summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2012-08-23 06:21:46 +0000
committerderaadt <deraadt@openbsd.org>2012-08-23 06:21:46 +0000
commit33822c12f294fd067c10b708bb8e7c0700e0bc0c (patch)
treefb969720ed2515730b6db60441f0ab6ab2c3fd7f /usr.sbin
parentknowledge of nnpfs can be removed (diff)
downloadwireguard-openbsd-33822c12f294fd067c10b708bb8e7c0700e0bc0c.tar.xz
wireguard-openbsd-33822c12f294fd067c10b708bb8e7c0700e0bc0c.zip
the afs src tree can go away
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/Makefile6
-rw-r--r--usr.sbin/afs/Makefile27
-rw-r--r--usr.sbin/afs/Makefile.inc31
-rw-r--r--usr.sbin/afs/include/arla-version.h2
-rw-r--r--usr.sbin/afs/include/atypes.h2
-rw-r--r--usr.sbin/afs/include/config.h1670
-rw-r--r--usr.sbin/afs/lib/Makefile5
-rw-r--r--usr.sbin/afs/lib/libarla/Makefile30
-rw-r--r--usr.sbin/afs/lib/libarla/Makefile.arla.inc8
-rw-r--r--usr.sbin/afs/lib/libarla/Makefile.bufdir.inc4
-rw-r--r--usr.sbin/afs/lib/libarla/Makefile.ko.inc37
-rw-r--r--usr.sbin/afs/lib/libarla/Makefile.lwp.inc40
-rw-r--r--usr.sbin/afs/lib/libarla/Makefile.rx.inc15
-rw-r--r--usr.sbin/afs/lib/libarla/Makefile.rxdef.inc28
-rw-r--r--usr.sbin/afs/lib/libarla/Makefile.rxkad.inc9
-rw-r--r--usr.sbin/afs/lib/libarla/Makefile.sl.inc4
-rw-r--r--usr.sbin/afs/lib/libarla/Makefile.util.inc7
-rw-r--r--usr.sbin/afs/libexec/Makefile5
-rw-r--r--usr.sbin/afs/libexec/afsd/Makefile54
-rw-r--r--usr.sbin/afs/src/.cvsignore5
-rw-r--r--usr.sbin/afs/src/.indent.pro29
-rw-r--r--usr.sbin/afs/src/ChangeLog1075
-rw-r--r--usr.sbin/afs/src/ChangeLog.19998348
-rw-r--r--usr.sbin/afs/src/ChangeLog.20002972
-rw-r--r--usr.sbin/afs/src/ChangeLog.20011849
-rw-r--r--usr.sbin/afs/src/ChangeLog.20022859
-rw-r--r--usr.sbin/afs/src/HACKING32
-rw-r--r--usr.sbin/afs/src/INSTALL425
-rw-r--r--usr.sbin/afs/src/LIESMICH195
-rw-r--r--usr.sbin/afs/src/Makefile.in56
-rw-r--r--usr.sbin/afs/src/NEWS707
-rw-r--r--usr.sbin/afs/src/README188
-rw-r--r--usr.sbin/afs/src/THANKS62
-rw-r--r--usr.sbin/afs/src/TODO90
-rw-r--r--usr.sbin/afs/src/acconfig.h36
-rw-r--r--usr.sbin/afs/src/acinclude.m49
-rw-r--r--usr.sbin/afs/src/appl/Makefile.in50
-rw-r--r--usr.sbin/afs/src/appl/aafs-perl/AAFS.pm56
-rw-r--r--usr.sbin/afs/src/appl/aafs-perl/AAFS.xs330
-rw-r--r--usr.sbin/afs/src/appl/aafs-perl/su/check-home.pl37
-rw-r--r--usr.sbin/afs/src/appl/aafs-perl/t/test.pl32
-rw-r--r--usr.sbin/afs/src/appl/aafs-perl/typemap4
-rw-r--r--usr.sbin/afs/src/appl/aafs/aafs_cell.h145
-rw-r--r--usr.sbin/afs/src/appl/aafs/aafs_conn.h61
-rw-r--r--usr.sbin/afs/src/appl/aafs/aafs_partition.h51
-rw-r--r--usr.sbin/afs/src/appl/aafs/aafs_private.h73
-rw-r--r--usr.sbin/afs/src/appl/aafs/aafs_security.h64
-rw-r--r--usr.sbin/afs/src/appl/aafs/aafs_vldb.h91
-rw-r--r--usr.sbin/afs/src/appl/aafs/aafs_volume.h179
-rw-r--r--usr.sbin/afs/src/appl/aafs/cell.c554
-rw-r--r--usr.sbin/afs/src/appl/aafs/conn.c143
-rw-r--r--usr.sbin/afs/src/appl/aafs/partition.c95
-rw-r--r--usr.sbin/afs/src/appl/aafs/security.c102
-rw-r--r--usr.sbin/afs/src/appl/aafs/test_aafs.c121
-rw-r--r--usr.sbin/afs/src/appl/aafs/vldb.c254
-rw-r--r--usr.sbin/afs/src/appl/aafs/volume.c583
-rw-r--r--usr.sbin/afs/src/appl/afsmgr/Makefile.in98
-rw-r--r--usr.sbin/afs/src/appl/afsmgr/afsaclmgr.in314
-rw-r--r--usr.sbin/afs/src/appl/afstool/afstool.1149
-rw-r--r--usr.sbin/afs/src/appl/afstool/afstool.c229
-rw-r--r--usr.sbin/afs/src/appl/afstool/at_cachemgr.c47
-rw-r--r--usr.sbin/afs/src/appl/afstool/at_cm_localcell.c101
-rw-r--r--usr.sbin/afs/src/appl/afstool/at_cm_whoareyou.c160
-rw-r--r--usr.sbin/afs/src/appl/afstool/at_fileserver.c49
-rw-r--r--usr.sbin/afs/src/appl/afstool/at_fs_flush_cps.c189
-rw-r--r--usr.sbin/afs/src/appl/afstool/at_fs_getcap.c145
-rw-r--r--usr.sbin/afs/src/appl/afstool/at_fs_gettime.c119
-rw-r--r--usr.sbin/afs/src/appl/afstool/at_locl.h108
-rw-r--r--usr.sbin/afs/src/appl/afstool/at_mini_cm.c197
-rw-r--r--usr.sbin/afs/src/appl/afstool/at_u_debug.c237
-rw-r--r--usr.sbin/afs/src/appl/afstool/at_ubik.c46
-rw-r--r--usr.sbin/afs/src/appl/afsutils/Makefile.in167
-rw-r--r--usr.sbin/afs/src/appl/afsutils/README.afsutils61
-rw-r--r--usr.sbin/afs/src/appl/afsutils/TODO.afsutils23
-rw-r--r--usr.sbin/afs/src/appl/afsutils/aklog.1119
-rw-r--r--usr.sbin/afs/src/appl/afsutils/aklog.c376
-rw-r--r--usr.sbin/afs/src/appl/afsutils/klog.1196
-rw-r--r--usr.sbin/afs/src/appl/afsutils/klog.c818
-rw-r--r--usr.sbin/afs/src/appl/afsutils/klog.ctx221
-rw-r--r--usr.sbin/afs/src/appl/afsutils/klog.h75
-rw-r--r--usr.sbin/afs/src/appl/afsutils/sys.c68
-rw-r--r--usr.sbin/afs/src/appl/afsutils/tokens.168
-rw-r--r--usr.sbin/afs/src/appl/afsutils/tokens.c228
-rw-r--r--usr.sbin/afs/src/appl/afsutils/tokens.h5
-rw-r--r--usr.sbin/afs/src/appl/afsutils/unlog.191
-rw-r--r--usr.sbin/afs/src/appl/afsutils/unlog.c276
-rw-r--r--usr.sbin/afs/src/appl/afsutils/unlog.h21
-rw-r--r--usr.sbin/afs/src/appl/afsutils/up.c163
-rw-r--r--usr.sbin/afs/src/appl/amon/Makefile.in121
-rw-r--r--usr.sbin/afs/src/appl/amon/amon.c474
-rw-r--r--usr.sbin/afs/src/appl/asrvutil/Makefile.in120
-rw-r--r--usr.sbin/afs/src/appl/asrvutil/README10
-rw-r--r--usr.sbin/afs/src/appl/asrvutil/asrvutil.c334
-rw-r--r--usr.sbin/afs/src/appl/bos/Makefile.in138
-rw-r--r--usr.sbin/afs/src/appl/bos/bos.8304
-rw-r--r--usr.sbin/afs/src/appl/bos/bos.c169
-rw-r--r--usr.sbin/afs/src/appl/bos/bos_addhost.c132
-rw-r--r--usr.sbin/afs/src/appl/bos/bos_adduser.c140
-rw-r--r--usr.sbin/afs/src/appl/bos/bos_getrestart.c135
-rw-r--r--usr.sbin/afs/src/appl/bos/bos_listhosts.c176
-rw-r--r--usr.sbin/afs/src/appl/bos/bos_listusers.c141
-rw-r--r--usr.sbin/afs/src/appl/bos/bos_local.h61
-rw-r--r--usr.sbin/afs/src/appl/bos/bos_removehost.c132
-rw-r--r--usr.sbin/afs/src/appl/bos/bos_restart.c135
-rw-r--r--usr.sbin/afs/src/appl/bos/bos_start.c135
-rw-r--r--usr.sbin/afs/src/appl/bos/bos_status.c200
-rw-r--r--usr.sbin/afs/src/appl/bos/bos_stop.c135
-rw-r--r--usr.sbin/afs/src/appl/fs/Makefile.in141
-rw-r--r--usr.sbin/afs/src/appl/fs/fs.1736
-rw-r--r--usr.sbin/afs/src/appl/fs/fs.c522
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_arladebug.c78
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_checkservers.c102
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_connect.c93
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_copyacl.c106
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_diskfree.c89
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_examine.c86
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_flush.c53
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_flushvol.c53
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_getcache.c98
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_getcellstat.c68
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_getfid.c78
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_getprio.c87
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_la.c211
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_listcell.c140
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_listquota.c111
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_local.h133
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_lsm.c60
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_mkm.c96
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_newcell.c87
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_nnpfsdebug.c213
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_quota.c83
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_rmm.c60
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_setacl.c167
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_setcache.c86
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_setcrypt.c75
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_setquota.c123
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_statistics.c272
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_strerror.c59
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_whereis.c92
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_whichcell.c79
-rw-r--r--usr.sbin/afs/src/appl/fs/fs_wscell.c62
-rw-r--r--usr.sbin/afs/src/appl/kalog/Makefile.in135
-rw-r--r--usr.sbin/afs/src/appl/kalog/kalog.157
-rw-r--r--usr.sbin/afs/src/appl/kalog/kalog.c128
-rw-r--r--usr.sbin/afs/src/appl/lib/Makefile.in119
-rw-r--r--usr.sbin/afs/src/appl/lib/appl_locl.h138
-rw-r--r--usr.sbin/afs/src/appl/lib/arlalib.c964
-rw-r--r--usr.sbin/afs/src/appl/lib/arlalib.h247
-rw-r--r--usr.sbin/afs/src/appl/lib/fs_lib.c1104
-rw-r--r--usr.sbin/afs/src/appl/lib/ka-procs.c633
-rw-r--r--usr.sbin/afs/src/appl/lib/ka-procs.h102
-rw-r--r--usr.sbin/afs/src/appl/lib/tokens.c113
-rw-r--r--usr.sbin/afs/src/appl/mac/Arla_Configuration/Controller.h48
-rw-r--r--usr.sbin/afs/src/appl/mac/Arla_Configuration/Controller.m394
-rw-r--r--usr.sbin/afs/src/appl/mac/Arla_Configuration/DataSource.h28
-rw-r--r--usr.sbin/afs/src/appl/mac/Arla_Configuration/DataSource.m704
-rw-r--r--usr.sbin/afs/src/appl/mac/Arla_Configuration/Info.plist.in26
-rw-r--r--usr.sbin/afs/src/appl/mac/Arla_Configuration/Makefile.in116
-rw-r--r--usr.sbin/afs/src/appl/mac/Arla_Configuration/PkgInfo1
-rw-r--r--usr.sbin/afs/src/appl/mac/Arla_Configuration/ReadCells.h9
-rw-r--r--usr.sbin/afs/src/appl/mac/Arla_Configuration/ReadCells.m88
-rw-r--r--usr.sbin/afs/src/appl/mac/Arla_Configuration/arla.icnsbin17174 -> 0 bytes
-rw-r--r--usr.sbin/afs/src/appl/mac/Arla_Configuration/dialog.nib/classes.nib80
-rw-r--r--usr.sbin/afs/src/appl/mac/Arla_Configuration/dialog.nib/info.nib32
-rw-r--r--usr.sbin/afs/src/appl/mac/Arla_Configuration/dialog.nib/objects.nibbin13194 -> 0 bytes
-rw-r--r--usr.sbin/afs/src/appl/mac/Arla_Configuration/lock.tiffbin2354 -> 0 bytes
-rw-r--r--usr.sbin/afs/src/appl/mac/Arla_Configuration/main.m6
-rw-r--r--usr.sbin/afs/src/appl/mac/Arla_Configuration/unlock.tiffbin2354 -> 0 bytes
-rw-r--r--usr.sbin/afs/src/appl/mac/Makefile.in50
-rw-r--r--usr.sbin/afs/src/appl/mac/make-mac-package.sh78
-rw-r--r--usr.sbin/afs/src/appl/perf/afsfsperf.c912
-rw-r--r--usr.sbin/afs/src/appl/pts/Makefile.in138
-rw-r--r--usr.sbin/afs/src/appl/pts/pts.1290
-rw-r--r--usr.sbin/afs/src/appl/pts/pts.c1562
-rw-r--r--usr.sbin/afs/src/appl/udebug/Makefile.in138
-rw-r--r--usr.sbin/afs/src/appl/udebug/udebug.192
-rw-r--r--usr.sbin/afs/src/appl/udebug/udebug.c291
-rw-r--r--usr.sbin/afs/src/appl/udebug/udebug.in82
-rw-r--r--usr.sbin/afs/src/appl/vos/Makefile.in146
-rw-r--r--usr.sbin/afs/src/appl/vos/vos.8470
-rw-r--r--usr.sbin/afs/src/appl/vos/vos.c169
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_backup.c331
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_common.c323
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_createentry.c160
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_createvolume.c304
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_dump.c208
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_endtrans.c165
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_examine.c385
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_listaddrs.c218
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_listpart.c121
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_listvldb.c248
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_listvol.c147
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_local.h88
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_lock.c171
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_partinfo.c173
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_status.c169
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_syncsite.c97
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_unlock.c172
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_vldbexamine.c197
-rw-r--r--usr.sbin/afs/src/appl/vos/vos_zap.c176
-rw-r--r--usr.sbin/afs/src/arlad/.gdbinit241
-rw-r--r--usr.sbin/afs/src/arlad/AliasDB.580
-rw-r--r--usr.sbin/afs/src/arlad/CellServDB.585
-rw-r--r--usr.sbin/afs/src/arlad/DynRootDB.576
-rw-r--r--usr.sbin/afs/src/arlad/Makefile.in233
-rw-r--r--usr.sbin/afs/src/arlad/SuidCells.558
-rw-r--r--usr.sbin/afs/src/arlad/ThisCell.566
-rw-r--r--usr.sbin/afs/src/arlad/adir.c244
-rw-r--r--usr.sbin/afs/src/arlad/adir.h79
-rw-r--r--usr.sbin/afs/src/arlad/afsdir_check.c332
-rw-r--r--usr.sbin/afs/src/arlad/arla-cli.880
-rw-r--r--usr.sbin/afs/src/arlad/arla-cli.c1082
-rw-r--r--usr.sbin/afs/src/arlad/arla.c474
-rw-r--r--usr.sbin/afs/src/arlad/arla.conf.5105
-rw-r--r--usr.sbin/afs/src/arlad/arla_local.h227
-rw-r--r--usr.sbin/afs/src/arlad/arlad.8203
-rw-r--r--usr.sbin/afs/src/arlad/arlad.c292
-rw-r--r--usr.sbin/afs/src/arlad/arladeb.c217
-rw-r--r--usr.sbin/afs/src/arlad/arladeb.h135
-rw-r--r--usr.sbin/afs/src/arlad/arladeb2.c89
-rw-r--r--usr.sbin/afs/src/arlad/arladebu.c78
-rw-r--r--usr.sbin/afs/src/arlad/bsd-subr.c194
-rw-r--r--usr.sbin/afs/src/arlad/cmcb.c376
-rw-r--r--usr.sbin/afs/src/arlad/cmcb.h42
-rw-r--r--usr.sbin/afs/src/arlad/conn.c884
-rw-r--r--usr.sbin/afs/src/arlad/conn.h136
-rw-r--r--usr.sbin/afs/src/arlad/cred.c433
-rw-r--r--usr.sbin/afs/src/arlad/cred.h132
-rw-r--r--usr.sbin/afs/src/arlad/d-trans.c310
-rw-r--r--usr.sbin/afs/src/arlad/darla.c104
-rw-r--r--usr.sbin/afs/src/arlad/darla.h50
-rw-r--r--usr.sbin/afs/src/arlad/disco.c503
-rw-r--r--usr.sbin/afs/src/arlad/disco.h217
-rw-r--r--usr.sbin/afs/src/arlad/dump_state.c132
-rw-r--r--usr.sbin/afs/src/arlad/dynroot.c430
-rw-r--r--usr.sbin/afs/src/arlad/dynroot.h56
-rw-r--r--usr.sbin/afs/src/arlad/fcache.c4987
-rw-r--r--usr.sbin/afs/src/arlad/fcache.h384
-rw-r--r--usr.sbin/afs/src/arlad/fprio.c292
-rw-r--r--usr.sbin/afs/src/arlad/fprio.h64
-rw-r--r--usr.sbin/afs/src/arlad/fs_errors.h108
-rw-r--r--usr.sbin/afs/src/arlad/hpux-subr.c158
-rw-r--r--usr.sbin/afs/src/arlad/inter.c1103
-rw-r--r--usr.sbin/afs/src/arlad/inter.h123
-rw-r--r--usr.sbin/afs/src/arlad/irix-subr.c145
-rw-r--r--usr.sbin/afs/src/arlad/kernel.c427
-rw-r--r--usr.sbin/afs/src/arlad/kernel.h62
-rw-r--r--usr.sbin/afs/src/arlad/messages.c4348
-rw-r--r--usr.sbin/afs/src/arlad/messages.h74
-rw-r--r--usr.sbin/afs/src/arlad/nnpfs.c540
-rw-r--r--usr.sbin/afs/src/arlad/nnpfs.h68
-rw-r--r--usr.sbin/afs/src/arlad/play_disco.c57
-rw-r--r--usr.sbin/afs/src/arlad/poller.c340
-rw-r--r--usr.sbin/afs/src/arlad/poller.h67
-rw-r--r--usr.sbin/afs/src/arlad/ptest.c136
-rw-r--r--usr.sbin/afs/src/arlad/reconnect.h41
-rw-r--r--usr.sbin/afs/src/arlad/service.h51
-rw-r--r--usr.sbin/afs/src/arlad/state.c251
-rw-r--r--usr.sbin/afs/src/arlad/state.h122
-rw-r--r--usr.sbin/afs/src/arlad/stats.c293
-rw-r--r--usr.sbin/afs/src/arlad/stats.h73
-rw-r--r--usr.sbin/afs/src/arlad/subr.c127
-rw-r--r--usr.sbin/afs/src/arlad/subr.h80
-rw-r--r--usr.sbin/afs/src/arlad/unknown-subr.c62
-rw-r--r--usr.sbin/afs/src/arlad/volcache.c1314
-rw-r--r--usr.sbin/afs/src/arlad/volcache.h159
-rw-r--r--usr.sbin/afs/src/arlad/xfs.c538
-rw-r--r--usr.sbin/afs/src/arlad/xfs.h69
-rw-r--r--usr.sbin/afs/src/cf/auth-modules.m427
-rw-r--r--usr.sbin/afs/src/cf/broken-glob.m422
-rw-r--r--usr.sbin/afs/src/cf/broken-snprintf.m458
-rw-r--r--usr.sbin/afs/src/cf/broken.m419
-rw-r--r--usr.sbin/afs/src/cf/bsd-func-lockmgr.m424
-rw-r--r--usr.sbin/afs/src/cf/bsd-func-lockstatus.m449
-rw-r--r--usr.sbin/afs/src/cf/bsd-func-selrecord.m425
-rw-r--r--usr.sbin/afs/src/cf/bsd-func-suser.m424
-rw-r--r--usr.sbin/afs/src/cf/bsd-func-vfs-getnewfsid.m427
-rw-r--r--usr.sbin/afs/src/cf/bsd-header-vnode-if-h.m441
-rw-r--r--usr.sbin/afs/src/cf/bsd-uvm-only.m434
-rw-r--r--usr.sbin/afs/src/cf/bsd-vfs-busy.m466
-rw-r--r--usr.sbin/afs/src/cf/bsd-vfs-object-create.m428
-rw-r--r--usr.sbin/afs/src/cf/bsd-vget.m466
-rw-r--r--usr.sbin/afs/src/cf/bsd-vop-lock.m463
-rw-r--r--usr.sbin/afs/src/cf/c-attribute.m440
-rw-r--r--usr.sbin/afs/src/cf/c-function.m433
-rw-r--r--usr.sbin/afs/src/cf/check-declaration.m425
-rw-r--r--usr.sbin/afs/src/cf/check-dirsiz.m445
-rw-r--r--usr.sbin/afs/src/cf/check-getpwnam_r-posix.m424
-rw-r--r--usr.sbin/afs/src/cf/check-glibc.m422
-rw-r--r--usr.sbin/afs/src/cf/check-kafs.m455
-rw-r--r--usr.sbin/afs/src/cf/check-kerberos.m4488
-rw-r--r--usr.sbin/afs/src/cf/check-kernel-func.m411
-rw-r--r--usr.sbin/afs/src/cf/check-kernel-funcs.m415
-rw-r--r--usr.sbin/afs/src/cf/check-kernel-var.m411
-rw-r--r--usr.sbin/afs/src/cf/check-kernel-vop-t.m417
-rw-r--r--usr.sbin/afs/src/cf/check-kernel.m466
-rw-r--r--usr.sbin/afs/src/cf/check-lfs.m431
-rw-r--r--usr.sbin/afs/src/cf/check-man.m459
-rw-r--r--usr.sbin/afs/src/cf/check-roken.m484
-rw-r--r--usr.sbin/afs/src/cf/check-type-extra.m423
-rw-r--r--usr.sbin/afs/src/cf/check-var.m420
-rw-r--r--usr.sbin/afs/src/cf/check-x.m452
-rw-r--r--usr.sbin/afs/src/cf/check-xau.m454
-rw-r--r--usr.sbin/afs/src/cf/elf-object-format.m415
-rw-r--r--usr.sbin/afs/src/cf/find-func-no-libs.m49
-rw-r--r--usr.sbin/afs/src/cf/find-func-no-libs2.m463
-rw-r--r--usr.sbin/afs/src/cf/find-func.m49
-rw-r--r--usr.sbin/afs/src/cf/find-if-not-broken.m413
-rw-r--r--usr.sbin/afs/src/cf/func-getvfsbyname.m424
-rw-r--r--usr.sbin/afs/src/cf/func-hstrerror-const.m418
-rw-r--r--usr.sbin/afs/src/cf/func-krb-get-default-principal.m430
-rw-r--r--usr.sbin/afs/src/cf/func-krb-get-default-tkt-root.m431
-rw-r--r--usr.sbin/afs/src/cf/func-krb-get-err-text.m428
-rw-r--r--usr.sbin/afs/src/cf/func-krb-kdctimeofday.m431
-rw-r--r--usr.sbin/afs/src/cf/func-ntohl.m438
-rw-r--r--usr.sbin/afs/src/cf/grok-type.m435
-rw-r--r--usr.sbin/afs/src/cf/have-def.m419
-rw-r--r--usr.sbin/afs/src/cf/have-kernel-struct-field.m419
-rw-r--r--usr.sbin/afs/src/cf/have-linux-kernel-type.m424
-rw-r--r--usr.sbin/afs/src/cf/have-linux-kernel-types.m414
-rw-r--r--usr.sbin/afs/src/cf/have-pragma-weak.m437
-rw-r--r--usr.sbin/afs/src/cf/have-struct-field.m419
-rw-r--r--usr.sbin/afs/src/cf/have-type.m432
-rw-r--r--usr.sbin/afs/src/cf/have-types.m414
-rw-r--r--usr.sbin/afs/src/cf/header-dirent-dir-h.m421
-rw-r--r--usr.sbin/afs/src/cf/kernel-have-def.m419
-rw-r--r--usr.sbin/afs/src/cf/kernel-need-proto.m414
-rw-r--r--usr.sbin/afs/src/cf/kernel.m419
-rw-r--r--usr.sbin/afs/src/cf/krb-bigendian.m453
-rw-r--r--usr.sbin/afs/src/cf/krb-find-db.m489
-rw-r--r--usr.sbin/afs/src/cf/krb-func-getcwd-broken.m442
-rw-r--r--usr.sbin/afs/src/cf/krb-func-getlogin.m423
-rw-r--r--usr.sbin/afs/src/cf/krb-ipv6.m4122
-rw-r--r--usr.sbin/afs/src/cf/krb-prog-ln-s.m428
-rw-r--r--usr.sbin/afs/src/cf/krb-prog-ranlib.m48
-rw-r--r--usr.sbin/afs/src/cf/krb-prog-yacc.m48
-rw-r--r--usr.sbin/afs/src/cf/krb-struct-sockaddr-sa-len.m422
-rw-r--r--usr.sbin/afs/src/cf/krb-struct-spwd.m422
-rw-r--r--usr.sbin/afs/src/cf/krb-struct-winsize.m427
-rw-r--r--usr.sbin/afs/src/cf/krb-sys-aix.m415
-rw-r--r--usr.sbin/afs/src/cf/krb-sys-nextstep.m422
-rw-r--r--usr.sbin/afs/src/cf/krb-version.m425
-rw-r--r--usr.sbin/afs/src/cf/linux-d_delete-void.m426
-rw-r--r--usr.sbin/afs/src/cf/linux-filldir-dt-type.m421
-rw-r--r--usr.sbin/afs/src/cf/linux-func-d_alloc_root-two_args.m421
-rw-r--r--usr.sbin/afs/src/cf/linux-func-devfs-register-eleven-args.m419
-rw-r--r--usr.sbin/afs/src/cf/linux-func-dget-locked.m420
-rw-r--r--usr.sbin/afs/src/cf/linux-func-init-mutex.m423
-rw-r--r--usr.sbin/afs/src/cf/linux-func-init-wait-queue-head.m421
-rw-r--r--usr.sbin/afs/src/cf/linux-func-list-del-init.m420
-rw-r--r--usr.sbin/afs/src/cf/linux-type-wait-queue-head.m416
-rw-r--r--usr.sbin/afs/src/cf/linux-type-wait-queue-task-list.m419
-rw-r--r--usr.sbin/afs/src/cf/mips-abi.m487
-rw-r--r--usr.sbin/afs/src/cf/misc.m43
-rw-r--r--usr.sbin/afs/src/cf/need-proto.m425
-rw-r--r--usr.sbin/afs/src/cf/osf-func-ubc-lookup.m424
-rw-r--r--usr.sbin/afs/src/cf/osf-func-vfs-name-hash.m447
-rw-r--r--usr.sbin/afs/src/cf/osfc2.m414
-rw-r--r--usr.sbin/afs/src/cf/prog-cc-flags.m415
-rw-r--r--usr.sbin/afs/src/cf/proto-compat.m422
-rw-r--r--usr.sbin/afs/src/cf/shared-libs.m4186
-rw-r--r--usr.sbin/afs/src/cf/test-package.m488
-rw-r--r--usr.sbin/afs/src/cf/try-compile-kernel.m415
-rw-r--r--usr.sbin/afs/src/cf/try-cpp-kernel.m410
-rw-r--r--usr.sbin/afs/src/cf/type-iovec.m423
-rw-r--r--usr.sbin/afs/src/cf/type-krb-principal.m426
-rw-r--r--usr.sbin/afs/src/cf/type-msghdr.m419
-rw-r--r--usr.sbin/afs/src/cf/wflags.m421
-rw-r--r--usr.sbin/afs/src/conf/CellServDB728
-rw-r--r--usr.sbin/afs/src/conf/Makefile.in60
-rw-r--r--usr.sbin/afs/src/conf/SuidCells0
-rw-r--r--usr.sbin/afs/src/conf/ThisCell1
-rw-r--r--usr.sbin/afs/src/conf/arla.conf48
-rw-r--r--usr.sbin/afs/src/conf/arla.conf.in62
-rw-r--r--usr.sbin/afs/src/conf/arla.spec.in134
-rw-r--r--usr.sbin/afs/src/conf/bos.conf40
-rw-r--r--usr.sbin/afs/src/conf/check-cellservdb.pl190
-rw-r--r--usr.sbin/afs/src/conf/freebsd/freebsd4-rc.arla64
-rw-r--r--usr.sbin/afs/src/conf/services13
-rw-r--r--usr.sbin/afs/src/config.guess1276
-rw-r--r--usr.sbin/afs/src/config.sub1417
-rw-r--r--usr.sbin/afs/src/configure.in1937
-rw-r--r--usr.sbin/afs/src/doc/Makefile.in195
-rw-r--r--usr.sbin/afs/src/doc/ack.texi191
-rw-r--r--usr.sbin/afs/src/doc/ack.texi.in39
-rw-r--r--usr.sbin/afs/src/doc/afs-basics.texi262
-rw-r--r--usr.sbin/afs/src/doc/arla-logo.eps1
-rw-r--r--usr.sbin/afs/src/doc/arla.info2408
-rw-r--r--usr.sbin/afs/src/doc/arla.texi381
-rw-r--r--usr.sbin/afs/src/doc/authors.texi40
-rw-r--r--usr.sbin/afs/src/doc/caching-in-blocks107
-rw-r--r--usr.sbin/afs/src/doc/debugging.texi337
-rw-r--r--usr.sbin/afs/src/doc/index.texi11
-rw-r--r--usr.sbin/afs/src/doc/intro.texi110
-rw-r--r--usr.sbin/afs/src/doc/latin1.tex95
-rw-r--r--usr.sbin/afs/src/doc/milko1.fig111
-rw-r--r--usr.sbin/afs/src/doc/nnpfs.txt498
-rw-r--r--usr.sbin/afs/src/doc/oddities.texi44
-rw-r--r--usr.sbin/afs/src/doc/partsofarla.texi366
-rw-r--r--usr.sbin/afs/src/doc/pioctl.texi104
-rw-r--r--usr.sbin/afs/src/doc/porting.texi188
-rw-r--r--usr.sbin/afs/src/doc/prog-disco.texi240
-rw-r--r--usr.sbin/afs/src/doc/prog.texi58
-rw-r--r--usr.sbin/afs/src/doc/real-world.texi279
-rw-r--r--usr.sbin/afs/src/doc/servers.texi50
-rw-r--r--usr.sbin/afs/src/doc/storage.texi218
-rw-r--r--usr.sbin/afs/src/doc/timeline.texi101
-rw-r--r--usr.sbin/afs/src/doc/tools.texi30
-rw-r--r--usr.sbin/afs/src/doc/xfs.txt380
-rw-r--r--usr.sbin/afs/src/include/.cvsignore1
-rw-r--r--usr.sbin/afs/src/include/Makefile.in139
-rw-r--r--usr.sbin/afs/src/include/afssysdefs.h107
-rw-r--r--usr.sbin/afs/src/include/arla-version.h2
-rw-r--r--usr.sbin/afs/src/include/bits.c209
-rw-r--r--usr.sbin/afs/src/include/config.h1074
-rw-r--r--usr.sbin/afs/src/include/config.h.in1668
-rw-r--r--usr.sbin/afs/src/include/kafs.h432
-rw-r--r--usr.sbin/afs/src/include/netbsd-lkm/foo.c10
-rw-r--r--usr.sbin/afs/src/include/stds.h60
-rw-r--r--usr.sbin/afs/src/install-sh250
-rw-r--r--usr.sbin/afs/src/lib/Makefile.in47
-rw-r--r--usr.sbin/afs/src/lib/bufdir/Makefile.in96
-rw-r--r--usr.sbin/afs/src/lib/bufdir/afs_dir.h107
-rw-r--r--usr.sbin/afs/src/lib/bufdir/fbuf.c542
-rw-r--r--usr.sbin/afs/src/lib/bufdir/fbuf.h74
-rw-r--r--usr.sbin/afs/src/lib/bufdir/fdir.c666
-rw-r--r--usr.sbin/afs/src/lib/bufdir/fdir.h89
-rw-r--r--usr.sbin/afs/src/lib/bufdir/fids.h55
-rw-r--r--usr.sbin/afs/src/lib/cmd/Makefile.in123
-rw-r--r--usr.sbin/afs/src/lib/cmd/cmd.3271
-rw-r--r--usr.sbin/afs/src/lib/cmd/cmd.c1021
-rw-r--r--usr.sbin/afs/src/lib/cmd/cmd.h136
-rw-r--r--usr.sbin/afs/src/lib/cmd/frame.ctx48
-rw-r--r--usr.sbin/afs/src/lib/cmd/testc.c145
-rw-r--r--usr.sbin/afs/src/lib/cmd/testc.ctx121
-rw-r--r--usr.sbin/afs/src/lib/ko/Makefile.in165
-rw-r--r--usr.sbin/afs/src/lib/ko/afs_uuid.c455
-rw-r--r--usr.sbin/afs/src/lib/ko/afs_uuid.h55
-rw-r--r--usr.sbin/afs/src/lib/ko/afsconf.c117
-rw-r--r--usr.sbin/afs/src/lib/ko/agetarg.c608
-rw-r--r--usr.sbin/afs/src/lib/ko/agetarg.h85
-rw-r--r--usr.sbin/afs/src/lib/ko/ares.c220
-rw-r--r--usr.sbin/afs/src/lib/ko/auth.c159
-rw-r--r--usr.sbin/afs/src/lib/ko/auth.h74
-rw-r--r--usr.sbin/afs/src/lib/ko/cellconfig.h77
-rw-r--r--usr.sbin/afs/src/lib/ko/gensysname.c317
-rw-r--r--usr.sbin/afs/src/lib/ko/ko.h153
-rw-r--r--usr.sbin/afs/src/lib/ko/ko_locl.h94
-rw-r--r--usr.sbin/afs/src/lib/ko/kocell.c1316
-rw-r--r--usr.sbin/afs/src/lib/ko/koerror.c321
-rw-r--r--usr.sbin/afs/src/lib/ko/kotest.c80
-rw-r--r--usr.sbin/afs/src/lib/ko/misc.c52
-rw-r--r--usr.sbin/afs/src/lib/ko/part.c98
-rw-r--r--usr.sbin/afs/src/lib/ko/part.h37
-rw-r--r--usr.sbin/afs/src/lib/ko/ports.c125
-rw-r--r--usr.sbin/afs/src/lib/ko/ports.h50
-rw-r--r--usr.sbin/afs/src/lib/ko/resnull.c57
-rw-r--r--usr.sbin/afs/src/lib/ko/resolve.c134
-rw-r--r--usr.sbin/afs/src/lib/ko/restest.c82
-rw-r--r--usr.sbin/afs/src/lib/ko/reswinnt.c131
-rw-r--r--usr.sbin/afs/src/lib/ko/slcompat.c52
-rw-r--r--usr.sbin/afs/src/lib/ko/uae.c475
-rw-r--r--usr.sbin/afs/src/lib/ko/uae.h173
-rw-r--r--usr.sbin/afs/src/lib/ko/vlmisc.c220
-rw-r--r--usr.sbin/afs/src/lib/sl/ChangeLog156
-rw-r--r--usr.sbin/afs/src/lib/sl/Makefile.in125
-rw-r--r--usr.sbin/afs/src/lib/sl/lex.l119
-rw-r--r--usr.sbin/afs/src/lib/sl/make_cmds.c240
-rw-r--r--usr.sbin/afs/src/lib/sl/make_cmds.h76
-rw-r--r--usr.sbin/afs/src/lib/sl/parse.y167
-rw-r--r--usr.sbin/afs/src/lib/sl/roken_rename.h67
-rw-r--r--usr.sbin/afs/src/lib/sl/sl.c325
-rw-r--r--usr.sbin/afs/src/lib/sl/sl.h60
-rw-r--r--usr.sbin/afs/src/lib/sl/sl_locl.h46
-rw-r--r--usr.sbin/afs/src/lib/sl/ss.c136
-rw-r--r--usr.sbin/afs/src/lib/sl/ss.h55
-rw-r--r--usr.sbin/afs/src/lib/vers/make-print-version.c58
-rw-r--r--usr.sbin/afs/src/lib/vers/print_version.c56
-rw-r--r--usr.sbin/afs/src/lib/vers/vers.h41
-rw-r--r--usr.sbin/afs/src/lwp/LICENSE.s39039
-rw-r--r--usr.sbin/afs/src/lwp/Makefile.in120
-rw-r--r--usr.sbin/afs/src/lwp/fasttime.c160
-rw-r--r--usr.sbin/afs/src/lwp/iomgr.c863
-rw-r--r--usr.sbin/afs/src/lwp/lock.c254
-rw-r--r--usr.sbin/afs/src/lwp/lock.h308
-rw-r--r--usr.sbin/afs/src/lwp/lwp_asm.c1189
-rw-r--r--usr.sbin/afs/src/lwp/lwp_asm.h230
-rw-r--r--usr.sbin/afs/src/lwp/lwp_elf.h29
-rw-r--r--usr.sbin/afs/src/lwp/make-process.o.sh.in180
-rw-r--r--usr.sbin/afs/src/lwp/plwp.c1141
-rw-r--r--usr.sbin/afs/src/lwp/plwp.h213
-rw-r--r--usr.sbin/afs/src/lwp/preempt.c162
-rw-r--r--usr.sbin/afs/src/lwp/preempt.h48
-rw-r--r--usr.sbin/afs/src/lwp/process-vpp.s171
-rw-r--r--usr.sbin/afs/src/lwp/process.aix22.S120
-rw-r--r--usr.sbin/afs/src/lwp/process.alpha.S205
-rw-r--r--usr.sbin/afs/src/lwp/process.arm.S103
-rw-r--r--usr.sbin/afs/src/lwp/process.hpux.S436
-rw-r--r--usr.sbin/afs/src/lwp/process.i386.S111
-rw-r--r--usr.sbin/afs/src/lwp/process.ibm032.S109
-rw-r--r--usr.sbin/afs/src/lwp/process.m68k.S125
-rw-r--r--usr.sbin/afs/src/lwp/process.m88k.S110
-rw-r--r--usr.sbin/afs/src/lwp/process.mips.S233
-rw-r--r--usr.sbin/afs/src/lwp/process.patch.S80
-rw-r--r--usr.sbin/afs/src/lwp/process.ppc.S207
-rw-r--r--usr.sbin/afs/src/lwp/process.rios.S179
-rw-r--r--usr.sbin/afs/src/lwp/process.s390.S115
-rw-r--r--usr.sbin/afs/src/lwp/process.sh.S135
-rw-r--r--usr.sbin/afs/src/lwp/process.sparc.S547
-rw-r--r--usr.sbin/afs/src/lwp/process.vax.S101
-rw-r--r--usr.sbin/afs/src/lwp/process.x86_64.S163
-rw-r--r--usr.sbin/afs/src/lwp/q.c55
-rw-r--r--usr.sbin/afs/src/lwp/q.h4
-rw-r--r--usr.sbin/afs/src/lwp/rw.c258
-rw-r--r--usr.sbin/afs/src/lwp/testlwp.c412
-rw-r--r--usr.sbin/afs/src/lwp/testprocess.c22
-rw-r--r--usr.sbin/afs/src/lwp/timer.c265
-rw-r--r--usr.sbin/afs/src/lwp/timer.h80
-rw-r--r--usr.sbin/afs/src/make-release26
-rw-r--r--usr.sbin/afs/src/make-release.el25
-rw-r--r--usr.sbin/afs/src/milko/ChangeLog1704
-rw-r--r--usr.sbin/afs/src/milko/Makefile.in49
-rw-r--r--usr.sbin/afs/src/milko/README196
-rw-r--r--usr.sbin/afs/src/milko/appl/Makefile.in49
-rw-r--r--usr.sbin/afs/src/milko/appl/bootstrap/Makefile.in59
-rw-r--r--usr.sbin/afs/src/milko/appl/bootstrap/anti-boot-strap.sh.in48
-rw-r--r--usr.sbin/afs/src/milko/appl/bootstrap/boot-strap.sh.in149
-rw-r--r--usr.sbin/afs/src/milko/appl/perf/Makefile.in113
-rw-r--r--usr.sbin/afs/src/milko/appl/perf/perf.c676
-rw-r--r--usr.sbin/afs/src/milko/appl/sked/Makefile.in125
-rw-r--r--usr.sbin/afs/src/milko/appl/sked/sked.c807
-rw-r--r--usr.sbin/afs/src/milko/bos/Makefile.in120
-rw-r--r--usr.sbin/afs/src/milko/bos/bos_locl.h76
-rw-r--r--usr.sbin/afs/src/milko/bos/bosprocs.c515
-rw-r--r--usr.sbin/afs/src/milko/bos/bosserver.c670
-rw-r--r--usr.sbin/afs/src/milko/bos/kconf.c800
-rw-r--r--usr.sbin/afs/src/milko/bos/kconf.h210
-rw-r--r--usr.sbin/afs/src/milko/fs/Makefile.in142
-rw-r--r--usr.sbin/afs/src/milko/fs/connsec.c262
-rw-r--r--usr.sbin/afs/src/milko/fs/connsec.h47
-rw-r--r--usr.sbin/afs/src/milko/fs/dump.c919
-rw-r--r--usr.sbin/afs/src/milko/fs/dump.h119
-rw-r--r--usr.sbin/afs/src/milko/fs/fileserver.c247
-rw-r--r--usr.sbin/afs/src/milko/fs/fs_def.h54
-rw-r--r--usr.sbin/afs/src/milko/fs/fsprocs.c1758
-rw-r--r--usr.sbin/afs/src/milko/fs/fsrv_locl.h99
-rw-r--r--usr.sbin/afs/src/milko/fs/volprocs.c1304
-rw-r--r--usr.sbin/afs/src/milko/include/mdebug.h70
-rw-r--r--usr.sbin/afs/src/milko/lib/Makefile.in49
-rw-r--r--usr.sbin/afs/src/milko/lib/dpart/Makefile.in104
-rw-r--r--usr.sbin/afs/src/milko/lib/dpart/dpart.c308
-rw-r--r--usr.sbin/afs/src/milko/lib/dpart/dpart.h74
-rw-r--r--usr.sbin/afs/src/milko/lib/mdb/mdb.c83
-rw-r--r--usr.sbin/afs/src/milko/lib/mdb/mdb.h61
-rw-r--r--usr.sbin/afs/src/milko/lib/mdb/mdb_locl.h43
-rw-r--r--usr.sbin/afs/src/milko/lib/mdb/ndbm.c170
-rw-r--r--usr.sbin/afs/src/milko/lib/mlog/Makefile.in105
-rw-r--r--usr.sbin/afs/src/milko/lib/mlog/mdebug.c66
-rw-r--r--usr.sbin/afs/src/milko/lib/mlog/mdebug.h73
-rw-r--r--usr.sbin/afs/src/milko/lib/mlog/mlog.c196
-rw-r--r--usr.sbin/afs/src/milko/lib/mlog/mlog.h110
-rw-r--r--usr.sbin/afs/src/milko/lib/msecurity/Makefile.in104
-rw-r--r--usr.sbin/afs/src/milko/lib/msecurity/msecurity.c161
-rw-r--r--usr.sbin/afs/src/milko/lib/msecurity/msecurity.h50
-rw-r--r--usr.sbin/afs/src/milko/lib/msecurity/netinit.c240
-rw-r--r--usr.sbin/afs/src/milko/lib/msecurity/netinit.h49
-rw-r--r--usr.sbin/afs/src/milko/lib/ropa/Makefile.in109
-rw-r--r--usr.sbin/afs/src/milko/lib/ropa/README79
-rw-r--r--usr.sbin/afs/src/milko/lib/ropa/ropa.c1422
-rw-r--r--usr.sbin/afs/src/milko/lib/ropa/ropa.h56
-rw-r--r--usr.sbin/afs/src/milko/lib/vld/Makefile.in111
-rw-r--r--usr.sbin/afs/src/milko/lib/vld/common.c250
-rw-r--r--usr.sbin/afs/src/milko/lib/vld/debug.c63
-rw-r--r--usr.sbin/afs/src/milko/lib/vld/fvol.c347
-rw-r--r--usr.sbin/afs/src/milko/lib/vld/fvol.h49
-rw-r--r--usr.sbin/afs/src/milko/lib/vld/glue.c235
-rw-r--r--usr.sbin/afs/src/milko/lib/vld/mdir.c343
-rw-r--r--usr.sbin/afs/src/milko/lib/vld/mdir.h81
-rw-r--r--usr.sbin/afs/src/milko/lib/vld/mnode.c304
-rw-r--r--usr.sbin/afs/src/milko/lib/vld/mnode.h110
-rw-r--r--usr.sbin/afs/src/milko/lib/vld/salvage.c801
-rw-r--r--usr.sbin/afs/src/milko/lib/vld/salvage.h43
-rw-r--r--usr.sbin/afs/src/milko/lib/vld/sfvol_private.h64
-rw-r--r--usr.sbin/afs/src/milko/lib/vld/svol.c126
-rw-r--r--usr.sbin/afs/src/milko/lib/vld/svol.h1
-rw-r--r--usr.sbin/afs/src/milko/lib/vld/vld.c2526
-rw-r--r--usr.sbin/afs/src/milko/lib/vld/vld.h341
-rw-r--r--usr.sbin/afs/src/milko/lib/vld/vld_ops.h24
-rw-r--r--usr.sbin/afs/src/milko/lib/voldb/Makefile.in107
-rw-r--r--usr.sbin/afs/src/milko/lib/voldb/vdb_flat.c1010
-rw-r--r--usr.sbin/afs/src/milko/lib/voldb/vol.c264
-rw-r--r--usr.sbin/afs/src/milko/lib/voldb/voldb.c522
-rw-r--r--usr.sbin/afs/src/milko/lib/voldb/voldb.h241
-rw-r--r--usr.sbin/afs/src/milko/lib/voldb/voldb_internal.h130
-rw-r--r--usr.sbin/afs/src/milko/lib/voldb/voldb_locl.h67
-rw-r--r--usr.sbin/afs/src/milko/lib/vstatus/Makefile.in106
-rw-r--r--usr.sbin/afs/src/milko/lib/vstatus/vstat.xg62
-rw-r--r--usr.sbin/afs/src/milko/lib/vstatus/vstatus.c172
-rw-r--r--usr.sbin/afs/src/milko/lib/vstatus/vstatus.h46
-rw-r--r--usr.sbin/afs/src/milko/pts/Makefile.in118
-rw-r--r--usr.sbin/afs/src/milko/pts/pr.c486
-rw-r--r--usr.sbin/afs/src/milko/pts/ptserver.c870
-rw-r--r--usr.sbin/afs/src/milko/pts/ptserver.h88
-rw-r--r--usr.sbin/afs/src/milko/vldb/Makefile.in126
-rw-r--r--usr.sbin/afs/src/milko/vldb/ubikprocs.c96
-rw-r--r--usr.sbin/afs/src/milko/vldb/vl_db.c351
-rw-r--r--usr.sbin/afs/src/milko/vldb/vl_disk.c159
-rw-r--r--usr.sbin/afs/src/milko/vldb/vldb_locl.h113
-rw-r--r--usr.sbin/afs/src/milko/vldb/vldbserver.c889
-rw-r--r--usr.sbin/afs/src/milko/vldb/vled.c449
-rw-r--r--usr.sbin/afs/src/mkinstalldirs40
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/Info.plist.in31
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/bin/getmntopts.c95
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/bin/mntopts.h104
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/bin/mount_locl.h86
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/bin/mount_nnpfs.842
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/bin/mount_nnpfs.c105
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/bin/nnpfs.426
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/bin/nnpfs_kld_makedev5
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/bin/nnpfs_makedev5
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/bin/startarla.in51
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/bin/umount_nnpfs.830
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/bin/umount_nnpfs.c74
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_common.h79
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_deb.h60
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_dev.h161
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_fs.h96
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_locl.h422
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_msg_locl.h87
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_node.h161
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_syscalls.h92
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_vfsops-bsd.h103
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_vfsops.h75
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_vnodeops.h220
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_wrap.h41
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs_common-bsd.c108
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs_common.c69
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs_deb.c55
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs_dev-bsd.c339
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs_dev-common.c736
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs_info.c41
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs_message.c526
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs_node-bsd.c808
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs_node.c140
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs_syscalls-common.c659
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs_syscalls-wrap-bsd.c197
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs_vfsops-bsd.c530
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs_vfsops-common.c273
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs_vfsops-openbsd.c191
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs_vnodeops-bsd.c1564
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs_vnodeops-common.c1137
-rw-r--r--usr.sbin/afs/src/nnpfs/bsd/nnpfs_wrap-bsd.c310
-rw-r--r--usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_attr.h126
-rw-r--r--usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_debug.h61
-rw-r--r--usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_global.h9
-rw-r--r--usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_message.h491
-rw-r--r--usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_queue.h91
-rw-r--r--usr.sbin/afs/src/rx/LICENSE27
-rw-r--r--usr.sbin/afs/src/rx/Makefile.in157
-rw-r--r--usr.sbin/afs/src/rx/doyle17
-rw-r--r--usr.sbin/afs/src/rx/rx-new.h238
-rw-r--r--usr.sbin/afs/src/rx/rx.c4319
-rw-r--r--usr.sbin/afs/src/rx/rx.h1084
-rw-r--r--usr.sbin/afs/src/rx/rx_clock.c96
-rw-r--r--usr.sbin/afs/src/rx/rx_clock.h163
-rw-r--r--usr.sbin/afs/src/rx/rx_dumptrace.c82
-rw-r--r--usr.sbin/afs/src/rx/rx_event.c231
-rw-r--r--usr.sbin/afs/src/rx/rx_event.h101
-rw-r--r--usr.sbin/afs/src/rx/rx_globs.c30
-rw-r--r--usr.sbin/afs/src/rx/rx_globs.h309
-rw-r--r--usr.sbin/afs/src/rx/rx_kern.h80
-rw-r--r--usr.sbin/afs/src/rx/rx_kmutex.h60
-rw-r--r--usr.sbin/afs/src/rx/rx_locl.h95
-rw-r--r--usr.sbin/afs/src/rx/rx_mach.h92
-rw-r--r--usr.sbin/afs/src/rx/rx_misc.c57
-rw-r--r--usr.sbin/afs/src/rx/rx_misc.h43
-rw-r--r--usr.sbin/afs/src/rx/rx_multi.c110
-rw-r--r--usr.sbin/afs/src/rx/rx_multi.h80
-rw-r--r--usr.sbin/afs/src/rx/rx_null.c44
-rw-r--r--usr.sbin/afs/src/rx/rx_null.h39
-rw-r--r--usr.sbin/afs/src/rx/rx_pkt.c1390
-rw-r--r--usr.sbin/afs/src/rx/rx_pkt.h301
-rw-r--r--usr.sbin/afs/src/rx/rx_queue.h185
-rw-r--r--usr.sbin/afs/src/rx/rx_rdwr.c437
-rw-r--r--usr.sbin/afs/src/rx/rx_strm.h101
-rw-r--r--usr.sbin/afs/src/rx/rx_trace.c116
-rw-r--r--usr.sbin/afs/src/rx/rx_trace.h53
-rw-r--r--usr.sbin/afs/src/rx/rx_user.c609
-rw-r--r--usr.sbin/afs/src/rx/rx_user.h102
-rw-r--r--usr.sbin/afs/src/rx/rxdebug.1107
-rw-r--r--usr.sbin/afs/src/rx/rxdebug.c732
-rw-r--r--usr.sbin/afs/src/rx/rxgencon.h38
-rw-r--r--usr.sbin/afs/src/rx/rxperf.c998
-rw-r--r--usr.sbin/afs/src/rx/simple.example/README11
-rw-r--r--usr.sbin/afs/src/rx/simple.example/sample.xg30
-rw-r--r--usr.sbin/afs/src/rx/simple.example/sample_client.c57
-rw-r--r--usr.sbin/afs/src/rx/simple.example/sample_server.c69
-rw-r--r--usr.sbin/afs/src/rx/test_rx_clock.c59
-rw-r--r--usr.sbin/afs/src/rx/transarc135
-rw-r--r--usr.sbin/afs/src/rx/transarc231
-rw-r--r--usr.sbin/afs/src/rxdef/Makefile.in198
-rw-r--r--usr.sbin/afs/src/rxdef/afsuuid.h19
-rw-r--r--usr.sbin/afs/src/rxdef/bos.xg233
-rw-r--r--usr.sbin/afs/src/rxdef/cb.xg129
-rw-r--r--usr.sbin/afs/src/rxdef/common.h179
-rw-r--r--usr.sbin/afs/src/rxdef/fs.xg185
-rw-r--r--usr.sbin/afs/src/rxdef/ka.xg202
-rw-r--r--usr.sbin/afs/src/rxdef/pts.xg302
-rw-r--r--usr.sbin/afs/src/rxdef/rx_pkt.xg77
-rw-r--r--usr.sbin/afs/src/rxdef/ubik.xg126
-rw-r--r--usr.sbin/afs/src/rxdef/vldb.xg545
-rw-r--r--usr.sbin/afs/src/rxdef/volumeserver.xg373
-rw-r--r--usr.sbin/afs/src/rxkad/Makefile.in97
-rw-r--r--usr.sbin/afs/src/rxkad/compat.c175
-rw-r--r--usr.sbin/afs/src/rxkad/osi_alloc.c59
-rw-r--r--usr.sbin/afs/src/rxkad/rxk_clnt.c353
-rw-r--r--usr.sbin/afs/src/rxkad/rxk_crpt.c782
-rw-r--r--usr.sbin/afs/src/rxkad/rxk_locl.c270
-rw-r--r--usr.sbin/afs/src/rxkad/rxk_serv.c563
-rw-r--r--usr.sbin/afs/src/rxkad/rxkad.h170
-rw-r--r--usr.sbin/afs/src/rxkad/rxkad_locl.h198
-rw-r--r--usr.sbin/afs/src/tests/Makefile.in264
-rw-r--r--usr.sbin/afs/src/tests/append-over-page.c981
-rw-r--r--usr.sbin/afs/src/tests/append16
-rw-r--r--usr.sbin/afs/src/tests/apwd.c466
-rw-r--r--usr.sbin/afs/src/tests/boot-strap-arla17
-rw-r--r--usr.sbin/afs/src/tests/build-emacs4
-rw-r--r--usr.sbin/afs/src/tests/build-emacs-j4
-rw-r--r--usr.sbin/afs/src/tests/build-gdb4
-rw-r--r--usr.sbin/afs/src/tests/checkpwd3
-rw-r--r--usr.sbin/afs/src/tests/compare-inum-mp8
-rw-r--r--usr.sbin/afs/src/tests/compare-inums4
-rw-r--r--usr.sbin/afs/src/tests/compare-with-local77
-rw-r--r--usr.sbin/afs/src/tests/copy-and-diff-gnu-mirror7
-rw-r--r--usr.sbin/afs/src/tests/copy-file26
-rw-r--r--usr.sbin/afs/src/tests/creat15
-rw-r--r--usr.sbin/afs/src/tests/create-dirs.c95
-rw-r--r--usr.sbin/afs/src/tests/create-files.c118
-rw-r--r--usr.sbin/afs/src/tests/create-remove-dirs4
-rw-r--r--usr.sbin/afs/src/tests/create-remove-files4
-rw-r--r--usr.sbin/afs/src/tests/create-remove.c137
-rw-r--r--usr.sbin/afs/src/tests/create-stat.c169
-rw-r--r--usr.sbin/afs/src/tests/create-symlinks.c136
-rw-r--r--usr.sbin/afs/src/tests/dd8
-rw-r--r--usr.sbin/afs/src/tests/deep-tree6
-rw-r--r--usr.sbin/afs/src/tests/deep-tree212
-rw-r--r--usr.sbin/afs/src/tests/dir-size-mismatch10
-rw-r--r--usr.sbin/afs/src/tests/dir-tree22
-rw-r--r--usr.sbin/afs/src/tests/discon-create6
-rw-r--r--usr.sbin/afs/src/tests/discon-echo6
-rw-r--r--usr.sbin/afs/src/tests/discon-mkdir6
-rw-r--r--usr.sbin/afs/src/tests/discon-mkdir27
-rw-r--r--usr.sbin/afs/src/tests/discon-tar19
-rw-r--r--usr.sbin/afs/src/tests/discon-tar213
-rw-r--r--usr.sbin/afs/src/tests/discon-touch17
-rw-r--r--usr.sbin/afs/src/tests/discon-touch28
-rw-r--r--usr.sbin/afs/src/tests/dup2-and-unlog.c53
-rw-r--r--usr.sbin/afs/src/tests/echo-n.c20
-rw-r--r--usr.sbin/afs/src/tests/exec9
-rw-r--r--usr.sbin/afs/src/tests/exit-wo-close.c129
-rw-r--r--usr.sbin/afs/src/tests/fcachesize-dir13
-rw-r--r--usr.sbin/afs/src/tests/fcachesize-file-small13
-rw-r--r--usr.sbin/afs/src/tests/fchmod.c74
-rw-r--r--usr.sbin/afs/src/tests/fhbench.c370
-rw-r--r--usr.sbin/afs/src/tests/find-and-cat-netbsd5
-rw-r--r--usr.sbin/afs/src/tests/find-linux5
-rw-r--r--usr.sbin/afs/src/tests/fs-flush6
-rw-r--r--usr.sbin/afs/src/tests/fs-sa-la6
-rw-r--r--usr.sbin/afs/src/tests/ga-test.c327
-rw-r--r--usr.sbin/afs/src/tests/generic-build19
-rw-r--r--usr.sbin/afs/src/tests/getdents-and-unlink19
-rw-r--r--usr.sbin/afs/src/tests/getdents-and-unlink29
-rw-r--r--usr.sbin/afs/src/tests/getdents-and-unlink39
-rw-r--r--usr.sbin/afs/src/tests/hardlink1.c149
-rw-r--r--usr.sbin/afs/src/tests/hardlink2.c105
-rw-r--r--usr.sbin/afs/src/tests/hardlink328
-rw-r--r--usr.sbin/afs/src/tests/hello-world.in8
-rw-r--r--usr.sbin/afs/src/tests/invalidate-file.c190
-rw-r--r--usr.sbin/afs/src/tests/kill-softer.c193
-rw-r--r--usr.sbin/afs/src/tests/kill-softly.c163
-rw-r--r--usr.sbin/afs/src/tests/kotest4
-rw-r--r--usr.sbin/afs/src/tests/large-dir-163844
-rw-r--r--usr.sbin/afs/src/tests/large-dir-extra7
-rw-r--r--usr.sbin/afs/src/tests/large-dir.c159
-rw-r--r--usr.sbin/afs/src/tests/large-dir2.c138
-rw-r--r--usr.sbin/afs/src/tests/large-dir3.c126
-rw-r--r--usr.sbin/afs/src/tests/large-filename6
-rw-r--r--usr.sbin/afs/src/tests/ls-afs5
-rw-r--r--usr.sbin/afs/src/tests/make-page.c98
-rw-r--r--usr.sbin/afs/src/tests/many-dirs4
-rw-r--r--usr.sbin/afs/src/tests/many-fetchs15
-rw-r--r--usr.sbin/afs/src/tests/many-files4
-rw-r--r--usr.sbin/afs/src/tests/many-files-with-content4
-rw-r--r--usr.sbin/afs/src/tests/many-stores10
-rw-r--r--usr.sbin/afs/src/tests/many-symlinks4
-rw-r--r--usr.sbin/afs/src/tests/mkdir10
-rw-r--r--usr.sbin/afs/src/tests/mkdir-lnk12
-rw-r--r--usr.sbin/afs/src/tests/mkdir17
-rw-r--r--usr.sbin/afs/src/tests/mkdir2.c84
-rw-r--r--usr.sbin/afs/src/tests/mkm-rmm13
-rw-r--r--usr.sbin/afs/src/tests/mmap-and-read.c163
-rw-r--r--usr.sbin/afs/src/tests/mmap-cat.c160
-rw-r--r--usr.sbin/afs/src/tests/mmap-shared-write.c103
-rw-r--r--usr.sbin/afs/src/tests/mmap-vs-read.c170
-rw-r--r--usr.sbin/afs/src/tests/mmap-vs-read2.c170
-rw-r--r--usr.sbin/afs/src/tests/mountpoint.in12
-rw-r--r--usr.sbin/afs/src/tests/parallel15
-rw-r--r--usr.sbin/afs/src/tests/pine.c103
-rw-r--r--usr.sbin/afs/src/tests/read-vs-mmap.c170
-rw-r--r--usr.sbin/afs/src/tests/read-vs-mmap2.c133
-rw-r--r--usr.sbin/afs/src/tests/read-write.c145
-rw-r--r--usr.sbin/afs/src/tests/readdir-vs-lstat.c104
-rw-r--r--usr.sbin/afs/src/tests/readfile-wo-create3
-rw-r--r--usr.sbin/afs/src/tests/rename-under-feet.c161
-rw-r--r--usr.sbin/afs/src/tests/rename17
-rw-r--r--usr.sbin/afs/src/tests/rename27
-rw-r--r--usr.sbin/afs/src/tests/rename39
-rw-r--r--usr.sbin/afs/src/tests/rename48
-rw-r--r--usr.sbin/afs/src/tests/rename5.c109
-rw-r--r--usr.sbin/afs/src/tests/rm-rf.c145
-rw-r--r--usr.sbin/afs/src/tests/run-tests.in250
-rw-r--r--usr.sbin/afs/src/tests/setgroups4
-rw-r--r--usr.sbin/afs/src/tests/setpag4
-rw-r--r--usr.sbin/afs/src/tests/shallow-tree5
-rw-r--r--usr.sbin/afs/src/tests/still-there-p.c93
-rw-r--r--usr.sbin/afs/src/tests/strange-characters7
-rw-r--r--usr.sbin/afs/src/tests/strange-characters-c.c95
-rw-r--r--usr.sbin/afs/src/tests/strange-other-characters5
-rw-r--r--usr.sbin/afs/src/tests/symlink.c74
-rw-r--r--usr.sbin/afs/src/tests/test-gunzip-gnu-mirror14
-rw-r--r--usr.sbin/afs/src/tests/test-parallel1.c103
-rw-r--r--usr.sbin/afs/src/tests/test-parallel2.c185
-rw-r--r--usr.sbin/afs/src/tests/test-setgroups.c146
-rw-r--r--usr.sbin/afs/src/tests/test-setpag.c139
-rw-r--r--usr.sbin/afs/src/tests/touch14
-rw-r--r--usr.sbin/afs/src/tests/truncate.c112
-rw-r--r--usr.sbin/afs/src/tests/untar-emacs9
-rw-r--r--usr.sbin/afs/src/tests/utime-dir.c81
-rw-r--r--usr.sbin/afs/src/tests/utime-file.c98
-rw-r--r--usr.sbin/afs/src/tests/visit-volumes6
-rw-r--r--usr.sbin/afs/src/tests/write-closed.c99
-rw-r--r--usr.sbin/afs/src/tests/write-closed2.c134
-rw-r--r--usr.sbin/afs/src/tests/write-ro-file.c72
-rw-r--r--usr.sbin/afs/src/tests/write-ucc.c105
-rw-r--r--usr.sbin/afs/src/tests/write14
-rw-r--r--usr.sbin/afs/src/tests/write26
-rw-r--r--usr.sbin/afs/src/tools/gnats/COPYING340
-rw-r--r--usr.sbin/afs/src/tools/gnats/INSTALL83
-rw-r--r--usr.sbin/afs/src/tools/gnats/MANIFEST20
-rw-r--r--usr.sbin/afs/src/tools/gnats/README43
-rw-r--r--usr.sbin/afs/src/tools/gnats/categ.texi123
-rw-r--r--usr.sbin/afs/src/tools/gnats/categories2
-rw-r--r--usr.sbin/afs/src/tools/gnats/fields.texi520
-rw-r--r--usr.sbin/afs/src/tools/gnats/install-sid.sh88
-rw-r--r--usr.sbin/afs/src/tools/gnats/s-usage.texi565
-rw-r--r--usr.sbin/afs/src/tools/gnats/send-pr-el.in811
-rw-r--r--usr.sbin/afs/src/tools/gnats/send-pr.1289
-rw-r--r--usr.sbin/afs/src/tools/gnats/send-pr.info1606
-rw-r--r--usr.sbin/afs/src/tools/gnats/send-pr.sh553
-rw-r--r--usr.sbin/afs/src/tools/gnats/send-pr.texi656
-rw-r--r--usr.sbin/afs/src/tools/gnats/states.texi56
-rw-r--r--usr.sbin/afs/src/tools/gnats/texinfo.tex4800
-rw-r--r--usr.sbin/afs/src/tools/gnats/version.texi1
-rw-r--r--usr.sbin/afs/src/tools/release-tools/common.c73
-rw-r--r--usr.sbin/afs/src/tools/release-tools/common.h42
-rw-r--r--usr.sbin/afs/src/tools/release-tools/cpio-rootify.c157
-rw-r--r--usr.sbin/afs/src/tools/release-tools/tar-rootify.c146
-rw-r--r--usr.sbin/afs/src/util/Makefile.in141
-rw-r--r--usr.sbin/afs/src/util/arlamath.c69
-rw-r--r--usr.sbin/afs/src/util/arlamath.h46
-rw-r--r--usr.sbin/afs/src/util/arlautil.h17
-rw-r--r--usr.sbin/afs/src/util/bool.h68
-rw-r--r--usr.sbin/afs/src/util/hash.c381
-rw-r--r--usr.sbin/afs/src/util/hash.h97
-rw-r--r--usr.sbin/afs/src/util/heap.c291
-rw-r--r--usr.sbin/afs/src/util/heap.h85
-rw-r--r--usr.sbin/afs/src/util/heaptest.c114
-rw-r--r--usr.sbin/afs/src/util/list.c248
-rw-r--r--usr.sbin/afs/src/util/list.h130
-rw-r--r--usr.sbin/afs/src/util/localtime_r.c55
-rw-r--r--usr.sbin/afs/src/util/log.c777
-rw-r--r--usr.sbin/afs/src/util/log.h89
-rw-r--r--usr.sbin/afs/src/util/log_log.3153
-rw-r--r--usr.sbin/afs/src/util/mmaptime.c201
-rw-r--r--usr.sbin/afs/src/util/mmaptime.h47
-rw-r--r--usr.sbin/afs/src/util/mmaptime_test.c136
-rw-r--r--usr.sbin/afs/src/util/util-tester.c273
-rw-r--r--usr.sbin/afs/src/ydr/Makefile.in103
-rw-r--r--usr.sbin/afs/src/ydr/lex.h43
-rw-r--r--usr.sbin/afs/src/ydr/lex.l189
-rw-r--r--usr.sbin/afs/src/ydr/main.c150
-rw-r--r--usr.sbin/afs/src/ydr/output.c2445
-rw-r--r--usr.sbin/afs/src/ydr/output.h83
-rw-r--r--usr.sbin/afs/src/ydr/parse.y324
-rw-r--r--usr.sbin/afs/src/ydr/sym.h76
-rw-r--r--usr.sbin/afs/src/ydr/symbol.c136
-rw-r--r--usr.sbin/afs/src/ydr/types.c238
-rw-r--r--usr.sbin/afs/src/ydr/types.h89
-rw-r--r--usr.sbin/afs/usr.sbin/Makefile5
-rw-r--r--usr.sbin/afs/usr.sbin/bos/Makefile38
-rw-r--r--usr.sbin/afs/usr.sbin/fs/Makefile57
-rw-r--r--usr.sbin/afs/usr.sbin/pts/Makefile22
-rw-r--r--usr.sbin/afs/usr.sbin/vos/Makefile42
-rw-r--r--usr.sbin/afs/usr.sbin/ydr/Makefile37
904 files changed, 1 insertions, 200597 deletions
diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile
index c0323161183..5f34efc20b0 100644
--- a/usr.sbin/Makefile
+++ b/usr.sbin/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.162 2012/08/16 04:10:25 dlg Exp $
+# $OpenBSD: Makefile,v 1.163 2012/08/23 06:21:46 deraadt Exp $
.include <bsd.own.mk>
@@ -18,10 +18,6 @@ SUBDIR= ac accton acpidump adduser amd apm apmd arp \
tokenadm tokeninit traceroute traceroute6 trpt usbdevs user vipw \
watchdogd wsconscfg wsfontload wsmoused zdump zic ztsscale
-.if (${AFS:L} == "yes")
-SUBDIR+=afs
-.endif
-
.if (${YP:L} == "yes")
SUBDIR+=ypbind ypldap yppoll ypset ypserv
.endif
diff --git a/usr.sbin/afs/Makefile b/usr.sbin/afs/Makefile
deleted file mode 100644
index f7647afd982..00000000000
--- a/usr.sbin/afs/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-# $OpenBSD: Makefile,v 1.6 2007/11/19 21:13:58 espie Exp $
-
-# To the future maintainer (if I get hit by a car or something): The structure
-# is like this (everything in src, except the makefiles), because we want
-# the upgrade process to be easy, without building and installing 5 different
-# libs and without making a hairy Makefile.bsd-wrapper
-#
-# Anomalies:
-# - config.h and arla-version.h have to be pre-built and put in src/include.
-# config.h contains macros for endianness, but they are only used in one
-# place and will be replaced on OpenBSD. They have to be placed in
-# src/include because we want to reduce the memory footprint of mkdep
-# (yes, it's a real problem).
-#
-
-.if !make(install)
-SUBDIR += usr.sbin/ydr
-.endif
-SUBDIR += lib libexec usr.sbin
-
-## To be able to make depend in libarla we have to have ydr
-
-beforedepend:
- cd usr.sbin/ydr && ${MAKE} depend && exec ${MAKE}
-
-.include <bsd.dep.mk>
-.include <bsd.subdir.mk>
diff --git a/usr.sbin/afs/Makefile.inc b/usr.sbin/afs/Makefile.inc
deleted file mode 100644
index 1620e1e34ea..00000000000
--- a/usr.sbin/afs/Makefile.inc
+++ /dev/null
@@ -1,31 +0,0 @@
-
-AFSSRC = ${.CURDIR}/${AFSTOPDIR}/src
-
-YDR = ${AFSTOPDIR}/usr.sbin/ydr/ydr
-
-OS_VER != uname -r
-BINDIR ?=/usr/sbin
-
-ROKENSRC=$(.CURDIR)/$(AFSTOPDIR)/../../kerberosV/src/lib/roken
-
-LIBARLA = ${AFSTOPDIR}/lib/libarla/libarla.a
-NOPIE=
-
-CFLAGS += -DHAVE_CONFIG_H -DSYSCONFDIR=\"/etc/afs\" \
- -DARLACACHEDIR=\"/var/spool/afs\"\
- -DARLACONFFILE=\"/etc/afs/afsd.conf\" -DKERBEROS \
- -DARLAVENDOR=\"unknown\" -DARLACPU=\"${MACHINE_ARCH}\" \
- -DARLAOS=\"openbsd${OS_VER}\" \
-
-CFLAGS += -I${.CURDIR}/${AFSTOPDIR}/include -I${AFSSRC}/include \
- -I${.CURDIR}/${AFSTOPDIR}/../../kerberosV/include \
- -I${.CURDIR}/${AFSTOPDIR}/../../kerberosV/src/lib/roken \
- -I${AFSTOPDIR}/lib/libarla -I${AFSSRC}/lwp \
- -I${AFSSRC}/rxkad -I${AFSSRC}/lib/bufdir -I${AFSSRC}/lib/ko \
- -I${AFSSRC} -I${DESTDIR}/usr/include/kerberosV \
- -I${AFSSRC}/util -I${AFSSRC}/arlad \
- -I${AFSSRC}/lib/sl -I${AFSSRC}/lib/vers \
- -I${AFSSRC}/nnpfs/include -I${AFSSRC}/nnpfs/bsd
-
-#CFLAGS+=-g -Wall -Werror -Wno-uninitialized
-
diff --git a/usr.sbin/afs/include/arla-version.h b/usr.sbin/afs/include/arla-version.h
deleted file mode 100644
index 6e12063b51b..00000000000
--- a/usr.sbin/afs/include/arla-version.h
+++ /dev/null
@@ -1,2 +0,0 @@
-char *arla_long_version = "@(#)$Version: arla-20030805/OpenBSD";
-char *arla_version = "arla-20030805";
diff --git a/usr.sbin/afs/include/atypes.h b/usr.sbin/afs/include/atypes.h
deleted file mode 100644
index f004c6de466..00000000000
--- a/usr.sbin/afs/include/atypes.h
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <sys/types.h>
-#include <inttypes.h>
diff --git a/usr.sbin/afs/include/config.h b/usr.sbin/afs/include/config.h
deleted file mode 100644
index 08d0701166b..00000000000
--- a/usr.sbin/afs/include/config.h
+++ /dev/null
@@ -1,1670 +0,0 @@
-/* include/config.h. Generated by configure. */
-/* include/config.h.in. Generated from configure.in by autoheader. */
-
-#ifndef OPENSSL_DES_LIBDES_COMPATIBILITY
-#define OPENSSL_DES_LIBDES_COMPATIBILITY 1
-#endif
-
-#ifndef RCSID
-#define RCSID(msg) \
-static /**/const char *const rcsid[] = { (const char *)rcsid, "@(#)" msg }
-#endif
-
-/* Maximum values on all known systems */
-#define MaxHostNameLen (64+4)
-#define MaxPathLen (1024+4)
-
-
-
-/* Define if realloc(NULL) doesn't work. */
-/* #undef BROKEN_REALLOC */
-
-/* define if you can include both dirent.h and sys/dir.h */
-#define DIRENT_AND_SYS_DIR_H 1
-
-/* define if DIRSIZ is defined in dirent.h */
-/* #undef DIRSIZ_IN_DIRENT_H */
-
-/* define if DIRSIZ is defined in sys/dir.h */
-#define DIRSIZ_IN_SYS_DIR_H 1
-
-/* how should ntohl be done? */
-#define EFF_NTOHL ntohl
-
-/* define if sys/param.h defines the endiness */
-#define ENDIANESS_IN_SYS_PARAM_H 1
-
-/* define if DIRSIZ is defined in sys/dirent.h */
-/* #undef GENERIC_DIRSIZ_IN_SYS_DIRENT_H */
-
-/* define if prototype of gethostbyaddr is compatible with struct hostent
- *gethostbyaddr(const void *, size_t, int) */
-/* #undef GETHOSTBYADDR_PROTO_COMPATIBLE */
-
-/* define if prototype of gethostbyname is compatible with struct hostent
- *gethostbyname(const char *) */
-#define GETHOSTBYNAME_PROTO_COMPATIBLE 1
-
-/* define if prototype of getservbyname is compatible with struct servent
- *getservbyname(const char *, const char *) */
-#define GETSERVBYNAME_PROTO_COMPATIBLE 1
-
-/* define if prototype of getsockname is compatible with int getsockname(int,
- struct sockaddr*, socklen_t*) */
-#define GETSOCKNAME_PROTO_COMPATIBLE 1
-
-/* Define if you have the `altzone' variable. */
-/* #undef HAVE_ALTZONE */
-
-/* define if your system declares altzone */
-/* #undef HAVE_ALTZONE_DECLARATION */
-
-/* Define to 1 if you have the <arpa/inet.h> header file. */
-#define HAVE_ARPA_INET_H 1
-
-/* Define to 1 if you have the <arpa/nameser.h> header file. */
-#define HAVE_ARPA_NAMESER_H 1
-
-/* Define to 1 if you have the `asnprintf' function. */
-/* #undef HAVE_ASNPRINTF */
-
-/* Define to 1 if you have the `asprintf' function. */
-#define HAVE_ASPRINTF 1
-
-/* Define to 1 if you have the `atexit' function. */
-#define HAVE_ATEXIT 1
-
-/* Define to 1 if you have the `bool' function. */
-/* #undef HAVE_BOOL */
-
-/* Define to 1 if you have the `bswap16' function. */
-/* #undef HAVE_BSWAP16 */
-
-/* Define to 1 if you have the `bswap32' function. */
-/* #undef HAVE_BSWAP32 */
-
-/* Define to 1 if you have the `cgetent' function. */
-#define HAVE_CGETENT 1
-
-/* Define if you have the function `chown'. */
-#define HAVE_CHOWN 1
-
-/* Define to 1 if you have the <com_err.h> header file. */
-#define HAVE_COM_ERR_H 1
-
-/* Define to 1 if you have the <config.h> header file. */
-/* #undef HAVE_CONFIG_H */
-
-/* Define if you have the function `copyhostent'. */
-/* #undef HAVE_COPYHOSTENT */
-
-/* Define to 1 if you have the `crypt' function. */
-#define HAVE_CRYPT 1
-
-/* Define to 1 if you have the <crypt.h> header file. */
-/* #undef HAVE_CRYPT_H */
-
-/* Define if you have the function `daemon'. */
-#define HAVE_DAEMON 1
-
-/* define if you have a berkeley db1/2 library */
-#define HAVE_DB1 1
-
-/* define if you have a berkeley db3/4 library */
-/* #undef HAVE_DB3 */
-
-/* Define to 1 if you have the <db3/db.h> header file. */
-/* #undef HAVE_DB3_DB_H */
-
-/* Define to 1 if you have the <db4/db.h> header file. */
-/* #undef HAVE_DB4_DB_H */
-
-/* Define to 1 if you have the `dbm_firstkey' function. */
-#define HAVE_DBM_FIRSTKEY 1
-
-/* Define to 1 if you have the <dbm.h> header file. */
-#define HAVE_DBM_H 1
-
-/* Define to 1 if you have the `dbopen' function. */
-#define HAVE_DBOPEN 1
-
-/* Define to 1 if you have the <db_185.h> header file. */
-/* #undef HAVE_DB_185_H */
-
-/* Define to 1 if you have the `db_create' function. */
-/* #undef HAVE_DB_CREATE */
-
-/* Define to 1 if you have the <db.h> header file. */
-#define HAVE_DB_H 1
-
-/* define if you have ndbm compat in db */
-/* #undef HAVE_DB_NDBM */
-
-/* Define if you have struct setgroups_args */
-/* #undef HAVE_DEF_STRUCT_SETGROUPS_ARGS */
-
-/* Define if you have struct sys_setgroups_args */
-#define HAVE_DEF_STRUCT_SYS_SETGROUPS_ARGS 1
-
-/* define if devfs_register takes eleven arguments */
-/* #undef HAVE_DEVFS_REGISTER_ELEVEN_ARGS */
-
-/* define if you have a function dget_locked */
-/* #undef HAVE_DGET_LOCKED */
-
-/* Define to 1 if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Define to 1 if you have the `dn_expand' function. */
-#define HAVE_DN_EXPAND 1
-
-/* define if d_alloc_root takes two arguments */
-/* #undef HAVE_D_ALLOC_ROOT_TWO_ARGS */
-
-/* define if d_delete in struct dentry_operations returns void */
-/* #undef HAVE_D_DELETE_VOID */
-
-/* Define if you have the function `ecalloc'. */
-/* #undef HAVE_ECALLOC */
-
-/* Define to 1 if you have the <elflib/nlist.h> header file. */
-/* #undef HAVE_ELFLIB_NLIST_H */
-
-/* Define to 1 if you have the `el_init' function. */
-/* #undef HAVE_EL_INIT */
-
-/* Define if you have the function `emalloc'. */
-/* #undef HAVE_EMALLOC */
-
-/* define if your system declares environ */
-/* #undef HAVE_ENVIRON_DECLARATION */
-
-/* Define if you have the function `erealloc'. */
-/* #undef HAVE_EREALLOC */
-
-/* Define if you have the function `err'. */
-#define HAVE_ERR 1
-
-/* Define to 1 if you have the <errno.h> header file. */
-#define HAVE_ERRNO_H 1
-
-/* Define if you have the function `errx'. */
-#define HAVE_ERRX 1
-
-/* Define to 1 if you have the <err.h> header file. */
-#define HAVE_ERR_H 1
-
-/* Define if you have the function `estrdup'. */
-/* #undef HAVE_ESTRDUP */
-
-/* Define to 1 if you have the <et/com_err.h> header file. */
-/* #undef HAVE_ET_COM_ERR_H */
-
-/* Define if you have the function `fchown'. */
-#define HAVE_FCHOWN 1
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define to 1 if you have the `fhopen' function. */
-#define HAVE_FHOPEN 1
-
-/* define if filldir_t takes a dt_type argument */
-/* #undef HAVE_FILLDIR_T_DT_TYPE */
-
-/* Define if you have the function `flock'. */
-#define HAVE_FLOCK 1
-
-/* Define if you have the function `fnmatch'. */
-#define HAVE_FNMATCH 1
-
-/* Define to 1 if you have the <fnmatch.h> header file. */
-#define HAVE_FNMATCH_H 1
-
-/* define if lockmgr takes four arguments */
-/* #undef HAVE_FOUR_ARGUMENT_LOCKMGR */
-
-/* define if vfs_busy takes four arguments */
-/* #undef HAVE_FOUR_ARGUMENT_VFS_BUSY */
-
-/* define if vfs_name_hash takes four arguments */
-/* #undef HAVE_FOUR_ARGUMENT_VFS_NAME_HASH */
-
-/* if vfs_object_create takes four arguments */
-/* #undef HAVE_FOUR_ARGUMENT_VFS_OBJECT_CREATE */
-
-/* Define to 1 if you have the `freeaddrinfo' function. */
-#define HAVE_FREEADDRINFO 1
-
-/* Define if you have the function `freehostent'. */
-/* #undef HAVE_FREEHOSTENT */
-
-/* Define to 1 if you have the `gai_strerror' function. */
-#define HAVE_GAI_STRERROR 1
-
-/* Define to 1 if you have the <gdbm/ndbm.h> header file. */
-/* #undef HAVE_GDBM_NDBM_H */
-
-/* Define to 1 if you have the `getaddrinfo' function. */
-#define HAVE_GETADDRINFO 1
-
-/* Define to 1 if you have the `getattrlist' function. */
-/* #undef HAVE_GETATTRLIST */
-
-/* Define to 1 if you have the `getconfattr' function. */
-/* #undef HAVE_GETCONFATTR */
-
-/* Define if you have the function `getcwd'. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the function `getdtablesize'. */
-#define HAVE_GETDTABLESIZE 1
-
-/* Define if you have the function `getegid'. */
-#define HAVE_GETEGID 1
-
-/* Define if you have the function `geteuid'. */
-#define HAVE_GETEUID 1
-
-/* Define to 1 if you have the `getfh' function. */
-#define HAVE_GETFH 1
-
-/* Define if you have the function `getgid'. */
-#define HAVE_GETGID 1
-
-/* Define to 1 if you have the `gethostbyname' function. */
-#define HAVE_GETHOSTBYNAME 1
-
-/* Define to 1 if you have the `gethostbyname2' function. */
-#define HAVE_GETHOSTBYNAME2 1
-
-/* Define if you have the function `gethostname'. */
-#define HAVE_GETHOSTNAME 1
-
-/* Define if you have the function `getifaddrs'. */
-#define HAVE_GETIFADDRS 1
-
-/* Define if you have the function `getipnodebyaddr'. */
-/* #undef HAVE_GETIPNODEBYADDR */
-
-/* Define if you have the function `getipnodebyname'. */
-/* #undef HAVE_GETIPNODEBYNAME */
-
-/* Define to 1 if you have the `getlogin' function. */
-#define HAVE_GETLOGIN 1
-
-/* Define to 1 if you have the `getnameinfo' function. */
-#define HAVE_GETNAMEINFO 1
-
-/* Define if you have the function `getopt'. */
-#define HAVE_GETOPT 1
-
-/* Define to 1 if you have the `getpagesize' function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define to 1 if you have the `getprogname' function. */
-/* #undef HAVE_GETPROGNAME */
-
-/* Define to 1 if you have the `getrlimit' function. */
-#define HAVE_GETRLIMIT 1
-
-/* Define to 1 if you have the `getrusage' function. */
-#define HAVE_GETRUSAGE 1
-
-/* Define to 1 if you have the `getsockopt' function. */
-#define HAVE_GETSOCKOPT 1
-
-/* Define to 1 if you have the `getspnam' function. */
-/* #undef HAVE_GETSPNAM */
-
-/* Define if you have the function `gettimeofday'. */
-#define HAVE_GETTIMEOFDAY 1
-
-/* Define if you have the function `getuid'. */
-#define HAVE_GETUID 1
-
-/* Define if you have the function `getusershell'. */
-#define HAVE_GETUSERSHELL 1
-
-/* define if you have a glibc-based system */
-/* #undef HAVE_GLIBC */
-
-/* define if you have a glob() that groks GLOB_BRACE, GLOB_NOCHECK,
- GLOB_QUOTE, GLOB_TILDE, and GLOB_LIMIT */
-#define HAVE_GLOB 1
-
-/* Define to 1 if you have the <glob.h> header file. */
-#define HAVE_GLOB_H 1
-
-/* Define to 1 if you have the <grp.h> header file. */
-#define HAVE_GRP_H 1
-
-/* Define to 1 if you have the `hstrerror' function. */
-#define HAVE_HSTRERROR 1
-
-/* Define if you have the `h_errlist' variable. */
-#define HAVE_H_ERRLIST 1
-
-/* define if your system declares h_errlist */
-/* #undef HAVE_H_ERRLIST_DECLARATION */
-
-/* Define if you have the `h_errno' variable. */
-#define HAVE_H_ERRNO 1
-
-/* define if your system declares h_errno */
-#define HAVE_H_ERRNO_DECLARATION 1
-
-/* Define if you have the `h_nerr' variable. */
-#define HAVE_H_NERR 1
-
-/* define if your system declares h_nerr */
-/* #undef HAVE_H_NERR_DECLARATION */
-
-/* Define to 1 if you have the <ifaddrs.h> header file. */
-#define HAVE_IFADDRS_H 1
-
-/* Define if you have the in6addr_loopback variable */
-#define HAVE_IN6ADDR_LOOPBACK 1
-
-/* define */
-#define HAVE_INET_ATON 1
-
-/* define */
-#define HAVE_INET_NTOP 1
-
-/* define */
-#define HAVE_INET_PTON 1
-
-/* Define if you have the function `initgroups'. */
-#define HAVE_INITGROUPS 1
-
-/* Define to 1 if you have the `initstate' function. */
-#define HAVE_INITSTATE 1
-
-/* define if you have a function init_MUTEX */
-/* #undef HAVE_INIT_MUTEX */
-
-/* define if you have a init_waitqueue_head */
-/* #undef HAVE_INIT_WAITQUEUE_HEAD */
-
-/* Define if you have the function `innetgr'. */
-#define HAVE_INNETGR 1
-
-/* Define to 1 if you have the `int16' function. */
-/* #undef HAVE_INT16 */
-
-/* Define to 1 if you have the `int16_t' function. */
-#define HAVE_INT16_T 1
-
-/* Define to 1 if you have the `int32' function. */
-/* #undef HAVE_INT32 */
-
-/* Define to 1 if you have the `int32_t' function. */
-#define HAVE_INT32_T 1
-
-/* Define to 1 if you have the `int64_t' function. */
-#define HAVE_INT64_T 1
-
-/* Define to 1 if you have the `int8_t' function. */
-#define HAVE_INT8_T 1
-
-/* Define to 1 if you have the `intptr_t' function. */
-/* #undef HAVE_INTPTR_T */
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define if you have IPv6. */
-#define HAVE_IPV6 1
-
-/* Define if you have the function `iruserok'. */
-#define HAVE_IRUSEROK 1
-
-/* Define to 1 if you have the `issetugid' function. */
-#define HAVE_ISSETUGID 1
-
-/* Define to 1 if you have the `kernel_aout_sysent' function. */
-/* #undef HAVE_KERNEL_AOUT_SYSENT */
-
-/* Define to 1 if you have the `kernel_cache_purgevfs' function. */
-#define HAVE_KERNEL_CACHE_PURGEVFS 1
-
-/* Define to 1 if you have the `kernel_cdevsw_add' function. */
-/* #undef HAVE_KERNEL_CDEVSW_ADD */
-
-/* Define to 1 if you have the `kernel_debuglockmgr' function. */
-/* #undef HAVE_KERNEL_DEBUGLOCKMGR */
-
-/* Define to 1 if you have the `kernel_devtoname' function. */
-/* #undef HAVE_KERNEL_DEVTONAME */
-
-/* Define to 1 if you have the `kernel_doforce' function. */
-#define HAVE_KERNEL_DOFORCE 1
-
-/* Define to 1 if you have the `kernel_genfs_mmap' function. */
-/* #undef HAVE_KERNEL_GENFS_MMAP */
-
-/* Define to 1 if you have the `kernel_genfs_revoke' function. */
-/* #undef HAVE_KERNEL_GENFS_REVOKE */
-
-/* Define to 1 if you have the `kernel_lf_advlock' function. */
-#define HAVE_KERNEL_LF_ADVLOCK 1
-
-/* Define to 1 if you have the `kernel_lockmgr' function. */
-#define HAVE_KERNEL_LOCKMGR 1
-
-/* Define to 1 if you have the `kernel_lockstatus' function. */
-#define HAVE_KERNEL_LOCKSTATUS 1
-
-/* Define to 1 if you have the `kernel_memcpy' function. */
-#define HAVE_KERNEL_MEMCPY 1
-
-/* Define to 1 if you have the `kernel_namei_hash' function. */
-/* #undef HAVE_KERNEL_NAMEI_HASH */
-
-/* Define to 1 if you have the `kernel_nosys' function. */
-/* #undef HAVE_KERNEL_NOSYS */
-
-/* Define to 1 if you have the `kernel_snprintf' function. */
-#define HAVE_KERNEL_SNPRINTF 1
-
-/* Define to 1 if you have the `kernel_strlcpy' function. */
-#define HAVE_KERNEL_STRLCPY 1
-
-/* Define to 1 if you have the `kernel_sys_lkmnosys' function. */
-#define HAVE_KERNEL_SYS_LKMNOSYS 1
-
-/* Define to 1 if you have the `kernel_sys_nosys' function. */
-#define HAVE_KERNEL_SYS_NOSYS 1
-
-/* Define to 1 if you have the `kernel_udev2dev' function. */
-/* #undef HAVE_KERNEL_UDEV2DEV */
-
-/* Define to 1 if you have the `kernel_uma_zfree_arg' function. */
-/* #undef HAVE_KERNEL_UMA_ZFREE_ARG */
-
-/* define if we only can include uvm headers */
-/* #undef HAVE_KERNEL_UVM_ONLY */
-
-/* Define to 1 if you have the `kernel_vfs_add_vnodeops' function. */
-/* #undef HAVE_KERNEL_VFS_ADD_VNODEOPS */
-
-/* Define to 1 if you have the `kernel_vfs_attach' function. */
-/* #undef HAVE_KERNEL_VFS_ATTACH */
-
-/* Define to 1 if you have the `kernel_vfs_cache_lookup' function. */
-/* #undef HAVE_KERNEL_VFS_CACHE_LOOKUP */
-
-/* Define to 1 if you have the `kernel_vfs_deallocate_syncvnode' function. */
-/* #undef HAVE_KERNEL_VFS_DEALLOCATE_SYNCVNODE */
-
-/* Define to 1 if you have the `kernel_vfs_getnewfsid' function. */
-#define HAVE_KERNEL_VFS_GETNEWFSID 1
-
-/* Define to 1 if you have the `kernel_vfs_getvfs' function. */
-#define HAVE_KERNEL_VFS_GETVFS 1
-
-/* Define to 1 if you have the `kernel_vfs_object_create' function. */
-/* #undef HAVE_KERNEL_VFS_OBJECT_CREATE */
-
-/* Define to 1 if you have the `kernel_vfs_opv_init' function. */
-#define HAVE_KERNEL_VFS_OPV_INIT 1
-
-/* Define to 1 if you have the `kernel_vfs_opv_init_default' function. */
-#define HAVE_KERNEL_VFS_OPV_INIT_DEFAULT 1
-
-/* Define to 1 if you have the `kernel_vfs_opv_init_explicit' function. */
-#define HAVE_KERNEL_VFS_OPV_INIT_EXPLICIT 1
-
-/* Define to 1 if you have the `kernel_vfs_register' function. */
-#define HAVE_KERNEL_VFS_REGISTER 1
-
-/* Define to 1 if you have the `kernel_vgonel' function. */
-#define HAVE_KERNEL_VGONEL 1
-
-/* Define to 1 if you have the `kernel_vnode_pager_generic_getpages' function.
- */
-/* #undef HAVE_KERNEL_VNODE_PAGER_GENERIC_GETPAGES */
-
-/* Define to 1 if you have the `kernel_vnode_pager_generic_putpages' function.
- */
-/* #undef HAVE_KERNEL_VNODE_PAGER_GENERIC_PUTPAGES */
-
-/* Define to 1 if you have the `kernel_vnode_pager_setsize' function. */
-/* #undef HAVE_KERNEL_VNODE_PAGER_SETSIZE */
-
-/* Define to 1 if you have the `kernel_vop_revoke' function. */
-/* #undef HAVE_KERNEL_VOP_REVOKE */
-
-/* Define to 1 if you have the `kernel_vop_stdpathconf' function. */
-/* #undef HAVE_KERNEL_VOP_STDPATHCONF */
-
-/* Define to 1 if you have the `kernel_zfree' function. */
-/* #undef HAVE_KERNEL_ZFREE */
-
-/* Define to 1 if you have the `kernel_zfreei' function. */
-/* #undef HAVE_KERNEL_ZFREEI */
-
-/* define if you have kerberos 4 */
-/* #undef HAVE_KRB4 */
-
-/* define if you have kerberos 5 */
-#define HAVE_KRB5 1
-
-/* define if you have kerberos 4 compat */
-/* #undef HAVE_KRB5_COMPAT_KRB4 */
-
-/* Define to 1 if you have the `krb_afslog_uid' function. */
-/* #undef HAVE_KRB_AFSLOG_UID */
-
-/* define if you have krb_get_default_principal */
-/* #undef HAVE_KRB_GET_DEFAULT_PRINCIPAL */
-
-/* define if you have krb_get_default_tkt_root */
-/* #undef HAVE_KRB_GET_DEFAULT_TKT_ROOT */
-
-/* define if you have krb_get_err_text */
-/* #undef HAVE_KRB_GET_ERR_TEXT */
-
-/* define if you have krb_kdctimeofday */
-/* #undef HAVE_KRB_KDCTIMEOFDAY */
-
-/* define if you have a struct krb_principal */
-/* #undef HAVE_KRB_PRINCIPAL */
-
-/* Define to 1 if you have the <ktypes.h> header file. */
-/* #undef HAVE_KTYPES_H */
-
-/* Define to 1 if you have the <kvm.h> header file. */
-#define HAVE_KVM_H 1
-
-/* Define to 1 if you have the <libelf/nlist.h> header file. */
-/* #undef HAVE_LIBELF_NLIST_H */
-
-/* Define to 1 if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define to 1 if you have the <linux/devfs_fs.h> header file. */
-/* #undef HAVE_LINUX_DEVFS_FS_H */
-
-/* Define to 1 if you have the <linux/devfs_fs_kernel.h> header file. */
-/* #undef HAVE_LINUX_DEVFS_FS_KERNEL_H */
-
-/* Define to 1 if you have the `linux_kernel_int16_t' function. */
-/* #undef HAVE_LINUX_KERNEL_INT16_T */
-
-/* Define to 1 if you have the `linux_kernel_int32_t' function. */
-/* #undef HAVE_LINUX_KERNEL_INT32_T */
-
-/* Define to 1 if you have the `linux_kernel_int64_t' function. */
-/* #undef HAVE_LINUX_KERNEL_INT64_T */
-
-/* Define to 1 if you have the `linux_kernel_int8_t' function. */
-/* #undef HAVE_LINUX_KERNEL_INT8_T */
-
-/* Define to 1 if you have the `linux_kernel_uint16_t' function. */
-/* #undef HAVE_LINUX_KERNEL_UINT16_T */
-
-/* Define to 1 if you have the `linux_kernel_uint32_t' function. */
-/* #undef HAVE_LINUX_KERNEL_UINT32_T */
-
-/* Define to 1 if you have the `linux_kernel_uint64_t' function. */
-/* #undef HAVE_LINUX_KERNEL_UINT64_T */
-
-/* Define to 1 if you have the `linux_kernel_uint8_t' function. */
-/* #undef HAVE_LINUX_KERNEL_UINT8_T */
-
-/* Define to 1 if you have the <linux/stddef.h> header file. */
-/* #undef HAVE_LINUX_STDDEF_H */
-
-/* define if you have a function list_del_init */
-/* #undef HAVE_LIST_DEL_INIT */
-
-/* define if there exists a localtime_r */
-#define HAVE_LOCALTIME_R 1
-
-/* Define to 1 if the system has the type `long long'. */
-#define HAVE_LONG_LONG 1
-
-/* Define if you have the function `lstat'. */
-#define HAVE_LSTAT 1
-
-/* Define to 1 if you have the <machine/asm.h> header file. */
-#define HAVE_MACHINE_ASM_H 1
-
-/* Define to 1 if you have the <machine/regdef.h> header file. */
-/* #undef HAVE_MACHINE_REGDEF_H */
-
-/* Define to 1 if you have the <mach/alpha/asm.h> header file. */
-/* #undef HAVE_MACH_ALPHA_ASM_H */
-
-/* Define if you have the function `memmove'. */
-#define HAVE_MEMMOVE 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the <miscfs/genfs/genfs.h> header file. */
-/* #undef HAVE_MISCFS_GENFS_GENFS_H */
-
-/* Define to 1 if you have the <miscfs/syncfs/syncfs.h> header file. */
-/* #undef HAVE_MISCFS_SYNCFS_SYNCFS_H */
-
-/* Define if you have the function `mkstemp'. */
-#define HAVE_MKSTEMP 1
-
-/* Define to 1 if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* define if you have a ndbm library */
-#define HAVE_NDBM 1
-
-/* Define to 1 if you have the <ndbm.h> header file. */
-#define HAVE_NDBM_H 1
-
-/* Define to 1 if you have the <netdb.h> header file. */
-#define HAVE_NETDB_H 1
-
-/* Define to 1 if you have the <netinet6/in6.h> header file. */
-/* #undef HAVE_NETINET6_IN6_H */
-
-/* Define to 1 if you have the <netinet6/in6_var.h> header file. */
-#define HAVE_NETINET6_IN6_VAR_H 1
-
-/* Define to 1 if you have the <netinet/in6.h> header file. */
-/* #undef HAVE_NETINET_IN6_H */
-
-/* Define to 1 if you have the <netinet/in6_machtypes.h> header file. */
-/* #undef HAVE_NETINET_IN6_MACHTYPES_H */
-
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#define HAVE_NETINET_IN_H 1
-
-/* Define to 1 if you have the <netinet/in_systm.h> header file. */
-#define HAVE_NETINET_IN_SYSTM_H 1
-
-/* Define to 1 if you have the <netinet/ip.h> header file. */
-#define HAVE_NETINET_IP_H 1
-
-/* Define to 1 if you have the <netinet/tcp.h> header file. */
-#define HAVE_NETINET_TCP_H 1
-
-/* Define to 1 if you have the <net/if_dl.h> header file. */
-#define HAVE_NET_IF_DL_H 1
-
-/* Define to 1 if you have the <net/if.h> header file. */
-#define HAVE_NET_IF_H 1
-
-/* Define to 1 if you have the <net/if_types.h> header file. */
-#define HAVE_NET_IF_TYPES_H 1
-
-/* Define if NDBM really is DB (creates files *.db) */
-#define HAVE_NEW_DB 1
-
-/* Define to 1 if you have the <nlist.h> header file. */
-#define HAVE_NLIST_H 1
-
-/* Define to 1 if you have the `off64_t' function. */
-/* #undef HAVE_OFF64_T */
-
-/* define if lockstatus takes one argument */
-#define HAVE_ONE_ARGUMENT_LOCKSTATUS 1
-
-/* define if vget takes one argument */
-/* #undef HAVE_ONE_ARGUMENT_VGET */
-
-/* define if VOP_LOCK takes one argument */
-/* #undef HAVE_ONE_ARGUMENT_VOP_LOCK */
-
-/* Define to 1 if you have the `on_exit' function. */
-/* #undef HAVE_ON_EXIT */
-
-/* define if your system declares optarg */
-#define HAVE_OPTARG_DECLARATION 1
-
-/* define if your system declares opterr */
-#define HAVE_OPTERR_DECLARATION 1
-
-/* define if your system declares optind */
-#define HAVE_OPTIND_DECLARATION 1
-
-/* define if your system declares optopt */
-#define HAVE_OPTOPT_DECLARATION 1
-
-/* Define if you have the `optreset' variable. */
-#define HAVE_OPTRESET 1
-
-/* define if your system declares optreset */
-#define HAVE_OPTRESET_DECLARATION 1
-
-/* Define to 1 if you have the <paths.h> header file. */
-#define HAVE_PATHS_H 1
-
-/* Define to 1 if you have the `pidfile' function. */
-#define HAVE_PIDFILE 1
-
-/* define if you have sigaction */
-#define HAVE_POSIX_SIGNALS 1
-
-/* Define to 1 if you have the `pthread_create' function. */
-/* #undef HAVE_PTHREAD_CREATE */
-
-/* Define if you have the function `putenv'. */
-#define HAVE_PUTENV 1
-
-/* Define to 1 if you have the <pwd.h> header file. */
-#define HAVE_PWD_H 1
-
-/* Define to 1 if you have the `random' function. */
-#define HAVE_RANDOM 1
-
-/* Define if you have the function `rcmd'. */
-#define HAVE_RCMD 1
-
-/* define if you have a function readline */
-#define HAVE_READLINE 1
-
-/* Define if you have the function `readv'. */
-#define HAVE_READV 1
-
-/* Define if you have the function `recvmsg'. */
-#define HAVE_RECVMSG 1
-
-/* Define to 1 if you have the <regdef.h> header file. */
-/* #undef HAVE_REGDEF_H */
-
-/* Define to 1 if you have the `register_t' function. */
-#define HAVE_REGISTER_T 1
-
-/* define? */
-/* #undef HAVE_REPAIRABLE_HTONL */
-
-/* Define to 1 if you have the <resolv.h> header file. */
-#define HAVE_RESOLV_H 1
-
-/* Define to 1 if you have the `res_init' function. */
-#define HAVE_RES_INIT 1
-
-/* Define to 1 if you have the `res_nsearch' function. */
-/* #undef HAVE_RES_NSEARCH */
-
-/* Define to 1 if you have the `res_search' function. */
-#define HAVE_RES_SEARCH 1
-
-/* Define to 1 if you have the <rpcsvc/dbm.h> header file. */
-/* #undef HAVE_RPCSVC_DBM_H */
-
-/* Define to 1 if you have the <rpcsvc/ypclnt.h> header file. */
-#define HAVE_RPCSVC_YPCLNT_H 1
-
-/* Define to 1 if the system has the type `sa_family_t'. */
-#define HAVE_SA_FAMILY_T 1
-
-/* Define if you have the function `sendmsg'. */
-#define HAVE_SENDMSG 1
-
-/* Define to 1 if you have the `setattrlist' function. */
-/* #undef HAVE_SETATTRLIST */
-
-/* Define if you have the function `setegid'. */
-#define HAVE_SETEGID 1
-
-/* Define if you have the function `setenv'. */
-#define HAVE_SETENV 1
-
-/* Define if you have the function `seteuid'. */
-#define HAVE_SETEUID 1
-
-/* Define to 1 if you have the `setlogin' function. */
-#define HAVE_SETLOGIN 1
-
-/* Define to 1 if you have the `setprogname' function. */
-/* #undef HAVE_SETPROGNAME */
-
-/* Define to 1 if you have the `setsockopt' function. */
-#define HAVE_SETSOCKOPT 1
-
-/* Define to 1 if you have the `setstate' function. */
-#define HAVE_SETSTATE 1
-
-/* Define to 1 if you have the <shadow.h> header file. */
-/* #undef HAVE_SHADOW_H */
-
-/* define if ubc_lookup takes six arguments */
-/* #undef HAVE_SIX_ARGUMENT_UBC_LOOKUP */
-
-/* define if you have a working snprintf */
-#define HAVE_SNPRINTF 1
-
-/* Define to 1 if you have the `socket' function. */
-#define HAVE_SOCKET 1
-
-/* Define to 1 if the system has the type `socklen_t'. */
-#define HAVE_SOCKLEN_T 1
-
-/* Define to 1 if you have the `ssize_t' function. */
-#define HAVE_SSIZE_T 1
-
-/* Define to 1 if you have the <standards.h> header file. */
-/* #undef HAVE_STANDARDS_H */
-
-/* Define to 1 if you have the `statvfs' function. */
-/* #undef HAVE_STATVFS */
-
-/* Define to 1 if you have the <stdint.h> header file. */
-/* #undef HAVE_STDINT_H */
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* We always have <stds.h>, needed by rxkad */
-#define HAVE_STDS_H 1
-
-/* Define if you have the function `strcasecmp'. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the function `strdup'. */
-#define HAVE_STRDUP 1
-
-/* Define if you have the function `strerror'. */
-#define HAVE_STRERROR 1
-
-/* Define if you have the function `strftime'. */
-#define HAVE_STRFTIME 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the function `strlcat'. */
-#define HAVE_STRLCAT 1
-
-/* Define if you have the function `strlcpy'. */
-#define HAVE_STRLCPY 1
-
-/* Define if you have the function `strlwr'. */
-/* #undef HAVE_STRLWR */
-
-/* Define if you have the function `strncasecmp'. */
-#define HAVE_STRNCASECMP 1
-
-/* Define if you have the function `strndup'. */
-/* #undef HAVE_STRNDUP */
-
-/* Define if you have the function `strnlen'. */
-/* #undef HAVE_STRNLEN */
-
-/* Define if you have the function `strptime'. */
-#define HAVE_STRPTIME 1
-
-/* Define if you have the function `strsep'. */
-#define HAVE_STRSEP 1
-
-/* Define if you have the function `strsep_copy'. */
-/* #undef HAVE_STRSEP_COPY */
-
-/* Define to 1 if you have the `strsvis' function. */
-/* #undef HAVE_STRSVIS */
-
-/* Define if you have the function `strtok_r'. */
-#define HAVE_STRTOK_R 1
-
-/* Define to 1 if you have the `strtoll' function. */
-#define HAVE_STRTOLL 1
-
-/* Define to 1 if you have the `strtoq' function. */
-#define HAVE_STRTOQ 1
-
-/* Define to 1 if the system has the type `struct addrinfo'. */
-#define HAVE_STRUCT_ADDRINFO 1
-
-/* Define if struct cdevsw has field d_bmaj */
-/* #undef HAVE_STRUCT_CDEVSW_D_BMAJ */
-
-/* Define if struct cdevsw has field d_bogoparms */
-/* #undef HAVE_STRUCT_CDEVSW_D_BOGOPARMS */
-
-/* Define if struct cdevsw has field d_bogoreset */
-/* #undef HAVE_STRUCT_CDEVSW_D_BOGORESET */
-
-/* Define if struct cdevsw has field d_devtotty */
-/* #undef HAVE_STRUCT_CDEVSW_D_DEVTOTTY */
-
-/* Define if struct cdevsw has field d_kqfilter */
-/* #undef HAVE_STRUCT_CDEVSW_D_KQFILTER */
-
-/* Define if struct cdevsw has field d_maxio */
-/* #undef HAVE_STRUCT_CDEVSW_D_MAXIO */
-
-/* Define if struct cdevsw has field d_psize */
-/* #undef HAVE_STRUCT_CDEVSW_D_PSIZE */
-
-/* Define if struct cdevsw has field d_reset */
-/* #undef HAVE_STRUCT_CDEVSW_D_RESET */
-
-/* Define if struct cdevsw has field d_spare */
-/* #undef HAVE_STRUCT_CDEVSW_D_SPARE */
-
-/* Define if struct cdevsw has field d_stop */
-/* #undef HAVE_STRUCT_CDEVSW_D_STOP */
-
-/* Define if struct componentname has field cn_hash */
-#define HAVE_STRUCT_COMPONENTNAME_CN_HASH 1
-
-/* Define if struct dirent has field d_type. */
-#define HAVE_STRUCT_DIRENT_D_TYPE 1
-
-/* Define to 1 if the system has the type `struct ifaddrs'. */
-#define HAVE_STRUCT_IFADDRS 1
-
-/* Define if struct inode_operations has field default_file_ops */
-/* #undef HAVE_STRUCT_INODE_OPERATIONS_DEFAULT_FILE_OPS */
-
-/* Define to 1 if the system has the type `struct iovec'. */
-#define HAVE_STRUCT_IOVEC 1
-
-/* Define if struct mount has field mnt_syncer */
-#define HAVE_STRUCT_MOUNT_MNT_SYNCER 1
-
-/* Define if struct mount has field m_info */
-/* #undef HAVE_STRUCT_MOUNT_M_INFO */
-
-/* Define to 1 if the system has the type `struct msghdr'. */
-#define HAVE_STRUCT_MSGHDR 1
-
-/* Define if struct proc has field p_sigctx. */
-/* #undef HAVE_STRUCT_PROC_P_SIGCTX */
-
-/* Define if struct proc has field p_sigmask. */
-#define HAVE_STRUCT_PROC_P_SIGMASK 1
-
-/* Define to 1 if the system has the type `struct sockaddr'. */
-#define HAVE_STRUCT_SOCKADDR 1
-
-/* Define if struct sockaddr_in has field sin_len. */
-#define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1
-
-/* Define if struct sockaddr has field sa_len. */
-#define HAVE_STRUCT_SOCKADDR_SA_LEN 1
-
-/* Define to 1 if the system has the type `struct sockaddr_storage'. */
-#define HAVE_STRUCT_SOCKADDR_STORAGE 1
-
-/* define if you have struct spwd */
-/* #undef HAVE_STRUCT_SPWD */
-
-/* Define if struct super_operations has field notify_change */
-/* #undef HAVE_STRUCT_SUPER_OPERATIONS_NOTIFY_CHANGE */
-
-/* Define if struct sysent has field sy_flags */
-/* #undef HAVE_STRUCT_SYSENT_SY_FLAGS */
-
-/* Define if struct sysent has field sy_info */
-/* #undef HAVE_STRUCT_SYSENT_SY_INFO */
-
-/* Define if struct task_struct has field pending */
-/* #undef HAVE_STRUCT_TASK_STRUCT_PENDING */
-
-/* Define if struct tm has field tm_gmtoff. */
-#define HAVE_STRUCT_TM_TM_GMTOFF 1
-
-/* Define if struct tm has field tm_zone. */
-#define HAVE_STRUCT_TM_TM_ZONE 1
-
-/* Define if struct uio has field uio_procp */
-#define HAVE_STRUCT_UIO_UIO_PROCP 1
-
-/* Define if struct vfsconf has field vfc_mountroot */
-/* #undef HAVE_STRUCT_VFSCONF_VFC_MOUNTROOT */
-
-/* Define if struct vfsconf has field vfc_refcount */
-#define HAVE_STRUCT_VFSCONF_VFC_REFCOUNT 1
-
-/* Define if struct vfsops has field vfs_checkexp */
-#define HAVE_STRUCT_VFSOPS_VFS_CHECKEXP 1
-
-/* Define if struct vfsops has field vfs_done */
-/* #undef HAVE_STRUCT_VFSOPS_VFS_DONE */
-
-/* Define if struct vfsops has field vfs_freevfs */
-/* #undef HAVE_STRUCT_VFSOPS_VFS_FREEVFS */
-
-/* Define if struct vfsops has field vfs_mount */
-#define HAVE_STRUCT_VFSOPS_VFS_MOUNT 1
-
-/* Define if struct vfsops has field vfs_mountroot */
-/* #undef HAVE_STRUCT_VFSOPS_VFS_MOUNTROOT */
-
-/* Define if struct vfsops has field vfs_name */
-/* #undef HAVE_STRUCT_VFSOPS_VFS_NAME */
-
-/* Define if struct vfsops has field vfs_oid */
-/* #undef HAVE_STRUCT_VFSOPS_VFS_OID */
-
-/* Define if struct vfsops has field vfs_opv_descs */
-/* #undef HAVE_STRUCT_VFSOPS_VFS_OPV_DESCS */
-
-/* Define if struct vfsops has field vfs_reinit */
-/* #undef HAVE_STRUCT_VFSOPS_VFS_REINIT */
-
-/* Define if struct vfsops has field vfs_smoothsync */
-/* #undef HAVE_STRUCT_VFSOPS_VFS_SMOOTHSYNC */
-
-/* Define if struct vfsops has field vfs_swapvp */
-/* #undef HAVE_STRUCT_VFSOPS_VFS_SWAPVP */
-
-/* Define if struct vfsops has field vfs_uninit */
-/* #undef HAVE_STRUCT_VFSOPS_VFS_UNINIT */
-
-/* Define if struct ViceIoctl has field in */
-/* #undef HAVE_STRUCT_VICEIOCTL_IN */
-
-/* Define if struct vop_fsync_args has field a_flags */
-/* #undef HAVE_STRUCT_VOP_FSYNC_ARGS_A_FLAGS */
-
-/* Define if struct vop_getpages_args has field a_offset */
-/* #undef HAVE_STRUCT_VOP_GETPAGES_ARGS_A_OFFSET */
-
-/* Define if struct vop_putpages_args has field a_sync */
-/* #undef HAVE_STRUCT_VOP_PUTPAGES_ARGS_A_SYNC */
-
-/* define if struct winsize is declared in sys/termios.h */
-#define HAVE_STRUCT_WINSIZE 1
-
-/* Define to 1 if you have the `strunvis' function. */
-#define HAVE_STRUNVIS 1
-
-/* Define if you have the function `strupr'. */
-/* #undef HAVE_STRUPR */
-
-/* Define to 1 if you have the `strvis' function. */
-#define HAVE_STRVIS 1
-
-/* Define to 1 if you have the `strvisx' function. */
-#define HAVE_STRVISX 1
-
-/* Define to 1 if you have the `svis' function. */
-/* #undef HAVE_SVIS */
-
-/* Define if you have the function `swab'. */
-#define HAVE_SWAB 1
-
-/* Define to 1 if you have the `sysconf' function. */
-#define HAVE_SYSCONF 1
-
-/* Define to 1 if you have the `sysctl' function. */
-#define HAVE_SYSCTL 1
-
-/* Define to 1 if you have the `syslog' function. */
-#define HAVE_SYSLOG 1
-
-/* Define to 1 if you have the <syslog.h> header file. */
-#define HAVE_SYSLOG_H 1
-
-/* Define to 1 if you have the <sys/attr.h> header file. */
-/* #undef HAVE_SYS_ATTR_H */
-
-/* Define to 1 if you have the <sys/bitypes.h> header file. */
-/* #undef HAVE_SYS_BITYPES_H */
-
-/* Define to 1 if you have the <sys/bswap.h> header file. */
-/* #undef HAVE_SYS_BSWAP_H */
-
-/* Define to 1 if you have the <sys/cdefs.h> header file. */
-#define HAVE_SYS_CDEFS_H 1
-
-/* Define to 1 if you have the <sys/dir.h> header file. */
-#define HAVE_SYS_DIR_H 1
-
-/* Define to 1 if you have the <sys/file.h> header file. */
-#define HAVE_SYS_FILE_H 1
-
-/* Define to 1 if you have the <sys/inttypes.h> header file. */
-/* #undef HAVE_SYS_INTTYPES_H */
-
-/* Define to 1 if you have the <sys/ioccom.h> header file. */
-#define HAVE_SYS_IOCCOM_H 1
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define to 1 if you have the <sys/libkern.h> header file. */
-/* #undef HAVE_SYS_LIBKERN_H */
-
-/* Define to 1 if you have the <sys/lkm.h> header file. */
-#define HAVE_SYS_LKM_H 1
-
-/* Define to 1 if you have the <sys/lock.h> header file. */
-#define HAVE_SYS_LOCK_H 1
-
-/* Define to 1 if you have the <sys/mkdev.h> header file. */
-/* #undef HAVE_SYS_MKDEV_H */
-
-/* Define to 1 if you have the <sys/mman.h> header file. */
-#define HAVE_SYS_MMAN_H 1
-
-/* Define to 1 if you have the <sys/module.h> header file. */
-/* #undef HAVE_SYS_MODULE_H */
-
-/* Define to 1 if you have the <sys/mount.h> header file. */
-#define HAVE_SYS_MOUNT_H 1
-
-/* Define to 1 if you have the <sys/mutex.h> header file. */
-/* #undef HAVE_SYS_MUTEX_H */
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define to 1 if you have the <sys/poll.h> header file. */
-#define HAVE_SYS_POLL_H 1
-
-/* Define to 1 if you have the <sys/prctl.h> header file. */
-/* #undef HAVE_SYS_PRCTL_H */
-
-/* Define to 1 if you have the <sys/proc.h> header file. */
-#define HAVE_SYS_PROC_H 1
-
-/* Define to 1 if you have the <sys/queue.h> header file. */
-#define HAVE_SYS_QUEUE_H 1
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#define HAVE_SYS_RESOURCE_H 1
-
-/* Define to 1 if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define to 1 if you have the <sys/selinfo.h> header file. */
-/* #undef HAVE_SYS_SELINFO_H */
-
-/* Define to 1 if you have the <sys/signalvar.h> header file. */
-#define HAVE_SYS_SIGNALVAR_H 1
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#define HAVE_SYS_SOCKET_H 1
-
-/* Define to 1 if you have the <sys/sockio.h> header file. */
-#define HAVE_SYS_SOCKIO_H 1
-
-/* Define to 1 if you have the <sys/statfs.h> header file. */
-/* #undef HAVE_SYS_STATFS_H */
-
-/* Define to 1 if you have the <sys/statvfs.h> header file. */
-/* #undef HAVE_SYS_STATVFS_H */
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/syscallargs.h> header file. */
-#define HAVE_SYS_SYSCALLARGS_H 1
-
-/* Define to 1 if you have the <sys/sysctl.h> header file. */
-#define HAVE_SYS_SYSCTL_H 1
-
-/* Define to 1 if you have the <sys/sysent.h> header file. */
-/* #undef HAVE_SYS_SYSENT_H */
-
-/* Define to 1 if you have the <sys/sysproto.h> header file. */
-/* #undef HAVE_SYS_SYSPROTO_H */
-
-/* Define to 1 if you have the <sys/systm.h> header file. */
-/* #undef HAVE_SYS_SYSTM_H */
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H 1
-
-/* Define to 1 if you have the <sys/tty.h> header file. */
-#define HAVE_SYS_TTY_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <sys/ubc.h> header file. */
-/* #undef HAVE_SYS_UBC_H */
-
-/* Define to 1 if you have the <sys/uio.h> header file. */
-#define HAVE_SYS_UIO_H 1
-
-/* Define to 1 if you have the <sys/user.h> header file. */
-#define HAVE_SYS_USER_H 1
-
-/* Define to 1 if you have the <sys/utsname.h> header file. */
-#define HAVE_SYS_UTSNAME_H 1
-
-/* Define to 1 if you have the <sys/vfs.h> header file. */
-/* #undef HAVE_SYS_VFS_H */
-
-/* Define to 1 if you have the <sys/vfs_proto.h> header file. */
-/* #undef HAVE_SYS_VFS_PROTO_H */
-
-/* Define to 1 if you have the <sys/vnode.h> header file. */
-#define HAVE_SYS_VNODE_H 1
-
-/* Define to 1 if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define to 1 if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define to 1 if you have the `tf_init' function. */
-/* #undef HAVE_TF_INIT */
-
-/* Define to 1 if you have the `tgetent' function. */
-#define HAVE_TGETENT 1
-
-/* define if selrecord takes three arguments */
-/* #undef HAVE_THREE_ARGUMENT_SELRECORD */
-
-/* define if vfs_busy takes three arguments */
-/* #undef HAVE_THREE_ARGUMENT_VFS_BUSY */
-
-/* define if vfs_name_hash takes three arguments */
-/* #undef HAVE_THREE_ARGUMENT_VFS_NAME_HASH */
-
-/* define if vget takes three arguments */
-#define HAVE_THREE_ARGUMENT_VGET 1
-
-/* define if VOP_LOCK takes three arguments */
-#define HAVE_THREE_ARGUMENT_VOP_LOCK 1
-
-/* Define to 1 if you have the `thr_yield' function. */
-/* #undef HAVE_THR_YIELD */
-
-/* Define if you have the `timezone' variable. */
-#define HAVE_TIMEZONE 1
-
-/* define if your system declares timezone */
-#define HAVE_TIMEZONE_DECLARATION 1
-
-/* define if lockstatus takes two arguments */
-/* #undef HAVE_TWO_ARGUMENT_LOCKSTATUS */
-
-/* define if suser takes two arguments */
-#define HAVE_TWO_ARGUMENT_SUSER 1
-
-/* define if vfs_getnewfsid takes two arguments */
-/* #undef HAVE_TWO_ARGUMENT_VFS_GETNEWFSID */
-
-/* define if vfs_busy takes two arguments */
-#define HAVE_TWO_ARGUMENT_VFS_BUSY 1
-
-/* define if vget takes two arguments */
-/* #undef HAVE_TWO_ARGUMENT_VGET */
-
-/* define if VOP_LOCK takes two arguments */
-/* #undef HAVE_TWO_ARGUMENT_VOP_LOCK */
-
-/* Define to 1 if you have the `uint16_t' function. */
-#define HAVE_UINT16_T 1
-
-/* Define to 1 if you have the `uint32_t' function. */
-#define HAVE_UINT32_T 1
-
-/* Define to 1 if you have the `uint64_t' function. */
-#define HAVE_UINT64_T 1
-
-/* Define to 1 if you have the `uint8_t' function. */
-#define HAVE_UINT8_T 1
-
-/* Define to 1 if you have the `uintptr_t' function. */
-/* #undef HAVE_UINTPTR_T */
-
-/* Define to 1 if you have the `uname' function. */
-#define HAVE_UNAME 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the function `unsetenv'. */
-#define HAVE_UNSETENV 1
-
-/* Define to 1 if you have the `unvis' function. */
-#define HAVE_UNVIS 1
-
-/* Define to 1 if you have the <userconf.h> header file. */
-/* #undef HAVE_USERCONF_H */
-
-/* Define to 1 if you have the <usersec.h> header file. */
-/* #undef HAVE_USERSEC_H */
-
-/* Define to 1 if you have the <util.h> header file. */
-#define HAVE_UTIL_H 1
-
-/* Define to 1 if you have the <uvm/uvm_extern.h> header file. */
-#define HAVE_UVM_UVM_EXTERN_H 1
-
-/* Define to 1 if you have the `u_int16' function. */
-/* #undef HAVE_U_INT16 */
-
-/* Define to 1 if you have the `u_int16_t' function. */
-#define HAVE_U_INT16_T 1
-
-/* Define to 1 if you have the `u_int32' function. */
-/* #undef HAVE_U_INT32 */
-
-/* Define to 1 if you have the `u_int32_t' function. */
-#define HAVE_U_INT32_T 1
-
-/* Define to 1 if you have the `u_int64_t' function. */
-#define HAVE_U_INT64_T 1
-
-/* Define to 1 if you have the `u_int8_t' function. */
-#define HAVE_U_INT8_T 1
-
-/* Define to 1 if you have the `vasnprintf' function. */
-/* #undef HAVE_VASNPRINTF */
-
-/* Define to 1 if you have the `vasprintf' function. */
-#define HAVE_VASPRINTF 1
-
-/* Define if you have the function `verr'. */
-#define HAVE_VERR 1
-
-/* Define if you have the function `verrx'. */
-#define HAVE_VERRX 1
-
-/* Define to 1 if you have the `vis' function. */
-#define HAVE_VIS 1
-
-/* Define to 1 if you have the <vis.h> header file. */
-#define HAVE_VIS_H 1
-
-/* Define to 1 if you have the <vm/uma.h> header file. */
-/* #undef HAVE_VM_UMA_H */
-
-/* Define to 1 if you have the <vm/vm_extern.h> header file. */
-/* #undef HAVE_VM_VM_EXTERN_H */
-
-/* Define to 1 if you have the <vm/vm.h> header file. */
-/* #undef HAVE_VM_VM_H */
-
-/* Define to 1 if you have the <vm/vm_object.h> header file. */
-/* #undef HAVE_VM_VM_OBJECT_H */
-
-/* Define to 1 if you have the <vm/vm_pager.h> header file. */
-/* #undef HAVE_VM_VM_PAGER_H */
-
-/* Define to 1 if you have the <vm/vm_zone.h> header file. */
-/* #undef HAVE_VM_VM_ZONE_H */
-
-/* Define to 1 if you have the <vm/vnode_pager.h> header file. */
-/* #undef HAVE_VM_VNODE_PAGER_H */
-
-/* define if you have a vop_t */
-/* #undef HAVE_VOP_T */
-
-/* define if you have a working vsnprintf */
-#define HAVE_VSNPRINTF 1
-
-/* Define if you have the function `vsyslog'. */
-#define HAVE_VSYSLOG 1
-
-/* Define if you have the function `vwarn'. */
-#define HAVE_VWARN 1
-
-/* Define if you have the function `vwarnx'. */
-#define HAVE_VWARNX 1
-
-/* define if you have a wait_queue_head_t */
-/* #undef HAVE_WAIT_QUEUE_HEAD_T */
-
-/* define if you have a wait_queue_task_list */
-/* #undef HAVE_WAIT_QUEUE_TASK_LIST */
-
-/* Define if you have the function `warn'. */
-#define HAVE_WARN 1
-
-/* Define if you have the function `warnx'. */
-#define HAVE_WARNX 1
-
-/* Define to 1 if you have the <winsock.h> header file. */
-/* #undef HAVE_WINSOCK_H */
-
-/* Define if you have the function `writev'. */
-#define HAVE_WRITEV 1
-
-/* define if struct winsize has ws_xpixel */
-#define HAVE_WS_XPIXEL 1
-
-/* define if struct winsize has ws_ypixel */
-#define HAVE_WS_YPIXEL 1
-
-/* Define if you have the `_res' variable. */
-#define HAVE__RES 1
-
-/* define if your system declares _res */
-#define HAVE__RES_DECLARATION 1
-
-/* define if your compiler has __attribute__ */
-#define HAVE___ATTRIBUTE__ 1
-
-/* define if your compiler has __FUNCTION__ */
-#define HAVE___FUNCTION__ 1
-
-/* Define if you have the `__progname' variable. */
-#define HAVE___PROGNAME 1
-
-/* define if your system declares __progname */
-/* #undef HAVE___PROGNAME_DECLARATION */
-
-/* define this if on Irix6.4 or higher */
-/* #undef IRIX_64 */
-
-/* define if you have kerberos */
-#define KERBEROS 1
-
-/* define if the system is missing a prototype for asnprintf() */
-#define NEED_ASNPRINTF_PROTO 1
-
-/* define if the system is missing a prototype for asprintf() */
-/* #undef NEED_ASPRINTF_PROTO */
-
-/* define if the system is missing a prototype for crypt() */
-/* #undef NEED_CRYPT_PROTO */
-
-/* define if the system is missing a prototype for gethostname() */
-/* #undef NEED_GETHOSTNAME_PROTO */
-
-/* define if the system is missing a prototype for getusershell() */
-/* #undef NEED_GETUSERSHELL_PROTO */
-
-/* define if the system is missing a prototype for glob() */
-/* #undef NEED_GLOB_PROTO */
-
-/* define if the system is missing a prototype for hstrerror() */
-/* #undef NEED_HSTRERROR_PROTO */
-
-/* define if the system is missing a prototype for inet_aton() */
-/* #undef NEED_INET_ATON_PROTO */
-
-/* define if the system is missing a prototype for issignal() */
-/* #undef NEED_ISSIGNAL_PROTO */
-
-/* define if the system is missing a prototype for mkstemp() */
-/* #undef NEED_MKSTEMP_PROTO */
-
-/* define if the system is missing a prototype for select() */
-/* #undef NEED_SELECT_PROTO */
-
-/* define if the system is missing a prototype for setenv() */
-/* #undef NEED_SETENV_PROTO */
-
-/* libsl need sl_apropos */
-/* #undef NEED_SLCOMPAT_SL_APROPOS */
-
-/* define if the system is missing a prototype for snprintf() */
-/* #undef NEED_SNPRINTF_PROTO */
-
-/* define if the system is missing a prototype for strncmp() */
-#define NEED_STRNCMP_PROTO 1
-
-/* define if the system is missing a prototype for strndup() */
-#define NEED_STRNDUP_PROTO 1
-
-/* define if the system is missing a prototype for strsep() */
-/* #undef NEED_STRSEP_PROTO */
-
-/* define if the system is missing a prototype for strsvis() */
-/* #undef NEED_STRSVIS_PROTO */
-
-/* define if the system is missing a prototype for strtok_r() */
-/* #undef NEED_STRTOK_R_PROTO */
-
-/* define if the system is missing a prototype for strunvis() */
-/* #undef NEED_STRUNVIS_PROTO */
-
-/* define if the system is missing a prototype for strvisx() */
-/* #undef NEED_STRVISX_PROTO */
-
-/* define if the system is missing a prototype for strvis() */
-/* #undef NEED_STRVIS_PROTO */
-
-/* define if the system is missing a prototype for svis() */
-/* #undef NEED_SVIS_PROTO */
-
-/* define if the system is missing a prototype for ubc_pushdirty() */
-#define NEED_UBC_PUSHDIRTY_PROTO 1
-
-/* define if the system is missing a prototype for unsetenv() */
-/* #undef NEED_UNSETENV_PROTO */
-
-/* define if the system is missing a prototype for unvis() */
-/* #undef NEED_UNVIS_PROTO */
-
-/* define if the system is missing a prototype for vasnprintf() */
-#define NEED_VASNPRINTF_PROTO 1
-
-/* define if the system is missing a prototype for vasprintf() */
-/* #undef NEED_VASPRINTF_PROTO */
-
-/* define if the system is missing a prototype for vgonel() */
-/* #undef NEED_VGONEL_PROTO */
-
-/* define if you need 32 bit compat pioctl */
-/* #undef NEED_VICEIOCTL32 */
-
-/* define if the system is missing a prototype for vis() */
-/* #undef NEED_VIS_PROTO */
-
-/* define if the system is missing a prototype for vn_writechk() */
-/* #undef NEED_VN_WRITECHK_PROTO */
-
-/* define if the system is missing a prototype for vsnprintf() */
-/* #undef NEED_VSNPRINTF_PROTO */
-
-/* define if prototype of openlog is compatible with void openlog(const char
- *, int, int) */
-#define OPENLOG_PROTO_COMPATIBLE 1
-
-/* Name of package */
-#define PACKAGE "arla"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "arla-drinkers@stacken.kth.se"
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "arla"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "arla 0.36pre29"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "arla"
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "0.36pre29"
-
-/* Define if getlogin has POSIX flavour (and not BSD). */
-/* #undef POSIX_GETLOGIN */
-
-/* define this if your as understands .register */
-/* #undef PROG_AS_UNDERSTANDS_REGISTER */
-
-/* Define if you have the readline package. */
-/* #undef READLINE */
-
-/* Define as the return type of signal handlers (`int' or `void'). */
-#define RETSIGTYPE void
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#define TIME_WITH_SYS_TIME 1
-
-/* Version number of package */
-#define VERSION "0.36pre29"
-
-/* Define if signal handlers return void. */
-#define VOID_RETSIGTYPE 1
-
-/* define if target is big endian */
-/* #undef WORDS_BIGENDIAN */
-
-/* Define to 1 if the X Window System is missing or not being used. */
-/* #undef X_DISPLAY_MISSING */
-
-/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
- `char[]'. */
-#define YYTEXT_POINTER 1
-
-
-/*
- * Defining this enables us to get the definition of `sigset_t' and
- * other importatnt definitions on Solaris.
- */
-
-#ifndef __EXTENSIONS__
-#define __EXTENSIONS__
-#endif
-
-
-/* Define to empty if `const' does not conform to ANSI C. */
-/* #undef const */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef gid_t */
-
-/* Define as `__inline' if that's what the C compiler calls it, or to nothing
- if it is not supported. */
-/* #undef inline */
-
-/* Define to `int' if <sys/types.h> does not define. */
-/* #undef pid_t */
-
-/* Define to `unsigned' if <sys/types.h> does not define. */
-/* #undef size_t */
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef uid_t */
-
-
-#if !(defined(USING_ASM) || defined(_KERNEL) || defined(__KERNEL__) || defined(_LKM) || defined(KERNEL))
-#if ENDIANESS_IN_SYS_PARAM_H
-# include <sys/types.h>
-# include <sys/param.h>
-# if BYTE_ORDER == BIG_ENDIAN
-# define WORDS_BIGENDIAN 1
-# endif
-#endif
-#endif
-
-
-#ifdef VOID_RETSIGTYPE
-#define SIGRETURN(x) return
-#else
-#define SIGRETURN(x) return (RETSIGTYPE)(x)
-#endif
-
-#ifdef BROKEN_REALLOC
-#define realloc(X, Y) isoc_realloc((X), (Y))
-#define isoc_realloc(X, Y) ((X) ? realloc((X), (Y)) : malloc(Y))
-#endif
-
-#ifdef __hppa__
-#define __hp9000s800
-#endif
diff --git a/usr.sbin/afs/lib/Makefile b/usr.sbin/afs/lib/Makefile
deleted file mode 100644
index 0834f966e74..00000000000
--- a/usr.sbin/afs/lib/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-# $OpenBSD: Makefile,v 1.1 2002/06/07 05:02:58 hin Exp $
-
-SUBDIR = libarla
-
-.include <bsd.subdir.mk> \ No newline at end of file
diff --git a/usr.sbin/afs/lib/libarla/Makefile b/usr.sbin/afs/lib/libarla/Makefile
deleted file mode 100644
index 6d5a53fb1a6..00000000000
--- a/usr.sbin/afs/lib/libarla/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-# $OpenBSD: Makefile,v 1.2 2006/09/29 10:04:17 martin Exp $
-
-#
-# You don't want to understand this makefile.
-#
-
-AFSTOPDIR = ../..
-.include <../../Makefile.inc>
-
-LIB = arla
-NOPIC =
-NOPROFILE=
-MAN =
-
-CFLAGS += -DHAVE_CONFIG_H -I. -I${AFSSRC}/util
-
-# Don't install libarla.a
-install:
-
-.include "Makefile.lwp.inc"
-.include "Makefile.rx.inc"
-.include "Makefile.rxdef.inc"
-.include "Makefile.rxkad.inc"
-.include "Makefile.ko.inc"
-.include "Makefile.bufdir.inc"
-.include "Makefile.util.inc"
-.include "Makefile.sl.inc"
-.include "Makefile.arla.inc"
-
-.include <bsd.lib.mk>
diff --git a/usr.sbin/afs/lib/libarla/Makefile.arla.inc b/usr.sbin/afs/lib/libarla/Makefile.arla.inc
deleted file mode 100644
index e734a063889..00000000000
--- a/usr.sbin/afs/lib/libarla/Makefile.arla.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-SRCS += arlalib.c \
- fs_lib.c \
- ka-procs.c \
- tokens.c \
- print_version.c
-
-CFLAGS += -I${AFSSRC}/appl/lib
-.PATH: ${AFSSRC}/appl/lib
diff --git a/usr.sbin/afs/lib/libarla/Makefile.bufdir.inc b/usr.sbin/afs/lib/libarla/Makefile.bufdir.inc
deleted file mode 100644
index ae2649f89b6..00000000000
--- a/usr.sbin/afs/lib/libarla/Makefile.bufdir.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-### bufdir stuff
-SRCS += fdir.c fbuf.c
-CFLAGS += -I${AFSSRC}/lib/bufdir
-.PATH: ${AFSSRC}/lib/bufdir
diff --git a/usr.sbin/afs/lib/libarla/Makefile.ko.inc b/usr.sbin/afs/lib/libarla/Makefile.ko.inc
deleted file mode 100644
index eaa0db62f9d..00000000000
--- a/usr.sbin/afs/lib/libarla/Makefile.ko.inc
+++ /dev/null
@@ -1,37 +0,0 @@
-### ko stuff
-
-.PATH: $(ROKENSRC)
-
-OS_VER != uname -r
-
-SRCS += koerror.c \
- kocell.c \
- ports.c \
- vlmisc.c \
- part.c \
- agetarg.c \
- uae.c \
- sysname.c \
- afs_uuid.c \
- misc.c \
- ko_resolve.c
-
-# resolve.c exists in roken as well *sigh*
-ko_resolve.c:
- ln -sf $(AFSSRC)/lib/ko/resolve.c ko_resolve.c
-
-CLEANFILES += sysname.c gensysname gensysname.o getarg.o strupr.o \
- get_window_size.o
-CFLAGS += -I${AFSSRC}/lib/ko
-
-.PATH: ${AFSSRC}/lib/ko
-.PATH: ${.CURDIR}/${AFSTOPDIR}/../../kerberosV/src/lib/roken
-
-sysname.c: gensysname
- ./gensysname -c > sysname.c
-
-gensysname.o: vldb.h lwp.h
-gensysname: gensysname.o getarg.o strupr.o get_window_size.o
- ${HOSTCC} ${CFLAGS} -o gensysname gensysname.o getarg.o strupr.o get_window_size.o
-
-CLEANFILES+= gensysname.o agetarg.o
diff --git a/usr.sbin/afs/lib/libarla/Makefile.lwp.inc b/usr.sbin/afs/lib/libarla/Makefile.lwp.inc
deleted file mode 100644
index c6ac177b93c..00000000000
--- a/usr.sbin/afs/lib/libarla/Makefile.lwp.inc
+++ /dev/null
@@ -1,40 +0,0 @@
-### lwp stuff
-SRCS += lwp.c lock.c iomgr.c timer.c fasttime.c preempt.c q.c
-OBJS += process.o
-CLEANFILES += process.S process.o lwp.c lwp.h
-.PATH: ${AFSSRC}/lwp
-CFLAGS += -DAFS_BSD_ENV -DFD_SPEED_HACK -I${AFSSRC}/lwp
-AINC += -DUSING_ASM -DHAVE_PIC
-
-# We use the handcoded assembler stuff for context switching, not
-# pthreads (because pthreads do not work for now).
-
-beforedepend: lwp.c lwp.h
-
-lwp.h:
- ln -sf ${AFSSRC}/lwp/lwp_asm.h lwp.h
-lwp.c:
- ln -sf ${AFSSRC}/lwp/lwp_asm.c lwp.c
-
-process.S:
- HOST_CPU=${MACHINE_ARCH}; \
- case "$$HOST_CPU" in \
- arm) PROCESS_S="process.arm.S" ;; \
- amd64) PROCESS_S="process.x86_64.S" ;; \
- sparc64) PROCESS_S="process.sparc.S" ;; \
- sparc) PROCESS_S="process.sparc.S" ;; \
- i*86*) PROCESS_S="process.i386.S" ;; \
- m68k) PROCESS_S="process.m68k.S" ;; \
- m88k) PROCESS_S="process.m88k.S" ;; \
- mips*) PROCESS_S="process.mips.S" ;; \
- alpha*) PROCESS_S="process.alpha.S" ;; \
- hppa*) PROCESS_S="process.hpux.S" ;; \
- powerpc) PROCESS_S="process.ppc.S" ;; \
- rs6000) PROCESS_S="process.rios.S" ;; \
- sh) PROCESS_S="process.sh.S" ;; \
- vax) PROCESS_S="process.vax.S" ;; \
- *) echo "Unknown host_cpu, good luck" ;; \
- esac; \
- ln -s ${AFSSRC}/lwp/$$PROCESS_S process.S
-
-all: lwp.h
diff --git a/usr.sbin/afs/lib/libarla/Makefile.rx.inc b/usr.sbin/afs/lib/libarla/Makefile.rx.inc
deleted file mode 100644
index 8830202040b..00000000000
--- a/usr.sbin/afs/lib/libarla/Makefile.rx.inc
+++ /dev/null
@@ -1,15 +0,0 @@
-### rx stuff
-SRCS += rx_clock.c \
- rx_event.c \
- rx_user.c \
- rx.c \
- rx_globs.c \
- rx_null.c \
- rx_misc.c \
- rx_pkt.c \
- rx_rdwr.c \
- rx_multi.c \
- rx_trace.c
-
-CFLAGS += -I${AFSSRC}/rx -I${AFSSRC}
-.PATH: ${AFSSRC}/rx
diff --git a/usr.sbin/afs/lib/libarla/Makefile.rxdef.inc b/usr.sbin/afs/lib/libarla/Makefile.rxdef.inc
deleted file mode 100644
index 50e2ec9acbf..00000000000
--- a/usr.sbin/afs/lib/libarla/Makefile.rxdef.inc
+++ /dev/null
@@ -1,28 +0,0 @@
-### rxdef stuff
-includes: fs.h vldb.h cb.h pts.h bos.h volumeserver.h ubik.h bos.h ka.h
-
-## No, cb.ss.c is _not_ a mistake. The _client_ is the callback server.
-SRCS += vldb.cs.c \
- fs.cs.c \
- cb.ss.c \
- pts.cs.c \
- volumeserver.cs.c \
- ubik.cs.c \
- bos.cs.c \
- ka.cs.c
-
-CFLAGS += -I${AFSSRC}/rxdef -I${AFSSRC}/arlad
-
-YDRFLAGS = -I${.CURDIR}
-.PATH: ${AFSSRC}/rxdef
-
-.for f in vldb fs cb pts volumeserver ubik bos ka
-
-stamp_$f: $f.xg
- $(YDR) $(YDRFLAGS) ${AFSSRC}/rxdef/$f.xg
- touch $@
-
-$f.cs.c $f.cs.h $f.ss.c $f.ss.h $f.ydr.c $f.h: stamp_$f
-
-CLEANFILES+=$f.cs.c $f.cs.h $f.ss.c $f.ss.h $f.ydr.c $f.h stamp_$f
-.endfor
diff --git a/usr.sbin/afs/lib/libarla/Makefile.rxkad.inc b/usr.sbin/afs/lib/libarla/Makefile.rxkad.inc
deleted file mode 100644
index fab12d8e2c8..00000000000
--- a/usr.sbin/afs/lib/libarla/Makefile.rxkad.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-### rxkad stuff
-SRCS += rxk_locl.c \
- rxk_clnt.c \
- rxk_crpt.c \
- osi_alloc.c
-
-CFLAGS += -I${AFSSRC}/rxkad
-
-.PATH: ${AFSSRC}/rxkad
diff --git a/usr.sbin/afs/lib/libarla/Makefile.sl.inc b/usr.sbin/afs/lib/libarla/Makefile.sl.inc
deleted file mode 100644
index 133b24f10b5..00000000000
--- a/usr.sbin/afs/lib/libarla/Makefile.sl.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-SRCS += sl.c
-CFLAGS += -I${AFSSRC}/lib/sl
-
-.PATH: ${AFSSRC}/lib/sl
diff --git a/usr.sbin/afs/lib/libarla/Makefile.util.inc b/usr.sbin/afs/lib/libarla/Makefile.util.inc
deleted file mode 100644
index ad70e7d1882..00000000000
--- a/usr.sbin/afs/lib/libarla/Makefile.util.inc
+++ /dev/null
@@ -1,7 +0,0 @@
-SRCS += log.c \
- hash.c \
- heap.c \
- list.c \
- arlamath.c
-
-.PATH: ${AFSSRC}/util
diff --git a/usr.sbin/afs/libexec/Makefile b/usr.sbin/afs/libexec/Makefile
deleted file mode 100644
index 7f29db7cd33..00000000000
--- a/usr.sbin/afs/libexec/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-# $OpenBSD: Makefile,v 1.1 2002/06/07 05:02:58 hin Exp $
-
-SUBDIR= afsd
-
-.include <bsd.subdir.mk>
diff --git a/usr.sbin/afs/libexec/afsd/Makefile b/usr.sbin/afs/libexec/afsd/Makefile
deleted file mode 100644
index fd7a2e1d5d6..00000000000
--- a/usr.sbin/afs/libexec/afsd/Makefile
+++ /dev/null
@@ -1,54 +0,0 @@
-# $OpenBSD: Makefile,v 1.7 2005/12/16 19:38:40 todd Exp $
-
-AFSTOPDIR= ../..
-.include <../../Makefile.inc>
-
-.PATH: $(ROKENSRC)
-
-PROG = afsd
-MAN = afsd.8 CellServDB.5 ThisCell.5 SuidCells.5 afsd.conf.5 DynRootDB.5 \
- AliasDB.5
-BINDIR = /usr/libexec
-LDADD += ${LIBARLA} -lkrb5 -lasn1 -lcrypto
-DPADD += ${LIBARLA}
-
-CFLAGS += -I${AFSSRC}/util -I${AFSSRC}/arlad \
- -I${AFSSRC}
-
-SRCS = adir.c \
- arla.c \
- arlad.c \
- arladeb.c \
- arladebu.c \
- bsd-subr.c \
- cmcb.c \
- conn.c \
- cred.c \
- d-trans.c \
- disco.c \
- dynroot.c \
- fcache.c \
- fprio.c \
- inter.c \
- kernel.c \
- messages.c \
- nnpfs.c \
- poller.c \
- state.c \
- stats.c \
- subr.c \
- volcache.c \
- estrdup.c \
- erealloc.c \
- print_version.c
-
-.PATH: ${AFSSRC}/arlad
-
-afsd.8:
- ln -s ${AFSSRC}/arlad/arlad.8 afsd.8
-afsd.conf.5:
- ln -s ${AFSSRC}/arlad/arla.conf.5 afsd.conf.5
-
-CLEANFILES+=afsd.8 fbuf.h fdir.h afs_dir.h afsd.conf.5
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/afs/src/.cvsignore b/usr.sbin/afs/src/.cvsignore
deleted file mode 100644
index 75a58a36051..00000000000
--- a/usr.sbin/afs/src/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-ID
-configure
-config.h.in
-TAGS
-aclocal.m4
diff --git a/usr.sbin/afs/src/.indent.pro b/usr.sbin/afs/src/.indent.pro
deleted file mode 100644
index 52b50d7c837..00000000000
--- a/usr.sbin/afs/src/.indent.pro
+++ /dev/null
@@ -1,29 +0,0 @@
--bad
--bap
--bbb
--nbc
--br
--c40
--cdb
--ce
--cli0
--d0
--di1
--ndj
--ei
--nfc1
--i4
--ip
--l78
--lp
--npcs
--psl
--sc
--nsob
--Tpag_t
--Txfs_cred
--Txfs_message_function
--Txfs_handle
--Txfs_cache_handle
--Txfs_attr
--Topaque
diff --git a/usr.sbin/afs/src/ChangeLog b/usr.sbin/afs/src/ChangeLog
deleted file mode 100644
index 8cf1dd96620..00000000000
--- a/usr.sbin/afs/src/ChangeLog
+++ /dev/null
@@ -1,1075 +0,0 @@
-2003-07-15 Love <lha@stacken.kth.se>
-
- * nnpfs/bsd/nnpfs_dev-common.c: freebsd5.x needs
- nnpfs_block_sigset too
-
- * nnpfs/bsd/nnpfs_dev-common.c: drop support for freebsd 5.0 and
- only support freebsd 5.1
-
-2003-07-01 Tomas Olsson <tol@stacken.kth.se>
-
- * nnpfs/winnt/src/nnpfs_init.c (nnpfs_initdevice): use nnpfs_fsd_*
- wrappers
-
- * nnpfs/winnt/src/nnpfs_vops.c: defined wrappers (nnpfs_fsd_*) for
- all fsd entry points.
- (nnpfs_{handle_stale,data_valid}): some lock handling
-
- * nnpfs/winnt/src/nnpfs_node.c
- (nnpfs_{vrele,node_gc_all,close_data_handle,open_file,open_fh}):
- locking
-
- * nnpfs/winnt/src/nnpfs_message.c
- (nnpfs_message_{installdata,invalidnode}): lock MainResource
-
- * nnpfs/winnt/src/nnpfs_fastio.c (nnpfs_fastio_read): don't print
- buffer contents, use FsRtlE{nter,xit}FileSystem
- (nnpfs_createsec_acq): use FsRtlE{nter,xit}FileSystem
- (nnpfs_lazywrite_{acq,rel}): use node->lazy_writer
-
- * nnpfs/winnt/src/nnpfs_dnlc.c (*): more
- FsRtlE{nter,xit}FileSystem usage
- * nnpfs/winnt/src/nnpfs_dev.c (*): more FsRtlE{nter,xit}FileSystem
- usage
-
- * nnpfs/winnt/src/nnpfs_dev.c (nnpfs_devctl): renamed to
- nnpfs_fsd_devctl sprinkle some FsRtlE{nter,xit}FileSystem()
-
- * nnpfs/winnt/inc/nnpfs_proto.h: added DEFINE_IRP:s for wrappers
- for fsd entry points
-
- * nnpfs/winnt/inc/nnpfs_locl.h (nnpfs_node): store lazy writer
- thread
-
-2003-06-26 Tomas Olsson <tol@stacken.kth.se>
-
- * nnpfs/winnt/src/inc/nnpfs_locl.h
- use FastMutex to protect zone allocation and nodelist
-
- * nnpfs/winnt/src/nnpfs_{dev,dnlc,init,misc}.c
- use FastMutex to protect zone allocation and nodelist
-
- * nnpfs/winnt/src/nnpfs_node.c (*): use FastMutexes to protect
- zone allocation and node list
- (nnpfs_open_fh): added
-
- * nnpfs/winnt/src/nnpfs_message.c (nnpfs_message_gc_node): set
- STALE and call vgone() for unused nodes
-
- * nnpfs/winnt/src/nnpfs_vops.c (nnpfs_get_dummynode): clear
- wake_event
- (nnpfs_readwrite): hold PagingIoResource when paging
-
- * nnpfs/winnt/src/nnpfs_fastio.c (nnpfs_fastio_initmap): added
- (*): updated lock handling, use nnpfs_fastio_initmap
-
-2003-06-12 Love <lha@stacken.kth.se>
-
- * appl/lib/arlalib.c: add more v4 glue
-
- * rxkad/rxkad_locl.h: protect v4 stuff with #ifdef HAVE_KRB4
-
- * appl/lib/Makefile.in: add krb5 includes
-
- * include/stds.h: s/HAVE_KERBEROS/KERBEROS/
-
- * appl/lib/appl_locl.h: add <krb5.h>
-
-2003-06-11 Love <lha@stacken.kth.se>
-
- * appl/lib/arlalib.c: add krb5 support, untested
-
- * rxkad/rxk_serv.c: avoid warning
-
- * rxkad/rxk_serv.c: make rxkad_NewServerSecurityObject match
- prototype
-
- * appl/lib/arlalib.c: change enable to support krb5, now just fill
- in the blanks
-
-2003-06-10 Love <lha@stacken.kth.se>
-
- * rxkad/Makefile.am: drop rxk_info.c its a server function
-
- * rx/rx_misc.c: drop osi_{Alloc,Free}, we use macros
-
- * lib/ko/koerror.c: wrap krb4 stuff with HAVE_KRB4
-
- * lib/ko/kocell.c: wrap krb4 stuff with krb4
-
- * configure.in: add AC_FUNC_KAFS_SETTOKEN_RXKAD
-
- * lib/ko/auth.c: wrap krb4 stuff with krb4, use kafs_settoken_rxkad
-
- * include/netbsd-lkm/Makefile: include <bsd.own.mk>
-
- * include/stds.h: more kerberos4 defines
-
- * appl/lib/arlalib.c: wrap krb4 stuff in HAVE_KRB4
-
- * appl/lib/appl_locl.h: wrap krb4 stuff in HAVE_KRB4
-
- * rxkad/Makefile.am: drop rxkad server end (to be build later as
- rxkad_server)
-
- * configure.in: make include k5 stuff in rxkad lib
-
- * arlad/arla_local.h: wrap krb4 stuff in HAVE_KRB4
-
- * arlad/arla.c: wrap krb4 stuff in HAVE_KRB4
-
- * arlad/Makefile.in: use krb5 cflags too
-
- * arlad/cred.h: use MAXKRB4TICKETLEN
-
- * rxkad/rxkad.h: provide MAXKRB4TICKETLEN
-
- * appl/perf/afsfsperf.c: wrap <krb.h> with HAVE_KRB4
-
- * lib/ko/auth.h: put ifdef HAVE_KRB4 around <krb.h>
-
- * arlad/{arla-cli.c,conn.c,cred.c,cred.h,messages.c}:
- remove depency on CREDENTIALS (and thus krb4) for rxkad
-
-2003-06-04 Hans Insulander <hin@stacken.kth.se>
-
- * appl/vos/vos_listvldb.c: Remove \n from warnx()
- * appl/vos/vos.c: Missing \n on printout added
- * appl/afsutils/aklog.1: Spellfix
- * appl/afsutils/klog.c: Spellfix
-
-2003-06-04 Tomas Olsson <tol@stacken.kth.se>
-
- * appl/afsutils/aklog.1: speling
-
-2003-06-02 Love <lha@stacken.kth.se>
-
- * nnpfs/bsd: s/make_dead_vnode/nnpfs_make_dead_vnode/
-
- * nnpfs/bsd/nnpfs_message.c (nnpfs_message_installdata): use
- nnpfs_dnlc_purge instead of cache_purge
-
-2003-05-21 Love <lha@stacken.kth.se>
-
- * appl/fs/fs.1: retreived->retrieved, from pjanzen@openbsd via
- jmc@openbsd
-
-2003-05-06 Love <lha@stacken.kth.se>
-
- * appl/fs/fs_la.c (afs_getacl): a couple of off-by-one string
- bounds in sscanf, from Anil Madhavapeddy <avsm@cvs.openbsd.org>
- via openbsd.
-
-2003-04-25 Love <lha@stacken.kth.se>
-
- * appl/afsutils/unlog.1: remove unused .Ed fixe typos
- from jmc <jmc@prioris.mini.pw.edu.pl>
-
- * appl/afsutils/tokens.1: fixed bad .Fl usage, remove unused .El
- from jmc <jmc@prioris.mini.pw.edu.pl>
-
-2003-04-24 Love <lha@stacken.kth.se>
-
- * appl/lib/arlalib.h: s/managment/management/, from jmc
- <jmc@prioris.mini.pw.edu.pl>
- * doc/storage.texi: s/managment/management/, from jmc
- <jmc@prioris.mini.pw.edu.pl>
-
-2003-04-16 Love <lha@stacken.kth.se>
-
- * ydr/output.c (cppfilesymbolname): new function, Convert filename
- into a cpp symbol
- (init_generate): use cppfilesymbolname
- (close_generator): ditto
-
-2003-04-13 Love <lha@stacken.kth.se>
-
- * appl/pts/pts.c (pr_name2id): don't free memory on error
-
-2003-04-10 Love <lha@stacken.kth.se>
-
- * arlad/messages.c (try_again): treat RXKADBADTICKET, RXKADBADKEY
- as key expired
-
- * arlad/volcache.c (get_info_loop): treat RXKADBADTICKET,
- RXKADBADKEY as key expired
-
-2003-04-09 Love <lha@stacken.kth.se>
-
- * lib/ko/gensysname.c: s/strcpy/strlcpy/
- * tests/large-dir.c: s/strcpy/strlcpy/
- * rxkad/rxk_crpt.c: s/strcpy/strlcpy/
- * rx/rx_dumptrace.c: s/strcpy/strlcpy/
-
- * rx/rx_pkt.c: make osi_Msg sane
- * rx/rx.c: make osi_Msg sane
- * rx/rx_user.c: make osi_Msg sane add rx_vMsg
- * rx/rx_user.h: make osi_Msg sane
-
-2003-04-08 Love <lha@stacken.kth.se>
-
- * arlad/arla_local.h: include <uae.h>
-
- * arlad/arla.c: init uae
-
- * rx/rxperf.c: replace sprint with snprintf
-
- * appl/fs/fs_copyacl.c: replace sprint with snprintf
-
- * appl/vos/vos_backup.c: replace sprint with asprintf
-
-2003-04-08 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * arlad/conn.c (re_probe): only increase ntries until threshold
- value. more readable logic for problelist removal
- (pinger): always schedule re_probe
-
- * arlad/arla_local.h: added argument f to assert_not_flag
- * arlad/conn.c (init_fs_context): Set rtt to half of its previous
- value if fileserver unreachable
-
-2003-04-08 Love <lha@stacken.kth.se>
-
- * arlad/arla_local.h: include <uae.h>
-
- * arlad/arla.c: init uae
-
- * rx/rxperf.c: replace sprint with snprintf
-
- * appl/fs/fs_copyacl.c: replace sprint with snprintf
-
- * appl/vos/vos_backup.c: replace sprint with asprintf
-
-2003-04-08 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * arlad/fcache.c (unlink_lru_entry): assert_not_flag() on kernelp
-
-2003-04-03 Love <lha@stacken.kth.se>
-
- * include/afssysdefs.h: freebsd 4 uses 210 freebsd 5 uses 339
-
- * configure.in: no longer change for chflags and lchflags, it was
- themis that needed it
-
-2003-04-01 Love <lha@stacken.kth.se>
-
- * appl/afsutils/Makefile.in: avoid building klog when that we are
- not install it
-
- * rx/rxdebug.1: spelling, from jmc <jmc@prioris.mini.pw.edu.pl>
-
- * appl/kalog/kalog.1: spelling, from jmc
- <jmc@prioris.mini.pw.edu.pl>
-
- * appl/bos/bos.8: spelling, from jmc
- <jmc@prioris.mini.pw.edu.pl>
-
- * arlad/{DynRootDB,arla.conf,ThisCell}.5arla-cli.8: spelling, from
- jmc <jmc@prioris.mini.pw.edu.pl>
-
- * nnpfs/bsd/nnpfs_dev-bsd.c (nnpfs_dev): handle newer freebsd,
- from Mattias Amnefelt <mattiasa@e.kth.se>
-
- * configure.in: check for d_psize and d_kqfilter
-
-2003-03-17 Love <lha@stacken.kth.se>
-
- * lib/ko/koerror.c: s/Invaild/Invalid/
-
-2003-03-13 Love <lha@stacken.kth.se>
-
- * util/log.c: log in LOG_NOTICE since LOG_INFO might get lost
-
-2003-03-10 Love <lha@stacken.kth.se>
-
- * appl/afstool/at_fs_flush_cps.c: fix usage usage info
-
- * lib/ko/uae.h: remove dup
-
- * nnpfs/linux/nnpfs_load.c (init_module): do devfs_register_chrdev
- also when using a chardev, pointed out by Per Olofsson.
-
-2003-03-09 Love <lha@stacken.kth.se>
-
- * configure.in: pull in arla_OPENSSL_COMPAT, add the -I to
- netbsd-lkm dir after the system KERNEL_CPPFLAGS
-
-2003-03-08 Love <lha@stacken.kth.se>
-
- * appl/vos/vos_status.c: fix bad lp64 broken typecasts, make
- strftime buffer 128bytes
- * lib/ko/kocell.c: make strftime buffer 128 bytes
- * appl/afstool/at_fs_gettime.c: make strftime buffer 128 bytes
- * appl/afstool/at_u_debug.c: make strftime buffer 128 bytes
-
- * appl/vos/vos_examine.c: make strftime buffer 128 bytes
- * appl/vos/vos_status.c (printstatus): fix formating
-
-2003-03-07 Love <lha@stacken.kth.se>
-
- * lib/ko/uae.c: add all missing errorcodes
-
- * lib/ko/uae.h: add UAE_ERROR_base remove dup
-
- * lib/ko/uae.h: add more error codes from derrick
-
-2003-03-06 Love <lha@stacken.kth.se>
-
- * rxdef/common.h: add Capabilities
-
- * HACKING: automake appl/udebug/Makefile
-
- * include/Makefile.in: add uae.h
-
- * appl/afstool/at_fs_getcap.c: print string name of caps
-
- * appl/afstool: add support for RXAFS_GetCapabilities
-
- * rxdef/fs.xg: add GetCapabilities
-
- * appl/udebug: replace udebug with a shellscript that call afstool
-
- * NEWS: UAE
-
- * arlad/fs_errors.h: do uae translation
-
- * arlad/cmcb.c (SRXAFSCB_TellMeAboutYourself): tell server we
- support UAE
-
- * lib/ko/uae.c: comment how this should work
-
- * appl/perf/Makefile.in: adapt for uae
-
- * appl/afstool/Makefile.am: adapt for uae
-
- * lib/ko: Add infrastructure for 'Unified AFS errnos' (uae)
-
-2003-03-05 Love <lha@stacken.kth.se>
-
- * appl/afstool: use getarg style --no-auth like the rest for the
- arguments, fix auth
-
- * appl/afstool: add ubik debug
-
- * appl/afstool/afstool.1: fs gettime
-
- * appl/afstool/at_locl.h: add mini_cachemanager_init and
- fs_gettime_cmd
-
- * appl/afstool/Makefile.am: add mini cm, gettime and link with
- librxcbserver
-
- * appl/afstool/at_fileserver.c: plug in gettime
-
- * appl/afstool/at_fs_gettime.c: fetch time from fileserver
-
- * appl/afstool/at_mini_cm.c: add yet another mini cache-manager
-
- * rx/rx_user.h (rxi_GetUDPSocket): return the portnumber we bound to
- * rx/rx_user.c (rxi_GetUDPSocket): return the portnumber we bound to
-
- * rx/rx.c: find out the portnumber we bound too
-
- * appl/afstool/afstool.c (main) call rx_Init(0)
-
- * arlad/cmcb.c: prefix callback manager stubs with S
-
- * ydr/output.c (generate_server_stub): prefix server stubs with S
-
- * ydr/output.c: move the server parsing stubs into private
- namespace and make them static
-
- * appl/afstool/at_fs_flush_cps.c: remove stale comment
-
- * appl/afstool/at_cm_{localcell,whoareyou}.c: make use of for loop
- to make it look like other code in same directory
-
- * appl/afstool/afstool.c: add aliases for fileserver (fs) and
- cachemanager (cm)
-
- * appl/perf/afsfsperf.c: add dummy for GetCellByNum and
- TellMeAboutYourself
-
- * arlad/cmcb.c: add dummy for GetCellByNum and implement
- TellMeAboutYourself
-
- * rxdef/cb.xg: add GetCellByNum and TellMeAboutYourself
-
- * appl/afstool/Makefile.am: install manpage
-
- * appl/afstool/at_cm_localcell.c: getarg-ify, make more sane
- * appl/afstool/at_cm_whoareyou.c: getarg-ify, make more sane
- * appl/afstool/afstool.1: getarg-ify, make more sane
-
- * appl/afstool/afstool.1: mdoc fixes
-
-2003-03-04 Love <lha@stacken.kth.se>
-
- * arlad/poller.c (poller_foreach): new function
-
- * appl/afstool/afstool.1: manpage for afstool
-
- * configure.in: remove cbdebug
-
- * appl/afstool: fold in cbdebug
-
- * appl/cbdebug: remove cbdebug, move to afstool
-
- * appl/afstool/at_locl.h: add some more headers
-
- * appl/perf/Makefile.in: link agaist the new cb lib
-
- * arlad/Makefile.in: link agaist the new cb lib
-
- * rxdef/Makefile.in: split callback stubs to their own libs
-
- * configure.in (AC_OUTPUT): add appl/afstool/Makefile
-
- * HACKING: add appl/afstool/Makefile
-
- * appl/afstool: afstool
-
- * arlad/fcache.c: improve logging when giving back callbacks
-
- * appl/fs/fs_connect.c: add callback-connected, connect and
- refetch callback we had before
-
- * arlad/poller.c: add poller_foreach and poller_iter_func
-
- * arlad/poller.h: add poller_foreach and poller_iter_func
-
- * arlad/fcache.c (fcache_giveup_all_callbacks): first try poller +
- giveup_all_callbacks
- (giveup_all_callbacks): give up all callback with new rpc function
- RXAFS_GiveUpAllCallBacks.
- (throw_entry): conn can never be NULL, check for aliveness instead
- (fcache_reobtain_callbacks): conn can never be NULL
-
- * rxdef/fs.xg: add GiveUpAllCallBacks, and FlushCPS add commented
- out versions of 64 bit fetch/store data
-
-2003-03-03 Love <lha@stacken.kth.se>
-
- * arlad/messages.c (nnpfs_message_getdata): make comptible with
- open and set the DATA_W if requested.
-
-2003-02-28 Tomas Olsson <tol@stacken.kth.se>
-
- * nnpfs/linux/nnpfs_inodeops.c (nnpfs_file_mmap): don't iref
-
-2003-02-28 Love <lha@stacken.kth.se>
-
- * tests/run-tests.in: add mmap-and-fork
-
- * tests/mmap-and-fork.c: mmap and fork test
-
- * nnpfs/bsd/nnpfs_node-bsd.c (nnpfs_dnlc_enter): use
- nnpfs_vfs_unlock instead of VOP_UNLOCK
-
-2003-02-26 Love <lha@stacken.kth.se>
-
- * nnpfs/bsd/nnpfs_node-bsd.c: OpenBSD 3.3 will have NetBSD 1.5
- dnlc semantics
-
-2003-02-24 Tomas Olsson <tol@stacken.kth.se>
-
- * nnpfs/linux/nnpfs_message.c (clear_all_children): don't throw
- negative dentries, and it's the children we drop
-
-2003-02-24 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * nnpfs/linux/nnpfs_inodeops.c: nnpfs_d_revalidate: always return
- true if root node
-
-2003-02-22 Love <lha@stacken.kth.se>
-
- * Add support for netbsd 1.6O
-
- * configure.in: fix openbsd makefile probing
-
-2003-02-21 Tomas Olsson <tol@stacken.kth.se>
-
- * nnpfs/linux/nnpfs_message.c (clear_all_children): drop negative
- dentries
-
- * arlad/messages.c (*): send messages to kernel before
- fcache_release()
-
-2003-02-18 Tomas Olsson <tol@stacken.kth.se>
-
- * nnpfs/linux/nnpfs_message.c (nnpfs_d_remove): added
- (nnpfs_message_installnode): handle new inode != existing better
- (clear_all_children): use dcache_lock, don't use xdentry if null,
- use nnpfs_d_remove()
- (d_prune_aliases): use nnpfs_d_remove()
-
-2003-02-17 Love <lha@stacken.kth.se>
-
- * configure.in: decrease world pain by setting AM_MAINTAINER_MODE,
- now Makefile.in isn't rebuilt when Makefile.am have a newer
- timestamp
-
-2003-02-16 Tomas Olsson <tol@stacken.kth.se>
-
- * nnpfs/linux/nnpfs_message.c: make it compile
-
-2003-02-16 Love <lha@stacken.kth.se>
-
- * nnpfs/linux/nnpfs_message.c (clear_all_children): throw way
- unused nodes more aggressively (that is, remove then, don't just
- unhash them)
-
-2003-02-15 Love <lha@stacken.kth.se>
-
- * nnpfs/linux/nnpfs/nnpfs_locl.h: define I_DIRTY_DATASYNC to 0 if
- it isn't there
-
- * nnpfs/bsd/nnpfs_vnodeops-bsd.c: even more extensive casting to
- print lk_lockholder
-
- * nnpfs/bsd/nnpfs/nnpfs_locl.h: include <sys/inttypes.h> try to
- define nnpfs_uintptr_t
-
- * configure.in: check for uintptr_t
-
- * appl/lib/ka-procs.c: remove som more memsets
-
- * tests/run-tests.in (ARLA_TESTS): add kill-mh
-
- * tests/kill-mh: unpacking and removing the "right" files in the
- test tar-ball that will trigger a bug in the directory removing
- code if it doesn't that care and consider directory page
- (DIRBLKSIZ) bounderies correctly, bug report and tarfile came from
- Nickolai Zeldovich <kolya@MIT.EDU>
-
- * arlad/bsd-subr.c (dir_remove_name): make sure the d_reclen is
- too large so it will cross a page boundary, found by
- kolya@mit.edu.
-
-2003-02-14 Love <lha@stacken.kth.se>
-
- * appl/lib/ka-procs.c: make compile with new openssl >= 0.9.7,
- ignore type of key schedule
-
- * nnpfs/bsd/nnpfs_vnodeops-bsd.c: freebsd current make
- lk_lockholder to the thread (or so my spies say), so just cast to
- long long and print with %llx
-
- * nnpfs/bsd/nnpfs/nnpfs_locl.h: malloc(9) waits by default,
- freebsd post 5.0 choose to remove the flag, provide glue
-
- * */*: add copyright notice
-
-2003-02-14 Tomas Olsson <tol@stacken.kth.se>
-
- * tests/asu.c (is_pag): getgroups() might not include egid in
- groups list
-
- * tests/build-emacs-j: bsd make wants an arg after -j, use 4
-
- * nnpfs/linux/Makefile.in: don't build getcwd on ia64
-
- * configure.in: added AM_CONDITIONAL for LINUX_IA64
-
-2003-02-13 Fallsjo <fallsjo@stacken.kth.se>
-
- * .cvsignore: Honor new name of autom4te cache
-
-2003-02-12 Love <lha@stacken.kth.se>
-
- * arlad/arlad.8: rxkad-level, default is crypt
- * arlad/arla.c (rxkad_level_string): default to crypt
-
-2003-02-11 Love <lha@stacken.kth.se>
-
- * nnpfs/linux/nnpfs_vfsops.c (nnpfs_statfs): bump values some to
- make it more pretty from Harald Barth <haba@pdc.kth.se>
-
- * arlad/cred.c (cred_add): use cred_delete instead of
- recycle_entry, so when the entry is still in use we don't stomp
- all over it
-
- also, sprinkel asserts all over the place to make sure we don't
- use root node or reuse nodes that still have refcount
-
-2003-02-11 Tomas Olsson <tol@stacken.kth.se>
-
- * arlad/messages.c (nnpfs_message_getdata): set datausedp in entry
-
- * appl/perf/Makefile.in: move up arlautil before roken in LIBS
-
-2003-02-10 Love <lha@stacken.kth.se>
-
- * lib/ko/afs_uuid.c: when we use a randomized uuid, set the
- multicast bit to make sure we don't collied witha a real
- (allocated) address.
-
-2003-02-10 Tomas Olsson <tol@stacken.kth.se>
-
- * nnpfs/linux/nnpfs_syscalls.c: declare sys_call_table as its
- actual type
-
- * nnpfs/linux/nnpfs_syscalls-lossage.c: don't check for
- sys_call_table
-
- * nnpfs/linux/nnpfs/nnpfs_syscalls.h: check for sys_call_table
-
- * appl/perf/Makefile.in: move up LIB_roken in LIBS
-
- * lib/Makefile.am: build editline before sl
-
-2003-02-08 Love <lha@stacken.kth.se>
-
- * tests/run-tests.in: add read-past-eof
-
- * tests/Makefile.in: add read-past-eof
-
- * tests/read-past-eof.c: test for read past end of file
-
- * nnpfs/bsd/nnpfs_vnodeops-netbsd.c (nnpfs_netbsd_read): don't
- premit reading past end of file (found with mozilla)
-
-2003-02-07 Love <lha@stacken.kth.se>
-
- * arlad/messages.c: replace assert_kernelp with assert_flag
-
- * arlad/fcache.c: replace assert_kernelp with assert_flag
-
- * arlad/arla_local.h: replace assert_kernelp with assert_flag
-
- * nnpfs/linux/nnpfs_syscalls.c: use [] for now on sys_call_table
-
-2003-02-04 Love <lha@stacken.kth.se>
-
- * configure.in (netbsd,openbsd): we really want -f flags too when
- building lkms
-
- * lib/bufdir/fdir.c: trust length of directory file more then the
- data in the top of the file, this is slightly broken because what
- really happen was that we just removed a entry, and then shrinked
- the file because it was the last entry (and thus decremented the
- page-count), refetched the length from the fileserver and then
- expected the pagecount == size / AFSPAGESIZE
-
- * nnpfs/bsd/nnpfs_wrap-bsd.c (nnpfs_uninstall): detach malloc
- types when we are all done not completly right, but better then
- before
-
- * nnpfs/bsd/nnpfs_wrap-bsd.c: move malloc_type_detach from
- nnpfs_stat to nnpfs_uninstall
-
-2003-02-03 Love <lha@stacken.kth.se>
-
- * nnpfs/linux/nnpfs_syscalls.c:
- s/sys_call_function/nnpfs_sys_call_function/g
-
- * nnpfs/bsd/nnpfs_wrap-bsd.c: attach/detach malloc types when
- loading module
-
- * nnpfs/bsd/nnpfs/nnpfs_locl.h: type argument to malloc is
- malloc_type in netbsd 1.6N
-
-2003-02-03 Tomas Olsson <tol@stacken.kth.se>
-
- * nnpfs/linux/nnpfs_syscalls-lossage.c: make it compile, ifdef,
- define
-
- * nnpfs/linux/nnpfs_syscalls.c (install_afs_syscall): call
- nnpfs_fixup_syscall_lossage()
-
- * nnpfs/linux/nnpfs/nnpfs_locl.h: added
- nnpfs_fixup_syscall_lossage
-
- * nnpfs/linux/Makefile.in: build nnpfs_syscalls-lossage.c
-
-2003-02-02 Love <lha@stacken.kth.se>
-
- * nnpfs/linux/nnpfs_node.c (nnpfs_iget): use get_empty_inode for
- linux22
-
- * nnpfs/linux/nnpfs_message.c (nnpfs_message_installdata): only
- whine when there is a real failure to do a fh_to_dentry
-
- * nnpfs/linux/nnpfs_node.c (nnpfs_iget): use new_inode (and
- unlock_new_inode in case we have I_NEW)
-
-2003-02-01 Love <lha@stacken.kth.se>
-
- * doc/themis.texi: drop themis, live a life of its own now
-
- * doc/oddities.texi: s/Themis/Arla timeline/
-
- * doc/timeline.texi: s/Themis/Oddities/
-
- * doc/arla.texi: drop @include themis.texi
-
- * appl/lib/tokens.c: don't bail out if cell == NULL, then we want
- all cells
-
- * rx/Makefile.in: help libtool find libko
-
- * nnpfs/linux/nnpfs/nnpfs_locl.h: add typedef for
- nnpfs_sys_call_function
-
- * nnpfs/linux/nnpfs_syscalls-lossage.c: for you to make compile
- and work and start to use ok'ed to put in copyrighted to KTH by
- Chaskiel when I asked him
-
-2003-01-28 Love <lha@stacken.kth.se>
-
- * appl/fs/fs_listquota.c: more spaceing, 8 number for printing
- used space it not enougth
-
- * tests/write-and-stat: test that detects if dncl is there, or if
- we just live on tbl (really detects another bug, but this is fine
- for now)
-
- * nnpfs/bsd/nnpfs_node-bsd.c (nnpfs_cnp_init): if we have a
- namei_hash, use it
-
- * nnpfs/bsd/nnpfs_vnodeops-netbsd.c: fix printing of b_blkno
-
-2003-01-27 Love <lha@stacken.kth.se>
-
- * appl/perf/afsfsperf.c: make the tests table drivern, now you can
- write afsfsperf ... -tests get-time,bulk-status
-
- * tests/check-sysname: remove set -x
-
- * tests/run-tests.in: ARLA_TESTS: add check-sysname
-
- * tests/check-sysname: check if sysname seems to work
-
- * arlad/messages.c (nnpfs_message_getnode): replace #if 0 assert
- with assert_kernelp()
-
- * nnpfs/bsd/nnpfs_vnodeops-common.c (nnpfs_attr_valid): fix logic,
- request node from userland when we don't have one of requested
- token or don't have the pag in the pag cache.
-
- * nnpfs/bsd/nnpfs/nnpfs_locl.h: help SCARG-less freebsd some more
-
- * appl/perf/afsfsperf.c: add bulkstatus perf testing
-
- * rxdef/Makefile.in: add depenecy on common.h where needed
-
-2003-01-25 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (resolve_mp): use fcache_verify_data instead of
- fcache_get_data
-
- * nnpfs/bsd/nnpfs_message.c (nnpfs_message_updatefid): use new
- function nnpfs_update_handle, now that there are a fid hash
- instead of a list, we can't just update the handle in the
- nnpfs_node.
-
- * nnpfs/bsd/nnpfs_node.c: add nnpfs_update_handle
-
- * nnpfs/bsd/nnpfs/nnpfs_node.h: add nnpfs_update_handle
-
- * arlad/messages.c (nnpfs_message_getdata): use entry->fid as fid
- since it might have changed because of resolved mp's
-
-2003-01-24 Tomas Olsson <tol@stacken.kth.se>
-
- * tests/intr-read.c: wait on killed children
-
- * lwp/plwp.c (*): indent, clean up debugging
-
-2003-01-24 Love <lha@stacken.kth.se>
-
- * tests/intr-read.c: add comment why we kill children, "they smell
- bad" :)
-
- * tests/intr-read.c: kill children when parents is done
-
- * appl/fs/fs_diskfree.c: from dup printf, from Nickolai Zeldovich
-
-2003-01-23 Tomas Olsson <tol@stacken.kth.se>
-
- * lib/bufdir/fbuf.c (mmap_copyrx2fd): adjust mapped length to
- pagesize
-
-2003-01-23 Love <lha@stacken.kth.se>
-
- * lib/bufdir/fbuf.c (mmap_copy{rx2fd,fd2rx}): make these handle
- off/len that are not a multiple of the pagesize.
-
-2003-01-22 Love <lha@stacken.kth.se>
-
- * nnpfs/bsd/nnpfs_dev-common.c (nnpfs_block_sigset): make the
- three diffrent cases define a macro that later code can use, this
- to make it easier to block new signals, and while I'm here, ignore
- SIGINFO
-
-2003-01-21 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * appl/Makefile.in: don't build themis and mpp
- * configure.in: don't build themis and mpp
- * util/.cvsignore: ignore Makefile.in
- * appl/themis appl/mpp: removed, they are now in their own repos
-
-2003-01-20 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (dynroot_update_entry): no more spare, change to
- update fields
-
- * arlad/dynroot.c (dynroot_update_entry): no more spare, change to
- real version
-
- * ydr/Makefile.am: ydr_SOURCES: add header files
-
- * ydr/Makefile.am: CLEANFILES = lex.c parse.c parse.h
-
- * ydr/Makefile.am: YFLAGS= -d
-
- * rxdef/common.h: make the last for elements match the rest of the
- code
-
- * rxdef/common.h: drop all long/short/unsigned stuff and replace
- all by c99 types
-
- * rxdef/common.h (AFSFetchStatus): fill in the now no longer spare
- bits of FetchStatus
-
- * lib/Makefile.am: add libvers
-
- * rxdef/Makefile.in: add EXEEXT to ydr
-
- * ydr: automakeify
-
- * ydr: 64 bits encodeing/decodeing support (require presence of
- htole64/le64toh) verified same output with:
- perl -pi -e 's/sizeof\(tmp\)/sizeof\(int32_t\)/g' *.[ch]
- for a in *.[ch] ; do diff -uw $a old/$a ; done
-
- * lib/ko/kocell.c (cell_getthiscell): if the cell is unconfigured,
- return "unknown-cell-missing-configuration"
-
-2003-01-19 Love <lha@stacken.kth.se>
-
- * nnpfs/bsd/nnpfs_syscalls-common.c (*): use syscall_d_thread_t,
- syscall_thread_to_thread
-
- * nnpfs/bsd/nnpfs/nnpfs_syscalls.h (*): use syscall_d_thread_t
-
- * nnpfs/bsd/nnpfs_syscalls-wrap-bsd.c (sys_lkmnosys): use
- syscall_d_thread_t
-
- * nnpfs/bsd/nnpfs/nnpfs_locl.h: add yet another glue type
- syscall_d_thread_t, this is the process/thread argument that
- syscall are called with, add a syscall_thread_to_thread macro that
- converts from a syscall_d_thread_t to a d_thread_t
-
- * nnpfs/bsd/nnpfs_dev-common.c (nnpfs_cursig): in netbsd 1.6M
- CURSIG takes a struct lwp disable this for now
-
- * nnpfs/bsd/nnpfs_dev-bsd.c, nnpfs/bsd/nnpfs_dev-common.c
- nnpfs/bsd/nnpfs_dev-osf.c, nnpfs/bsd/nnpfs/nnpfs_dev.h:
- nnpfs_devopen_common dont need struct proc, remove it
-
- * appl/cbdebug/cbdebug.h: update to changed signature of cbgetconn()
- * appl/cbdebug/localcell.c: ditto
- * appl/cbdebug/whoareyou.c: ditto
-
- * appl/cbdebug/cbdebug.c (cbgetconn): make it possible for
- cbgetconn to return hostname if not passed in.
- (*): change to use afscallbackport
-
- * rx/Makefile.in: fix rx_trace that I manage to break
-
- * rx/rx.c: s/long/int32_t/;s/short/int16_t/ where apropriate
- * rx/rx.h: s/long/int32_t/;s/short/int16_t/ where apropriate
- * rx/rx_misc.c: s/long/int32_t/;s/short/int16_t/ where apropriate
- * rx/rx_misc.h: s/long/int32_t/;s/short/int16_t/ where apropriate
- * rx/rx_globs.h: s/long/int32_t/;s/short/int16_t/ where apropriate
- * rx/rx_pkt.c: s/long/int32_t/;s/short/int16_t/ where apropriate
- * rx/rx_pkt.h: s/long/int32_t/;s/short/int16_t/ where apropriate
- * rx/rx_user.c: s/long/int32_t/;s/short/int16_t/ where apropriate
- * rx/rx_rxdebug.c: s/long/int32_t/;s/short/int16_t/ where apropriate
-
- * rx/rx_multi.h: remove register, s/long/int32_t/ where aproporate
-
- * rx/rx_kern.h: remove register
- * rx/rx_event.h: remove register
- * rx/rx_event.c: remove register
-
-2003-01-18 Love <lha@stacken.kth.se>
-
- * arlad/SuidCells.5: improve
-
- * arlad/DynRootDB.5: improve
-
-2003-01-17 Love <lha@stacken.kth.se>
-
- * appl/udebug/udebug.c: print version with print_version()
- (and cleanup usage string)
-
- * appl/kalog/kalog.c: print version with print_version()
-
- * appl/cbdebug/cbdebug.c: print version with print_version()
-
- * appl/cbdebug/Makefile.in: add libvers
-
- * appl/amon/amon.c: print version with print_version()
-
- * appl/pts/pts.c: use arlalib_version_cmd for version
-
- * appl/fs/fs.c: use arlalib_version_cmd for version
-
- * appl/lib/arlalib.h: add arlalib_version_cmd
-
- * appl/fs/Makefile.in: add libvers
-
- * appl/fs/fs.c: print version with print_version()
-
- * appl/lib/arlalib.h: drop fslib_version
-
- * appl/lib/fs_lib.c: drop fslib_version
-
- * arlad/arla-cli.c: print version with print_version()
-
- * arlad/arlad.c: print version with print_version()
-
- * appl/perf/afsfsperf.c: print version now and then
-
- * configure.in: AC_OUTPUT: add lib/vers/Makefile
-
- * lib/vers: add from heimdal/kth-krb
-
-2003-01-15 Love <lha@stacken.kth.se>
-
- * nnpfs/bsd/nnpfs/nnpfs_locl.h: add missing #endif
-
- * lib/ko/Makefile.am: split CPPFLAGS to target_CFLAGS
-
-2003-01-14 Tomas Olsson <tol@stacken.kth.se>
-
- * arlad/messages.c (nnpfs_message_getdata): OR new flags into
- msg.flags
-
-2003-01-14 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (read_data, write_data): be more careful how
- updating of ->length and usedbytes is done to make sure its
- correct
-
- * nnpfs/bsd/nnpfs/nnpfs_locl.h: freebsd removed SCARG in 5.0RC3
- and later
-
- * lib/ko/Makefile.am: s/SYSCONFDIR/sysconfdir/
-
-2003-01-13 Love <lha@stacken.kth.se>
-
- * HACKING: spell
-
-2003-01-11 Love <lha@stacken.kth.se>
-
- * rxkad: change from old afs int32/u_int32 to iso c99 int32_t/uint32_t
-
- * includes/stds.h: drop compat glue for rxkad
-
- * util: drop copy_dirname/copy_basename
-
- * arlad/arla-cli.c: inline copy_dirname/copy_basename
-
- * appl/lib/arlalib.c: (arlalib_get_cred_krb): rewrite the code
- that fetches the server key to be simpler
-
- * HACKING: more automake
-
- * **/Makefile.in: use libtool library for libarlautil and libko
-
- * lib/ko/gensysname.c: change to use getarg (instead of agetarg)
- to drop circular dependcy for libtool
-
- * conf/Makefile.in: (arla.conf): depend on the right file
-
- * appl/afsutils/klog.c: fix (stupid) warning with cast
-
- * appl/aafs-perl/Makefile.in: fix building
-
- * util/heap.c: (heap_remove): compare dummy with the right thing
-
- * lib/Makefile, lib/ko/Makefile: generate with automake
-
- * README: update to reality
-
-2003-01-10 Tomas Olsson <tol@stacken.kth.se>
-
- * arlad/arla.conf.5: spelling, clarify, explain fake_stat
-
- * arlad/{kernel,fcache,messages}.c: indent
-
-2003-01-10 Love <lha@stacken.kth.se>
-
- * HACKING: add util/Makefile as a automake file
-
- * util/Makefile.am: automakeify
-
- * util/*.h: unify header protection and make it arlalib specific
-
- * arlad/fcache.h (FCacheEntry): remove datap
-
- * arlad/{fcache.c,inter.c,dynroot.c,unknown-subr.c}:
- remove all references to datap, instead use '->length',
- '->fetch_data', or just remove the paranoid assert.
-
- the state log doesn't change (value still stored), its just
- ignored when reading back the state
-
- * arlad/poller.c: some poller log statments
-
-2003-01-09 Love <lha@stacken.kth.se>
-
- * nnpfs/bsd/nnpfs: (nnpfs_message_installdata): pass
- NNPFS_LOCKLEAF to namei
-
- * nnpfs/bsd/nnpfs/nnpfs_locl.h: provide glue for namei flag
- LOCKLEAF
-
- * arlad/messages.c (nnpfs_message_{open,getdata}): set msg.flag
- correctly
-
- * includes/kafs.h: add AFSCOMMONIOC_GKK5SETTOK (in arla space for now)
-
- * arlad/cred.h: add prototype for rxgk cred handling
-
- * arlad/messages.c: add prototype for rxgk cred handling
-
- * arlad/inter.h: new signature of cm_open
-
- * arlad/inter.c (cm_open): simplify, let other do the hard work
-
- * arlad/messages.c: Split message_getdata and message_open for
- now. They are quite simular, but I want to see the diffrences
- between them. Also, this fixes inc-open (again) since I broke it
- before.
-
- * arlad/fcache.c (fcache_get_data): directories can fetch part of
- the file, explain why we shold remove `update attr case' in this
- function.
- (fcache_update_length): set wanted_length to min of len we have and
- length of file so we don't got off and fetch the whole thing.
- (sum_node): don't look at datap/attrp, length will be 0 when there
- isn't any data
-
-2003-01-07 Love <lha@stacken.kth.se>
-
- * arlad/kernel.c: name the workers with their worker id
-
-2003-01-06 Love <lha@stacken.kth.se>
-
- * appl/lib/tokens.c (arlalib_token_iter): if there is unknown
- error from k_pioctl, bail out
-
-2003-01-03 Tomas Olsson <tol@stacken.kth.se>
-
- * lwp/plwp.h: include windows.h after roken.h
-
- * lwp/plwp.c (*): indent, cleanup, more debugging
-
- * lwp/plwp.c (LWP_INT_SIGNAL): use SetEvent(), not PulseEvent()
- (Create_Process_Part2): handle locks properly around LWP_INT_WAIT
-
-For older ChangeLog entries see ChangeLog.2002
diff --git a/usr.sbin/afs/src/ChangeLog.1999 b/usr.sbin/afs/src/ChangeLog.1999
deleted file mode 100644
index db6e77260f3..00000000000
--- a/usr.sbin/afs/src/ChangeLog.1999
+++ /dev/null
@@ -1,8348 +0,0 @@
-1999-12-31 Love <lha@s3.kth.se>
-
- * arlad/reconnect.c (*): try to handle the case that find_first_fs
- failes
-
-1999-12-31 Assar Westerlund <assar@sics.se>
-
- * arlad/messages.c: add debug prints of the fids to the messages
-
- * arlad/inter.c (getrights): static-ize
- * arlad/fcache.c (sum_node): static-ize
- * arlad/inter.c (cm_getattr): make sure we have a parent before
- doing bulk status
-
- * tests/Makefile.in (run-tests): make it work with makes that run
- all the commands in the same shell
- (clean): add run-tests
-
- * arlad/messages.c: remove some double fcache_release:s
-
-1999-12-31 Love <lha@s3.kth.se>
-
- * arlad/fcache.c (creating_nodes): remove variable
- (unlink_lru_entry): make it more presistant and not fail
-
-1999-12-30 Love <lha@s3.kth.se>
-
- * arlad/messages.c (*): disable prio-stuff
-
- * arlad/fcache.h (FCacheEntry): added cleanergen and changed type
- of priority
- (fcache_need_bytes,fcache_need_nodes): new prototypes
-
- * arlad/fcache.c (current_vnodes): counter of currently created
- vnodes
- (needbytes): how many bytes the cleaner needs to clean away
- (fprioritylevel): make it a bool
- (creating_nodes): if the create_nodes is running
- (create_nodes): merge in create_node() and create_new_entries() and
- make create_nodes add new entires to the list instead of operating
-v on the list, also mak create_nodes a thread sleeping until we need
- more nodes.
- (cleaner_working): tells if the cleaner is working
- (cleaner): make it a state machine that is waken up each time there
- is a shortage of nodes or bytes, this repleaces
- emergency_remove_data() and emergency_remove_nodes().
- (fcache_wakeup_cleaner) how to wake up the cleaner
- (fcache_need_bytes): wakeup the cleaner to get more bytes
- (fcache_need_nodes): wakeup the cleaner to get more nodes
- (emergency_remove_data): remove
- (emergency_remove_nodes): remove
- (unlink_lur_entry): call fcache_need_nodes()
- (find_free_entry): print warning to ADEBWARN
- (fcache_recover_state): assert find_free_entry never failes
- (fcache_reinit): disable increseing of nodes
- (fcache_unused): never signal lru_list since we never clean out the node
- (read_data): use new fcache_need_bytes(), more verbose debugging
-
-1999-12-29 Love <lha@s3.kth.se>
-
- * xfs/linux/xfs_message.c (xfs_message_installnode): remember to
- dput the dentry when its inserted without a already existing
- dcache-entry.
- (gc_vnode): more debugging
-
- * xfs/solaris/Makefile.in (xfs): added magic glue to avoid that
- the solaris module is name xfs
- (load,mount): new target
-
- * xfs/linux/xfs_node.c: remove #ifdef HAVE_GET_EMPTY_INODE
-
- * configure.in (linux): no get_empty_inode test
-
- * cf/linux-func-get-empty-inode.m4: no more
-
- * doc/oddities.texi: note importance that . and .. need to be
- first, also tell about dirent.reclen
-
- * doc/debugging.texi: note that you can cat the /proc/kmsg file on
- linux since klogd sucks performancewise and it loosses message
-
-1999-12-28 Love <lha@s3.kth.se>
-
- * lib/ko/ko_locl.h: no strmatch.h
-
- * include/Makefile.in: no strmatch or strsplit
-
-1999-12-28 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/Makefile.in (vnode_if.c): not used. remove
- (vnode_if.h): handle vnode_if.sh and vnode_if.pl
- * configure.in (freebsd): try to handle running vnode_if.pl or
- vnode_if.sh
-
- * tests/large-dir2.c: don't check for directory being 2048 bytes
- long
- * tests/large-dir.c: don't check for directory being 2048 bytes
- long
-
- * arlad/bsd-subr.c (dir_remove_name): using a too large d_reclen
- is bad because readdir() can't cope with it being larger than the
- buffer size that's being used by opendir/readdir. so let's take
- DIRBLKSIZ (defaulting to 1024) as a conservative estimate
-
- * xfs/bsd/xfs_message.c (xfs_message_version): try to figure out
- if we don't have a getfh syscall installed. new and improved.
- now more #ifdef's.
-
- * configure.in (nosys, sys_nosys): test for under bsd
-
-1999-12-25 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs/xfs_vnodeops.h: handle VOP_LOCK with [1,3] arguments
- and bail out else.
-
- * xfs/bsd/xfs_message.c (xfs_message_version): test for getfh
- actually being filled in. In FreeBSD 3 and 4 before kern/15452
- was applied, it might not be filled in at run-time if there's no
- NFS.
-
- * configure.in (freebsd): do the test for vnode_if.sh the same way
- as in xfs/bsd/Makefile.in
- (AC_BSD_FUNC_LOCKSTATUS): use
-
- * xfs/bsd/bin/Makefile.in: segregate programs and scripts. use
- INSTALL_SCRIPT for installing scripts.
-
- * tests/build-emacs-j: cater for people with broken shells
-
- * xfs/bsd/xfs_vnodeops-bsd.c (cleanup_cnp): new function for
- cleaning up a componentname. also reset HASBUF after free-ing,
- this is needed by fbsd-current.
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_link): conditionalize calls to
- VOP_ABORTOP (doesn't exist in fbsd-current)
- (xfs_islocked): handle one and two-argument lockstatus
-
- * xfs/bsd/Makefile.in (vnode_if.h): try to handle vnode_if.src in
- fbsd-current with different arguments
-
-1999-12-16 Love <lha@s3.kth.se>
-
- * Release 0.29.2 (in the arla-0-29-2-branch)
-
-1999-12-16 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (do_read_attr): always set ret_conn so it's not
- left unitialized
-
-1999-12-16 Love <lha@s3.kth.se>
-
- * arlad/messages.c (xfs_message_rename): set old_entry to NULL
-
-1999-12-14 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs/xfs_node.h (xfs_do_vget): use {1,2,3}_ARGUMENT_VGET.
- * cf/bsd-vget.m4: <sys/cdefs.h> conditionalize check for 1, 2, or
- 3 arguments verify that at least one of them actually works
- * cf/bsd-vop-lock.m4: conditionalize <sys/cdefs.h>
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhopen): do copy-in. never call
- fhopen or sys_fhopen. if this function was called, that's because
- someone didn't want the ordinary fhopen function.
- * xfs/bsd/xfs_syscalls-common.c (fhopen_call): adapt to new
- xfs_fhopen
-
- * configure.in (osf): move test_KERNEL_CFLAGS
- * configure.in (AC_CHECK_KERNEL_FUNCS): remove sys_fhopen. not
- used anymore.
- * configure.in (freebsd[34]): handle current version of
- vnode_if.sh and check that we actually got a vnode_if.h generated
- * configure.in: junk freebsd2: we don't support in anyway
-
-1999-12-14 Love <lha@s3.kth.se>
-
- * arlad/.gdbinit (lwp_ps_internal): pritty-printing and added
- intelism
-
- * configure.in: testing for readline in editline, by Tino Schwarze
- <tino.schwarze@informatik.tu-chemnitz.de>
-
-1999-12-13 Love <lha@s3.kth.se>
-
- * milko/lib/ropa/Makefile,milko/appl/perf/Makefile
-
- * configure.in (AC_OUTPUT): Added
-
- * Release 0.29.1 (in the arla-0-29-1-branch)
-
- * arlad/messages.c (VenusFid_cmp): really compare the to fids
-
-1999-12-11 Love <lha@s3.kth.se>
-
- * lwp/plwp.c (Debug): disable hardwired debugging..
-
- * Makefile.in (SUBDIRS): do test too
-
- * tests/compare-inum-mp: remove right mountpoint
-
- * tests/Makefile.in: echo-n
-
-1999-12-08 Assar Westerlund <assar@sics.se>
-
- * arlad/bsd-subr.c (write_dirent): handle DIRENT_SIZE
-
- * arlad/arla_local.h: <dirent.h>: needs _KERNEL, otherwise we
- don't get DIRENT_SIZE
-
- * configure.in: re-do editline/readline stuff
-
- * arlad/sunos-subr.c (dir_remove_name): do a proper reclen
- overflow check
-
- * arlad/solaris-subr.c (dir_remove_name): do a proper reclen
- overflow check
-
- * arlad/irix-subr.c (dir_remove_name): do a proper reclen overflow
- check
-
- * arlad/hpux-subr.c (dir_remove_name): do a proper reclen overflow
- check
-
- * arlad/aix-subr.c (dir_remove_name): do a proper reclen overflow
- check
-
- * arlad/bsd-subr.c (dir_remove_name): handle last_dp == NULL (this
- might happen for the first entry and even through we should never
- remove `.' (which is always the first entry) it seems better not
- to rely on this)
-
- * arlad/bsd-subr.c (dir_remove_name): do a proper check for
- overflow `d_reclen'
-
- * arlad/messages.c (xfs_message_create): be more careful before
- releasing fcache entries
-
-1999-12-08 Love <lha@s3.kth.se>
-
- * conf/CellServDB: updated rhic
-
- * Release 0.29
-
-1999-12-08 Assar Westerlund <assar@sics.se>
-
- * configure.in: add missing ;; in case, from hin@stacken.kth.se
-
-1999-12-06 Love <lha@s3.kth.se>
-
- * arlad/fcache.c (create_directory): don't update used bytes, its
- done in adir_mkdir().
-
-Sun Dec 5 05:50:15 1999 Magnus Ahltorp <map@stacken.kth.se>
-
- * configure.in: Make all --with-sys-guessing in one place. Use
- $SYS/include as the include directory for linux.
-
-1999-12-05 Love <lha@s3.kth.se>
-
- * arlad/reconnect.c (reconnect_create): fetch parent fid volume if
- there is none.
-
- * arlad/fcache.c (fcache_get_attr_bulk): don't care about nodes
- without names, version 3.with brain
- * arlad/fcache.c (fcache_get_attr_bulk): don't care about nodes
- without names, version 2.
-
- * arlad/inter.c (cm_lookup): no more mp_traversal
-
- * arlad/fcache.h (*): no more mp_traversal
-
- * arlad/fcache.c (fcache_get_attr_bulk): don't care about nodes
- without names
-
-1999-12-05 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/Makefile.in (install): support installing in /modules
-
- * configure.in (AC_CHECK_KERNEL_VFSSW): remove, it's not used
- anyways.
-
- * cf/linux-func-get-empty-inode.m4: set CFLAGS to
- test_KERNEL_CFLAGS
-
- * cf/linux-func-full-name-hash-8bit.m4: set CFLAGS to
- test_KERNEL_CFLAGS
-
- * cf/have-linux-kernel-type.m4: call AC_TRY_COMPILE_KERNEL so that
- we use the right flags.
-
- * cf/check-kernel-vfssw.m4: not used. remove
-
- * lib/bufdir/fdir.c: use typedef for function point to
- fdir_readdir
- * lib/bufdir/fdir.h: use typedef for function point to
- fdir_readdir
-
- * configure.in: support KERNEL_CFLAGS being set in the shell.
- support --with-sys on linux check for sys/dir.h and don't check
- for sys/dir.h and dirent.h being compatible (we only include one
- of them anyways)
-
- * arlad/inter.c (cm_lookup): look in the volume entry to find the
- parent of ..
- * arlad/fcache.c (get_root_of_volume): store parent fid in the
- volume entry
- * arlad/volcache.h (volcacheentry): add `parent' (the .. of this
- volume)
-
- * arlad/messages.h (VenusFid_cmp): add prototype
- * arlad/messages.c (VenusFid_cmp): const-ify
-
- * arlad/volcache.h (volcacheentry): rename fid fields
- * arlad/volcache.c (recycle_entry): don't care about finding the
- root vnode
-
- * arlad/*-subr.c: use common subr functions
- * arlad/subr.c: new file
- * arlad/Makefile.in (arlad_OBJS): add subr.o
- (SRCS): add subr.c
-
-1999-12-03 Assar Westerlund <assar@sics.se>
-
- * configure.in: redo the tests for readline/editline. now it
- should only test for the functions that are needed. and if should
- fail if any does not exist.
-
- * tests/build-emacs-j: new test
-
- * tests/run-tests.in (ARLA_TESTS): do `build-emacs' before
- `untar-emacs'. add `build-emacs-j'
-
- * lib/ko/kocell.c (readdb): love-complete skipping of white-space
- * lib/ko/kocell.c (readdb): also try to remove trailing white
- space
- * lib/ko/kocell.c (readdb): change the format to be "IP-address([#
- \t]+hostname)?"
-
-1999-12-02 Assar Westerlund <assar@sics.se>
-
- * arlad/bsd-subr.c (write_dirent): check for volume == NULL
-
-1999-12-01 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c: add a magic cookie and version number to the
- dump file.
-
- * arlad/fcache.h: add a magic cookie and version number to the
- dump file.
-
- * arlad/volcache.h: add a magic cookie and version number to the
- dump file.
-
- * arlad/bsd-subr.c: simplify include-mess
- (write_dirent): use `volume->mp'
-
- * arlad/volcache.c: set `li'
- (volcache_free): add at tail of lrulist
-
- * arlad/volcache.h (volcacheentry): add a list pointer into
- lrulist
-
- * arlad/fcache.c: don't use realfid any longer. store the
- information in the volume instead
- (fcache_realfid): new function
-
- * arlad/fcache.h (FCacheEntry): delete `realfid' (this information
- is now stored in the volume entry instead)
- (fcache_realfid): new function
-
- * ydr/output.c (generate_server_switch): make ExecuteRequest of
- the type that rx expects it to be.
- * rx/rx.h (rx_service): correct type for `executeRequestProc'
- * rx/rx.c (rx_NewService): correct type for `serviceProc'
- * arlad/cmcb.c (cmcb_init): remove bad cast
- (RXAFSCB_CallBack): print warning when we can't find the host the sent
- us the callback
-
- * arlad/arla_local.h: don't include both dirent.h and sys/dir.h,
- but just in that order of preference
-
- * arlad/afsdir_check.c (check): printf format correctness
-
-1999-12-01 Love <lha@s3.kth.se>
-
- * arlad/messages.c (xfs_message_mkdir): avoid to set datausedp to
- later when we know that the node will be installed
-
- * arlad/messages.c (xfs_message_mkdir): do some locking of the
- parent
-
- * lib/ko/kocell.c (readdb): pass over isspace() in hostnames, if
- there is no hostname, replace with ip-address.
-
- * arlad/fcache.c (fcache_get_attr_bulk): check if we want to do
- bulkstatus, check the return value of find_first_fs()
-
- * arlad/messages.c (*): try to set datausedp later when the node
- is passed down to the kernel
-
-1999-11-30 Assar Westerlund <assar@sics.se>
-
- * xfs/*/xfs_message.c: make installattr not finding the node non-fatal
-
-1999-11-28 Assar Westerlund <assar@sics.se>
-
- * arlad/inter.c (cm_lookup): don't get provoked into doing
- bulk-status on "." or ".."
-
- * arlad/messages.c (xfs_message_inactivenode): reset datausedp and
- attrusedp also.
-
- * xfs/bsd/xfs_vnodeops-osf.c: update to changing reality
-
- * xfs/bsd/xfs_message.c (xfs_message_installattr): sanity-check
- tokens
- (*): print handle in lots of the debug messages
-
- * xfs/bsd/xfs_node-bsd.c: better and more consistent debug
- messages
-
-1999-11-27 Love <lha@s3.kth.se>
-
- * xfs/linux/xfs_syscalls.c (sys_afs_int): handle the case where
- the dentry set
- (xfs_debug_print): XDEBNODE:enable printing of node and childs
-
- * arlad/afsdir_check.c (*): add verbose and help
-
-1999-11-27 Assar Westerlund <assar@sics.se>
-
- * appl/afsutils/klog.c (randfilename): use
- krb_get_default_tkt_root if existing
-
- * appl/afsutils/klog.h: add (with gcc attributes) prototypes for
- die et al
-
- * configure.in: test for krb_get_default_tkt_root bsd: test for
- cdevsw_add (it might disappear any day now in fbsd)
- * configure.in (linux): test for inode_operations.get_block
-
- * xfs/linux/xfs/xfs_locl.h: add <linux/smp_lock.h> define LINUX2_3
- based on patches from <yasushi@cs.washington.edu>
-
- * xfs/linux/xfs_inodeops.c (xfs_d_validate): add new flag argument
- inode_operations has added a `get_block' operation
- (xfs_readpage): lock and unlock kernel under 2.3
-
- * xfs/linux/xfs_dev.c (xfs_print_sleep_queue): handle new type of
- wait_queue in 2.3
-
- * arlad/fcache.c (fcache_get_attr_bulk): check for `prefered_name'
- being NULL. set tokens to be the tokens of the entry masking out
- data if the data hasn't been installed in the kernel.
-
- * xfs/bsd/xfs/xfs_common.h (xfs_devtoname_r): add prototype
-
- * xfs/bsd/xfs_node-bsd.c (xfs_dnlc_lookup): try to handle the
- locking protocol correctly for "." and ".."
-
- * xfs/bsd/xfs_dev-common.c: use xfs_devtoname_r
-
- * xfs/bsd/xfs_dev-bsd.c: use xfs_devtoname_r
-
- * xfs/bsd/xfs_common-bsd.c (xfs_devtoname_r): new function to
- print the name of a `dev_t'
-
- * configure.in (bsd): test for snprintf and devtoname in the
- kernel
-
-1999-11-26 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_symlink_common): don't rele
- in modern FreeBSD
-
- * xfs/bsd/xfs_dev-common.c (xfs_message_rpc): also mask SIGVTALRM
-
- * include/stds.h (int16, u_int16): define. From Derrick J
- Brashear <shadow@dementia.org>
-
- * conf/CellServDB: update for MIT cells
-
-1999-11-26 Love <lha@s3.kth.se>
-
- * arlad/messages.c (*): try to set datausedp when data is
- installed, also remeber to set tokens to some (in)sane value.
-
- * arlad/inter.c: (cm_getattr): remove datatokens it data isn't
- used
-
- * arlad/fcache.c (fcache_get_attr_bulk): update tokens more
- forcefully (even new nodes can have data)
-
- * arlad/fcache.c (fcache_get_attr_bulk): update tokens
-
- * arlad/fcache.c (xfs_message_install_node_attr): union of
- install{node,attr} for bulkstat
- (bulkstat_help_func): don't exclude nodes we have attributes for,
- we need them too in kernel, this should be made more beautifully,
- it should be installed, but not bulkstat:ed
- (fcache_get_attr_bulk): just install nodes when they don't exist
- in kernel, install attributes otherwise
-
- * arlad/messages.c (xfs_message_remove): install the nodes in
- right order
-
- * xfs/linux/xfs_message.c (xfs_message_installnode): invalid
- childs when XFS_INVALID_DNLC is set.
-
-1999-11-23 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_wrap-bsd.c: adapt to fbsd -current:
-
- s/remove_dev/destroy_dev/ DEV_MODULE now only takes three
- arguments
-
- * xfs/bsd/xfs/xfs_dev.h (xfs_devioctl): simplify prototype by not
- caring for old FreeBSD
-
- * xfs/bsd/xfs/xfs_common.h (MALLOC_DECLARE): use if defined
- * xfs/bsd/xfs_common-bsd.c (MALLOC_DEFINE): use if defined
-
-1999-11-22 Love <lha@s3.kth.se>
-
- * xfs/bsd/xfs_message.c (xfs_message_gc_nodes): remove comment
- about osf
-
- * arlad/xfs.h: export xfs_send_message_{,v}multiple{,list}()
-
- * arlad/xfs.c (send_count): removed since we don't use writev any
- longer, need to add some logarithmic stuff instead
- (add_new_msg): new function, add a msg to a ``struct write_buf''
- (send_msg): new function, send of a ``struct write_buf''
- (xfs_send_message_vmultiple): rewrite in terms of add_new_msg and
- send_msg
- (xfs_send_message_multiple): new function
- (xfs_send_message_multiple_list): new function, send of a list of
- message of same size.
- (xfs_send_message_wakeup_vmultiple): reimpement in terms of
- xfs_send_message_vmultiple and write
-
- * arlad/reconnect.c (*): use new adir_lookup
-
- * arlad/messages.c (xfs_message_getdata): set datausedp when
- getting dir
- (fcacheentry2xfsnode): export
-
- * arlad/inter.c (cm_getattr): implement bulkstat
- (cm_lookup): use new adir_lookup and implement bulkstat
-
- * arlad/fcache.h (FCacheEntry): add hits
-
- * arlad/fcache.c (fcache_counter): add some counters
- (emergency_remove_data): implement some more intelligent removing of data
- (emergency_remove_node): implement some more intelligent removing of nodes
- (unlink_lru_entry): increse number of nodes we emergency remove
- (fcache_get/fcache_recover_state): init hits to 0
- (update_attr_entry): break out common code
- (do_read_attr): use update_attr_entry
- (bulkstat_help_func): helper function for fcache_get_attr_bulk and fdir_readdir
- (fcache_get_attr_bulk): implement bulkstat
-
- * arlad/adir.h (adir_lookup): changed signature
-
- * arlad/adir.c (adir_lookup): enable too pass back the entry of
- ``dir''
-
-1999-11-21 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_cachedlookup): cast pointer to
- correct type
- * xfs/bsd/xfs_vnodeops-common.c (xfs_symlink_common): simplify
- ifdef
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_mkdir): vput should also be
- called on NetBSD
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_link): try to DTRT when failing
- when errors early
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_create): on {Net,Open}BSD dvp
- should not be returned locked
-
- * appl/afsutils/klog.c (get_afs_id): use
- arlalib_get_viceid_servers
-
- * appl/lib/arlalib.c (arlalib_get_viceid): new function
-
-1999-11-20 Assar Westerlund <assar@sics.se>
-
- * Release 0.28
-
-1999-11-20 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vnodeops-common.c: remove vn_share_lock and
- vn_unshare_lock (and all calls). they're not actually used for
- doing anything.
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_lookup): don't unlock parent
- when returning EJUSTRETURN
- (xfs_lock, xfs_unlock): print flags when DEBUG
-
-1999-11-17 Assar Westerlund <assar@sics.se>
-
- * rx/rx_rdwr.c (rx_ReadProc, rx_WriteProc): make generic and
- pretty prototypes
-
- * rx/rx_clock.c (clock_ReInit): add dummy function when we're
- without getitimer
- * configure.in: check for getitimer
- * rx/rx_clock.c: add fallback code for systems without getitimer
-
- * ydr/output.c (encode_enum): hopefully make the generated code be
- more portable and correct without using any casts to and from int
-
- * lib/ko/ko_locl.h: conditionalize <sys/mman.h>
- * lib/bufdir/fbuf.c: conditionalize <sys/mman.h>
- * arlad/arla_local.h: conditionalize <sys/mman.h>
-
- * lwp/plwp.c (LWP_WaitProcess): make prototype compatible with the
- lwp function
-
- * configure.in: test for `make_dev' in kernel
-
- * rx/rx.h: add some prototypes
-
-1999-11-17 Love <lha@s3.kth.se>
-
- * xfs/linux/xfs_node.c (free_xfs_node): be paranoid and reset
- tokens
-
- * xfs/linux/xfs_message.c (xfs_message_installattr): added some
- paranoid checks to try to catch readpage on NULL node
- (xfs_message_installdata): remove obsolete BSD comment
- (xfs_invalid_xnode): added comment about possible race then throwing node->data
-
-1999-11-13 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_wrap-bsd.c: add calls to make_dev and remove_dev iff
- the kernel has a make_dev
- (FreeBSD 4.x).
-
- * xfs/bsd/xfs/xfs_vnodeops.h (xfs_lookup_name): what function?
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_lookup_name): not used.
- retire.
-
- * xfs/bsd/xfs_vnodeops-osf.c (xfs_symlink): adapt to changes in
- xfs_symlink_common
- (xfs_create, xfs_mkdir): use xfs_lookup_common
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_create, xfs_mkdir): use
- `xfs_lookup_common'
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_symlink_common): use
- xfs_lookup_common
-
- * arlad/fcache.c (fcache_stale_entry): if the cell is unknown,
- loop over all the entries in the cache and nuke the ones with
- matching fid. This is a kludge to solve the problem with
- multi-homed file servers. The problem is that the callback break
- can come from a different IP address than the one we have been
- talking to and then we have no idea as to what cell that belongs
- to. The real fix is to start using the 3.4 interfaces and be
- aware of multi-homed file servers.
-
- * xfs/bsd/xfs_node-bsd.c (xfs_dnlc_lookup): correct tbl_lookup
- call
- * xfs/bsd/xfs_vnodeops-common.c (vn_share_lock, vn_unshare_lock):
- disable
- (xfs_lookup_common): don't do any parent unlocking. try to handle
- . and .. special cases. we always get back a locked vnode from
- xfs_dnlc_lookup
- (xfs_create_common): more information in debug messages
-
- * xfs/bsd/xfs_node-bsd.c (tbl_lookup): make common
- (xfs_dnlc_lookup): always lock the node that is returned
-
-1999-11-08 Love <lha@s3.kth.se>
-
- * conf/CellServDB ({arla.,}e.kth.se): Put arla.e.kth.se after
- e.kth.se since libkafs seams to do first match.
- (psc.edu): update from info-afs
- (lsa.umich.edu): update from info-afs
- (math.lsa.umich.edu): update from info-afs
-
-1999-11-07 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_message.c (xfs_message_installnode,
- xfs_message_installdata): do vget without locking and vrele
- (gc_vnode): unlock interlock if node is being used
- (xfs_message_gc_nodes): don't use dead next pointer
-
- * xfs/bsd/xfs_vfsops-common.c (xfs_root_common): don't tell vget
- we already have an interlock. we don't.
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_lookup): look at PDIRUNLOCK flag
- to see if we should unlock
- (xfs_create): simplify
- (xfs_mkdir): simplify. correct debug printf
- (xfs_inactive): remove FreeBSD 2-code
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhopen): the fhopen syscall can be
- called fhopen or sys_fhopen. handle both cases.
-
- * xfs/bsd/xfs_syscalls-common.c (fhget_call): we don't have any
- memset on FreeBSD, use bzero instead
-
- * xfs/bsd/xfs_node-bsd.c (new_xfs_node): always do vget. (this
- will probably not work on fbsd2)
- (tbl_lookup): new version for NetBSD 1.4K or higher. cache_lookup now
- returns with the resulting node locked, do the same thing in
- tbl_lookup
-
- * configure.in (AC_CHECK_KERNEL_FUNCS): check for `sys_fhopen'
-
-1999-11-03 Love <lha@s3.kth.se>
-
- * configure.in (AC_OUTPUT): added milko/appl/bootstrap/Makefile
-
-1999-11-03 Marcus Sundberg <mackan@stacken.kth.se>
-
- * cf/linux-func-devfs-register-eleven-args.m4: new file
-
- * configure.in: use AC_LINUX_FUNC_DEVFS_REGISTER_ELEVEN_ARGS
-
- * xfs/linux/xfs_load.c (init_module): support recent devfs_register()
-
-1999-11-02 Love <lha@nutcracker.e.kth.se>
-
- * rxdef/cb.xg: removed #if 0 def's that have been moved to
- common.h removed \r in comment end mark.
-
- * rxdef/vldb.xg: added a comment about VLSF and VLF
-
-1999-10-31 Assar Westerlund <assar@sics.se>
-
- * arlad/inter.c (cm_symlink): create mount points with 0644
-
- * arlad/fcache.c (create_new_entries): handle `n == 0'
- (fcache_reinit): don't fail when setting it to the same number as
- nodes that's already there
-
-1999-10-30 Assar Westerlund <assar@sics.se>
-
- * configure.in: don't export RXKAD_LIBS use new
- AC_FIND_FUNC_NO_LIBS2 for checking for kafs/krbafs
-
- * cf/find-func-no-libs.m4: add yet another argument to allow
- specify linker flags that will be added _before_ the library when
- trying to link
-
- * cf/find-func-no-libs2.m4: add yet another argument to allow
- specify linker flags that will be added _before_ the library when
- trying to link
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_lock, xfs_unlock): handle the
- case of three-argument lockmgr's
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_loopup_common): remove
- lockparent stuff
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_lookup): move the BSD-specific
- lockparent stuff here from xfs_lookup_common
-
- * xfs/bsd/xfs/xfs_locl.h: move syscall argument macros here from
- xfs_syscalls.h
-
- * xfs/bsd/xfs/xfs_syscalls.h: move syscall argument stuff to
- xfs_locl.h
-
- * xfs/bsd/xfs_vfsops-osf.c: add some struct to xfs_fhandle_t make
- debug printfs less informative by not printing unexisting
- variables
-
- * xfs/bsd/xfs-message.c (xfs_message_gc_nodes): add osf version
-
- * xfs/bsd/xfs/xfs_locl.h (u_int16_t): add for osf
- (xfs_setgroups_args): add a hard-coded defintion of this struct for
- osf. It's not defined anywhere and hopefully it will not be
- changed.
-
-1999-10-26 Love <lha@s3.kth.se>
-
- * rxdef/common.h: Added SS_FSYNC flag, given to StoreData and
- friends when we are supposed to fsync.
-
-1999-10-23 Love <lha@s3.kth.se>
-
- * appl/afsmgr/afsaclmgr.in: A acl manager written i guile-gtk.
-
-1999-10-22 Love <lha@s3.kth.se>
-
- * configure.in (AC_PATH_PROGS): Added check for guile-gtk
- (AC_OUTPUT): Added appl/afsmgr/Makefile
-
-1999-10-22 Magnus Ahltorp <map@stacken.kth.se>
-
- * lib/bufdir/fbuf.c, arlad/*.c: Don't close fd when fbuf is closed.
-
-1999-10-22 Love <lha@s3.kth.se>
-
- * appl/afsutils/klog.h: remove do_help prototype
-
- * appl/afsutils/klog.c (*): rewrote to use getarg
-
- * tests/ga-test.c (test_simple_strings): added simple test for
- arg_strings
- (*): print what test failed
-
-1999-10-21 Love <lha@s3.kth.se>
-
- * tests/ga-test.c (test_simple_integer, test_simple_string):
- swaped functionsname to reflect what the do.
-
- * appl/afsutils/unlog.c (save_tokens): remove variable as a
- cleanup from Chris Wing
- (getarg): made getarg work as expected (compat)
-
-1999-10-20 Magnus Ahltorp <map@stacken.kth.se>
-
- * arlad/fcache.[ch], arlad/dynroot.c, arlad/reconnect.c: Added
- length field to FCacheEntry
-
-1999-10-19 Love <lha@s3.kth.se>
-
- * tests/{ga-test.c,Makefile.in,run-tests.in}: added basic getarg
- tests suite.
-
-Tue Oct 19 02:44:21 1999 Magnus Ahltorp <map@stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_read_file): read from page owned
- by backing store
-
-1999-10-19 Magnus Ahltorp <map@stacken.kth.se>
-
- * lib/bufdir/fdir.c (update_fid_by_name): Don't corrupt directory
- entry
-
-1999-10-17 Magnus Ahltorp <map@stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c: xfs_readdir: Eliminated memory leak
-
-1999-10-17 Assar Westerlund <assar@sics.se>
-
- * tests/create-files.c (creat_files): remember O_WRONLY to open
-
- * configure.in (hpux): set KERNEL_INCLUDE
-
- * appl/fs/fs.c: revert last commit. xfs_deb.h is needed here
-
-1999-10-16 Magnus Ahltorp <map@stacken.kth.se>
-
- * rxdef/pts.c, appl/pts/pts.c, milko/pts/pr.c,
- milko/pts/ptserver.c: Better names for pts constants
-
-1999-10-15 Magnus Ahltorp <map@stacken.kth.se>
-
- * xfs/linux/xfs_syscalls.c: sys_afs_int: Check for NULL xnode
-
-1999-10-15 Love <lha@s3.kth.se>
-
- * rx/Makefile.in (install): create $(includedir)/rx
-
- * rx/rx.[ch]: a service returns a int32_t not a long
-
-1999-10-13 Love <lha@s3.kth.se>
-
- * tests/create-files.c(usage): updated.
-
- * tests/compare-inums: new style create-file
-
-1999-10-13 Assar Westerlund <assar@sics.se>
-
- * appl/udebug/Makefile.in (LIB_tgetent): add
-
- * xfs/bsd/xfs_wrap-bsd.c: use NODEV on FreeBSD 3
-
- * xfs/bsd/xfs_vnodeops-common.c: use xfs_vfs_vn_lock
-
- * xfs/bsd/xfs/xfs_vnodeops.h (xfs_vfs_vn_lock): new ugly macro for
- calling vn_lock
-
-Tue Oct 12 23:22:35 1999 Magnus Ahltorp <map@stacken.kth.se>
-
- * arlad/fcache.c: Clear attrp when clearing length.
-
-1999-10-12 Assar Westerlund <assar@sics.se>
-
- * arlad/messages.c (xfs_message_getnode): reset data mask before
- installing tokens
-
- * configure.in: use LIB_tgetent when testing for el_init
-
- * cf/find-func-no-libs.m4 (AC_FIND_FUNC_NO_LIBS): new argument
- `extra libs'
-
- * cf/find-func-no-libs2.m4 (AC_FIND_FUNC_NO_LIBS2): new argument
- `extra libs'
-
- * configure.in: use AC_BSD_FUNC_LOCKMGR
-
- * cf/bsd-func-lockmgr.m4: new test
-
-1999-10-10 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_wrap-bsd.c: NODEV -> NOMAJ
-
- * xfs/bsd/xfs_vfsops-netbsd.c: use xfs_checkexp
-
- * xfs/bsd/xfs_vfsops-freebsd.c (xfs_vfsops): add `xfs_checkexp'
- when appropriate
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_checkexp): new dummy function
-
- * configure.in: check for debuglockmgr
-
- * xfs/bsd/xfs/xfs_node.h (xfs_node): sort out when to use `struct
- lock'
-
- * xfs/bsd/xfs_node-bsd.c (xfs_dnlc_lookup): try to handle the new
- NetBSD version of cache_lookup that has a return value that's the
- opposite of the traditional one (but actually more logical and
- consistent with everything else). The test for __NetBSD_Version__
- >= 104110000 might not be optimal.
-
- * arlad/arla_local.h: fix for building on MacOS X
-
- * tests/create-files.c: support writing data into the files
-
-1999-10-07 Love <lha@s3.kth.se>
-
- * arlad/xfs.h (rcvfuncs): is extern.
-
- * configure.in (tgetent): check in ncurses too.
-
-Wed Oct 6 01:51:12 1999 Magnus Ahltorp <map@stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c: xfs_write_file: Check if cache file is
- NULL
-
- * tests/read-write.c: Added.
-
- * xfs/linux/xfs_node.c: free_xfs_node: Cleanup.
-
- * xfs/linux/xfs_message.c: xfs_invalid_xnode: Move code around to
- avoid scheduling between token clearing and DATA_FROM_XNODE
- clearing. Cleanup.
-
- * xfs/linux/xfs_inodeops.c: xfs_readdir: Merge 2.0 and 2.2 code.
- Cleanup. xfs_readpage: Correct spelling mistake.
-
-1999-10-06 Assar Westerlund <assar@sics.se>
-
- * (xfs_lookup_common): use xfs_vfs_unlock
-
- * xfs/bsd/xfs/xfs_locl.h: add <sys/signalvar.h>
-
- * xfs/bsd/xfs_wrap-bsd.c (DEV_MODULE): set major number
-
- * xfs/bsd/xfs_node-bsd.c: handle the case of there being no
- `cn_hash' in `struct componentname'
-
- * xfs/bsd/xfs_dev-common.c (xfs_message_rpc): handle another way
- of setting signal masks
- (SIGADDSET, used in FreeBSD 4)
-
- * xfs/bsd/xfs_dev-bsd.c (FreeBSD, cdevsw): conditionalize some
- fields
-
- * lwp/process.S (RCSID): undef to avoid conflicts and possibly use
- an assembly version (ENTRY): conditionalize
-
- * configure.in (AC_CHECK_HEADERS): beautify. add
- <sys/signalvar.h>
- (struct cdevsw): test for lots of fields
- (struct componentname): check for cn_hash
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_lookup_common): try to
- approximate the weird locking some more
-
- * xfs/bsd/xfs_node-bsd.c (xfs_getnewvnode): lockmgr or not
- (new_xfs_node): don't interlock
-
- * xfs/bsd/xfs_vnodeops-bsd.c: start using lockmgr for vop_lock,
- vop_unlock, and vop_islocked
-
- * xfs/bsd/xfs_vfsops-freebsd.c (xfs_dead_vnodeop_entries): default
- should be vop_defaultop
-
- * xfs/bsd/xfs_dev-bsd.c (FreeBSD): more conditional fields
-
- * configure.in: test for d_spare in cdevsw
-
- * configure.in: test for d_reset in `struct cdevsw'
-
- * xfs/linux/xfs/xfs_locl.h (xfs_iref): inline function for
- incrementing the ref count
-
- * xfs/linux/xfs_syscalls.c (fhopen_call): always call DPUT. add
- some comments
-
- * xfs/linux/xfs_inodeops.c (xfs_readpage): always call dput,
- simplify a tiny bit use xfs_iref
-
- * xfs/linux/xfs_message.c (xfs_message_installnode): iput the
- xnode instead of `dentry->d_inode'. use `xfs_iref' for bumping
- reference count
-
- * xfs/linux/xfs_node.c: add some comments
- (xfs_iget): don't call xfs_attr2inode, it's always done in
- new_xfs_node
- (xfs_node_find): simplify
-
-1999-10-05 Love <lha@s3.kth.se>
-
- * conf/CellServDB (northstar.dartmouth.edu): changed
-
- * appl/afsutils/sys.c (main): ask kernel if avaible.
-
- * arlad/fcache.c (throw_data, create_file): when truncating files
- to zero length, set status.Length == 0.
-
-1999-10-05 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs/xfs_node.h (xfs_node): start using `struct lock' iff
- lockmgr
-
- * arlad/bsd-subr.c (write_dirent): check that the parent isn't the
- same
-
-1999-10-05 Love <lha@s3.kth.se>
-
- * conf/CellServDB (urz.uni-magdeburg.de): changed db servers
-
- * arlad/cmcb.c: s,EOPNOTSUPP,RXGEN_OPCODE,
-
-1999-10-04 Love <lha@s3.kth.se>
-
- * appl/afsutils/sys.c: Added sys program.
-
-Mon Oct 4 01:58:56 1999 Magnus Ahltorp <map@stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c: xfs_readdir: Don't lookup inode
- number. Cleanup.
-
-1999-10-03 Assar Westerlund <assar@sics.se>
-
- * arlad/messages.c (xfs_message_symlink): handle realfid
-
- * arlad/inter.h (cm_symlink): update prototype
-
- * arlad/inter.c (cm_symlink): return the realfid
-
- * arlad/bsd-subr.c (write_dirent): also handle the case of `..'
- referring to a mount-point
-
- * tests/readdir-vs-lstat.c (verify_inodes): no need to check for
- . or ..
-
- * xfs/linux/Makefile.in (mount): add
-
- * tests/readdir-vs-lstat.c (verify_inodes): probably works better
- if chdir:ing to the directory
-
- * tests/readdir-vs-lstat.c (main): change default "foo" -> "."
-
- * tests/readdir-vs-lstat.c (verify_inodes): don't unlink
-
- * tests/compare-inum-mp: new test
-
- * tests/compare-inums: new test
-
- * tests/run-tests.in: add compare-inums, compare-inum-mp
-
- * tests/readdir-vs-lstat.c: only verify inode numbers
-
-1999-10-02 Love <lha@s3.kth.se>
-
- * conf/CellServDB (dev.mit.edu): changed
- (athena.mit.edu): changed
-
-1999-10-01 Assar Westerlund <assar@sics.se>
-
- * tests/run-tests.in: add readdir-vs-lstat
-
- * tests/Makefile.in: add readdir-vs-lstat
-
- * tests/readdir-vs-lstat.c: new test program for verifying that
- inode numbers from lstat and readdir are equal
-
-1999-09-30 Assar Westerlund <assar@sics.se>
-
- * rx/Makefile.in (install, uninstall): move include files to `/rx'
-
- * xfs/bsd/xfs/xfs_locl.h: <vm/vm_object.h>: add
-
- * arlad/hpux-subr.c: DIRSIZ circus
-
- * arlad/arla.c (args): more units
-
- * appl/fs/fs.c: no <xfs/xfs_deb.h>
-
- * include/Makefile.in: add parse_bytes.h
-
- * appl/amon/amon.c: add parse_bytes.h
-
-1999-09-30 Harald Barth <haba@pdc.kth.se>
-
- * doc/intro.texi: Documentation is for wimps /Überwimp.
- * doc/oddities.texi
- * doc/partsofarla.texi
- * doc/porting.texi
- * doc/tools.texi
- * doc/authors.texi: Here, too.
- * doc/arla.texi: Love said I should do this by now
- * configure.in: Noting in if clause is no good
-
-1999-09-30 Assar Westerlund <assar@sics.se>
-
- * lwp/make-process.o.sh.in: hpux: don't set PROCESS_S, it gets
- included from process.S add -I$(srcdir) when running cpp/cc
-
- * lwp/Makefile.in (make-process.o.sh): add a dependency on
- ../config.status
-
-1999-09-29 Love <lha@s3.kth.se>
-
- * configure.in: readline support done diffrently, again
-
- * NEWS: remove asrvutil notice and replace it with lwp notice
-
- * configure.in: move lwp things to the top so we can use it in
- windows too add case cygwin in the switch statment. That isn't
- relly correct but print a warning that we only work on NT.
-
- * lwp/plwp.h: windwos threads glue code.
-
- * lwp/plwp.c: Added windows threads suppport on phtread emulation
- mode. Debugged by Magnus map@stacken.kth.se and Robert rb@abc.se
-
-1999-09-28 Harald Barth <haba@puffin.pdc.kth.se>
-
- * doc/partsofarla.texi: nice format
-
- * doc/debugging.texi: minor
-
- * doc/Makefile.in: New targets: .pdf and .html files. Generated
- from texi input. Not made as default yet.
-
- * configure.in: Test for texi2pdf and texi2html, used in the doc
- tree
-
-1999-09-27 Love <lha@s3.kth.se>
-
- * arlad/unknown-subr.c (dir_remove_name): new dummy function
-
- * rx/rx_clock.c (set_alrm_handler): use only sigaction if
- SA_RESTART is defined
-
- * xfs/winnt/src/xfs_vops.c (xfs_close): free ccb and fcb
- (xfs_cleanup): opencounter--
- (xfs_create): allocate ccb and fcb and
- to pointer magic
- (xfs_dirctl): figure out where to start and only show 3 files
- (xfs_devctl): add begining of ioctl that we might use for xfs-rpc
-
- * xfs/winnt/src/makefile: check for alternate location of NTDDK
-
- * xfs/winnt/src/xfs_misc.c: ccb/fcb allocation/release
-
- * xfs/winnt/inc/xfs_locl.h: CCB flags and panic string
-
-1999-09-26 Love <lha@s3.kth.se>
-
- * xfs/winnt/inc/xfs_type.h: Add a allignment macro
-
- * xfs/winnt/inc/xfs_locl.h: Added lot of confusion structures that
- the book claims we need.
-
- * xfs/winnt/src/xfs_init.c (InitFS): initilize the zones for fcb
- and ccb
- (DriverEntry): #if 0 out exception code since can't generate a loadable
- modules otherwise.
-
-1999-09-26 Assar Westerlund <assar@sics.se>
-
- * appl/amon/amon.c (GetUsedBytes): use unparse_bytes_short for
- nicer output
-
- * arlad/volcache.c (get_info_loop, get_info_byid,
- get_info_byname): add an explicit `cell' argument
- (volcache_getbyname, volcache_getbyid): set stablep correctly and also
- set validp
-
-1999-09-26 Love <lha@s3.kth.se>
-
- * xfs/winnt/xfs.reg: Z: to many \ in string.
-
- * arlad/messages.c (vioc_calculate_cache): must be root.
-
-1999-09-26 Harald Barth <haba@pdc.kth.se>
-
- * doc/debugging.texi: Spelling check and some new night excercices.
-
- * doc/intro.texi: Mostly spelling check.
-
- * doc/partsofarla.texi: Mostly spelling check.
-
- * doc/porting.texi: Mostly spelling check.
-
-1999-09-25 Love <lha@s3.kth.se>
-
- * lib/ko/ko.h (cell_is_sanep): new prototype
-
- * lib/ko/kocell.c (cell_is_sanep): new function
-
- * arlad/volcache.c (get_info_loop): print out the volume of the
- strance cell that doesn't have and db-server, and assert that this
- cell is a sane one.
-
- * arlad/fcache.c (*): Add some comments about silly rename
-
- * arlad/fcache.c (write_data): in case of failure, set the
- status.Length = 0 since we truncate the buffer, otherwise the
- assertion that
- (sum (all-fcachenodes).status.Length) != usedbytes will fail.
-
- * tests/Makefile(dup2-and-unlog): Added program.
-
- * tests/dup2-and-unlog.c: xsession-errors emulation
-
-1999-09-24 Love <lha@s3.kth.se>
-
- * appl/lib/Makefile.in (INCLUDES): Added xfs/include
-
- * arlad/fcache.c (throw_data): make sure we call
- cm_check_usedbytes_consistency() If we are compiling w/o assert,
- make sure we don't count below zero.
- (cleaner) call cm_check_usedbytes_consistency.
- (sum_node): only use Length when calculating sum (that should be
- equal usedbytes)
-
- * arlad/cmcb.c (RXAFSCB_CallBack): call
- cm_check_usedbytes_consistency()
- (RXAFSCB_InitCallBackState): call cm_check_usedbytes_consistency()
-
- * arlad/arla.c (args): new option --usedbytes-consistency -b
- (main): turn on usedbytes_consistency if needed
-
- * arlad/inter.h
- (cm_turn_on_usedbytes_consistency,cm_check_usedbytes_consistency):
- new prototypes.
-
- * arlad/inter.c (cm_check_usedbytes_consistency): if we have a
- consistent view of usedbytes
- (*): start to use cm_check_usedbytes_consistency()
-
- * arlad/messages.c (viocwhereis): send address to userland in
- network order.
-
-1999-09-23 Love <lha@s3.kth.se>
-
- * arlad/.gdbinit (lwp_ps_internal): more pretty printing
-
- * arlad/messages.c (read_mount_point): Map the mountpoint
- rw|rd|private
- (vioc_afs_stat_mt_pt): now that the mountpoint is mapped private, dont
- use a copy buffer.
-
- * lib/bufdir/fbuf.h: (fbuf_flags): new flags
-
- * lib/bufdir/fbuf.c:(mmap_flags): check new semantics
- (mmap_prot): new function
- (mmap_create): use mmap_prot
- (malloc_flush): mmap emulation
-
- * arlad/fcache.c (parse_mountpoint): document
- (followmountpoint): map file PRIVATE|WRITE
-
- * */{,*/}/*.c (*): Changed sematics of fbuf_create
-
-1999-09-23 Assar Westerlund <assar@sics.se>
-
- * arlad/Makefile.in: add arladeb2
-
- * arlad/arladeb2.c: new file
-
- * arlad/arladeb.c (arla_log_method): make global
- (arla_vwarn_with_fid, arla_warn_with_fid): move away
-
-1999-09-20 Assar Westerlund <assar@sics.se>
-
- * arlad/messages.c (try_again): try to print more explicit
- messages when waiting
-
- * arlad/volcache.c (volcache_getname): new function for mapping id
- -> name
-
- * arlad/arladeb.c (arla_warnx_with_fid, arla_vwarnx_with_fid): new
- functions
-
- * util/log.c (log_vlog): try to handle vasprintf failing
-
- * configure.in: support smp for FreeBSD as well
-
-1999-09-17 Assar Westerlund <assar@sics.se>
-
- * arlad/messages.c (read_mount_point): break up into
- get_mount_point and read_mount_point
-
-1999-09-17 Love <lha@s3.kth.se>
-
- * arlad/volcache.c: Apply assar's patch to avoid dead-lock in
- recycle_entry()
-
- * arlad/messages.c (vioc_afs_stat_mt_pt): create a termporary
- buffer to make sure the string ends with a '\0'.
- (read_mount_point): more confusing comments.
-
-1999-09-16 Love <lha@s3.kth.se>
-
- * appl/afsutils/klog.c: put krb_afslog_uid inside a KERBEROS ifdef
-
- * configure.in (APPL_SUBDIRS): += asrvutil
-
-1999-09-14 Love <lha@s3.kth.se>
-
- * appl/asrvutil/asrvutil.c (ANAME_SZ & co): Added some krb-compat
-
- * lib/ko/ko_locl.h: added <sys/ioccom.h>
-
- * arlad/fcache.c (fcache_get): make sure the new (not newest)
- entry is unlocked when put on the lru.
- (find_free_entry): Added comment about locking
- (unlink_lru_entry): Added comment about locking
-
- * arlad/.gdbinit: add random gdb sequences for your late night
- entertainment.
-
-1999-09-13 Love <lha@s3.kth.se>
-
- * appl/vos/vos_local.h: Iflags now defined in volumeserver.xg
-
- * xfs/bsd/xfs_dev-common.c (xfs_message_rpc): ignore SIGALRM
-
-1999-09-11 Magnus Ahltorp <map@stacken.kth.se>
-
- * configure.in: Don't use fpu registers on alpha and sparc64
-
-1999-09-10 Love <lha@s3.kth.se>
-
- * ydr/sym.h (Symbol): add u.proc.package
-
- * ydr/parse.y (proc_decl): save what package we was created ``in''
- (directive): add package to packagelist
-
- * ydr/output.h (packagelist): add extern prototype.
-
- * ydr/output.c (packagelist): used to keep track of what packages
- we have had
- (generate_hdr_struct): don't be suprised by a empty defintion.
- (generate_init): create list packagelist
- (generate_server_switch/gencase): iterate over all packages in
- this .xg file
-
- * ydr/parse.y (directive): estrdup package
-
- * appl/lib/arlalib.c (arlalib_getsyncsite): seams like the
- syncsite doesn't fill in the syncsiteaddress for some odd reson.
-
- * arlad/services.h: added KA one of services
-
- * rxdef/Makefile.in: add ka server stuff
-
- * rxdef/ka.xg: (new file) partial kaserver def.
-
- * appl/asrvutil/*: Initial import, a afs equivalent of ksrvutil.
-
- * conf/CellServDB (e.kth.se): changed names of db servers
-
- * conf/CellServDB (jpl.nasa.gov): new db-servers
-
-1999-09-10 Assar Westerlund <assar@sics.se>
-
- * appl/Makefile.in (SUBDIRS): partly set conditionally
-
- * lib/ko/koerror.c: move around includes
-
- * include/stds.h: more ifdef
-
- * configure.in: handle --without-krb4 set APPL_SUBDIRS to build
- some subdirs of appl conditionally
-
- * include/Makefile.in: add acl.h
-
- * arlad/fcache.c: some ifdef KERBEROS
-
- * arlad/bsd-subr.c (conv_dir): ignore fcache_fhget failing
-
- * lib/ko/auth.c: ifdef KERBEROS
-
- * lib/acl/acl_files.c: ifdef KERBEROS
-
-1999-09-09 Assar Westerlund <assar@sics.se>
-
- * rxdef/cb.xg: int32 -> int32_t
-
- * rxdef/cb.xg: add new RPCs for AFS3.5 and the data types used by
- these
-
- * rxdef/common.h (afs_UUID): add
-
- * rxdef/vldb.xg: move afs_UUID to common.h
-
- * arlad/cmcb.c: implement stubs for the 3.5 RPCs
-
- * configure.in: always link with -lkrb et al when testing for
- -lkafs (this breaks with shared libraries otherwise)
-
-1999-09-03 Assar Westerlund <assar@sics.se>
-
- * appl/lib/arlalib.c (rx_initlizedp): remove, rx takes care of not
- re-initializing
-
-1999-08-16 Assar Westerlund <assar@sics.se>
-
- * xfs/include/xfs/xfs_attr.h: remove obsolete comment
-
- * xfs/solaris/xfs_syscalls.c (xfs_pioctl_call): ifdef the 32 bit
- versions so we don't get duplicates
-
- * xfs/include/xfs/xfs_message.h (xfs_msg_node): add more padding
- at the end
-
- * lwp/make-process.o.sh.in: handle all kinds of sparcs
-
-1999-09-09 Marcus Sundberg <mackan@stacken.kth.se>
-
- * configure.in: Check for linux/devfs_fs_kernel.h
-
- * xfs/linux/xfs/xfs_locl.h: If linux/devfs_fs_kernel.h is available,
- use that instead of linux/devfs_fs.h
-
-1999-09-07 Love <lha@s3.kth.se>
-
- * arlad/fcache.c (throw_data): use entry->status.Length when
- counting usedbytes.
-
- * arlad/fcache.c (create_file): remove superflourius
- free_fs_server_context in case of error
-
-1999-09-06 Love <lha@s3.kth.se>
-
- * arlad/xfs.c (xfs_send_message_gc_nodes): log the number of nodes
- to gc
-
- * arlad/fcache.c (do_read_attr): remeber to free context when
- failing, add comment about fs_context
- (write_attr): remeber to free fs_context when failing
- (create_file): emeber to free fs_context when failing
-
-1999-09-03 Love <lha@s3.kth.se>
-
- * conf/Makefile.in (install) At least try to set the bits rights
- on the cachedir
-
- * configure.in: Check for chmod
-
- * xfs/solaris/bin/Makefile.in: Added krb_lib_flags
-
-1999-09-03 Assar Westerlund <assar@sics.se>
-
- * lib/ko/Makefile.in (LIB_SOURCES): add afsconf and auth
- (install): install header files
-
- * lib/ko/{cellconfig.h,afsconf.c,auth.h,auth.c}: new files for
- some transarc library compatability
-
- * lib/ko/ports.c (ports_init): make sure we only execute once
-
-1999-08-30 Assar Westerlund <assar@sics.se>
-
- * tests/Makefile.in (REALCFLAGS): add $(srcdir)/../include
-
-1999-08-30 Love <lha@s3.kth.se>
-
- * configure.in: Added check for libkafs with AC_FIND_FUNC_NO_LIBS
-
-1999-08-29 Love <lha@s3.kth.se>
-
- * appl/udebug/udebug.c: Host order bug noticed by Dr A V Le Blanc
- <LeBlanc@mcc.ac.uk>
-
- * README: Update that programs we distribute
-
-1999-08-28 Love <lha@s3.kth.se>
-
- * conf/Makefile.in: Create the cache-dir
-
-1999-08-27 Love <lha@s3.kth.se>
-
- * xfs/linux/xfs_message.c (xfs_message_installdata): Add code for
- open_namei in the linux2.1+ case.
-
- * configure.in (AC_OUTPUT): Changed to reflect new directory
- structure for appl/
-
- * appl/*/Makefile.in (RXKAD_LIBS): use @MILKO_RXKAD_LIBS@
-
- * xfs/include/xfs/xfs_message.h: Ugly hack for WIN32/i386
-
-1999-08-25 Love <lha@s3.kth.se>
-
- * xfs/winnt/src/xfs_vops.c: Added create
-
- * xfs/winnt/xfs.reg [Dos Devices] Change place of device
-
- * xfs/winnt/README: Added more tips and tools
-
- * xfs/winnt/src/xfs_init.c: start using XFSLOG and xfs_debug()
-
- * xfs/winnt/inc/xfs_locl.h: Added <stdio.h> <stdarg.h>
-
- * xfs/winnt/src/xfs_deb.c (xfs_debug): implement
-
- * xfs/winnt/inc/xfs_proto.h: Add prototyp for xfs_debug()
-
- * xfs/winnt/inc/xfs_deb.h: rename things to XFSLOG since that is
- what is realy is add XDEB things from xfs/include/xfs_debug.h,
- should really be an include XXX
-
- * xfs/winnt/src/xfs_vops.c (*): more sane debugging
- (xfs_queryvol,xfs_fscontrol): added placeholder
-
- * xfs/winnt/src/xfs_init.c: Added IRP_MJ_QUERY_VOLUME_INFORMATION,
- IRP_MJ_FILE_SYSTEM_CONTROL more debugging
-
- * xfs/winnt/inc/xfs_deb.h: Misc debugging constants
-
- * xfs/winnt/inc/xfs_proto.h: Added xfs_queryvol, xfs_fscontrol
-
- * xfs/winnt/inc/xfs_locl.h: include xfs_deb.h
-
-1999-08-22 Love <lha@flippflopp.passet.pp.se>
-
- * appl/lib/arlalib.c: remove empty comment ad the end
-
- * appl/lib/appl_locl.h: move <kafs.h> outside #ifdef KERBEROS
-
- * appl/afsutils/unlog.h: change prototype of do_help
-
- * appl/afsutils/tokens.c (*): Added nonkerberos support
-
- * appl/afsutils/klog.c (main) moved non-global stuff to main
- (*): Added non-kerberos support.
-
- * appl/afsutils/TODO.afsutils (general): fixed mktemp and /ticket
- problem
-
- * appl/*: new style tree (one program in each dir (almost))
-
-1999-08-21 Love <lha@s3.kth.se>
-
- * appl/fs.c (getcache_cmd): formating fix
-
- * tests/run-tests.in: Format stuff for tests now when they are
- reformated print date when we are done.
-
-1999-08-20 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_syscalls.c (unpag): repair linux 2.0 code
-
- * xfs/linux/xfs_message.c (gc_vnode): try to handle linux 2.0
-
- * xfs/linux/xfs_node.c (xfs_iget): use get_empty_inode if we have
- it
-
- * configure.in (AC_LINUX_FUNC_GET_EMPTY_INODE): add
-
- * rx/Makefile.in (test_rx_clock): add dependency on $(LIB)
-
-1999-08-17 Love <lha@s3.kth.se>
-
- * arlad/xfs.c (xfs_message_wakup): Added check for lost messages.
- Fix the assert
-
- * configure.in(linux): Set KERNEL_CC to CC as default
-
-1999-08-17 Simon Josefsson <jas@pdc.kth.se>
-
- * appl/klog.c (do_timeout): Use waitpid() instead of wait4().
-
- * xfs/irix/Makefile.in (distclean,distclean-subdirs): New targets.
-
- * xfs/irix/bin/Makefile.in (distclean): New target.
-
- * conf/Makefile.in (distclean): Remove Makefile.
-
- * lwp/Makefile.in (clean): Remove process.i.
- (distclean): Remove Makefile.
-
- * include/Makefile.in (distclean): New target.
-
-1999-08-14 Love <lha@s3.kth.se>
-
- * tests/find-linux: new test
-
- * tests/run-tests.in: beatified and added test find-linux
-
- * arlad/fcache.c (emergency_remove_node): added function
- (cleaner): try to throw nodes when they are in kernel
- (unlink_lru_entry): call emergency_remove_node() if we are short on nodes.
-
-1999-08-10 Assar Westerlund <assar@sics.se>
-
- * configure.in: AC_DEFINE with three arguments to avoid having
- garbage in acconfig.h
-
- * acconfig.h: remove more from this supposed-to-be-empty file
-
-1999-08-09 Assar Westerlund <assar@sics.se>
-
- * configure.in: use AC_HAVE_KERNEL_DEF instead of AC_HAVE_DEF
-
-1999-08-08 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs/xfs_locl.h: try to move up asm/current.h even more
-
-1999-08-08 Assar Westerlund <assar@sics.se>
-
- * Release 0.27
-
-1999-08-08 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhlookup): correct call to
- xfs_vfs_object_create
-
- * xfs/bsd/xfs_syscalls-common.c (fhget_call): return a
- `xfs_handle_t' and not a `fh_args' in vice_ioctl->out
-
- * xfs/bsd/xfs/xfs_common.h (memcpy): add prototype
-
- * xfs/bsd/xfs_common-bsd.c (memcpy): implement in terms of bcopy
- for the kernels that don't have it
-
- * configure.in: check for memcpy in kernel
-
- * arlad/messages.c (xfs_message_remove): always do an installnode
- instead of an installattr sometimes. this seems to solve
- hardlink1
-
- * appl/Makefile.in (LIBS): gratious link with RXKAD_LIBS.
-
- * appl/tokens.sh: retire
-
- * appl/Makefile.in: remove SHELL_SCRIPTS. none left after
- tokens.sh was retired
-
- * xfs/solaris/Makefile.in (DEFS): include KERNEL_CFLAGS
-
- * configure.in (solaris): try to handle 64-bit sparc
-
- * configure.in (linux): add `-ffixed-8' when compiling on alpha
- (setgroups-tests): add _LKM, should really use KERNEL_foo instead
-
-1999-08-04 Assar Westerlund <assar@sics.se>
-
- * arlad/messages.c (xfs_message_pioctl): conditionalize to death
- (for 32 bit compat foobar).
-
- * include/kafs.h: conditionalize 32-bit guck
-
- * appl/klog.c: merge in more patch from Chris Wing
- <wingc@engin.umich.edu>:
-
- 1) Somebody broke the behavior of the -tmp option. (made get_tkt
- FALSE instead of TRUE). Fixed.
-
- 2) mkstemp() from roken creates a unique temporary file and
- returns the name. Previously I had used mktemp(), which returns
- a unique name only.
- (I originally dealt with the possible race condition by putting the
- ticket files in a directory called /ticket, mode 1733).
-
- The problem is that if a ticket cannot be gathered (for
- instance, if the wrong password is entered), this temporary
- file will stick around.
-
- Fixed so that the ticket file is automatically destroyed if it
- isn't made available to the user.
-
- 3) If -setpag is used and the shell cannot be exec()ed, the AFS
- token will stick around in a ghost PAG. Now klog makes sure to
- remove the token in this case.
-
- (as per the recent discussion about bloating the AFS client with large
- numbers of dead credentials)
-
- 4) Minor changes to move all warning messages to use warnx, diet,
- etc., eliminating fprintf(stderr, ... )
-
- 5) Minor changes to warning messages missing whitespace or having
- superfluous newlines
-
-1999-08-02 Assar Westerlund <assar@sics.se>
-
- * arlad/messages.c (xfs_message_pioctl): handle all the 32 bit
- versions of the pioctls
-
- * xfs/solaris/xfs_wrap.c: install the 32bit syscall
-
- * xfs/solaris/xfs_syscalls.c (xfs_syscall32): implement a 32 bit
- syscall (to be used when running on solaris 7 in 64bit mode)
-
- * include/kafs.h: define ViceIoctl32 for the 32bit API in case
- it's different. also define all the pioctl values with _32
- appended because the sizeof the struct may be used to to derive
- the actual value used.
-
- * configure.in (--with-krbafs): handle both pointing at the prefix
- and the lib itself
- (setgroups tests): define all kernel defines and correct name of
- sysproto macro (this should really be done with the kernel test)
-
- * arlad/afsdir_check.c: don't include arla_local.h because that
- would give us xfs.h which we don't want.
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_link): try to handle early
- FreeBSD here as well
-
- * arlad/arladeb.c: don't include arla_local.h because that would
- give us xfs.h which we don't want.
-
-1999-08-02 Love <lha@s3.kth.se>
-
- * conf/CellServDB (umr.edu): Uppdated
-
-1999-08-01 Love <lha@s3.kth.se>
-
- * arlad/fcache.c (fcache_fhget): move vice_ioctl to avoid warning.
-
- * xfs/bsd/xfs/xfs_syscalls.h (xfs_fhandle_t): define
-
- * xfs/bsd/xfs/xfs_locl.h: glue for xfs_vfs_getvfs and
- xfs_vfs_object_create
-
- * xfs/bsd/xfs_vfsops-osf.c (xfs_fhlookup): use opaque
- xfs_fhandle_t instead of (fsid,fileid,gen)
- (xfs_fhopen): changed to new signature
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhlookup): new signature, use
- opaque struct to pass in fh-data and typecast it to xfs_fh_args or
- fhandle_t depending on if we have a working VPTOHP (ie getfh)
- (xfs_fhopen): use native sys_fhopen
-
- * xfs/bsd/xfs_syscalls-common.c (fhget_call): implement a fhget if
- we have a working VPTOFH.
- (fhopen_call): use xfs_fhandle_t instead of fh_args.
-
- * xfs/bsd/xfs_message.c (xfs_message_installdata): use new style
- fhlookup
- (xfs_message_version): reenable native fhget
-
- * xfs/solaris/xfs_syscalls.c (xfs_unpag): implement
-
-1999-07-29 Assar Westerlund <assar@sics.se>
-
- * appl/klog.c: use krb_get_pw_in_tkt instead of krb_get_pw_in_tkt2
- and don't use krb_get_default_principal to be compatible with CNS
-
- * lib/acl/acl_files.c (krb_principal): removed definition. we get
- it from stds.h
-
- * lwp/process.S: use ENTRY instead of _ENTRY to be more consistent
- with the definitions in <machine/asm.h>
-
-1999-07-29 Love <lha@s3.kth.se>
-
- * arlad/messages.c (try_again): free connections then we get a
- RXKADEXPIRED.
-
- * rx/rx.c (rxi_ReceivePacket): if there is an error with the
- connection propagate that up to the user with
- rxi_ConnectionError()
-
-1999-07-29 Assar Westerlund <assar@sics.se>
-
- * lwp/process.S: try to be more consitent with using _C_LABEL and
- _ENTRY
-
- * configure.in: some more <sys/time.h>, from Harald Barth
- <haba@pdc.kth.se>
-
-1999-07-29 Love <lha@s3.kth.se>
-
- * conf/CellServDB: Added eng.utah.edu, anl.gov changed
-
- * include/Makefile.in: Added parse_time.h, by Ken Raeburn
- <raeburn@raeburn.org>
-
- * xfs/bsd/xfs/xfs_locl.h: include xfs/xfs_syscalls.h instead of
- sys/syscallargs.h to avoid dual inclusion by Ken Raeburn
- <raeburn@raeburn.org>
-
- * configure.in: added <sys/time.h> for setgroups test as suggested
- by Ken Raeburn <raeburn@raeburn.org>
-
-1999-07-28 Love <lha@s3.kth.se>
-
- * arlad/fcache.c (stale): throw data if we have any
-
-1999-07-28 Assar Westerlund <assar@sics.se>
-
- * arlad/volcache.c (sanitize_nvldbentry): added. used.
-
- * arlad/volcache.c (volcache_getbyname, volcache_getbyid): move
- the setting of stablep here
-
- * arlad/messages.c (try_again): figure out if the volume
- information is reliable
-
- * arlad/volcache.c (cmp_nvldbentry): new function
- (volcache_reliable): another new function
- (*): maintain stablep
-
- * arlad/volcache.h (volcacheentry): add last_fetch and stablep
- (volcache_reliable): prototype
- (VOLCACHE_OLD): 120
-
-1999-07-25 Simon Josefsson <jas@pdc.kth.se>
-
- * tests/hardlink1.c (main): Non-ambigous errors.
-
-1999-07-25 Magnus Ahltorp <map@stacken.kth.se>
-
- * xfs/linux/xfs/xfs_msg_locl.h: Added xfs_message_{version,gc_nodes}
- prototypes
-
- * xfs/linux/xfs_message.c (xfs_message_version): new func, what
- this xfs supports
- (xfs_message_gc_nodes): throw away nodes that isn't used
-
- * xfs/linux/xfs_dev.c: Call new functions
-
-1999-07-25 Love <lha@s3.kth.se>
-
- * tests/run-tests.in: -p for `fs calculate`
-
- * appl/fs_lib.c (fs_calculate_cache): new function
-
- * arlad/messages.c (vioc_calculate_cache): New function
-
- * arlad/fcache.c (fcache_calculate_usage,sum_node): new functions
- to calculate real cachesize
-
- * include/kafs.h: added VIOC_CALCULATE_CACHE (58)
-
- * arlad/reconnect.c (reconnect_mkdir): Dont run mkdir on the
- child-node, its already done.
-
-1999-07-24 Assar Westerlund <assar@sics.se>
-
- * ydr/output.c (error_function): let the default be the empty
- string which makes lots of stuff much simpler
- (generate_simple_stub): always use error_function
-
- * arlad/fcache.c (throw_data): correct the assert to use the
- correct variable
- (try_next_fs): return TRUE for ARLA_VNOVOL (suggested by Jeffrey
- Hutzelman <jhutz+@cmu.edu>)
- (read_attr): don't free server context if do_read_attr fails
- (read_data): increment `usedbytes' when we have actually gotten the
- data
- (fcache_get_data): don't free server context if do_read_attr fails
-
-1999-07-24 Love <lha@s3.kth.se>
-
- * arlad/*-subr.c: use fcache_get_fbuf and fdir_readdir instead of
- adir_readdir to avoid racecondition
-
- * arlad/adir.c (get_fbuf_from_fcache): remove and use
- fcache_get_fbuf instead.
-
- * arlad/fcache.[ch] (fcache_get_fbuf): new function
-
- * arlad/xfs.[ch]: Move a lot of xfs related stuff here. Document
- and clarify how each function is (almost) suppose to work,
- REMEMBER the comments are only there to confuse you.
-
- * arlad/messages.[ch]: move a lot of xfs related stuff from
- message.[ch] to xfs.[ch]
-
- * arlad/kernel.c (version_thread): don't wait, just exit
-
- * appl/vos_dump.c (dump_volume): use conv_to_arla_errno for
- afs-errors
-
- * xfs/include/xfs/xfs_message.h: Add
- xfs_message_{version,gc_nodes} messsages
-
- * xfs/bsd/xfs/xfs_msg_locl.h: Added xfs_message_{version,gc_nodes}
- prototypes
-
- * xfs/bsd/xfs_message.c (xfs_message_version): new func, what this
- xfs supports
- (xfs_message_gc_nodes): throw away nodes that isn't used, XXX
- osf,smp
-
- * arlad/fcache.c (fcache_fhopen,fcache_fhget): check if we have
- native fopen
- (throw_data): don't assert on wrong length, file might be broken
- from and faulty StoreData.
- (cleaner): run xfs_send_message_gc_nodes() to try to gc nodes that
- is ref:ed by xfs.
- (emergency_remove_data): use xfs_send_message_gc_nodes() to throw
- any lot of nodes that is ref:ed by xfs
- (read_data): use conv_to_arla_errno() for afs-errors
- (write_data): open file RW so we can truncate if it we get an
- error while storing the file
- (truncate_file): use conv_to_arla_errno() for afs-errors
-
- * lib/bufdir/fbuf.c (mmap_copy{rx2fd,fd2rx}): use
- conv_to_arla_errno to fetch afs special error (VDISKFULL & co)
- from rx_Write()
-
- * arlad/reconnect.c (reconnect_putattr): use conv_to_arla_errno to
- fetch afs special error (VDISKFULL & co) from rx_Write()
-
- * arlad/messages.h (xfs_message_{send,sleep}): export
-
- * arlad/messages.c (*): Add gc node stuff
- (xfs_message_{send,sleep}): export
- (xfs_message_rpc): move to xfs.[ch]
-
- * arlad/kernel.c (kernel_interface): create version_thread
- (version_thread): start probing on what xfs can do. (XXX do
- earlier ?)
-
- * arlad/arla_local.h: Added "xfs.h"
-
- * arlad/Makefile.in: Added xfs.[cho]
-
- * arlad/xfs.[ch]: xfs related stuff, like version-control and
- xfs_send_message_gc_nodes().
-
- * configure.in: AC_CHECK_KERNEL_FUNCS(vgonel)
-
-1999-07-23 Love <lha@s3.kth.se>
-
- * arlad/messages.c (xfs_message_rmdir): only do sillyrename when
- linkcount == 2, add comments.
- (xfs_message_remove): only set it silly when linkcount == 1 (ie
- last reference to file)
-
- * arlad/fcache.c
- (do_read_attr,write_data,write_attr,fcache_get_data): don't read
- attr if its a silly rename.
-
-1999-07-20 Love <lha@s3.kth.se>
-
- * arlad/fcache.c (fcache_get): reset flags.silly
- (fcache_recover_state): set flags.silly == FALSE
- (fcache_reobtain_callbacks): check for flags.silly
- (fcache_giveup_all_callbacks): check for flags.silly
-
- * arlad/reconnect.c (do_replay): ftruncate the log_file
-
- * arlad/messages.c (xfs_message_remove): Only insert limbo entry
- into kernel when its there, add comment.
-
- * arlad/inter.c (cm_symlink): the caller of create_symlink is
- resonsible of setting flags.kernelp.
-
- * arlad/fcache.c (create_symlink): move out settign of
- flags.kernelp, since the entry might be a mountpoint and the
- child_entry is never pushed to the kernel.
-
- * arlad/inter.c (cm_lookup): make sure ret is set to a correct
- value.
-
- * appl/fs.c (getcache_cmd): use getarg, enable printing of bytes
- and kbytes.
-
- * appl/amon.c (GetUsedBytes): change names to reflect new
- fs_getfilecachestats
-
- * appl/fs.c (getcache_cmd): use new fs_getfilecachestats() that
- uses bytes instead of kbytes
-
- * appl/fs_lib.c (fs_getfilecachestats): change signature, pass
- bytes instead of kbytes.
-
- * arlad/messages.c (viocgetcacheparams): pass on
- fcache_{high,used}bytes unchanged to userland.
-
-1999-07-20 Assar Westerlund <assar@sics.se>
-
- * arlad/inter.h (cm_lookup): update prototype
-
- * arlad/inter.c (cm_lookup): new flags for following mount points
-
- * arlad/messages.c: new version of cm_lookup, change callers
- (xfs_message_remove): set tokens correctly
-
-1999-07-20 Artur Grabowski <art@stacken.kth.se>
-
- * configure.in: test for machine/endian.h
-
- * rxkad/rxk_crpt.c: add a special test for endianness to allow
- static config.h on many architectures. (don't ask)
-
- * xfs/bsd/xfs_common-bsd.c: make it build without XFS_DEBUG.
-
-1999-07-20 Love <lha@s3.kth.se>
-
- * xfs/bsd/xfs/xfs_locl.h: add test for {sys_,}setgroups_args
-
- * xfs/bsd/xfs_syscalls-common.c (xfs_setgroups): use
- xfs_setgroups_args and SCARG
-
- * configure.in: test for {,sys_}setgroups_args
-
- * cf/have-def.m4: New macro
-
-1999-07-20 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_vfsops.c: handle d_alloc_root with one and two
- arguments
-
- * configure.in: use AC_LINUX_FUNC_D_ALLOC_ROOT_TWO_ARGS
-
- * cf/linux-func-d_alloc_root-two_args.m4: new test
-
- * xfs/solaris/xfs_syscalls.c (xfs_setgroups): port the linux patch
- to prohibit setting the pag with setgroups
-
- * xfs/bsd/xfs_syscalls-common.c (xfs_setgroups): port the linux
- patch to prohibit setting the pag with setgroups
-
- * xfs/linux/xfs_syscalls.c (xfs_setgroups): always leave from the
- PAG. prevent it from installing fake PAGs. From Chris Wing
- <wingc@engin.umich.edu>
-
- * arlad/fcache.c (create_symlink): remove bogus increate of
- `usedbytes'
-
-1999-07-20 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (fcache_extra_file_name): terminate string
- properly
-
-1999-07-19 Assar Westerlund <assar@sics.se>
-
- * tests/hardlink1.c: more testing
-
- * xfs/linux/xfs_inodeops.c (xfs_getattr): new function for return
- the attributes for a file or directory. installed in all the
- instances of `struct inode_operations'. This requires the patch
- adding the getattr operation to inode_operations.
-
- * xfs/linux/xfs/xfs_locl.h: <asm/current.h>: conditionalize
-
- * configure.in: check for asm/current.h check for {updatepage,
- revalidate, and getattr} in `struct inode_operations'
-
- * NEWS: mention new cache file names
-
- * arlad/messages.c (token_for_cell): copy out the ticket
-
-1999-07-19 Simon Josefsson <jas@pdc.kth.se>
-
- * appl/fs.c (copyacl_cmd):
- (afs_copyacl): New functions.
- (afs_setacl): Garbage collect empty rights. Don't segfault on
- empty acl.
-
-1999-07-19 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (fcache_extra_file_name): add the @ at the end
- instead
-
-1999-07-15 Love <lha@s3.kth.se>
-
- * arlad/messages.c (voicckserv): s,0,cell_name2num
- (cell_getthiscell());,
-
-1999-07-15 Assar Westerlund <assar@sics.se>
-
- * appl/klog.c (main): use kname_parse instead of krb_parse_name
-
-1999-07-14 Assar Westerlund <assar@sics.se>
-
- * appl/appl_locl.h: <sys/wait.h>
-
- * lib/acl/acl_files.c: some functions to handle other kerberos
- libraries
-
- * appl/tokens.c (krb_kdctimeofday): check for
-
- * appl/klog.c: fallback for KRB_TICKET_GRANTING_TICKET
-
- * configure.in: check for sys/wait.h
-
- * configure.in: AC_FUNC_KRB_KDCTIMEOFDAY: add
-
- * tests/Makefile.in: add create-{symlinks,dirs}
-
- * arlad/fcache.c: make the cache directory two-level
-
- * arlad/fcache.h (fcache_dir_name): new prototype
-
- * tests/many-dirs: use create-dirs
-
- * tests/many-symlinks: use create-symlinks
-
- * tests/create-symlinks.c: new file
-
- * tests/create-dirs.c: new file
-
- * tests/many-files: use create-files
-
- * tests/create-files.c: new program for creating lots of files
-
- * tests/Makefile.in: add create-files
-
- * tests/read-vs-mmap2.c (mmap_file): needed cast
-
- * tests/read-vs-mmap.c (mmap_file): needed cast
-
- * appl/fs.c (afs_whereis): remove htonl - address is already in
- network byte order
-
-1999-07-13 Love <lha@s3.kth.se>
-
- * xfs/winnt/*: Added dead code.
-
- * arlad/bsd-subr.c (dir_remove_name): Add assertions. Only merge
- with previous dirent, if there is enough space in the dirent.
-
- * appl/klog.c: start to use diet{,x}
- (randfilename): rewrite, umich compat on ticketfile
-
- * appl/{README.afsutils,TODO.afsutils}: Note by Chris Wing
- <wingc@engin.umich.edu>
-
- * appl/klog.[ch1]: Added klog by Chris Wing
- <wingc@engin.umich.edu>
-
- * appl/unlog.[ch1]: Added unlog by Chris Wing
- <wingc@engin.umich.edu>
-
- * appl/appl_locl.h: Added <kafs.h>, <parse_time.h>
-
- * appl/amon.c: removed <kafs.h>
-
-1999-07-12 Magnus Ahltorp <map@stacken.kth.se>
-
- * appl, lib/ko: Move partition name conversion to libko
-
-1999-07-06 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_link): only vput on OpenBSD and
- NetBSD :-(
-
-1999-07-06 Love <lha@s3.kth.se>
-
- * arlad/volcache.c (get_info_loop): check for dynroot volume
-
- * arlad/fcache.c (read_attr): check for dynroot
- (getroot): check for dynroot
- (fcache_get_data): check for dynroot
-
- * arlad/arla.c: (args): -dynroot, -D for dynroot
-
- * arlad/arla_local.h: <dynroot.h>
-
- * arlad/Makefile.in (SOURCE,HEADER,OBJECT) += dynroot.?
-
- * arla/dynroot.[ch]: dynamic root, new files.
-
- * lib/ko/ko.h (cell_foreach,cell_get_version): export
-
- * lib/ko/kocell.c (celldb_version): version of in-memory
- (cellno): dont use the 0 cell
- (add_cell): assert on cell == 0
- (cell_init): add dynroot cell
- (cell_foreach): make a iterator function
- (cell_get_version): return version of the db
- (add_special_dynroot_cell): add dynrootcell to the celldb
-
-1999-07-04 Love <lha@s3.kth.se>
-
- * tests/fs-flush: test to flush
-
-1999-07-04 Assar Westerlund <assar@sics.se>
-
- * tests/run-tests.in (ARLA_TESTS): add mkdir2
-
- * tests/Makefile.in (mkdir2): add
-
- * tests/mkdir2.c: new test
-
- * tests/run-tests.in (ARLA_TESTS): add hardlink2
-
- * tests/hardlink2.c: new test
-
- * tests/Makefile.in (hardlink2): add
-
- * arlad/messages.c (xfs_message_remove): fall back to conv_dir if
- dir_remove_name fails. decrement the linkcount to zero if it was
- one before so that hardlink1 succeeds. generally clean-up.
-
-1999-07-03 Assar Westerlund <assar@sics.se>
-
- * tests/test-gunzip-gnu-mirror: replace spaces in the case-pattern
- with * (how do you quote in a case-pattern?)
-
- * tests/run-tests.in (ARLA_TESTS): add test-gunzip-gnu-mirror
-
- * tests/test-gunzip-gnu-mirror: new test
-
-1999-07-01 Assar Westerlund <assar@sics.se>
-
- * arlad/arla_local.h: add <sys/mount.h>
-
- * configure.in (NetBSD): figure out PMAP_NEW in the same way as
- UVM
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_link): VOP_UNLOCK ->
- xfs_vfs_unlock
-
- * configure.in (NetBSD): fix test syntax, hopefully.
-
- * arlad/fcache.c (fcache_fhopen, fcache_fhget): try to handle
- getfh and fhopen syscalls
-
- * configure.in (VERSION): bump to 0.27pre
- (getfh, fhopen): check for
-
-1999-06-29 Assar Westerlund <assar@sics.se>
-
- * arlad/messages.c (xfs_message_remove): install attributes for
- the dead none so that if there are more links to it they will get
- the correct link count
-
- * tests/Makefile.in: add hardlink1
-
- * tests/hardlink1.c: new test
-
- * tests/run-tests.in (ARLA_TESTS): add hardlink1
-
- * xfs/linux/xfs_node.c (new_xfs_node): always update the inode
- attributes
-
- * appl/fs.c (afs_print_sysname): transarc-compatible quoting.
- From Simon Josefsson <jas@pdc.kth.se>
-
- * arlad/messages.c (token_for_cell): return the viceId instead.
- From Chris Wing <wingc@engin.umich.edu>
-
-1999-06-29 Assar Westerlund <assar@sics.se>
-
- * Release 0.26
-
- * configure.in (VERSION): bump
-
- * configure.in (irix): set IP in a more robust way
-
- * xfs/linux/xfs_inodeops.c (xfs_print_lock): punt on printing
- `waking' since it's different types on different architectures
-
-1999-06-28 Johan Danielsson <joda@pdc.kth.se>
-
- * xfs/bsd/xfs_vnodeops-osf.c: implement xfs_mmap, and (crude)
- xfs_getpage
-
- * xfs/bsd/xfs_message.c (xfs_message_installdata): ugly hack to
- prevent panics on OSF/1
-
-1999-06-26 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_dev.c (xfs_message_rpc): remove unused variable
-
- * xfs/linux/xfs_inodeops.c: removed som printf warnings
-
-1999-06-24 Assar Westerlund <assar@sics.se>
-
- * lib/bufdir/fbuf.h: <rx/rx.h>: add
-
-1999-06-23 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/bin/arla.init.in: new sysv-style init file from Marko
- Asplund <aspa@hip.fi>
-
- * arlad/messages.c (xfs_message_remove): remove the entry from the
- converted directory but without moving anything around (with
- dir_remove_name). also install it with XFS_DATA_R. this should
- fix the problem with large-dir-extra
-
- * arlad/solaris-subr.c (dir_remove_name): implement
-
- * arlad/sunos-subr.c (dir_remove_name): implement
-
- * arlad/irix-subr.c (dir_remove_name): implement
-
- * arlad/hpux-subr.c (dir_remove_name): implement
-
- * arlad/aix-subr.c (dir_remove_name): implement
-
- * arlad/solaris-subr.c (dir_remove_name): some more paranoia
-
- * arlad/subr.h (dir_remove_name): new prototype
-
-1999-06-22 Johan Danielsson <joda@pdc.kth.se>
-
- * xfs/bsd/xfs_wrap-osf.c (xfs_configure): check for errors
-
-1999-06-20 Assar Westerlund <assar@sics.se>
-
- * lib/bufdir/fdir.c (fdir_readdir): initialize `len'. start using
- fbuf_len and fbuf_buf
-
- * configure.in: comment out test for mode_t and nlink_t
-
- * lib/bufdir/fbuf.c (mmap_copyfd2rx): correct arguments to mmap
-
- * arlad/fcache.c (find_first_fs): don't segv when e->volume is not
- set
- (write_data): new copyfd2rx
-
- * lib/bufdir/fbuf.c (copyfd2rx): also include offset
-
- * arlad/adir.c: remove all unsued variables
-
- * arlad/adir.c: start using fdir
-
- * arlad/inter.c: new signature for adir_lookup_fcacheentry
-
- * arlad/adir.h (adir_lookup_fcacheentry): new parameter `dir'
-
- * arlad/Makefile.in: link with bufdir instead of our own copy of
- fbuf
-
- * include/Makefile.in (LOCL_HEADERS): add fbuf.h
-
- * tests/test-setgroups.c, tests/test-setpag.c (NGROUPS): define to
- NGROUPS_MAX if not def
-
- * tests/large-dir3.c: remove extra paranoid test
-
- * lwp/process.S: update comment for .register stuff on solaris 7
-
- * arlad/messages.c (xfs_message_create, xfs_message_mkdir): don't
- send down (owner,group) group attributes
-
- * appl/vos_common.c: get rid of some stupid ctype warnings
-
- * configure.in (mode_t, nlink_t): test for
- (const, endianness): also test for
-
- * arlad/fcache.c (create_directory): use the kludge of throwing
- away data if we for turn out to get a new directory with initial
- data. this is to make milko happy and should really be solved
- there instead.
-
-1999-06-19 Assar Westerlund <assar@sics.se>
-
- * arlad/arla.c: write the PID to /var/run/arlad.pid make
- fork-logic simpler
-
-1999-06-17 Johan Danielsson <joda@pdc.kth.se>
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_read_common): actually call
- xfs_vop_read
-
-1999-06-16 Assar Westerlund <assar@sics.se>
-
- * xfs/rhapsody/xfs_node.c (xfs_attr2vattr, vattr2xfs_attr): it's
- not ts_* but tv_*
-
- * xfs/rhapsody/xfs_message.c (xfs_message_installdata): the
- standard `tmp' -> `message->cache_name'
-
- * xfs/solaris/xfs_vnodeops.c (do_fsync): copy attributes
-
- * xfs/solaris/xfs_node.c (vattr2xfs_attr): only copy the
- interesting bits from va_mode
-
-1999-06-13 Assar Westerlund <assar@sics.se>
-
- * appl/vos_dump.c: patch from Alexandra Ellwood <lxs@MIT.EDU> to
- work around a rhapsody gcc bug (variables and typenames in the
- same namespace)
-
- * arlad/arla.c (miain): complain if we can't create the cache
- directory or it doesn't exist
-
-1999-06-11 Assar Westerlund <assar@sics.se>
-
- * util/ip.[ch]: zaped
-
-1999-06-10 Johan Danielsson <joda@pdc.kth.se>
-
- * xfs/bsd/xfs_syscalls-common.c: remove some more ifdefs
-
- * xfs/bsd/xfs/xfs_locl.h: add xfs_proc_to_ruid
-
-1999-06-09 Assar Westerlund <assar@sics.se>
-
- * include/Makefile.in (LOCL_HEADERS): removed unexisting headers
-
- * ydr/main.c (main): use efopen and remove temporary files and
- give sensible error messages for popen failing
-
-1999-06-09 Johan Danielsson <joda@pdc.kth.se>
-
- * xfs/bsd/xfs_vnodeops-common.c: use
- xfs_vop_{read,write,access,getattr}
-
- * xfs/bsd/xfs/xfs_locl.h: add xfs_vop_{read,write,access,getattr}
-
- * xfs/bsd/xfs_syscalls-wrap-bsd.c: add support for NetBSD a.out
- emulation
-
- * configure.in: check for aout_sysent to keep old pre-ELF NetBSD
- programs happy
-
-1999-06-08 Love <lha@s3.kth.se>
-
- * xfs/bsd/xfs_wrap-bsd.c (xfs_mod): dont have a special case for
- MOD_DISPATCH since we need the major number befor exiting.
-
-1999-06-08 Assar Westerlund <assar@sics.se>
-
- * arlad/messages.c (viocsettok): return ENOENT if the cell doesn't
- exist
-
- * xfs/bsd/bin/startarla.in: after thinking about it, it doesn't
- make very much sense to send kldload options that isn't supported
- on any machine other than mine
-
-1999-06-07 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/getcwd.c: add <sys/types.h>. Patch from Derrick J
- Brashear <shadow@dementia.org>
-
-1999-06-04 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/bin/startarla.in: send -p to kldload
-
-1999-06-03 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhopen): FILE_UNUSE the `struct
- file'. This might solve arlad getting hung in `closef' on NetBSD
-
- * xfs/bsd/xfs_wrap-bsd.c (xfs_modload): make it compile
-
- * xfs/bsd/xfs/xfs_dev.h (xfs_is_xfs_dev): add prototype
-
- * xfs/bsd/xfs_wrap-osf.c (xfs_is_xfs_dev): new function
-
- * xfs/bsd/xfs_wrap-bsd.c (xfs_is_xfs_dev): new function
-
- * xfs/bsd/xfs_vfsops-common.c (xfs_mount_common): use
- xfs_is_xfs_dev instead of xfs_isdevopen
-
- * xfs/bsd/xfs_dev-osf.c (xfs_func_is_devopen): remove
-
- * xfs/bsd/xfs_dev-bsd.c (xfs_func_is_devopen): remove
-
-1999-06-03 Johan Danielsson <joda@pdc.kth.se>
-
- * xfs/bsd/xfs_wrap-bsd.c (xfs_mod): expand call to DISPATCH, since
- we want to get the assigned major number before exiting
-
-1999-05-31 Love <lha@s3.kth.se>
-
- * util/eefile.c (eefopen) Fail if mkstemp fails
-
-1999-05-30 Love <lha@s3.kth.se>
-
- * Release 0.25
-
-1999-05-30 Assar Westerlund <assar@sics.se>
-
- * tests/run-tests.in (ARLA_TESTS): add discon-tar{1,2} and remove
- setgroups (it needs to be run as root)
-
- * tests/test-setgroups.c (main): kludgy tests to handle the case
- of the PAG being in slots (0 and 1) or (1 and 2)
-
- * configure.in: add test for .register on solaris as
-
- * HACKING: new file
-
- * rx/Makefile.in: add test_rx_clock
-
- * rx/test_rx_clock.c: new test program
-
- * tests/build-gdb: use gdb-4.18 instead
-
- * arlad/reconnect.c: only update the fids in the kernel if they
- are there
-
- * tests/run-tests.in: warm fuzzy at the end
-
- * tests/run-tests.in: add more discon*
-
- * arlad/reconnect.c (reconnect_putattr): comment out some code.
- handle directories correctly.
-
- * arlad/messages.c (xfs_message_mkdir): try to invent attributes
- when creating directories
-
- * arlad/fcache.c (write_attr): handle disconnected mode
- (create_file, create_directory): allocate fake FIDs from 1000 and 1001
- with an increment of two.
-
- * xfs/solaris/xfs/xfs_locl.h: add sys/syscall.h
-
- * xfs/irix/xfs_syscalls.c: junk unused code
-
- * tests/run-tests.in: recognize --version and --help
-
- * lwp/process.S: upgrade solaris 7 sparcv9 .register declarations
- to the (apparently) correct syntax. now we only need an autoconf
- test.
-
- * arlad/kernel.c: err format fixes
-
- * arlad/afsdir_check.c: err format fixes
-
-1999-05-30 Love <lha@s3.kth.se>
-
- * doc/partsofarla.texi: @xref in a () should be a @pxref
-
- * tests/boot-strap-arla: New test
-
- * conf/CellServDB: Added arla.e.kth.se
-
- * configure.in (CONFIG_FILES)+= milko/bos/Makefile
-
- * rxdef/bos.xg: Added partial bos def.
-
- * rxdef/Makefile.in: Add libbos{server,client}.a
-
- * arlad/service.h: Added bos service id
-
- * lib/ko/koerror.c: Prefixed all entries with appropiate prefixes.
- Added bos errorcodes.
-
- * appl/fs.c: fs strerror to easy find the errorcode
-
-1999-05-29 Assar Westerlund <assar@sics.se>
-
- * tests/run-tests.in (ARLA_TESTS): add new tests
-
- * tests/discon-{create,echo,mkdir}: new tests
-
- * arlad/volcache.c (volcache_set_rootvolume): assert there being a
- volname
- (VOLCACHE_SIZE): make prime
-
- * arlad/reconnect.c (fid_translate): make global
- (recon_hashtabdel, recon_hashtabadd): remove
- (reconnect_mkdir): remove bad error check
-
- * arlad/messages.c (xfs_message_putattr): write disconnected
- changes to the log
- (xfs_message_create): try to invent attributes when creating
- disconnected files
- (xfs_message_mkdir): log disconnected changes
- (viocconnect): remove ARLACACHEDIR
-
- * arlad/fcache.c (recon_hashtabadd, recon_hashtabdel): add
- handle the case of entry->volume == NULL in more places
- (init_fs_server_context): new function
- (find_first_fs): don't care about connected_mode
- (fcache_reobtain_callbacks): get volume entries here. is this right?
- (write_attr, create_directory, create_symlink, create_link,
- remove_file, remove_directory, rename_file, do_read_data, getacl,
- setacl, getvolstat, setvolstat): check connected_mode
- (create_file): initialize more attributes
-
- * arlad/discon_log.h: add more prototypes
-
- * arlad/conn.c (internal_get): don't check connected_mode here,
- it's done elsewhere.
-
- * configure.in: AC_HAVE_STRUCT_FIELD: fix uses
-
- * tests/mountpoint.in: run fs from objdir
-
- * tests/run-tests.in (MILKO_TESTS): add deep-tree2
-
-1999-05-28 Assar Westerlund <assar@sics.se>
-
- * configure.in (KRB_LIB_FLAGS): set
-
- * tests/Makefile.in: need to link against libkrb as well...
-
- * tests/run-tests.in: add new test: setgroups setpag
-
- * tests/Makefile.in: add setgroups and setpag
-
- * tests/setpag*, tests/setgroups*: add new tests
-
- * xfs/solaris/xfs_syscalls.c (store_pag): always get a new `struct
- ucred'
-
- * xfs/bsd/xfs_syscalls-common.c (store_pag): always get a new
- `struct ucred'
-
-1999-05-28 Love <lha@s3.kth.se>
-
- * lib/ko/kocell.c: add cell_setthiscell
-
- * appl/vos_createentry.c: added cell, and corrected noauth, use cell in
- arlalib_getconnbyname, return a sane error
-
- * appl/vos_vldbexamine.c: Added, a examine that only probes the
- vldbserver (to be removed by when vldblist works).
-
-1999-05-27 Assar Westerlund <assar@sics.se>
-
- * xfs/solaris/xfs/xfs_syscalls.h: new prototypes
-
- * xfs/solaris/xfs_wrap.c: install/remove setgroups wrapper
-
- * xfs/solaris/xfs_syscalls.c: add setgroups wrapper
-
- * lib/acl/acl.h: add atypes.h to make stds.h happy
-
- * configure.in: fix the hstrerror tests
-
- * xfs/bsd/xfs_syscalls-common.c (store_pag): store the correct
- values
-
- * xfs/bsd/xfs/xfs_syscalls.h (xfs_setgroups, old_setgroups_func):
- add
-
- * xfs/bsd/xfs_syscalls-wrap-osf.c: save and restore setgroups
- system call
-
- * xfs/bsd/xfs_syscalls-wrap-freebsd.c: save and restore setgroups
- system call
-
- * xfs/bsd/xfs_syscalls-wrap-bsd.c: save and restore setgroups
- system call
-
- * xfs/bsd/xfs_syscalls-common.c (store_pag): new function
- (xfs_setgroups): wrapper around setgroups that preserves the PAG
-
- * xfs/linux/xfs_syscalls.c (xfs_setgroups): a wrapper around
- setgroups that preserves the PAG
-
-1999-05-25 Love <lha@s3.kth.se>
-
- * lib/ko/ko.h: Added <netinet/in.h>
-
-1999-05-22 Assar Westerlund <assar@sics.se>
-
- * INSTALL: note that if you change your prefix your kerberos/afs
- libraries may have problems.
-
-1999-05-22 Marcus Sundberg <mackan@stacken.kth.se>
-
- * xfs/linux/bin/startarla.in: Do insmod before creating missing
- device node - makes devfs happy.
-
-1999-05-19 Love <lha@s3.kth.se>
-
- * xfs/bsd/xfs_dev-bsd.c (xfs_devioctl): reorder defines
-
- * xfs/bsd/xfs_vfsops-common.c (xfs_mount_common): udev2dev for
- freebsd
-
- * configure.in: AC_CHECK_KERNEL_FUNCS check for udev2dev
-
-1999-05-19 Johan Danielsson <joda@pdc.kth.se>
-
- * configure.in: fix test for -mno-fp-regs on NetBSD/alpha
-
- * lib/bufdir/fbuf.c: sys/errno.h -> errno.h
-
-1999-05-18 Love <lha@s3.kth.se>
-
- * configure.in: CONFIG_FILES += milko/lib/msecurity
-
-1999-05-17 Love <lha@s3.kth.se>
-
- * milko/*: Added filbunke - nnp-server-class fileserver
-
- * include/Makefile.in: Added afs_dir.h
-
- * appl/vos_createentry.c (vos_createentry): zero out newentry
-
-Mon May 17 14:13:33 1999 Johan Danielsson <joda@pdc.kth.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c: only include vm/vnode_pager.h if
- it's present
-
-1999-05-16 Assar Westerlund <assar@sics.se>
-
- * configure.in (AC_LINUX_FUNC_INIT_WAITQUEUE_HEAD): add
-
- * cf/linux-func-init-wait-queue-head.m4: new file
-
- * lwp/lwp.h (LWP_NewRock, LWP_GetRock): add prototypes
-
- * rx/rx_clock.c: handle the case of the itimer expiring
-
- * acconfig.h (__EXTENSIONS__): conditionalize. (it gets
- automatically defined on Irix and needs to be defined on Solaris)
-
- * appl/vos.c: move cmds to avoid a forward declaration
-
- * cf/linux-type-wait-queue-head.m4: try compiling instead of
- greping in linux/wait.h
-
- * arlad/fcache.c (fcache_extra_file_name): change the name for the
- converted directory to be @%04X
-
- * arlad/reconnect.c: adjusted the length of the filenames, based
- on a patch from Niklas Hallqvist <niklas@appli.se>.
- (copy_cached_file): simplify
-
-1999-05-15 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_print_lock): make it work on 2.3.2
- and 2.2 by printing less information. From Hee-Seok Heo
- <hsheo@postech.ac.kr>
-
- * xfs/linux/xfs_dev.c: patch from Hee-Seok Heo
- <hsheo@postech.ac.kr> for 2.3.2 plus autoconf-junk by myself.
-
- * configure.in: test for wait_quque_head_t and init_MUTEX.
-
- * acconfig.h: cut down a lot
-
- * aclocal.m4: dead
-
- * configure.in: moved most of the tests to cf. removed duplicate
- tests updated to autoconf 2.13 separated linux and bsd kernel
- tests
-
- * lwp/Makefile.in (install): work around make rewriting the vpath
- file name
-
- * xfs/bsd/xfs_vfsops-osf.c: use xfs_suser
-
- * xfs/bsd/xfs_vfsops-bsd.c: use xfs_suser
-
- * xfs/bsd/xfs_syscalls-common.c: use xfs_suser
-
- * xfs/bsd/xfs_common-osf.c (xfs_suser): add
-
- * xfs/bsd/xfs_common-bsd.c (xfs_suser): add
-
- * lwp/rw.c (main): correct cast
-
- * arlad/fcache.h (FCacheEntry): kill invalid_le
-
- * Release 0.24
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhlookup): handle one and two
- argument suser
-
- * xfs/bsd/xfs_syscalls-common.c (fhget_call, xfs_debug): handle
- one and two argument suser
-
- * configure.in: test for suser taking two arguments
-
-1999-05-14 Assar Westerlund <assar@sics.se>
-
- * lwp/process.S (__sparcv9): add commented-out .register
- declarations. these are apparently needed if you have a recent as
- but I've currently no way of testing it.
-
-1999-05-12 Assar Westerlund <assar@sics.se>
-
- * rx/rx.c (rxi_ReceivePacket): long should be u_int32_t
-
- * rx/rx.h: do the obvious short -> u_int16_t, long -> u_int32_t
-
-1999-05-11 Assar Westerlund <assar@sics.se>
-
- * lwp/make-process.o.sh.in: use AS from configure
-
- * configure.in: allow setting AS
-
- * xfs/linux/xfs_inodeops.c: merge 2.2.7-fix from map
-
- * lwp/Makefile.in (install): solaris make seems very good at
- rewriting vpath file names. try to work around it.
-
- * include/Makefile.in (install): solaris make seems very good at
- rewriting vpath file names. try to work around it.
-
-1999-05-06 Assar Westerlund <assar@sics.se>
-
- * arlad/arla.c (newwalk): renamed to walk.
-
-1995-05-04 Assar Westerlund <assar@sics.se>
-
- * rx/rx_clock.c (clock_ReInit): count microseconds also
-
- * arlad/fcache.c (getroot): find out the local cell the equality
- way. also made more robust, more informative, and more
- consistent. welcome to the new getroot.
-
- * lib/ko/kocell.c: make all cells be equal (and no cells more
- equal that others)
-
- * arlad/arla.c (main): call clock_ReInit after forking
-
- * rx/rx_clock.c (clock_ReInit): add
-
-1999-04-12 Assar Westerlund <assar@sics.se>
-
- * arlad/Makefile.in (LDFLAGS): set
-
- * configure.in: LDFLAGS: substitute
-
-1999-04-06 Love <lha@s3.kth.se>
-
- * arlad/messages.c (viocsetvolstat): Do not change volumename,
- motd or offlinemsg
-
- * arlad/fcache.c (fcache_get): Added check if we missed
- volume. Note that we should really either nuke the entry or check
- for e->volume == NULL everywhere.
-
-1999-03-29 Love <lha@s3.kth.se>
-
- * arlad/messages.c (try_again) If we don't have EDQUOT use ENOSPC
-
-1999-03-28 Robert Burgess <rb@stacken.kth.se>
-
- * Release 0.23
-
-Sat Mar 27 05:16:49 1999 Assar Westerlund <assar@sics.se>
-
- * arlad/messages.c (vioc_get_cellstatus): reverse issuid test
-
- * configure.in (freebsd[34]): build KLD if kernel is ELF
-
- * xfs/bsd/xfs_syscalls-wrap-osf.c (rename sys_xfspioctl ->
- xfspioctl)
-
- * xfs/bsd/xfs_syscalls-wrap-freebsd.c (rename sys_xfspioctl ->
- xfspioctl)
-
- * xfs/bsd/xfs_syscalls-wrap-bsd.c (rename sys_xfspioctl ->
- xfspioctl)
-
- * xfs/bsd/xfs_syscalls-common.c (rename sys_xfspioctl ->
- xfspioctl)
-
- * xfs/bsd/xfs/xfs_syscalls.h (rename sys_xfspioctl -> xfspioctl)
-
-1999-03-27 Robert Burgess <rb@stacken.kth.se>
-
- * Removed Solaris umount_xfs (the umount command that comes with
- Solaris works better)
-
- * xfs/solaris/xfs_syscalls.c (fhopen_call): Changed in_size check
-
-Wed Mar 24 23:31:09 1999 Assar Westerlund <assar@sics.se>
-
- * arlad/arla.c: always do fork_late
-
-Thu Mar 4 02:40:46 1999 Assar Westerlund <assar@sics.se>
-
- * ydr/output.c: revert back extra changes
-
- * ydr/output.c (generate_multi): do the right thing with the macro
- arguments
-
- * rxdef/ubik.xg: remove bogus struct keywords
-
- * rx/rx_user.c (rxi_GetUDPSocket): fix typos
-
-1999-03-20 Love <lha@s3.kth.se>
-
- * xfs/bsd/xfs/xfs_node.h: Added test for LK_SHARED
-
- * xfs/bsd/xfs_message.c (xfs_message_installnode): lock node when
- doing vget
- (xfs_message_installdata): lock node when doing vget
-
-
-1999-03-19 Love <lha@s3.kth.se>
-
- * Snapshot 1999-03-19
-
- * arlad/volcache.h (volume_make_uptodate): new function
-
- * arlad/volcache.c (volume_make_uptodate): new function
-
- * arlad/messages.c (try_again): ARLA_VMOVED and ARLA_VNOVOL
- invalidates volcache
- (*): new useage of try_again()
-
- * arlad/fcache.c (find_first_fs): make sure the volume is uptodate
- (try_next_fs): ARLA_VMOVED and ARLA_VNOVOL are errornous and will break
- the search for next fileserver (they mean that we should update
- our vldb info)
-
- * lib/ko/koerror.c: Added <rx/rx.h>, <fs_errors.h> and fileserver
- converted errors.
-
- * arlad/messages.c (viocflushvolume): when flushing the volume,
- flush the volume from the volcache at the same time
-
- * ydr/parse.y: use create_type
-
- * ydr/types.c (create_type): New function
-
- * xfs/bsd/xfs/xfs_node.h: If LK_EXCLUSIVE isn't defined make sure
- we define it to 1, its used for compat with old vget() that
- doesn't use lockmgr locking-style
-
- * xfs/bsd/xfs_vfsops-common.c (xfs_root_common): return a locked
- vnode
-
- * xfs/bsd/xfs_message.c: (xfs_message_install{node,root}): do
- vrele() instead of vput() since we never locks the vnode in the
- vget
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_lookup_common): Get a lock on
- when returning it
-
-1999-03-16 Love <lha@s3.kth.se>
-
- * include/Makefile.in: Break out generated headers and files that
- comes with the dist
-
-Sun Mar 14 20:03:10 1999 Assar Westerlund <assar@sics.se>
-
- * appl/vos_local.h: update prototypes
-
- * appl/vos_listvldb.c (vos_listvldb_iter): complain if
- find_db_cell_and_host fails
-
- * appl/vos_examine.c (printvolstat): complain if
- find_db_cell_and_host fails
-
- * appl/vos_common.c (get_vlentry): write a comment to make Magnus
- happy. assume host != NULL.
- (new_vlentry): check and complain if find_db_cell_and_host fails
- (find_db_cell_and_host): comment and remove casts
-
- * rxkad/rxk_clnt.c (client_GetResponse): handle versions >=
- RXKAD_VERSION and always generate a version 2 response
-
-1999-03-12 Love <lha@s3.kth.se>
-
- * Snapshot 1999-03-12
-
- * ydr/parse.y: (TPOINTER): set symbol to NULL
-
- * arlad/fcache.c (find_first_fs): set num_conns to 0 for
- DISCONNECTED case
- (do_read_attr): check if disconnected and have bits
-
-1999-03-11 Love <lha@s3.kth.se>
-
- * arlad/fcache.c (setacl): flush bits in kernel to make it
- update acl
-
-1999-03-10 Assar Westerlund <assar@sics.se>
-
- * rxdef/*.xg: include <config.h> and <roken.h>. They are needed
- when building with !gcc
-
- * xfs/bsd/xfs/xfs_vfsops.h (xfs_fhopen): correct prototype
-
- * xfs/bsd/xfs/xfs_syscalls.h (xfs_pioctl_call): correct prototype
-
- * xfs/bsd/xfs_syscalls-common.c (lookup_node): printf format fix
-
-1999-03-06 Love <lha@s3.kth.se>
-
- * appl/vos_syncsite.c (vos_syncsite): Added arguments (-cell and
- -no-resolve)
-
- * rxdef/volumeserver.xg (AFSVolCreateVolume): name is string
-
- * appl/vos_local.h: Added prototypes
-
- * appl/vos_listvldb.c (vos_listvldb_iter): use
- find_db_cell_and_host
-
- * appl/vos_examine.c (vos_examine): use find_db_cell_and_host
-
- * appl/vos_common.c (getvolumetype): document
- (new_vlentry): New function
- (find_db_cell_and_host): new function
-
- * appl/fs.c(apropos_cmd): use sl apropos
-
- * appl/Makefile.in: Added vos_createvolume.c vos_endtrans.c to vos
-
- * appl/vos_{createvolume,endtrans}.c: New files
-
-Thu Mar 4 02:40:46 1999 Assar Westerlund <assar@sics.se>
-
- * appl/vos_listvldb.c (vos_listvldb_iter): const-ify
-
- * appl/vos_examine.c (printvolstat): use get_vlentry
-
- * appl/vos_common.c (get_vlentry): use arlalib_authflags_t
-
- * appl/vos_common.c (get_vlentry): new function
-
- * appl/vos_dump.c: new file
-
- * ydr/types.c (define_struct): handle already declared structures
- (set_struct_body_sym): new function
-
- * ydr/parse.y: handle forward declaration of struct and redundant
- struct keywords
-
- * ydr/output.c (generating_multi): fix macro call code
-
- * ydr/lex.l: match the final newline on the #line-lines from cpp
- so that we don't increment the lineno when we should not.
-
- * ydr: patches from Derrick J Brashear <shadow@dementia.org> for
- generating rx-multi macros
-
-1999-03-04 Love <lha@s3.kth.se>
-
- * appl/*: started to use arlalib_getauthflag arlalib_authflags_t
- for unified -noauth and -local
-
- * appl/vos_listvldb.c: New file
-
- * appl/vos_local.h: Added prototypes for vos_listvldb() and
- vos_listvldb_iter()
-
- * appl/vos.c (cmds): added listvldb
-
- * appl/Makefile.in (vos): vos_listvldb
-
-Thu Mar 4 02:40:46 1999 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vfsops-netbsd.c (xfs_vfsops): add vfs_checkexp
- conditionally
-
- * configure.in: check for vfsops.vfs_checkexp
-
- * rx/rx_pkt.c (rxi_ReadPacket): ignore errors from recvmsg
- silently.
- (osi_NetSend): sendmsg can return ECONNREFUSED on linux. ignore it.
-
- * rx/rx_user.c (rxi_GetUDPSocket): set SO_BSDCOMPAT. clean-up
-
- * include/Makefile.in (install): install stds.h
-
-Wed Mar 3 13:10:15 1999 Marcus Sundberg <mackan@stacken.kth.se>
-
- * xfs/linux/getcwd.c: removed redundant fcntl.h so it works on glibc 2.1
-
-Wed Mar 3 00:49:00 1999 Marcus Sundberg <mackan@stacken.kth.se>
-
- * configure.in, xfs/linux/xfs_load.c, xfs/linux/xfs/xfs_locl.h:
- Linux devfs support
-
-Tue Mar 2 08:50:27 1999 Assar Westerlund <assar@sics.se>
-
- * rxdef/*.xg: more RPCs
-
- * rx/Makefile.in (install): install header files
-
- * lwp/Makefile.in (install): install include files from srcdir
-
- * lib/ko/Makefile.in: add vlmisc
-
- * arlad/volcache.c (vldb2vldbN): move to vlmisc.c
- (get_info_loop): less warnings
-
- * appl/arlalib.c: let all the functions take a cell argument
-
- * appl/appl_locl.h: add rx header files
-
- * appl/Makefile.in: vos: re-organize
-
- * lib/ko/vlmisc.c: new file
-
- * lib/acl/Makefile.in (INCLUDES): use include directory in srcdir
- (Makefile): add
- * appl/vos.c: clean-up
-
- * ydr/output.c (print_varray): correct code
- (init_generate): let all the files include the appropriate header
- files
- (print_type): make `string<>' generate `char *'
- (encode_string): allocate memory dynamically with string<>
-
- * arlad/volcache.c (recycle_entry): don't assume that num_ptr and
- name_ptr are parallel
- (add_clone): add a parameter for the suffix_type
- (get_info_common): if there's no read-write volume, add the read-only
- volume with the vanilla name
-
- * arlad/fcache.c (find_first_fs): do not believe volumeId[type] to
- be valid
- (find_volume): more paranoid checks for if the volumes really exist.
-
- * arlad/conn.c (pinger): re-structure the code
-
- * rx/rx_user.c (rxi_getUDPSocket): remove code for looping around
- bind and for checking the port number
-
- * rx/Makefile.in (install): install headers
-
- * lwp/Makefile.in (install): install headers
-
-Sun Feb 28 00:44:51 1999 Assar Westerlund <assar@sics.se>
-
- * ydr/output.c (init_generate): add inclusion of foo.{s,c}s.h in
- foo.{c,s}s.c
- (generate_server_stub): use prefix when writing the prototype.
-
- * configure.in: freebsd34: nuke DIAGNOSTIC test
-
- * xfs/bsd/xfs_vnodeops-bsd.c: call zfreei instead of zfree
-
- * ydr/output.c: always generate includs for atypes.h and rx.h in
- stubs
-
- * ydr/main.c (main): return an error if parse_errors is true.
-
- * ydr/lex.l: recognize `proc'
- (error_message): set a flag when an error has occured.
-
- * ydr/lex.h (error_message): update prototype
-
- * ydr/parse.y: add prefix
-
- * ydr/lex.l: add prefix
-
- * lwp/Makefile.in (install): install lwp.h
-
- * ydr/Makefile.in (install): install ydr
-
- * ydr/output.c (generating): remove roken.h and arlad/fs_errors.h
-
- * rxdef/*.xg: arlad/fs_errors.h -> fs_errors.h
-
- * lwp/Makefile.in (clean): remove test programs.
-
- * include/Makefile.in: install some headers
-
- * ydr/parse.y (param_type): default to IN
- (memberdecl2): handle string without size
-
-Sat Feb 27 20:11:28 1999 Johan Danielsson <joda@blubb.pdc.kth.se>
-
- * xfs/bsd/xfs_dev-common.c (xfs_uprintf_device): don't print junk
-
-Sat Feb 27 12:01:35 1999 Assar Westerlund <assar@sics.se>
-
- * util/eefile.c, util/eefile.h: new files
-
- * ydr: Install patches from Derrick J Brashear
- <shadow@dementia.org> for running several instances simultaneously.
-
-1999-02-26 Love <lha@s3.kth.se>
-
- * xfs/bsd/xfs_vnodeops-common.c: (xfs_rename_common): Don't remove
- "tname". Arlad changes the fid if it exist (linux does this today)
-
- * configure.in: welcome back test for mnt_syncer
-
- * xfs/bsd/xfs_node-bsd.c: (free_all_xfs_nodes): check if we don't
- unmount and then skip mnt_syncer
-
- * xfs/bsd/xfs_node-osf.c: (free_all_xfs_nodes): third dummy
- argument
-
- * xfs/bsd/xfs_dev-common.c (xfs_devclose_common): pass on to
- free_all_xfs_nodes that we dont unmount
-
- * xfs/bsd/xfs_vfsops-common.c (xfs_unmount_common): pass on to
- free_all_xfs_nodes that we unmount
-
-1999-02-25 Love <lha@s3.kth.se>
-
- * arlad/messages.c (xfs_message_rename): flush new dir from DNLC
- cache
-
-1999-02-22 Love <lha@s3.kth.se>
-
- * xfs/bsd/xfs_dev-common.c:(xfs_devclose_common): Removed dead
- mnt_syncer code.
-
- * acconfig.h: HAVE_STRUCT_VOP_FSYNC_ARGS_A_FLAGS
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_fseek):
- HAVE_STRUCT_VOP_FSYNC_ARGS_A_FLAGS
-
- * configure.in: check for vop_fsync_args.a_flags
-
- * Release 0.22
-
- * arlad/fs_errors.h: catch VRESTARTING
-
- * arlad/messages.c: catch VRESTARTING.
-
- * xfs/bsd/bin/startarla.in: test for kld
-
-Sun Feb 21 04:31:22 1999 Magnus Ahltorp <map@stacken.kth.se>
-
- * xfs/linux/xfs_message.c (xfs_message_installnode): Try a
- requested entry first, then try any entry. Delete old alias from
- alias chain before adding it.
-
-Sat Feb 13 02:32:37 1999 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_syscalls-common.c (sys_xfspioctl): use
- `xfs_proc_to_cred'
-
- * util/Makefile.in: add heaptest
- (check): new target
-
- * util/heaptest.c, util/util-tester.c: improve batchability a
- little bit
-
- * util/Makefile.in (libutil_SRCS, libutil_OBJS): removed prio and
- timeprio
-
- * util/prio.[ch], util/timeprio.[ch]: removed
-
- * util/mem.[ch]: removed.
-
- * xfs/linux/getcwd.c: handle both `struct stat' and `struct
- new_stat'
-
- * acconfig.h (HAVE_STRUCT_NEW_STAT): add
-
- * configure.in: remove old BSD kernel functions not being called
- any longer. test for `struct new_stat' for linux
-
- * xfs/linux/getcwd.c: handle the case without getcwd
-
- * xfs/linux/getcwd.c: try to get the current directory by any of
- these ways:
- a. the getcwd syscall
- b. /proc/self/cwd (only on 2.1)
- c. by tracing the directory structure backwards and comparing
- inode numbers
-
- also make sure that buf == NULL works everywhere
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_lock, xfs_unlock): re-organize
- the code so that we handle the case of there not being any flag
- argument (with one argument vop_lock)
-
- * xfs/bsd/xfs/xfs_vnodeops.h (xfs_fsync_common, xfs_close_common):
- update prototypes
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_fsync_common,
- xfs_close_common): add `proc' argument
-
- * xfs/bsd/xfs_vnodeops-osf.c (xfs_fsync, xfs_close): adapt to
- changing *-common functions
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_fsync, xfs_close): adapt to
- changing *-common functions
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_lock, xfs_unlock, xfs_islocked):
- re-introduce counted locking but only when flags & LK_TYPE_MASK,
- otherwise the assymetry comes back to bite us.
-
- * xfs/bsd/Makefile.in (unload): add support for kld
-
- * configure.in (freebsd): generate vnode_if.[ch] and -I. to be
- able to find them
-
-Sat Feb 6 03:22:56 1999 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs/xfs_vnodeops.h (xfs_fsync_common, xfs_close_common):
- update prototypes
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_fsync_common,
- xfs_close_common): add `proc' argument
-
- * xfs/bsd/xfs_vnodeops-osf.c (xfs_fsync, xfs_close): adapt to
- changing *-common functions
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_fsync, xfs_close): adapt to
- changing *-common functions
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_lock, xfs_unlock, xfs_islocked):
- re-introduce counted locking but only when flags & LK_TYPE_MASK,
- otherwise the assymetry comes back to bite us.
-
- * xfs/bsd/Makefile.in (unload): add support for kld
-
- * configure.in (freebsd): generate vnode_if.[ch] and -I. to be
- able to find them
-
- * xfs/bsd/xfs_syscalls-common.c (xfs_debug): move the super-user
- test to the setting of the debug level. I don't quite remember
- why I did this but I can see no harm in letting any user find out
- the current debug level?
-
- * tests/run-tests.in: add --help
-
- * arlad/volcache.c (vldb2vldbN): constize and only copy the safe
- number of servers
-
- * arlad/fcache.c: remove old code
-
- * arlad/inter.c: always set Result.error to make things simpler.
-
-1999-02-05 Love <lha@s3.kth.se>
-
- * arlad/volcache.c (vldb2vldbN): Added bounce checking
- (get_info_loop): dont loop if old serve returns RXGEN_OPCODE
-
-1999-02-05 Love <lha@s3.kth.se>
-
- * arlad/volcache.c (vldb2vldbN): New function
- (get_info_loop): Added fallback-code for old server
-
- * arlad/volcache.c (ConnCacheEntry): Added field flags.old
-
- * arlad/conn.c (new_connection): reset flags.old
-
- * arlad/arla_local.h: Added rxgencon.h
-
- * appl/fs.c (connect_cmd): return 0;
- (newcell_cmd): rewrote and started to use getarg
- (getmaxfprio): return 0
-
- * arlad/messages.c (viocgetwscell): len strlen(cellname)+1 as
- suggested by Chuck Lever <cel@monkey.org>
-
-Mon Feb 1 05:53:52 1999 Assar Westerlund <assar@sics.se>
-
- * lwp/plwp.c: include config.h
- (LWP_CreateProcess): call thr_yield if there's one
- (Create_Process_Part2): fix call to pthread_attr_setstacksize
-
- * acconfig.h: define __EXTENSIONS__ to make solaris' header files
- happy.
-
- * configure.in: check for thr_yield
-
- * lwp/plwp.[ch]: new files with lwp-over-pthreads
-
- * lwp/rw.c: new file with test code
-
- * lwp/preempt.h: more prototypes
-
- * lwp/Makefile.in: support building with lwp-over-pthreads
-
- * include/Makefile.in (lwp.h): link in the correct file for
- LWP/pthreads
-
- * appl/Makefile.in: handle linking with pthreads
-
- * arlad/Makefile.in: handle linking with pthreads
-
- * INSTALL: document --with-pthreads
-
- * configure.in (--with-pthreads): add code from Derrick J Brashear
- <shadow@dementia.org> for using pthreads
-
-Sun Jan 31 20:48:57 1999 Assar Westerlund <assar@sics.se>
-
- * configure.in (irix): always add -DR4000 to cflags, otherwise it
- seems to break.
-
- * xfs/irix/xfs/xfs_syscalls.h: use correct include files
-
- * xfs/irix/xfs/xfs_node.h: port to Irix 6.4
-
- * xfs/irix/xfs/xfs_fs.h: port to Irix 6.4
-
- * xfs/irix/xfs_vnodeops.c: port to Irix 6.4
-
- * xfs/irix/xfs_vfsops.c: port to Irix 6.4
-
- * xfs/irix/xfs_syscalls.c: use `curprocp' instead of `u'. that
- makes it work under 6.4 as well
-
- * xfs/irix/xfs_node.c: port to Irix 6.4
-
- * xfs/irix/xfs_message.c (xfs_message_installdata): VOP_LOOKUP is
- called differently under irix 6.4
-
- * xfs/irix/Makefile.in (LDFLAGS): always add -32
- (MOD): write in current directory and not source directory
-
- * configure.in (irix): correct and portabilize irix6.4-test
-
- * xfs/solaris/xfs_vnodeops.c (xfs_map): always cast len to
- unsigned long in the debug output
-
- * xfs/bsd/xfs_vfsops-osf.c (xfs_root): send both proc and cred to
- xfs_root_common
-
- * configure.in (irix): define IRIX_64 if running on Irix 6.4 or
- above.
-
- * tests/dir-size-mismatch: use find | xargs rm to remove the
- files, it was overflowing the argument size.
-
- * xfs/solaris/xfs/xfs_dev.h (intptr_t): define if there's none
-
- * acconfig.h (HAVE_INTPTR_T): add
-
- * configure.in: bump version to 0.22pre remove duplicate test for
- syslog test for `intptr_t'
-
-Sun Jan 31 17:51:34 1999 Assar Westerlund <assar@sics.se>
-
- * Release 0.21
-
- * configure.in (freebsd34): add -I. to kernel flags to find the
- generated vnode_if.h
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_lock, xfs_unlock, xfs_islocked):
- more debug output
-
-Sat Jan 30 17:42:00 1999 Assar Westerlund <assar@sics.se>
-
- * tests/copy-and-diff-gnu-mirror: use correct fd. From Simon
- Josefsson <jas@pdc.kth.se>
-
-1999-01-28 Love <lha@s3.kth.se>
-
- * arlad/arla.c(arla_cp): Added copy command.
-
-1999-01-24 Love <lha@s3.kth.se>
-
- * conf/Makefile.in(install): Install a empty SuidCells if there is no.
-
- * tests/run-tests.in: Print out that the test FAILED while running
-
- * xfs/bsd/Makefile.in: (xfs_vopdefs.h): Make the link even if
- 'mkdir xfs' fails, and test if xfs is a dir
-
- * configure.in (freebsd[34]*) Add support for freebsd4, default to
- kld on freebsd4, add output from test
-
-Tue Jan 19 20:31:50 1999 Assar Westerlund <assar@sics.se>
-
- * configure.in (irix): check for IP and cpu and add them to
- KERNEL_CFLAGS
-
- * xfs/irix/Makefile.in: use KERNEL_CFLAGS for figuring out CPU and
- such
-
-Sat Jan 16 18:55:17 1999 Love <lha@stacken.kth.se>
-
- * configure.in: check if VOP_LOCK takes one argument (NetBSD1.3.x)
-
- * xfs/bsd/xfs_vnodeops-bsd.c: Check if VOP_LOCK takes one argument
-
-Tue Jan 12 01:16:12 1999 Assar Westerlund <assar@sics.se>
-
- * xfs/include/xfs/xfs_message.h (CACHEHANDLESIZE): bump to 80
- (needed on Solaris 7 in 64bit mode)
-
- * lwp/process.S: add even more ifdef's to handle sparc v9
-
- * lwp/make-process.o.sh.in: use CC and AS from environment.
- remove foo.c when we're done.
-
- * lwp/lwp.c (REGSIZE): on a sparc v9 the registers are also 8
- bytes
-
- * lwp/lwp.h (lwp_context): try to use the correct amount for sparc
- v9
-
- * rx/rx_user.c (rxi_Listener): use `rx_maxSocketNumber' when
- selecting to avoid having to send the rather large FD_SETSIZE
-
- * rx/rx_pkt.h (rx_GetLong, rx_PutLong): use `u_int32_t' instead of
- `long'
-
- * tests/build-gdb: change path for gdb.
-
- * tests/build-emacs: change path for emacs. GNU has reorganized
- their ftp server and moved all programs into subdirectories.
-
-Sun Jan 10 07:25:51 1999 Assar Westerlund <assar@sics.se>
-
- * arlad/fprio.c (fprio_readin): don't print a warning if the file
- cannot be opened.
-
- * xfs/linux/xfs_dev.c (xfs_message_rpc): also check for strange
- positive return values.
-
- * xfs/bsd/xfs_wrap-bsd.c (SYSCALL_MODULE): replace index with
- pointer
- (xfs_load): update prototype
-
- * xfs/bsd/xfs_vfsops-bsd.c (vfs_object_create): use the correct
- number of arguments
-
- * INSTALL (--enable-kld): add
-
- * configure.in (freebsd3): change test for kernel object format
- (vfs_object_create): add test for number of arguments
-
- * xfs/bsd/xfs_vfsops-freebsd.c: preliminary support for syscall
- KLD module
-
- * xfs/bsd/xfs/xfs_vfsops.h (xfs_root_common): update prototype
-
- * xfs/bsd/xfs_vfsops-common.c (xfs_root_common): take a `proc' as
- argument. call vget instead of vref.
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_root): call new style
- xfs_root_common update comments
-
- * xfs/bsd/xfs_syscalls-freebsd.c: preliminary support for syscall
- KLD module
-
- * xfs/bsd/xfs_wrap-bsd.c: preliminary support for syscall KLD
- module
-
- * arlad/messages.c (CELLSTATUS_{PRIMARY,SETUID}): use defines
- (vioc_gcpags): implement no-op
-
- * arlad/inter.c (cm_getattr): real_fid is always set.
-
- * appl/fs_lib.c (fs_gcpags): send in a correct (and empty) params
- structure
-
- * appl/fs.c (gc_cmd): correct argc and string in printf
- (all): add XDEBNODE
-
- * configure.in (freebsd): use sysctl to get the name of the kernel
- reorder the include files in the kernel compilation tests, it was
- failing on FreeBSD-current
-
-1999-01-05 Magnus Ahltorp <map@stacken.kth.se>
-
- * xfs/linux/xfs_vfsops.c: Do xfs_d_init() when building too to
- prevent dangling pointers
-
- * xfs/linux/xfs_message.c: Hopefully more correct invalidation of
- dentries
-
-Tue Jan 5 00:07:51 1999 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vfsops-openbsd.c (vfs_register, vfs_unregister):
- define and use
-
- * include/kafs.h: add cell status flags
-
-1999-01-03 Love <lha@s3.kth.se>
-
- * arlad/fcache.c
- (throw_entry,fcache_reobtain_callbacks,fcache_giveup_all_callbacks):
- if the fileserver is `down' don't give up callbacks
-
- * xfs/bsd/xfs_node-bsd.c (xfs_getnewvnode): Set field vnlock to 0
- (new_xfs_node): Use HAVE_LK_INTERLOCK
-
- * xfs/include/xfs/xfs_message.h: XFS_MSG_ADVLOCK confusion
-
- * xfs/bsd/xfs/xfs_node.h: Added locks confusion
-
- * lib/ko/kocell.c: Implement clue-code for
- cell_{is,set}suid{,by_{num,name}} and $SYSCONFDIR/SuidCells
-
- * lib/ko/ko.h (cell_issuid): new function
- (cell_issuid_by_name): new function
- (cell_issuid_by_num): new function
- (cell_setsuid_by_num): new function
- (struct cell_entry): Added field suid_cell
-
- * arlad/messages.c: added rpc messages advlock
- (vioc_get_cellsstatus): implement
- (vioc_get_cells): implement
-
- * appl/fs_local.h: afs_listcells()
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_invalid): dummyify since is
- break free 2.2.x
- (xfs_print): write
- (xfs_advlock): comment out comfusing code
-
- * arlad/fcache.c (update_entry): suid-flags cleaner
-
- * appl/fs.c:suidcells: New command, show all cells with suid cells
- marked. afs_listcells(): Rewritten
-
-
- * appl/fs_lib.c: fs_getcells(): New function fs_getcellstatus():
- New function
-
- * appl/alralib.c(hfs_getcells): New function fs_getcellstatus():
- New function
-
- * xfs/bsd/xfs_vfsops-freebsd.c(xfs_init (<3.0)): reset ptr's
- (vfs_register): set ptr before calling function
-
- * conf/CellServDB(stacken.kth.se): dog.stacken.kth.se ->
- fishburger.stacken.kth.se
-
-1999-01-03 Assar Westerlund <assar@sics.se>
-
- * arlad/reconnect.c: add some more O_BINARY
-
- * arlad/messages.c: add some more O_BINARY
-
- * arlad/fcache.c: add some more O_BINARY
-
- * util/date_rfc822.c (date_time2rfc822): update from rfc822 to
- rfc1123 section 5.2.14
-
- * rx/rx_pkt.h (RX_FIRSTBUFFERSIZE): always define it to 1468
- (RX_CBUFFERSIZE): always define it to 1024
-
- * xfs/bsd/xfs_syscalls-freebsd.c: use `sysent' instead of
- `aout_sysvec'
-
-1999-01-02 Magnus Ahltorp <map@stacken.kth.se>
-
- * Changed getcwd.so to libgetcwd.so.
-
-Thu Dec 31 12:13:10 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_node-bsd.c (xfs_dnlc_enter): actually set nameiop to
- CREATE. (when did this disappear?)
-
-Thu Dec 31 13:04:23 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/volcache.c (volcache_getbyid): use correct hash table
-
- * arlad/volcache.c (recycle_entry): don't clear entire entry
- (volcache_getbyname, volcache_getbyname): restructure
-
- * xfs/linux/xfs_message.c (xfs_message_installnode): nuke benign
- warning
-
-Wed Dec 30 11:56:04 1998 Assar Westerlund <assar@sics.se>
-
- * tests/untar-emacs: esthetically corect on fd 3
-
- * configure.in (freebsd3): always try to guess the kernel object
- format, also print it out to give the user the change to see if
- the guess was wrong. also, warn when building LKMs with a !aout
- kernel (maybe we should just switch to KLDs in that case).
-
- * arlad/volcache.c (recycle_entry): hopefully work around
- refcount-bug
-
-Tue Dec 29 03:01:57 1998 Assar Westerlund <assar@sics.se>
-
- * tests/generic-build: get rid of warning messages from tar
-
- * configure.in (full_name_hash): more politically correct test.
-
- * configure.in: --with-sys: actually use the value.
-
- * arlad/messages.c (vioc_afs_sysname): send 4 bytes length and
- then string
- * appl/fs_lib.c (fs_get_sysname): change to expect 4 bytes before
- sysname string
-
- * arlad/arla.c (krb_get_err_text): fallback version. Should
- probably be somewhere else. kroken?
-
- * configure.in: test for krb_get_err_text
-
- * configure.in: HAVE_BROKEN_FULL_NAME_HASH ->
- HAVE_FULL_NAME_HASH_8BIT
-
- * xfs/linux/xfs/xfs_locl.h: conditionalize on replacing
- full_name_hash
-
- * configure.in: test for broken full_name_hash
-
-1998-12-28 Love <lha@s3.kth.se>
-
- * xfs/bsd/bin/Makefile.in(startarla): Build startarla via
- startarla.new as suggested by Ken Raeburn <raeburn@raeburn.org>
-
- * rx/Makefile.in(INCLUDE): typo, fix by Ken Raeburn
- <raeburn@raeburn.org>
-
- * Snapshot 0.21pre
-
-Mon Dec 28 01:16:36 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vfsops-freebsd.c (xfs_init): kludge that might make
- it work with kld modules
-
- * aclocal.m4: KERNEL_CFLAGS -> test_KERNEL_CFLAGS
-
- * configure.in: support for building kld modules. more tests
-
- * xfs/bsd/Makefile.in: support building a kld module
-
- * xfs/bsd/xfs_vfsops-freebsd.c (xfs_init): try with
- vfs_add_vnodeops
-
- * xfs/bsd/xfs_vfsops-netbsd.c (xfs_init): vfs_opv_init depending
- on NetBSD-version
-
- * configure.in: check for vfs_opv_init include <sys/module.h> in
- some tests
-
- * xfs/bsd/xfs_wrap-bsd.c: update and conditionalize KLD_MODULE
-
- * arlad/messages.c (all_powerful_p): new function. use it.
- (vioc_afs_sysname): fix reading of sysname
-
- * configure.in: new files to test for
- (freebsd3): try to make kld work
-
- * xfs/bsd/xfs_vfsops-netbsd.c: try without having a special vfs
- for xfs dead vnodes
-
- * xfs/bsd/xfs_vfsops-netbsd.c: HAVE_VFS_ATTACH ->
- HAVE_KERNEL_VFS_ATTACH
-
- * xfs/bsd/xfs_vfsops-freebsd.c (xfs_stat_filesys): add
-
- * xfs/bsd/xfs_vfsops-openbsd.c (xfs_stat_filesys): add
-
- * xfs/bsd/xfs_vfsops-netbsd.c (xfs_stat_filesys): add
- (xfs_install_filesys): try xfs first
- (xfs_uninstall_filesys): dito
-
- * xfs/bsd/xfs_wrap-bsd.c (xfs_unload): try unloading filesystem
- first
- (xfs_may_unload): remove
-
- * xfs/bsd/xfs_vfsops-netbsd.c (vfs_attach): check for vfs_init
- being NULL
-
- * include/Makefile.in (HEADERS): add heap.h
-
- * util/heap.c, util/heap.h: new files
-
- * util/Makefile.in: add heap.[ch]
-
- * arlad/fcache.c (add_to_invalidate): go backwards
-
- * util/list.h (listhead, listtail, listprev, listnext, listdata,
- listemptyp, listnextp): made into inline functions
-
- * arlad/inter.c (cm_close): don't overwrite the error code.
-
- * arlad/fcache.c (fcache_update_length): assert against usedbytes
- wrapping around
-
- * arlad/fcache.c (create_file, create_directory): don't touch
- dir_entry->status.Length
-
- * arlad/fcache.c (create_symlink): update usedbytes
-
- * INSTALL: linux: add map's warning message about updating
- getcwd.so
-
- * arlad/reconnect.c (reconnect_putdata): adapt to new semantics of
- copyfd2rx
-
- * arlad/fcache.c (read_data): adapt to new semantics of copyrx2fd
- and copyfd2rx
-
- * arlad/fbuf.c: *_copyfd2rx, *_copyrx2fd: don't close the fd some
- comments
-
- * arlad/fcache.c: assert that all closes are succesful.
-
- * arlad/adir.c: assert that all closes are succesful.
-
-1998-12-24 Robert Burgess <rb@stacken.kth.se>
-
- * Release 0.20
-
-1998-12-23 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/getcwd.c (getcwd): If we fail with ENOSYS, fall back
- on the old getcwd. From <allbery@ece.cmu.edu>
-
- * lib/ko/kocell.c (newcell): no dbnum
- (readcellservdb): init dbnum
-
- * arlad/messages.c (vioc_new_cell): new function
- (vioc_get_cell): fix bugs
-
- * lib/ko/ko.h: sync with kocell.c
-
- * lib/ko/kocell.c: re-organize and write some new functions
-
- * appl/fs.c: newcell: implement
-
- * appl/fs_lib.c (fs_newcell): implement
-
- * xfs/bsd/xfs_vfsops.c: move all xfs initialization code into
- xfs_vfsops-*bsd.c
-
- * configure.in (*bsd): use xfs_vfsops-*bsd.c
-
-1998-12-22 Love <lha@s3.kth.se>
-
- * */*/*: Moved xfs's include files to xfs/
-
-1998-12-21 Assar Westerlund <assar@sics.se>
-
- * arlad/cred.c (print_cred): print uid correctly
-
- * arlad/fcache.c (find_next_fs): made global
- (*): hopefully use try_next_fs properly
-
-Sun Dec 20 17:52:17 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_message.c (xfs_message_installnode): vget and vput
- the parent node to prevent it from being recycled
- (xfs_message_installdata): vget and vput the vnode.
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_symlink_common): vput the
- just created symlink...
-
- * arlad/messages.c (try_again): also translate error codes
- (*): realfid always contains the correct fid
-
- * arlad/fcache.c (try_next_fs): some more error codes
-
- * arlad/fs_errors.h: add some more error codes
-
- * arlad/fs_errors.h (VNOVOL, ARLA_VNOVOL): add
-
- * arlad/fcache.c (findconn): remove
- (try_next_fs): figure out if it's worth trying the next fs from the
- error code. call it.
- (fcache_get): always set realfid
-
-1998-12-19 Magnus Ahltorp <map@stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c: Prevent xfs_lookup from returning
- errno values below -1000 in 2.1 kernels. They would otherwise be
- dereferenced in other parts of the kernel.
-
- * arlad/fcache.c: Check for rw flag when looking for backup volume
-
- * arlad/reconnect.c: Use find_first_fs instead of find_conn
-
-Sat Dec 19 01:34:23 1998 Assar Westerlund <assar@sics.se>
-
- * appl/fs.c: move around some more
- (apropos_cmd): implement
-
- * conf/CellServDB (transarc.com): updated cell entry
-
- * arlad/volcache.c (get_info_loop): call VL_GetEntryByNameN
- instead of VL_GetEntryByName
-
- * arlad/fs_errors.h (conv_to_arla_errno): add unused. this also
- requires <roken.h>
-
- * arlad/fcache.c (fs_server_context): MAXNSERVERS -> NMAXNSERVERS
-
- * arlad/volcache.h (volcacheentry): use nvldbentry
-
-1998-12-16 Magnus Ahltorp <map@stacken.kth.se>
-
- * xfs/linux/bin/startarla.in: start arlad with -z switch
-
-1998-12-15 Assar Westerlund <assar@sics.se>
-
- * Release 0.19
-
- * xfs/solaris/xfs_dev.c (xfs_message_rpc): bzero the xfs_link's.
- why is this necessary?
-
- * xfs/solaris/xfs_node.c (xfs_dnlc_enter): handle the case of no
- NC_NAMLEN
-
- * xfs/solaris/xfs_syscalls.c (xfs_debug): new function
- (xfs_pioctl_call): call xfs_debug
-
- * xfs/irix/xfs_dev.c (xfs_message_wakeup_data): fix call to
- MUTEX_LOCK
-
- * arlad/fcache.c (find_next_fs): simplify
- (free_fs_server_context): simplify
-
- * tests: introduce and use AFSROOT
-
- * arlad/fcache.c (find_first_fs): only sort valid entries.
- estimate rtt:s before sorting.
- * arlad/volcache.c (get_info_loop): only sort valid entries.
- estimate rtt:s before sorting.
- * arlad/conn.c (conn_rtt_cmp): don't handle NULL pointers
-
- * arlad/conn.h (conncacheentry): add rtt
- (RTT_FUZZ): add
-
-1998-12-14 Love <lha@s3.kth.se>
-
- * xfs/unknown/xfs_deb.h: dummy
-
-Sun Dec 13 10:55:10 1998 Assar Westerlund <assar@sics.se>
-
- * Release 0.18
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_lock, xfs_unlock, xfs_islocked):
- add a large comment describing the sad state of affairs and remove
- all commented out code from the functions
-
- * ydr/parse.y: add syntax: error-function <function>
-
- * configure.in (AC_C_INLINE): test for
-
- * arlad/fcache.c (find_first_fs, find_next_fs): update to sort
- filservers by rtt (+ random fuzz)
- (free_fs_server_context): new function
-
- * arlad/volcache.c (get_info_loop): get all db-servers and sort
- them by rtt + random fuzz.
-
- * arlad/conn.c (conn_rtt_cmp): comparison function for rtt of two
- entries. adds a random fuzz to load balance.
-
- * arlad/conn.h (conn_rtt_cmp): function for comparing two entries
- for rtt
-
-Sun Dec 13 10:47:21 1998 Magnus Ahltorp <map@stacken.kth.se>
-
- * appl/fs.c: Added fs rmm.
-
- * arlad/messages.c: Change to new symlink creation
- sematics. VIOC_AFS_DELETE_MT_PT added. VIOC_AFS_STAT_MT_PT code
- rewritten.
-
- * arlad/inter.c: Do followmountpoint in cm_symlink in order to
- install correct information into xfs
-
- * arlad/fcache.c: Don't to fcache_update_length when doing
- directory operations. Put more paranoia into fcache_update_length
-
- * arlad/adir.c: Change to unsigned char in hash function
-
- * xfs/linux/xfs_message.c: Invalidate cache when directory is
- installed.
-
- * tests/*: New tests.
-
-Sat Dec 12 11:52:22 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/Makefile.in (SYS): set from configure
-
- * configure.in (--with-sys): add
-
- * arlad/volcache.c (get_info_loop): try to return better errors.
- also handle the case of an non-existing volume better.
-
- * arlad/fcache.c (followmountpoint): update some comments and move
- some code.
-
- * arlad/fcache.c (followmountpoint): more comments.
-
- * arlad/fcache.c (followmountpoint): restructure and split up.
- also return better errors.
-
- * arlad/messages.c (vioc_arladebug): new function
-
- * arlad/volcache.c (volcache_getby*): return ETIMEDOUT instead of
- ENODEV
-
- * arlad/fcache.c (followmountpoint): don't nuke the error code
-
- * arlad/conn.c (pinger): ping one host per loop. print debug
- information correctly
- (conn_dead): print port number/services correctly.
-
- * appl/fs.c (checkservers_cmd): try to give better error messages
- for non-existing cells
-
- * tests/Makefile.in (SRC_TESTS): add ls-afs
-
- * tests/ls-afs: new test
-
- * appl/arlalib.h (fserr): update prototype
-
- * appl/fs_lib.c (fserr): const-ize, print to stderr
- (fs_checkservers): copy cell name correctly. return correct return
- value
-
- * appl/fs.c (checkservers): fixes
-
- * appl/arlalib.h: add prototype for fs_checkservers
-
- * appl/fs_lib.c (fs_checkservers): random fixups move around
- #ifdef's
-
- * arlad/messages.c (viocckserv): some fixes
-
- * arlad/conn.h (conn_probe): add prototype
-
- * arlad/conn.c (pinger): run `conn_free' instead of just
- decrementing the refcount when done with a connection. if
- somebody else killed it while we're using it, it should get
- recycled.
- (conn_probe): new function
- (host_down): implement CKSERV_DONTPING and some other random stuff
-
- * xfs/linux/xfs_inodeops.c (xfs_write_file): return `i_blocks' in
- units of `I_BLOCKS_UNIT'
-
- * xfs/linux/xfs_node.c (xfs_attr2inode): return `i_blocks' in
- units of `I_BLOCKS_UNIT'
-
- * xfs/linux/xfs_locl.h (I_BLOCKS_UNIT): add
-
- * configure.in (VERSION): bump
-
-1998-12-08 Love <lha@s3.kth.se>
-
- * tests/run-tests.in: new file, do it in shellscript instead
- of the makefile.
-
- * lib/roken/getarg.[ch]: Made arg_printusage() understand style.
-
- * */{,*/}*.c: Made world aware of that arg_printusage() took
- a style argument.
-
- * fs/fs_lib.c: stub for VIOCCKSERV
-
- * fs/fs.c: checkservers
-
- * arlad/conn.[ch]: conn_downhosts
-
- * arlad/messages.c: Non working viocckserv()
-
- * include/kafs.h: Flags for VIOCCKSERV
-
-Tue Dec 8 00:49:26 1998 Robert Burgess <rb@stacken.kth.se>
-
- * Release 0.17.1
-
-Tue Dec 8 00:47:49 1998 Magnus Ahltorp <map@stacken.kth.se>
-
- * xfs/*: Fix memory leak.
-
-1998-12-06 Love <lha@s3.kth.se>
-
- * tests/find-and-cat-netbsd: cat netbsd 1.3.2
-
-Sun Dec 6 20:00:25 1998 Assar Westerlund <assar@sics.se>
-
- * Release 0.17
-
- * appl/amon.c (main): no options to XtAppInitialize
-
- * configure.in (VERSION): bump
-
- * INSTALL: add --without-x
-
- * appl/Makefile.in (AMON_LIBS): add more libraries
-
- * appl/fs_lib.c (debug): new helper function
- (arla_debug): new function
-
- * appl/fs_local.h (arla_debug): add prototype
-
- * appl/fs.c (arladebug_cmd): new function
- (xfsdebug_cmd): fix parsing and unparsing of flags
-
- * appl/Makefile.in (fs): add arladeb.c
-
- * xfs/bsd/xfs_deb.c (xfsdeb): no XDEBANY
-
- * xfs/linux/xfs_syscalls.h: remove xfs_syscall debug stuff
-
- * xfs/linux/xfs_syscalls.c (handle_xfs_syscall): remove
-
- * xfs/include/xfs_debug.h (XDEBANY): remove
-
- * include/kafs.h (VIOC_ARLADEBUG): add
-
- * configure.in (VERSION): bump
-
-1998-12-06 Love <lha@s3.kth.se>
-
- * arlad/messages.c (viocaviator): New funtion
- (xfs_message_pioctl): Add VIOC_AVIATOR case
-
- * appl/fs_lib.c (fs_getaviatorstats)new function
-
- * appl/arlalib.h (fs_getaviatorstats)new function
-
- * arlad/kernel.[ch]: added kernel_usedworkers() and
- kernel_highworkers()
-
- * include/kafs.h: added VIOC_AVIATOR
-
- * appl/amon.c: Break out stripChart and add workers
-
- * configure.in: Check for X.
-
- * appl/amon.c: New, monitor number of vnodes and kbytes used i cache.
-
-Sun Dec 6 00:02:42 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/arladeb.h (arla_deb_units): export new prototypes
- * arlad/arladeb.c (arla_deb_units): define in order. define all
- and almost-all properly
- (arla_log_set_level_num, arla_log_get_level_num): new functions
-
- * xfs/linux/setdebug.c: removed
-
- * xfs/linux/Makefile.in: removed setdebug
-
- * arlad/discon_log.c (log_head): initialize to zero by default
-
- * arlad/reconnect.c: static-ize some
-
- * arlad/darla.h: add prototypes
-
- * arlad/arla_local.h: include reconnect.h
-
- * arlad/reconnect.h: new file
-
- * appl/vos.c (main): initports -> ports_init
-
- * appl/pts.c (main): initports -> ports_init
-
- * lib/ko/ports.c (ports_num2name): new function
- (initports): renamed to ports_init. changed all callers
-
- * arlad/volcache.c (vl_probe): new function
-
- * arlad/messages.c (try_again): print a warning and sleep while
- waiting for a busy volume
- (viocgetacl, viocsetacl, viocgetvolstat, viocsetvolstat): call
- try_again
-
- * arlad/fcache.c (fs_probe): new function
- (invalidator): new debug messages
-
- * arlad/cred.c (cred_expire): print a message telling the user
- that credentials have expired
-
- * arlad/conn.h (ConnCacheEntry): add `probe', `probe_le',
- `probe_next', `ntries'
- (conn_get): new parameter `probe'
-
- * arlad/conn.c: probe servers that were marked as down.
- (re_probe, add_to_probe_list, pinger): new functions
- (conn_init): start a pinger thread
- (new_connection, add_connection, internal_get, conn_get): new
- parameter `probe' (a function that probes the service)
- (conn_dead): print message when loosing connection to a server
- (conn_alive): print message when a server comes up again
-
- * arlad/arla_local.h: add <pwd.h>
-
- * arlad/arla.c (main): init rx before conn. initports ->
- ports_init
-
- * xfs/irix/Makefile.in (CFLAGS): update with more magic flags
-
- * util/list.c (listempty): explicit cast to shut up SGI cc
-
- * tests/copy-and-diff-gnu-mirror: use find and cmp instead of diff
- -r
-
- * arlad/discon_log.c (write_log_ent): add type to `index'
-
- * xfs/linux/xfs_message.c (xfs_message_installnode): use
- xfs_full_name_hash instead of full_name_hash
-
- * xfs/linux/xfs_inodeops.c (xfs_readdir): use xfs_full_name_hash
- instead of full_name_hash
-
- * xfs/linux/xfs_locl.h (xfs_full_name_hash): work-around for
- broken full_name_in_hash in 2.1.131
-
- * xfs/linux/xfs_vfsops.c (xfs_delete_inode): correct type in debug
- output
-
-Sat Dec 5 00:35:05 1998 Assar Westerlund <assar@sics.se>
-
- * tests/Makefile.in (SRC_TESTS): add build-gdb
-
- * tests/build-emacs: use generic-build
-
- * tests/build-gdb: new test
-
- * tests/generic-build: new file
-
- * tests/strange-characters: new test
-
- * tests/read-vs-mmap.c, read-vs-mmap2.c, mmap-and-read.c: include
- <time.h>
-
- * tests/Makefile.in: add copy-and-diff-gnu-mirror
- (check): generate more unique directory names so that several tests
- can be run in the same directory at the same time
-
- * tests/copy-and-diff-gnu-mirror: new test
-
- * arlad/kernel.c (worker): move `data' up front to make sure it's
- more suitably aligned. how should this really be done?
-
- * lwp/make-process.o.sh.in (irix): needs -n32 to as.
-
- * arlad/discon_log.h: clean-up
-
- * arlad/discon.h: clean-up
-
- * arlad/reconnect.c (reconnect_create): remove C++-comment
-
- * arlad/discon_log.c (update_log_ent): fix strange comment
- look-a-likes
-
- * arlad/messages.c (afsstatus2xfs_attr): use ClientModTime instead
- of ServerModTime
-
- * arlad/adir.c: spell-checking and updating of comments
-
- * arlad/fcache.c (find_next_fs): destroy previous connection.
- change all callers.
-
- * arlad/fcache.c: call conn_dead at all the appropriate places
-
- * arlad/volcache.c (get_info_loop): mark conns as dead
-
- * arlad/conn.c (create_new_connections): init `parent'
- (recycle_conn): remove one reference to `parent'
- (internal_get): new function. handle setting of parent.
- (conn_get): only return live servers
- (conn_dead, conn_alive): new functions
-
- * arlad/conn.h (ConnCacheEntry): `parent' points to a
- security-cred-free instance
- (conn_dead, conn_alive): new functions
-
- * arlad/fcache.c (find_next_fs, find_first_fs): fill the daily
- quota for comments.
-
- * arlad/fcache.c (find_next_fs): remember how far we got
- (getacl, setacl, getvolstat, setvolstat): always call fcache_release
-
-1998-12-05 Love <lha@s3.kth.se>
-
- * arlad/arla.c: New option, --fork-late,-f that daemonify,
- when everything is setup and running.
-
-1998-12-03 Love <lha@s3.kth.se>
-
- * Cleaned up disconnected code (no warnings).
-
-Wed Dec 2 05:04:04 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/messages.c (viocgetcell): update to use `cell_dbservers'
-
- * arlad/fcache.c (find_first_fs, find_next_fs): new functions.
- use them.
- (findconn): dead. reconnect code probably doesn't work
-
- * arlad/volcache.c (get_info_loop): new function to try all db
- servers. use it.
-
- * lib/ko/ko.h (cell_dbservers): new prototype
-
- * lib/ko/kocell.c (cell_dbservers): new function to list all DB
- servers
- (cell_listdbserver, cell_finddbserver): removed
-
- * ydr/output.c (print_array, print_varray): fix printf types
-
-Wed Dec 2 09:26:55 1998 Robert Burgess <rb@stacken.kth.se>
-
- * Release 0.16
-
-Wed Dec 2 00:10:05 1998 Assar Westerlund <assar@sics.se>
-
- * tests/large-dir.c, tests/large-dir-16384: new files
-
- * tests/Makefile.in (TEST_PROGRAMS): add large-dir
-
- * tests/large-dir.c (creat_files): fix types
-
- * tests/mmap-and-read.c (generate_random_file): generate digits in
- the different pages
-
- * configure.in: vm/vm_object.h, vm/vm_pager.h, vm/vnode_pager.h:
- check for
-
- * util/hash.c (_add): add braces to make it do what I mean
-
- * util/hash.h (hashtabaddreplace): new prototype
-
- * util/hash.c (hashtabadd): renamed hashtabaddreplace
- (hashtabadd): don't replace existing entry
-
- * arlad/afs_dir.h (MAXPAGES): update comment
-
- * arlad/afsdir_check.c: handle large directories
-
- * arlad/adir.c (getpage): new function. use it.
- (is_page_empty): new function
- handle large directories
-
- * tests/large-dir.c (creat_files): better close the files
-
- * xfs/bsd/xfs_message.c (xfs_message_installattr,
- xfs_message_installdata): set pager size
-
- * xfs/bsd/xfs_locl.h: include vm/vm.h and vm/vm_extern.h
-
- * configure.in: VERSION: bump to 0.15
- vm/vm.h, vm/vm_extern.h: check for
-
- * arlad/reconnect.c: don't inlcude discon_fix.h
-
- * arlad/discon_fix.h: remove. not used anymore.
-
- * arlad/discon_log.c: don't inlcude discon_fix.h
-
- * arlad/arla_local.h: remove discon_fix.h
-
- * arlad/discon_log.h: replace vattr by xfs_attr and moved two
- definitions here from discon_fix.h
-
-1998-11-23 Love <lha@s3.kth.se>
-
- * Release 0.15
-
-Sun Nov 22 00:35:33 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/inter.c (cm_open): set result to zero if succesful
-
- * arlad/fs_errors.h: new file
-
- * arlad/messages.c (try_again): new function
- (xfs_message_*): rewritten to use a loop and call try_again to handle
- expiring kerberos credentials and busy volumes
-
- * arlad/kernel.c (WORKER_STACKSIZE): increase
-
- * tests/untar-emacs: progress to fd 3
-
- * tests/Makefile.in (check): give the tests a fd to stderr
-
- * tests/Makefile.in: add read-vs-mmap2
-
- * tests/read-vs-mmap2.c: new file
-
- * tests/Makefile.in (SRC_TESTS): add rename2
- (check): write output of failing tests into temporary files. run
- scripts with $(SHELL) -x
-
- * tests/Makefile.in: add mmap-and-read
-
- * arlad/inter.c (cm_mkdir): ReleaseSharedLock -> ReleaseWriteLock
-
- * arlad/fcache.h (fcache_update_length); add prototype
-
- * arlad/fcache.c (fcache_update_length): new function. use it.
-
- * arlad/adir.c: call fcache_update_length at appropriate places
-
- * configure.in: don't test for <sys/dirent.h> test for
- vfs_object_create and vnode_pager_setsize
-
- * tests/read-vs-mmap.c: new file
-
- * tests/hello-world.in: new file
-
- * tests/Makefile.in: hello-world, read-vs-mmap: add
-
- * arlad/fbuf.c (fbuf_buf): new function
-
- * arlad/fbuf.h (fbuf_buf): add prototype
-
- * arlad/fbuf.h: (fbuf_len): add prototype
-
- * arlad/fbuf.c (fbuf_len): add
-
- * tests/untar-emacs: add . in loop
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_getpages): report the error
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhlookup): call vfs_object_create
- if there's one.
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_write_comon): call
- `vnode_pager_setsize' if there's one
-
-1998-11-18 Love <lha@s3.kth.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c(xfs_{get,put}pages): use
- vnode_pager_generic_{put,get}pages if they exist.
-
-Tue Nov 17 04:10:59 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/bin/startarla.in: create /afs
-
- * arlad/bsd-subr.c (write_dirent): use _GENERIC_DIRSIZ
-
- * arlad/arla_local.h: only include <sys/dir.h> if there's no
- <dirent.h>
-
-1998-11-15 Love <lha@s3.kth.se>
-
- * arlad/inter.c(cm_rename): Check in new_name already exist, and
- delete it in that case, this should not happen. Suggested by
- Chuck Lever <chuckl@netscape.com>. Relly a problem between
- implementations of rename i bsd and linux xfs.
-
-1998-11-14 Love <lha@s3.kth.se>
-
- * arlad/inter.c(cm_rename): use adir_lookup_fcacheentry()
-
- * arlad/adir.[ch]: New function adir_lookup_fcacheentry()
-
-Fri Nov 13 05:31:27 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/volcache.c (get_info_common): check for dfs fileset
-
- * rxdef/vldb.xg (VLF_DFSFILE_SET): added
-
-Tue Nov 10 05:08:27 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (fcache_get): handle the case of the entry
- appearing while we were out looking for a free entry to put it in.
-
- * arlad/adir.c (adir_lookup): centry shouldn't be static
-
-1998-11-08 Love <lha@s3.kth.se>
-
- * ydr/output.c: dont ydr the OUT arguments in server stub if
- function fails, ie returns != 0.
-
-Sat Nov 7 17:22:58 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/arla.c: new argument --workers
-
- * arlad/kernel.c (kernel_interface): dynamic number of worker
- threads
-
- * arlad/{discon_fix.h,darla.h,discon_log.c,discon.h,discon_log.h,darla.c,reconnect.c}: new files (from wwshen)
-
- * include/kafs.h (CONNMODE_PARCONNECTED): new
-
- * arlad/messages.c (xfs_message_create): preliminary disconn
- support
- (viocconnectmode): create and replay log on transitions between
- DISCONNECTED and CONNECTED
-
- * arlad/fcache.h: some new prototypes
-
- * arlad/cmcb.c (cmcb_init): not being able to create security
- objects is a fatal error
-
- * arlad/fcache.c (throw_entry): signal threads waiting on fee
- nodes
- (unlink_lru_entry): if there are no nodes, sleep until they appear.
- don't reuse nodes being used.
- (findconn): made global. handle disconnected mode
- (find_entry): remove bogus assert
- (fcache_unused): new function
- (fcache_giveup_all_callbacks): new function
- (fcache_reobtain_callbacks): new function
- (do_read_attr): more asserts
- (read_data): more asserts
- (write_data): try to handle disconnected mode
- (truncate_file): try to handle disconnected mode
- (create_file): dito
- (fcache_get): can't set volume if disconnected
-
- * arlad/adir.c (adir_lookup): remove static variables. add more
- asserts
- (adir_readdir): handle the case of broken pgcount in athena.mit.edu
-
- * arlad/kernel.c: create NUM_WORKERS worker threads to handle
- messages from xfs
-
- * arlad/volcache.c (get_info): handle the case of getting back a
- different name (seems to happen with DFS-servers). move out some
- common code.
-
-1998-11-07 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_dead_lookup): add
-
- * arlad/volcache.c: separate out the _byid and _byname functions.
-
-1998-11-07 Love <lha@s3.kth.se>
-
- * appl/fs.c: Patches from Andrzej Filinski <andrzej@daimi.aau.dk>
-
-1998-11-04 Love <lha@s3.kth.se>
-
- * arlad/fbuf.c (malloc_create): Do lseek(fd, 0, SEEK_SET) before
- reading in the file.
-
- * doc/oddities.texi: Added.
-
-1998-11-02 Love <lha@s3.kth.se>
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhopen): Fix for FreeBSD3.0
-
- * util/list.[ch] (listnextp): New function.
-
- * ydr/main.c: Call generate_tcpdump_patches().
-
- * ydr/parse.y: Call generate_printfunction{,_prototype} and
- generate_tcpdump_stub
-
- * ydr/output.h: Random prototypes for below functions.
-
- * ydr/output.c: Introduces concept of printing ydr structures,
- added random comment (in generated and !generated code).
- (td_file): where tcpdump patches ends up.
- (encode_*): Changed sematics for *_MEM, now do goto fail; instead
- of return
- (print_*): Implemented random functions and stubs for the rest.
- (display_type): entrypoint for printing functions
-
-Mon Nov 2 05:11:25 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (throw_data): check that the length of the cache
- file agress with the status
-
- * arlad/arladeb.c (arla_deb_units): add `almost-all'
-
- * xfs/bsd/xfs_vnodeops-osf.c (xfs_create): don't print va_rawmode,
- there's no such field in 4.0
-
- * xfs/bsd/xfs_vfsops-osf.c (xfs_root): moved the code to
- xfs_root_common
-
- * xfs/bsd/xfs_vfsops.h (xfs_root_common, make_dead_vnode): add
-
- * xfs/bsd/xfs_vfsops-common.c (xfs_root_common): new function
-
- * xfs/bsd/xfs_vfsops-bsd.c (make_dead_vnode): set v_data in newly
- created node
- (xfs_root): moved the code to xfs_root_common
- (xfs_install_filesys): use vfs_register if available
-
- * arlad/fcache.c (write_data): make sure `usedbytes' and
- entry->status.Length is updated correctly even if we fail to write
- the data to the server
-
- * aclocal.m4 (AC_C___ATTRIBUTE__): update to discover that the
- support for __attribute__ in gcc 2.6.3 is not enough for us
-
-Mon Nov 2 05:53:25 1998 Robert Burgess <rb@stacken.kth.se>
-
- * Release 0.14.1
-
-1998-11-02 Love <lha@s3.kth.se>
-
- * README: Note about ultrix.
-
- * lib/acl/acl.h: Added stds.h, patch from Max
- <davros@cyclone.Stanford.EDU>
-
-Mon Nov 2 02:38:52 1998 Robert Burgess <rb@stacken.kth.se>
-
- * Release 0.14
-
-1998-11-02 Love <lha@s3.kth.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_{get,put}pages): Disable since
- it doesn't work.
-
-1998-10-31 Love <lha@s3.kth.se>
-
- * configure.in (FreeBSD3.0): Ugly hack to check if we have
- DIAGNOSTIC in kernel.
-
- * xfs/bsd/xfs_vnodeops-common.c: FreeBSD3.0
- (xfs_rename-common): Removed common
-
-
-Sat Oct 31 15:00:55 1998 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * xfs/bsd/xfs_syscalls-common.c: make xfs_is_pag static
-
- * xfs/bsd/xfs_node-osf.c (vattr2xfs_attr): va_mode is u_short, not
- mode_t
-
-Sat Oct 31 03:42:23 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_d_delete): make sure we have an
- xfs_node to delete
-
- * xfs/solaris/bin/Makefile.in (check): add
-
- * arlad/inter.c (cm_rename): swap order of adir_creat and
- adir_remove
-
-Wed Oct 28 04:00:05 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_syscalls-freebsd.c (xfs_syscall): fix typo
-
- * configure.in: vfsops: test for vfs_uninit and vfs_oidp struct
- proc.p_retval: improve test vfs_register: test for
-
-Sun Oct 25 20:36:37 1998 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * arlad/arla.c: implement simple `wc' command
-
- * rx/rx_clock.c: STARTVALUE for UXP/V
-
- * lwp/make-process.o.sh.in: UXP/V
-
- * lwp/lwp.c: set regsize to 8 for UXP/V
-
- * lwp/process-vpp.s: LWP context switch for Fujitsu UXP/V
-
-1998-10-25 Assar Westerlund <assar@sics.se>
-
- * configure.in (freebsd3): set VFS_LKM
-
-Sun Oct 25 09:48:25 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * arlad: Added viocgetcacheparms
-
- * xfs/linux: Use filehandles in installdata. SMP fixes.
-
-Sat Oct 24 02:11:00 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux: Added filehandle support
-
-1998-10-24 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_message.c (xfs_message_installdata): revert second
- part of last change.
-
- * xfs/bsd/xfs_message.c (xfs_message_installdata): fall back to
- looking up cached by names if fhlookup fails. do not reinstall
- the same node.
-
- * xfs/bsd/xfs_vfsops-common.c (xfs_unmount_common): conditionalize
- on HAVE_KERNEL_DOFORCE
-
- * xfs/bsd/Makefile.in (DEFS): remove DIAGNOSTICS. defining this
- when it's defined in the kernel build would be a good idea but we
- currently have no way of knowing when that's the case.
-
- * arlad/adir.c (adir_lookup, adir_changefid): fcache_release
- properly
-
- * configure.in (doforce): check for
-
- * aclocal.m4 (AC_CHECK_KERNEL_VAR): new macro
-
- * xfs/bsd/bin/mount_xfs.c: handle two argument getvfsbyname
-
- * configure.in: getvfsbyname: check for two argument version
-
-1998-10-23 Love <lha@natt.e.kth.se>
-
- * rxkad/rxkad_locl.h: #ifndef assert
-
- * appl/pts.c: Implemented: createuser, creategroup, delete, remove,
- rename, chown, setfields
- (pr_name2id): Bugfixed
- (prdebug): Added debugging variable, and added some output code.
- (main): Added cvs style debugging switch.
-
- * lib/ko/koerror.c: Added prerrors.
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_readdir): Cookies are off_t in NetBSD
-
-1998-10-21 Love <lha@s3.kth.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_readdir): No need to save cookies
- for netbsd.
-
- * ydr/output.c (encode_string): Check length of size-less TSTRING
- when decoding.
-
-Wed Oct 21 22:41:29 1998 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * xfs/bsd/xfs_node-bsd.c (xfs_cnp_init): init cn_proc
-
-Mon Oct 19 01:47:22 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_syscalls-common.c (fhget_call, remote_pioctl):
- re-order code so that we always vrele vp
-
- * arlad/adir.c (adir_lookup): don't release the centry if
- fcache_get fails
-
- * arlad/messages.c (viocvenuslog): only print rx stats if RX_DEBUG
-
- * xfs/bsd/xfs_msg_locl.h: new prototype
-
- * xfs/bsd/xfs_message.c (xfs_message_updatefid): new function
-
- * xfs/include/xfs_message.h (XFS_MESSAGE_UPDATEFID): new message
-
- * xfs/bsd/xfs_dev-common.c (xfs_message_receive): handle
- XFS_MSG_UPDATEFID
-
- * arlad/messages.c (update_kernelfid): new function
- (xfs_message_pioctl): moved most of the operations into functions of
- their own
-
- * arlad/adir.h: new prototypes
-
- * arlad/adir.c (find_entry): new function
- (find_by_name): use find_entry
- (update_fid_by_name): new function
- (adir_changefid): new function
- (adir_emptyp): new function
-
-1998-10-19 Assar Westerlund <assar@sics.se>
-
- * lwp/make-process.o.sh.in (irix): needs -n32 add -I../include to
- find config.h
-
- * lwp/process.S (hopefully) improve some of the conditional stuff.
-
-Sun Oct 18 11:00:58 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_mkdir): conditionalize vput
-
- * xfs/irix/xfs_vnodeops.c (xfs_write): merge solaris fix for
- updating mtime and size
- (xfs_creat): merge solaris fix for truncating file
- (xfs_map): try to implement
-
-Sun Oct 18 00:03:12 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_symlink): fix call to
- xfs_symlink_common
-
- * arlad/cred.h (cred_add_krb4): updated prototype
-
- * arlad/cred.c (cred_add_krb4): add `uid'
-
-Sun Oct 18 00:02:36 1998 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * xfs/bsd/xfs_node-osf.c (vattr2xfs_attr): cast VNOVAL to correct
- type
- (xfs_cnp_init): fix hash calculation
-
- * xfs/bsd/xfs_vnodeops-*.c: don't pass cnp to various common
- vnode-ops
-
-Sat Oct 17 12:37:54 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_lookup_common,
- xfs_create_common): disable my create optimization
-
- * xfs/bsd/xfs_node-bsd.c (new_xfs_node): fix interlock stuff
-
- * arlad/adir.c (adir_lookup): disable cache
-
- * xfs/bsd/xfs_message.c (xfs_message_installdata): only purge
- cache if XFS_INVALID_DNLC is set
-
- * arlad/messages.c: set installdata.flag
-
- * xfs/include/xfs_message.h (installdata): add a flag
-
-Sat Oct 17 11:47:48 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/messages.c (token_for_cell): return uid
- (xfs_message_pioctl VIOCSETTOK): remember uid
-
- * arlad/cred.c (cred_add): add `uid'
-
- * arlad/cred.h (CredCacheEntry): add uid
-
- * xfs/irix/xfs_vnodeops.c (xfs_readdir): look at the abi and
- convert to irix5_dirent if needed
-
- * xfs/bsd/xfs_vnodeops-common.c: remove bsd-specific code
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_lookup, xfs_remove, xfs_rmdir,
- xfs_link, xfs_symlink): move the freeing of the namei buffer here
- from common
-
- * xfs/bsd/xfs_vfsops-osf.c (make_dead_vnode): fix prototype
-
- * xfs/bsd/xfs_syscalls-common.c: include <sys/ioccom.h> or
- <sys/ioctl.h>
-
- * xfs/bsd/xfs_node-osf.c (xfs_dnlc_enter): do the negative cache
- check
-
- * xfs/bsd/xfs_vnodeops-common.c: VOP_UNLOCK -> xfs_vfs_unlock
-
- * xfs/bsd/xfs_node-bsd.c (xfs_dnlc_enter): make sure there's no
- entry already in the DNLC
-
- * xfs/bsd/xfs_message.c (xfs_message_installnode): removed cache
- checking code
-
- * arlad/fcache.c (read_data): if copyrx2fd fails, bail out
-
-Fri Oct 16 16:46:57 1998 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * xfs/bsd/xfs_locl.h: #define cn_nameiop ni_nameiop
-
-1998-10-16 Love <lha@s3.kth.se>
-
- * appl/fs*.[ch]: Added code to gc pags (compat).
-
- * include/kafs.h: Added VIOC_GCPAGS
-
-1998-10-15 Love <lha@s3.kth.se>
-
- * INSTALL,configure.in: --enable-knfs
-
- * xfs/bsd/xfs_vnodeops.c(xfs_readdir): Added cookie creation code.
-
-Wed Oct 14 05:41:34 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vnodeops.h: update prototypes
-
- * xfs/bsd/xfs_vnodeops-osf.c (xfs_mkdir, xfs_readdir): adapt to
- new versions of -common functions
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_lookup_common): do not enter
- negative entries if creating
- (xfs_mkdir_common): remove the OS-specific code
- (xfs_readdir): set `eofflag'
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_create): make sure to call
- VOP_LOOKUP with cn_nameiop == LOOKUP
- (xfs_mkdir): do the post mkdir lookup
- (xfs_readdir): set eofflag
-
- * xfs/bsd/xfs_vfsops-bsd.c: replace printf with XFSDEB
-
- * xfs/bsd/xfs_syscalls-common.c (fhget_call): check suser
-
- * xfs/bsd/xfs_node-bsd.c (xfs_dnlc_enter_name): init more fields
- in `cn'
-
- * xfs/bsd/xfs_message.c (xfs_message_installnode): make sure we
- get rid of any negative entries before adding the new entry. Is
- this really needed?
- (xfs_message_installdata): remove old stuff
-
- * xfs/bsd/xfs_locl.h (xfs_proc_to_cred): new macro
-
- * xfs/bsd/Makefile.in (unload): fix for non-OSF1
-
- * xfs/bsd/bin/mount_locl.h (__progname): remove
-
- * xfs/bsd/xfs_vfsops.h (xfs_fhlookup): update prototype
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhlookup): take `gen' and check it
-
- * lib/ko/gensysname.c (sysnames): remove all bsd entries
-
- * TODO: I think we do this (at least on some OSes)
-
- * xfs/bsd/xfs_dev-common.c (xfs_message_rpc): sigmask seems to be
- defined on more systems than __sigmask. are there any with only
- __sigmask?
-
- * xfs/bsd/xfs_common.h: s/define/endif/
-
-Thu Oct 15 05:29:19 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/Makefile.in: use KERNEL_LD
-
- * xfs/bsd/xfs_locl.h: <vm/vm_zone.h>
-
- * configure.in (KERNEL_LD): set
- <vm/vm_zone.h>: check for
-
- * xfs/bsd/xfs_vnodeops-bsd.c: free pathnames with zfree if there's
- a zfreei.
-
- * aclocal.m4 (AC_KERNEL): allow ac_kernel_ld to be already set
- (AC_HAVE_KERNEL_FUNC): use KERNEL_CLAGS. should probably call
- AC_TRY_COMPILE_KERNEL directly
-
- * xfs/bsd/xfs_vnodeops-common.c: free pathnames with zfree if
- there's a zfreei.
-
- * configure.in (freebsd3): add
- (vfc_mountroot in struct vfsconf): check for
- (zfreei, vfs_cache_lookup): check for
-
- * xfs/irix/xfs_vfsops.c (xfs_root): don't VN_HOLD
- (make_dead_vnode): use vn_alloc
-
- * xfs/bsd/xfs_vfsops-bsd.c: move around and reorganize the code
-
- * xfs/bsd/xfs_wrap-bsd.c: handle different versions of MOD_DEV
-
- * xfs/bsd/xfs_syscalls.h: re-organize SCARG & syscallarg
-
- * configure.in: add -I. before testing for VOP_LOCK & c:o
-
- * configure.in (freebsd): use /bin/sh and not $SHELL
-
- * acconfig.h (HAVE_STRUCT_PROC_P_RETVAL): add
-
- * configure.in (freebsd): generate vnode_if.[ch]
- (struct proc): look for `p_retval'
-
- * xfs/bsd/xfs_wrap-bsd.c: replace printf by XFSDEB
- (xfs_mod): handle MOD_DISPATCH
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_cachedlookup): new function
- (xfs_eopnotsupp): always return EOPNOTSUPP. use instead of
- vn_default_error
-
- * xfs/bsd/xfs_syscalls.h (xfs_setpag_call, xfs_pioctl_call): add
-
- * xfs/bsd/xfs_syscalls-freebsd.c (xfs_syscall): move here. handle
- 3.0 returning values
- (xfs_install_syscalls): try AFS_SYSCALL first, then first free lkm
- slot
-
- * xfs/bsd/xfs_syscalls-common.c (xfs_syscall): remove
-
- * xfs/bsd/xfs_syscalls-osf.c (xfs_syscall): move here
- (xfs_install_syscalls): try AFS_SYSCALL first, then AFS_SYSCALL2, and
- then first free lkm slot
-
- * xfs/bsd/xfs_syscalls-bsd.c (xfs_syscall): move here
- (xfs_install_syscalls): try AFS_SYSCALL first, then first free lkm
- slot
-
- * xfs/bsd/xfs_locl.h: <sys/filedesc.h>: move <sys/fctnl.h>:
- include
-
- * xfs/bsd/xfs_dev-bsd.c (xfs_dev): modern FreeBSD has poll instead
- of select
-
-Sun Oct 11 16:15:04 1998 Johan Danielsson <joda@stp.pdc.kth.se>
-
- * xfs/bsd/xfs_vnodeops-{osf,bsd}.c (xfs_create): move some code from
- xfs_create_common here
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_create_common): remove
- architecture dependent code (specifically the call to VOP_LOOKUP)
-
- * xfs/bsd/xfs_dev-common.c (xfs_message_rpc): use __sigaddset if
- defined
-
-Sat Oct 10 21:05:13 1998 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * lib/ko/gensysname.c: add generic bsd handler
-
- * configure.in, lib/ko/ko_locl.h: sys/utsname.h
-
-1998-10-09 Love <lha@s3.kth.se>
-
- * ydr/output.c: (sizeof_type) TOPAQUE has a size (1).
-
-Thu Oct 8 14:39:48 1998 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * xfs/bsd/xfs_node-osf.c (new_xfs_node): move call to insmntque to
- after initializing the vnode
- (so it will automagically create a VM object)
-
- * xfs/bsd/xfs_vfsops.h: xfs_fhlookup takes generation number iff
- OSF/1
-
- * xfs/bsd/xfs_message.c (xfs_message_installdata): pass generation
- number to xfs_fhlookup iff OSF/1
-
- * xfs/bsd/xfs_vfsops-osf.c: implement xfs_fhlookup, and xfs_fhopen
-
- * xfs/bsd/xfs_vfsops-common.c (xfs_mount_common): init OSF/1
- f_fsid
-
- * xfs/bsd/xfs_dev-osf.c (xfs_install_device): try to install
- device with major 64
-
- * xfs/bsd/xfs_syscalls-osf.c: try to install syscall at slot 232
-
- * xfs/bsd/xfs_syscalls-common.c: fixes for OSF/1
-
- * xfs/bsd/xfs_dev-common.c (xfs_devclose_common): cleanup,
- (xfs_message_rpc): use xfs_curproc()
-
- * xfs/bsd/xfs_locl.h: xfs_curproc()
-
- * arlad/bsd-subr.c (conv_dir): check return value from
- fcache_fhget
-
- * xfs/bsd/bin/mount_xfs.c: call set_progname, add `-F' option to
- set mountflags (used by OSF/1 mount)
-
-Wed Oct 7 21:28:14 1998 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * lib/ko/gensysname.c: Add Digital UNIX/Alpha
-
-Wed Oct 7 05:01:53 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_follow_link): handle both two and
- three argument versions
-
- * acconfig.h: HAVE_FOLLOW_LINK_THREE_ARGS: add
-
- * configure.in (linux): try looking in /proc/ksyms before
- /proc/cpuinfo
- (follow_link): test for number of arguments
-
-1998-10-05 Assar Westerlund <assar@sics.se>
-
- * Release 0.13
-
- * NEWS: updated
-
- * configure.in: bump to 0.13
-
- * arlad/irix-subr.c: use the correct size macro
-
- * INSTALL: add --disable-dynamic-afs and --enable-smp
-
- * xfs/irix/Makefile.in (unload): add
-
- * configure.in (linux): fall back on testing on /proc/cpuinfo
- (--enable-smp): add
-
- * configure.in (linux): do the smp test against the include-files
- instead of /proc
-
- * configure.in (linux): test for smp by looking in /proc/ksyms
- instead of /proc/cpuinfo
-
-1998-10-04 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (stale): set sentenced iff already locked.
- changed all callers.
-
- * util/log.c (log_vprint_syslog): fflush
-
- * xfs/irix: much improved. most stuff (except getdents) seems to
- work.
-
-Sun Oct 4 03:44:53 1998 Magnus Ahltorp <map@stacken.kth.se>
-
- * acconfig.h configure.in: Check for read_super arguments.
-
- * xfs/linux/xfs_load.c: Fix read_super argument confusion.
-
-1998-10-03 Love <lha@e.kth.se>
-
- * xfs/bsd/xfs_node-bsd.c(new_xfs_node): Broke out the
- getnewvnode() code.
- (xfs_getnewvnode): new function, creates xnode too.
-
- * xfs/bsd/xfs_vfsops-{bsd.c,common.c}: Added strange knfs code.
-
-Fri Oct 2 06:39:15 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/volcache.c (get_info): remove bogus `we didn't get what we
- asked for'-warning
-
- * xfs/linux/xfs_inodeops.c (xfs_readdir, xfs_follow_link): do
- xfs_free
-
- * xfs/linux/xfs_dev.c (xfs_devread): do free
-
- * xfs/linux/xfs_common.c (xfs_alloc): debugging for xfs_allocs -
- xfs_frees
-
- * xfs/linux/xdeb.h (XDEBMEM): add
-
- * ydr/symbol.c (printsymbol): unused
-
- * lwp/iomgr.c (IOMGR): correct printf format string
-
- * include/bits.c: some unused to get rid of warnings
-
- * arlad/messages.c (xfs_message_rpc): mark as unused to get rid of
- a warning
-
- * acconfig.h (_GNU_SOURCE): define it
-
-Wed Sep 30 06:39:08 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/irix/xfs_dev.c (xfs_install_device): initialize the queues
-
- * xfs/irix/xfs_vfsops.c (xfs_mount): remove cdevsw check
-
-Wed Sep 30 01:10:31 1998 Assar Westerlund <assar@sics.se>
-
- * Release 0.12
-
- * arlad/fcache.c (create_node): new function
- (fcache_get): call create_node if there is no cache node.
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_lock, xfs_unlock, xfs_islocked):
- don't use vop_nolock/vop_nounlock/vop_noislocked
-
-Tue Sep 29 04:07:14 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/volcache.c (recycle_entry): release the filecache entry
-
- * arlad/fcache.c (fcache_get): assert that find_free_entry
- succeeded
-
-Mon Sep 28 00:51:45 1998 Assar Westerlund <assar@sics.se>
-
- * acconfig.h (HAVE_KERNEL_VFS_GETVFS): add
-
-Sun Sep 27 11:55:55 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_may_uninstall_filesys): new
- (xfs_fhlookup): use vfs_getvfs
-
- * configure.in (vfs_getvfs): check for
- (linux): check for __SMP__
-
-Sun Sep 27 11:55:54 1998 Assar Westerlund <assar@sics.se>
-
- * Release 0.11
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_islocked): faking always having
- it locked is better.
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhopen): bump v_writecount if
- opening for wrinting
-
-Sun Sep 27 11:29:46 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/Makefile.in: use KERNEL_CFLAGS
-
- * configure.in (linux): set KERNEL_CFLAGS
- use AC_HAVE_KERNEL_STRUCT_FIELD
-
- * aclocal.m4 (AC_HAVE_KERNEL_STRUCT_FIELD): new macro
-
-Sun Sep 27 07:33:18 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/adir.c (add_to_page): set flag
-
-Sat Sep 26 19:45:37 1998 Robert Burgess <rb@stacken.kth.se>
-
- * Release 0.10
-
-Sat Sep 26 19:28:00 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/adir.c (adir_lookup): correct centry logic
-
- * lwp/Makefile.in (REALCFLAGS): add DEBUG
-
- * arlad/fbuf.c (mmap_copyrx2fd, mmap_copyfd2rx, malloc_copyrx2fd,
- malloc_copyfd2rx): handle len == 0 properly
-
- * arlad/arla.c: use fcache_release
-
- * arlad/adir.c (adir_lookup): verify datap of cached directory
-
- * arlad/fcache.c (find_entry_nolock): new function
- (fcache_stale_entry): if entry is locked, sentence it
- (read_data): always call copyrx2fd
- (write_data): always call copyfd2rx
- (fcache_release): new function. change all callers.
-
- * arlad/fcache.h (FCacheEntry): new flag `sentenced'
- (fcache_release): new function
-
-Wed Sep 23 03:31:48 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/solaris/xfs_common.c (memcpy): define in terms of bcopy
- because gcc generates references to it and solaris doesn't have
- any in the kernel
-
-Sun Sep 20 06:18:09 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/sunos-subr.c (conv_dir): `handle' should be `cache_name'
-
- * arlad/irix-subr.c (conv_dir): `handle' should be `cache_name'
-
- * arlad/hpux-subr.c (conv_dir): `handle' should be `cache_name'
-
- * arlad/linux-subr.c (conv_dir): `handle' should be `cache_name'
-
-Thu Sep 17 00:26:08 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/messages.c: conditionalize all tests of RXKADEXPIRED on
- KERBEROS
-
- * xfs/bsd/xfs_message.c (xfs_message_installdata): use cache
- handle
-
- * xfs/bsd/xfs_syscalls-common.c: use xfs_fh_args
-
- * xfs/bsd/xfs_syscalls.h (xfs_fh_args): define
-
- * xfs/bsd/xfs_vfsops.h (xfs_fhlookup): add prototype
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhlookup): new function
- (xfs_fhopen): use `xfs_fhlookup'
-
-1998-09-15 Love <lha@s3.kth.se>
-
- * xfs/linux/xfs_locl.h: Checked for HAVE_LINUX_MODVERSIONS_H
- and appied patch from Aaron M. Ucko <amu@mit.edu>.
-
- * configure.in: - Added check for <linux/modversions.h>
- - Applied patch from (Dima Ruban) <dima@best.net>
-
-Mon Sep 14 03:14:13 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/solaris/xfs_vnodeops.c (xfs_read, xfs_write): complain if
- not VREG
-
- * xfs/solaris/xfs_message.c (xfs_message_installdata): only purge
- the name cache if this file had data before.
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_lookup_common): removed bogus
- NCHNAMLEN test
-
- * xfs/bsd/xfs_node-bsd.c (xfs_dnlc_enter): check for NCHNAMLEN.
- apparently freebsd-3.0 doesn't have any limit on the length of
- file names in the dnlc.
-
- * conf/arla.conf: bump {high,low}_bytes
-
- * arlad/messages.c (xfs_message_mkdir): do an installdata of the
- new directory
-
- * arlad/inter.c (cm_getattr): should be no need to set the tokens
- here explicitly
-
- * arlad/adir.c: removed lots of magic, clean-up.
- (adir_lookup): add a one-entry cache of directories
- (adir_readdir): return entries in order stored in directory instead of
- hash table order (. and .. are always the two first entries)
-
-1998-09-13 Johan Danielsson <root@chowder.pdc.kth.se>
-
- * configure.in: use AC_ELF_OBJECT_FORMAT, add -D_LKM to CFLAGS
- when checking for vfssw, (NetBSD) try to figure out KERNEL_CFLAGS
- in a more intelligent way, and make sure we have -mno-fp-regs on
- alpha
-
-Sat Sep 12 23:34:14 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/solaris/xfs_vnodeops.c (xfs_setattr): clear tokens before
- rpc
- (xfs_link): arguments in correct order. call lookup correctly
- (xfs_map): verify that the attributes are there. fake handling the
- MAP_SHARED, PROT_WRITE-case
-
- * xfs/solaris/xfs_syscalls.c: solaris' uprintf doesn't understand
- %p
-
- * arlad/messages.c (xfs_message_putattr): install the new
- attributes
-
- * arlad/fcache.c (truncate_file): send (size, 0, size) to
- StartRXAFS_StoreData.
-
-1998-09-12 Love <lha@s3.kth.se>
-
- * ydr/output.c: Added missing adding of total_len for strings.
- Added RCSID to the generated files.
-
-Sat Sep 12 03:01:36 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vfsops.h (xfs_mount_common): new prototype
-
- * xfs/bsd/xfs_vfsops-common.c (xfs_mount_common): const-ize
- user_path
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhopen): more debugging
-
- * xfs/bsd/xfs_syscalls-common.c (fhget_call, fhopen_call): new
- prototypes
-
- * xfs/bsd/xfs_syscalls-freebsd.c (xfs_syscallent): correct number
- of arguments
-
- * xfs/bsd/xfs_syscalls-bsd.c (xfs_syscallent): correct number of
- arguments
-
- * arlad/fcache.c (fcache_fhget): check fhopen_working
-
-Fri Sep 11 04:27:35 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * milko/{ptserver.c,pr.c}: First version of ptserver
-
-Wed Sep 9 22:15:09 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_syscalls.h (SCARG): better definition
-
- * xfs/bsd/xfs_syscalls-common.c: now even compiles
-
- * xfs/bsd/xfs_message.c (xfs_messge_installdata): don't use
- non-existing variable `tmp'
-
- * rx: compilable without RXDEBUG
-
- * arlad/messages.c: remove unused variables
-
- * lib/ko/gensysname.c: add freebsd2.2
-
- * arlad/arla.c (arla_rx_status): conditionalize on RXDEBUG
-
- * arlad/Makefile.in (REALCFLAGS): add RXDEBUG
-
-Tue Sep 8 01:21:25 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/adir.c: new fcache_open_file
-
- * xfs/bsd/xfs_vfsops.h (xfs_fhopen): prototype
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhopen): new function
-
- * xfs/bsd/xfs_syscalls-common.c (fhget_call, fhopen_call): new
- functions
- (pioctl_call): restructure
-
- * xfs/solaris/bin/umount_xfs.c: include <config.h>
- add ID
-
- * xfs/solaris/bin/mount_xfs.c: include <config.h>
- add ID
-
- * xfs/solaris/bin/test-fhopen.c: new file
-
- * xfs/solaris/bin/Makefile.in (test-fhopen): add
-
- * xfs/solaris/xfs_vnodeops.c (xfs_space): implement for cmd ==
- F_FREESP, fl->l_len == 0
-
- * xfs/solaris/xfs_vfsops.c (xfs_fhlookup, xfs_fhopen): new
- functions
-
- * xfs/solaris/xfs_syscalls.h (xfs_fh_args): add
-
- * xfs/solaris/xfs_syscalls.c (fhget_call, fhopen_call): new
- functions
- (pioctl_call): restructure
-
- * xfs/solaris/xfs_message.c (xfs_message_installdata): update to
- new message. use xfs_fhlookup
-
- * xfs/solaris/xfs_deb.h (XDEBLKM, XDEBSYS): define
-
- * xfs/sunos/xfs_message.c (xfs_message_installdata): update to new
- message
-
- * xfs/rhapsody/xfs_message.c (xfs_message_installdata): update to
- new message
-
- * xfs/linux/xfs_message.c (xfs_message_installdata): update to new
- message
-
- * xfs/irix/xfs_message.c (xfs_message_installdata): update to new
- message
-
- * xfs/include/xfs_message.h (CACHEHANDLESIZE): make fsid_t +
- fhandle_t in size
- (xfs_message_installdata): add cache_name
-
- * xfs/bsd/xfs_message.c (xfs_message_installdata): update to new
- message
-
- * xfs/aix/xfs_message.c (xfs_message_installdata): update to new
- message
-
- * include/kafs.h (VIOC_FHGET, VIOCE_FHOPEN): define
-
- * arlad/inter.h (cm_open): update prototype
-
- * arlad/inter.c (cm_open): return cache_name and cache_handle
-
- * arlad/arla.c: update to new fcache_open_file
-
- * arlad/fcache.h (FCacheEntry): 32-ize. replace `inode' with
- index and cache-handle
-
- * arlad/fcache.c (fhopen, fcache_fhget): new functions
- (fcache_create_file): new function. use.
- (fcache_open_file): use fhopen if it's working
- (fcache_open_file): remove mode argument. change all callers.
- (find_entry): handle the case of being called from volcache before the
- fcache is initialized.
- (read_data, write_data): only call copyrx2fd/copyfd2rx if sizefs > 0
-
- * arlad/subr.h (conv_dir): update prototype
-
- * arlad/*-subr.c (conv_dir): return cache_name and handle.
-
- * arlad/Makefile.in (KAFS_LIBS): set
- (LIBS): add KAFS_LIBS
-
-1998-09-06 Love <lha@s3.kth.se>
-
- * output.c: - Added bounce checking for memencoding.
- - Got rid of fail: label error message.
-
- * rx/rx.h: Added sys/param.h to get rid of warning.
-
-Fri Aug 28 22:49:22 1998 Assar Westerlund <assar@sics.se>
-
- * util/strutil.h (strupr, strlwr): remove prototypes
-
- * util/strutil.c (strupr, strlwr): remove (they're already in
- libroken)
-
-Mon Aug 24 02:48:19 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/solaris/xfs_vnodeops.c (xfs_create): truncate the file if
- needed
-
- * xfs/solaris/xfs_vnodeops.c (xfs_create): existing file is no
- error
- (xfs_write): update mtime and size from cache vnode
-
-Tue Aug 11 18:34:33 1998 Johan Danielsson <joda@blubb.pdc.kth.se>
-
- * arlad/arla.c (read_conffile): use parse_units
-
-Tue Aug 4 02:19:06 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_vfsops): conditionalize vfc_name
-
- * configure.in: check for `vfs_name' in `struct vfsops'
-
-Fri Jul 31 00:15:38 1998 Robert Burgess <rb@stacken.kth.se>
-
- * Release 0.9
-
- * xfs/solaris: compiler warning cleanup
-
-Thu Jul 30 23:04:46 1998 Assar Westerlund <assar@sics.se>
-
- * configure.in (netbsd): comments are `dnl' and not `/*' :-)
-
- * configure.in: --with-krb{4,5}: better values for include and lib
- directory
-
- * xfs/linux/xfs_inodeops.c (xfs_write_file): set the f_pos of the
- cached file before calling its write
-
-Wed Jul 29 22:35:31 1998 Assar Westerlund <assar@sics.se>
-
- * TODO: optimistically remove the items that I think have been
- fixed
-
- * arlad/fcache.c (unlink_lru_entry): don't remove entries with
- refcount > 0
- (followmountpoint): set refcount on the root of the new volume, not on
- the mount point in the old one.
-
- * arlad/inter.c (cm_lookup): fix the handling of `..' over mount
- points.
-
- * arlad/volcache.c (recycle_entry): decrement the refcounts of all
- fcacheentries pointing to the root of any of the volumes of `e'
-
- * arlad/volcache.h (volcacheentry): remove `mount_point'
-
- * INSTALL: removed mknod from BSD installation instructions
-
- * xfs/bsd/bin/xfs_makedev: new file
-
- * xfs/bsd/bin/startarla.in: use xfs_makedev
-
- * xfs/bsd/bin/Makefile.in: install xfs_makedev
-
- * xfs/bsd/xfs_wrap-bsd.c: made it into a LKM_DEV.
-
- * xfs/bsd/xfs_dev-bsd.c (xfs_install_device, xfs_uninstall_device,
- xfs_stat_device): removed all code for adding the device to the
- cdevsw.
-
- * xfs/bsd/Makefile.in (load): use -p xfs_makedev
-
- * arlad/adir.c (adir_remove, adir_creat): assert the directory
- having data
-
- * arlad/inter.c (cm_create, cm_mkdir, cm_symlink, cm_link,
- cm_remove, cm_rmdir, cm_rename): make sure we have the data of the
- directory
-
- * arlad/fbuf.c (malloc_truncate): call ftruncate
-
- * xfs/bsd/xfs_vfsops-common.c (xfs_mount_common): handle two
- argument vfs_getnewfsid
-
- * configure.in: test for two argument vfs_getnewfsid
-
-Tue Jul 28 23:36:47 1998 Assar Westerlund <assar@sics.se>
-
- * lwp/process.S: Applied patch for NetBSD/alpha from John Davison
- <davisoja@clarkson.edu>
-
- * ydr/output.c: try to handle error returns from rx_Read and
- rx_Write
-
- * lib/ko/kocell.c: check memory allocation and clean-up
-
- * appl/fs.c (afs_listquota): don't divide by zero
-
- * arlad/fcache.c (followmountpoint): close fd if fbuf_create fails
-
-1998-07-28 Love <lha@e.kth.se>
-
- * xfs/bsd/xfs_vfsops-osf.c(xfs_install_fs): Be paranoid about the size
- of the private data of struct vnode.
-
- * xfs/bsd/xfs_dev-common.c: (xfs_message_rpc):No code for sigwaitmask
-
-1998-07-24 Love <lha@e.kth.se>
-
- * xfs/bsd/xfs_vfsops-osf.c: (xfs_root): Added uid check for osf.
-
- * appl/fs.c: Added VIOCNOP.
-
-Fri Jul 24 19:15:45 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * arlad/messages.c: Added VIOCGETCELL, VIOCWHEREIS, VIOCNOP,
- VIOCUNPAG and VIOC_AFS_STAT_MT_PT.
-
-Fri Jul 24 09:53:19 1998 Assar Westerlund <assar@sics.se>
-
- * configure.in (int32, u_int32): test for
-
- * arlad/messages.c (xfs_message_create): try installing data for
- the new file.
-
- * arlad/arla.c (temp_sysname): const-ize
-
-Fri Jul 24 06:49:32 1998 Magnus Ahltorp <map@stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c: Merged in patch from
- Aaron M. Ucko <amu@mit.edu>.
-
- * xfs/linux: Made things work better on 2.0 and i386.
-
-1998-07-24 Love <lha@e.kth.se>
-
- * appl/fs.c: fixed small bug in fs lsm.
-
-Thu Jul 23 03:55:12 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vfsops-common.c (xfs_mount_common): use
- vfs_getnewfsid is there's one. From Dan Winship <danw@MIT.EDU>
-
- * xfs/bsd/xfs_vfsops-bsd.c: use `struct vnodeopv_desc',
- vfs_attach, and vfs_detach when applicable. From Dan Winship
- <danw@MIT.EDU>
-
- * configure.in: more tests for modern NetBSD. From Dan Winship
- <danw@MIT.EDU>
-
- * arlad/inter.c (expand_sys): new function for expanding @sys
- (cm_lookup): expand @sys anywhere in the name
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_inactive_common): handle the
- case of an already clean vnode.
-
- * xfs/bsd/xfs_node-bsd.c (free_xfs_node): remove bogus comment
-
- * arlad/fcache.c (create_{file,symlink,directory}): update the
- acccache and anonacess
-
- * arlad/volcache.c: rename recover_state -> volcache_recover_state
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_islocked): return 0 as a
- fallback
-
- * xfs/bsd/xfs_vnodeops.h (xfs_vfs_readlock, xfs_vfs_writelock,
- xfs_vfs_unlock): new macros for encapsulating the locking
-
- * xfs/bsd/xfs_vfsops-osf.c (xfs_root): remove ifdef __osf__
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_root): remove ifdef __osf__
-
-Wed Jul 22 05:00:08 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.h (create_symlink): update prototype
-
- * arlad/fcache.c: keep better track of the number of used bytes
- (usedbytes)
-
- * rxdef/fs.xg (Symlink): correct
-
- * arlad/fcache.c (fcache_file_name): cast `inode' to unsigned
-
- * lib/ko/gensysname.c: restructured, cleaned up and added new
- sysnames
-
- * util/strmatch.c: const-ize
-
- * arlad/adir.c: replace magic numbers with expressions based on
- constants from afs_dir.h
-
- * arlad/arla.c (main): set the sysname from arla_getsysname
-
-Tue Jul 21 04:55:00 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/adir.c (adir_remove): eliminate trailing empty pages
-
- * arlad/adir.c (adir_remove): use the actual size of the converted
- directory instead of that from status
-
- * arlad/adir.c (adir_lookup, adir_readdir): use the actual size of
- the converted directory instead of that from status
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_revoke): implement
-
- * configure.in (vop_revoke, genfs_revoke): check for
-
- * configure.in (vop_noislocked, genfs_nolock, genfs_nounlock,
- genfs_noislocked): check for
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_lock, xfs_unlock, xfs_islocked):
- try to use default operations
-
-Mon Jul 20 04:51:11 1998 Assar Westerlund <assar@sics.se>
-
- * configure.in: openbsd2.3: remove
- more kernel tests
-
- * lwp/lwp.h (lwp_context): add linkRegister and conditionRegister
- for powerpc
-
- * xfs/bsd: restructured
-
- * arlad/arla.c (connected_levels): fix misspelling
-
-Mon Jul 20 01:49:28 1998 Robert Burgess <rb@stacken.kth.se>
-
- * Release 0.8
-
-Sun Jul 19 10:41:44 1998 Mattias Amnefelt <mattiasa@stacken.kth.se>
-
- * appl/vos.c: added support for busy volumes
-
-Fri Jul 17 18:21:10 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * configure.in, xfs/linux/Makefile.in, xfs/linux/getcwd.c: Added
- getcwd shared library to make getcwd work better in 2.1.
-
-Fri Jul 17 03:10:48 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (fcache_recover_state): make sure the volume of
- the entry we read back actually exists, otherwise just ignore it.
-
-Thu Jul 16 02:06:28 1998 Assar Westerlund <assar@sics.se>
-
- * configure.in: selinfo.si_pid test removed
-
- * lib/ko/gensysname.c (printsysname): arla_getsysname should
- return a const string
-
- * lib/ko/ko.h (arla_getsysname): const-ize
-
- * arlad/volcache.c (volcache_getbyname, volcache_getbyid):
- restructure tail so that refcount is return whenn e != NULL
-
- * xfs/openbsd2.3/xfs_vnodeops.c (xfs_lookup): set *vpp to NULL at
- the beginning
-
- * xfs/bsd/xfs_vnodeops.c (xfs_lookup_common): set *vpp to NULL at
- the beginning
-
-1998-07-15 Love <lha@s3.kth.se>
-
- * lib/ko/gensysname.c: Added generation of a sysname function.
-
-Tue Jul 14 16:35:31 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/bin/mount_xfs.c: conditionalize on autoconf symbols
- instead of on __FreeBSD__
-
- * configure.in (getvfsbyname,vfsisloadable,vfsload): check for
- them
-
-1998-07-14 Love <lha@s3.kth.se>
-
- * arlad/services.h: Added VOTE_SERVICE and DISK_SERVICE
-
- * appl/udebug.c: Added the udebug program.
-
- * appl/vos.c: Added command syncsite (only work on local cell)
-
- * appl/arlalib.[ch]: arlalib_getsyncsite() does not work,
- I can't see why it shouldn't work thou.
-
- * appl/appl_locl.h: added <err.h> and <ubib*>
-
- * appl/Makefile: Added udebug
-
- * rxdef/ubik.xg: Added
-
- * xfs/bsd/bin/mount_xfs.c: Added patch from Alec Wolman
- <wolman@cs.washington.edu> to add the right argument to mount
- for FreeBSD
-
-Mon Jul 13 20:50:09 1998 Assar Westerlund <assar@sics.se>
-
- * lwp/make-process.o.sh.in (aix): for some odd reason the aix
- assembler is happier if we always say we have a RIOS
-
- * ydr/Makefile.in: compat with stupid makes
-
- * xfs/sunos/Makefile.in: compat with stupid makes
-
- * xfs/linux/Makefile.in: compat with stupid makes
-
- * util/Makefile.in: compat with stupid makes
-
- * rxdef/Makefile.in: compat with stupid makes
-
- * lwp/process.S: rhapsody fixes
-
- * arlad/volcache.c (recycle_entry): only decrement fe->refcount
- if we found the node.
-
- * arlad/kernel.c (process_message): remove `proc_msg: byte = %d'
-
- * arlad/fcache.c (count): rename to inode_count
- (fcache_stale_entry): always call stale
- (fcache_find): check if find_entry succeeded
-
- * arlad/conn.c (conn_get): check securityindex and cred, otherwise
- we could end up not having any connection for (0,0) and loose when
- we get a callback
-
- * arlad/arla.c (newwalk): patches from Alec Wolman
- <wolman@cs.washington.edu>
-
- * arlad/Makefile.in: compat with stupid makes
-
- * lib/Makefile.in: compat with stupid makes
-
- * appl/Makefile.in: compat with stupid makes
-
- * THANKS: Alec Wolman <wolman@cs.washington.edu>
-
- * Makefile.in: compat with stupid makes
-
- * configure.in (KERNEL_INCLUDE): include -I
- (rhapsody): add
- some more field tests
-
- * config.{guess,sub}: rhapsody
-
- * xfs/rhapsody: Rhapsody port from Alexandra Ellwood <lxs@MIT.EDU>
-
-Thu Jul 9 16:14:50 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_write_file): 2.0-fix
-
-Mon Jul 13 06:35:55 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux: Locking corrected and locking debugging added
-
- * xfs/linux: Changed to new lookup method
-
-Sun Jul 12 16:39:05 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * xfs/bsd/*: Merge OSF/1 changes.
-
- * xfs/bsd/xfs_dev.h: make xfs_devopen static, and add prototype
- for xfs_func_is_devopen that does the comparison
-
- * xfs/bsd/xfs_deb.h: unsigned int
-
- * xfs/bsd/xfs_deb.c: unsigned int
-
- * xfs/bsd/xfs_common.c: use xfs_malloc
-
- * configure.in: Add support for OSF/1.
-
- * xfs/bsd/bin/{mount_xfs,umount_xfs}.c: use <mount_locl.h>
-
- * xfs/bsd/bin/mount_locl.h: common include file for mount/umount
-
- * xfs/bsd/bin/mntopts.h: remove __P from the single prototype (to
- avoid having to add a definition for __P) -- all compilers (gcc
- and DEC CC knows prototypes anyway).
-
- * xfs/bsd/bin/Makefile.in: some fixes for OSF/1: conditionally
- build `startarla', and add include and link paths for roken.
-
- * rxkad/rxk_crpt.c: __alpha is LE
-
-Thu Jul 9 22:18:25 MET DST 1998 Mattias Amnefelt <mattiasa@stacken.kth.se>
-
- * appl/Makefile.in: Changed so we use libroken included in
- arla insead of the one which comes with kth-krb.
-
-1998-07-08 Love <lha@e.kth.se>
-
- * xfs/bsd/{xfs_vfsops.c,xfs_wrap.c} Check if we can unload
- before we even try, since on NetBSD you can unload a
- mounted filesystem, that will crash in next sync.
-
-Wed Jul 8 01:44:15 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (creat_nodes): use IOMGR_Select instead of
- LWP_DispatchProcess to give the iomgr thread the chance to run
-
- * xfs/aix/xfs_syscalls.c (xfs_setpag_call): generate the pag
- correctly
-
-1998-07-07 Love <lha@e.kth.se>
-
- * util/{time,}prio.[ch], util-tester.c: Added.
-
-Tue Jul 7 02:41:05 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux/xfs_vfsops.c: Use print_aliases() and
- set xfsp->root to NULL when unmounting
-
- * xfs/linux/xfs_common.[ch]: Added print_aliases()
-
-Mon Jul 6 19:56:34 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_dev.c: obvious xfs_vfs_busy fix
-
-Mon Jul 6 12:59:51 1998 Mattias Amnefelt <mattiasa@sundance.stacken.kth.se>
-
- * appl/vos.c: correct parsing of partition names
-
- * appl/appl_locl.h: #include <ctype.h>
-
-Mon Jul 6 12:29:04 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * xfs/bsd/Makefile.in: Get KERNEL_CFLAGS from configure.
-
- * xfs/bsd/xfs_dev.c: Add wrapper for vfs_busy.
-
- * xfs/bsd/xfs_vnodeops.c: Add wrapper for VOP_LOCK/VOP_UNLOCK.
-
- * configure.in: Add KERNEL_CFLAGS for *BSD and OSF/1. Test for
- three valued vfs_busy, and two valued VOP_LOCK.
-
- * aclocal.m4: AC_TRY_COMPILE_KERNEL, that adds KERNEL_CFLAGS to
- CFLAGS during test.
-
-Sun Jul 5 20:26:02 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (fcache_find): new function add invalidating and
- vnode creating threads
-
- * arlad/fcache.h (FCacheEntry): rename `listentry' -> `lru_le'.
- add `invalid_le'
- (fcache_find): add prototype
-
- * util/list.c (listaddbefore, listaddafter): new functions
-
-Sun Jul 5 03:28:44 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/arla.c: new option `--cache-dir'
-
-Sun Jul 5 04:28:02 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux/xfs_vfsops.c: Fix 2.1 {put,delete}_inode weirdness
-
- * xfs/linux/xfs_message.c: Fix callback handling
-
-Sun Jul 5 04:24:14 1998 Magnus Ahltorp <magnus@dike.aladdin.se>
-
- * xfs/linux/xfs_inodeops.c: Clear vm maps when closing file.
-
-Sat Jul 4 16:21:44 1998 Magnus Ahltorp <magnus@dike.aladdin.se>
-
- * xfs/linux/xfs_inodeops.c: 2.0 fixes
-
-Sat Jul 4 05:53:01 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux/*: Big rewrite of different things. Works somewhat
- (writes sometimes do the wrong thing) on 2.1, 2.0 is untested.
- The file system may now be mounted before arlad is started.
-
-Fri Jul 3 19:38:22 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/arla_local.h: this ugliness seems required
-
-Wed Jul 1 21:34:42 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (fcache_get): remove the old entry from the free
- list before adding the new one.
-
-Sat Jun 27 12:46:20 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_syscalls.c (sys_afs): correct check for
- copy_{from,to}_user. Always return -errno.
-
- * xfs/linux/xfs_common.h (copy_to_user, copy_from_user): these
- functions should return the number of uncopied bytes.
-
- * configure.in: remove uid_t size test
-
- * xfs/include/xfs_message.h: use __kernel_foo_t
-
- * xfs/include/xfs_attr.h: define __kernel_foo_t if they are not
- already defined and use them.
-
- * xfs/bsd/xfs_node.c (vattr2xfs_attr): cast to `mode_t' otherwise
- it breaks on modern NetBSD
-
-Thu Jun 25 06:04:01 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/adir.c (add_to_page): don't index off the end of the page.
-
-1998-06-24 Love Hornquist-Astrand <root@junkyard.stacken.kth.se>
-
- * doc/partsofarla.texi: Added info about libkafs and pioctl()
-
-Mon Jun 22 17:34:53 1998 Robert Burgess <rb@stacken.kth.se>
-
- * xfs/solaris/xfs_vfsops.c: debug panic patch from:
- John Hawkinson <jhawk@bbnplanet.com>
-
-1998-06-22 Love <lha@e.kth.se>
-
- * Added doc/*.texi
-
-1998-06-21 Love <lha@e.kth.se>
-
- * lib/sl/sl.[ch]: Added SL_BADCOMMAND
-
- * appl/{fs,vos}.c: Fixes for sl.
-
- * configure.in: Added patch for afslib from:
- Mark Eichin <eichin@kitten.gen.ma.us>
-
-Fri Jun 19 20:43:42 1998 Assar Westerlund <assar@sics.se>
-
- * appl/fs.c (connect_cmd): correct comparison against `dis'
-
-Wed Jun 17 17:08:39 1998 Robert Burgess <rb@stacken.kth.se>
-
- * Release 0.7.2
-
-Sat Jun 13 03:32:39 1998 Assar Westerlund <assar@sics.se>
-
- * appl/vos.c (printpartinfo): use bogus field
-
-1998-06-09 Love <lha@e.kth.se>
-
- * lwp/make-process.o.sh.in: The new magic way of building process.o
-
-Tue Jun 9 10:11:03 1998 Magnus Ahltorp <map@stacken.kth.se>
-
- * Release 0.7.1
-
- * major bug fixes
-
-Mon Jun 8 18:07:12 1998 Robert Burgess <rb@stacken.kth.se>
-
- * Release 0.7
-
-1998-06-08 Love <lha@e.kth.se>
-
- * arlad/fcache.c: Try to do sane things with callback->ExpirationTime.
- (Assume that ExpirationTime is a relative time)
-
- * util/log.c(log_vprint_file): Print date when logging to file/stderr.
-
-Mon Jun 8 15:14:10 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/openbsd2.3/xfs_syscalls.c: merge in
- xfs/bsd/xfs_syscalls.c:1.26->1.27
-
- * xfs/bsd/xfs_syscalls.c (xfs_setpag_call): only copy the required
- gids and return the new cred
-
-Sun Jun 7 10:57:18 1998 Assar Westerlund <assar@sics.se>
-
- * configure.in: add irix
-
-Sun Jun 7 07:23:07 1998 Robert Burgess <rb@stacken.kth.se>
-
- * xfs/{solaris,aix,sunos}/xfs_messages.c
- (xfs_message_invalidroot): clear tokens when invalidating
-
- * arlad/fcache.c (fcache_init): set fprioritylevel at init
-
-Sun Jun 7 07:19:35 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * acconfig.h, configure.in, lib/roken/roken.h:
- Autodetect linux htonl weirdness
-
-Thu Jun 4 00:12:37 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/arla.c: new option `--recover' or `-z' for recovering
- (not) stored state
-
- * arlad/fcache.c (fcache_init): new parameter `recover'
-
- * arlad/volcache.c (volcache_init): new parameter `recover'
-
-Wed Jun 3 23:41:42 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (do_read_attr): make sure we don't return -1
-
-Tue Jun 2 19:16:15 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_locl.h: include <linux/modversions.h> to get
- versioned names of exported kernel symbols
-
-Tue May 26 22:54:33 1998 Assar Westerlund <assar@sics.se>
-
- * acconfig.h (VFS_NEED_PROCP): remove
-
- * configure.in (openbsd2.3): remove old junk
-
-Mon May 25 04:16:26 1998 Artur Grabowski <art@stacken.kth.se>
-
- * arlad/messages.c: fix reading of links when only having
- 'l' rights
-
- * xfs/*bsd*/xfs_vnodeops.c: change size and mtime of files when
- writing to them.
-
-Mon May 25 00:58:17 1998 Assar Westerlund <assar@sics.se>
-
- * Release 0.6
-
- * lwp/Makefile.in: more uglyness for process.S
-
- * util/Makefile.in: link mmaptime_test with libroken
-
-1998-05-24 Love <lha@e.kth.se>
-
- * util/mmaptime_test.c: Added
-
- * arlad/messages.c(vioc_fpriostatus): FPRIO_{GET,SET}MAX
-
- * arlad/fcache.c(restore_state): Set priority too.
- (do_read_attr): Check for disconnected mode, if we got
- attr just return, otherwise return ENETDOWN.
- (read_data): Check for disconnected mode.
- (fcache_get): Check for disconnected mode.
- (uptodatep): Check for connected logging mode.
-
- * arlad/conn.c(conn_free): When in disconnected mode conn
- sets to NULL.
-
- * appl/{arlalib.h,fs.c,fs_lib.c,fs_local.h}: Added
- {set,get}maxfprio.
-
-Sat May 23 07:24:22 1998 Assar Westerlund <assar@sics.se>
-
- * appl/appl_locl.h: include <sys/param.h>
-
- * arlad/aix-subr.c: new file
-
- * arlad/linux-subr.c (conv_dir): got rid of stupid warning
-
- * arlad/arla.c (arla_cat): check return values from fcache*
-
- * configure.in: check for h_errno, h_errlist, and h_nerr
-
- * aclocal.m4: add check-declaration and check-var
-
-Fri May 22 21:34:30 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (fcache_get): check return value from
- volcache_getbyid.
-
-Wed May 20 02:56:14 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/arla.c: add `--port'
-
- * getarg.c: fix some of the getarg bugs
-
-Tue May 19 17:18:31 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux: Fixed varous pointer conversions.
- Moved glibc support to the correct place.
- Added random code for debug control syscall.
-
-1998-05-18 Love <lha@e.kth.se>
-
- * lwp/process.S: Add linux alpha support
-
- * xfs/bsd/xfs_syscalls.c: Log to XDEBSYS instead of XDEBMSG
-
- * include/kafs.h: Added new PIOCTL (50) for VIOC_FPRIOSTATUS
- Added defines and structs for FPRIOSTATUS.
-
- * conf/arla.conf: Added fpriority, default to 100
-
- * arlad/messages.c: Added vioc_fpriostatus
-
- * arlad/inter.c:(log_operation) dont log operations when in
- connected mode.
-
- * arlad/fcache.c: Added fprioritylevel and made use of it in
- emergency_remove_file() and in cleaner thread.
-
- * arla/arla_local.h: Added new state of connected_mode,
- CONNECTEDLOG
-
- * arlad/arla.c: Added fpriority to the conf file
-
- * appl/fs.c: (getarg) Added {add,remove,get}removepriority,
- and version.
- (connect) changed fs_connect syntax
- ({get,set}crypt) changed fs_*crypt syntax
- ({set,get,remove}prio) added calls
- (fserr) moved to fs_lib.c and changed syntax
- (fsversion) print version of fs.c and fs_lib.c
- (afs_getfid) moved to fs_lib
-
- * appl/arlalib.h: Added fs_* prototypes
-
-Sat May 16 11:41:19 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux: Merged in Linux 2.1 support
-
-Sat May 16 06:44:16 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/solaris/xfs_vnodeops.c: fix use of VOP_RWLOCK and
- VOP_RWUNLOCK
-
- * xfs/aix/bin: add umount_xfs and mount_xfs.
-
- * xfs/aix/xfs_vfsops.c (xfs_mount): find the device path
-
- * xfs/aix/xfs_dev.c: init `event_word' to EVENT_NULL
-
- * xfs/aix/xfs_deb.h: Use uprintf instead of printf to make it
- possible to see the messages.
-
-Tue May 12 17:29:39 1998 Assar Westerlund <assar@sics.se>
-
- * lwp/process.S: grammar fix
-
-Sun May 10 02:25:47 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c: Fixed create, mkdir, rmdir, rename
- in 2.1 branch
-
- * xfs/linux/{xfs_message.c,xfs_inodeops.c}:
- Addded more correct handling of dcache in 2.1 branch
-
-Sat May 9 11:41:10 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/solaris/xfs_vnodeops.c: replace VN_HOLD/VN_RELE by
- VOP_RWLOCk/VOP_RWUNLOCK before calling VOP-funktions in ufs.
-
- * configure.in: aix
-
- * xfs/solaris/xfs_message.c (xfs_message_installdata): replace
- printf by XFSDEB. Extra ASSERT for rb.
-
-Thu May 7 04:00:30 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/aix: new directory
-
-1998-05-06 Assar Westerlund <assar@sics.se>
-
- * xfs/solaris/xfs_message.c: try to purge the dnlc once in a while
-
- * xfs/solaris/xfs_node.c (vattr2xfs_attr): check for AT_TYPE
- (vattr2xfs_attr, xfs_attr2vattr): correct panic string
-
-Tue May 5 10:45:15 1998 Assar Westerlund <assar@sics.se>
-
- * ydr/output.c (encode_string): zero-terminate string when
- decoding.
-
-1998-05-05 Love <lha@s3.kth.se>
-
- * configure.in: Check for dbm.
-
- * arla/arla.c: Added flushfid command in -t mode.
-
- * milko/bufcache.{c,h}: Added experimental bufcache.
-
-Sun May 3 04:29:01 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/solaris/xfs_vnodeops.c: return ENOSYS instead of EINVAL.
- implement some trivial vnodeops
-
- * xfs/solaris/xfs_vfsops.c: return ENOSYS instead of EINVAL for
- non-implemented vfs-operations
-
-Sat May 2 03:00:35 1998 Assar Westerlund <assar@sics.se>
-
- * **/Makefile.in: add `DESTDIR' and `uninstall:'
-
- * arlad/fcache.c: got rid of some stupid warnings
- updated to new volcache root volume stuff
-
- * arlad/volcache.c: renamed volcache_rootvolume ->
- volcache_get_rootvolume
- (volcache_set_rootvolume): new function
-
- * arlad/cred.c (cred_add): remove any old entry before adding the
- new one.
-
- * arlad/messages.c: try to handle expiring credentials in lots of
- places
- (viocgettok): remember to free the cred.
-
- * arlad/fcache.c (read_data): handle the case of the file not
- fitting in the cache.
- (getroot): print the errors correctly
- (getacl, setacl, getvolumestatus, setvolumestatus): don't destroy the
- error code
-
- * arlad/fbuf.c: rename all arguments fbuf -> f to avoid namespace
- invasion.
-
- * arlad/bsd-subr.c (conv_dir): get rid of a stupid varning
-
- * arlad/cred.c (cred_expire): new function
-
- * arlad/messages.c: try to handle expiring credentials.
-
-Fri May 1 22:20:23 1998 Assar Westerlund <assar@sics.se>
-
- * configure.in: call AC_C___ATTRIBUTE__
-
- * aclocal.m4 (AC_C___ATTRIBUTE__): new macro for testing for
- `__attribute__'
- (AC_C___FUNCTION__, AC_FUNC_NTOHL): conservative default when
- cross-compiling
-
-1998-04-30 Love <lha@s3.kth.se>
-
- * ydr/output.c: No #define FOO_BAR_SIZE 0
-
- * conf/services.h: No more errormessages...
-
- * arlad/{fcache.c, arlad.c}: Added --root-vol=root.afs
-
- * milko/* Added random stuff.
-
-Mon Apr 27 22:11:55 1998 Assar Westerlund <assar@sics.se>
-
- * ydr/lex.l: parse more types of #line-lines.
- renamed all tokens to T_FOO
-
- * lwp/lwp.h: <sys/types.h> and <sys/select.h>
-
- * lwp/Makefile.in: rs6000.
- try harder preprocessing process.S
-
- * appl/Makefile.in: add AIX_EXTRA_KAFS
-
- * configure.in: aix
-
- * aclocal.m4: AC_KRB_SYS_AIX added
-
-Sun Apr 19 15:36:35 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/Makefile.in (vop_defs.h): generate list of vops. From
- "Per Boussard, ERA/T/ED" <per@era-t.ericsson.se>
-
- * xfs/bsd/xfs_locl.h: include vop_defs.h
-
-Sun Apr 19 08:09:43 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/openbsd2.3/xfs_vfsops.c (xfs_mount): set `f_files' correctly
-
- * xfs/bsd/xfs_vfsops.c (xfs_mount): set `f_files' correctly
-
-Wed Apr 15 04:52:27 1998 Robert Burgess <rb@abc.se>
-
- * Release 0.5
-
- * xfs/solaris/xfs_node.c: set blksize/nblocks
-
-Tue Apr 14 23:59:08 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux/xfs_load.c: Changed major number to the newly
- allocated 103
-
-Tue Apr 7 05:32:26 1998 Robert Burgess <rb@stacken.kth.se>
-
- * arlad/fcache.c: Added VIOCSETAL support
-
- * arlad/messages.c: Moved some checks here from xfs_syscalls.c
-
-Mon Apr 6 05:19:44 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux/xfs_vfsops.c: Added xfs_statfs
-
- * xfs/linux/xfs_syscalls.c: Merged in new syscall style from bsd
-
- * arlad/messages.c: Free opaque after use
-
-Sun Apr 5 12:50:56 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_node.c (xfs_dnlc_lookup): print debug output
- correctly.
-
- * arlad/cred.c (cred_delete): new function
-
-Sun Apr 5 05:49:27 1998 Robert Burgess <rb@stacken.kth.se>
-
- * arlad/fcache.c: Added VIOCGETVOLSTAT/VOLCSETVOLSTAT support
-
-Sun Apr 5 05:31:52 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (truncate_file): decrement usedbytes iff the data
- was cached.
-
- * arlad/adir.c (adir_mkdir): zero out hash table.
-
- * arlad/afsdir_check.c: use arla_log
-
- * arlad/Makefile.in (afsdir_check): link with arladeb.o
-
-Sun Apr 5 01:25:00 1998 Assar Westerlund <assar@sics.se>
-
- * ydr/output.c (gendeclare): handle strings
-
-Sat Apr 4 20:39:18 1998 Assar Westerlund <assar@sics.se>
-
- * configure.in: add a --disable-mmap
-
- * aclocal.m4 (AC_HAVE_GETCONF): call AC_CHECK_PROG properly
-
-Sat Apr 4 14:00:06 1998 Assar Westerlund <assar@sics.se>
-
- * appl/Makefile.in: link with RXKAD and KAFS in the correct order
-
-Fri Apr 3 09:19:53 1998 Love H-Astrand <lha@ksk.sala.se>
-
- * lib/ko/port.[ch]: Moved and added more ports.
-
-Fri Apr 3 05:30:19 1998 Assar Westerlund <assar@sics.se>
-
- * lib/ko/koerror.c: const-ize
-
- * arlad/arla.c: new option `-n'
-
- * arlad/*.c: rationalize and use new debug levels and functions
-
- * util/log.c: change LOG_DEBUG -> LOG_INFO
-
- * util/log.h: add __attribute__
-
- * arlad/arladeb.c: add new debug levels.
- add arla_{v,}{err,warn}{,x}
-
-Thu Apr 2 05:07:29 1998 Assar Westerlund <assar@sics.se>
-
- * configure.in: use AC_STRUCT_SOCKADDR_HAS_SA_LEN
-
- * aclocal.m4 (AC_STRUCT_SOCKADDR_HAS_SA_LEN): added
-
- * rx/rx_user.c (GetIFInfo): rewrite so that it actually works.
-
-Tue Mar 31 07:52:39 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vnodeops.c (xfs_lookup): better debug output for
- negative caching
-
- * xfs/bsd/xfs_message.c (xfs_message_installnode): purge the name
- cache
- (xfs_message_installdata): purge the name cache iff it's a directory
-
-Mon Mar 30 17:45:45 1998 Love Hörnquist-Åstrand <lha@stacken.kth.se>
-
- * Added autoconf test for glibc.
- From: Brad Keryan <keryan@andrew.cmu.edu>
-
-Mon Mar 30 12:01:50 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c: added mkdir and rmdir
-
- * xfs/linux/xfs_inodeops.c: xfs_readdir checks for inode numbers
- in the name cache
-
-Mon Mar 30 00:27:22 1998 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * aclocal.m4: Autoconf test for getconf, and getconf LFS_{C,LD}FLAGS
-
-Sun Mar 29 14:25:28 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux: Merged in access control from bsd.
-
- * xfs/linux: Fixed various things. Should work much better.
-
-Sun Mar 29 03:21:39 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/arla.c: new option `connected-mode' for setting initial
- connected mode
-
- * arlad/fcache.c (do_read_attr, read_data): set anonaccess
-
- * configure.in: remove test for winsock.h. added test for recvmsg
- and sendmsg.
-
- * rx/rx_mach.h: cygwin doesn't have SIOCGIFCONF. From Dan Winship
- <danw@MIT.EDU>
-
- * arlad/*.c: Use O_BINARY. From Dan Winship <danw@mit.edu>
-
-Sat Mar 28 10:34:30 1998 assar westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_common.c (install): use DESTDIR
-
- * arlad/bsd-subr.c (write_dirent): conditionalize on
- HAVE_STRUCT_DIRENT_D_TYPE
-
- * configure.in: check for `d_type' in `struct dirent'
-
-Sat Mar 28 10:15:29 1998 Assar Westerlund <assar@sics.se>
-
- * aclocal.m4 (AC_HAVE_STRUCT_FIELD): added
-
-1998-03-28 Love Hörnquist-Åstrand <lha@s3.kth.se>
-
- * *: USE_MMAPTIME
-
- * configure.in: Added --enable-mmaptime
-
- * arlad/{messages,arlad}.c: Added no kerberos fix from
- Dan Winship <danw@mit.edu>
-
-1998-03-27 Love Hornquist-Astrand <lha@ksk.sala.se>
-
- * util/mmaptime.[ch]: Added (not working yet)
-
-Fri Mar 27 03:41:45 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/arla.c (newwalk): handle symlink followed by more path
-
- * xfs/bsd/xfs_vnodeops.c (xfs_lookup): enter negative entires in
- name cache when arlad returns ENOENT
-
- * xfs/bsd/xfs_node.c (xfs_dnlc_lookup): change signature to be
- more compatible with cache_lookup
-
- * arlad/arla.c (arla_cat): release lock
-
-Thu Mar 26 02:21:48 1998 Assar Westerlund <assar@sics.se>
-
- * Release 0.4
-
- * lwp/process.S: rhapsody/powerpc
-
- * lwp/Makefile.in: Add powerpc and rhapsody.
-
- * **/Makefile.in: Use KRB_INC_FLAGS
-
- * configure.in, aclocal.m4: Test for krb v5. From <lxs@mit.edu>
-
-Wed Mar 25 04:26:56 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_dev.c (xfs_devwrite): return the correct value.
- also check for bogus size == 0
-
- * xfs/{linux,sunos,solaris}: update to new style xfs_message.h
-
- * xfs/bsd/xfs_msg_locl.h: new file
-
- * xfs/bsd/xfs_wrap.c: do DISPATCH the `correct' way
-
- * xfs/bsd/xfs_message.c: add `struct proc *p' to xfs_message_*
-
- * xfs/bsd/xfs_node.c (new_xfs_node): now takes a `struct proc *p'
-
- * xfs/bsd/xfs_dev.c: add `struct proc *p' to xfs_message_*
-
- * xfs/bsd/xfs_dev.h: add prototypes for xfs_message_*
-
- * arlad/messages.c: made all xfs_message_* functions static
-
- * arlad/messages.h: add proto for xfs_message_receive
-
- * xfs/include/xfs_message.h: Removed all the prototypes.
-
- * xfs/bsd/xfs_vnodeops.c: s/EINVAL/EOPNOTSUPP/
-
- * xfs/bsd/xfs_dev.c (xfs_message_wakeup_data): correct debug
- output
-
- * arlad/messages.c(afsrights2xfsrights): change arguments.
-
- * xfs/linux/xfs_load.c (init_module): don't print
- xfs_message_installnode, it's static now.
-
-Tue Mar 24 00:24:18 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vfsops.c (xfs_mount): copy in the arguments. From
- Karl Ramm <kcr@mit.edu>.
-
-Tue Mar 24 19:53:50 1998 Robert Burgess <rb@stacken.kth.se>
-
- * arlad/fcache.c: Added VIOCGETAL support
-
-Tue Mar 24 02:03:43 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_dev.c (xfs_devwrite): fix?
-
- * arlad/kernel.c: also collect statistics on the number of
- messages per read
-
- * arlad/messages.c: more stats
-
- * arlad/messages.c: count the number of send/recd messages
-
- * xfs/include/xfs_message.h (XFS_MSG_COUNT): added
-
- * arlad/*-subr.c (conv_dir): use `fcache_extra_file_name' and do
- locking correctly.
-
- * xfs/bsd/xfs_vnodeops.c (xfs_seek): return 0.
-
- * Makefile.in (configure): ignore errors
-
- * arlad/arla.c (main): don't malloc and free device_file
-
- * appl/fs.c: added `getcrypt' and `setcrypt'
-
- * xfs/bsd/xfs_syscalls.c (xfs_pioctl_call): add
- VIOC_[GS]ETRXKCRYPT
-
- * include/kafs.h (VIOC_[GS]ETRXKCRYPT): added
-
- * arlad/bsd-subr.c (write_dirent): set `d_type'
-
-Sun Mar 22 19:25:18 1998 Assar Westerlund <assar@sics.se>
-
- * Release 0.3
-
- * configure.in: don't clobber CFLAGS
-
- * xfs/bsd/xfs_syscalls.c (xfs_pioctl_call): use
- `a_followSymlinks'. Call `suser' instead of == 0
-
- * arlad/solaris-subr.c: handle the weirdness in the solaris dirent
- format
-
- * arlad/afsdir_check.c (check): removed bogus code
-
- * xfs/solaris: major rewriting and fixing.
-
-Sun Mar 22 02:47:59 1998 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * appl/fs.c,arlad/messages.c,xfs/{bsd,openbsd2.3,linux}:
- Added VIOCCONNECTMODE
-
-Sat Mar 21 15:20:52 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (read_data, write_data, truncate_file): kill the
- call if an error occurs.
-
- * configure.in: tweak CFLAGS and -I/usr/athena
-
- * arlad/conn.c (conn_get): connected_mode test
-
- * arlad/volcache.c (volume_uptodatep): look at connected_mode
-
- * arlad/fcache.c (uptodatep): look at `connected_mode'
-
- * arlad/arla.c: new option `--debug'
-
- * arlad/arladeb.c (arla_log_set_level, arla_log_get_level,
- arla_log_print_levels): new functions
-
- * arlad/kernel.c (process_message): handle multiple messages
-
- * xfs/{sunos,solaris,linux}/xfs_dev.c: merge in changes from bsd
-
- * arlad/messages.c(xfs_send_message_wakeup_multiple): new
- function. use it.
-
- * lwp/iomgr.c: re-wrote the handling of fd_set's
-
- * xfs/bsd/xfs_dev.c (xfs_devread, xfs_devwrite): implement
- multiple messages per read/write
-
-Sat Mar 21 06:45:42 1998 Artur Grabowski <art@squit.stacken.kth.se>
-
- * doc/* : added a few docs about Arla.
-
-Fri Mar 20 08:19:36 1998 Artur Grabowski <art@squit.stacken.kth.se>
-
- * xfs/{openbsd2.3,bsd}/xfs_vfsops.c (xfs_unmount): fix unmounting.
-
-Fri Mar 20 04:30:33 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vnodeops.c (xfs_fetch_rights): new function used by
- `xfs_access'
- (xfs_read, xfs_write, xfs_readdir, xfs_readlink): vop_lock and
- vop_unlock
-
-Thu Mar 19 22:31:20 1998 Assar Westerlund <assar@sics.se>
-
- * ydr/output.c (init_generate): change path of rx.h
-
- * xfs/bsd/xfs_vnodeops.c(xfs_fsync): send correct flags to
- do_fsync
-
- * arlad/fbuf.c (mmap_copyrx2fd, malloc_copyrx2fd): check result of
- ftruncate
-
- * arlad: moved kerberos includes to arla_local.h
-
- * include/Makefile.in: remove stds.h, kafs.h add rxkad.h service.h
-
- * **/Makefile.in: remove unused INCLUDES
-
-Thu Mar 19 12:27:47 1998 Love Hörnquist-Åstrand <lha@s3.kth.se>
-
- * app/fs/fs.c:
- (fserr): Implemented and changed on all used use on all places.
- (afs_getfid): Added VIOCGETFID
- (quit_cmd): use return instead of exit();
-
-Wed Mar 18 21:52:31 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (create_directory): create the directory locally
- instead of fetching it from the file server
-
- * arlad/adir.c (dir_mkdir): new function
-
- * arlad/fcache.c (stale): don't bother if the callback is already
- dropped
-
-Wed Mar 18 10:58:44 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux/xfs_vfsops.c: Added xfs_write_inode
-
- * xfs/linux/xfs_inodeops.c: Added permission checking and write support
-
-Wed Mar 18 03:11:51 1998 Artur Grabowski <art@squit.stacken.kth.se>
-
- * xfs/{openbsd2.3,bsd}/{xfs_fs.h,xfs_node.c}: xfs_has_pag implemented.
-
- * xfs/{openbsd2.3,bsd}/xfs_node.c (new_xfs_node): set anonrights.
-
- * xfs/openbsd2.3/xfs_vfsops.c: small fix to {un,}installation.
-
- * xfs/{openbsd2.3,bsd}/xfs_vnodeops.c
- (xfs_access): implement correctly
-
- * xfs/{openbsd2.3,bsd}/xfs_node.h: add an anonrights field to
- xfs_node.
-
- * xfs/{openbsd2.3,bsd}/xfs_message.c
- (xfs_message_installattr, xfs_message_installdata): set anonrights.
-
- * xfs/include/xfs_message.h: add anonrights, change id from u_int
- to pag_t, add masks for rights.
-
- * arlad/messages.c
- (afsrights2xfsrights): implement.
- (fcacheentry2xfsnode): add handling of access rights.
- (most functions): access rights handling with changed cm_attr.
-
- * arlad/inter.c
- (getrights): correct implementation.
- (checkright): correct implementation.
- (cm_getattr): handling of access rights.
-
- * arlad/fcache.c
- (create_new_entries): initialize acccache.
- (recover_state): Do not recover rights.
- (findaccess): pag 0 doesn't mean that it's unauthorized.
-
- * ChangeLog: updated.
-
-Tue Mar 17 06:05:26 1998 Artur Grabowski <art@squit.stacken.kth.se>
-
- * lwp/iomgr.c: some speed optimizations on selecting.
-
-Tue Mar 17 03:09:56 1998 Love Hornquist-Astrand <lha@foo.ksk.sala.se>
-
- * Make arlad /dev/xfs0 working again.
-
- * lib/ko/koerror.c: Fallback on strerror().
-
- * xfs/bsd/{xfs_dev.c,xfs_vnodeops.c,xfs_locl.h}: Started to
- use #ifdef HAVE_VOP_FOO for everything.
-
- * xfs/bsd/xfs_dev.c: NetBSD 1.3 and OpenBSD 2.2 doesn't have
- vop_{get,put}pages_desc.
-
-Tue Mar 17 01:24:55 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/*: moved xfs/*.h to .
-
- * xfs/bsd/xfs_vnodeops.c: fixed vop_t
-
- * xfs/solaris/Makefile.in: renamed xfs.mod -> xfs
-
- * lwp/Makefile.in: check if the compiler is gcc not if it's called
- gcc
-
- * **: renames lots of `errno' to `error'
-
- * xfs/linux/Makefile.in: include KRB_INC_DIR last
-
-Mon Mar 16 21:38:06 1998 Artur Grabowski <art@squit.stacken.kth.se>
-
- * lwp/process.S: close a comment and let lwp work on ppc. (reported
- to work)
-
-Mon Mar 16 20:55:52 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c: Fixed bug in xfs_readdir
-
-Mon Mar 16 02:54:53 1998 Assar Westerlund <assar@sics.se>
-
- * Release 0.2
-
- * NEWS, THANKS: new files.
-
- * include/Makefile.in: add parse_units.h and resolve.h
-
-Sun Mar 15 00:56:47 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/volcache.c (volume_uptodatep): new function
- (recover_state): don't mark recovered volumes as valid
-
- * xfs/sunos/xfs_vnodeops.c (xfs_inactive): use the flag field on
- the inactivenode message
-
- * xfs/solaris/xfs_vnodeops.c (xfs_inactive): use the flag field on
- the inactivenode message
-
- * xfs/openbsd2.3/xfs_vnodeops.c (xfs_reclaim): use the flag field
- on the inactivenode message
-
- * xfs/linux/xfs_vfsops.c (xfs_put_inode): set flag in inactivenode
- message
-
- * xfs/include/xfs_message.h (xfs_message_inactivenode): new `flag'
- field
-
- * xfs/bsd/xfs_vnodeops.c (xfs_close): only call `do_fsync' if the
- file was oppened for writing and was actually changed.
- (xfs_inactive): send an inactivenode message
- (xfs_reclaim): use the correct flag on the inactivenode message
-
- * arlad/messages.c (xfs_message_inactive): look at the flags
- (xfs_message_create & c:o): use the correct realfid
-
- * arlad/inter.c: update to new FCacheEntry
-
- * arlad/fcache.c (throw_entry): only give up a callback if we have
- any.
- (recover_state): init `count'
- (fcache_stale_entry): call stale iff flags.kernelp
- (fcache_get_data): don't get data if the shows that it hasn't changed.
-
- * arlad/fcache.h (FCacheEntry): remove `nreaders' and `nwriters'.
- add `flags.kernelp'
-
- * arlad/adir.c (create_new_page): return page1
- (add_to_page): only loop till ENTRIESPERPAGE - 2
- (adir_creat): don't use status.Length, it might already have been
- increased by the file server. more and more correct checks.
-
- * appl/vos.c (printvolstat): const-ized
-
- * appl/arlalib.h: const-ized
-
- * appl/arlalib.c: const-ized
-
-Sat Mar 14 14:39:25 1998 Assar Westerlund <assar@sics.se>
-
- * include/Makefile.in: add err.h
-
- * rx/rx_pkt.[ch]: don't assume sizeof(void) == 1
-
-Sat Mar 14 14:08:02 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/cmcb.c (RXAFSCB_CallBack): remove warning message
-
- * arlad/{ports,arla,messages}.c: no \n to arla_log
-
- * rxkad/rxk_locl.c (rxkad_check_packet): kludge around.
-
- * README: update installation instructions
-
- * arlad/arla.c: add options for rxkad_level and device.
-
-Sat Mar 14 13:56:55 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * arlad/Makefile.in: Added libko dependencies in arlad
-
-Fri Mar 13 05:06:37 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_readlink): call `set_fs'
-
- * xfs/bsd/xfs_vnodeops.c (do_fsync): reset the XFS_DATA_DIRTY flag
- (xfs_remove): remove the name from the dnlc
- (xfs_mmap, xfs_bmap, xfs_getpages, xfs_putpages): dummy functions
-
- * xfs/bsd/xfs_message.c: spell-check the printfs
-
- * util/fnameutil.[ch]: rename {base,dir}name to copy_\1name
-
- * rxdef/pts.xg: fix broken declarations
-
- * include/Makefile.in: add getarg.h
-
- * arlad/volcache.h (volcacheentry): add `validp'
-
- * arlad/volcache.c: change `freelist' to be a `lrulist'
- (recover_state, volcache_store_state): new functions
- (volcache_invalidate): new function
-
- * arlad/inter.c (cm_init,cm_store_state,log_operation): new
- functions
- (*): call log_operation
- (*): const-ized some arguments
-
- * arlad/fcache.h: update prototypes
-
- * arlad/fcache.c (fcache_store_state,recover_state): new functions
- (fcache_init): don't create cachedir. try to recover state.
- (*): return ENETDOWN if findconn fails
- (do_read_attr): throw data if DataVersion has changed
- (truncate_file): use O_CREAT
- (create_file): create a empty cache file
- (*): const-ized some arguments
- (fcache_get_data): DTRT
-
- * arlad/cmcb.c (RXAFSCB_CallBack): handle volume callbacks.
-
- * arlad/arladeb.h: add ADEBVOLCACHE and ADEBCM
-
- * arlad/arla.c (newwalk): return int. change callers. handle
- signals by storing state
- (main): use getarg. chdir to cachedir before initializing
-
- * configure.in: fix sys/dir.h and dirent.h test.
- call AC_KRB_VERSION
-
- * aclocal.m4 (AC_KRB_VERSION): new macro
-
- * TODO: update
-
-Thu Mar 12 15:22:50 1998 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * configure.in,aclocal.m4,acconfig.h,lib/roken/resolve.c:
- Added HAVE__RES
-
- * configure.in, aclocal.m4: Added tests for krb-libs,and includes.
-
-Thu Mar 5 22:20:54 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c: More correct error handling
- and -Wall pleasing.
-
-Thu Mar 7 05:50:10 1998 Love Hörnquist-Åstrand <lha@s3.kth.se>
-
- * rxdef/pts.xg: Added broken xg def.
-
-Wed Mar 4 03:23:19 1998 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * arla/*.c: Added arla_log and started to used.
-
- * util/log.c: Added log_vlog.
-
- * arlad/messages.c: Moved vicofluchvolume outsize #ifdef KERBEROS
- and added stub for VIOCGETAL.
-
-Tue Mar 3 21:16:06 1998 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c: fixes memoryleak and xfs_readdir()
- on linux != sparc. from amu@mit.edu (Aaron M. Ucko)
-
-Tue Mar 3 00:00:55 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/inter.c (cm_lookup): const-ized parameters
-
- * xfs/{sunos,solaris}/{,bin/}Makefile.in: set exec_prefix
- (install): removed '-m 444'
-
- * rxdef/volumeserver.xg: remove stds.h
-
- * lib/{ko,tl}/Makefile.in (install): removed '-m 444'
-
- * arlad/arla.c (newwalk): follow symlinks
- (main): try harder getting kerberos credentials
-
- * appl/appl_locl.h: include <atypes.h>
-
-Mon Mar 2 13:32:42 1998 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * appl/vos.c: Vos exa now uses libko/kocell.
-
- * lib/ko/kocell.c: Moved from arlad/cell.c, and turned
- arlad/cell.c to a dummy.
-
- * configure.in,include/stds.h.in: Added autoconf test
- for krb_principal
-
- * Made a bunch of links to include/ from all .h files
- to make the compile lines more sane.
-
- * arla/{fcache.c,volcache.c} Added use of libkoerror.
-
-Mon Mar 2 01:00:09 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * arlad/bsd-subr.c: Horrible hack for DEC Unix.
-
-Sun Mar 1 06:42:00 1998 Assar Westerlund <assar@sics.se>
-
- * Release 0.1
-
- * arlad/fcache.c (do_read_attr): invalidate data if we have it
- cached and DataVersion has changed.
-
- * xfs/bsd/xfs_node.c (new_xfs_node): postpone vget-ing
-
- * xfs/bsd/bin/Makefile.in: set PROGS and clean properly
-
- * xfs/bsd/xfs_message.c (xfs_message_isntallnode): more debug
-
- * xfs/bsd/Makefile.in (doclean): clean properly
- (CFLAGS): remove Wall (it is set by configure)
-
- * rx/rx.h: remove stupid includes
-
- * conf/Makefile.in: don't overwrite existing configuration files
-
- * configure.in: remove unused tests
-
- * xfs/bsd/xfs_message.c (xfs_message_installdata): don't
- VOP_UNLOCK unlocked vnode.
-
- * util/list.c: more paranoia
-
- * arlad/bsd-subr.c (conv_dir): free buf
-
- * arlad/adir.c (adir_readdir): do `.' and `..'-magic correctly.
-
-Fri Feb 27 23:37:39 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c: better error reports when rx calls fail.
-
-Fri Feb 27 07:09:08 1998 Artur Grabowski <art@squit.stacken.kth.se>
-
- * arlad/*-subr.c: truncate files when opening a dircache file.
-
-Fri Feb 27 04:56:58 1998 Artur Grabowski <art@squit.stacken.kth.se>
-
- * arlad/arladeb.h: ADEBFCACHE added
-
- * arlad/fcache.c: don't break dead xfs-callbacks.
-
- * arlad/adir.c: put '.' and '..' in front of a readdir. Some systems
- seem to like it that way.
-
-Thu Feb 26 01:30:44 1998 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * arlad/fcache.c,messages.c: VIOC_FLUSHVOLUME
-
- * Now semiworking (no good parsing) vos listvol, it was a feature
- in ydr.
-
- * ydr/output.c:
- - long -> int32 fix
- - Fix for use of temporary variables.
-
-Mon Feb 23 06:38:18 1998 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * xfs/bsd/xfs_syscalls.c: Merged in changes from obsd23.
-
- * lib/roken/roken.h: ssize_t added.
-
- * lib/roken/roken.h: sunos select fix.
-
- * lib/roken/roken.h,acconfig.h, configure.in: sunos select fix.
-
- * VIOC_VENUSLOG: Almost.
-
-Mon Feb 23 01:17:43 1998 Artur Grabowski <art@stacken.kth.se>
-
- * xfs/openbsd2.3: (xfs_pioctl) cleanup and VIOCSETCACHE
-
- * arlad/messages.c, fcache.c: VIOCSETCACHE
-
-Mon Feb 23 02:10:51 1998 Assar Westerlund <assar@sics.se>
-
- * Release 0.0
-
- * arlad/arla.c (main): try to get tokens for the local cell.
-
- * appl/appl_locl.h: include rxkad.h iff KERBEROS
-
- * arlad/fcache.c (read_data): make sure we never go over
- `highbytes'
-
- * lwp/Makefile.in: add hpux
-
- * configure.in: add hpux
-
- * rx/rx_pkt.c(rxi_ReadPacket): fix from <per@era-t.ericsson.se>
- for handling strange packets.
-
- * rxdef/vldb.xg: MAXNAMELEN -> VLDB_MAXNAMELEN
-
- * rx/rx_locl.h: include <atypes.h>
-
- * lib/ko/ko.h: include <atypes.h>
-
- * arlad/messages.c: always include <kafs.h>
-
- * arlad/arla.c: made `conf_params' static to make it initable.
-
- * arlad/Makefile.in: coompatible with stupid make
-
- * appl/Makefile.in: use KAFS_LIBS
-
- * configure.in: set KAFS_LIBS
-
- * arlad/arla.c: allow setting of low and high-water marks.
-
- * configure.in: test if strtok_r needs a prototype
-
- * rxdef/Makefile.in: remove new junk files
-
- * ydr/main.c: changed the way of running cpp :-(
-
-Mon Feb 23 05:55:54 1998 Artur Grabowski <art@squit.stacken.kth.se>
-
- * xfs/openbsd2.3: (xfs_pioctl) cleanup and VIOCSETCACHE
-
- * arlad/messages.c, fcache.c: VIOCSETCACHE
-
- * appl/fs.c: setcachesize implmeneted.
-
- * arlad/arla.c: Added reading of a configuration file.
-
-Sun Feb 22 20:51:47 1998 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * xfs/bsd/xfs_vnodeops.c(xfs_link): Added OpenBSD and NetBSD
- compability
-
- * configure.in, include/stds.h, rxkad/rxkad.h: Added test for
- {,u_}int32, and added those for rxkad.
-
- * appl/vos.c: Fixing listpart, but the total is still wrong.
-
- * appl/vos.c: Added libko to parts of vos.c
-
- * lib/ko: Added libko, vlserver, volserver and rxkad errorcodes
- and messages.
-
-Sun Feb 22 15:59:30 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/volcache.c (print_entry): print every volume only once.
-
-Sun Feb 22 15:23:31 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * lwp/iomgr.c (struct IoRequest): add `next' pointer instead of
- bogus use of `result'.
-
- * lwp/lwp.c: Include <string.h>, replace "0x%x" with "%p".
-
- * rx/*: Use rx_locl.h
- - replace bcopy with memcpy
- - remove `register'
- - change long -> int32
- - don't depend on sizeof(whatever) being correct
-
- * rx/rx_user.c: Clean up osi_Panic.
-
- * rx/rx_pkt.c: Cleanup rx_Slow{Read,Write}Packet.
-
- * appl/vos.c: htonl(vlentry.serverNumber)
-
-Sun Feb 22 06:10:55 1998 Assar Westerlund <assar@sics.se>
-
- * ydr/lex.l (yywrap): conditionalize
-
-Sun Feb 22 01:11:17 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/messages.c (xfs_message_pioctl): implement VIOCGETTOK
-
- * xfs/bsd/xfs_syscalls.c (xfs_pioctl_call): implement `VIOCGETTOK'
-
- * rxkad: updated to a more modern version.
-
- * xfs/bsd/xfs_vnodeops.c (xfs_link, xfs_rename): implement
-
- * arlad/messages.c (xfs_message_link, xfs_message_rename):
- implement
-
- * arlad/inter.c (cm_link, cm_rename): new functions
-
- * arlad/fcache.c (create_link, rename_file): new functions
- all functions are now careful not to use any OUT parameters from
- rpc's that fail.
-
- * xfs/bsd/xfs_node.c (xfs_node_find): cleaner
-
- * arlad/fbuf.c: re-did the fbuf-interface
-
- * arlad/bsd-subr.c (write_dirent): do special for ".." iff
- flags.mountp
-
- * arlad/volcache.c (recycle_entry): removed a bogus `hashtabdel'
-
- * rx/rx_pkt.c (rxi_ReadPacket): case `RX_HEADER_SIZE' to int when
- comparing again `nbytes', otherwise we lose :-(
-
- * xfs/bsd/xfs_node.c (xfs_node_find): a dead vnode might still be
- on the mount-list, check for that.
-
-Sat Feb 21 23:14:47 Love Hornquist-Astrand <lha@foo.ksk.sala.se>
-
- * arlad/adir.c(adir_remove): Use length when deleting a entry
- in a afsdir.
-
- * arlad/fcache.c: Return ENOMEM when not finding a cred for the
- new cell (this should never fail, we should allways be able to find a
- rx_null cred.)
-
- * xfs/bsd/xfs_vnodeops.c: Define xfs_vop_t for Open|NetBSD for
- typecasting --> getting less errors.
-
- * arlad/fcache.c: Use CRED_ANY when we hit a remote cell,
- and doesn't find a "native" cred.
-
-Sat Feb 21 18:14:47 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/messages.c (xfs_message_symlink): new function
-
- * arlad/inter.c (cm_symlink): new function
-
- * arlad/fcache.c (create_symlink): new function
-
- * xfs/bsd/xfs_vnodeops.c (xfs_symlink): implement
-
- * xfs/bsd/xfs_vnodeops.c (xfs_lookup): more SAVENAME voodoo
- (xfs_remove, xfs_rmdir, xfs_abortop): implement functions
-
- * arlad/messages.c (xfs_message_mkdir, xfs_message_rmdir): new
- functions
-
- * arlad/inter.c (cm_mkdir, cm_rmdir): new functions
-
- * arlad/fcache.c (create_directory, remove_file,
- remove_directory): new files
-
- * arlad/afsdir_check.c: more paranoid tests
-
- * arlad/adir.c: squash some almost fence-post bugs.
-
- * xfs/include/xfs_message.h (xfs_message_remove): added cred
-
- * arlad/afs_dir.h: start using sized types
-
- * arlad/messages.c (xfs_message_create): convert and push down the
- updated directory
-
- * arlad/inter.c (cm_create): create the file in the local cached
- copy of the directory.
-
- * arlad/fbuf.c: re-organized.
- (truncatefilebuffer): new function
-
- * arlad/adir.c (adir_lookup): test to see that `dir' is a
- directory.
- (adir_readdir): dito
- (adir_creat): new function for adding an entry to a directory.
- (aidr_remove): new function for removing an entry from a directory.
-
- * arald/afsdir_check.c: new program
-
-Sat Feb 21 16:00:00 Love Hornquist-Astrand <lha@foo.ksk.sala.se>
-
- * arlad/arla.c, rx/r.c: Added rx-status.
-
-Fri Feb 20 09:32:52 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c: return better error codes than ENODEV (except in
- two cases)
-
-Thu Feb 19 23:17:25 1998 Love Hornquist-Astrand <lha@foo.ksk.sala.se>
-
- * xfs/bsd/xfs_syscalls.c, arlad/messages.c: Added VIOC_GET_WS_CELL.
-
- * xfs/include/xfs_messages.h: Added handle to pioctl msg.
-
-Thu Feb 19 02:47:52 1998 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * xfs/bsd/syscalls.c, arlad/message.c: VIOC_FILE_CELL_NAME.
-
- * xfs/bsd/xfs_vnodeops.c(xfs_mkdir): Send right message and
- save us a panic
-
- * include/kafs.h: Added more pioctl calls.
-
- * appl/vos.c: Added to option to query a specific server in vos exa
- and added options -host, -cell and -noauth.
-
- * arlad/arla.c: begining for sysname in -t mode.
-
- * arlad/cell.c: Ask diffrent vldb-server each time.
-
-Thu Feb 19 06:05:43 1998 Assar Westerlund <assar@sics.se>
-
- * include/kafs.h: added
-
- * arlad/fcache.c: re-wrote
-
- * arlad/volcache.c: re-wrote
-
- * arlad/messages.c (VIOC_AFS_SYSNAME): remove
- (afsstatus2xfs_attr): fix
- (xfs_message_*): updated
-
- * arlad/inter.c (getrights, checkright): commented out, I didn't
- bother to fix them now.
- (cm_lookup): add test for `@sys'
- (cm_remove, cm_link): commented out
-
- * arlad/fbuf.c: remove #undef HAVE_MMAP and make the code compile.
-
- * arlad/conn.c: re-wrote
-
- * arlad/cred.c: re-wrote
-
- * arlad/cmcb.c (RXAFSCB_InitCallBackState): do something
-
- * arlad/cell.c: rename all functions to cell_
- (cell_num2name): new function
- fix fopen format strings
- removed all locks (sorry Love)
-
- * arlad/arla.c: Use `tmpce'
- (arla_{conn,vol,cred,fcache}_status): new functions
-
- * arlad/adir.c (adir_lookup): update to new fcache-interface. use
- CredCacheEntry. don't handle @sys
- (adir_readdir): update to new fcache-interface. use CredCacheEntry
-
- * ydr/output.c: add copyright
- (gen1): make TIN arguments `const'
-
- * xfs/bsd/Makefile.in (CFLAGS): add `-Wno-unused'
-
- * xfs/bsd/xfs_node.c (xfs_attr2vattr): set `va_blocksize' to a
- reasonable value.
-
- * util/hash.c (hashtabnew): check malloc return value at correct
- place.
-
- * arlad/Makefile.in: more includes link with libraries in correct
- order
-
- * makesnap: don't hardcode cvsbin and CVSROOT
-
-Thu Feb 12 01:38:21 1998 Assar Westerlund <assar@sics.se>
-
- * ydr/output.c: include rx.h
-
- * ydr/main.c: does it have to be this hairy to run a simple cpp
- portably?
-
- * xfs/solaris/xfs_node.c (new_xfs_node): use correct set of
- attributes
-
- * xfs/include/xfs_message.h: moved xfs_msg_node and related
- defintions here from xfs/*/xfs/xfs_node.h
-
- * lwp/q.c: renamed {ins,rem}que to lwp_\1
-
- * arlad/irix-subr.c: new file
-
- * aclocal.m4: stolen BASH_CHECK_DEV_FD from bash
-
- * configure.in: Add testing for /dev/fd.
- correct gcc test.
- stub support for irix.
-
-Wed Feb 11 02:18:51 1998 Assar Westerlund <assar@sics.se>
-
- * lib/roken/{snprintf.c,mini_inetd.c,getarg.c}: merged in newer
- code.
-
- * configure.in: moved util and ydr from subdirs to AC_OUTPUT
-
-1998-02-10 Per Andersson <ppan@joker.cntw.com>
-
- * INSTALL: Changed sunos(4) instructions to match current version
-
-Tue Feb 10 02:52:51 1998 Assar Westerlund <assar@sics.se>
-
- * lwp: renamed process.s -> process.S
-
- * aclocal.m4(AC_GROK_TYPE): test for ktypes.h
-
- * xfs/sunos/Makefile.in: rewrote and vpath-ed.
-
- * xfs/sunos: updated to changes elsewhere.
-
- * arlad/arla_local.h: use <dirent.h> xor <sys/dir.h>
-
- * arlad/afs_dir.h: rename PAGESIZE -> AFS_PAGESIZE
-
- * include/bits.c: test for ktypes.h
-
- * configure.in: test for ktypes.h
-
- * include/{bits.c,Makefile.in}: generate atypes.h
-
- * xfs/solaris: new directory
-
- * arlad/solaris-subr.c: new file
-
- * ydr/lex.l: handle more kinds of #-lines
-
- * rxkad/Makefile.in: work-around for stupid solaris make
-
- * rxdef/Makefile.in: remove BSD/GNU-special and use explicit rules
- instead.
-
- * rx/Makefile.in: work-around for stupid solaris make
-
- * lwp/iomgr.c: add <fcntl.h>
-
- * lwp/Makefile.in: more magic for preprocessing and assembling
- process.s
-
- * arlad/sunos-subr.c (fcacheentry2xfsnode, conv_dir): update to
- new signatures
-
- * arlad/conn.c (markasdown): don't initialize `d' in declaration
-
- * Makefile.in: add include to SUBDIRS
-
- * configure.in: replace @CANONICAL_HOST@
- add solaris
- check for -lsocket, -lnsl and -lresolv
- generate Makefile in include
-
-Tue Feb 3 16:16:42 1998 Love Hörnquist-Åstrand <lha@e.kth.se>
-
- * util/hash.c(hashjpw): Some typecasting to save the world.
-
- * lib/roken/snprint.c: Removed #if 0
-
- * configure.in: Added check for gcc and -Wall
-
-Fri Jan 30 19:58:51 1998 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * arlad/{conn.c,fcache.c,volcache.c}: Fixed conn locking.
-
-Wed Jan 28 05:43:44 1998 Artur Grabowski <art@stacken.kth.se>
-
- * Cleaned up most of the warnings in arlad, lwp, rx* and some other
- small things.
-
- * lwp: ANSI-prototypes.
-
- * rx: ANSI-prototypes. Indentation, cleanup
-
-Wed Jan 28 01:00:00 1998 Niklas Hallqvist <nh@stacken.kth.se>
-
- * BSDmake compatibility
-
- * Build from local libsl
-
-Thu Jan 22 22:13:57 1998 Magnus Holmberg <mho@stacken.kth.se>
-
- * xfs/include/xfs_message.h: Argh! Whoever came up with the bright
- idea of having userland xfs_message_receive() and kernel
- xfs_message_receive() have the same name and share the same
- prototype?
-
- * xfs/include/xfs_message.h, configure.in, acconfig.h:
- Gross hack to support both old and new VFS.
-
-Wed Jan 21 12:52:44 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_close): use XFS_{READ,WRITE}
-
- * xfs/bsd/xfs_vnodeops.c (xfs_close): use XFS_{READ,WRITE}.
- always call cm_close, independent of the dirty flag. arlad needs
- to now how many processes have this file open.
-
- * arlad/inter.c(cm_close): use XFS_READ & c:o
-
- * xfs/include/xfs_message.h: introduced flags:
- XFS_{READ,WRITE,...}
-
-Wed Jan 21 03:54:15 1998 Magnus Holmberg <mho@stacken.kth.se>
-
- * xfs/openbsd2.3:
- VFS Lite2 changes.
- Merged from .../xfs/bsd.
- -Wall.
-
-Mon Jan 19 03:30:53 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * arlad/*-subr.c, arlad/messages.c: Merged xfs_attr stuff into messages.c
-
- * Changed linux xfs to use xfs_attr and changed everything to include
- xfs/include/xfs_message.h
-
-Mon Jan 19 04:46:36 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/include/xfs_message.h: add ID. remove old junk
-
- * xfs/include/xfs_attr.h (XA_SET_*): Use correct field name.
- (xfs_file_type): fix typo
-
- * xfs/bsd/xfs_node.c (vattr2xfs_attr, xfs_attr2vattr): new
- functions
-
-Sun Jan 18 12:19:26 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/Makefile.in (MODULE): use `mv -f'
- (unload): correct symbol is `xfs_mod'
-
- * arlad/fcache.c (writefile): don't send the length of data in the
- stream.
-
-Sun Jan 18 23:57:11 1998 Love H-Åstrand <lha@foo.ksk.sala.se>
-
- * xfs/bsd/bin/startarla.in: a startscript, using autoconf.
-
- * xfs/bsd/xfs_dev.c(xfs_devclose): Make sure we dont unmount a
- not mounted filesystem.
-
-Sun Jan 18 12:19:26 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/conn.c (getconnection): restructured. Make all
- unauthenticated connections with cred == 0. Try to add an
- unauthenticated connection at the same time as a authenticated
- one. This is used when receiving and breaking callbacks.
-
- * arlad/conn.h (ConnCacheEntry): add `securityclass'
-
- * xfs/bsd/bin/mount_xfs.c: DTRT with __progname and err*
-
- * xfs/bsd/Makefile.in (unload): use modunload
-
- * arlad/*-subr.c: no need to specify cachedir.
-
- * arlad/fcache.c: allow specification of cachedir
-
- * arlad/arla.c (main): specify cachedir when calling initfcache
-
- * Makefile.in: clean and simplify
-
- * xfs/bsd/xfs_dev.c: use = instead of bcopy
-
-Sun Jan 18 15:14:58 CET 1998 Love H-Åstrand <lha@foo.ksk.sala.se>
-
- * Added configure option --with-arlacachedir
-
-Sun Jan 18 01:20:45 1998 Love H-Åstrand <lha@foo.ksk.sala.se>
-
- * arla/cafe-au-lait.c: Added new file.
-
- * Added target install and made arla/cell.c use prefix for
- CellServDB and ThisCell.
-
- * xfs/bsd/xfs_dev.c(xfs_uninstall_device): Fixed unload bug for
- net|open-bsd
-
- * xfs/bsd/xfs_vfs_ops.c: Fixed kernel panic for net|openbsd,
- it may work now. Tried to fix it for freebsd too.
-
-Thu Jan 15 23:24:52 1998 Magnus Holmberg <mho@stacken.kth.se>
-
- * xfs/openbsd2.3/xfs_vnodeops.c: Fixed arguments to vnode
- functions to match new vfs.
-
-Thu Jan 15 06:10:37 1998 Assar Westerlund <assar@sics.se>
-
- * configure.in: test for symorder. use xfs/bsd
-
- * xfs/bsd: new unified bsd xfs-module
-
-Thu Jan 15 01:14:35 1998 Love Hornquist-Astrand <lha@foo.ksk.sala.se>
-
- * xfs/openbsd/xfs_vnodeops.c: Added use of XFS_ANONYMOUSID when we
- dont have a cred. Setting pag_t.pag to 0 is a bad idea, since we
- use uid when the user doesn't have a pag...
-
-Thu Jan 15 00:52:16 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux/xfs_vfsops.c: Made xfs_put_inode tell arla when an
- inode goes inactive
-
- * arlad/fcache.c: Hopefully more correct locking
-
-Tue Jan 13 23:10:03 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (openfile): changed to return error and fd as
- parameter.
-
- * arlad/Makefile.in: use @LIB_readline@
-
- * configure.in: stolen editline-tests from krb4
-
- * aclocal.m4: stolen AC_FIND_FUNC_NO_LIBS from krb4
-
- * arlad/arla.c: junked lots of old code.
- wrote a new simple command-line mode for `-t'.
-
- * arlad/cmcb.c (RXAFSCB_Probe, RXAFSCB_InitCallBackState,
- RXAFSCB_CallBack): print the IP-address
-
- * arlad/Makefile.in: renamed arla -> arlad.
- link with sl and related libraries
-
- * configure.in: make sure we have a working version of autoconf
- don't create any xfs-makefiles if we have a unsupported OS
-
-1998-01-13 Per Andersson <ppan@joker.cntw.com>
-
- * Arladaemons name changed to 'arlad' in INSTALL
-
-Tue Jan 13 19:23:10 1998 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * Added sl and editline
-
- * Added pag support for net/open-bsd
-
- * Added libroken
-
-Mon Jan 12 23:12:15 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * arlad/messages.c,xfs/{linux,openbsd,freebsd}:
- Moved to pag authentication, added set sysname,
- added set pag in linux
-
-Mon Jan 12 00:59:55 1998 Magnus Ahltorp <magnus@dike.aladdin.se>
-
- * xfs/linux/xfs_syscalls.c: Added set pag.
-
-Sun Jan 11 05:14:44 1998 Assar Westerlund <assar@sics.se>
-
- * rxkad/rxk_crpt.c: resurrect bswap and conditionalize it on
- EFF_NTOHL
-
- * configure.in: use AC_FUNC_NTOHL
-
- * aclocal.m4 (AC_FUNC_NTOHL): new macro
-
- * ydr: added support for the 'multi' keyword
-
-Sun Jan 11 00:19:46 1998 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * xfs/openbsd/xfs_locl.h: Added prototype for xfs_get_pag and
- added som include files (removed those include files all over)
-
- * xfs/openbsd/xfs_vfsops.c: Added the type of fs to the
- mp->mnt_stat struct
-
- * xfs/openbsd/xfs_syscalls.c: Added pag support
-
- * xfs/openbsd/xdeb.h: Added XDEBSYS
-
- * xfs/openbsd/xfs_dev.c(xfs_devclose): Lock the mointpoint when
- freeing the xfsnodes
-
-Sat Jan 10 04:21:31 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/{bsd,linux,sunos}-subr.c (conv_dir): don't ReleaseReadLock
-
- * arlad/fcache.c: allow reuse of the cache files
-
- * arlad/messages.c (xfs_message_getroot): use `cm_getattr'
-
- * arlad/inter.c (cm_getattr): return real_fid as a parameter.
-
- * arla/thash.[ch], arla/vlstr.h: removed.
-
- * ydr/output.c (generate_server_switch): write prototype to header
- file.
-
- * lwp/Makefile.in: add mips/irix
-
- * arlad/volcache.c: clean-up:
- cell -> int32_t
- const-ize
-
- * arlad/ports.c (initports): use the official IANA names and
- enable the code.
-
- * arlad/{linux,sunos,bsd}-subr.c (write_dirent): const-ize
-
- * arlad/conn.c: all cells are int32_t
-
- * arlad/cell.c: all cells are int32_t
-
- * arlad/cmcb.c: clean-up
-
- * arlad/adir.c (afs_lookup): return int. removed old code.
- clean-up.
-
- * lwp/Makefile.in: fix ranlib
-
- * arlad/cell.c: restructured a tiny bit and added some (void)
-
- * arlad/fcache.c (getroot): return error code. changed all callers.
-
- * arlad/kernel.c: `struct fd_set' should be `fd_set'
-
- * include/config.h.in: removed
-
- * xfs/openbsd2.3/xfs_vfsops.c (xfs_mount): replaced VOP_UNLOCK by
- vput
-
- * xfs/openbsd/xfs_vfsops.c (xfs_mount): do vput instead of
- VOP_UNLOCK.
-
-Fri Jan 9 21:32:54 1998 Assar Westerlund <assar@sics.se>
-
- * configure.in: test for header files used by fs
-
-Fri Jan 9 20:55:05 1998 Robert Burgess <rb@bobby.stacken.kth.se>
-
- * appl/fs.{c,h}: added
-
-Fri Jan 9 18:29:28 1998 Assar Westerlund <assar@sics.se>
-
- * xfs/*/xfs/xfs_node.h: define xfs_attr
-
- * xfs/linux/xfs/attr.h: xfs_attr must be a type and not a struct.
-
- * bin/umount_xfs.c: does not work. replaced with the
- openbsd-version.
-
- * arlad/kernel.c: new file with generic kernel interface code.
-
- * arlad/{bsd,sunos,linux}-subr.c: OS-specific functions
-
- * arlad/messages.c: new file with the generic message code.
-
- * conf/CellServDB: A recent version.
-
-Fri Jan 9 17:23:08 1998 Love H-Astrand <lha@ksk.sala.se>
-
- * Added milko/aefs: Added Äckligt fs, and cleaned up
-
- * configure: Removed
-
-Fri Jan 9 17:25:21 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * arlad/linux-messages.c: getattr and creds fixed
-
-Fri Jan 9 13:53:50 1998 Artur Grabowski <art@squit.stacken.kth.se>
-
- * xfs/openbsd: cleanup
-
- * xfs/openbsd: add flags to free_all_xfs_nodes to allow forced unmount
-
-Fri Jan 9 12:17:20 1998 Artur Grabowski <art@squit.stacken.kth.se>
-
- * Made the definite move of mount_xfs and other binaries into
- xfs/@sys/bin
-
-Fri Jan 9 05:23:13 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * arlad/adir.c: Moved pointer dereference to after initialization
- of the pointer
-
-1998-01-08 Per Andersson <ppan@joker.cntw.com>
-
- * Added very preliminary installation instructions in ./INSTALL
-
-Thu Jan 8 11:05:40 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * arlad/fbuf.c: Truncate file before close
-
- * arlad/inter.c, arlad/fcache.c: Made cm_lookup handle EACCES
-
-Thu Jan 8 03:28:55 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c: changed getfile and getattr to return an error
- code. fixed all callers.
-
- * lwp/preempt.c: ifdef SA_NODEFER
-
- * ydr/lex.l: always print error messages with `error_message'.
- use global `filename'.
- be careful when setting `filename' from cpp-lines
-
- * ydr/types.h: add TINOUT
-
- * ydr/parse.y: add INOUT and int
-
- * ydr/output.c (encode_symbol): add default catch-all.
- add handling of INOUT.
- rename `result' -> `_result'
-
- * ydr/lex.l: add INOUT
-
- * rxdef/Makefile.in (CLIENTLIB, SERVERLIB): run ranlib.
- (clean): remove more files.
-
- * rx/rx_queue.h: renamed _Q() to _RX_QUEUE(): it conflicts with _Q
- from <ctype.h>
-
- * configure, include/config.h.in: regenerated
-
- * configure.in: remove rxgen
-
- * rxdef/Makefile.in: add more file types to ydr rule
-
- * lwp/preempt.c, lwp/iomgr.c: use RETSIGTYPE
-
- * arlad/volcache.c: use `u_int32_t' for volumes.
-
- * arlad/fcache.c (writefile): fix sprintf call.
-
- * configure.in: add AC_TYPE_SIGNAL
-
- * arlad/msg.c: removed
-
-Wed Jan 7 19:54:57 1998 Love H-Astrand <lha@ksk.sala.se>
-
- * arlad/*.xg, arlad/common.h: Removed them, then live in rxdef/ now
-
-Wed Jan 7 10:00:25 1998 Magnus Ahltorp <magnus@dike.aladdin.se>
-
- * xfs/linux/Makefile: removed
-
- * xfs/linux/Makefile.in: Added
-
-Wed Jan 7 07:40:02 1998 Artur Grabowski <art@squit.stacken.kth.se>
-
- * xfs: mount_xfs and umount_xfs moved from openbsd to xfs/bin
-
- * xfs/bin: new mount_xfs with argument parsing and correct syntax
-
-Wed Jan 7 05:31:16 1998 Artur Grabowski <art@squit.stacken.kth.se>
-
- * xfs/openbsd/mount_xfs.c: mount_xfs mow mounts with fstype "xfs"
- and not from command-line
-
-Tue Jan 6 07:03:38 1998 Artur Grabowski <art@squit.stacken.kth.se>
-
- * appl/vos.c: new command-interface for vos
-
-Tue Jan 6 05:22:13 1998 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * arlad/inter.c(cm_setattr): Using error from writeattr()
-
- * arlad/fcache.c(writeattr): Using the error we got back from
- RXAFSStoreStatus()
-
- * xfs/openbsd/Makefile.in: Added -e to modload
-
-Tue Jan 6 05:06:40 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * arlad/adir.c: Added @sys support
-
- * arlad/linux-messages.c: Added putdata, putattr, create,
- pioctl. Cleaned up a lot.
-
- * xfs/linux/xfs_syscalls.c: First real version
-
- * xfs/linux/xfs_inodeops.c: Added open, read, readdir, readlink,
- followlink
-
- * xfs/linux/xfs_dev.c: Added xfs_message_wakeup_data
-
-Tue Jan 6 04:16:53 1998 Artur Grabowski <art@squit.stacken.kth.se>
-
- * fixed xfs/openbsd/umount_xfs and compilation problems with mount
- and umount
-
-Mon Jan 5 17:30:41 1998 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * xfs/openbsd/mod.c: Dont need the diffence between net and open,
- use modload -e
-
- * arlad/fcache.c: Fixed bug that made arla write the old length of
- the file
-
- * xfs/openbsd/xfs_node.c: Fixed long filename, and added a one
- entry cache for them.
-
- * xfs/openbsd/xfs_dev.c: Added some really ugly workarounds for
- differences between *BSD
-
-Mon Jan 5 05:10:41 1998 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * xfs/openbsd/mount_xfs.c: More errorchecking and removed compat
- junk
-
-Sun Jan 4 22:30:37 1998 Love Hörnquist-Åstrand <lha@stacken.kth.se>
-
- * */*/*: Removed all (?) reference to u_long cred and started to
- use pag_t cred. Dont know how much vill break.
-
- * xfs/openbsd/xfs/xfs_message.h: added xfs_cred and pag_t
-
-Sat Jan 3 21:51:56 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux/xfs_syscalls.c: Added
-
- * xfs/linux/xfs_inodeops.c: Released inode after use
-
-Sat Jan 3 20:24:37 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux/xfs_cache.c: Added
-
- * xfs/linux/xfs_node.c: Added cache purging in
- free_all_xfs_nodes()
-
- * xfs/linux/xfs_common.h: Cleaned up and changed syntax for xfs_free
-
- * xfs/linux/xfs_common.c, xfs/linux/xfs_dev.c,
- xfs/linux/xfs_node.c: Changed syntax for xfs_free
-
- * xfs/linux/xfs_inodeops.c, xfs/linux/xfs_message.c: Changed to xfs_cache
-
- * xfs/linux/xfs_vfsops.c: Added xfs_put_inode
-
-Sat Jan 3 08:37:08 1998 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * arlad/bsd-messages.c(xfs_message_create): New function
-
- * arlad/inter.c(cm_close): Fixed flags semantics
-
- * arlad/fcache.c(writefile): Fix AFSStoreStatus mask
-
- * xfs/openbsd/xfs/xfs_message.h: Added flag to struct
- xfs_message_putdata, so we know what to do.
-
- * arlad/bsd-messages.c: Implemented xfs_message_putdata()
-
- * xfs/openbsd/xfs_vnodeops.c(xfs_close, xfs_fsync): Added writesupport
-
-Sat Jan 3 05:27:51 1998 Assar Westerlund <assar@sics.se>
-
- * xfs_message.c: merge in changes from ../openbsd
-
- * xfs_vnodeops.c (xfs_read): panic if cache vnode == NULL
-
- * arlad/bsd-messages.c (xfs_message_getnode,xfs_message_getattr):
- mask XFS_DATA_MASK from `msg.node.tokens'
-
-Sat Jan 3 00:55:46 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * arlad/inter.c: Changed cm_getattr to check for the correct rights
-
- * xfs/linux/xfs_inodeops.c: Fixed return value from xfs_lookup
-
-Fri Jan 2 23:34:22 1998 Love Hörnquist-Åstrand <e96_lho@e.kth.se>
-
- * xfs/openbsd/xfs_message.c(xfs_message_invalidnode): Fixed tokens
- in xfsnode
-
-Fri Jan 2 20:46:03 1998 Assar Westerlund <assar@sics.se>
-
- * xfs_vnodeops.c: mrege in changes from ../openbsd
-
- * arlad/bsd-messages.c (vattr2afsstorestatus): remove mask
-
-Fri Jan 2 20:47:20 1998 Love Hörnquist-Åstrand <e96_lho@e.kth.se>
-
- * xfs/openbsd/xfs_vnodeops.c: Fixed xfs_write()
-
- * arlad/bsd-messages.c: Added vattr2afsstorestatus() and cleaned up
-
- * arlad/arla_local.h: Added vattr2afsstorestatus() defines
-
-Fri Jan 2 12:47:20 1998 Love Hörnquist-Åstrand <e96_lho@e.kth.se>
-
- * xfs/openbsd/xfs_vnodeops.c: putattr support working when ATTR
- not opened RW
-
- * arlad/inter.c (cm_setattr): Return error message if writeattr fail
-
- * arlad/fcache.h: Fixed writeattr call
-
- * arlad/fcache.c: Adding support for chmod
-
- * arlad/arla_local.h: Added {fs,vldb}.cs.c to get prototypes,
- and fixed the error that was discoved
-
-Fri Jan 2 04:27:06 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/cmcb.c (RXAFSCB_CallBack): handle the case of there not
- being enough callbacks.
-
-Fri Jan 2 03:42:43 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * arlad/linux-messages.c: Made getnode and getroot work
-
- * xfs/linux/xfs_inodeops.c: Added xfs_lookup
-
- * xfs/linux/xfs_message.c: Fixed inode number bug
-
-Thu Jan 1 22:53:15 1998 Assar Westerlund <assar@sics.se>
-
- * rx/Makefile.in: removed all xdr*
-
- * rx/rx_misc.c: remove xdr.h and use malloc/free instead of
- mem_alloc/mem_free
-
- * ydr/Makefile.in: bsd-make compatible
-
-Thu Jan 1 19:13:40 1998 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux/xfs_dev.c: Fixed some inits.
-
-Thu Jan 1 17:31:08 1998 Assar Westerlund <assar@sics.se>
-
- * arlad/arla.c (main): fix call to conv_dir
-
-Wed Dec 31 18:17:15 1997 Love H-Astrand <lha@ksk.sala.se>
-
- * milko/ss2fs/file.c: Bugfixes, not done
-
- * milko/mutil/dirpage.c: Moved to here
-
- * milko/mutil/fdrxop.c: Added file
-
-Wed Dec 31 13:11:01 1997 Love H-Astrand <lha@ksk.sala.se>
-
- * milko/ss2fs/ss2dir.c: Added file
-
-Wed Dec 31 00:30:07 1997 Assar Westerlund <assar@sics.se>
-
- * xfs/xfs_message.h (xfs_message_wakeup_data): added
-
- * xfs_dev.c (xfs_message_wakeup_data): copied from ../openbsd
-
- * Makefile.in: removed duplicate ydr
-
- * rx/rx_pkt.c (rxi_ReadPcket): use a sensible length test.
-
- * rx/rx_null.h: prototypize
- rxnull_New{Server,Client}SecurityObject
-
- * xfs/xfs_message.h (xfs_message_pioctl): add `outsize' add some
- prototypes
-
- * arlad/cred.h: only include <des.h> and <krb.h> iff KERBEROS
-
- * arlad/conn.c (getconnection): ifdef KERBEROS for krbdata
-
- * arlad/bsd-messages.c (xfs_message_pioctl): (VIOCSETTOK,
- VIOCUNLOG): ifdef KERBEROS
-
- * arlad/arla.c (get_cred): ifdef KERBEROS.
-
- * arlad/Makefile.in: use autoconf'd RXKAD_LIBS
-
- * configure.in: set RXKAD_LIBS
-
- * util/fnameutil.c (dirname): return "." for local files.
-
- * ydr/output.c (init_generate): include the same set of headers in
- all generated .c-files.
-
- * lwp/Makefile.in: separate cpu vs OS definitions
-
-Tue Dec 30 22:08:55 1997 Magnus Ahltorp <map@lroken.stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c: Added
-
- * xfs/linux/xfs_node.c: Inode values now based on xfs_node
- pointer. Some more functions ported.
-
- * xfs/linux/xfs_message.c: Initial linux port
-
-Tue Dec 30 21:11:01 1997 Love H-Astrand <lha@ksk.sala.se>
-
- * milko/ss2fs/file.c: Added even more junk
-
- * rxdef/Makefile.in: Removed that common.h link, using -I
-
-Mon Dec 29 17:23:25 1997 Assar Westerlund <assar@sics.se>
-
- * util/fnameutil.c (dirname): new function
-
-Fri Dec 26 22:54:12 1997 Love H-Astrand <lha@ksk.sala.se>
-
- * configure.in: Added ufs01fs & co
-
- * milko/ss2fs: Added
-
- * milko/ufs01fs: Added
-
- * milko: Cleaned up and started to migrate in ss2fs
-
-Wed Dec 24 03:25:51 1997 Magnus Ahltorp <map@hefaistos.abc.se>
-
- * xfs/linux: Added nfs like allocation of inodes
-
- * xfs/linux/xfs/attr.h, arlad/linux-messages.c: Added xfs_attr
-
-Mon Dec 22 12:38:26 1997 Love H-Astrand <lha@ksk.sala.se>
-
- * ydr/lex.l: We now recognise {u_,}int{16,32}_t
-
-Sun Dec 21 10:30:42 1997 Love H-Astrand <lha@ksk.sala.se>
-
- * Makefile.in: Added rxdef
-
-Fri Dec 19 05:08:24 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * xfs/openbsd/xfs_dev.c: Added wakedup_data function in xfs end
-
- * arlad/fcache.c: Added sysname
-
- * xfs/openbsd/xfs/xfs_message.h: Added wakedup_data function and
- struct
-
- * xfs/openbsd/xfs_syscalls.c: Started adding of sysname
-
- * arlad/volcache.c: Added VOLCACHEADDDYNAMIC
-
-Wed Dec 17 08:39:02 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * TODO: Fixed getcwd() ?
-
- * arlad/bsd-messages.c: Added error checking and fixed error msg
-
- * arlad/arla_local.h: Added debuggingmacro
-
- * Makefile.in: Changed to ydr
-
- * arlad/fcache.c: getcwd & ydr
-
- * arlad/bsd-messages.c: Working pwd, there is still bugs in
- there...
-
-1997-12-10 Love Hornquist-Astrand <lha@foo.ksk.sala.se>
-
- * arlad/inter.c: Made tokens support more sane
-
- * xfs/openbsd/*: Added support for NetBSD
-
-Tue Dec 9 03:38:52 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * arlad/inter.c: cm_open(): Not quite ready yet.
-
- * arlad/inter.c: Added test för datausedp;
-
-Mon Dec 8 20:52:09 1997 Assar Westerlund <assar@sics.se>
-
- * arlad/bsd-messages.c (afsstatus2vattr): use VNOVAL
- (xfs_message_getnode): cleanup
-
- * configure.in: test for more header files.
-
- * ydr: new version.
-
-Thu Dec 4 14:51:05 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * TODO: Added vos and rxdef
-
-Sat Nov 29 02:18:57 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * appl/vos.c: listvol does not work, yet
-
- * appl/vos.c: Almost working, just lacking CellServDB parsing
-
- * appl/arlalib.c: Added more junk
-
-Fri Nov 28 17:00:17 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * appl/vos.c: More working code
-
- * appl/arlalib.c: First version
-
-Tue Nov 25 20:45:20 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * rxgen/main.c: Fixed configure test for CPP
-
-Wed Nov 19 13:03:58 1997 Love Hornquist-Astrand <lha@foo.ksk.sala.se>
-
- * milko/dirpage.c: Added
-
- * milko/inodedb.c: Added
-
- * milko/diskio.c: Made more usable
-
-Tue Nov 18 23:54:11 1997 Magnus Ahltorp <map@stacken.kth.se>
-
- * configure.in: Fixed bug that turned off kerberos default
-
-Tue Nov 18 06:13:17 1997 Magnus Ahltorp <map@stacken.kth.se>
-
- * Added support for different include and lib paths in kerberos.
- Clean up configure.
-
-Sat Nov 15 15:31:24 1997 Love H-Astrand <lha@jenny.ksk.sala.se>
-
- * lwp/lwp.c: Added support for posix signals, added RCSID()
-
- * lwp/preempt.c: Added support for posix signals
-
- * lwp/lwp.h: Added check for posix-signals
-
- * acconfig.h: Added check for posix-signals
-
- * configure.in: Added check for sys/ioccom.h
-
- * arla/Makefile.in: Added @CFLAGS@
-
-Sat Nov 15 11:41:33 1997 Magnus Ahltorp <map@stacken.kth.se>
-
- * configure.in, Makefile.in: Added support for conditional
- build of rxkad
-
-Fri Nov 14 09:36:20 1997 Magnus Ahltorp <map@stacken.kth.se>
-
- * configure.in: Cleaned up and added messages
-
-Fri Nov 14 08:54:26 1997 Magnus Ahltorp <map@stacken.kth.se>
-
- * configure.in: Added support for --with-krb4.
-
- * acconfig.h: Removed superfluous #define KERBEROS
-
-Thu Nov 13 05:42:30 1997 Artur Grabowski <art@stacken.kth.se>
-
- * xfs/openbsd/xfs_node.c: Fixed the removing of vnodes from the
- list of all vnodes in the fs. :)
-
-Wed Nov 12 22:00:28 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * arlad/volcache.c: Added gc
-
-Wed Nov 12 04:40:46 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * arlad/conn.c: Added gc
-
- * arlad/bsd-messages.c: Added check for invalid rpc calls
-
- * arlad/cred.c: Made a cred_remove() remove all connection in the
- connection cache too.
-
- * arlad/bsd-messages.c: Cleaned up the code.
-
- * arlad/conn.c: Added support to remove a connection from the
- connection cache, we still dont gc.
-
- * util/hash.c: Added hashtabcleantab()
-
-Mon Nov 10 01:11:38 1997 Assar Westerlund <assar@sics.se>
-
- * added lots of copyrights.
-
- * lib/rxkad: updated
-
- * acconfig.h: -DKERBEROS
-
- * xfs/freebsd/xfs/xfs_message.h: added pioctl
-
-Sun Nov 9 19:16:25 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * arlad/cred.h: Cleanup, added support to clean tokens based on
- uid.
-
- * xfs/openbsd/xfs_syscalls.c: Added support for VIOCUNLOG
-
- * xfs/openbsd/xfs/xfs_message.h: Added uid to struct
- xfs_message_pioctl, in some magic way we should support PAGs too.
-
- * arlad/bsd-messages.c: Added support for VIOCUNLOG
-
-Sun Nov 9 17:25:27 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * xfs/openbsd/xfs/xfs_message.h: Added xfs_message_pioctl
-
- * xfs/openbsd/kafs.h: Added
-
- * xfs/openbsd/xfs_syscalls.c: Added VIOCSETTOK
-
- * arlad/bsd-messages.c: Working cred
-
-Sat Nov 8 19:58:46 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * arlad/cred.c: Added putkrb4cred()
-
-Fri Nov 7 20:57:09 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * rx/rx_user.c: Removed rx warning messages
-
- * arlad/conn.c: After 24h hacking, working rxkad !
-
-Thu Nov 6 22:28:33 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * arlad/arla.c: Added kerberos support, not working, yet.
-
- * arlad/Makefile.in: Added support for rxkad, assume krb4 world
-
- * Makefile.in: Added rxkad
-
- * arlad/cred.h: Fixed.
-
- * arlad/cred.c: Fixed some more
-
-Thu Nov 6 18:05:59 1997 Artur Grabowski <art@bobby.stacken.kth.se>
-
- * arlad/bsd-kernel.c: fixed exit on error from device.
-
-Thu Nov 6 17:34:27 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * arlad/arla.c: Init credcache
-
- * arlad/conn.c: Added support for rxkad
-
-Thu Nov 6 17:34:27 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * arlad/cred.h: Made it buildable and spell checked.
-
- * arlad/cred.c: Made it buildable.
-
-Thu Nov 6 17:31:09 1997 Artur Grabowski <art@bobby.stacken.kth.se>
-
- * xfs/openbsd/xfs_vfsops.c: fixed the releasing of vnodes.
-
- * xfs/openbsd/xfs_vnodeops.c: cleaned up.
-
- * Learned to use ChangeLog. (hopefully)
-
-Thu Nov 6 02:38:20 1997 Love Hornquist-Astrand <lha@foo.ksk.sala.se>
-
- * arlad/cred.h: Added
-
- * arlad/cred.c: Added
-
- * milko/diskio.c: Started to read the inode instead of makeing up data.
-
- * milko/build_a_inode.c: more features
-
-Tue Nov 4 03:03:03 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * rxkad/*.[ch]: s/int32/int32_t/g
-
- * configure.in: Added some more tests.
-
- * rxkad/Makefile.in: Living in a krb4 work, assar will shot me.
-
- * aclocal.m4: Added checks for types (int32 & co)
-
-Sun Nov 2 17:24:22 1997 Assar Westerlund <assar@sics.se>
-
- * xfs_vnodeops.c (xfs_data_valid): set `msg.tokens'
- (xfs_lookup): copy name to `msg' correctly
-
- * xfs_vfsops.c (xfs_root): set `msg.cred'
-
- * xfs_node.c (free_xfs_node): reset data
-
- * xfs_message.c (xfs_message_installdata): unlock the cache vnode
- after lookup
-
- * xfs_dev.c (xfs_message_rpc): copy back from temporary memory to
- `message'
-
- * arlad/inter.c (cm_open): set enty->tokens correctly
-
- * arlad/Makefile.in: use `test -h' instead of `test -L'
-
-Sat Nov 1 02:06:18 1997 Love H-Astrand <lha@ksk.sala.se>
-
- * arlad/Makefile.in: Fixed so we can build in another directory
- then src
-
- * aclocal.m4: Added
-
-Thu Oct 30 01:46:51 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * configure.in: Fixed linux include stuff
-
- * arlad/linux*: Added linux specific files
-
- * configure.in: Added milko.
-
- * milko/Makefile.in: Fixed for merging into arla-tree
-
-Wed Oct 29 22:52:15 1997 Assar Westerlund <assar@sics.se>
-
- * arlad/volcache.c (findvolname, findvolid): check for getvolname
- returning an error
-
-Sun Oct 26 17:59:11 1997 Magnus Ahltorp <map@wakko.stacken.kth.se>
-
- * xfs/linux/xfs_common.c: Linuxified
-
-Sat Oct 25 19:01:45 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * lwp/lwp.c: Ansified
-
- * lwp/iomgr.c: Ansified
-
-Sat Oct 25 17:05:21 1997 Assar Westerlund <assar@sics.se>
-
- * xfs/freebsd: use mp->mnt_vnodelist instead of xfsp->nodes
-
- * xfs/freebsd/Makefile.in: new autoconf'ed makefile
-
-Sat Oct 25 15:53:31 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * lwp/Makefile.in: Grrrr gcc -E är dum.
-
- * Makefile.in: Added rx and rxgenbuilding
-
- * lwp/Makefine.in: Added support for multippel processors
-
-Sat Oct 25 15:48:38 1997 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs: new files
-
-Sat Oct 25 14:23:45 1997 Love Hornquist-Astrand <lha@stacken.kth.se>
-
- * configure.in: Removed some configure.in's
-
-Sat Oct 25 14:15:11 1997 Magnus Ahltorp <map@wakko.stacken.kth.se>
-
- * xfs/linux/xfs_dev.c: Merged in the real file and adopted it to
- Linux
-
-Sat Oct 25 05:46:29 1997 Magnus Ahltorp <map@stacken.kth.se>
-
- * xfs/linux/xfs_dev.c: Moved device stuff here
-
- * xfs/linux/super.c: Working filesystem
-
-Fri Oct 24 18:33:36 1997 Magnus Ahltorp <map@stacken.kth.se>
-
- * xfs/linux/super.c: Almost working empty filesystem.
-
-Fri Oct 24 17:20:40 1997 Assar Westerlund <assar@sics.se>
-
- * rx/Makefile.in: replaced junk makefile with a new one
-
- * arlad/Makefile.in: much clean-up and improvements
-
- * Makefile.in: much clean-up and improvements
-
- * configure.in: much clean-up and improvements
-
- * xfs/Makefile.in: stub makefile
-
- * lib/util/ip.[ch]: resurrected
-
- * lib/lwp/q.c: resurrected
-
-
diff --git a/usr.sbin/afs/src/ChangeLog.2000 b/usr.sbin/afs/src/ChangeLog.2000
deleted file mode 100644
index 4f2b33b0484..00000000000
--- a/usr.sbin/afs/src/ChangeLog.2000
+++ /dev/null
@@ -1,2972 +0,0 @@
-2000-12-31 Assar Westerlund <assar@sics.se>
-
- * configure.in: do not include <sys/vnode_if.h>, it gets included
- by <vnode.h> and may not reside in <sys/>
-
-2000-12-30 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/linux/xfs_inodeops.c: Rewrote xfs_lookup to make use of the
- 2.2.8 interface. Now xfs_lookup returns the dentry, which suits us
- much better.
-
- * xfs/bsd/xfs_syscalls-common.c: Don't allow fhget/fhopen when
- compiling for Darwin. fhget/fhopen leaks vnodes when used on
- Darwin.
-
-2000-12-29 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_inodeops.c: clarify some printk messages
-
-2000-12-23 Love <lha@stacken.kth.se>
-
- * conf/CellServDB (zepa.net): added first cell w/o hosts
-
-2000-12-21 Love <lha@stacken.kth.se>
-
- * configure.in: check for res_init()
- * lib/ko/kocell.c (cell_init): call res_init() to initialize the
- resolver.
-
- * lib/ko/Makefile.in: change the way $(LIBS) is used
- * include/Makefile.in: added @LIBS@ to program built locally
-
-2000-12-21 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_putpages): make it build on
- NetBSD-current
- * configure.in: test for putpages.sync to differentiate between
- NetBSD and FreeBSD putpages
-
-2000-12-18 Assar Westerlund <assar@sics.se>
-
- * appl/vos/*.c: do not call inet_ntop when getnameinfo fails, just
- set a constant string
-
- * tests/mmap-and-read.c (main): remove extra print to make it
- consitent with all the other tests
-
-2000-12-15 Assar Westerlund <assar@sics.se>
-
- * appl/vos/vos_examine.c (printvolstat): only set `sin_len' if
- there's such a field
- * appl/vos/vos_syncsite.c (vos_syncsite): only set `sin_len' if
- there's such a field
- * appl/vos/vos_vldbexamine.c (printvolstat): only set `sin_len' if
- there's such a field
-
-2000-12-12 Love <lha@stacken.kth.se>
-
- * appl/vos/*.c: fix getaddrinfo calls, print numeric address in
- case we fail
-
-2000-12-11 Love <lha@stacken.kth.se>
-
- * xfs/linux/xfs/xfs_locl.h: added list_for_each
- * doc/*: improvements
-
-2000-12-07 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs/xfs_locl.h: use nline instead of __inline for
- consistency
-
-2000-12-04 Love <lha@stacken.kth.se>
-
- * arlad/arla-cli.c (print_dir_long): check it we followed a
- mountpoint to ourself, in that case, bail out.
-
-2000-12-01 Love <lha@stacken.kth.se>
-
- * doc/*: improve text, add text, improve indices, spellcheck
-
-2000-11-29 Love <lha@stacken.kth.se>
-
- * arlad/inter.c (potential_update_dir): change to it take a child
- entry and a parent to make sure we don't deadlock when trying to
- lock the parent.
- (cm_rename): when moving the child entry between directories, make
- sure we update the child's parent. Pass down the child and the new
- parent to potential_update_dir
-
-2000-11-28 Love <lha@stacken.kth.se>
-
- * arlad/arla-cli.c: rename the consistency checking function
- * arlad/arla.c: rename the consistency checking function
- * arlad/arla_local.h: rename the consistency checking function
- * arlad/arlad.c: rename the consistency checking function
- * arlad/cmcb.c: rename the consistency checking function
- * arlad/fcache.c (*): rename the consistency checking function
- (get_root_of_volume): if we are found ourself when following a
- mountpoint, just return
- * arlad/inter.c (*): rename the consistency checking function
- (cm_symlink): check if the symlink points to ourself, then don' chase
- it it since then we'll deadlock
- * arlad/inter.h: rename the consistency checking function
-
-2000-11-27 Love <lha@stacken.kth.se>
-
- * appl/pts/pts.c (dump_cmd,dump_1): remove the need to give a host
-
-2000-11-26 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (fs_downp): replace with host_downp()
- (*): replace a occurrences of fs_downp with host_downp(); instead of
- checking the return value is RX_CALL_DEAD, use host_downp() to see
- it the error is from a `dead' fileserver; also, replace all
- RX_CALL_DEAD with ARLA_CALL_DEAD.
-
- * arlad/fs_errors.h: translate Rx errors to ARLA_ equivalent
-
- * arlad/conn.h (host_downp): new
- * arlad/conn.c (host_downp): return True is the error means that
- the host is down
-
- * rx/rx.h (RX_{MIN,MAX}_ERROR): minimum and maximum rx error
- values
-
-2000-11-25 Love <lha@stacken.kth.se>
-
- * ydr/output.c: try to use some more int32_t as return values
-
- * rx/rx.c (rxi_SendCallAbort, rxi_SendConnectionAbort): don't send
- a long, send a int32_t
-
-2000-11-25 Marcus Sundberg <mackan@stacken.kth.se>
-
- * xfs/linux/bin/Makefile.in: sed -e 'expr ; expr' doesn't work with
- older GNU sed, do it the old fashioned way instead.
-
-2000-11-25 Love <lha@stacken.kth.se>
-
- * doc/*.texi: reorganized the text, added index, and detailed nodes
- * doc/afs-basics.texi: some more text about fs and vldb relations
- * doc/real-world.texi: some real world problems
-
- * arlad/fcache.c (cleaner): check if entry is locked before trying
- to clean it out, lock node before unlinking it from the lru
-
- * xfs/linux/xfs_node.c (xfs_node_users): use xfs_dcount
- * xfs/linux/xfs/xfs_locl.h (xfs_dcount): added
-
- * xfs/linux/xfs_load.c (init_module): make devfs_register work for
- 2.4, patch from Chris Kuklewicz <chrisk@MIT.EDU>
-
-2000-11-23 Love <lha@stacken.kth.se>
-
- * arlad/dynroot.c (dynroot_get_node): use
- fcache_mark_as_mountpoint() to mark the symlinks as mountpoints.
- * arlad/fcache.c (fcache_mark_as_mountpoint): new function
- (update_entry): use fcache_mark_as_mountpoint
- * arlad/fcache.h (fcache_mark_as_mountpoint): prototype
-
- * lib/ko/kocell.c (readcellservdb): reset dbserver when creating a
- new cell, otherwise new cell might get the previous cell's
- hostinformation.
- (readdb): set timeout to 0, since this is static information
-
-2000-11-16 Love <lha@stacken.kth.se>
-
- * xfs/linux/xfs_message.c (xfs_invalid_node): break out node
- counting stuff to xfs_node_users
- * xfs/linux/xfs_node.c (xfs_node_users): new function, return
- number of users
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_inactive_common): is stale,
- reclaim at once.
- * xfs/bsd/xfs_message.c (xfs_message_invalidnode): is data is
- used, make it as stale
- * xfs/linux/xfs_node.c (free_all_xfs_nodes): call
- xfs_force_invalid_xnode instead of xfs_invalid_xnode
- * xfs/linux/xfs_inodeops.c: s,xfs_iread,xfs_icount,
- * xfs/linux/xfs_message.c (xfs_force_invalid_xnode): break out
- parts of xfs_invalid_xnode
- (xfs_invalid_node): mark node as stale if there is users left
- * xfs/linux/xfs_vfsops.c (xfs_notify_change): clear attributes
- before rpc
- (xfs_put_inode): if data is stale and this is the last user, flush data
- * xfs/linux/xfs/xfs_locl.h (xfs_icount): rename xfs_iread
- (xfs_iwritecount): add
- * xfs/linux/xfs/xfs_fs.h (xfs_force_invalid_xnode): add new
- function
-
-2000-11-15 Love <lha@stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_setattr): clear attr token before
- rpc, not after
-
- * appl/lib/arlalib.c (arlalib_try_next_db): try next db-server on
- RX_CALL_DEAD
-
- * xfs/linux/xfs_inodeops.c (xfs_lookup): wrap errno in ERR_PTR
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_unlock): don't print internal
- structure of v_interlock
-
- * util/log.c: make it pass the regression test
- * util/util-tester.c: add :notime, renumber, add "all" target, and
- print "all" and "-all"
-
-2000-11-14 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c: revert 1.301->1.300 until I have a brain (it
- should sleep now) to write this code more beatuify and at the same
- time working.
-
-2000-11-07 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (read_data): remove bogus assert, data can have
- changed inbetween fetchstatus and fetchdata
-
-2000-11-04 Love <lha@stacken.kth.se>
-
- * xfs/solaris/xfs_vnodeops.c: implement xfs_getpage, xfs_putpage,
- xfs_delmap and xfs_addmap modify xfs_map to do the page handling
- itself.
-
-2000-11-03 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c: make all loop-over-all-file-servers simpler and
- more uniform
-
-2000-11-03 Love <lha@stacken.kth.se>
-
- * rxdef/common.h: CALLBACK_VERSION is the current version of the
- callback
-
-2000-11-02 Love <lha@stacken.kth.se>
-
- * arlad/.gdbinit: add some volcache debugging stuff
-
-2000-11-02 Assar Westerlund <assar@sics.se>
-
- * configure.in: remove unused vfs* tests
- * xfs/bsd/bin/mount_locl.h: remove unused MOUNT_XFS stuff
- * xfs/bsd/bin/mount_xfs.c: always mount filesystem by name, except
- on OSF. remove all code for auto-loading.
-
-2000-10-31 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_createvobject,
- xfs_destroyvobject, xfs_getvobject): add new methods, needed for
- FreeBSD-5-current
-
- * cf/bsd-func-suser.m4: add <sys/systm.h>
- * xfs/bsd/xfs_dev-bsd.c (__FreeBSD__) xfs_dev: conditionalize
- d_bmaj
- * configure.in: test for cdevsw.d_bmaj
-
- * util/log.c (log_open_syslog): add LOG_NDELAY per default,
- otherwise program that do chroot may fail to open the syslog
- socket later
-
-2000-10-28 Love <lha@stacken.kth.se>
-
- * Release 0.34.6, see the branch for relevant patches
-
- * xfs/solaris/xfs_vnodeops.c (xfs_map): add debugging statement
- that show is a program mmap:s of the end of a file. Add add gross
- hack that flush all mmaped files to server if they are mmap R/W
- XXX.
- (*): indent
-
-2000-10-27 Love <lha@stacken.kth.se>
-
- * arlad/solaris-subr.c (write_dirent): use strcpy to copy name and
- check size of reclen so it isn't larger then blocksize.
- * arlad/inter.c (cm_lookup): if we are looking up . make sure we
- don't set `res' to value of parent
-
-2000-10-26 Love <lha@stacken.kth.se>
-
- * xfs/solaris/xfs_message.c (xfs_message_installnode): avoid
- holding node mutex when doing VN_RELE() since that might cause a
- VOP_INACTIVE if the node happend to fall out of the dnlc
-
-2000-10-25 Love <lha@stacken.kth.se>
-
- * arlad/inter.c (cm_lookup): try avoid doing bulkstat when doing
- lookup on .
-
- * xfs/solaris/xfs_message.c (xfs_message_installdata): HOLD the
- vnode when doing a dnlc_purge_vp since it might not be used, and
- that will result in a VOP_INACTIVE and recusive mutex enter panic
- in xfs_inactive.
-
- * xfs/solaris/xfs_message.c (xfs_message_installdata): make the
- lookup by path code work again, ident
-
- * arlad/solaris-subr.c: (write_dirent): DTRT re the size of the
- name, don't do sizeof() when you mean strlen.
-
- * **/Makefile.in: make distclean target consistent
-
-2000-10-24 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/fcache.c: Assert return value from listadd*
-
-2000-10-24 Love <lha@stacken.kth.se>
-
- * appl/pts/pts.c (*): expand cellname
-
-2000-10-20 Assar Westerlund <assar@sics.se>
-
- * arlad/*.c: use AssertLockOwner and AssertNotLockOwner
-
- * lwp/lock.h (AssertLockOwner, AssertNotLockOwner): print the
- current locker, and print file:line correctly, add trailing
- newline
- (AssertExclLocked, AssertNotExclLocked): add two new macros for
- users to verify that a lock is (not) held
-
-2000-10-20 Love <lha@stacken.kth.se>
-
- * lwp/lock.c (Lock_Init): set thread_index
- * lwp/lock.h (struct Lock): thread_index is the thread that have a
- exclusive lock
- (Obtain.*, Release.*): check owner of lock
- * lwp/{plwp,lwp_asm}.h: define LWP_INVALIDTHREADID
-
-2000-10-19 Love <lha@stacken.kth.se>
-
- * xfs/solaris/xfs_vfsops.c (xfs_{,u}mount): initialize/delete the
- mutex's in struct xfs
- * xfs/solaris/xfs_dev.c: don't init the struct xfs since it
- belongs to the filesystem
-
- * xfs/solaris/xfs_dev.c: indent
-
-2000-10-18 Assar Westerlund <assar@sics.se>
-
- * arlad/arla-cli.c (default_log_file): change to /dev/stderr, it's
- much more useful for an interactive program to output errors and
- warnings where they're immediately visible
-
-2000-10-18 Love <lha@stacken.kth.se>
-
- * Release 0.34.5, see the branch for relevant patches
-
- * configure.in: check for strlcpy
-
- * xfs/linux/xfs_inodeops.c (*): return error if filename is too
- long
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_lookup_common): do copy of
- label diffrently
- (xfs_symlink_common): check length of symlink content
-
- * xfs/include/xfs/xfs_message.h (XFS_MAX_SYMLINK_CONTENT): define
- for size largest symlink that can be passed in the rpc system.
- * xfs/linux/xfs_dev.c (enqueue_message): fixed wrong debug printf
-
- * xfs/*/xfs_common.c: added strlcpy
- * xfs/*/xfs_[iv]nodeops*.c: avoid overrun the filename in the
- upcall packet
- * xfs/*/xfs_message.c (xfs_message_installdata): terminate the
- cache_name string
-
-2000-10-17 Love <lha@stacken.kth.se>
-
- * Release 0.34.4, see the branch for relevant patches
-
-2000-10-16 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (get_root_of_volume): finish un-finished comment
-
-2000-10-15 Assar Westerlund <assar@sics.se>
-
- * xfs/rhapsody: remove this (to the attic). it is probably not
- useful for anybody, and the new MacOS X port of this code has been
- integrated into xfs/bsd
- * lwp/make-process.o.sh.in: remove (unsued) rhapsody case
-
- * lib/ko/kocell.c (cell_getcellbyhost): make it consistent as
- related to memory allocation. now always returns non-malloced
- memory.
-
- * tests/make-page.c: make it work without MMAP_ANON
- * appl/lib/ka-procs.c: remove dupliate include files, add fallback
- definitions for DES_ENCRYPT and fix types
- * xfs/bsd/bin/Makefile.in (startarla): also substitute libexecdir
- * xfs/bsd/bin/startarla.in (PATH): also include libexecdir to find
- arlad
-
-2000-10-15 Love <lha@stacken.kth.se>
-
- * arlad/arlad.c (arla_start): don't send USR1 when not forking
-
- * arlad/messages.c (xfs_message_rmdir): msg0 is of type
- xfs_message_installdata
-
- * arlad/inter.c (cm_getattr): if data isn't in kernel, make sure
- to mask way the open-mask too
-
- * doc/debugging.texi: some more debugging help
-
-2000-10-14 Love <lha@stacken.kth.se>
-
- * xfs/linux/xfs_message.c (xfs_message_installdata): look at
- XFS_ID_HANDLE_VALID flag and make sure we fall back on
- path_init/path_wait/open_namei if its not there.
- (xfs_message_installnode): print tokens
-
- * xfs/solaris/xfs_message.c (xfs_message_installdata): look at the
- XFS_ID_HANDLE_VALID flag and panic if not set
-
-2000-10-14 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/bsd/xfs_message.c (xfs_message_installdata): Only use handle
- if XFS_ID_HANDLE_VALID is set
-
- * arlad/*.c: Use fcache_cache_handle. Set XFS_ID_HANDLE_VALID.
-
- * arlad/{arlad.c,arla.c,arla-cli.c,arla_local.h}: Fork early and
- wait for SIGUSR1
-
- * xfs/include/xfs/xfs_message.h: Add XFS_ID_HANDLE_VALID
-
- * xfs/bsd/xfs_vfsops-macos.c: Dead vnodes should use nop locking
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhlookup): check for NULL vnode
- from VGET
-
-2000-10-14 Love <lha@stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_read_file): 2.4: check if the data
- is valid valid before calling generic_file_read.
-
- * tests/invalidate-file.c: use fs_invalidate, better errormessages
- * tests/invalidate-file.c: invalidate files when they are used.
-
- * lwp/lwp_asm.c: clean up some, allocate some STACK_HEADROOM in
- first call to savecontext(), unify some cases, remove unused stuff
- * lwp/lwp_asm.h: define AFS_LWP_MINSTACKSIZE to (100 * 1024) in
- all cases, make comment match
-
- * INSTALL: simplify the chardevice node text, 0.5 is a LONG time
- ago. add text about kgcc and rh7.0;
-
- * lwp/process.ppc.S: document PowerPC Stack structure
- * xfs/linux/xfs_inodeops.c (xfs_write_file): validate data before
- writing to file
- * tests/run-tests.in (ARLA_TESTS): run copy-file
- * tests/copy-file: copy a file several times
-
- * configure.in (linux): allow overriding of KERNEL_CC
-
- * appl/kalog/kalog.c: improve the user-interface
- * appl/lib/ka-procs.c: remove usused variable
-
-2000-10-12 Love <lha@stacken.kth.se>
-
- * xfs/linux/xfs_dev.c (struct xfs_channel, xfs_queue_inactive,
- xfs_process_inactive_queue): protect inactive_list too
-
- * xfs/linux/xfs_dev.c (enqueue_message): common parts of
- xfs_message_send, protect updating of sequence-number
- (xfs_process_inactive_queue): use enqueue_message instead of xfs_message_send
- (xfs_message_send): moved body to enqueue_message
- (xfs_devread): process inactive queue
- (xfs_message_send): process inactive queue
- (xfs_message_rpc): process inactive queue, protect updating of sequence-number
- (struct xfs_channel): document what channel_sem is protecting
-
- * tests/create-symlinks.c: verify contents
-
-2000-10-11 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_dev-common.c (xfs_message_rpc): do not send SIGABRT,
- only useful when debugging
-
- * configure.in: call AC_KRB_IPV6 (we might end up getting some
- library such as libinet6 that gives us getnameinfo et al)
-
-2000-10-11 Love <lha@stacken.kth.se>
-
- * lib/ko/gensysname.c: make it match sparc64 too
- * tests/fhbench.c: include <sys/ioccom.h> if exist
- * lib/roken: make getaddrinfo stuff work
- * **/Makefile.in: wack everything until it seems to work
- * arlad/solaris-subr.c: remove _KERNEL, solaris don't need it.
-
-2000-10-10 Love <lha@stacken.kth.se>
-
- * lib/roken: remove strmatch.c, inaddr2str.c, str2inaddr.c
-
- * configure.in: check for sin_len
- * appl/*/*.[ch]: use getaddrinfo/getnameinfo
- * lib/ko/gensysname.c (main): use fnmatch instead of strmatch
- * arlad/afsdir_check.c: use arla_local.h
- * arlad/arla_local.h: define O_BINARY is not defined.
- * ydr/output.[ch]: break out eefile from libroken
- * ydr/main.c: break out strange libroken functions
-
-2000-10-09 Love <lha@stacken.kth.se>
-
- * lib/ko/ports.c: initialize ports to random value to fool
- darwin's ranlib
-
-2000-10-08 Assar Westerlund <assar@sics.se>
-
- * rx/rxdebug.c (*): check that the socket fd is not too large to
- select on
- * rx/rx_pkt.c (osi_NetSend): check that the socket fd is not too
- large to select on
- * lwp/testlwp.c (selectConsumer): check that the fd is not too
- large to select on
- * arlad/kernel.c (kernel_opendevice): check that the fd is not too
- large to select on
- * appl/afsutils/klog.c (do_timeout): check for the fd being too
- large to be able to select on
- * rx/rx_user.c: static-ize some variables and check that the
- socket fd is not too large
- * rx/rx_globs.h: remove some variables that are only used in
- rx_user
-
-2000-10-08 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c, xfs/bsd/xfs_vnodeops-common.c: Mac
- OS X UBC fixes
-
- * configure.in: Check which library to include to get pthreads
- support
-
-2000-10-08 Love <lha@stacken.kth.se>
-
- * lib/ko/kocell.c: improve dns handling
- * appl/*/Makefile.in: Add depency on arlalib
-
- * appl/kalog/kalog.c: use new ka_ interface
- * appl/lib/Makefile.in: add ka-procs.[ch], install headerfiles
- * appl/lib/ka-procs.h: KA server interfaces.
- * appl/lib/ka-procs.c: KA server interfaces. Currently implemented
- is Authenticate and GetTicket.
-
-2000-10-07 Love <lha@stacken.kth.se>
-
- * rxdef/ka.xg: added GetTicket and random fixes
- * arlad/services.h: added ka missing services
-
-2000-10-06 Love <lha@stacken.kth.se>
-
- * configure.in: added kalog
- * appl/Makefile.in (SUBDIRS): added kalog
- * appl/kalog/kalog.c: simple klog program need some cleaning
- in the user-interface
- * appl/kalog/Makefile.in: makefile for kalog
-
-2000-10-04 Love <lha@stacken.kth.se>
-
- * ydr/output.c: try to handle encoding strings
-
- * arlad/inter.c (cm_lookup): avoid deadlock when looking up .. in
- a volume root
-
- * xfs/bsd/xfs/xfs_locl.h: don't include <vm/...> headers on a uvm
- only system
- * configure.in: check if we are a uvm only system
- * cf/bsd-uvm-only.m4: add a uvm vs vm test
-
-2000-10-03 Love <lha@stacken.kth.se>
-
- * arlad/dynroot.c (dynroot_update_entry): set unitmodebits for
- mountpoints
- * lib/ko/kocell.c (celldebug_units): add a almost-all
- * util/log.c (parse_word): fixet parsing and implement best_match
-
- * **/*.[chly]: Removed advertising clause.
-
-2000-10-02 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * include/afssysdefs.h, xfs/bsd/xfs/xfs_syscalls.h,
- xfs/bsd/xfs_syscalls-wrap-bsd.c: Added afssysdefs.h
-
- * xfs/bsd/xfs_dev-bsd.c: xfs_is_xfs_dev should only be defined
- once on Mac OS X
-
- * arlad/inter.c: Transarc doesn't check permissions on directory
- FetchStatus
-
-2000-10-02 Harald Barth <haba@pdc.kth.se>
-
- * rx/rx_queue.h: If it will segfault, get it at early as possible.
- * rx/rx.c: Asserts to find when the congestionQueue breaks
-
-2000-10-02 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * lib/ko/gensysname.c: Added ppc_macosx
-
-2000-10-02 Love <lha@stacken.kth.se>
-
- * arlad/bsd-subr.c: don't define _KERNEL since it not used
-
-2000-09-30 Assar Westerlund <assar@sics.se>
-
- * arlad/*-subr.c, arlad/arla_local.h: 'move the required magic for
- getting DIRSIZ et al from dirent.h into the *-subr.c files, since
- it is different on all OSes
-
- * util/log.c (syslog_opt_units): conditionalize the different
- openlog flags
-
-2000-09-29 Assar Westerlund <assar@sics.se>
-
- * rx/rx_user.c (ADDRSPERSITE): bump to 256 to work-around a bug in
- older FreeBSD
-
-2000-09-29 Love <lha@stacken.kth.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_lookup): merge the EJUSTRETURN
- and 0 cases
-
-2000-09-28 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/bsd/xfs/xfs_locl.h: include sys/ubc.h on darwin
-
- * xfs/bsd/xfs_vfsops-bsd.c, xfs/bsd/xfs_node-bsd.c,
- xfs/bsd/xfs_vnodeops-bsd.c: darwin ubc handling fixed
-
- * xfs/bsd/xfs_syscalls-common.c, xfs/bsd/xfs_vfsops-common.c:
- darwin copyinstr requires valid 4th argument
-
-2000-09-28 Love <lha@stacken.kth.se>
-
- * rx/rxperf.c: getopt'ify to make it possible to link agaist
- transarc libs
- * arlad/arlad.8: remove paths
-
-2000-09-27 Love <lha@stacken.kth.se>
-
- * xfs/bsd/bin/Makefile.in: move programs to sbin
-
- * arlad/inter.c: deal with followmountpoint change
- * arlad/fcache.h: new signature of followmountpoint
- * arlad/fcache.c (followmountpoint): add parameter to pass down
- parent FCacheEntry
-
- * arlad/volcache.c: (get_info_byname): cast volname_len to int
- when doing a .*s printf
-
- * arlad/Makefile.in: deal with arlad/arla-cli changes
- * arlad/arla.c: break out daemon/test parts
- * arlad/arla_local.h: export part of arla{,-cli,d}.c
- * arlad/arlad.8: created from arlad.1
- * arlad/arla-cli.8: document, new file
- * arlad/arlad.c: daemon parts of arla.c
- * arlad/arla-cli.c: pull out command line specific parts of arla.c
- * arlad/ThisCell.5: fix refenceses
-
-2000-09-25 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/arlad.1: Corrected referred filenames
-
-2000-09-25 Love <lha@stacken.kth.se>
-
- * lib/ko/kocell.c (readdb,readcellservdb): make less picky about
- whitespace.
-
- * appl/fs/Makefile: include arladebu.o
- * appl/lib/Makefile: don't include arladeb.o
-
- * arlad/Makefile.in (afsdir_check_OBJS): don't need arladeb.o
- any more
- * arlad/afsdir_check.c: don't need arla_loginit
-
- * arlad/arladeb.c: moved functions around
- * arlad/arladeb2.c: removed: functions moved to arladebug.c
- * arlad/arladebu.c: exported parts of arla debug interface
-
- * arlad/fcache.c (fcache_get): set pag to ARLA_NO_AUTH_CRED, not 0
-
- * xfs/linux/xfs_dev.c (xfs_print_sleep_queue): use
- HAVE_WAIT_QUEUE_TASK_LIST
- * configure.in: check for linux/stddef.h and wait-queue->task_list
- * cf/linux-type-wait-queue-task_list.m4: check for
- wait-queue->task_list
-
-2000-09-25 Assar Westerlund <assar@sics.se>
-
- * config.sub: update to version 2000-09-11 (aka 1.181) from
- subversions.gnu.org
-
- * config.guess: update to version 2000-09-05 (aka 1.156) from
- subversions.gnu.org plus some minor tweaks
-
-2000-09-20 Love <lha@stacken.kth.se>
-
- * conf/arla.spec.in: make it (maybe) work with suse
- * xfs/linux/bin/Makefile.in: look for init.d directories at some
- more places
-
-2000-09-19 Love <lha@stacken.kth.se>
-
- * lwp/Makefile.in (clean): remove process.S, its a symlink created
- by make-process.o.sh
-
-2000-09-18 Love <lha@stacken.kth.se>
-
- * conf/CellServDB (admin.kth.se): added malvolio.admin.kth.se
-
- * Release 0.34.3, see the branch for relevant patches
-
-2000-09-16 Love <lha@stacken.kth.se>
-
- * tests/fhbench.c: a fhopen bench program
-
-2000-09-15 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (truncate_file): remove assert that new
- filelength shold be the length that we specified, since old
- fileserver just seems to do wrong with it.
-
-2000-09-14 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_message.c (xfs_message_installnode): grab a
- reference to the parent dentry while it's being used
-
-2000-09-13 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_dev.c (sigisactive, sigissignaled): handle both
- old style `current->signal' and 2.4.0-test8 style
- `current->pending.signal'
-
- * configure.in (linux): test for `struct task_struct.pending',
- added in 2.4.0-test8
-
-2000-09-12 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs/xfs_dev.h (xfs_channel): add `proc' to save who is
- connection to this channel new prototypes
-
- * xfs/bsd/xfs_dev-common.c (xfs_devread, xfs_devwrite): save the
- proc used in the channel
- (xfs_message_rpc): check to avoid deadlocks caused by arlad
- calling xfs that would cause rpcs sent to arlad
-
-2000-09-09 Love <lha@stacken.kth.se>
-
- * appl/vos/vos_status.c (printstatus): print volume name here,
- indent
- * appl/udebug/udebug.1: specify section
- * arlad/arlad.1: clairify how to start arlad
- * arlad/arla.conf.5: the return of the mandoc maffia
-
-2000-09-08 Love <lha@stacken.kth.se>
-
- * tests/run-tests.in: added fchmod and truncate
-
-2000-09-06 Love <lha@stacken.kth.se>
-
- * util/log.c (syslog_facility_units): add #ifdef junk for broken
- OS that doesn't have LOG_foo
- * appl/bos/Makefile.in: added mandir
- * rx/Makefile.in: added mandir
-
-2000-09-05 Love <lha@stacken.kth.se>
-
- * appl/udebug/udebug.c (myctime): dont use %c to strftime
- * util/log.c (log_vprint_file): don't use %c to strftime
- (log_open_syslog): make shorter
-
-2000-09-04 Love <lha@stacken.kth.se>
-
- * appl/*/*.c: (main): log_open use :notime
-
- * util/log.c: added options
- * lib/ko/ko_locl.h: include <log.h>
- * lib/ko/ko.h: include <log.h>
- * lib/ko/kocell.c: use log_log for debugging
- * appl/udebug/udebug.c: try to clear up myctime warnings
-
-2000-09-02 Love <lha@stacken.kth.se>
-
- * ydr/output.c: differate variable declaration and function
- (prototype) declaration make max sized string (string foo<10>)
- have fixed size in variable declaration, and be a pointer in
- function declarations
-
- * **/*.[ch]: fixed missing agetarg stuff
-
-2000-09-01 Love <lha@stacken.kth.se>
-
- * **/*.[ch]: use agetarg where approriate
- * lib/ko/agetarg.[ch]: introduce wacked agetarg
- * lib/roken/getarg.[ch]: change to heimdal 0.3a's libroken
- * arlad/arlad.1: --dynroot
- * arlad/CellServDB.5: more AFSDB religion
-
-2000-09-01 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/messages.c (try_again): Handle RXKADSEALEDINCON and
- RXKADUNKNOWNKEY
- * arlad/volcache.c (get_info_loop): Handle RXKADSEALEDINCON and
- RXKADUNKNOWNKEY
-
-2000-08-31 Love <lha@stacken.kth.se>
-
- * arlad/messages.c: make more consistent, make all fcache_get_data
- calls loop on try_again
- * arlad/messages.c (xfs_message_getdata): don't pass NULL as fid
- to try_again, since if the error is from VBUSY, it try to print
- the fid, and since fid is NULL it will crash.
- * rxdef/bos.xg: added missing ;
-
-2000-08-30 Love <lha@stacken.kth.se>
-
- * appl/bos/*.c: indent, make work, correct, refit to new bos.xg
- * rxdef/bos.xg: try to make it more correct
-
-2000-08-29 Love <lha@stacken.kth.se>
-
- * appl/bos/Makefile.in: install manual pages
- * appl/bos/bos.8: added initial manualpage
- * doc/storage.texi: more about volume management
- * doc/afs-basics.texi: corrent dns example
- * lib/ko/kocell.c: always read suidcell when starting
-
-2000-08-28 Love <lha@stacken.kth.se>
-
- * xfs/solaris/xfs_node.c (new_xfs_node): pass in parentnode to
- avoid deadlock when "." is entered.
- (*): start doing locking on xnode
- * xfs/solaris/xfs/xfs_node.h (struct xfs_node): add a mutex to
- lock the struct, add a comment that struct vnode needs to be
- first.
- * xfs/solaris/xfs_node.c (free_xfs_node): if we are next_node,
- point it on node after us
-
-2000-08-27 Love <lha@stacken.kth.se>
-
- * xfs/solaris/xfs_message.c (gc_vnode): lock vnode when looking at
- v_count
- * xfs/solaris/xfs_node.c (new_xfs_node): protect nodes list
- (free_xfs_node): protect nodes list, make sure to update the
- next_node pointer
- (xfs_node_iter_start): start a iteration of the nodes list
- (xfs_node_iter_next): get next node in iteration
- (xfs_node_iter_stop): end iteration of the nodes list
- (xfs_node_find): use new list iteration function
- (free_all_xfs_nodes): use new list iteration function
- * xfs/solaris/xfs_message.c (xfs_message_gc_nodes): use new
- interation functions on nodelist
- * xfs/solaris/xfs_dev.c (xfs_dev_attach): call xfs_init_xfs() to
- init struct xfs
- (xfs_dev_detach): call xfs_destroy-xfs to free usage of struct xfs
- * xfs/solaris/xfs_wrap.c (_fini): disallow unloading of module
- that still used
- * xfs/solaris/xfs_vfsops.c (xfs_unloadable): return 0 is xfs is
- unloaded
- (xfs_init_xfs): init mutexed related to struct xfs
- (xfs_destroy_xfs): destroy mutexes related to struct xfs
- (xfs_uprintf_filsys): use literation functions
- * xfs/solaris/xfs/xfs_fs.h (struct xfs): added mutex'es for list
- protection add new prototypes
- * xfs/solaris/xfs_syscalls.c (xfs_uninstall_setgroups): avoid
- unload if never loaded
- (xfs_setgroups): protect with p->p_crlock
-
-2000-08-26 Assar Westerlund <assar@sics.se>
-
- * xfs/solaris/xfs_dev.c: remove some old stuff make some macros
- into functions
- (xfs_message_rpc): add signals to blocked set
-
-2000-08-26 Love <lha@stacken.kth.se>
-
- * xfs/solaris/xfs_dev.c (xfs_message_rpc): mask SIGPOLL, SIGALRM,
- and SIGVTALRM while doing the rpc
-
-2000-08-26 Love <lha@stacken.kth.se>
-
- * lib/ko/Makefile.in: change order of KRB4_LIB_FLAGS and libroken
-
- * xfs/solaris/xfs/xfs_locl.h: added <sys/signal.h>
- * xfs/solaris/xfs_dev.c: allocate xfs_channel->message_buf at
- attach/detach moment protect xfs_channel->message_buf with mutex
- convert some printf to XFSDEB
- * xfs/solaris/xfs_dev.c: lock messageq and sleepq, initial SMP
- support use a macro to get ddi_get_soft_state() add some comments
-
- * tests/write-closed2.c: include more stuff to make it work on
- solaris
-
-2000-08-25 Love <lha@stacken.kth.se>
-
- * lwp/process.m68k.S: make the `register % hack' depend on __ELF__
-
-2000-08-25 Assar Westerlund <assar@sics.se>
-
- * arlad/volcache.c: replace some strncpy with strlcpy, and make a
- too long volume name an error
- * arlad/fcache.c: replace some strcpy with strlcpy
- * arlad/arla.c (main): use the correct cell and not `0'
-
- * arlad/messages.c (try_again): get anonymous credentials in the
- correct cell
- (xfs_message_getroot, viocgettok)): use the correct cell and not `0'
- (viocsetacl): only malloc the required space
-
-2000-08-24 Love <lha@stacken.kth.se>
-
- * arlad/arladeb{2,}.[ch]: new log_log
- * util/util-tester.c: added new test for log
- * util/log.[ch]: enable subsystem to log
- * util/log_log.3: added manualpage
- * util/Makefile.in (LIBS): change order of including libroken and
- @LIBS@
-
-2000-08-21 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/solaris/bin: Added startarla and modctl
-
-2000-08-20 Tomas Olsson <tol@stacken.kth.se>
-
- * rxdef/cb.xg: don't convert addr_in & subnetmask in struct
- interfaceAddr
-
- * tests/write-closed.c (doit): cast MAP_FAILED to void *
-
- * tests/write-closed2.c: include atypes.h
- (doit): cast MAP_FAILED to void *
-
-2000-08-20 Assar Westerlund <assar@sics.se>
-
- * ydr/output.c: inherit flags to the elements of of an
- array/varray
-
- * tests/write-closed.c, write-closed2.c: new tests
-
-2000-08-19 Magnus Ahltorp <ahltorp@ahltorp.nada.kth.se>
-
- * Release 0.34.2, see the branch for relevant patches
-
-2000-08-19 Assar Westerlund <assar@sics.se>
-
- * configure.in: update smp-test on linux to newer kernels: more
- header files are necessary when doing the cpp test and uppercase
- characters when grepping /proc/ksyms
- * cf/krb-bigendian.m4: re-write this so that it hopefully it works
- correctly
-
-2000-08-17 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_fsync_common): give up and
- throw away data when called from reclaim
- (xfs_inactive_common): use printf so that user seems the failed
- writing-back
-
- * xfs/bsd/xfs/xfs_locl.h: try including all vm-related files that
- we find
-
- * configure.in: actually test if we found krb4 for deciding to
- build rxkad, not just that we were looking for it
-
-2000-08-16 Love <lha@stacken.kth.se>
-
- * appl/lib/fs_lib.c (fs_get_sysname): fix strlcpy
- (fs_getcells): fix strlcpy, argument i a len not a size
- * appl/lib/arlalib.h (fs_getcells): fix prototype
-
-2000-08-15 Love <lha@stacken.kth.se>
-
- * arlad/messages.c (xfs_message_symlink): update usage of
- cm_symlink
- * arlad/inter.c (cm_symlink): convert to take a FCacheEntry
- instead of a VenusFid
-
-2000-08-14 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_message.c (clear_all_children): make it invalidate
- this dcache entry iff `parent'. fix all callers.
-
-2000-08-13 Love <lha@stacken.kth.se>
-
- * doc/arla.texi: add new files and nodes
- * doc/afs-basics.texi: spelling
- * doc/intro.texi: update platforms, and add arla-commit
- * doc/oddities.texi: mountpoints
- * doc/authors.texi: updata
- * doc/Makefile.in: added new files
- * doc/{storage,timeline}.texi: new random texts
- * doc/history.txt: merged into info document
- * doc/{partsofarla,,porting,servers,tools,ack,debugging}.texi: Id police
-
-2000-08-13 Love <lha@stacken.kth.se>
-
- * arlad/arla.c (recover): don't revover by default
-
-2000-08-13 Assar Westerlund <assar@sics.se>
-
- * configure.in: check for uvm/uvm_extern.h
-
- * xfs/bsd/xfs/xfs_locl.h: use uvm/uvm_extern.h instead of vm/vm*.h
- if it exists
-
-2000-08-11 Love <lha@stacken.kth.se>
-
- * configure.in: enable to disable compiling xfs
-
-2000-08-10 Tomas Olsson <tol@stacken.kth.se>
-
- * lib/bufdir/fbuf.c (malloc_flush): reorder args to lseek()
-
-2000-08-09 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * conf/CellServDB: Updated club.cc.cmu.edu
-
-2000-08-08 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (getroot): don't die when we cant find the root
- volume, don't enter volccache_getbyname more then one time XXX the
- later should be fixed in volcache
-
-2000-08-06 Love <lha@stacken.kth.se>
-
- * Release 0.34.1 relased, see the branch for relevant patches
-
-2000-08-06 Assar Westerlund <assar@sics.se>
-
- * xfs/solaris/xfs_syscalls.c (remote_pioctl): also interpret ENXIO
- as the daemon not being there and therefore mapped into EINVAL
-
-2000-08-06 Love <lha@stacken.kth.se>
-
- * appl/afsutils/Makefile.in (MANPAGES): += klog.1 aklog.1
- * appl/afsutils/aklog.1: add manulpage
- * appl/afsutils/*.1: mandoc'ify, and clean u
-
- * appl/afsutils/aklog.c: use "TheseCells" if there is no arguments
- * lib/ko/kocell.c (cell_expand_cell): expand in the same order as
- CellServDB
- (readthesecells): read a "TheseCells" file and add them to the ofst of
- TheseCells
- (addthesecell): add a new cell to the thesecells list, permit no dups.
- (cell_init): also parse the TheseCells files
-
- * appl/afsutils/aklog.c: Added aklog from Brandon S. Allbery
- <allbery@ece.cmu.edu>, rewrote it a little bit.
- * appl/afsutils/Makefile.in: added aklog
-
- * appl/lib/arlalib.c (arlalib_get_viceid_servers): return the
- errorcode
-
- * cf/c-attribute.m4: check for old gcc that can't eat
- __attribute__ ((unused)) bar (void) { return ; }
-
- * Release 0.34
-
- * configure.in (CHECK_KERBEROS): need to check for both krb4 and
- krb5 since libkafs might depend on both.
-
-2000-08-03 Love <lha@stacken.kth.se>
-
- * lib/cmd/cmd.c (parse_magic_options): don't abort(), break
-
-2000-08-04 Love <lha@stacken.kth.se>
-
- * cf/check-kafs.m4: check if libkafs needs to be linked against
- libkrb5, libkrb4 or both
-
-2000-08-02 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (get_attr_bulk): try to not leak memory from
- bulkstatus. handle any number of returned status
- * arlad/fcache.c (get_attr_bulk): actually break out when
- RXAFS_BulkStatus fails
-
- * arlad/arla.c: move chroot later
-
-2000-08-02 Harald Barth <haba@pdc.kth.se>
-
- * LIESMICH: Polish german.
- * README: Small hint
-
-2000-08-02 Assar Westerlund <assar@sics.se>
-
- * arlad/arla.c (main): chroot to cache_dir to avoid influencing
- anything
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_open_common): store the
- `cred' in the xfs_node for later
- (xfs_inactive_common): fsync the vnode (with the stored cred)
- * xfs/bsd/xfs_vnodeops-osf.c (xfs_open): call xfs_open_common
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_open): call xfs_open_common
- * xfs/bsd/xfs_node-bsd.c (xfs_getnewvnode): initialize `cred'
- (free_xfs_node): free `cred'
- * xfs/bsd/xfs/xfs_node.h (xfs_node): add `cred'
-
- * xfs/bsd/xfs_vfsops-common.c (xfs_mount_common): remove `length'
- parameter when copying
-
- * rx/rxdebug.c: printf format correctness
-
-2000-07-30 Assar Westerlund <assar@sics.se>
-
- * lib/ko/kocell.c: complain once if we fail to open */ThisCell
- don't complain about missing SuidCells
- * lib/ko/kocell.c: do not write warnings about configuration files
- found in /usr/vice instead of /usr/arla. read suid cell
- information on demand.
-
-2000-07-28 Love <lha@stacken.kth.se>
-
- * lwp/make-process.o.sh.in (HOST_CPU): nbsd/pmax uses mipsl, catch
- that one too.
-
-2000-07-24 Tomas Olsson <tol@stacken.kth.se>
-
- * appl/fs/fs.c (mkmount_cmd): simple support for cell as third arg
-
-2000-07-23 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_node-bsd.c (xfs_dnlc_lookup_int): always call
- cache_lookup with LOCKPARENT | ISLASTCN to make sure the returned
- parent node is locked.
- (xfs_dnlc_lock): implement common function for doing the first half of
- the required locking (the second half is done in xfs_lookup) after
- fetching an entry from the cache. depending on the implementation
- of cache_lookup, this has to be done always or only when
- cache_lookup failed
-
- * xfs/bsd/xfs_dev-bsd.c: treat _LKM and KLD_MODULE the same way
- * xfs/bsd/xfs_syscalls-common.c: treat _LKM and KLD_MODULE the
- same way
- (lookup_node): remove unused `done'
-
-2000-07-17 Love <lha@stacken.kth.se>
-
- * xfs/linux/*.c: dentry->d_child is atomic_t on linux 2.4-test3
-
-2000-07-16 Love <lha@stacken.kth.se>
-
- * rx/rxperf.c: rx test perf program
- * conf/CellServDB (cs.unc.edu): update
-
-2000-07-14 Simon Josefsson <jas@vic20.blipp.com>
-
- * cf/check-kerberos.m4 (AC_KRB4_INC_WHERE): Typo.
- (AC_KRB5_LIB_WHERE1): Try -lresolv too.
-
-2000-07-12 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_message.c (xfs_message_invalidnode): try not to
- throw away nodes that act as backing store for dirty vm objects
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_putpages): call underlying putpages
-
- * lwp/Makefile.in: always install lwp headerfile as lwp.h
-
- * xfs/include/xfs/xfs_message.h (XFS_FSYNC): add flag
- * xfs/linux/xfs_inodeops.c (xfs_fsync): add flag
- * xfs/*/xfs_vnodeops*.c (xfs_fsync): set fsync bit
- * arlad/inter.c (cm_close): propagate fsync bit to fs
-
- * arlad/messages.c (viocwhereis): use volcache_volid2bit and only
- return relevant file servers
- * arlad/fcache.c (find_first_fs): use volcache_volid2bit
- * arlad/volcache.h (volcache_volid2bit): add prototype
- * arlad/volcache.c (volcache_volid2bit): new function
-
-2000-07-08 Love <lha@stacken.kth.se>
-
- * arlad/volcache.c (recycle_entry): assert the the entry isn't
- used, free any parent
- (get_free_entry): make sure the this node isn't a parent node before
- recycling it
- (volcache_getby{name,id}): if refcount == 0,
- inc nactive_volcacheentries since the entry just started to
- be used (after try_reuse or creation)
- (add_entry_by{name,id}): move ++nactive_volcacheentries
- resposibility to caller.
- (try_reuse): relocate
-
-2000-07-06 Assar Westerlund <assar@sics.se>
-
- * rx/rx_pkt.c (rxi_EncodePacketHeader, rxi_DecodePacketHeader):
- generalize the code to work where sizeof(u_int32_t) != 4
-
-2000-07-03 Harald Barth <haba@pdc.kth.se>
-
- * tests/dir-tree: haba version, now without bash features
- * tests/shallow-tree: with haba dir-tree
- * tests/deep-tree: with haba dir-tree
-
-2000-07-02 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (update_entry): look at `fake_mp'
- * arlad/arla_local.h (fake_mp): add
- * arlad/arla.c: add `--fake-mp'
-
- * arlad/fcache.c (followmountpoint): set parent
- * arlad/fcache.c: redo fake and real mountpoint stuff
-
- * arlad/messages.c (update_fid); try handling flags better
- (xfs_message_getdata): translate errors in common case
-
- * tests/visit-volumes: new test
-
-2000-06-27 Love <lha@stacken.kth.se>
-
- * appl/bos/bos_status.c: indent and some cleaning
- * appl/bos/bos.c (cmds): added apropos, help, quit
-
-
-2000-07-02 Tomas Olsson <tol@stacken.kth.se>
-
- * lib/ko/koerror.c (koerr_gettext): make ret const
- * lib/bufdir/fdir.c (fdir_creat): return EEXIST when appropriate
-
-2000-07-01 Assar Westerlund <assar@sics.se>
-
- * arlad/inter.c (cm_symlink): do not let the user choose 0644 bits
- for a symlink, because then we could confuse it with a mount point
-
-2000-06-30 Assar Westerlund <assar@sics.se>
-
- * appl/vos/vos_examine.c: be more robust when the volume server
- returns errors
-
-2000-06-26 Love <lha@stacken.kth.se>
-
- * arlad/messages.c (xfs_message_remove): it seems silly but remove
- can cause a bulkstatus, pass the parent to fcache_verify_attr to
- avoid a deadlock.
-
-2000-06-26 Tomas Olsson <tol@stacken.kth.se>
-
- * lib/ko/koerror.c (koerr_gettext): never return NULL
- * tests/dir-tree: syntax
-
-2000-06-25 Tomas Olsson <tol@stacken.kth.se>
-
- * appl/vos/vos_createentry.c: check helpflag
-
-2000-06-25 Assar Westerlund <assar@sics.se>
-
- * appl/lib/arlalib.c (arlalib_get_viceid): update to
- cell_dbservers_by_id
- * arlad/volcache.c: adapt to new cell_dbservers_by_id
- * arlad/arla.c (usage): print help correctly
- * arlad/afsdir_check.c (usage): fix to print usage correctly
- * arlad/messages.c: adapt to new cell_dbservers_by_id and
- cell_new_dynamic
- * lib/ko/Makefile.in: remove kodebug
- * lib/ko/kocell.c: look up AFSDB records also for the case of an
- existing cell that has no database servers. record cells
- dynamically added in CellServDB
- * lib/ko/ko_locl.h: remove kodebug.h
- * lib/ko/ko.h: update to new prototypes from kocell.c
-
- * xfs/linux/xfs_vfsops.c (xfs_put_inode): change back the i_count
- test to the comparison it was
- (xfs_delete_inode): fix printf of i_count
- * xfs/linux/xfs_inodeops.c (xfs_release_file): use xfs_iread for
- accessing i_count
-
- * arlad/fcache.c (purge_volume): handle wildcard cells that can
- result from volume callbacks from multi-homed file servers
- * arlad/volcache.c (volcache_invalidate): handle wildcard cells
- that can result from volume callbacks from multi-homed file
- servers
-
- * lib/ko/kocell.c: make all cell name comparisons case-insensitive
-
-2000-06-24 Love <lha@stacken.kth.se>
-
- * rxdef/vldb.xg: add some more flag
-
-2000-06-24 Harald Barth <haba@pdc.kth.se>
-
- * tests/rm-rf.c: closedir() is good - do not die from too many
- open files in big trees
- * tests/deep-tree: Fast version does a not-so-deep-tree
- * tests/create-files.c: Not only the first file should be of given
- size
-
-2000-06-23 Assar Westerlund <assar@sics.se>
-
- * appl/afsutils/klog.c (main): use fgets for reading the password
-
-2000-06-23 Love <lha@s3.kth.se>
-
- * xfs/linux/xfs_message.c (gc_vnode): use xfs_iread
- * xfs/linux/xfs_vfsops.c (xfs_read_super): set error = 0 when we
- use path_init/path_tree
- (xfs_put_inode,xfs_delete_inode): use xfs_iread
- * xfs/linux/xfs/xfs_locl.h (xfs_iread): use for reading of i_count
- (xfs_iref): change to use atomic_read
-
-2000-06-22 Assar Westerlund <assar@sics.se>
-
- * xfs/solaris/xfs/xfs_msg_locl.h (xfs_message_updatefid): add
- prototype
- * xfs/solaris/xfs_message.c (xfs_message_updatefid): add
- * xfs/solaris/xfs_dev.c (xfs_message_receive): add updatefid
-
-2000-06-19 Assar Westerlund <assar@sics.se>
-
- * arlad/subr.c (dentry2ino): actually handle all the cases:
- - . at the root of a volume
- - .. at the root of a volume
- - .. pointing to the root of the volume
- - all other
-
- * arlad/fcache.c (fcache_realfid): try to return the right fid for
- (*,1,1)
- * arlad/fcache.c (invalidator): check that the heap has not
- mutated while sleeping
-
- * appl/pts/pts.c (main): add an terminating element (NULL) in
- myargv
-
-2000-06-18 Harald Barth <haba@pdc.kth.se>
-
- * LIESMICH: Follow README
-
-2000-06-17 Assar Westerlund <assar@sics.se>
-
- * configure.in (openbsd): set _LKM (should really come from
- bsd.lkm.mk)
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_lookup): locking protocol is
- more complex. if we're returning in *vpp the same node that we
- got in dvp, we should not unlock it.
- * xfs/bsd/xfs_vnodeops-common.c: add some extra (#if 0 code)
- (xfs_readdir): fetch length from cache vnode with getattr
- (xfs_reclaim_common): don't set v_data to NULL
-
-2000-06-16 Assar Westerlund <assar@sics.se>
-
- * configure.in: check for com_err.h and et/com_err.h
-
- * xfs/linux/bin/arla.init.in: do start and top in a somewhat more
- debian-compatible way. based on a patch from Adrian Bridgett
- <adrian.bridgett@iname.com>
-
- * ydr/lex.h (yylex): add prototype
-
- * arlad/fcache.c (fcache_fhopen, fcache_fhget): do not probe
-
- * configure.in: check for com_err.h and et/com_err.h
-
- * xfs/linux/bin/arla.init.in: do start and top in a somewhat more
- debian-compatible way. based on a patch from Adrian Bridgett
- <adrian.bridgett@iname.com>
-
-2000-06-15 Love <lha@s3.kth.se>
-
- * appl/afsutils/klog.c: backed out cmd changes
-
-2000-06-12 Love <lha@s3.kth.se>
-
- * cf/check-kerberos.m4: do the krb4 extra lib check the same way
- as the krb5 case, there is no need to check for the include, since
- if the user have choose a prefix explicity, they get
- includedir=$prefix
-
-2000-06-12 Assar Westerlund <assar@sics.se>
-
- * arlad/messages.c (break_callback): reset attrusedp and
- datausedp, otherwise we still think they are in use when we turn
- on kernelp again.
-
-2000-06-12 Harald Barth <haba@pdc.kth.se>
-
- * doc/intro.texi: Be more precise about support status
- * doc/arla.info: Follows intro.texi
- * cf/check-kerberos.m4: run AC_KRB{4,5}_{LIB,INC}_WHERE even when
- --with-krb{4,5}=/path is specified
-
-2000-06-10 Assar Westerlund <assar@sics.se>
-
- * lwp/process.sparc.S (sunos4): also define STACK_BIAS
-
- * tests/apwd.c: add verbosity.
- (getcwd_classic): print the correct string in the verbose output
-
- * tests: allow overriding FS
-
- * appl/fs/fs_local.h (PRIMARY_CELL, SETUID_HONORED,
- OBSOLETE_VERSION): redefine in terms of constants from kafs.h
- * appl/fs/fs.c (afs_getcellstatus): use fs_getcellstatus
- (lsmount_cmd, rmmount_cmd): only print error messages when it actually
- failed
-
- * tests/apwd.c: clarify error messages
-
- * arlad/subr.c (dentry2ino): rewrite, hopefully simpler
-
- * arlad/xfs.h: update for new version handling
- * arlad/kernel.c (version_thread): update to new version message
- * arlad/xfs.c: update to new version message
- * xfs: (invalidnode): do not print warnings when node not found.
- (updatefid): add some implementations
- (version): add some handlers
- * xfs/include/xfs/xfs_message.h: make version number-based and not
- capability based. change all modules.
- (XFS_ID_AFSDIR): add new flag for installdata
- (XFS_VERSION): set version
-
- * xfs/linux/xfs_inodeops.c (xfs_readdir): data is not valid when
- trying to read from a bad fake mount point, so do not print
- anything then
-
- * arlad/fcache.c (fcache_get_data): be more careful replacing a
- fake mount-point
- (find_volume): handle cases of missing types of volumes better
-
-2000-06-10 Love <lha@s3.kth.se>
-
- * rx/Makefile.in (rxdebug): added @LIBS@
-
- * lib/cmd/testc.c (main): call set_progname
-
- * tests/rm-rf.c (main): do right with argc
-
- * arlad/xfs.c (*): try do to the right thing from kern_write()
-
- * xfs/linux/xfs_message.c (*): set return values to be negative
-
-2000-06-09 Love <lha@s3.kth.se>
-
- * tests/run-tests.in: use rm-rf instead of rm -rf when removing
- the tree for paranoia resons.
-
- * tests/rm-rf.c (do_dir): if we have afs, try to do fs_rmmount on
- each directory
- (main): check for afs
-
- * appl/fs/fs.c (lsmount_cmd,rmmount_cmd): use fs_\1
- * appl/lib/fs_lib.c (fs_lsmount,fs_rmmount): added, moved from
- fs.c
-
- * arlad/fcache.c (fcache_get_data): set TYPE_LINK when converting
- to a mountpoint
-
- * arlad/messages.c (xfs_message_link): change if #if 1 to #if 0
- that I apprently changed with last commit, changed order of
- free:ing dir_entry
- (xfs_message_symlink): update to new
- break_callback, free dir_entry later
- (*): remove #if 0 code that tried to
- break_callback instead of installing new data.
-
-2000-06-09 Harald Barth <haba@pdc.kth.se>
-
- * doc/authors.texi: spell
-
-2000-06-08 Love <lha@s3.kth.se>
-
- * arlad/fcache.c (invalidator): updated to new style
- break_callback
- * arlad/messages.c (break_callback): make it take a FCacheEntry
- instead of a Fid, now it sets flags.kernelp = FALSE too.
- (*): update all calls to break_callback and updated semantics
- * arlad/messages.h (break_callback): update prototype
-
- * arlad/reconnect.c: fix compiler warnings
- * rx/Makefile.in (include_HEADERS): added rxgencon.h
-
-2000-06-08 Assar Westerlund <assar@sics.se>
-
- * appl/vos/vos_status.c (vos_status): check for server and set
- cell
-
- * appl/bos/bos_status.c (bos_status): check for server and set
- cell
-
-2000-06-08 Love <lha@s3.kth.se>
-
- * doc/partsofarla.texi: expand pioctl stuff
- * doc/servers.texi: point out again the importance of the
- "comments" in the CellServDB file
- * doc/afs-basics.texi: clearify CellServDB and AFSDB
-
-2000-06-08 Harald Barth <haba@pdc.kth.se>
-
- * doc/afs-basics.texi: Added verbs to sentences and other spelling
- business.
- * doc/servers.texi: This should be said somewhere.
-
-2000-06-07 Love <lha@s3.kth.se>
-
- * arlad/fcache.c (fcache_get_data): remove #if 1, that was for -t
- protection
- * arlad/arla.c (main): for -t call xfs_message_init()
- * arlad/kernel.h (kernel_args): remove device_file
- (kernel_device): added prototype
- * arlad/arla.c (main): call kernel_opendevice() where apropriate
- * arlad/kernel.c (kernel_opendevice): break out kern_open of
- kernel_interface
- (kern_interface): add the new "null" interface
- (null_{open,read,write}): "null" interface
-
- * doc/authors.texi: mention rhapsody port and disco code
- * doc/*.texi: spelling
-
-2000-06-05 Harald Barth <haba@pdc.kth.se>
-
- * xfs/linux/xfs_message.c: change XFS{,_ID}_INVALID_DNLC
- * xfs/bsd/xfs_message.c: change XFS{,_ID}_INVALID_DNLC
- * xfs/solaris/xfs_message.c: change XFS{,_ID}_INVALID_DNLC
- * xfs/winnt/src/xfs_message.c: change XFS{,_ID}_INVALID_DNLC
-
-2000-06-05 Love <lha@s3.kth.se>
-
- * ydr/output.c (genin): make input only arguments const
-
- * rxkad/osi_alloc.c (osi_Alloc,osi_Free): add prototype to avoid
- warning
- * rxkad/compat.c: added prototype for initialize_rxk_error_table()
- to avoid warning
-
- * doc/Makefile.in: remove some unused stuff
- * Makefile.in (SUBDIRS): += doc.
-
-2000-06-05 Harald Barth <haba@pdc.kth.se>
-
- * xfs/include/xfs/xfs_message.h: name change:
- XFS{,_ID}_INVALID_DNLC
-
- * lib/bufdir/fdir.h: add const to VenusFid decls
-
- * arlad/messages.c: My compiler didn't like the report_fid
- declaration inside the do { } while when it is used in the while
- expression.
-
- * INSTALL: Added some comments about ports (for all the firewall
- owners)
-
-2000-06-05 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (fcache_get_data): bump in new data for resolved
- mount point
-
- * arlad/fcache.h (FCACHE_VERSION): bump
-
- * arlad: merge in `fake-mp' code
-
-2000-06-04 Love <lha@s3.kth.se>
-
- * doc/afs-basics.texi: spelling, linked in into the tree.
- * doc/arla.texi: added "Description of AFS infrastructure"
-
-2000-06-03 Love <lha@s3.kth.se>
-
- * arlad/cmcb.c (RXAFSCB_InitCallBackState{2,3}): update to new
- definitions
-
-2000-06-02 Love <lha@s3.kth.se>
-
- * cf/krb-version.h: name the file ${PACKAGE}-version.h
- * arlad/arla.c: use <arla-version.h>
-
- * cf/check-kerberos.m4: try to not pollute the cache
- * ydr/output.c (encode_string): change order of %s left
- pharentesis
-
-2000-06-02 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * rxdef/cb.xg: correct initcallbackstate confusion
-
- * rxdef/volumeserver.xg: added constants
-
-2000-06-01 Love <lha@s3.kth.se>
-
- * appl/afsutils/klog.c: cmd-ify
- * appl/afsutils/klog.ctx: help text for mdoc page.
-
- * rx/Makefile.in: add and enable rxdebug, install/install rxdebug
- * rx/rxdebug.c: clean up, made compile
-
- * lib/Makefile.in: add and enable cmd
- * lib/cmd/cmd.c(print_usage): added CMD_MANDOC stuff
- (cmd_PrintSyntaxManDoc): dont print argument twice with one
- command commands
- (*): s,params,parms,
-
- * lib/cmd/*: a cmd parser with mandoc support
-
-2000-05-25 Love <lha@s3.kth.se>
-
- * tests/mkdir: more paranoia
-
-2000-05-24 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_message.c (gc_vnode): use d_prune_aliases
- (d_prune_aliases): define if !LINUX2_3
-
- * arlad/arla.c (print_dir): do not assume that strftime handles %F
- * cf/check-kerberos.m4: empty then-clause makes sh grumpy also add
- some more random libraries when seeking krb5
-
- * xfs/linux/xfs_inodeops.c (xfs_d_delete): make it always return
- an `int'. the signature was changed in 2.3.99-pre9 and this
- should be safer. removing the warning for older code would
- require an autoconf test
- * xfs/linux/xfs_syscalls.c (fhopen_call): declare `error'
-
-2000-05-23 Assar Westerlund <assar@sics.se>
-
- * cf/check-kerberos.m4: make no to everything actually be no
- prepend -L to libraries
- * cf/check-kerberos.m4: handle given and not-given arguments
- better. fix library checking loops
-
-2000-05-23 Love <lha@s3.kth.se>
-
- * appl/lib/fs_lib.c (fs_invalidate): added
- * appl/fs/fs.c: (invalidate_cmd): added
-
- * cf/check-kerberos.m4 (krb5 compat) added KRB4_LIB_DIR
- (krb4) change order of extra libs and KRB4_LIB_DIR
-
- * xfs/linux/xfs_message.c (xfs_message_installnode): sync comment
- with code
-
-2000-05-22 Assar Westerlund <assar@sics.se>
-
- * arlad/volcache.c (get_info_oop): conditionalize the use of
- RXKADEXPIRED
- * arlad/conn.c (conn_rxkad_level): conditionalize on KERBEROS
- * tests/*.c: always call set_progname. make all tests buildable
- even without KERBEROS
-
- * xfs/linux/xfs_vfsops.c (make_root): no need to set valid to
- zero, since it's done in xfs_d_init
- * xfs/linux/xfs_syscalls.c (fhopen_call): call get_write_access
- * arlad/messages.c: make sure that all sub-functions of
- xfs_message_pioctl either send a wakeup themselves or that they
- get breaked from the switch and get handled at the end of
- xfs_message_pioctl.
-
- * tests/rename-under-feet.c (child_chdir): print cwd to fd 4
- * tests/run-tests.in (ARLA_TESTS): add rename-under-feet
- * tests/rename-under-feet.c (kill_child): do not be that brutal
- * tests/rename-under-feet.c (child_chdir): remember to exit in
- child
- * tests/rename-under-feet.c (child_chdir): print cwd in child
- * tests/rename-under-feet.c (child_chdir): invert fork-condition
- * tests/rename-under-feet.c: new test
-
-2000-05-19 Assar Westerlund <assar@sics.se>
-
- * rxdef/Makefile.in (CLIENTSONBJS): add bos.cs.o
-
-2000-05-19 Love <lha@s3.kth.se>
-
- * arlad/arla.c (print_dir): verbose info
- (arla_ls): ls -l
-
-2000-05-18 Love <lha@s3.kth.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_d_delete): remove unused code
-
-2000-05-18 Assar Westerlund <assar@sics.se>
-
- * lib/ko/Makefile.in (LIBS): add all the known (and required libs)
-
-2000-05-16 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs/xfs_locl.h (xfs_root): replace with
- xfs_replace_root
- * xfs/linux/xfs_inodeops.c (xfs_d_validate): rename to
- xfs_d_revalidate
- (xfs_as_writepage, xfs_as_readpage): update to signatures as of
- 2.3.99-pre8
- (try_replacing): new function that tries to do a root-swap when it
- detects that we're using a fake root
- (xfs_dead_lookup): use try_replacing
- * xfs/linux/xfs_vfsops.c (make_root): install the new root before
- replacing it
- * xfs/linux/xfs_vfsops.c (xfs_replace_root): new function for
- replacing the root with a new one. this just replaces the
- `xfs_node' part of the root inode.
- (make_root_vnode): new function for making a `fake' root node
- * xfs/linux/xfs_node.c (clear_xfs_node): correct debug output to
- print the correct function name
-
- * arlad/volcache.c (get_info_loop): make sure we re-try correctly
- when we get back `token expired'
-
- * ydr/output.c: handle the case of OUT parameters of type STRING
- <>. they need to be `char **' and not only `char *'. also fix
- problem with not passing STRINGs correctly to server-side work
- functions.
- * ydr/types.h (enum argtype): make named
-
- * rxdef/bos.xg: correct error codes and opcodes
-
-2000-05-15 Love <lha@s3.kth.se>
-
- * Release 0.33.1
-
- * appl/lib/arlalib.c (arlalib_get_token_id): new function
-
- * tests/run-tests.in (ARLA_TESTS): added kotest
- * tests/kotest: added new test
- * lib/ko/Makefile.in: added kotest target
- * lib/ko/kocell.c (cell_expand_cell): add new function, inspired
- by allbery <allbery@ECE.CMU.EDU>
-
- * cf/check-kerberos.m4 (AC_KRB4_LIB_WHERE1): break for-loop if
- entry found
-
-2000-05-15 Assar Westerlund <assar@sics.se>
-
- * appl/afsutils/klog.c (afs_id): use arlalib_get_token_id_servers
- * appl/lib/arlalib.c (arlalib_get_token_id_servers): add
- (arlalib_get_token_id): fix
-
- * arlad/kernel.h (kern_read, kern_write): update prototypes
-
- * include/kafs.h (_PATH_ARLA_VICE): add
-
-2000-05-14 Assar Westerlund <assar@sics.se>
-
- * arlad/kernel.c (*_read, *_write): change signatures to those of
- read and write
-
- * xfs/linux/Makefile.in (uninstall): remove SHARED_LIBS
- * conf/Makefile.in (CONF_FILES): add SuidCells
- * conf/SuidCells: add a default (empty)
-
- * tests/rm-rf.c, tests/kill-softly.c, tests/kill-softer.c: single
- unix standard (and probably posix) says that unlink(directory)
- should return EPERM and not EISDIR. accept both.
-
- * make-release, make-relase.el: new files
-
- * xfs/bsd/xfs_vfsops-common.c (xfs_mount_common): we always have
- vfs_getnewfsid in all support OSes. same thing with struct
- fstatfs.f_fstypename
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhtovp): current should probably
- be curproc. adding missing \n
-
- * xfs/*/xfs_syscalls*.c (remote_pioctl): convert ENODEV
- into EINVAL, otherwise kafs does not think there's pioctl support
- when arlad is not alive
-
-2000-05-12 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_syscalls.c (user_path2dentry): new function that's
- basically namei, but implemented different on 2.3 and earlier.
- (sys_afs_int): just map ENODEV to EINVAL (otherwise kafs is unhappy)
-
- * xfs/linux/xfs_message.c (xfs_message_installdata): use
- path_init/path_walk on 2.3 (lookup_dentry is dead).
- * xfs/linux/xfs_vfsops.c (xfs_read_super): use path_init/path_walk
- on 2.3 (lookup_dentry is dead).
-
-2000-05-12 Love <lha@s3.kth.se>
-
- * xfs/winnt/bin/xfs-helper.c: added tcp-forwarder
- * lwp/plwp.c: (LWP_INT_WAIT): change windows code
-
- * xfs/winnt/bin/makefile: add more tools
-
- * arlad/xfs.c: use kern_write
- * arlad/kernel.[ch]: new kern interface
-
- * xfs/winnt/README: osr tools have moved
-
-2000-05-10 Love <lha@s3.kth.se>
-
- * appl/fs/fs.c (arladebug_cmd, xfsdebug_cmd): try to be nicer when
- parseing commandline
-
-2000-05-09 Love <lha@s3.kth.se>
-
- * cf/check-kerberos.m4 (AC_KRB4_LIB_WHERE1): added fbsd security
- compat (req com_err)
-
-2000-05-09 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_dev-common.c (xfs_message_rpc): separate device was
- closed from we got signal so we do not have to lie to the user
-
- * xfs/bsd/xfs_wrap-bsd.c (SYSCALL_MODULE): set `xfs_sycall_num' so
- all syscall installations work the same way
- * arlad/fcache.c (real-extra_file_name): a new function that does
- not do any checks and does the real work of fcache_extra_file_name
-
- * xfs/bsd/xfs/xfs_locl.h (osf): add forward declaration of struct
- vop_generic_args
-
-2000-05-07 Love <lha@s3.kth.se>
-
- * xfs/bsd/xfs_dev-common.c (xfs_cursig): osf glue
- (xfs_message_rpc, xfs_devread): use xfs_cursig
- * xfs/bsd/xfs_message.c (xfs_message_invalidnode): osf compat for
- v_writecount
- * xfs/bsd/xfs_dev-common.c (xfs_message_rpc): osf compat with
- P_WEXIT
- * lwp/make-process.o.sh.in (HOST_CPU): use globing for alpha
- * configure.in (osf): enable to use a specific build-tree
-
-2000-05-07 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (fcache_create_file): unlink the (potential)
- extra directory
- (fcache_recover_state): bump current_vnodes
-
- * xfs/bsd/xfs_dev-common.c (xfs_message_rpc): set catch correctly
-
- * xfs/linux/xfs_dev.c (xfs_devopen, xfs_devclose, xfs_devread,
- xfs_devwrite, xfs_devpoll): do lock and unlock kernel. the new
- world order requires us to do the locking here ourselves. this
- should not be a problem with older kernels, since we should be
- able to call lock_kernel with the kernel already locked.
-
-2000-05-06 Assar Westerlund <assar@sics.se>
-
- * appl/fs/fs.c (listcells_cmd): try to correct usage
- (afs_listcells): cells begin with one, not zero
-
-2000-05-02 Love <lha@s3.kth.se>
-
- * xfs/winnt/src/xfs_deb.c (xfs_log): new version
- * tests/ga-test.c: make things arg_mandatory so they can be
- automagicly matched
-
-2000-05-02 Love <lha@s3.kth.se>
-
- * Release 0.33
-
-2000-05-01 Harald Barth <haba@pdc.kth.se>
-
- * appl/lib/Makefile.in: ln -s gets upset if the (target) file
- exists
-
- * lib/acl/Makefile.in: removed roken_rename.h rule.
-
-2000-05-01 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_message.c (xfs_message_installnode): if installing
- on a positive dentry that already has the inode that we're
- installing, set the dentry to valid.
-
- * xfs/bsd/xfs_vfsops-*bsd.c: use standard locking for dead vnodes
- * xfs/bsd/xfs_wrap-bsd.c (xfs_mod): print assigned numbers
-
- * appl/amon/Makefile.in (AMON_LIBS): re-order X libraries
-
-2000-05-01 Love <lha@s3.kth.se>
-
- * configure.in: dectect netbsd1.4.2 and build everything static
- * INSTALL: note on netbsd1.4.2
-
-2000-04-30 Love <lha@s3.kth.se>
-
- * xfs/linux/xfs_dev.c (xfs_fops): use new style struct init
- (*): break long lines
-
- * xfs/linux/xfs_inodeops.c (xfs_dentry_operations):
- s,d_validate,d_revalidate,
-
-2000-04-30 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c: correct some debug print update to new StoreData
- (add_to_invalidate): remove if already there
- * rxdef/fs.xg (StoreData): does not actually return a callback
-
- * xfs/linux/xfs_inodeops.c (xfs_dentry_operations): use new-style
- struct initialization
- (xfs_readdir): print more errors
- * xfs/linux/xfs_vfsops.c (xfs_sops): use new-style struct
- initialization
-
- * arlad/messages.c (xfs_message_rename): install data for child
- directory when needed
- * arlad/inter.c (cm_rename): if we're moving a directory between
- two directories, we need to fixup `..'
- * lib/bufdir/fdir.c (fdir_changefid): remove unused argument
- * tests/rename5.c: new test
-
-2000-04-29 Assar Westerlund <assar@sics.se>
-
- * cf/check-kerberos.m4: change include order when testing for krb5
- compat
-
- * configure.in: check for old libkafs
- * appl/afsutils/klog.c (get_afs_token): optionally call
- k_afslog_uid (old name for krb_afslog_uid)
-
- * xfs/linux/xfs/xfs_locl.h (I_BLOCKS_BITS): define
- * xfs/linux/xfs_node.c (xfs_attr2inode): use >> instead of / to
- calculate # of blocks to make old gcc happy
- * xfs/linux/xfs_inodeops.c (update_from_cache_node): new function
- to update inode when cached node has changed. call it.
-
-2000-04-28 Love <lha@s3.kth.se>
-
- * xfs/linux/bin/arla.init.in: Added support for SuSE && YaST, add
- some documentation
-
- * xfs/winnt/inc/xfs_type.h: clearify what cpu we want (or not)
- * xfs/winnt/src/sources (SOURCES): added xfs.rc
- * xfs/winnt/src/xfs_vops.c: remove some warnings
- * xfs/winnt/src/xfs_init.c: move around and make it work
-
-2000-04-28 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (add_to_invalidate): cancel the potential
- sleeping beauty/beast (or invalidator)
-
- * xfs/linux/xfs_vfsops.c (xfs_read_super): use the LOOKUP_POSITIVE
- constant instead of just `1'
- * xfs/linux/xfs_syscalls.c (fhopen_call): use dentry_open for 2.3
- * xfs/linux/xfs_message.c (xfs_message_installdata): use
- lookup_dentry for 2.3 now that it has been exported (in
- 2.3.99pre6)
-
-2000-04-27 Love <lha@s3.kth.se>
-
- * xfs/bsd/xfs/xfs_syscalls.h: export xfs_syscall_num
- * xfs/bsd/xfs_syscalls-wrap-freebsd.c (*):
- s,syscall_offset,xfs_syscall_num,
- * xfs/bsd/xfs_syscalls-wrap-bsd.c (*):
- s,syscall_offset,xfs_syscall_num,
-
-2000-04-26 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * INSTALL: Added note about Mac OS X
-
- * xfs/bsd/bin/startarla.in: Added Mac OS X support
-
-2000-04-23 Assar Westerlund <assar@sics.se>
-
- * configure.in (freebsd): always add `-O' to make the xfs module
- compile. See FreeBSD PR kern/17614
-
-2000-04-22 Assar Westerlund <assar@sics.se>
-
- * configure.in (freebsd): add `-mno-fp-regs' on alpha
-
-2000-04-20 Assar Westerlund <assar@sics.se>
-
- * arlad/inter.c (cm_rename): use VenusFid_cmp when comparing old
- and new parent fid so that we actually perform a full comparison
-
-2000-04-20 Love <lha@s3.kth.se>
-
- * tests/append-over-page.c: define MAP_FAILED for those whom lack
- it
- * configure.in: enable us to build lwp with windows threads,
- pthread and asm threads on cygwin
- * lwp/testlwp.c (main): do exit where approriate
- * lwp/plwp.c: define and use lwp_timerclear instead of timerclear
- * lwp/lock.h: clean up
- * xfs/winnt/README: expand what ddk you'll need
-
- * xfs/winnt/README: expand what ddk you'll need
-
-2000-04-19 Assar Westerlund <assar@sics.se>
-
- * tests/mmap-shared-write.c: new test
-
-2000-04-19 Love <lha@s3.kth.se>
-
- * cf/check-kerberos.m4: changed order of exporting varibles of
- krb5 and krb4 define kerberos in case we have krb5(only) too.
- rewrite krb5 compat stuff, and tune to death
-
- * tests/mkm-rmm: use setacl and more paranoia
-
- * conf/CellServDB (rhic): updated
-
-2000-04-19 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/bin/startarla.in: call mknod for 128,0 if we're using an
- KLD module, because that for now means FreeBSD. Since kern/9478
- has been laying waiting for over a year and since we always use
- that number, we might anyways just do that.
-
- * tests/mmap-shared-write.c: new test
-
-2000-04-18 Love <lha@s3.kth.se>
-
- * cf/check-kerberos.m4: clean up, change order of krb5 and krb4
- test, make it work ?
-
-2000-04-16 Assar Westerlund <assar@sics.se>
-
- * lwp/make-process.o.sh.in: allow overriding of CC, GCC, CPP, and
- AS
-
- * xfs/linux/xfs_syscalls.c (fhget_call, xfs_fh_to_dentry): change
- to make up the file-handle of
- (dev,inode,gen).
- (fhopen_call): first cut at opening files in 2.3.99-pre5
- * xfs/linux/xfs_message.c (xfs_message_installdata): skip using
- open_namei and instead do walk_init/walk_name for 2.3.99-pre5
- * xfs/linux/xfs_vfsops.c (xfs_read_super): lookup_dentry changed
- in 2.3.99pre-n (for some value of n).
-
- * arlad/messages.c (xfs_message_remove): don't set the data token
- when installing the limbo entry if data is not installed
-
-2000-04-14 Assar Westerlund <assar@sics.se>
-
- * tests/fs-sa-la: redirect output to avoid it without -verbose
- * arlad/fcache.c (setacl): release the FCacheEntry if we fail
- * arlad/messages.c (xfs_message_remove): don't return a bogus
- error when it was actually succesful
-
-2000-04-13 Love <lha@s3.kth.se>
-
- * test/fs-sa-la: new test
-
- * xfs/linux/xfs_inodeops.c (xfs_follow_link): changed for
- 2.3.99-pre4
-
- * xfs/linux/xfs_message.c (xfs_message_installdata): changed
- open_namei workings for 2.3.99-pre4
-
-2000-04-12 Love <lha@s3.kth.se>
-
- * arlad/messages.c (xfs_message_remove): do installattr instead of
- installnode now that we have disabled the warning message in
- installattr.
-
-2000-04-03 Love <lha@s3.kth.se>
-
- * tests/mkm-rmm: mount-point tests
-
-2000-04-03 Assar Westerlund <assar@sics.se>
-
- * appl/pts/pts.c (*): use arlalib_try_next_db
- * appl/lib/arlalib.h (arlalib_try_next_db): add prototype
- * appl/lib/arlalib.c (arlalib_try_next_db): add
-
- * arlad/inter.c (cm_ftruncate): make sure we have the data before
- truncating to non-zero length
-
- * arlad/fcache.c: revert the try_next_fs part of last commit
- * arlad/fcache.c (stale): remove clearing of `datap', only done in
- `throw_data'
- (*): clarify find_first_fs - find_next_fs loop
- * appl/lib/arlalib.c (arlalib_first_db): allow explicit `host'
- (NULL means pick from cell-db)
-
- * appl/pts/pts.c: make remaining functions loop over db's. allow
- all commands to use a specified db server. const-ize some.
- * appl/pts/pts.c (pr_create, create_cmd): add `-owner'
- * appl/pts/pts.c (*): make all arg_printusage print the
- sub-command before the options
- * appl/pts/pts.c (pr_create): write debug correctly
- * appl/pts/pts.c (pr_create): make the handling of `id' more
- obvious/correct/something
-
- * xfs/solaris/xfs_vnodeops.c (xfs_setattr): only send length and
- mtime if we actually have data
- * xfs/bsd/xfs_vnodeops-common.c (xfs_setattr_common): only send
- length and mtime if we actually have data
-
- * xfs/linux/xfs_vfsops.c (xfs_notify_change): only send length and
- mtime if we actually have data
- * xfs/linux/xfs_inodeops.c (xfs_setattr): only send length and
- mtime if we actually have data
-
- * xfs/linux/*.c: add (int) casts where required for
- %.*s format strings
-
-2000-04-01 Assar Westerlund <assar@sics.se>
-
- * xfs/*/xfs_dev.c (xfs_devread): only return entire messages
-
- * xfs/bsd/xfs_dev-common.c: add come const-ness
- (xfs_devread): print the signal that interrupted us
-
-2000-03-28 Assar Westerlund <assar@sics.se>
-
- * appl/lib/arlalib.h (db_server_context): remove synchost and
- nconn
-
- * appl/lib/arlalib.c (arlalib_first_db, arlalib_next_db,
- free_db_server_context): new functions for looping over all
- database servers. From Harald Barth <haba@pdc.kth.se>
- * appl/pts/pts.c (examine_cmd, pr_adduser): use arlalib_first_db,
- arlalib_next_db to iterate over all db servers.
- (pr_create_user): loop over db servers
- * appl/lib/arlalib.h (db_server_context, arlalib_first_db,
- arlalib_next_db, free_db_server_context): add
-
-2000-03-27 Love <lha@s3.kth.se>
-
- * xfs/linux/xfs/xfs_node.h (struct xfs_node): added coments
-
- * INSTALL: add --with-sys=dir and KERNEL_CFLAGS
-
-2000-03-25 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs/xfs_node.h (struct xfs_node): remove unused field
- `i_ino'
-
- * xfs/linux/xfs_inodeops.c (xfs_readdir): ignore deleted entries
- with fileno == 0
- * configure.in (solaris): add test for vfsops.vfs_freevfs
- * xfs/solaris/xfs_vfsops.c (xfs_freevfs): add on solaris8
- * xfs/solaris/bin/mount_xfs.c: upgraded to be compatible with the
- large changes in solaris 8 (in other words, do not print any
- warnings if opening /etc/mnttab fails with ENOSYS)
-
- * xfs/linux/xfs_dev.c (xfs_message_rpc): print out the signal we
- got interrupted by
-
- * tests/readdir-vs-lstat.c (verify_inodes): do not care if we're
- not allowed to stat
- * tests/kill-softly.c (kill_one): both possitive and negative
- checks
- * tests/kill-softer.c (kill_one): both possitive and negative
- checks
-
- * configure.in: add freebsdelf* (new sysname invented by the new
- version of config.guess). also add netbsdelf*
-
- * xfs/linux/xfs_vfsops.c (xfs_notify_change): set size for regular
- files and always mtime. move down inode_setattr.
- * xfs/bsd/xfs_vnodeops-common.c (xfs_setattr_common): set size on
- regular files and always mtime. let `vap' have priority over
- xn->attr
- * xfs/solaris/xfs_vnodeops.c (xfs_setattr): always copy size and
- mtime, they can be more current. only use seconds parts of mtime
- time stamp. only set size on regular files. let `vap' have
- priority over xn->attr
-
- * arlad/messages.c (xfs_message_remove): use `limbo_status' and
- not the potentially bad limbo_entry->status
-
-2000-03-25 Love <lha@s3.kth.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_write_file): make it work again
-
-2000-03-24 Marcus Sundberg <mackan@stacken.kth.se>
-
- * xfs/linux/xfs_dev.c:
- Removed check for HAVE_STRUCT_FILE_OPERATIONS_FLUSH as it's not
- defined anymore.
- Changed xfs_devselect -> xfs_devpoll.
-
- * xfs/linux/xfs_inodeops.c:
- Fix typo (generic_read_file -> generic_file_read).
- Fixed warnings about unused declarations.
-
- * xfs/linux/xfs_load.c:
- Need to unregister_filesystem() if we can't register xfs0 device.
-
-2000-03-24 Love <lha@s3.kth.se>
-
- * xfs/linux/xfs_inodeops.c: move functions around to make blocks
- of !LINUX2_3 code, start to use generic_file_{read,write} for
- linux 2.3, added more comment headers
-
- * configure.in: removed test for getattr and setattr for linux
-
-2000-03-24 Assar Westerlund <assar@sics.se>
-
- * tests/append-over-page.c: new test
-
- * xfs/bsd/bin/mount_locl.h: add "xfs" for Darwin/MacOS X, and do
- #error if MOUNT_XFS is not defined
- * xfs/bsd/Makefile.in (xfs_vopdefs.h): generate from vnode_if.h
- instead of vnode_if.src
- (which might not always be present)
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhlookup): initialize the vm
- object on Darwin/MacOS X
-
-2000-03-24 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * lwp/process.m68k.S: Remove bogus .globl Added _C_LABEL around
- PRE_Block
-
-2000-03-24 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_node-bsd.c (xfs_cnp_init): handle the different hash
- function used on Darwin/MacOS X
-
- * xfs/bsd/xfs_dev-bsd.c (xfs_install_device): create devfs nodes
- for Darwin/MacOS X. also remove them in xfs_uninstall_device
-
-2000-03-22 Love <lha@s3.kth.se>
-
- * xfs/bsd/xfs_syscalls-wrap-bsd.c:
- s,HAVE_SYS_LKMNOSYS,HAVE_KERNEL_SYS_LKMNOSYS,
-
-2000-03-21 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_dev-bsd.c (xfs_install_device): return error if
- installing cdev fails
-
-2000-03-21 Love <lha@s3.kth.se>
-
- * xfs/bsd/xfs_dev-bsd.c (xfs_uninstall_device): cdevsw_remove
- return the entry it operated on or -1.
-
-2000-03-18 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/bsd/*.c, xfs/bsd/xfs/*.h: More MacOS stuff
-
- * xfs/bsd/xfs/xfs_wrap.h, xfs/bsd/xfs_info.c,
- xfs/bsd/xfs_vfsops-macos.c: Added file
-
-2000-03-20 Assar Westerlund <assar@sics.se>
-
- * appl/udebug/udebug.c: add `-long' mode. based on a patch from
- Dr A V Le Blanc <LeBlanc@mcc.ac.uk>
-
- * tests/run-tests.in: replace date +%s with date
- +%Y-%m-%d-%H-%M-%S
-
-2000-03-19 Love <lha@s3.kth.se>
-
- * xfs/linux/xfs_inodeops.c: major cleanup of operations struct's
-
- * tests/kill-softly.c: removed unused varible
-
- * xfs/linux/xfs/xfs_locl.h: implement DECLARE_FSTYPE for linux
- pre-2.3 add XFS_RESET_I_MAPPING
-
- * xfs/linux/xfs_vfsops.c (xfs_{get,put}_super):
- MOD_{INC,DEC}_USE_COUNT is done i vfs now
-
- * xfs/linux/xfs_load.c (xfs_fs_type): use DECLARE_FSTYPE
-
- * xfs/linux/xfs_message.c (xfs_message_installdata): use
- __open_namei for 2.3.99, set i_mapping for the xfs-node, clean
- printf's
- (xfs_message_invalidnode): clean i_mapping when loosing node
-
- * xfs/linux/xfs_inodeops.c (xfs_readlink): implement with
- page_readlink i 2.3
- (xfs_follow_link): implement with page_follow_link i 2.3
- (*): clean up
- (xfs_readdir): implement readdir with buffer-cache in 2.3
- (xfs_as_*): Opps when called
-
- * tests/run-tests.in: added date to tmpdir
-
- * xfs/linux/xfs_vfsops.c (xfs_statfs): update header
-
-2000-03-18 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs/xfs_locl.h (xfs_set_vp_size): introduce a generic
- macro for setting the size of a vnode. use it.
- * xfs/bsd/xfs_message.c (xfs_message_installdata): call
- uvm_vnp_setsize with UVM
- * xfs/bsd/xfs_vnodeops-bsd.c (cleanup_cnp): add FREE_ZONE for
- macosx. add xfs_pagein and xfs_pageout. add some more ifdefs and
- debugs
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_dead_lock): add hopefully the
- minimal amount of locking required for dead nodes
- * xfs/bsd/xfs_dev-common.c (xfs_message_rpc): handle the special
- case of the process cleaning up, in that case we cannot catch
- signals while sleeping
- * xfs/bsd/xfs_dev-bsd.c (xfs_uninstall_filesys): add debug print
- * xfs/bsd/xfs_common-bsd.c (xfs_alloc, xfs_free): use MALLOC and
- FREE, they exist everywhere
-
- * tests/mmap-vs-read.c, tests/mmap-vs-read2.c: new tests
- * tests/exit-wo-close.c: new test
- * tests/dd: avoid running test if there's no /dev/zero
-
-2000-03-18 Love <lha@s3.kth.se>
-
- * configure.in: Added test for vfsops.vfs_done
-
- * xfs/bsd/xfs_vfsops-netbsd.c (xfs_vfsops): added vfs_done field
- (xfs_done): added
-
- * conf/CellServDB (postech.ac.kr): updated
-
-2000-03-18 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/bsd/*.c: Change all %p to %lx
-
-2000-03-17 Assar Westerlund <assar@sics.se>
-
- * rx/rx.h: use rxgencon.h.
- * ydr/output.c (generate_server_switch): return RXGEN_OPCODE if an
- unknown opcode is received. From David Sanderson
- <david@transarc.ibm.com>
-
- * tests/apwd.c: new file
- * tests/Makefile.in: add apwd
-
-2000-03-16 Assar Westerlund <assar@sics.se>
-
- * configure.in: call AC_BSD_HEADER_VNODE_IF_H and remove old code
- for setting VNODE_IF_H
-
- * xfs/bsd/Makefile.in (MODULE_OBJS): use @VNODE_IF_H@
- * configure.in (VNODE_IF_H): set and subst
-
-2000-03-16 Love <lha@s3.kth.se>
-
- * appl/afsutils/klog.c (main): alway set KRBTKFILE
- From Chris Wing
-
- * conf/CellServDB (src.uchicago.edu): updated
- (rhic): updated
-
-2000-03-15 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_syscalls-wrap-freebsd.c
- (install_first_free_syscall): try_install_syscall returns 0 on
- success
- (from xfs_syscalls-wrap-bsd.c:1.6)
-
- * arlad/solaris-subr.c (flushbuf): always use `struct dirent64'
-
-2000-03-13 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * configure.in: Set MODLOAD/MODUNLOAD in BSD. More MacOS
- stuff. Include sys/time.h when including sys/proc.h.
-
- * xfs/bsd/Makefile.in: Use the autoconf variable MODLOAD
-
-2000-03-11 Love <lha@s3.kth.se>
-
- * appl/afsutils/*: Fixes by Chris Wing
-
- * lib/roken/getarg.[ch]: Chris Wing's arg_generic_string patch
-
- * xfs/include/xfs/xfs_messsage.h: cygwin glue
-
-2000-03-11 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * (install_first_free_syscall): try_install_syscall returns 0 on
- success
-
-2000-03-10 Assar Westerlund <assar@sics.se>
-
- * Release 0.32
-
-2000-03-10 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_vfsops.c (xfs_statfs): in 2.3.51, `struct statfs'
- should not be copied to user-space, it's done by vfs_statfs
- instead
-
- * arlad/fcache.c (getacl, setacl): store the retrieved status in
- the fcache entry
-
- * arlad/messages.c (xfs_message_remove): work-around problems with
- silly-flag
- (xfs_message_rmdir, xfs_message_rename): try do dir_remove_name
-
- * arlad/solaris-subr.c (dir_remove_name): use an maximal d_reclen
- of DIRBUF.
-
- * appl/fs/fs.c (internal_mp): always follow symlinks when calling
- pioctl
-
- * arlad/solaris-subr.c (dir_remove_name): using a too large
- d_reclen is bad because readdir() can't cope with it being larger
- than the buffer size that's being used by opendir/readdir. so
- let's take DIRBUF (defaulting to 1048) as a conservative estimate
-
- * xfs/solaris/xfs_dev.c (xfs_chpoll): always initialize return
- values. print correct function name in debug output.
-
-2000-03-07 Assar Westerlund <assar@sics.se>
-
- * rxkad/compat.c: merge from krb4: fix incompatible protos
- * xfs/linux/Makefile.in (SHARED_LIBS): set unconditionally to
- libgetcwd.so. We assume that there's always a getcwd. based on a
- bug report by Dave Morrison <dave@bnl.gov>
-
- * arlad/messages.c (xfs_message_remove): move up the setting of
- the silly flag to before get_attr, otherwise that call might fail.
-
-2000-03-07 Love <lha@s3.kth.se>
-
- * util/log.c (log_open): when not finding the log, return NULL
- * arlad/arladeb.c (arla_loginit): fail when there is no valid log
-
-2000-03-06 Love <lha@s3.kth.se>
-
- * xfs/linux/xfs_load.c (init_xfs_fs): no code after ret
-
-2000-03-04 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * configure.in, lib/roken/signal.c, xfs/rhapsody/Makefile.in,
- xfs/rhapsody/xfs_wrap.c, xfs/rhapsody/xfs/kernelServer.h: Mac OS
- support
-
-2000-03-04 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_vfsops.c (make_dead_vnode): set `i_fop' on 2.3.x
- * xfs/linux/xfs_inodeops.c: fix up opreations vectors
- * xfs/linux/xfs_node.c (xfs_iget): conditionalize setting of
- `i_fop'
- * xfs/linux/xfs_node.c (xfs_iget): set inode->i_fop
- * xfs/linux/xfs_message.c (xfs_message_installdata): set mapping
- of the node to be that of the cache node.
- * xfs/linux/xfs_inodeops.c: adapt for 2.3.x (add address_space and
- other stuff)
-
- * xfs/linux/xfs_inodeops.c (xfs_release_file): consider the vnode
- as dirty if the cache node is
-
- * xfs/linux/xfs_inodeops.c (xfs_release_file): make debug prints
- correct. don't invalidate pages on 2.3.x
-
- * xfs/linux/xfs_message.c (xfs_message_installnode): use
- full_name_hash - always works now
- * xfs/linux/xfs_inodeops.c: unifdef some
- * xfs/linux/getcwd.c: unifdef -UHAVE_STRUCT_NEW_STAT
- * configure.in (linux): remove unused tests
-
- * xfs/linux/bin/mount_xfs.c: new program
- * xfs/linux/bin/Makefile.in: add mount_xfs.
- (clean): remove arla and not arla.init
- * xfs/linux/xfs_vfsops.c (xfs_read_super): make reading of minor
- device number work correctly
- * xfs/linux/xfs_vfsops.c (xfs_root): look at minor number
- (xfs_read_super): make into three arguments. look at data if != NULL.
- (xfs_put_super): look at minor number
- * xfs/linux/xfs_dev.c (xfs_devread, xfs_devwrite, xfs_devselect):
- look at the minor device
- (xfs_print_sleep_queue): print sleep queues for all minor devices
-
- * xfs/linux/xfs_load.c (xfs_read_super): remove conditional
- * configure.in (AC_LINUX_FUNC_READ_SUPER_FOUR_ARGS): remove. not
- used any longer
-
-2000-03-04 Love <lha@s3.kth.se>
-
- * arlad/arla.c: add checkservers to testmode
-
-2000-03-02 Love <lha@s3.kth.se>
-
- * conf/CellServDB (ir.stadford.edu): renumber networks.
-
- * ydr/output.c (encode_string): make it alway not fail in the
- DECODE_RX case
-
-2000-03-01 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_getattr, xfs_setattr): implement
- (xfs_write_file): set inode attributes even on 2.3
-
- * configure.in: test for inode_operations.default_file_ops
- * configure.in (linux): test for super_operations.notify_change
- * configure.in (linux): test for 2.3x getattr and setattr
-
- * xfs/linux/xfs_vfsops.c (xfs_delete_inode): always clear the
- inode
-
-2000-03-01 Love <lha@s3.kth.se>
-
- * xfs/linux/bin/Makefile.in (install): create @sysconfdir@ from
- Tino Schwarze <tino.schwarze@informatik.tu-chemnitz.de>
-
-2000-02-29 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_node-bsd.c (xfs_cnp_init): let it make some sense
- (xfs_dnlc_enter_name): use `xfs_cnp_init'
-
-2000-02-28 Assar Westerlund <assar@sics.se>
-
- * xfs/solaris/xfs_vnodeops.c (xfs_rename): ignore errors if we
- fail to remove the `new' file
- (xfs_rmdir): remove the directory from the dnlc
-
- * tests/rename3: new test
-
- * xfs/linux/xfs_syscalls.c (xfs_debug_print): print # of nodes
- with XDEBNODE and no node
-
-2000-02-26 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (getvolstat): if RXAFS_GetVolumeStatus does not
- actually return a volume name, get it from the vldb instead
-
-2000-02-26 Assar Westerlund <assar@sics.se>
-
- * Release 0.31
-
-2000-02-26 Assar Westerlund <assar@sics.se>
-
- * xfs/solaris/xfs_node.c (xfs_dnlc_lookup): always return the node
- holded
- * xfs/solaris/xfs_syscalls.c: more debug prints
- * xfs/solaris/xfs_vnodeops.c (xfs_lookup): don't hold, already
- done by dnlc_lookup
- (xfs_remove): remove dnlc entry for non-existant node
- * xfs/solaris/xfs_message.c (xfs_message_installdata): always
- clear dnlc if XFS_INVALID_DNLC
- (gc_vnode): prune dnlc when count <= 1 -> hopefully it will relase
- nodes
-
-2000-02-24 Assar Westerlund <assar@sics.se>
-
- * configure.in (openbsd): use the same make magic as netbsd
- * xfs/bsd/xfs_vnodeops-common.c (xfs_inactive_common): don't send
- any message to the daemon. recycle the node immediately if it's
- not valid.
- * xfs/bsd/xfs_message.c (xfs_message_invalidnode): only send
- message on last close. only invalidate name cache for children.
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_eopnotsupp, xfs_returnzero):
- print name of operation
-
- * xfs/linux/xfs_vfsops.c (xfs_delete_inode): always queue
- inactivation
- * xfs/linux/xfs_dev.c (xfs_queue_inactive): remove `chan'
- * xfs/linux/xfs_dev.c (xfs_queue_inactive,
- xfs_empty_inactive_queue): take `xfs_channel *' instead of `int'
- * xfs/linux/xfs_dev.c (xfs_empty_invalid_queue): rename to
- xfs_process_inactive_queue
- (xfs_empty_invalid_queue): new function to throw away nodes
- (xfs_devclose): call xfs_empty_invalid_queue
- * xfs/linux/xfs/xfs_common.h (XFS_MEM_XFSCACHE): remove, not used
- any longer
- * xfs/linux/xfs_common.c (xfs_tell_alloc): use printk consistenly
- * xfs/linux/xfs_inodeops.c (xfs_create, xfs_symlink, xfs_mkdir):
- set the gid
- * xfs/bsd/bin/startarla.in: add `-z' to arlad to be conservative
- * configure.in: add testing for int16 and u_int16
- * xfs/bsd/xfs_wrap-bsd.c (xfs_mod): add prototype (warn-hunting)
- * xfs/bsd/xfs_vnodeops-common.c (xfs_symlink_common): extra const
- (more warning-hunting)
- * xfs/bsd/xfs_vfsops-common.c (xfs_unmount_common): move out
- doforce as part of warning hunt
-
-2000-02-20 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vnodeops-osf.c (xfs_getpage): make it build on OSF5
- * xfs/bsd/xfs_vfsops-osf.c (xfs_fhtovp): try to handle both
- U_FD_SET and u_set_fe
- * xfs/bsd/xfs/xfs_fs.h: rename pag_t -> xfs_pag_t try to handle
- OSF that has `struct mount.m_info' instead of `m_data'
- * configure.in (osf): add test for ubc_lookup
- * configure.in (bsd): check for `struct mount.m_info'
- * configure.in: separate kernel_CFLAGS into kernel_CFLAGS and
- kernel_CPPFLAGS
- * configure.in: conditionalize <sys/cdefs.h>
- * configure.in (osf): cpus.h does not exist in all versions of
- OSF. try inet.h instead.
-
-2000-02-16 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs/xfs_node.h (xfs_node): add `invalid_list'
- * xfs/linux/xfs_vfsops.c (xfs_delete_inode): if we fail to send an
- inactive node message
- (typically, because of out of memory), clear the node and add it to
- the inactive list
- * xfs/linux/xfs_node.c (new_xfs_node): initialize `invalid_list'
- (clear_xfs_node): does all that free_xfs_node does except the actual
- freeing
- * xfs/linux/xfs_inodeops.c (xfs_d_init): check xfs_alloc for
- failure. changed into returning error. change callers.
- * xfs/linux/xfs_dev.c (xfs_channel): add `invalid_list'
- (xfs_queue_invalid, xfs_empty_invalid_queue): new functions for adding
- nodes to the list that should be invalidated and to iterate over
- the list and invalidate
- * xfs/linux/Makefile.in (unload): add target
-
- * lwp/iomgr.c (IOMGR): retry also when the error code from select
- is ENOMEM (this can happen on linux)
-
-2000-02-16 Love <lha@s3.kth.se>
-
- * xfs/linux/xfs/xfs_common.h (xfs_alloc,xfs_free): new prototypes
-
- * xfs/linux/xfs_common.c (xfs_alloc,xfs_free): use constant for
- xfs_{allocs,frees}
-
- * xfs/linux/bin/arla.init.in (start): don't fail when insmod
- succeed, from "Krysak, Tony" <tony.krysak@lmco.com>
-
-2000-02-15 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (fs_downp): new function for figuring out if the
- return code means that this fs should be mark as down
- (find_next_fs): new parameter if the previous connection should be
- disabled
- * xfs/linux/Makefile.in (load): create a map file
-
-2000-02-14 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c: remove lots of bogus assert's remove trailing \n
- from arla_log fix some leaking of fcache entries add some missing
- post-conditions
- (fcache_realfid): also do the mount-point thing for (1,1)
- (get_root_of_volume): add parent reference to child volume
- * arlad/volcache.c (getbyid, getbyname): new static functions
- (*): set and use vol_refs
- (volcache_recover_state): find and set parent pointers
- (volcache_invalidate_ve): new function
- (volcache_volref, volcache_volfree): new functions for manipulating
- vol_refs remove trailing \n from arla_log
- * arlad/volcache.h (volcacheentry): add `vol_refs' and `parent'
- (VOLCACHE_VERSION): bump
- add new prototypes
-
- * arlad/bsd-subr.c (dir_remove_name): make the loop-invariant more
- correct.
-
-2000-02-12 Assar Westerlund <assar@sics.se>
-
- * arlad/subr.c (dentry2ino): fix typo in looking for root of a
- volume
-
- * arlad/messages.c (xfs_message_remove): set silly flag after
- fetching attributes
-
- * appl/asrvutil/Makefile.in: s/KRB_INC_FLAGS/KRB4_INC_FLAGS/
- * xfs/solaris/bin/Makefile.in:
- s/KRB_{INC,LIB}_FLAGS/KRB4_{INC,LIB}_FLAGS/ add Makefile-rule
-
- * arlad/solaris-subr.c: start using the generic function in subr.c
- * arlad/subr.h (write_dirent_args): use `off64_t' if it exists to
- help solaris. We might be able to define and use the maximal int
- type instead?
- * configure.in (off64_t): test for
-
- * appl/lib/Makefile.in (arladeb.c): sprinkle srcdir to help
- not-so-bright makes
-
- * cf/check-kafs.m4: add Id. remove duplicate -L
-
- * arlad/conn.c (re_probe): don't assert that `e' is dead. it
- might have woken up
- (print_conn, conn_status): remove trailing \n from arla_log
- * arlad/fprio.c (fprio_status): remove trailing \n in arla_log
- * arlad/cred.c (cred_status, print_cred): remove trailing \n from
- arla_log
-
-2000-02-07 Love <lha@s3.kth.se>
-
- * conf/CellServDB (cs.wisc.edu): updated
-
-2000-02-05 Love <lha@s3.kth.se>
-
- * arlad/messages.c (xfs_message_rmdir): remove superflous
- fcache_release (dir_entry);
- (xfs_message_remove): same as above
-
-2000-02-04 Assar Westerlund <assar@sics.se>
-
- * rx/rx.c (rxi_FindConnection): remember to update the peer in
- `connection' when we discover that the corresponding host has
- moved
-
-2000-02-04 Love <lha@s3.kth.se>
-
- * xfs/linux/bin/arla.init.in (start): don't probe for xfs.o
-
-2000-02-03 Love <lha@s3.kth.se>
-
- * xfs/linux/bin/Makefile.in (install): do ; right
-
-2000-02-02 Love <lha@s3.kth.se>
-
- * xfs/linux/bin/Makefile.in (arla.init): don't write over local
- changes
-
- * arlad/fcache.c (do_read_attr): move out silly test
- (bulkstat_help_func): check also if the rights is cached for this pag
- and if node is uptodatep(), don't save the names if we aren't
- going to use them.
- (get_attr_bulk): added locking protocol, make sure names are free:ed
- when needeed, make sure fs_server_context is free:ed, break out
- updating of in-core node updating of install to kernel loop.
- (fcache_get_attr): make sure node is uptodate too, add check for
- silly rename, make sure we do the right thing with ``parent'',
- merge with get_entry
- (get_entry): remove
-
-2000-01-30 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_write_file): move debug prints
- inside the relevant ifdefs. remove commented-out and way old page
- invalidation
-
- * lib/ko/gensysname.c (printsysname): add ko.h to get rid of a
- warning
-
-2000-01-30 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/linux/xfs/xfs_locl.h, xfs/linux/xfs/xfs_common.h,
- xfs/linux/xfs_inodeops.c, xfs/linux/xfs_dev.c,
- xfs/linux/xfs_common.c: Drop Linux 2.0 support
-
-2000-01-29 Love <lha@s3.kth.se>
-
- * xfs/linux/xfs_cache.c: removed file
-
- * xfs/linux/Makefile.in (MODULE_SRCS): remove xfs_cache.c
-
- * xfs/linux/xfs_load.c: remove linux 2.0-ism
-
- * xfs/linux/xfs_syscalls.c: remove linux 2.0-ism
-
- * xfs/linux/xfs_vfsops.c: remove linux 2.0-ism
-
- * arlad/{arla.c,messages.c,conn.[ch]):use conn_rxkad_level instead
- of rxkad_min_level
-
- * xfs/linux/xfs_inodeops.c: remove 2.0-ism
-
- * arlad/inter.c (*): changed to use new fcache_get_attr
-
- * arlad/messages.c (*): changed to use new fcache_get_attr
-
- * arlad/fcache.h (fcache_get_attr): new style
-
- * arlad/fcache.c (fcache_bulkstatus_num): number of nodes to
- bulkstatus
- (get_attr_bulk): rename function, don't insert into kernel default
- (fcache_get_attr): change funtion to do bulkstatus if needed, do
- dynroot stuff here too.
- (bulkstat_help_func): check if the node is already cached
-
- * tests/compare-inum-mp: set the rights bits on the directory
- before creating the mountpoint
-
-2000-01-26 Love <lha@s3.kth.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_*lookup): removed 2.0-ism, at
- least its the same om 2.3.40 and 2.3.12+
-
- * arlad/messages.c (xfs_message_rmdir,unlink): be more carefull
- when releasing dir_entry. (this was fixed in the 0.29 branch but
- never pulled up)
-
- * xfs/linux/xfs_message.c (xfs_message_installattr): send a
- inactive node if we failed
-
- * conf/arla.spec.in: believed to work spec file for rpm's
-
- * conf/Makefile.in: added spec file
-
- * tests/read-vs-mmap.c: test both all-zeros and random bytes
-
-2000-01-26 Marcus Sundberg <mackan@stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c: fix typos
-
-2000-01-25 Assar Westerlund <assar@sics.se>
-
- * cf/check-kernel-var.m4: try to actually use the variable tested
- for so that this doesn't get optimized away by the compiler
-
-2000-01-25 Love <lha@s3.kth.se>
-
- * xfs/linux/Makefile.in (doclean): remove libgetcwd.so
-
- * configure.in (linux): test for bmap and smap
-
- * xfs/linux/xfs_inodeops.c: add some rough linux2.3 support, at
- least it does crash now. remove 2.0 code need some better
- autoconf test, assume 2.3.40
-
- * xfs/linux/xfs_message.c: removed linux 2.0 code and fixed
- printing of pointers
-
-2000-01-24 Love <lha@s3.kth.se>
-
- * conf/CellServDB: added ops.mit.edu
-
- * xfs/linux/bin/Makefile.in (install): added missing ; and \ and
- removed osf/1-ism
-
-2000-01-23 Assar Westerlund <assar@sics.se>
-
- * configure.in: use AC_PROG_CC_FLAGS
-
-2000-01-23 Love <lha@s3.kth.se>
-
- * xfs/linux/{xfs_syscalls.c,xfs/xfs_locl.h}: setgroups32 patches
- from Chris Wing <wingc@engin.umich.edu>
-
- * *{,*/*}{,/*}/Makefile.in: s,KRB_,KRB4_,
-
- * xfs/linux/Makefile.in (getarg.o): no -fPIC since it doesn't
- work, _syscall2 uses bx.
-
- * xfs/linux/bin/arla.init.in: added linuxconf glue
-
- * xfs/linux/bin/Makefile.in (sysconfdir): added
-
- * configure.in: use new macron for finding kerberos and kafs
-
- * cf/check-kafs.m4: more generic way of finding kafs
-
- * cf/check-kerberos.m4: more generic way of finding kerberos
-
-2000-01-22 Love <lha@s3.kth.se>
-
- * xfs/linux/Makefile.in (getcwd.o): use -fPIC when compiling, its
- supposted to be faster acording to Greg Stark <gsstark@mit.edu>
-
- * xfs/linux/bin/arla.init.in: try to use modprobe
-
- * arlad/inter.c (cm_getattr): make sure if we have attributes that
- we have rights for the user too
-
- * xfs/bsd/bin/Makefile.in (install): fix typo, noticed by matt
- <deberg@mit.edu>
-
-2000-01-21 Love <lha@s3.kth.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_readdir): warning if cache file is NULL
- (xfs_do_readlink): warning if cache file is NULL
-
-2000-01-20 Love <lha@s3.kth.se>
-
- * arlad/arla.c (main): check that we have a dbserver then running
- in -t
-
-2000-01-19 Love <lha@s3.kth.se>
-
- * Release 0.30
-
-2000-01-18 Love <lha@s3.kth.se>
-
- * ydr/parse.y (enumentries,enumbody): patch for automatic
- numbering from idea of Derrick J Brashear <shadow@dementia.org>
-
-2000-01-17 Love <lha@s3.kth.se>
-
- * tests/test-parallel1.c,tests/parallel1: create/chmod/unlink a
- file in 10 worker threads.
-
- * arlad/messages.c (xfs_message_remove): remember to set dir_entry
- to NULL.
-
- * arlad/messages.c (xfs_message_remove): don't release dir_entry
- when it's not used
- (viocsetacl): remove unused label
-
- * appl/fs/fs.c (afs_setacl): don't try to follow pointers when
- counter is 0
-
- * arlad/messages.c (viocsetacl): install the attributes when
- successful.
-
- * arlad/fcache.c (setacl): return the fcache entry when
- successful, remove the break_callback (its up to the caller (like
- rest of the code do it like this))
-
- * arlad/messages.c (xfs_message_remove): fixa
- remove-mountpoint-problem by doing operations in diffrent
- order. The problem is that the node still was in the namecache,
- and the we got a SoftAssert (on linux).
-
-2000-01-16 Assar Westerlund <assar@sics.se>
-
- * rxkad/rxk_crpt.c: more here endian-ness tests from acconfig.h
- * acconfig.h: remove endian-ness defines. they cause troubles be
- being here and are only used in rxkad anyways
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_readdir): unify much more
- * xfs/bsd/xfs_node-bsd.c (xfs_dnlc_lookup): remove extra unused
- variables
-
- * xfs/bsd/Makefile.in (vnode_if.h): handle vnode_if.h hiding in
- ../sys/vnode_if.h
-
-2000-01-16 Love <lha@s3.kth.se>
-
- * lwp/Makefile.in: added dependency for rw.o (by Derrick J
- Brashear <shadow+@andrew.cmu.edu>)
-
-2000-01-07 Assar Westerlund <assar@sics.se>
-
- * lwp/make-process.o.sh.in: add -DASSEMBLER when running cpp
- * acconfig.h: don't look for endianess information in
- <sys/param.h> when assembling
-
- * acconfig.h: new ifdef-code to handle KRB_C_BIGENDIAN
- * configure.in: replace AC_C_BIGENDIAN with KRB_C_BIGENDIAN
- * cf/krb-endian.m4: better endian-ness. stolen from Heimdal.
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhtovp): should send `mode' and
- not `flags' to VOP_ACCESS. Thanks to <tol@stacken.kth.se> for
- debuggning help
-
- * arlad/messages.c (xfs_message_putdata): set correct error in
- wakeup
-
- * rxkad/rxk_clnt.c (rxkad_NewClientSecurityObject): make sure bit
- 31 is not set in the epoch. this bit is used by rx to mean that
- we should only match on connection-id and that means we never get
- any port number updates when using NAT.
-
- * rx/rx.c (rxi_HasActiveCalls, rxi_FindService, rxi_DestroyPeer,
- rxi_FindConnection, rxi_CheckCall, rxi_DecongestionEvent,
- rxs_Release): static-ize
- (rxi_RemovePeer, rxi_InsertPeer, rxi_ChangePeer): new functions
-
- (rxi_FindConnection): only match based on host not port. change saved
- port if it changes. This allows much smoother function when
- behind a NAT. These devices from hell usually have a very short
- timeout on UDP `sessions' and will assign you a new port without
- you noticing.
-
-2000-01-07 Love <lha@s3.kth.se>
-
- * xfs/solaris/Makefile.in (load): don't remove the load tree since
- savecore needs it.
-
-Fri Jan 7 11:36:25 2000 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/linux/{xfs_message.c,xfs_inodeops.c,/xfs/xfs_common.h}:
- New installnode code
-
-2000-01-07 Love <lha@s3.kth.se>
-
- * xfs/solaris/xfs_dev.c (xfs_message_receive): add support for
- XFS_MSG_{VERSION,GC_NODE}
-
- * xfs/solaris/xfs/xfs_msg_locl.h(xfs_message_{gc_nodes,version}):
- add prototypes
-
- * xfs/solaris/xfs_message.c (xfs_message_{gc_nodes,version}):
- implement
- (gc_vnode): try to gc a node
-
- * xfs/solaris/Makefile.in (AFS,mount,unmount): where we should
- mount afs
-
-2000-01-05 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (fcache_get): take care to (re-)initialize all
- fields when re-using an entry
-
- * tests/generic-build: add an optional argument that specifies
- what the directory will be called for tarbolls where it's not the
- same as the file name without .tar.gz
-
- * lwp/lock.h: introduce a new cpp symbol LOCK_TRACE that keeps
- track in the lock of where (file and line) it was locked. add
- support to the locking macros. remove some unused (and notdef)
- code.
-
-2000-01-02 Assar Westerlund <assar@sics.se>
-
- * configure.in (CFLAGS): more warnings
- (freebsd3): test for vnode_if.pl and vnode_if.sh properly
-
- * xfs/bsd/Makefile.in (vnode_if.h): fix the tests for if the file
- exists
-
- * lwp/make-process.o.sh.in: link the candidate assember file to
- process.S before trying to assemble it
-
-2000-01-02 Love <lha@s3.kth.se>
-
- * lwp/Makefile.in(PROCESS_S): spelled .S
-
- * lwp/make-process.o.sh.in(PROCESS_S): spelled .S
-
- * (Makefile.in,make-process.o.sh.in,lwp_elf.h,process.aix22.S,
- process.alpha.S,process.hpux.S,process.i386.S,process.ibm032.S,
- process.m68k.S,process.mips.S,process.patch.S,process.ppc.S,
- process.rios.S,process.sparc.S,process.vax.S): split (and remove)
- process.S to diffrent arch-files, add ELF support for 68k
-
-For older ChangeLog entries see ChangeLog.1999
diff --git a/usr.sbin/afs/src/ChangeLog.2001 b/usr.sbin/afs/src/ChangeLog.2001
deleted file mode 100644
index 139c5cddc37..00000000000
--- a/usr.sbin/afs/src/ChangeLog.2001
+++ /dev/null
@@ -1,1849 +0,0 @@
-2001-12-20 Love <lha@stacken.kth.se>
-
- * configure.in (netbsd,openbsd): make sure we pass in -I$SYS to
- incl (KERNEL_CPPFLAGS) since the <bsd.lkm.mk> might not set it.
-
-2001-12-18 Love <lha@stacken.kth.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c: '(xfs_putpages): support NetBSD 1.5Y'
-
-2001-12-10 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/fcache.c (update_attr_entry): throw data when node is in
- kernel but doesn't use data
-
-2001-12-05 Love <lha@stacken.kth.se>
-
- * rx/rxperf.c: implement recv, indent, add some missing breaks,
- protect rx_debugFile with RXDEBUG
-
-2001-11-24 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * rx/rxdebug.c: print byte and packetcounters as unsigned
-
-2001-11-18 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * arlad/fcache.c (read_data) don't initiate a call if we have
- enough data, end call if we can't start FetchData
-
-2001-11-16 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * appl/vos/vos_{un,}lock.c send request to syncsite
- * rx/rxdebug.c: servers do return statistics
- * appl/vos/vos_listvldb.c: handle partitions > 'z'
-
-2001-11-07 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * appl/lib/arlalib.c (arlalib_first_db): Use default cell if NULL
-
- * rxdef/Makefile.in: Added pts.cs.o and ubik.cs.o to FSSERVEROBJS
-
-2001-11-07 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * xfs/bsd/xfs/xfs_locl.h: move definition of d_thread_t outside of
- #ifndef osf
-
-2001-11-02 Tomas Olsson <tol@stacken.kth.se>
-
- * rx/Makefile.in: rxperf: don't link with roken
- * rx/rxperf.c ({{warn,err},x}): implement more thoroughly
-
-2001-11-01 Love <lha@dynarc.se>
-
- * tests/run-tests.in: add option -large that avoids running tests
- that uses up large amount of diskspace (like
- copy-and-diff-gnu-mirror)
-
- * tests/copy-and-diff-gnu-mirror: don't run if $LARGE isn't set
-
- * tests/blocks-new-file.c: stat uses a filename, not a fd
-
-2001-10-29 Assar Westerlund <assar@kth.se>
-
- * tests/blocks-new-file.c: new test for previous fix
- * xfs/bsd/xfs_vnodeops-common.c, xfs/bsd/xfs_node-osf.c,
- xfs/bsd/xfs_node-bsd.c: make sure of updating vattr::va_bytes when
- (and only when) we have a valid length
-
-2001-10-24 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * lib/bufdir/fbuf.c: msync doesn't take protection flags
-
- * lib/bufdir/fbuf.c: Added msync before munmap where necessary
-
- * appl/afsutils/Makefile.in: Added LDFLAGS
-
- * appl/bos/Makefile.in: Added LDFLAGS
-
- * appl/fs/Makefile.in: Added LDFLAGS
-
- * appl/pts/Makefile.in: Added LDFLAGS
-
- * appl/udebug/Makefile.in: Added LDFLAGS
-
- * appl/vos/Makefile.in: Added LDFLAGS
-
- * lib/ko/Makefile.in: Added LDFLAGS
-
- * cf/check-kerberos.m4: Added support for Mac OS X built-in
- kerberos and kth-krb with openssl
-
- * configure.in: Don't use libroken in tf_util test.
-
-2001-10-22 Love <lha@stacken.kth.se>
-
- * configure.in: 1.465.2.57->1.465.2.58: freebsd[45]): when build
- with --enable-smp tag on APIC_IO since its needed (true for alpha
- too ?)
-
-2001-10-22 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * configure.in: Only compile kalog if there is a tf_init
-
- * configure.in: Added appl/mac/make-mac-package.sh and
- appl/mac/install/arla.info
-
- * appl/mac/install: Added installation package files
-
- * appl/mac/make-mac-package.sh.in: Added
-
- * appl/mac/make-mac-package.sh: Removed
-
- * appl/mac/Arla_Configuration/Controller.m (auth:) Bail out if not
- unlocked
-
-2001-10-21 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/arla-cli.c: Added arla_put.
-
-2001-10-19 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/bsd/xfs/xfs_locl.h: xfs_set_vp_size is called ubc_setsize on
- Darwin
-
- * xfs/bsd/xfs_vnodeops-common.c: Added xfs_handle_stale
- (xfs_open_valid): Call xfs_handle_stale
-
- * xfs/bsd/xfs_message.c (xfs_message_invalidnode): Call
- ubc_setsize if node is in use by ubc, but noone else
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_read_common): Do not print
- out random memory
-
-2001-10-19 Love <lha@stacken.kth.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_mmap):
- s/HAVE_GENFS_MMAP/HAVE_KERNEL_GENFS_MMAP/
-
- * tests/Makefile.in: add mmap-cat
- * tests/mmap-cat.c: add mmap cat from 0.35 branch
-
-2001-10-16 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/bsd/xfs_message.c (xfs_message_invalidnode): Don't treat as
- used if only UBC uses it.
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_inactive_common): Clear dirty
- flag when fsync fails
-
-2001-10-16 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * lib/ko/gensysname.c: added solaris 2.8
-
-2001-10-16 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/messages.c (xfs_message_getroot): Set tokens in
- installroot message
-
-2001-10-15 Love <lha@stacken.kth.se>
-
- * configure.in
- * appl/afsutils/Makefile.in
- * appl/amon/Makefile.in
- * appl/asrvutil/Makefile.in
- * appl/bos/Makefile.in
- * appl/fs/Makefile.in
- * appl/kalog/Makefile.in
- * appl/pts/Makefile.in
- * appl/udebug/Makefile.in
- * appl/vos/Makefile.in
- * arlad/Makefile.in
- * cf/check-sl.m4
- * include/Makefile.in
- * lib/Makefile.in
- * lib/ko/Makefile.in
- * milko/appl/perf/Makefile.in
- * milko/appl/sked/Makefile.in:
- make it possible to link to another libsl
-
- * lib/ko/slcompat.c: added sl_apropos to be able to link with
- older libsl
- * cf/check-roken.m4: adding missing ``with'' in the helptext
-
-2001-10-14 Love <lha@stacken.kth.se>
-
- * arlad/arla-cli.c: replace SL_BADCOMMAND with -1 to make it
- compatible with older libsl
-
- * appl/fs/fs.c: replace SL_BADCOMMAND with -1 to make it
- compatible with older libsl
-
-2001-10-14 Tomas Olsson <tol@stacken.kth.se>
-
- * rxdef/common.h: added AFS_SET{MIN,MAX}QUOTA
-
-2001-10-14 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * appl/mac/Arla_Configuration/Controller.m: Don't try to execute
- things with privileges if there aren't any.
-
-2001-10-14 Love <lha@stacken.kth.se>
-
- * conf/CellServDB: mc.vanderbilt.edu removed, from David Krause
- <david.w.krause@vanderbilt.edu> on arla-drinkers
-
-2001-10-12 Tomas Olsson <tol@stacken.kth.se>
-
- * rxdef/pts.xg: add prheader_disk, trim prentry_disk, drop contentry
-
-2001-10-11 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs/xfs_vfsops.h (xfs_mount_common_sys): add prototype
- * xfs/bsd/xfs_vfsops-common.c (xfs_mount_common_sys): export
- * xfs/bsd/xfs_vfsops-freebsd.c (xfs_mount_freebsd): simplify and
- handle kernel-pointer version
-
- * xfs/bsd: port to FreeBSD-current, from Andrea Campi
- <andrea@webcom.it> with small modifictions
- * configure.in: check for sys/lock.h and sys/selinfo.h, used on
- fbsd-current
-
-2001-10-09 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (get_attr_bulk): avoid updating entries that are
- locked, rewrite the install-kernel behave case to do the same way
- as update case
-
- * tests/run-tests.in: ARLA_TESTS: add hardlink3
- * tests/hardlink3: hardlink test
-
- * include/kafs.h: 1.32.2.1->1.32.2.2: add ARLAIOCTL support
-
- * arlad/messages.c (aioc_statistics): rename from vioc_statistics
- (xfs_message_pioctl): add cases for AIOCs
-
- * rx/Makefile.in: BSD-make can't handle $< in non-implicit rules
-
- * rx/rxperf.c: add support for opening rx_debugFile
-
-2001-10-07 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/fcache.c (getroot): Use normal codepath in dynroot case
-
- * arlad/dynroot.c (dynroot_isvolumep): Volume is called root.afs
-
- * arlad/dynroot.c (dynroot_fetch_vldbN): Volume is called root.afs
- and has only RO
-
- * configure.in: Build appl/mac/Arla_Configuration with normal make
-
- * appl/mac/Arla_Configuration/dialog.nib: Added
- * appl/mac/Arla_Configuration/Makefile.in: Build with normal make
- * appl/mac/Arla_Configuration/Info.plist.in: Added
- * appl/mac/Arla_Configuration/PkgInfo: Added
- * appl/mac/Arla_Configuration/Arla_Configuration.pbproj: Removed
- * appl/mac/Arla_Configuration/English.lproj: Removed
-
- * appl/mac/arlacmm: Added contextual menu module for Mac OS X
-
-2001-10-04 Assar Westerlund <assar@sics.se>
-
- * appl/lib/ka-procs.c (ka_authenticate): handle k_afsklog
- * appl/afsutils/klog.c (get_afs_token), appl/afsutils/aklog.c
- (krb_afslog_uid): k_afslog -> k_afsklog_uid
- (which always was the old name)
-
-2001-10-03 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * rxdef/vldb.xg: Trimmed down disk_vlentry. Make server tables
- variable size.
- * ydr/output.c (encode_string): Correct parenthesis error
-
-2001-10-02 Love <lha@stacken.kth.se>
-
- * cf/check-kerberos.m4: 1.38->1.38.2.1: replace -lroken with
- $LIB_roken
-
-2001-10-01 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * arlad/fcache.c (get_root_of_volume): always try to get the best
- credential
-
-2001-09-30 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * ydr/output.c (generate_function_definition): Added const to
- function definitions
-
-2001-09-28 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * appl/vos/vos.c: Added vos zap
-
- * appl/vos/Makefile.in: Added vos zap
-
- * appl/vos/vos_local.h: Added vos zap
-
- * appl/vos/vos_zap.c: Added
-
-2001-09-28 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * arlad/conn.h: increase fuzz by a factor of 1000
-
-2001-09-26 Love <lha@stacken.kth.se>
-
- * rx/Makefile.in: build rx_trace
-
-2001-09-26 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * appl/vos/vos_listpart.c: null terminate agetarg list
-
-2001-09-25 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_lookup): Fetch xnode if not
- present
- (xfs_permission): Fetch xnode if not present
-
- * arlad/fcache.c (cleaner): Always check cleanergen. Only throw
- entries without kernelp.
- (unlink_lru_entry): Only throw entries without kernelp.
- (update_attr_entry): Only throw entries without kernelp.
-
-2001-09-25 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * appl/fs: split into multiple files
-
-2001-09-24 Love <lha@stacken.kth.se>
-
- * appl/vos/vos_examine.c (printvolstat): print out if volume is
- locked, fixes arla/20
- * appl/vos/vos_common.c: added vol_getopname
- * appl/vos/vos_local.h: added vol_getopname
- * rxdef/vldb.xg: define VLOP operations
-
-2001-09-22 Assar Westerlund <assar@sics.se>
-
- * arlad/messages.c (try_again): do not invalidate the volcache
- entry on VNOVOL, it's done in fcache.c:try_next_fs now
- * arlad/fcache.c (try_next_fs): send in fid too. and mark
- volcache entry as invalid on VNOVOL and VMOVED. this way we
- actually mark volcache entries as invalid and refresh them even
- when there are other r/o clones that work
-
-2001-09-21 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * rx/rxdebug.c (GetVersion) Check return codes
-
-2001-09-19 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * appl/vos/vos_examine.c: Print info from vldb even if we can't
- reach fileserver
- * appl/vos/vos_examine.c: (printvolstat) only print volumeid when
- clone exists
-
-2001-09-18 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * appl/vos/vos_backup.c: added verbose messages
-
-2001-09-17 Assar Westerlund <assar@sics.se>
-
- * arlad/afsdir_check.c (getentry): fail and print a useful error
- instead of asserting on the magic cookie
-
-2001-09-17 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * appl/vos/vos_listvol.c: argument partition is
- aarg_optional_swless
- * appl/vos/vos_listvldb.c: take volume as argument, print
- volumeids
- * appl/vos/vos_local.h (vos_listvldb_iter): added argument volname
- * appl/vos/vos_backup.c (vos_backupsys): send volumename to
- vos_listvldb_iter
-
-2001-09-17 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/{messages.c,discon_log.c,discon_log.h}: Clean up
- prototypes. Truncate disconnected log.
-
- * arlad/conn.h: conn_isalivep: Added prototype
-
-2001-09-17 Love <lha@stacken.kth.se>
-
- * xfs/bsd/xfs_node-bsd.c: 1.47.2.3->1.47.2.4:
- (free_all_xfs_nodes): if we have a vfs_deallocate_syncvnode, use
- that to free the syncer-node, indent
- * configure.in: 1.465.2.46->1.465.2.47: check for
- vfs_deallocate_syncvnode
-
-2001-09-17 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * appl/vos/vos.8: listvldb doesn't require dbserver
- * appl/vos/vos.8: updated info about backup and backupsys
-
-2001-09-16 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/arla-cli.c: Added rmdir and rm
-
- * xfs/linux/{xfs_dev.c,xfs_inodeops.c,xfs_message.c,xfs_node.c,
- xfs_vfsops.c}: Send inactive messages when node is stale and no
- longer referenced
-
- * xfs/linux/xfs_inodeops.c: Handle daemon restarts properly
- * xfs/linux/xfs_message.c: Handle daemon restarts properly
- * xfs/linux/xfs_node.c: Handle daemon restarts properly
- * xfs/linux/xfs_vfsops.c: Handle daemon restarts properly
- * xfs/linux/xfs/xfs_fs.h: Handle daemon restarts properly
- * xfs/linux/xfs/xfs_locl.h: Handle daemon restarts properly
-
-2001-09-16 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/messages.c (xfs_message_remove): only installattr when
- node is in kernel
-
- * arlad/fcache.c (write_attr): return 0 when disconnected
-
-2001-09-16 Love <lha@stacken.kth.se>
-
- * xfs/bsd/xfs_vfsops-netbsd.c: check for vfs_reinit
- * configure.in: check for vfs_reinit
-
-2001-09-14 Love <lha@stacken.kth.se>
-
- * arlad/conn.c: remove unused constant, add comment to unconfuse me
-
-2001-09-14 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * lib/ko/gensysname.c: find better sysname for alpha osf
- * appl/fs/fs.c (fsversion_cmd): test for correct number of
- arguments
- * rx/rxdebug.c: Use agetarg instead of libcmd
- * rx/Makefile.in: link rxdebug with libko
- * Makefile.in: build rx after libko
-
-2001-09-14 Tomas Olsson <tol@stacken.kth.se>
-
- * tests/create-symlinks.c (verify_contents): readlink doesn't
- terminate content string
- * tests/deep-tree: adjust test size to todays hectic lifestyle
- * tests/many-dirs: rm-rf what we've done
- * tests/ga-test.c (test_simple_string): test partial matching
- * lib/ko/agetarg.c (arg_match_long): set matched arg number
- correctly for partials
- * appl/vos/vos_createentry.c (vos_createentry): return if argument
- parsing fails
- * appl/vos/vos_createvolume.c (vos_createvolume): spelling
-
-2001-09-14 Love <lha@stacken.kth.se>
-
- * arlad/arla_local.h: export afs_BusyWaitPeriod
- * arlad/arla.c: set afs_BusyWaitPeriod to 15 (as transarc/openafs does)
- * arlad/messages.c (try_again): when fileserver busy or
- restarting, wait afs_BusyWaitPeriod seconds, this is the same
- timeout as transarc/openafs has.
-
-2001-09-13 Love <lha@stacken.kth.se>
-
- * arlad/messages.c (vioc_new_cell): memset dbs, make sure we a
- static entry (timeout == 0)
-
-2001-09-13 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (find_first_fs), arlad/volcache.c
- (get_info_loop): set INT_MAX as rtt on known `dead' connections,
- so that they are only tried when all others have failed
- * arlad/conn.c (conn_get): always return connections, even if we
- think they are dead
- (conn_isalivep): new function
-
-2001-09-12 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * configure.in: changed incluee to include in check for issignal
-
-2001-09-10 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_message.c (xfs_message_installattr): limit offset
- to size of file
-
- * arlad/messages.c (xfs_message_getdata): do not fetch or prefetch
- data behind the end of the file
-
- * xfs/linux/xfs_syscalls.c (fhopen_call): dentry_open already
- calls get_write_access, do not do it here
-
- * xfs/linux/xfs_message.c (xfs_message_installdata): set error as
- a negative pointer. also remember to path_release after a
- successful path_walk
-
-2001-09-10 Love <lha@stacken.kth.se>
-
- * configure.in: added tools/{,gnats/}Makefile
- * tools/gnats: arla-send-pr & co
- * Makefile.in (SUBDIR): added tools
-
-2001-09-09 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * arlad/fcache.c: EPERM is reason to turn off fhopen too
-
-2001-09-08 Assar Westerlund <assar@sics.se>
-
- * configure.in: move some of the header files checks to be run
- with the kernel flags this allows finding miscfs/syncfs/syncfs.h
- on NetBSD
- * configure.in, xfs/bsd/xfs/xfs_locl.h: try miscfs/syncfs/syncfs.h
-
- * arlad/arla-cli.c (main): initialize random number generator
- * arlad/arlad.c (main): initialize random number generator
-
- * xfs/linux/xfs_inodeops.c (xfs_setattr): always send the size
- (for regular files), and the mtime to the daemon
-
-2001-09-08 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/fcache.c (do_read_data): return ENETDOWN if not connected
- (fcache_reobtain_callbacks): Lock fcachentry. Use update_attr_entry
- and break the kernel's callback
-
- * arlad/messages.c (viocconnect): open discon_log in cwd and give
- up callbacks
-
- * arlad/darla.c (DARLA_Open): Call open with mode
-
- * arlad/arla-cli.c: Added mkdir, use arguments as commands if
- present
-
- * arlad/arla_local.h, arlad/arlad.c: arla_start is local to arlad
- and arla-cli
-
-2001-09-07 Assar Westerlund <assar@sics.se>
-
- * configure.in (APPL_SUBDIRS): changed value sightly
- * appl/Makefile.in (SUBDIRS): update conditional part
-
-2001-09-07 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * config.guess, config.sub: update to newer versions
-
-2001-09-07 Love <lha@stacken.kth.se>
-
- * conf/CellServDB: added dynarc.se
-
-2001-09-06 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/bsd/xfs/xfs_dev.h: Handle three-argument selrecord
-
- * xfs/bsd/xfs_dev-bsd.c: Handle three-argument selrecord
-
- * xfs/solaris/xfs_node.c (new_xfs_node): Set tokens from message
-
- * xfs/irix/xfs_node.c (new_xfs_node): Set tokens from message
-
-2001-09-05 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * appl/fs/fs.c (get_statistics): More features
-
- * xfs/linux/xfs_node.c (new_xfs_node): Set tokens from message
-
- * xfs/linux/{xfs_node.c,xfs_inodeops.c}: Handle NULL xnodes and
- free xnodes on device close
-
- * xfs/bsd/xfs_node-bsd.c (new_xfs_node): Set tokens from message
-
-2001-09-04 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * configure.in, cf/bsd-func-selrecord.m4: Added selrecord test
-
-2001-09-04 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (find_first_fs): don't use entries maked by the
- vldb server as VLSF_DONTUSE, there are volumes marked up my the
- vldb server as non released volumes.
-
-2001-09-04 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/conn.c: 1.64->1.65: (re_probe): If sleeping already,
- choose the earliest wakeup
-
-2001-09-03 Love <lha@stacken.kth.se>
-
- * xfs/bsd/xfs_node-bsd.c (free_all_xfs_nodes/xfs_vflush): do magic
- with syncer-node on freebsd, this is since FreeBSD > 4.3 changed
- vflush api so we have to remove the mnt_syncer node first before
- calling vflush to avoid dying in a deadlock. break out vflush to a
- common function xfs_vflush().
-
-2001-09-01 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/fcache.c (add_time_statistics): update the correct pointer
- (get_attr_bulk): collect statistics
- (get_attr_bulk): avoid lockup when preferred entry == entry
- (followmountpoint): set parent fid before fcache_verify_attr
-
-2001-08-31 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * util/hash.c (hashtabcleantab): Free the correct pointer
-
-2001-08-23 Love <lha@stacken.kth.se>
-
- * appl/vos/vos_common.c (getlistparts): break up to two parts, one
- that get a already existing conn and one that doesn't
- (printlistvol): use new getlistparts_conn()
- * appl/lib/arlalib.h: add a new class for auth_flags update
- signatures
- * appl/lib/arlalib.c: arlalib_getsecurecontext(): don't cache
- cred, fewer ifdefs
- arlalib_getconnbyaddr(): update usage of arlalib_getsecurecontext()
-
- * doc/: Added themis to the documentation
-
-2001-08-20 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * configure.in: Check for getattrlist and setattrlist
-
-2001-08-16 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * doc/themis.texi: changed text about Q flag
-
-2001-08-10 Love <lha@stacken.kth.se>
-
- * appl/vos/vos_common.c: print out not attached volumes too,
- suggestion from haba@pdc.kth.se
-
-2001-08-08 Assar Westerlund <assar@sics.se>
-
- * configure.in: add support for $SYSDIR
-
-2001-08-06 Assar Westerlund <assar@stacken.kth.se>
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhopen): use p_ucred instead of
- the less portable p_cred->pc_ucred
-
- * xfs/bsd/Makefile.in (load): try to make it do the same thing
- with the symbols as startarla does
-
-2001-08-05 Assar Westerlund <assar@stacken.kth.se>
-
- * xfs/bsd/xfs_vnodeops-common.c: print size_t's correctly
- * arlad/messages.c: print size_t's correctly
-
-2001-08-02 Love <lha@stacken.kth.se>
-
- * lib/ko/Makefile.in: Avoid creating a empty sysname.c when
- gensysname failes
-
-2001-07-26 Love <lha@stacken.kth.se>
-
- * arlad/{dump_state.c,state.c,state.h,Makefile.in,
- arla_local.h,fcache.c,fcache.h,d,volcache.c,volcache.h}:
- Store the fcache data in a FCacheEntry independ format Store the
- volcache data in a VolCacheEntry independ format
- Create a simple tool to dump the stable storage filse
-
- * appl/afsutils/Makefile.in, appl/amon/Makefile.in,
- appl/asrvutil/Makefile.in, appl/bos/Makefile.in,
- appl/fs/Makefile.in, appl/pts/Makefile.in,
- appl/udebug/Makefile.in, appl/vos/Makefile.in,
- appl/kalog/Makefile.in, appl/themis/Makefile.in,
- milko/appl/perf/Makefile.in, milko/bos/Makefile.in,
- milko/fs/Makefile.in, milko/pts/Makefile.in,
- milko/vldb/Makefile.in, configure.in: remove the old
- MILKO_RXKAD_LIBS hack and replace it with top_builddir
-
-2001-07-26 Assar Westerlund <assar@stacken.kth.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_symlink): also handle OpenBSD
- current (aka version 200107)
-
- * xfs/linux/xfs_message.c (xfs_message_installnode): print
- pointers with %p
-
- * xfs/linux/xfs_dev.c (xfs_devwrite): do not set dumpable
- * arlad/arlad.c (arla_start): set dumpable with prctl if possible
- * arlad/arla_local.h: add sys/prctl.h
- * configure.in: check for sys/prctl.h
-
-2001-07-24 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_remove): call ubc_uncache after
- vput:ing (on osx/darwin)
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_symlink): NetBSD 1.5X and above
- doesn't vput the created symlink
-
-2001-07-23 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/linux/xfs_vfsops.c (print_nodes): Print all nodes
-
-2001-07-23 Assar Westerlund <assar@stacken.kth.se>
-
- * xfs/linux/xfs_syscalls.c (fhget_call): make `dentry' const and
- never dput it
- (user_path2dentry): define it differently for 2.3
- (sys_afs_int): move dput to the end of the function and call
- path_release in 2.3
-
-2001-07-22 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * tests/asu.c: Include atypes.h
-
-2001-07-22 Assar Westerlund <assar@stacken.kth.se>
-
- * xfs/linux/xfs_syscalls.c (xfs_debug_print): call print_dentry
- * xfs/linux/xfs_common.c (print_dentry): add
- (print_aliases): const-ize
- (print_childs): rename to print_children, constize
-
-2001-07-19 Assar Westerlund <assar@stacken.kth.se>
-
- * xfs/bsd/xfs_vfsops-osf.c: add xfs dead vnode operations
- (make_dead_vnode): use these and make the dead vnode have a mount point
-
- * rx/rx.c: (rx_PrintPeerStats): fix printf format
-
-2001-07-19 Love <lha@stacken.kth.se>
-
- * rx/{rx.c,rx.h,rx_globs.h}: performance patch from Bjoern
- Groenvall <bg@sics.se>
- * arlad/{fcache.c,volcache.c}: update to match with bg's patch
-
-2001-07-16 Love <lha@stacken.kth.se>
-
- * Release 0.35.5, see the branch for relevant patches
-
-2001-07-16 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vnodeops-common.c: make all functions vput/vrele
- agonstic. fix callers.
- * xfs/bsd/xfs_vnodeops-osf.c: add correct vrele:ing
-
- * xfs/bsd/Makefile.in (osf): add CFLAGS
- (bsd): look for vnode_if.h first in $(SYS)/sys
-
-2001-07-15 Assar Westerlund <assar@chicken.stacken.kth.se>
-
- * appl/amon/Makefile.in (LIBS): add roken
-
-2001-07-15 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * xfs/bsd/xfs_dev-common.c: define xfs_block_sigset in all cases
- where it's used
-
-2001-07-15 Love <lha@stacken.kth.se>
-
- * arlad/inter.c (cm_{,sym}link): pass parent directory to
- fcache_verify_attr
-
- * arlad/fcache.c (fcache_verify_attr): if we don't have a parent,
- don't bulkstat, this is to avoid possible deadlock
-
- * arlad/messages.c: pass up parent to fcache_verify_attr() to
- avoid deadlock in bulkstatus code
-
- * lwp/lock.h: print thread-id before the lock message
-
-2001-07-15 Assar Westerlund <assar@sics.se>
-
- * tests/intr-read.c: new test for SIGALRM interrupting open
-
- * xfs/bsd/xfs_dev-common.c (xfs_message_rpc): block the
- appropriate signals (SIGIO, SIGALRM, SIGVTALRM) also on OSF 5.x
-
- * appl/Makefile.in (SUBDIRS): make `lib' conditional
- * configure.in (APPL_SUBDIRS): add `lib'
-
-2001-07-15 Love <lha@stacken.kth.se>
-
- * xfs/bsd/xfs_dev-common.c (xfs_message_rpc): comment on what os
- releases that uses what signal confusion, make the osf code
- also use xfs_block_sigset()
-
- * arlad/fcache.c: (get_attr_bulk): when getting the fid to install
- the addr, use a fid will some !random value in it
-
-2001-07-14 Love <lha@stacken.kth.se>
-
- * lib/cmd/Makefile.in: link testc with @LIBS@
- * configure.in: check for get_progname set_progname warnerr
-
-2001-07-14 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * configure.in, appl/themis: Added Themis
-
-2001-07-13 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * appl/fs/fs.c: Added getstatistics
-
-2001-07-12 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * appl/vos/{vos_common.c,vos_examine.c,vos_local.h,vos_syncsite.c,
- vos_vldbexamine.c}: Use arlalib_host_to_name
- * appl/lib/arlalib.[ch]: Added arlalib_host_to_name
- * appl/lib/{arlalib.h,fs_lib.c}: Added collection of statistics
- * arlad/messages.c: Added collection of statistics
- * arlad/fcache.[ch]: Added collection of statistics
- * include/kafs.h: Added VIOC_STATISTICS opcodes and reqtypes
-
-2001-07-11 Love <lha@stacken.kth.se>
-
- * lib/ko/kocell.c (cell_foreach): avoid passing up the dynroot cell
- (cell_iterate_func): use constant
- (cell_new): make sure we don't create a dynroot cell
-
-2001-07-11 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * util/hash.[ch]: Added hashtabrelease
- * include/kafs.h: Added VIOC_PREFETCHTAPE, VIOC_RESIDENCY_CMD and
- VIOC_STATISTICS
- * xfs/linux/xfs_inodeops.c (xfs_data_valid): if we have knowledge
- about a directory, we believe it, even if we don't think we have
- enough data about it
-
-2001-07-11 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * arlad/fcache.c (fcache_get_data): set wanted_length if we don't
- have data or if it's not up-to-date
- * xfs/bsd/xfs_vnodeops-common.c (xfs_data_valid): if we have
- knowledge about a directory, we believe it, even if we don't think
- we have enough data about it
- * xfs/bsd/bin/startarla.in: added support for dux
- * xfs/bsd/bin/Makefile.in: build startarla on dux
-
-2001-07-09 Love <lha@stacken.kth.se>
-
- * lib/ko/kocell.c (host_sort): don't use E->name, since it might
- be NULL in case we did a ``fs newcell'', noted by Nickolai
- Zeldovich <kolya@mit.edu>
-
-2001-07-06 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * conf/CellServDB: changed vldb for it.kth.se according to
- <elu@it.kth.se>
-
-2001-07-06 Love <lha@stacken.kth.se>
-
- * rx/rx_pkt.c (rxi_SendDebugPacket): truncate the iov to the size
- of the outgoing packet
-
-2001-07-05 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * appl/pts/pts.c: membership: Move error handling to outside of
- the server trying loop. Handle non-existing users and groups.
-
- * appl/lib/arlalib.c (arlalib_try_next_db): Use ARLA_CALL_DEAD
- instead of RX_CALL_DEAD
-
-2001-06-27 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * xfs/bsd/xfs_node-osf.c (free_all_xfs_nodes): vflush the
- mountpoint after relasing the root vnode
- * xfs/bsd/xfs_vnodeops-osf.c (xfs_getpage, xfs_putpage): send
- wanted size to xfs_data_valid
-
-2001-06-21 Love <lha@stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_data_valid): move the check that
- offset will not extend over the end of since to the inside of the
- loop
-
- * arlad/fcache.c (fcache_get_data): don't specialcase directories,
- since that will mean we never will get data from then in som
- cases. Assert that we always never give length when fetching
- directories.
-
-2001-06-17 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/{aix-subr.c,arla-cli.c,bsd-subr.c,hpux-subr.c,inter.c,
- inter.h,irix-subr.c,messages.c,solaris-subr.c,subr.c,subr.h,
- sunos-subr.c,unknown-subr.c}: Change cm_setattr, cm_ftruncate and
- cm_access to take FCacheEntry. Make all cm functions return int.
- Change all callers.
-
- * arlad/{arla-cli.c,inter.c,inter.h}: Change arla-cli.c:walk() to
- inter.c:cm_walk(). Make it take separate arguments for start fid
- and result. Change all callers.
-
-2001-06-16 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/inter.c (cm_close): Remove erroneous fcache_release
-
- * arlad/{inter.c,inter.h,messages.c}: Change cm_create, cm_mkdir,
- cm_link, cm_symlink and cm_rename to take FCacheEntry
-
- * arlad/{inter.c,inter.h,messages.c}: Change cm_remove and
- cm_rmdir to take FCacheEntry
-
- * arlad/{arla-cli.c,inter.c,inter.h,messages.c}: Change cm_lookup
- to take FCacheEntry
-
- * arlad/inter.c (cm_getattr): Don't do fcache_release()
-
-2001-06-15 Assar Westerlund <assar@sics.se>
-
- * conf/CellServDB: add openafs.org
-
-2001-06-11 Love <lha@stacken.kth.se>
-
- * arlad/DynRootDB.5: clarify what happens if .Nm doesn't exist
-
-2001-06-10 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/{inter.c,inter.h,messages.c}: Change cm_getattr to take
- FCacheEntry
-
-2001-06-08 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/{inter.c,inter.h,messages.c}: Change cm_open and cm_close
- to take FCacheEntry
-
- * arlad/{adir.c,fcache.c,subr.c}, lib/bufdir/fdir.[ch]: Change
- fdir_readdir to take a VenusFid instead of a VenusFid*
-
- * arlad/{adir.c,adir.h,arla-cli.c,fcache.c,fcache.h,inter.c,
- messages.c}: Change fcache_get_data to take FCacheEntry instead of
- getting one itself. Changed all callers.
-
-2001-06-06 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/fcache.[ch]: Fix fcache recovery
-
-2001-06-06 Assar Westerlund <assar@sics.se>
-
- * xfs/solaris/bin: move startarla, mount_xfs from bin to sbin
-
-2001-06-05 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * xfs/bsd/xfs_node-osf.c: do locking and handle ndp:s better
- * xfs/bsd/xfs_vfsops-osf.c: test for vfs_swapvp and vfs_smoothsync
- * xfs/bsd/xfs_syscalls_common.c: don't use fhlookup on dux
- * configure.in: test for vfs_swapvp and vfs_smoothsync in struct
- vfsops (for dux)
-
-2001-06-05 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/{adir.c,adir.h,inter.c,messages.c}: Renamed from
- adir_lookup_fcacheentry to adir_lookup. Removed old adir_lookup.
- Use new adir_lookup instead.
-
- * arlad/{discon_log.c,reconnect.c}: Disable nonworking functions.
-
-2001-05-29 Assar Westerlund <assar@sics.se>
-
- * configure.in: test for genfs_mmap
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_mmap): call genfs_mmap if it
- exists
-
-2001-05-28 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/{dynroot.c,dynroot.h,fcache.c}: Make dynroot add
- CallerAccess to creds
-
-2001-05-26 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * xfs/bsd/xfs_{vnodeops,node}-osf.c: general update of the osf/1
- code. Doesn't crash immidiately
- * lib/sl/lex.l,ydr/lex.l: build with lex on dux 4.0d
- * arlad/Makefile.in: use correct syntax
- * cf/osf-func-vfs-name-hash.m4: function to find out more about
- vfs_name_hash()
- * cf/try-compile-kernel.m4: use KERNEL_CC if it is defined
- * configure.in: find out more about vfs_name_hash on osf/1
- * appl/{afsutils,amon,asrvutil,bos,fs,kalog,pts,udebug,vos}/Makefile.in
- lib/ko/Makefile.in: build working makefile even if @LIBS@ is empty
-
-2001-05-22 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_write_common): set the offset
- of the xnode to the length of the cache file
-
-2001-05-22 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * conf/CellServDB: Changed afsdb2.isk.kth.se
-
-2001-05-22 Harald Barth <haba@pdc.kth.se>
-
- * doc/Makefile.in: Added eps to pdf rule to be able to run texi to
- pdf generation.
-
-2001-05-21 Harald Barth <haba@pdc.kth.se>
-
- * doc/real-world.texi: Spell and grammar. Added stuff about KeyFile.
- * doc/storage.texi, doc/arla.texi: Spell and grammar.
-
-2001-05-17 Love <lha@stacken.kth.se>
-
- * xfs/bsd/bin/startarla.in: remove symbol file before loading
- kernel module
- * xfs/bsd/bin/startarla.in: use /var/db so the data is kept after
- a crash
-
-2001-05-17 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/messages.c (viocgetcacheparms): Return lowbytes and
- lowvnodes.
-
- * arlad/fcache.[ch]: Added fcache_lowbytes and fcache_lowvnodes.
-
-2001-05-15 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/xfs_vfsops.c (xfs_read_super): bail out on too large
- minor devices
-
- * xfs/linux/xfs_dev.c (xfs_devopen): move initialization of
- inactive_list to xfs_init_device. This should handle the case of
- mounting the device before opening it.
-
- * cf/bsd-uvm-only.m4: add sys/queue.h
-
-2001-05-13 Assar Westerlund <assar@sics.se>
-
- * appl/afsutils/Makefile.in (LIBS): add another RXKAD_LIBS to be
- consistent with other Makefiles
-
-2001-05-07 Love <lha@stacken.kth.se>
-
- * xfs/bsd/bin/startarla.in: 1.18->1.18.2.2: Store the output file
- from [k]modload and [k]modstat in /var/run so it will be possible
- to debug the kernel core.
-
-2001-05-07 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs/xfs_locl.h: add <sys/mutex.h>
- * xfs/bsd/xfs_syscalls-wrap-freebsd.c
- (freebsd_old_setgroups_func): static-ize
- (AFS_SYSCALL): remove, this is already defined in afssysdefs.h
-
- * xfs/bsd/xfs_vnodeops-bsd.c (get_pages_endlength): only for
- HAVE_VOP_GETPAGES
-
- * xfs/bsd/xfs_syscalls-wrap-macos.c (old_setgroups_func): use the
- common one instead
-
- * xfs/linux/xfs_inodeops.c (xfs_write_file): xfs_inode -> inode
-
-2001-05-06 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_write_common): Fetch whole
- file
-
- * arlad/messages.c: Assert or set attrusedp when setting datausedp
- (break_callback): Don't clear kernelp, attrusedp and datausedp
-
- * arlad/inter.c (cm_open): assert attrusedp when setting datausedp
-
- * arlad/fcache.c (stale): Don't clear attrusedp and datausedp
- (fcache_get_data): Don't set wanted_length if a directory that has data
- (fcache_update_length): Set wanted_length and fetched_length
-
- * xfs/linux/xfs_inodeops.c (xfs_write_file): Fetch whole file when
- writing
-
- * lib/bufdir/fbuf.c (mmap_copyrx2fd): Adjust mmap offset to
- pagesize
-
- * tests/Makefile.in: still-there-p: Added $(ROKEN_LIBS)
-
-2001-04-30 Love <lha@stacken.kth.se>
-
- * arlad/arlad.8: Added reference to DynRootDB
-
- * arlad/DynRootDB.5: new file
-
- * arlad/arla-cli.c (main): sleep for a some time to let the
- create_nodes thread start when we are using dynroot, otherwise it
- will never had a change to start before we enter editline/readline
-
- * lib/ko/ko.h: change suid information to a flag, added dynroot
- flag and functioncall
-
- * lib/ko/kocell.c: change suid information to a flag, added a
- simple_file_parse, added parsing of DynRootDB file
-
- * arlad/{arla.c,arla_local.h,arlad.c,arladeb.c,arladeb.h,arlad.8}:
- added option --cpu-usage
-
- * util/log.[ch]: added support for printing cpu usage on each line
-
- * configure.in: check for getrusage
-
-2001-04-28 Harald Barth <haba@pdc.kth.se>
-
- * doc/real-world.texi: Enhanced spelling, grammar and readability.
- Hopefully in a way that didn't harm content.
-
-2001-04-27 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * xfs/bsd/xfs_node-osf.c (xfs_dnlc_purge_mp) don't use
- cache_purgevfs() if not available
- * xfs/bsd/xfs_syscalls-wrap-osf.c: use sy_info in struct sysent on
- dux 5.1
- * xfs/bsd/xfs_vfsops-osf.c: added xfs_mountroot, xfs_swapvp,
- xfs_smoothsync from dux vfsops
- * configure.in: test for sys/vfs_proto.h sys/vnode.h and
- function cache_purgevfs()
- * configure.in: test for vfs_mountroot in vfsops and sy_info in
- sysent
-
-2001-04-27 Love <lha@stacken.kth.se>
-
- * doc/real-world.texi: Wrote more about tickets and tokens. Added
- more stuff to NAT section inspired by Harald Barth <haba@pdc.kth.se>,
- added some tables that describes the situation
-
-2001-04-18 Love <lha@stacken.kth.se>
-
- * conf/CellServDB: mit cells zone.mit.edu and ops.mit.edu have
- moved From Nickolai Zeldovich <kolya@MIT.EDU>
-
- * appl/lib/tokens.c: (arlalib_token_iter): return right thing,
- From Nickolai Zeldovich <kolya@MIT.EDU>
-
- * appl/bos/bos_listusers.c (printusers): only print user when we
- are are getting back good data From Nickolai Zeldovich
- <kolya@MIT.EDU>
-
- * arlad/fcache.c (getacl): fix problem that `opaque' can be
- uninitialized when returning errors, when caller might do stupid
- things. From Nickolai Zeldovich <kolya@MIT.EDU>
-
-2001-04-16 Love <lha@stacken.kth.se>
-
- * cf: Quote argument to undefine, patch by
- Hidvegi <hzoli@austin.ibm.com>
-
- * tests: Added write3
-
-2001-04-12 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * configure.in: Compile with -traditional-cpp on Mac OS X
-
-2001-04-12 Love <lha@stacken.kth.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c: (get_pages_endlength): extract
- endsize from a get_pages_args
- (xfs_getpages): use get_pages_endlength
-
- * xfs/bsd/xfs_vnodeops-common.c: (xfs_lookup_common): fixes for
- printf format strings
-
- * configure.in: add test for vop_getpages_args->a_offset
-
-2001-04-08 Love <lha@stacken.kth.se>
-
- * arlad/arlad.c: move paths to defines
-
- * NEWS: more things
-
- * INSTALL: spelling
-
-2001-04-04 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (find_first_fs): memset context, in case we fail
- to update the volume, context will contains data that
- free_fs_server_context() will grok.
-
-2001-04-05 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * configure.in, cf/check-kernel.m4,
- xfs/bsd/xfs_syscalls-wrap-macos.c, xfs_vnodeops-bsd.c: Make it
- build on Mac OS X release
-
-2001-03-25 Love <lha@stacken.kth.se>
-
- * xfs/linux/xfs_dev.c (xfs_message_rpc): ignore SIGSTOP, this make
- ptrace() work
-
-2001-03-23 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (get_attr_bulk): if parent entry is missing data,
- bail out and force regular get_attr
-
-2001-03-20 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * rxdef/vldb.xg: use nvldbentry in ReleaseEntryN
- * appl/vos/vos_common.c (get_vlentry): try to find dbserver if
- it's not given
- * vos_listvldb.c (listvldb_iter): use VL_ListAttributes interface,
- and allow to mask on servername and partition
- * appl/vos: added backup and backupsys commands
-
-2001-03-19 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * xfs/bsd/xfs_node-osf.c:
- (xfs_dnlc_enter): set ni_makeentry when calling cache_lookup
- (xfs_cnp_init): compute cache correctly
- * xfs/bsd/xfs_vnodeops-osf.c: set name in ndp->cn_nameptr when
- symlinking
-
-2001-03-18 Love <lha@stacken.kth.se>
-
- * arlad/.gdbinit: add some more debugging stuff
-
- * xfs/linux/xfs_inodeops.c: implement struct
- inode_operations->revalidate
-
-2001-03-17 Love <lha@stacken.kth.se>
-
- * arlad/volcache.c (clones_exists): return TRUE if there is a
- clone
- (get_info_byname): when there are no clones add add_clones_to_hashtab
- (add_entry_byname): remove add_clones_to_hashtab
- (volume_uptodatep): add a condition that a volume is uptodate when
- there exist (a) clone(s).
-
-2001-03-15 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/bsd/xfs_node-osf.c, xfs/bsd/xfs_node-bsd.c,
- xfs/bsd/xfs_message.c, xfs/bsd/xfs_vnodeops-common.c,
- xfs/bsd/xfs/xfs_vnodeops.h, xfs/bsd/xfs/xfs_node.h: Added support
- for incremental fetch
-
-2001-03-14 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * rx/rxdebug.c (MakeCall): check return codes
-
-2001-03-13 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * xfs/bsd/xfs_vnodeops-osf.c: xfs_{mkdir,create}: set
- ndp->cn_nameptr before calling lookup
-
-2001-03-12 Love <lha@stacken.kth.se>
-
- * arlad/volcache.c (getbyname): remove leftover type code
- (add_to_hashtab): split to two functions,
- add_{clones,name}_to_hashtab
- (add_entry_byname): add code for sleeping when there are multiple
- lookups (add_entry_byid): disable so the id-lookup can't create
- entries since that creates a race-condtion that isn't possible to
- solve.
- (volcache_getbyname): when there are a lookup in process, wait
- (volcache_getbyid): ditto
-
- * Release 0.35.3, see the branch for relevant patches
-
- * arlad/volcache.h (VolCacheEntry): add two flags fields that is
- used to signal when a lookup is in progress, and with ther are
- waiting threads.
-
- * tests/write2: improve test to make it work when it failes
-
- * arlad/volcache.c (getbyname): there is no `type' argument
- (add_entry_byname): update getbyname usage, check if there already
- exists an entry for this name with we return from get_info* before
- adding the new entry to the hashtab.
- (add_entry_byid): ditto
-
- * arlad/fcache.c (getroot): remove sleep-waiting on multiple
- getroot calls
-
-2001-03-11 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_fhtovp): repair broken code
- (xfs_fhopen): handle error conditions better
- add comments to some #else/#endif
-
-2001-03-11 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * lib/ko/kocell.c: manage cells without dbservers
-
-2001-03-09 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (fcache_reinit): allow unchanged, increasing or
- decreasing high watermark for vnodes
-
- * arlad/kernel.c (kernel_interface): sleep waiting for free
- threads on overload
-
- * arlad/kernel.c (kernel_interface): only print `all workers busy'
- once (and say how many)
-
-2001-03-08 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/aix/xfs_vnodeops.c, xfs/bsd/xfs_vnodeops-common.c,
- xfs/irix/xfs_vnodeops.c, xfs/solaris/xfs_vnodeops.c,
- xfs/sunos/xfs_vnodeops.c: (xfs_data_valid): Set offset to file
- length
-
- * arlad/messages.c: Added xfs_message_open
-
- * xfs/linux/xfs/xfs_node.h, xfs/linux/xfs_message.c,
- xfs/linux/xfs_node.c, xfs/linux/xfs_inodeops.c: Added support for
- incremental fetch
-
- * arlad/inter.{c,h}: Return fetched length in length field
-
- * xfs/include/xfs/xfs_message.h, arlad/messages.{c,h}: Added
- support for incremental fetch
-
- * xfs/linux/xfs_inodeops.c (xfs_setattr): fixed typo
-
-2001-03-08 Assar Westerlund <assar@sics.se>
-
- * xfs/solaris/xfs_syscalls.c: return EFAULT if copyin*/copyout*
- fails. do not copy in `struct ViceIoctl' it not a AFSCALL_PIOCTL.
- only call set_errno if an error actually has occured
-
-2001-03-07 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/fcache.c: Fetch from correct offset and to correct offset.
- Reset fields on invalidation.
-
-2001-03-07 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * xfs/bsd/xfs_vnodeops-osf.c (xfs_lookup): Need to set pointer to
- the parent directory.
-
-2001-03-06 Love <lha@stacken.kth.se>
-
- * xfs/linux/xfs/xfs_fs.h: export xfs_setattr
- * xfs/linux/xfs_inodeops.c: (xfs_setattr): only set time and size
- when we have a valid attribute for it (ie when asked to change it)
- (xfs_truncatate): remove unused code
- * xfs/linux/xfs_vfsops.c: implement xfs_notify_change with
- xfs_setattr
-
-2001-03-04 Love <lha@stacken.kth.se>
-
- * include/afssysdefs.h: solaris8 uses 65, freebsd uses 339
-
-2001-03-03 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * xfs/bsd/xfs/xfs_locl.h, xfs/bsd/xfs_vnodeops-common.c: use
- va_size_t instead of u_quad_t
- * xfs/bsd/xfs_vfsops-common.c: Wrap vfs_getnewfsid in autoconf
- ifdef
- * xfs/bsd/xfs_node-osf.c: new function xfs_dnlc_lock, doing dnlc
- locking on osf
- * xfs/bsd/xfs_message.c: there is no vrecycle on osf
- * xfs/bsd/xfs_common.c, xfs/bsd/xfs_common-bsd.c: moved memcpy to
- xfs_common.c
-
-2001-02-28 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/{adir.c, arla-cli.c, fcache.c, fcache.h, inter.c, inter.h,
- messages.c}: Added basic incremental fetch functionality
-
-2001-02-28 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_vfsops-openbsd.c, xfs_vfsops-freebsd.c (xfs_vfsops):
- use xfs_mount_common when possible
- * configure.in (bsd): add a test for type of vfs_mount
-
-2001-02-26 Assar Westerlund <assar@sics.se>
-
- * appl/vos/vos_examine.c (printvolstat): clarify error message
- when clone not found
- * appl/vos/vos_examine.c (printvolstat): print information about
- the current clone use get_servername
- * appl/vos/vos_common.c (get_servername): add
- * arlad/volcache.c: use volname_canonicalize, volname_specific
- * lib/ko/vlmisc.c (volname_canonicalize, volname_specific,
- volname_suffix): new functions
-
-2001-02-21 Love <lha@stacken.kth.se>
-
- * lwp/make-process.o.sh.in (HOST_CPU): catch the s390 case
-
- * lwp/process.s390.S: add support for S/390 written by
- <Neale.Ferguson@SoftwareAG-usa.com> and <adam@sinenomine.net>
-
- * lwp/lwp_asm.c: increase STACK_HEADROOM for s/390
-
-2001-02-21 Assar Westerlund <assar@sics.se>
-
- * xfs/linux/bin/arla.init.in: send /dev/xfs0 to mount
-
-2001-02-20 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * include/afssysdefs.h: OpenBSD has syscall 208
-
-2001-02-19 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/fcache.c (fcache_update_length): correct variable spelling
-
- * xfs/bsd/xfs_vfsops-bsd.c: Rewrite fhtovp and checkexp code.
-
- * xfs/bsd/xfs_node-bsd.c (xfs_node_find): assign value to variable
- _before_ using it
-
-2001-02-18 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (fcache_update_length): remove consistency check
- that the len that is passed in is the lenght of the cachefile
- since this might not be the case if its possible to write to the
- cachefile from useland while the file is being closed.
-
-2001-02-14 Love <lha@stacken.kth.se>
-
- * xfs/solaris/xfs_message.c (xfs_message_installdata): move out
- where we hold the xfs-vnode to avoid being it cleaned out under
- our feets by dnlc_purge_vp() From assar
-
- * appl/lib/ka-procs.c (get_password): fix problem noted by John
- Callaghan <jpc@msu.edu>
-
- * doc/timeline.texi: change wording
-
-2001-02-13 Assar Westerlund <assar@sics.se>
-
- * arlad/fcache.c (fcache_update_length): rewrite the assert:s in a
- more robust way
-
-2001-02-11 Love <lha@stacken.kth.se>
-
- * arlad/arlad.8: fix mandoc bug
-
-2001-02-11 Assar Westerlund <assar@sics.se>
-
- * xfs/solaris/xfs_vnodeops.c (xfs_inactive): check the v_count of
- the node since due to a race condition we can get nodes that
- shouldn't really be thrown away here
- (xfs_getpage, xfs_putpage): read the cache node from the xfs_node
- after calling xfs_data_valid
-
- * arlad/volcache.c (try_reuse): rename to mark_unused and do not
- drop vol ref to parent
- (this is done in recycle)
- * arlad/volcache.c: re-do some of the ref-counting logic and make
- it simpler
-
- * xfs/solaris/bin/startarla.in: only create /dev/xfs0 symlink if
- it doesn't exist
-
- * tests/Makefile.in: add -lroken before any external libraries
- consistenly
- (SOURCES): no .o sources
-
-2001-02-11 Love <lha@stacken.kth.se>
-
- * arlad/messages.c (try_again): send key to bitbucket if we get a
- back a unknown key
-
-2001-02-09 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_message.c: adapt to changing mutex interface in
- fbsd5-current
-
-2001-02-08 Love <lha@stacken.kth.se>
-
- * doc/timeline.texi: when bg started hacking rxkad
-
-2001-02-05 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/solaris/xfs_node.c: Corrected bad function call and
- declaration
-
-2001-02-05 Assar Westerlund <assar@sics.se>
-
- * arlad/arladeb.c (arla_vwarnx_with_fid): adapt to new
- volcache_getname
- * arlad/fcache.c (fcache_store_state): fix arla_warnx
- (getvolstat): use new volcache_getname
- * arlad/volcache.h (volcacheentry): only store one name pointer
- (the canonical name)
- (volcache_getname): update prototype
- * arlad/volcache.c: re-structure so that we only keep the
- canonical name for a volume
- (volcache_getname): copy name out instead of returning it
-
-2001-02-04 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_node-bsd.c (xfs_node_find): use LIST_FOREACH
-
-2001-02-01 Love <lha@stacken.kth.se>
-
- * xfs/bsd/xfs_vfsops-macos.c: warp xfs_mount to avoid typecast
-
- * xfs/bsd/Makefile.in: use @BSD_WERROR@ to turn on -Werror
-
- * configure.in: use AC_WERROR to turn on -Werror on those
- bsd-unixes that can handle it.
-
- * xfs/bsd/xfs/xfs_locl.h: added some missing prototypes
- * cf/kernel-need-proto.m4: need-proto for kernel
-
-2001-02-01 Assar Westerlund <assar@sics.se>
-
- * configure.in: check for krb_get_default_principal
- * appl/afsutils/aklog.c: add a fallback krb_get_default_principal
- for non-kth krb4 libraries
-
- * xfs/include/xfs/xfs_message.h: remove unneeded sys/param.h and
- linux/param.h that conflict with other header files
-
- * cf/prog-cc-flags.m4: remove -Wbad-function-cast, it's not
- obviously useful and breaks on fbsd
-
- * xfs/linux/Makefile.in (CFLAGS): add -Werror
-
- * xfs/linux/xfs_inodeops.c (xfs_d_delete): handle both returning
- void and not
- * configure.in (linux): test for struct dcache_operations.d_delete
- returning void
-
-2001-02-01 Love <lha@stacken.kth.se>
-
- * xfs/bsd/Makefile.in: -Werror
-
- * xfs/bsd/xfs_syscalls-wrap-osf.c (wrap_old_setgroups_func):
- provide wrapper function for setgroups
-
- * xfs/bsd/xfs_wrap-bsd.c: remove freebsd lkm code
-
- * xfs/bsd/xfs_syscalls-bsd.c:(old_setgroups_func): moved to common
- code.
-
- * xfs/bsd/xfs_syscalls-wrap-bsd.c (old_setgroups_func): remove,
- moved to common-code
-
- * xfs/bsd/xfs_vfsops-freebsd.c: remove pre 3.0 code provide a
- wrapper function around xfs_mount
-
- * xfs/bsd/xfs/xfs_vfsops-bsd.h (xfs_mount): make userdata void *
- * xfs/bsd/xfs_vfsops-bsd.c (xfs_mount): make userdata void *
-
- * xfs/bsd/xfs_wrap-osf.c (xfs_syscall_num): remove since is
- defined extern in <xfs/xfs_syscalls.h>
-
- * xfs/bsd/xfs_vfsops-netbsd.c: if NetBSD-1.5P or later,
- vnodeopv_desc should be const
-
- * xfs/bsd/xfs_syscalls-common.c (xfs_setgroups): syscalls take
- three arguments, make it so.
-
- * xfs/bsd/xfs_syscalls-wrap-bsd.c
- (xfs_syscallsent): check for sy_flags
- (old_setgroups_func): syscalls take three arguments, make it so.
-
- * xfs/bsd/xfs/xfs_syscalls.h: syscalls take three arguments, make
- it so.
-
- * configure.in: check if struct sysent have a sy_flags
-
- * xfs/bsd/xfs_syscalls-common.c (xfs_setgroups): syscalls take
- three arguments, make it so.
-
- * xfs/bsd/xfs_syscalls-wrap-bsd.c
- (xfs_syscallsent): check for sy_flags
- (old_setgroups_func): syscalls take three arguments, make it so.
-
- * xfs/bsd/xfs/xfs_syscalls.h: syscalls take three arguments, make
- it so.
-
- * configure.in: check if struct sysent have a sy_flags
-
-2001-01-31 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (fcache_store_state): if arla i killed before
- fcache_init has be called, then lrulist is NULL.
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_readdir): avoid looping when
- there is a (incorrect) entry with d_reclen == 0. Patch from: Chris
- Csanady <ccsanady@iastate.edu>
-
-2001-01-30 Love <lha@stacken.kth.se>
-
- * Release 0.35.2, see the branch for relevant patches
-
- * xfs/linux/xfs_vfsops.c (xfs_replace_root): update
- xfsf_attr2inode usage
-
- * Release 0.35.1, see the branch for relevant patches
-
- * xfs/*/xfs_message.c (xfs_message_installattr): don't clear
- node
- (xfs_message_installdata): clear node
- * xfs/*/xfs_node.c (xfs_attr2inode): only clean node if needed
- (new_xfs_node): clean node
-
- * xfs/linux/xfs_dev.c (xfs_message_rpc): mark message as worken
- before calling wakeup()
-
-2001-01-29 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * volumeserver.xg (AFSVolClone): changed argument to string
- newName
-
-2001-01-29 Love <lha@stacken.kth.se>
-
- * conf/CellServDB: added biocenter.helsinki.fi
-
- * arlad/bsd-subr.c: make XFS_DIRENT_BLOCKSIZE smaller since
- otherwise linux emulation code under freebsd will lose any entries
- that have its end past 512 bytes.
-
-2001-01-28 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * configure.in: Fixed fatal typo in pthreads detection
-
-2001-01-28 Love <lha@stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_lookup): fill in the whole getnode
- message inside the look, since xfs_message_rpc() might clobber it.
-
-2001-01-28 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_message.c: handle v_interlock being a mutex (fbsd
- 5-current) use correct ifdef for vgonel
- * configure.in: test for sys/mutex.h (fbsd 5-current)
-
- * xfs/bsd/xfs_vnodeops-bsd.c: use zfree if it exists and there is
- no zfreei (on fbsd 5-current)
- * configure.in: check for krenel zfree
-
-2001-01-27 Assar Westerlund <assar@sics.se>
-
- * tests/run-tests.in (ARLA_TESTS): do not run compare-inum-mp,
- since it doesn't currently work. it really should but it's hard
- and there's no real point in having it here and scaring the users.
-
-2001-01-25 Love <lha@stacken.kth.se>
-
- * appl/fs/fs.1 (incompat): document
- * appl/fs/fs.c (incompat_cmd): report what pioctl interface we use
- * appl/lib/fs_lib.c (fs_incompat_renumber): tries to detect what
- pioctl interface we have
- * appl/lib/arlalib.h (fs_incompat_renumber): new function
-
- * xfs/solaris/bin/startarla.in: install solaris 8 syscall number
-
- * arlad/messages.c (*): use new conn_clearcred
- * arlad/conn.c (conn_clearcred): propagate new argument flag to
- cred_cred
- (clear_cred): use mask to decide if this entry should be killed.
-
- * arlad/arlad.c (main): call tzset
-
- * xfs/bsd/xfs_node-bsd.c (xfs_attr2vattr): make it optional to
- reset the va struct
- (new_xfs_node): force reset of xfs_attr2vattr
- * xfs/bsd/xfs_node-osf.c (xfs_attr2vattr): make it optional to
- reset the va struct
- (new_xfs_node): force reset of xfs_attr2vattr
-
- * arlad: roll forward the flag-to-fcacheentry2xfsnode experiment
- again
- * lib/ko/agetarg.c: fix helpstring generation for
- aarg_optional_swless
-
-2001-01-22 Love <lha@stacken.kth.se>
-
- * appl/fs/fs.1: update setquota and mkmount
-
- * appl/vos/vos_status.c: use strftime instead of ctime
- * util/log.c (log_vprint_file): print timezone
- * appl/kalog/kalog.c: call tzset()
- * appl/vos/vos.c: call tzset()
-
- * appl/fs/fs.c (setquota_cmd, mkmount_cmd): rewrite with agetarg.
- From Nickolai Zeldovich <kolya@MIT.EDU>
-
- * appl/udebug/udebug.c: set_progname() and tzset()
-
- * lib/ko/agetarg.[ch]: Add an "aarg_optional_swless" to agetarg,
- to allow matching of optional switchless arguments. From Nickolai
- Zeldovich <kolya@MIT.EDU>
-
- * rxdef/pts.xg (ListOwned): over is a INOUT
- From Nickolai Zeldovich <kolya@MIT.EDU>.
-
- * ydr/output.c (genencodein): remeber to encode INOUT arguments
- too. From Nickolai Zeldovich <kolya@MIT.EDU>.
-
- * appl/vos/vos_examine.c (print_volume): use strftime instead of
- ctime. Bugrapport from Nickolai Zeldovich <kolya@MIT.EDU>
-
- * appl/pts/pts.c (pts listowned): remove debug output, correct
- usage output. From Nickolai Zeldovich <kolya@MIT.EDU>
-
-2001-01-21 Love <lha@stacken.kth.se>
-
- * appl/afsutils/tokens.c: use arlalib_token_iter
- * appl/lib/tokens.c (arlalib_token_iter): memset data that
- contains the token
-
-2001-01-15 Love <lha@stacken.kth.se>
-
- * include/kafs.h: update arla pioctl's that are assigned to
- assigned to arla, added comments for arla pioctls
-
- WARNING this break compability with older versions of arla !
-
-2001-01-14 Marcus Sundberg <mackan@stacken.kth.se>
-
- * configure.in: Removed some Linux checks that are no longer used
- by the code.
- * xfs/linux/xfs_inodeops.c: No need to have two identical
- xfs_file_operations.
- (xfs_fsync): new argument int datasync, zero means fsync(2),
- non-zero means fdatasync(2).
- (xfs_as_writepage): writepage no longer takes a struct file *.
-
-2001-01-09 Love <lha@stacken.kth.se>
-
- revert the flag-to-fcacheentry2xfsnode experiment
- * arlad/messages.h: revert 1.17
- * arlad/messages.c: revert 1.231
- * arlad/fcache.c: revert 1.311
-
- * arlad/messages.c (xfs_message_pioctl): implement VIOCCKBACK
- (vioc_ckback): invalidate all volumes and mountpoints
-
- * arlad/fcache.h (fcache_invalidate_mp): new function
- * arlad/fcache.c (invalidate_mp): mark mps as stale
- (fcache_invalidate_mp): mark all mps as stale
-
- * arlad/volcache.h (volcache_invalidate_all): new function
- * arlad/volcache.c (inval): invalidate volume
- (volcache_invalidate_all): invalidate all volumes
-
- * appl/fs/fs.1: document checkvolumes
- * appl/lib/arlalib.h (fs_checkvolumes): new function
- * appl/fs/fs.c (checkvolumes_cmd): implement
- (cmds): add pointer to checkvolumes command
- * appl/lib/fs_lib.c (fs_checkvolumes): check cached volumes
-
- * xfs/bsd/bin/Makefile.in (MANPAGES): added xfs.4
- * xfs/bsd/bin/xfs.4: added simplistic manualpage
-
- * Release 0.35 - branched here, see branch for ChangeLog
-
- * lib/ko/agetarg.c (print_arg): fix formating error in help text
- From Nickolai Zeldovich <kolya@MIT.EDU>
-
- * arlad/cred.c (cred_expire): dont try to get username since we
- are probably chroot()ed From Nickolai Zeldovich <kolya@MIT.EDU>
-
- * appl/vos/vos_partinfo.c (args): end end argument with a aarg_end
- From Nickolai Zeldovich <kolya@mit.edu>.
-
-2001-01-08 Love <lha@stacken.kth.se>
-
- * appl/kalog/kalog.c (main): use koerr_gettext to print error from
- ka_authenticate
-
- * lib/ko/koerror.c: ka errors
-
- * xfs/bsd/bin/umount_xfs.8: simplistic manualpage
- * xfs/bsd/bin/mount_xfs.8: simplistic manualpage
- * xfs/bsd/bin/Makefile.in (MANPAGES): mount_ffs.8, umount_xfs.8
- (install,uninstall): manualpages
-
- * lib/ko/agetarg.c (agetarg): fixed broken short option mandatory
- handleing
-
-2001-01-07 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (purge_cred, fcache_get_data): update use of
- install_attr()
- * arlad/messages.c (install_attr): update take a flag field for
- fcacheentry2xfsnode()
- (fcacheentry2xfsnode): update to take a flag field and use it.
- (*): update to new signature of install_attr() and
- fcacheentry2xfsnode()
-
- * arlad/messages.h (FCACHE2XFSNODE_{ATTR,RIGHT,ALL}): flags for
- fcacheentry2xfsnode()
- (fcacheentry2xfsnode): update to take a flag field
-
- * rx/rx.c (rxi_CheckCall): return -2 is the call is freed.
- (rxi_ReapConnections): check if rxi_CheckCall returns -2, in that
- case the hash-bucket might have changed and we need to restart.
-
- * lib/ko/agetarg.c: make mandatory work for real
-
- * util/log.c (log_open): pass on name to lower open, free name
-
- * appl/lib/Makefile.in: add tokens.c
- * appl/lib/arlalib.c (arlalib_get_cred_afs): get token from kernel
- (arlalib_get_cred_krb): rename from arlalib_get_cred
- (arlalib_getsecurecontext): use arlalib_get_cred_afs()
- * appl/lib/tokens.c (arlalib_token_iter): new func to iterate all
- tokens.
-
- * xfs/bsd/xfs_dev-common.c (xfs_block_sigset): new function that
- remove signals we want to block from a sigset_t in some diffrent
- ways.
- (xfs_message_rpc): use xfs_block_sigset(); if there is a p_sigctx, use it.
-
- * xfs/solaris/xfs_vnodeops.c (xfs_map): remove the check that the
- mapping is off the end of the file, solaris vm works that way.
-
- * xfs/linux/xfs_message.c (xfs_invalid_xnode): don't mark
- directories as STALE
- * xfs/bsd/xfs_message.c (xfs_message_invalidnode): don't mark
- directories as STALE
-
- * rx/rx.c (rxi_FindPeer): init connQueue
-
-2001-01-06 Love <lha@stacken.kth.se>
-
- * rx/rx.c (rxi_InsertPeer): change all connection that used the
- original peer that is about to die.
- (rx_NewConnection,rxi_FindConnection): attach this conn to the peer
- (rx_DestroyConnection): when the connection dies, deattach it
- from the peer.
-
- * rx/rx.h (rx_connection): add a queue_item that attaches this
- connection to its peer.
-
-2001-01-06 Simon Josefsson <jas@nada.kth.se>
-
- * conf/CellServDB (extundo.com): add.
-
-2001-01-06 Love <lha@stacken.kth.se>
-
- * appl/fs/fs.c (newcell_cmd): mark cell as mandatory and remove
- check
-
-2001-01-05 Love <lha@stacken.kth.se>
-
- * rx/rx.c (rxi_DecongestionEvent): decrement the refcount after we
- are done, so that the peer doesn't get reclaimed if we block in
- rxi_Start(). From Nickolai Zeldovich <kolya@mit.edu>.
-
- * appl/fs/fs.c (afs_listacl): just return if there a access
- failure. From Nickolai Zeldovich <kolya@mit.edu>
-
- * arlad/fcache.c (getacl): reset the opaque data structure in case
- we fail, make sure we free data when we fail.
- From Nickolai Zeldovich <kolya@mit.edu>
-
- * arlad/fcache.c (get_attr_bulk): pull out the host from the rx
- connection in case we need it later, then we don't need to used
- freed memory. From Nickolai Zeldovich <kolya@mit.edu>.
-
-2001-01-04 Love <lha@stacken.kth.se>
-
- * lib/ko/agetarg.c (agetarg): check that the mandatory arguments
- are filled in, from Nickolai Zeldovich <kolya@mit.edu>
-
- * appl/fs/fs.c (cmds): added "df" from Nickolai Zeldovich
- <kolya@mit.edu>
-
-2001-01-04 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * appl/pts/pts.c (member_cmd): set conn_context to null before
- using it.
-
-2001-01-02 Love <lha@stacken.kth.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_getpages): use VOP_GETPAGES()
- for BSDs that doesn't have vnode_pager_generic_getpages().
-
- * xfs/linux/bin/Makefile.in: install startarla in $prefix/sbin
-
-2001-01-01 Assar Westerlund <assar@sics.se>
-
- * xfs/bsd/xfs_syscalls-common.c (fhget_call): re-structure
- * xfs/bsd/xfs_syscalls-common.c (fhget_call): always vrelease `vp'
- (fhopen_call): check `vp' first
- (xfs_pioctl_call): handle the weird case of someone sending a filename
- to debug
-
-For older ChangeLog entries see ChangeLog.2000
diff --git a/usr.sbin/afs/src/ChangeLog.2002 b/usr.sbin/afs/src/ChangeLog.2002
deleted file mode 100644
index 2ad6e2d2ebc..00000000000
--- a/usr.sbin/afs/src/ChangeLog.2002
+++ /dev/null
@@ -1,2859 +0,0 @@
-2002-12-30 Love <lha@stacken.kth.se>
-
- * appl/vos/vos.8: fix Dt section
-
- * appl/bos/bos.8: fix Dt section
-
- * tests: switch to emacs-21.2
-
- * tests/generic-build: send error output to fd 4 (progress)
-
-2002-12-29 Love <lha@stacken.kth.se>
-
- * configure.in (bsd): don't check for kernel make_dev, we no
- longer need it
-
- * nnpfs/bsd/nnpfs_wrap-bsd.c (make_devices/destroy_devices):
- remove ifdef on HAVE_KERNEL_MAKE_DEV since we no longer support
- pre freebsd 4.1, rename remove_devices to destroy_devices to match
- destroy_dev, also remove support for CDEV_MODULE (freebsd 4.0)
-
- * appl/mpp/mpp.c (mpp_isblank): returns an int
-
- * nnpfs/bsd/Makefile.in: fix pre and post ld magic helper objects
- for freebsd < 5
-
- * conf/Makefile.in: (clean): remove arla.spec
-
- * configure.in: (AC_OUTPUT): don't build conf/arla.conf and
- conf/arla.spec, let the makefile do that.
-
-2002-12-21 Love <lha@stacken.kth.se>
-
- * rx/rxperf.c: s/strings.h/string.h/ for mem* functions
-
- * scripts/arla-release.sh: autom4te.cache is a directory
-
- * configure.in: pre7
-
- * HACKING: don't fail if automake failes for now
-
- * appl/fs/fs.1: s/comand/command/; from openbsd
-
-2002-12-20 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (fcache_init): don't set fprioritylevel, its
- already set
-
- * INSTALL: update to match configure options
-
- * INSTALL: no mmaptime
-
- * configure.in: no mmaptime
-
- * util/mmaptime.h: OBSOLETE
-
- * util/mmaptime.c: OBSOLETE
-
- * lwp/fasttime.c: no mmaptime
-
- * rxkad/rxkad_locl.h: no mmaptime
-
- * rx/rx_locl.h: no mmaptime
-
- * arlad/arla_local.h: no mmaptime
-
- * nnpfs/bsd/bin/startarla.in: move mknod after kldload so devfs
- have its chance to do its magic dance
-
- * doc/real-world.texi: update port and natkeep stuff
-
- * INSTALL: update port info
-
- * configure.in: if netbsd, set default_sys to /usr/src/sys
-
-2002-12-19 Love <lha@stacken.kth.se>
-
- * configure.in: pre6
-
- * arlad/fcache.[ch]: split find_first_fs into two parts,
- init_fs_context and find_first_fs. now the vldb operation can
- return error values to caller. This fixes problem haba had with
- expired token in root's pag
-
- * conf/arla.conf.in: remove fpriority as a configurable option, to
- be folded into the connection level instead
-
- * arlad/arla.{c,conf.in}: remove fpriority as a configurable
- option, to be folded into the connection level instead
-
- * configure.in: remove test for mnt_nvnodelist
-
- * nnpfs/bsd: change how nnpfs nodes are looked up to a hash
- instead of a linked list (the struct mount->m_vnodes list). This
- removes a race, an autoconf test and make it faster
-
- * conf/arla.conf{,.in}: generate arla.conf so we can changes the
- value depending on target platform
-
- * configure.in: ARLA_CONF_*: move arla.conf tunable option to here
-
- * tests/run-tests.in: make date in test output less verbose
-
-2002-12-18 Love <lha@stacken.kth.se>
-
- * NEWS: FreeBSD 5.0 is in 0.36
-
- * scripts/arla-release.sh: remove autom4te.cache if there is a
- $HOME/.gnupg, sign tar-boll
-
- * nnpfs/bsd/nnpfs_common-bsd.c (MALLOC_DEFINE): make helptests
- better
-
- * configure.in: pre5
-
- * nnpfs/bsd/nnpfs_syscalls-wrap-freebsd.c: force install afs
- syscall
-
- * tests/build-gdb: 5.3 is released
-
- * nnpfs/bsd/nnpfs_vnodeops-bsd.c: add debug output to
- nnpfs_pathconf
-
- * nnpfs/bsd/nnpfs_vnodeops-bsd.c: add vop_pathconf
-
- * configure.in: check for vop_stdpathconf
-
- * nnpfs/bsd/nnpfs_vnodeops-common.c (nnpfs_read_common): make sure
- we don't touch the vnode after we have done a vrecycle(), also
- make sure we don't look at the content of the vnode after we have
- release the vnode
-
- * nnpfs/bsd: split the malloc type in 4 diffrent malloc types
-
- * nnpfs/bsd/nnpfs_vnodeops-bsd.c (nnpfs_link): FreeBSD 5.0 doesn't
- need to lock the vnode in VOP_LINK
-
- * nnpfs/bsd/nnpfs/nnpfs_locl.h: move NNPFS_MAKE_VROOT to
- nnpfs_locl.h include <sys/vnode.h>
-
- * nnpfs/bsd/nnpfs_vnodeops-bsd.c (nnpfs_abortop,cleanup_cnp):
- remember to clear the HASBUF flag when when freeing the component
- name in the uma_zfree case
-
-2002-12-17 Love <lha@stacken.kth.se>
-
- * configure.in: add some freebsd 5 CFLAGS
-
- * nnpfs/bsd/nnpfs_vnodeops-common.c: comment out cruft after
- #endif/#else
-
- * nnpfs/bsd/nnpfs/nnpfs_locl.h: if exists, include <vm/uma.h>
- prototype for (freebsd5) compat VT_ defines
-
- * nnpfs/bsd/nnpfs_vfsops-freebsd.c: provide compat VT_ defines
-
- * nnpfs/bsd/nnpfs_message.c: use NNPFS_MAKE_VROOT comment out text
- after #endif
-
- * nnpfs/bsd/nnpfs/nnpfs_common.h: add helper macro
- NNPFS_MAKE_VROOT that sets that VROOT flag on a vnode this is
- since freebsd 5 split that v_flag field into too parts v_iflag and
- v_vflag because of locking issues
-
- * tests/run-tests.in: make sure the hostname is always set to
- something so we don't pass a - to mkdir
-
- * nnpfs/bsd/nnpfs_dev-common.c (nnpfs_cursig): its not easy to
- find the CURSIG for freebsd5, lets just ignore it for now (and
- return 0)
-
- * nnpfs/bsd/Makefile.in: build glue for freebsd5
-
- * configure.in: add some freebsd 5 glue: add automake variable
- FBSD5, check for <vm/uma.h>, and uma_zfree_arg()
-
- * nnpfs/bsd/Makefile.in: yet another way to build vnode_if.h
- (freebsd 5.0)
-
-2002-12-16 Love <lha@stacken.kth.se>
-
- * arlad/arla.conf.5: s/maxium/maximum/g ; Jesper Louis Andersen;
- from OpenBSD
-
-2002-12-15 Love <lha@stacken.kth.se>
-
- * rx/rx.c: remove more rx_{Read,Write}Proc
-
- * rx/rx_user.h: cleanup, ident, don't provide a prototype for
- fprintf
-
- * rx/rx_user.h: kill USE_MMAPTIME
-
- * rx/rx_rdwr.c: remove all rx_{Read,Write}proc and use
- rx_Write/rx_Read
-
- * rx/rx.h: ident some functions remove all rx_{Read,Write}proc and
- use rx_Write/rx_Read
-
- * arlad/messages.c (possibly_have_network): Ignore `0' as an ipv4
- address it wont work either. Comment on what v6 addresses to
- ignore.
-
-2002-12-11 Love <lha@stacken.kth.se>
-
- * rxkad/rxk_crpt.c: remove rx_SlowPutInt32 proto, no longer used
-
- * arlad/messages.c (viocconnect): when reconnecting, get a new
- uuid to make sure the fileserver doesn't get upset with us
-
-2002-12-07 Love <lha@stacken.kth.se>
-
- * configure.in: remember the flags we tested comerr with
-
-2002-12-06 Love <lha@stacken.kth.se>
-
- * util/log.c: avoid using reserved word 'log'
-
- * lib/ko/kocell.c: avoid using reserved word 'log'
-
- * arlad/arladeb.h: avoid using reserved word 'log'
-
- * arlad/arladeb.c: avoid using reserved word 'log'
-
-2002-12-04 Tomas Olsson <tol@stacken.kth.se>
-
- * nnpfs/bsd/nnpfs_syscalls-wrap-bsd.c (try_install_syscall): on
- openbsd, ignore that AFS_SYSCALL appears used
-
-2002-12-03 Love <lha@stacken.kth.se>
-
- * appl/mac/install/StartupParameters.plist: add missing ;
-
- * appl/mac/make-mac-package.in: cleanup
-
- * NEWS: Changes in release 0.35.11
-
-2002-12-03 Tomas Olsson <tol@stacken.kth.se>
-
- * nnpfs/bsd/nnpfs_vnodeops-bsd.c (nnpfs_symlink):
- vput for OpenBSD <= 3.2
-
-2002-12-03 Love <lha@stacken.kth.se>
-
- * appl/mac/mafslog/mafslog.m: 1.2.2.1->1.2.2.2: change order where
- we do k_hasafs() so we can tell use that afs client isn't started
-
- * appl/mac/install/Arla: handle kext's
-
-2002-12-02 Love <lha@stacken.kth.se>
-
- * appl/mac/mafslog/appl_locl.h: remove, no longer needed
-
- * appl/mac/mafslog/mafslog.m: inline appl_local.h so we use it
- itstead of the appl_local.h in arlalib, left over from when this
- program didn't use arlalib
-
- * appl/mac/mafslog/Makefile.in: no bundle for cocoa application
-
- * appl/mac/mafslog/Makefile.in: use libtool (for real this time)
-
- * appl/mac/mafslog/PkgInfo: add
-
- * appl/mac/mafslog/Info.plist: add
-
- * appl/mac/arlacmm/Makefile.in: libtool
-
- * appl/mac/Arla_Configuration/Makefile.in: libtool
-
- * HACKING: automake lib/sl/Makefile
-
- * lib/sl/Makefile.in: remove, use automake file
-
-2002-12-01 Love <lha@stacken.kth.se>
-
- * appl/mac/mafslog: prototype afslog
-
-2002-11-30 Tomas Olsson <tol@stacken.kth.se>
-
- * tests/run-tests.in: print date when each test is started
-
- * tests/build-emacs{,-j}: build --without-x, emacs-21.2
-
- * tests/generic-build: pass $CONFIGURE_ARGS to configure
-
-2002-11-30 Love <lha@stacken.kth.se>
-
- * arlad/messages.c: (break_callback): mirror the token managment code
- from the kernel in here so it will be use by all users of
- break_callback()
-
- * arlad/fcache.c (stale): have break_callback() manaage the tokens
- when we call it, if not just clear then (since the node isn't in
- the kernel)
-
-2002-11-29 Tomas Olsson <tol@stacken.kth.se>
-
- * configure.in (vfs_mount test): include param.h before proc.h
-
- * doc/{debugging,oddities}.texi: speling
-
- * lwp/make-process.o.sh.in: speling
-
- * nnpfs/{aix,irix,sunos,linux,solaris}/nnpfs_node.c
- (new_nnpfs_node): speling
-
- * arlad/inter.c (cm_open): update tokens on NNPFS_OPEN_*
-
-2002-11-28 Love <lha@stacken.kth.se>
-
- * nnpfs/include/nnpfs/nnpfs_queue.h: some useful list macros
-
- * arlad/fcache.c (cleaner): the 50 is really
- NNPFS_GC_NODES_MAX_HANDLE
-
- * ydr: generate free functions (from assar), remove tcpdump stuff
-
- * ydr/main.c: don't call generate_tcpdump_patches
-
- * rx/rx_pkt.h: replace rx_{Put,Get}Long with rx_Slow{Get,Put}Long
-
- * rx/rx_pkt.c (rxi_ReceiveDebugPacket): use rx_SlowPutLong
-
- * rx/rx.h: add a rock for the service to hide stuff under
-
- * rx/rx_globs.h: make rxi_Alloc return void *
-
-2002-11-26 Harald Barth <haba@stacken.kth.se>
-
- * conf/CellServDB: More followers from northern Sweden
-
-2002-11-26 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * nnpfs/linux/nnpfs/nnpfs_node.h (1.20.2.2 -> 1.20.2.3) nodelist
- * nnpfs/linux/nnpfs/nnpfs_fs.h (1.21.2.3 -> 1.21.2.4) nodelist
- is now a hashtable
- * nnpfs/linux/nnpfs_vfsops.c (1.71.2.3 -> 1.71.2.4)
- (xfs_read_super): call xn_init_head instead of INIT_LIST_HEAD
- * nnpfs/linux/nnpfs_node.c (1.51.2.6 -> 1.51.2.7) nodelist is now
- a hashtable
- * nnpfs/linux/nnpfs_dev.c (1.77.2.6 -> 1.77.2.7) (free_node): use
- xn_deletedp
-
-2002-11-18 Love <lha@stacken.kth.se>
-
- * arlad/Makefile.in: build ptest, the poller test
-
- * arlad/ptest.c: poller test
-
-2002-11-14 Love <lha@stacken.kth.se>
-
- * conf/CellServDB (athena.mit.edu): update prill.mit.edu
-
-2002-11-12 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * rx/rxdebug.c (MainCommand): don't change tstats.version if it's
- outside limits
-
-2002-11-08 Tomas Olsson <tol@stacken.kth.se>
-
- * nnpfs/linux/nnpfs_message.c (nnpfs_message_installdata): log
- error on data w/o token
- * .cvsignore: added compile
-
-2002-11-05 Harald Barth <haba@stacken.kth.se>
-
- * arlad/cred.c: spelling
-
-2002-11-04 Harald Barth <haba@stacken.kth.se>
-
- * configure.in: Building snapshot
- * scripts/arla-release.sh: Fix regexp and more variable quoting
-
-2002-10-31 Love <lha@stacken.kth.se>
-
- * appl/vos/vos_listaddrs.c: try to make listaddr work again
-
- * rxdef/vldb.xg: fix VL_GetAddrs, broken prototype
-
- * configure.in: more quoting for AC_PROG_EGREP, now it works for
- 2.54
-
-2002-10-30 Love <lha@stacken.kth.se>
-
- * rxkad/rxk_serv.c (decode_krb5_ticket): check the enc-type of the
- encrypted part of the ticket, make sure its des
-
-2002-10-29 Love <lha@stacken.kth.se>
-
- * configure.in: fix comment for PROG_EGREP
-
-2002-10-29 Tomas Olsson <tol@stacken.kth.se>
-
- * nnpfs/winnt/bin/nnpfs-helper.c: simple logging
- * nnpfs/winnt/inc/nnpfs_fastio.h: added; fast I/O prototypes
- * nnpfs/winnt/inc/nnpfs_list.h: simple list implementation
- * nnpfs/winnt/src/sources (SOURCES): added nnpfs_fastio.c
- * nnpfs/winnt/src/nnpfs_fastio.c: added; fast I/O routines
- * nnpfs/winnt/src/nnpfs.rc: not xfs any more
- * nnpfs/winnt/src/nnpfs_{dev,dnlc,fbuf,init,message,misc,node,vops}.c:
- write support
- * nnpfs/winnt/inc/nnpfs_{deb,dev,dnlc,ioctl,locl,node,proto}.h:
- write support
-
-2002-10-28 Harald Barth <haba@stacken.kth.se>
-
- * configure.in: This makes my autoconf complain less
- * arlad/nnpfs.c: Give better error message
-
-2002-10-24 Harald Barth <haba@stacken.kth.se>
-
- * arlad/fcache.c: Do not zero tokens if the tokens tell us that it
- is still in use from another place.
-
-2002-10-20 Tomas Olsson <tol@stacken.kth.se>
-
- * doc/nnpfs.txt: spelling
- * tests/part-files: spelling
-
-2002-10-20 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (write_attr): fix broken assert
-
- * tests/apwd.c: make readlink take size(buf) - 1, NUL terminate
- string remove unused variable
-
-2002-10-19 Love <lha@stacken.kth.se>
-
- * configure.in: add AC_PROG_EGREP since modern autoconf failes to
- a depend on that in AC_EGREP_CCP
-
- * lib/cmd: move to bit bucket for recycling
-
- * configure.in: no makefile for lib/cmd
-
- * lib/Makefile.in: don't build libcmd
-
- * appl/afsutils/Makefile.in: don't -lcmd, its not needed
-
- * conf/CellServDB: no more {cs,graphics}.cornell.edu from Mitch
- Collinsworth on arla-drinkers
-
- * util/heap.c (heap_remove): assert the we we don't try to remove
- a heap element that was inserted w/o a heap_ptr
-
-2002-10-17 Love <lha@stacken.kth.se>
-
- * **/*.[0-9]: format, indent, new sentence, new line
-
-2002-10-15 Love <lha@stacken.kth.se>
-
- * arlad/poller.c (poller_add_conn): use cell from conn
-
- * arlad/poller.c: remove a race when polling a server remove a
- race when adding/re-adding a entry fix a memory leak
-
-2002-10-11 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * appl/lib/arlalib.c (arlalib_get_cred_krb) try user given cell
- before we try to guess
-
-2002-10-08 Love <lha@stacken.kth.se>
-
- * tools/release-tools/tar-rootify.c: s/<strings.h>/<string.h>/
- * tools/release-tools/cpio-rootify.c: s/<strings.h>/<string.h>/
-
-2002-10-03 Love <lha@stacken.kth.se>
-
- * appl/mac/make-mac-package.sh.in: look for more places where
- arla-$VERSION.pax.gz might hide
-
- * nnpfs/bsd/nnpfs_vnodeops-bsd.c (nnfs_page{in,out}): if no apple,
- #error-out
-
- * nnpfs/bsd/nnpfs_vnodeops-bsd.c (nnpfs_pagein): Zero out rest of
- last page if there wasn't enough data in the file
-
-2002-10-02 Love <lha@stacken.kth.se>
-
- * conf/CellServDB (iastate.edu): update, from Tracy Di Marco White
- <gendalia@iastate.edu>
-
- * lib/ko/kocell.c: fix NUL termination of fgets string
-
- * lib/cmd/cmd.c: fix NUL termination of fgets string
-
- * appl/mpp/mpp.c: fix NUL termination of fgets string
-
- * rx/rxperf.c: fix NUL termination of fgets string
-
- * arlad/fprio.c: fix NUL termination of fgets string
-
- * arlad/arla.c: fix NUL termination of fgets string
-
-2002-09-30 Love <lha@stacken.kth.se>
-
- * arlad/arla-cli.c: add new command, sleep
-
- * arlad/state.c (state_store_fcache): plug memory leak, use static
- buffer
-
- * arlad/state.c (state_store_volcache): plug memory leak, use static
- buffer
-
-2002-09-30 Tomas Olsson <tol@nada.kth.se>
-
- * lwp/plwp.c (Cal_Highest_runnable_priority): highest index is
- MAX_PRIORITIES - 1
-
-2002-09-27 Love <lha@stacken.kth.se>
-
- * lwp/plwp.c: more verbose debugging, set stacksize (otherwise
- uninited), make Cal_Highest_runnable_priority() work again
-
- * rx/rxdebug.c: replace bcopy/bzero with memcpy/memset
-
- * INSTALL: update mac os text
-
- * nnpfs/include/nnpfs/nnpfs_message.h: add more comments
- describing nnpfs_node.flags and NNPFS_TOKEN macros
-
- * lwp/plwp.c (lwp_init): is a pointer, use it a such
-
- * lwp/plwp.c: (Abort_LWP): this function wasn't a vararg function,
- silly, it should be, make it.
-
- * lwp/plwp.c: (LWP_CreateProcess): reorganize to make error
- handling sane, also do AbortLWP() if pthread_create/CreateThread
- failes.
-
- * lwp/plwp.c: (LWP_CreateProcess): indent
-
-2002-09-26 Love <lha@stacken.kth.se>
-
- * lwp/plwp.c (Cal_Highest_runnable_priority): fix broken code
-
- * util/log.c: make code common between log_open_stderr and
- log_open_file that just was in log_open_file so all fields get
- inited.
-
-2002-09-25 Love <lha@stacken.kth.se>
-
- * doc/themis.texi: more themis stuff
-
-2002-09-18 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * appl/cbdebug/cbdebug.c (apropos_cmd): check argc correctly
-
-2002-09-17 Love <lha@stacken.kth.se>
-
- * nnpfs/bsd/bin: remove depenecy on roken
-
- * lib/ko/koerror.c: Add some more vldb error code that I forgot
- before
-
- * util/log.c: set progname to "unknown-program" when we don't know
- it (wasn't passed in)
-
- * lib/cmd/cmd.c: use getprogname()
-
- * cf/check-sl.m4: tests for yes so we don't get -Lyes/lib & co
-
- * tests/*.c: use getprogname()
-
- * appl/lib/arlalib.c: add localauth again
-
- * appl/asrvutil: remove program
-
- * configure.in: remove asrvutil
-
- * appl/lib/arlalib.c: remove localauth support, I'll rewrite it soon
-
- * appl/lib/arlalib.c: if we use openssl, use des_random_key
-
- * appl/asrvutil/asrvutil.c: if we use openssl, use des_random_key
-
- * nnpfs/bsd/nnpfs_wrap-bsd.c: more more glue code to support
- netbsd current
-
- * nnpfs/bsd/bin/nnpfs_makedev: there might be a optional bdev-num
-
-2002-09-16 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * arlad/fs_errors.h: Define __attribute__ if it's not defined and
- if not GNUC
-
- * util/log.h: Define __attribute__ if it's not defined and if not
- GNUC
-
- * util/util-tester.c: Include roken.h
-
- * tests/apwd.c (test_1): Don't do getcwd(NULL, 0), behaviour is
- undefined
-
- * lwp/make-process.o.sh.in: Try to use CPP with .S file
-
-2002-09-14 Tomas Olsson <tol@stacken.kth.se>
-
- * nnpfs/include/nnpfs/nnpfs_message.h (NNPFS_TOKEN_GOT): do things
- the traditional way, deprecate
- (NNPFS_TOKEN_GOT_{ANY,ALL}): added
-
- * nnpfs/include/nnpfs/nnpfs_debug.h: added XDEBREF - track
- reference counting
-
- * nnpfs/include/nnpfs/nnpfs_message.h (NNPFS_TOKEN_GOT): check for
- all requested tokens
-
-2002-09-13 Johan Danielsson <joda@pdc.kth.se>
-
- * nnpfs/bsd/nnpfs_wrap-bsd.c: make this compile with
- NetBSD-current
-
-2002-09-13 Love <lha@stacken.kth.se>
-
- * configure.in: add missing AC_CONFIG_SRCDIR, fix comment
-
- * HACKING: we need autoconf 2.53, remove exit 0, add error
- checking, call automake with -a -c to add missing files
-
-2002-09-12 Love <lha@stacken.kth.se>
-
- * appl/vos/vos_listaddrs.c (vos_listaddrs): make it work on cell's
- with holes in the index array
-
- * lwp/make-process.o.sh.in: add -DUSING_ASM to MYDEF add missing
- MYDEF spelling
-
- * configure.in: fix AC_INIT, AM_INIT_AUTOMAKE, and AC_KRB_VERSION
-
- * configure.in: catch up with new roken macros
-
- * cf:, lib/roken: import new roken from heimdal 0.5
-
-2002-09-12 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * appl/afsutils/Makefile.in: Don't install klog
-
- * arlad/fcache.c (cleaner): if state is CL_COLLECT, bail out
- unconditionally
-
- * nnpfs/linux/nnpfs_message.c (nnpfs_force_invalid_xnode): do
- invalidate_inode_pages
-
-2002-09-12 Love <lha@stacken.kth.se>
-
- * configure.in: check for <limits.h>
-
- * nnpfs/linux/Makefile.in: catch up with `pacify automake' changes
-
- * configure.in: prepare for new libroken, pacify automake
-
- * rxkad/Makefile.in: don't misuse VPATH, use srcdir
-
- * xfs: xfs is dead, long live nnpfs
-
-2002-09-11 Harald Barth <haba@pdc.kth.se>
-
- * nnpfs/linux/nnpfs_dev.c: Place down(), the enter of the mutex,
- earlier and move asignments which lingered in the variable
- declaration area inside the area protected by the mutex (compare
- with the corresponding solaris code). Use the newly assigned value
- of sleepq in the first part of the for(;;) construct to init the
- loop variable.
-
-2002-09-09 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * configure.in: Try to find linux includefiles in a way consistent
- with modern linux kernels.
-
-2002-09-08 Love <lha@stacken.kth.se>
-
- * nnpfs/bsd/nnpfs_message.c (nnpfs_message_invalidnode): in the
- __APPLE__ case, vget the node before calling ubc functions
-
- * nnpfs/bsd/nnpfs_vnodeops-common.c (nnpfs_handle_stale): set ubc
- size when invalidating the node
-
- * doc/nnpfs.txt: ispelling and technical updates
-
- * **/*: 's/nnpfsserver/xfsserver/g'
-
- * nnpfs/bsd/nnpfs_message.c: indent
-
-2002-09-08 Harald Barth <haba@stacken.kth.se>
-
- * doc/nnpfs.txt: Lots of changes, please review.
-
-2002-09-08 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * nnpfs/linux/nnpfs_inodeops.c (nnpfs_d_revalidate): added debug
- message
-
-2002-09-08 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * configure.in: Added --with-milkopart
-
- * lib/ko/afs_uuid.c: Include sys/file.h if it exists
-
- * configure.in: Added sys/mkdev.h to AC_CHECK_HEADERS
-
-2002-09-07 Love <lha@stacken.kth.se>
-
- * configure.in: require autoconf 2.53
-
-2002-09-07 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * lib/ko/kocell.c (cell_init): read cells from $CELLSERVDBFILE if
- set. also protect suid-binaries
-
- * appl/udebug/udebug.c: print alternate addresses
- * rxdef/ubik.xg: added alternate addresses in ubik_sdebug
-
- * appl/bos/bos.8 (getrestart) updated
-
- * appl/fs/fs_setcrypt.c: added help
-
-2002-09-07 Love <lha@stacken.kth.se>
-
- * arlad/messages.c: Always set offset in the installdata
- message. Noticed by <tol@it.su.se>.
-
- * arlad/fcache.c: adding missing ) and spelling, From Fredrik Thulin
- <ft@it.su.se>
-
- * nnpfs/linux: handle the changed semantics of ->d_revalidate
-
- * nnpfs/irix/nnpfs_vfsops.c: s/xFs/nnpfs/, close that I missed
- this one :)
-
- * **/* (with exception of ChangeLog,NEWS and timeline.texi):
- s/xfs/nnpfs/g;s/XFS/NNPFS/g
-
- * nnpfs: repo copy of xfs
-
- * xfs: rename to nnpfs
-
- * arlad/stats.c (collectstats_hostpart): remove gracious extra
- varible
-
- * arlad/messages.h: remove FETCH_BLOCKSIZE
-
- * arlad/stats.c: define MIN_FETCH_BLOCKSIZE here and
- s/FETCH_BLOCKSIZE/MIN_FETCH_BLOCKSIZE/
-
- * arlad/stats.c (collectstats_hostpart,collectstats_init): use
- growing hashtab
-
- * arlad/stats.c (hostpart_addhash): use hashtabaddreplace() to
- avoid memory leak
-
- * arlad/message.[ch],stats.[ch]: enable prefetch again
-
- * arlad/messages.c (xfs_message_putattr): don't update length at
- the same time as we update attributes, since the fileserver can't
- handle that.
-
-2002-09-06 Love <lha@stacken.kth.se>
-
- * configure.in: fix netbsd-lkm with relative $srcdir
-
-2002-09-05 Love <lha@stacken.kth.se>
-
- * arlad/stats.c (collectstats_stop): don't count statistics if
- partition is -1
-
-2002-08-29 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * xfs/bsd/Makefile.in: Changed Mac OS X to use kext:s
-
- * xfs/bsd/Info.plist.in: Added
-
- * configure.in: Added COM_APPLE_KERNEL_BSD and xfs/bsd/Info.plist
- generation
-
-2002-08-26 Love <lha@stacken.kth.se>
-
- * tools/release-tools/Makefile.in: don't install/uninstall
-
-2002-08-25 Love <lha@stacken.kth.se>
-
- * conf/CellServDB: su.se does afsdb, so should you
-
-2002-08-24 Love <lha@stacken.kth.se>
-
- * lib/bufdir/fbuf.c: Don't map the whole file in mmap_copy.*
- functions, do instead chunks of mmap_max_size (10M). This way
- operating system that have problems to maps things larger then
- 600M will still work.
-
-2002-08-21 Love <lha@stacken.kth.se>
-
- * xfs/linux/xfs_syscalls.c (sys_afs_int): simplify len logic in
- the copyout case
-
- * xfs/linux/xfs_inodeops.c: (xfs_d_delete): fix comment
-
-2002-08-17 Love <lha@stacken.kth.se>
-
- * rxkad/Makefile.in: build fc_test
-
-2002-08-16 Love <lha@stacken.kth.se>
-
- * arlad/messages.c (token_for_cell): use XFS_MSG_MAX_DATASIZE for
- buffer size
-
- * arlad/messages.c (viocsettok): more error checking
- (token_for_cell): more error checking
-
- * appl/lib/tokens.c (arlalib_token_iter): more error checking
-
-2002-08-15 Love <lha@stacken.kth.se>
-
- * Release 0.35.9, see the branch for relevant patches
-
-2002-08-14 Love <lha@stacken.kth.se>
-
- * NEWS: sync with 0.35 branch
-
-2002-08-13 Love <lha@stacken.kth.se>
-
- * arlad/arla.c (arla_init): if the user choose "syslog" as
- log_file, change it to "syslog:no-delay" to be helpful since that
- is probably what the user wants
-
- * NEWS: sync in changes from 0.35.9
-
- * xfs/aix/xfs_syscalls.c (xfs_pioctl_call): use
- XFS_MSG_MAX_DATASIZE
-
- * xfs/solaris/xfs_syscalls.c (remote_pioctl): use
- XFS_MSG_MAX_DATASIZE
-
- * xfs/bsd/xfs_syscalls-common.c (remote_pioctl): use
- XFS_MSG_MAX_DATASIZE
-
- * xfs/linux/xfs_syscalls.c (sys_afs_int): use XFS_MSG_MAX_DATASIZE
-
- * xfs/include/xfs/xfs_message.h (XFS_MSG_MAX_DATASIZE): new
- constant
- (xfs_message_pioctl, xfs_message_wakeup_data): use XFS_MSG_MAX_DATASIZE
-
- * include/kafs.h: add common pioctl's
-
-2002-08-10 Love <lha@stacken.kth.se>
-
- * conf/CellServDB: add lns.mit.edu
-
-2002-08-09 Love <lha@stacken.kth.se>
-
- * cf/*: do offical workaround for LTLIBOBJS
-
- * configure.in: add AC_PROG_EGREP for those that have it do
- LTLIBOBJS wordaround as documented
-
-2002-08-05 Love <lha@stacken.kth.se>
-
- * rxdef/vldb.xg: set limit to bulkaddrs<>
-
- * ydr/output.c (gen_check_overflow): check for overflows
- (encode_string):check for length -1 that would break the code otherwise
- (encode_varray): use gen_check_overflow
-
- * lib/Makefile.in: no libacl for now
-
- * rxdef/volumeserver.xg: sync with openafs s/replicas/manyDests/,
- put a limit on it too
-
- * rxdef/volumeserver.xg: AFSVolForwardMultiple/multi_results is
- OUT
-
-2002-08-01 Love <lha@stacken.kth.se>
-
- * arlad/messages.c (xfs_message_create): handle tokens for
- installnode
- (xfs_message_mkdir): ditto
- (xfs_message_getdata): don't allow to open directories with DATA_W
- Noticed by <tol@stacken.kth.se>
-
-2002-07-27 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (purge_cred): use FCACHE2XFSNODE_NO_LENGTH
-
- * arlad/messages.c: move the fake_stat code into
- afsstatus2xfs_attr(), obey the FCACHE2XFSNODE_LENGTH flag in
- afsstatus2xfs_attr(). this the had the effect that token changes
- will update rights when running with fake_stat
-
- * arlad/messages.h: change the FCACHE2XFSNODE flags to be more
- sane, the one that we really what make a make is possible to avoid
- is update the length of the file, so make that a flag instead
-
- * appl/mac/make-mac-package.sh.in: added more descriptive helptext,
- added Id tag
-
- * tests/intr-read[123]: intr-read is not a fast test
-
- * conf/CellServDB (in2p3.fr): update
- * conf/CellServDB (rl.ac.uk): update
-
-2002-07-26 Love <lha@stacken.kth.se>
-
- * tools/release-tools/common.c: use strtoq if there is no strtoll
- use strol if there is no strtoq
-
- * configure.in: check for strtoq
-
- * arlad/fcache.c (do_read_attr): print out warning with error
- before setting error to ENETDOWN
-
- * appl/mac/make-mac-package.sh.in: post-process with release-tools
-
-2002-07-25 Love <lha@stacken.kth.se>
-
- * lib/ko/kocell.c (cell_new_dynamic): remove write-to-CellServDB
- code
-
- * lib/ko/Makefile.in: added commented out ares support
-
- * appl/perf/afsfsperf.c: add -smallrun, spelling, help-tests From:
- Harald Barth <haba@pdc.kth.se>
-
-2002-07-24 Love <lha@stacken.kth.se>
-
- * lib/ko/restest.c: memset dbservers, print address, fix usage of
- _ko_resolve_host
-
- * lib/ko/ares.c: implementation of a libares resolver backend, need
- some patches to work
-
- * lib/ko/kocell.c (dns_lookup_cell): don't add time to the tll for
- hosts that have invalid timeout/address since that will render the
- address (0.0.0.0) valid
-
- * arlad/arladeb.h: unbreak (c)
-
-2002-07-24 Tomas Olsson <tol@stacken.kth.se>
-
- * xfs/winnt/bin/xfs-helper.c (device_thread, loop): cleaner debug
- output, don't fail when ioctl says ENOMEM DEBUG off by default
-
-2002-07-24 Love <lha@stacken.kth.se>
-
- * lib/ko/resolve.c: simplify, fixed some minor bugs, more strcasecmp
-
- * lib/ko/reswinnt.c: first shot of a windows <windns.h> resolver
- for libko
-
- * lib/ko/Makefile.in: restest
-
- * lib/ko/restest.c: restest
-
- * lib/ko/kocell.c (dns_lookup_cell): make lowest ttl 5 minutes,
- move comment
-
- * lib/ko/resnull.c: Dummy implementation of resolver api
-
- * lib/ko/Makefile.in: add RESOLVE_[CO]
-
- * lib/ko/resolve.c: Implementation of resolver api using roken
- resolve.h moved from kocell.c
-
- * lib/ko/kocell.c: use the independant resolver api to resolve
- cell/hosts
-
- * lib/ko/ko_locl.h: create a resolver independant resolver api for
- libko
-
-2002-07-23 Tomas Olsson <tol@stacken.kth.se>
-
- * arlad/xfs.h (xfs_message_receive): remove duplicate
-
- * xfs/winnt/src/* handle symlinks, reset cache, ...
-
- * xfs/winnt/inc/xfs_proto.h (xfs_alloc{,_link}): new arg - tag
-
- * xfs/winnt/inc/xfs_node.h (xfs_node_{gc_all,invalid}): added
-
- * xfs/winnt/inc/xfs_locl.h (xfs_node): reference counts are now long
- (xfs_channel): add wake_event
- define XFS_MAX_SYMLINKS
-
-2002-07-23 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (find_volume): only tell us to go get the rw
- volume if there exists one
-
- * arlad/Makefile.in: bring uptodate
-
- * arlad/volcache.c: push the disconnected test to later in the
- code so dynroot volumes lookups will work
- (volume_uptodatep): the volume is only valid in the disconnected
- case when we have valid data
-
- * arlad/dynroot.c: add aliases to the generated dynroot
-
- * lib/ko/kocell.c: add support for aliases in dynroot
-
- * lib/ko/ko.h (cell_alias_foreach): new function
- (cell_addalias): new function
-
- * arlad/arla.c (params): sort and add fetch_block
-
- * arlad/inter.c: indent
-
- * arlad/dynroot.h: update (c)
-
- * arlad/{darla.c,darla.h,discon.h,discon_log.c,discon_log.h,
- reconnect.c,reconnect.h}: mark obsolete
-
- * arlad/stats.c (stats_set_prefetch): no return from void
-
- * arlad/stats.c (stats_set_prefetch): new function, set prefetch
- variable
- (stats_prefetch): return fetch_block_size instead of fixed size
-
- * arlad/stats.h (stats_set_prefetch): new function, set prefetch
- variable
-
- * arlad/arla_local.h: stop include unused files export
- fetch_block_size
-
- * arlad/*.[58]: update, improve, add more junk
-
-2002-07-22 Love <lha@stacken.kth.se>
-
- * configure.in: check for lchflags too
-
-2002-07-21 Love <lha@stacken.kth.se>
-
- * arlad/inter.c (cm_check_consistency): fcache_calculate_usage now
- correctly returns a int64_t
-
- * arlad/fcache.h (fcache_calculate_usage): return a int64_t
- * arlad/fcache.c (fcache_calculate_usage): return a int64_t
-
- * arlad/fcache.c (write_data): fix byte accounting, we leaked
- bytes here before
-
-2002-07-20 Love <lha@stacken.kth.se>
-
- * arlad/dynroot.c (dynroot_get_node): use propper fcache function
- to update accunting length
-
- * arlad/fcache.c (read_data): decide how much read-ahead using the
- function stats_prefetch()
- (sum_node): include dynroot nodes again
-
- * arlad/stats.h: warpping and prototype for stats_prefetch()
-
- * arlad/stats.c (stats_prefetch): return how much readahead we
- should do for this fileserver, now wired to FETCH_BLOCKSIZE
-
- * arlad/arla_local.h: add "stats.h"
-
- * arlad/fcache.h: move out collectstats_ functions to stats.h
-
- * arlad/{Makefile.in.stats.[ch].fcache.c}: break out statistics
- counting to own module
-
- * arlad/fcache.c (cleaner): removed unused debugging code
-
- * INSTALL: --with-krbafs, point toward README
-
- * xfs/bsd/Makefile.in: add a install-native that tries to do the
- right thing make lkmdir mean lkmdir (almost at least)
- (same for uninstall)
-
- * xfs/bsd/bin/Makefile.in: make lkmdir mean lkmdir (almost at
- least)
-
-2002-07-17 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * arlad/disco.c (disco_print_entry) terminate default with break
-
-2002-07-16 Love <lha@stacken.kth.se>
-
- * appl/vos/vos_common.c: fix memset arguments, from openbsd
-
- * include/Makefile.in (LOCL_HEADERS): split out roken headers
-
- * configure.in: provide am conditional ARLA_LOCAL_ROKEN that can
- be used in makefiles
-
-2002-07-15 Love <lha@stacken.kth.se>
-
- * appl/mpp/mpp.c: fix expansion of macros
-
- * tests/*.c: s/set_progname/setprogname/
-
- * xfs/bsd/xfs/xfs_node.h (xfs_node): lockf should me a pointer to
- a struct lockf
-
- * lib/cmd/testc.c: s/set_progname/setprogname/
-
-2002-07-14 Love <lha@stacken.kth.se>
-
- * configure.in: KERNEL_FUNCS+= lf_advlock
-
- * xfs/bsd/xfs_vnodeops-bsd.c, xfs/bsd/xfs/xfs_node.h: do local
- locking if possible
-
-2002-07-11 Love <lha@stacken.kth.se>
-
- * scripts/arla-release.sh: manage current arla version extracting
- too (AM_INIT_AUTOMAKE vs VERSION)
-
- * appl/afsutils/klog.c: rewrite the code even more, this sucks
-
- * appl/afsutils/klog.c: fix for finding of ticket based on
- proposal from Christopher Wing <wingc@engin.umich.edu> on
- arla-drinkers, changed by me.
-
-2002-07-11 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * appl/mac/make-mac-package.sh.in: Make script take srcdir and
- destdir
-
-2002-07-10 Love <lha@stacken.kth.se>
-
- * arlad/reconnect.c: s/rx_Error/rx_GetCallError/
- * arlad/fcache.c: s/rx_Error/rx_GetCallError/
- * lib/bufdir/fbuf.c: s/rx_Error/rx_GetCallError/
-
- * arlad/xfs.c: move rpc messages counters to a struct to make
- easier to add new counters
-
-2002-07-09 Love <lha@stacken.kth.se>
-
- * appl/vos/vos_{examine,vldbexamine}.c: fix printing when
- volserdown, broken printing.
-
-2002-07-08 Tomas Olsson <tol@stacken.kth.se>
-
- * xfs/winnt/bin/xfs-helper.c (device_thread): proper bailout on error
- (loop): repeat recv until we have the whole packet
-
- * xfs/winnt/inc/xfs_{dnlc,errno,locl,node,proto}.h:
- read some more
-
- * xfs/winnt/src/xfs_{deb,dev,dnlc,fbuf,init,message,misc,node,vops}.c:
- read some more
-
-2002-07-05 Love <lha@stacken.kth.se>
-
- * NEWS: mention afs3-callback
-
- * arlad/arlad.c (client_port): default to 0, and thus to
- afscallbackport.
-
- * arlad/arla.c (rxinit): if no port is specified use
- afscallbackport
-
-2002-07-04 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (cleaner): Change where we update the cleaner run
- number of the node to just after we check for it. Each change of
- state in the cleaner will change the cleaner run number so that
- each state look at every node. Fixes bug noticed by
- <tol@stacken.kth.se>.
-
- * arlad/fcache.c (cleaner): always consider a node cleanable if
- its used in the first step, since we never clean used used nodes
- later in the code.
- (invalidator): use ADEBINVALIDATOR
- (read_data): fix needbytes calculation
-
- * arlad/arladebu.c (arla_deb_units): add ADEBINVALIDATOR
- * arlad/arladeb.h: masks: add ADEBINVALIDATOR
-
-2002-07-03 Love <lha@stacken.kth.se>
-
- * appl/perf: add from milko appl tree, clean up
-
- * configure.in (AC_OUTPUT): move perf form milko appl to arla appl
-
- * doc/xfs.txt (version): clean up
- (installdata): make more sane
-
- * conf/freebsd/freebsd4-rc.arla: freebsd 4 start script
- (/etc/rc.arla)
-
-2002-07-02 Love <lha@stacken.kth.se>
-
- * appl/mpp/mpp.c (expand_macro): fix a broken case where there was
- multiple macros on the same row
-
-2002-07-01 Love <lha@stacken.kth.se>
-
- * arlad/arla.c (read_conffile): make negative boolan values work
-
- * arlad/messages.c: (try_next_fs): protect RXKADUNKNOWNKEY with
- #ifdef KERBEROS, from tol
-
- * arlad/cmcb.c: (RXAFSCB_GetCellServDB): fix prototype, from tol
-
- * arlad/arla.c: protect rxkad_level_string with #ifdef KERBEROS
-
-2002-06-30 Love <lha@stacken.kth.se>
-
- * arlad/conn.c (conn_dead): tell in what cell the dead host is in
-
- * tests/run-tests.in: RUN_TESTS += intr-read2 intr-read3
-
- * tests/intr-read{.c,1,2,3}: sigchild test
-
- * xfs/bsd/xfs_dev-common.c (xfs_block_sigset): ignore dying children
- (xfs_message_rpc): correct comment
-
-2002-06-29 Love <lha@stacken.kth.se>
-
- * arlad/messages.c (xfs_message_open): add tokens to e->tokens,
- mirrors cm_open
-
- * xfs/bsd/xfs_vnodeops-netbsd.c (xfs_netbsd_strategy): don't do
- sync io
-
- * arlad/inter.c (cm_rename): when renaming a file we also need to
- check if the file is in the cache, since in that case we need to
- mark it as a silly rename in case its opened by the kernel, and
- thus need to write it back to the server (where it no longer
- exists!)
-
-2002-06-28 Johan Danielsson <joda@pdc.kth.se>
-
- * appl/lib/tokens.c: don't bail out before we get EDOM (signaling
- the end of the tokens), the kernel can also return ENOTCONN,
- meaning that the index does not exist anymore (for example if the
- token has expired)
-
-2002-06-28 Love <lha@stacken.kth.se>
-
- * Release 0.35.8, see the branch for relevant patches
-
-2002-06-27 Love <lha@stacken.kth.se>
-
- * tools/Makefile.in (SUBDIRS): add release-tools
-
-2002-06-25 Love <lha@stacken.kth.se>
-
- * lwp/process.sparc.S: rename AS_UNDERSTANDS_REGISTER to
- PROG_AS_UNDERSTANDS_REGISTER
-
- * configure.in: rename AS_UNDERSTANDS_REGISTER to
- PROG_AS_UNDERSTANDS_REGISTER
-
-2002-06-24 Love <lha@stacken.kth.se>
-
- * README: update where krbafs lives
-
-2002-06-22 Love <lha@stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_vma_close): don't iput
-
- * lib/ko/afs_uuid.c (get_node_addr): just use dl->sdl_type
- directly instead of fooling around with struct if_data
-
- * conf/arla.conf: add rxkad-level example
-
- * lib/ko/kocell.c: remove direct dep on libroken (emalloc/estrdup)
-
-2002-06-14 Love <lha@stacken.kth.se>
-
- * ydr/output.c: use rx_SetCallError and rx_GetCallError
-
- * rx/rx.h: add rx_SetCallError and rx_GetCallError
-
-2002-06-13 Love <lha@stacken.kth.se>
-
- * arlad/arla.conf.5: sort
-
- * arlad/arla.c: add rxkad-level, sort
-
-2002-06-12 Love <lha@stacken.kth.se>
-
- * arlad/messages.c: (fcacheentry2xfsnode): add hook for fake_stat
-
- * arlad/arlad.c: (args): add --fake-stat and sort
-
- * arlad/arla.c,arla_local.h: add fake_stat
-
- * arlad/cb.xg: add GetCacheConfig
-
- * arlad/cmcb.c: add RXAFSCB_GetCacheConfig
-
- * arlad/poller.c: fix comments
-
-2002-06-12 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * conf/CellServDB: update msc.cornell.edu
-
-2002-06-06 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * appl/udebug/udebug.c (ProbeHost) Don't try to talk to
- 0.0.0.0. It won't answer.
-
-2002-06-06 Love <lha@stacken.kth.se>
-
- * appl/lib/fs_lib.c (getaddrinfo): don't return a negativ error
-
- * lwp/lwp_asm.c: s/int32_t/unsigned long/
-
-2002-06-05 Love <lha@stacken.kth.se>
-
- * lwp/lwp_asm.c: don't used strlcpy, we don't want a dependency on
- libroken
-
-2002-06-05 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * appl/cbdebug/{localcell,whoareyou}.c: noauth is a flag
-
-2002-06-05 Love <lha@stacken.kth.se>
-
- * arlad/cmcb.c (RXAFSCB_GetLocalCell): implement
-
- * appl/cbdebug/cbdebug.1: document localauth and update usage
-
- * appl/cbdebug: clean up, merge common code, and add localcell
-
- * rxdef/cb.xg: add GetCellServDB and GetLocalCell
-
-2002-06-04 Love <lha@stacken.kth.se>
-
- * rx/rxperf.c: if we have getrusage and there is a -G, print
- rusage stats
-
- * configure.in: add check for getrusage
-
- * rx/rxperf.c: comment out rx_window, it doesn't belong here
-
- * lwp/Makefile.in: lwp redzone
-
- * configure.in: Add hook to turn off lwp redzone
-
- * lwp/lwp_asm.c: support those OS need to have have a fd to
- /dev/zero when mapping anonymous pages (ie those that doesn't have
- MAP_ANON)
-
- * TODO: the arlad bugs are fixed and verified to no occur, remove,
- now only xfs item left
-
- * arlad/fcache.c (throw_entry): make sure there isn't waiters for
- this lock, since we don't handle that case right now
-
-2002-06-03 Love <lha@stacken.kth.se>
-
- * configure.in: add aafs and release-tools
-
- * tools/release-tools/Makefile.in: new file
-
- * tools/release-tools: make compile cleanly
-
- * tools/release-tools: add cpio-rootifier and break out common stuff
-
- * lwp/plwp.c: remove def of PRE_Block
-
-2002-06-03 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * lib/ko/afs_uuid.c (get_node_addr): check if ifdata is NULL
-
-2002-06-03 Love <lha@stacken.kth.se>
-
- * tools/release-tools/tar-rootify.c: hack to root-ify tar archives
-
- * aafs/aafs-perl: perl interface to aafs, need some more work
-
- * appl/aafs: fetch info from vldb/volserver server library, more
- coming soon
-
- * lwp/process.sparc.S: make it work for netbsd/sparc64 (really any
- sparcv9 running !solaris)
-
- * configure.in (netbsd): make for-loop into a while test $#
- .. loop so we can parse two component items (-isystem)
-
- * configure.in (netbsd): make mkinstalldirs quiet
-
- * INSTALL: add notice about source-code for *BSD and remove text
- about netbsd 1.4.2 brokenness
-
- * configure.in: remove the need to copy the foo.c in the netbsd
- buildlink thingy s/with-make/with-bsd-make/
-
- * README: clean up versions supported
-
- * INSTALL: add --with-bsd-make
-
- * configure.in: --with-make, s/dir/make/
-
- * include/netbsd-lkm: buildlink-env for netbsd lkm's
-
- * configure.in: provide infrastructure for creating a build-link env in
- include/netbsd-lkm for netbsd kernel modules
-
-2002-06-02 Love <lha@stacken.kth.se>
-
- * netbsd 1.6 should also do the nm trick
-
- * arlad/arla.conf.5: document the broken parse_units
-
- * doc/pioctl.texi: document AIOC_GETCACHEPARAMS
-
- * arlad/messages.c: implement support for AIOC_GETCACHEPARAMS
-
- * appl: try to support 64-bit cache parameters
-
- * include/kafs.h: add AIOC_GETCACHEPARAMS and its opcodes
-
- * arlad/arla.c (read_conffile): parse_units returns a int, and
- wraps over, assume that negative returns are such overwrapped
- values.
-
- * arlad/arla.c (read_conffile): use strtoll if we have it
-
- * arlad: first part of support of large cache sizes (>4G)
-
- * configure.in: check for <sys/wait.h> we need it if we link
- against external roken
-
- * lwp/rw.c: try harder to not store interger in pointer
-
- * lwp/lwp_asm.c: LWP_REDZONE depends on HAVE_MMAP, make it so
-
- * lwp: revert the PRE_Block change, it not correct either way, and
- it breaks least process.S things by having it a char
-
- * xfs/bsd/xfs_vnodeops-netbsd.c (xfs_netbsd_read): uio_resid might
- be long, cast appropriately
-
- * arlad: const poisoning
-
- * arlad/fcache.c: update users of volcache_getby{id,name} to pass
- in NULL as type when it isn't need later in the code
-
- * arlad/volcache.c (create_new_entries): use malloc
- (add_clone): remove the suffix type, its no longer used
- (*): use dynroot_fetch_root_vldbN, update uses of add_clone
- (volcache_getbyname): make it voluntary to send in type
- (get_info_loop): pass in the entry to update, not the existing one
-
- * arlad/dynroot.[ch] (dynroot_fetch_root_vldbN): rename from
- dynroot_fetch_vldbN()
-
- * arlad/arlad.c: indent
-
-2002-06-01 Love <lha@stacken.kth.se>
-
- * lwp: remove register, ident some
- make PRE_block an int since some arch .S files access it as such
- add some comment to LWP_REDZONE code and rename some
- functions/variables, also pass in more info to free (since we know it)
- constify some functions
- add test-cases for the redzone code
-
- * conf/CellServDB: remove {mr-afs,blubb}.pdc.kth.se
-
-2002-05-31 Love <lha@stacken.kth.se>
-
- * rxdef: stop include stuff we dont need
-
- * arlad/messages.c (CONNMODE_FETCH): open disco log
-
- * appl/cbdebug/whoareyou.c: include more stuff
-
- * lib/ko/afs_uuid.c: include more stuff
-
- * rx: s/MUTEX_.*\>/RX_MUTEX_\1/ to make sure we dont pollute namespace
-
-2002-05-31 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * appl/vos/vos_listaddrs.c: added -uuid and -host flags
- * appl/lib/arlalib.{c,h}: added arlalib_name_to_host
-
-2002-05-31 Love <lha@stacken.kth.se>
-
- * doc/timeline.texi: mention that the darwin codes originates from lxs
-
-2002-05-30 Love <lha@stacken.kth.se>
-
- * rxdef/vldb.xg: add some comments
-
-2002-05-30 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * rxdef/vldb.xg: added new returncodes from openafs
- * lib/ko/afs_uuid.{c,h} (afsUUID_{hash,from_string,is_nil}) const args
- * appl/vos/vos_listaddrs.c: added, implements listaddrs
- * appl/vos/vos.{8,c} appl/vos/vos_local.h: added listaddrs
-
-2002-05-28 Love <lha@stacken.kth.se>
-
- * arlad/volcache.c (update_entry): common code between
- volcache_getbyname, volcache_getbyid and volume_make_uptodate
-
- (add_clone): add entry even if suffix_type doesn't match type
- (remove_clones_from_hashtab): new func
- (remove_clone): new func
- (add_clones_to_hashtab): comment out code that in spirit is right
- (get_info_common): make it take an nvldb entry that will be used when
- checking the entry out
- (volume_make_uptodate): make it do the correct thing
-
- * lib/ko/kocell.c (updatehosts): where there is no update on the
- dbservers array, don't copy it to a new malloced area and free the
- old.
- (fetch_host): hosts returned by gethostbyname() are valid for 600s.
-
- * TODO: some things fixed, some things doesn't apply
-
- * arlad/fcache.c
- (fcache_reobtain_callbacks,fcache_giveup_all_callbacks): avoid
- talking to dead hosts
-
- * arlad/arla.conf.5: fix dynroot example
-
- * conf/arla.conf: fix dynroot example
-
- * arlad/arla.c (read_conffile): support boolan values
- (conf_params): make dynroot a boolan value
-
-2002-05-27 Love <lha@stacken.kth.se>
-
- * rxdef/vldb.xg: clean up and add opcodes
-
- * doc: rename disco-prog.texi to prog-disco.texi
-
-2002-05-27 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * appl/fs/fs.c: Spell-checked command descriptions
-
-2002-05-26 Love <lha@stacken.kth.se>
-
- * doc/disco-prog.texi: clean up
-
- * doc/prog.texi: add afsUUID
-
- * doc/arla.texi: add afsUUID
-
- * include/kafs.h (CONNMODE_CONN_WITHCALLBACKS): add
-
- * arlad/d-trans.c,disco.[ch],play_disco.c: disco stuff
-
- * arlad/messages.c (*): use disco to store log entries, remove
- log_dis stuff, introduce CONNMODE_CONN_WITHCALLBACKS, so that we
- reconnect w/o getting callback again
- (VenusFid_cmp): move to libko
-
- * arlad/fcache.c (remove_file): add support for disco
-
- * arlad/fcache.h (FCacheEntry): add disco_id
-
- * lib/ko/Makefile.in: add misc and add EXEEXT hack for gensysname
-
- * lib/ko/misc.c: misc stuff, currently VenusFid_cmp that is shared
- between aafs and arlad
-
- * doc: clean up, add docu on new stuff, split of programming stuff in to own section
-
- * doc/real-world.texi: add note about kimpersonate
-
-2002-05-25 Love <lha@stacken.kth.se>
-
- * arlad/poller.c (poller_add): make time timeout stuff work again
-
- * arlad/poller.c (poller_add): check if the cell has a special
- timeout value, in that case we might want to use it (think NAT)
-
- * lib/ko/kocell.c: add volume-type printing stuff here
-
- * lib/ko/ko.h: add volume-type printing stuff here add poller
- timeout value to cell
-
- * appl/vos: move volume-type printing stuff to libko
-
- * configure.in: de-support hack for netbsd 1.4.1
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_fetch_rights): remove
- (xfs_attr_valid): make it check the pag too
- (xfs_access_common): stop calling xfs_fetch_rights, xfs_attr_valid
- does the same things
-
- * xfs/bsd/xfs_vnodeops-netbsd.c (xfs_netbsd_strategy): use already
- figured out curproc and only update the vattr if the write/read
- succeeded
-
-2002-05-24 Love <lha@stacken.kth.se>
-
- * appl/vos/vos_listvldb.c (vos_listvldb_iter): check error value,
- init variables, and even better, free used memory. Bug found by
- <jimmy@e.kth.se>
-
- * arlad/arla.c (read_conffile): compare endptr (from strtol) with
- '\0' since that is that since of that there wasn't any bad things
- in the string. From: Fredrik Thulin <ft@it.su.se>
-
- * rxdef/vldb.xg (VLSF_NEWREPSITE): dunno what this is ???
-
- * arlad/reconnect.c (copy_cached_file): open with mode, target
- file should be opened with O_TRUNC, from Andreas Östling
- <andreaso@it.su.se>
-
-2002-05-23 Love <lha@stacken.kth.se>
-
- * util/hash.c (hashtabnewf): size of zero is valid if the hash is
- a growing hashtable, remember to store the flags in the newly
- created hashtable
- (_might_resize): remeber to copy the size too
-
- * arlad/dynroot.c (DYNROOT_ROOTVOLUME_STR): string version of
- DYNROOT_ROOTVOLUME
- (dynroot_isvolumep): use DYNROOT_ROOTVOLUME_STR
-
- * rx/rxperf.c: clean up comments and usage
-
-2002-05-22 Love <lha@stacken.kth.se>
-
- * (free_fs_server_context): only process marks if there was a
- volume entry to process marks in, matters when in disconnected
- mode and we failed to talk to the fileserver/volumeserver.
-
-2002-05-21 Love <lha@stacken.kth.se>
-
- * doc/ack.texi: update
-
- * arlad/fcache.c (fcachecmp): use VenusFid_cmp when comparing fids
-
- * arlad/cmcb.h (cmcb_reinit): new interface
-
- * arlad/cmcb.c (cmcb_reinit): new interface that get you a new
- afsUUID
- (cmcb_init): use cmcb_reinit
- (RXAFSCB_CallBack): use poller_host2cell
-
-2002-05-18 Love <lha@stacken.kth.se>
-
- * arlad/poller.c (poller): don't talk to !conn_alive hosts, assume
- they are dead
-
- * arlad/arla.conf.5: added dynroot
- * conf/arla.conf: add dynroot
-
-2002-05-17 Love <lha@stacken.kth.se>
-
- * lib/ko/ko_locl.h: added <limits.h>, needed for standards
- complient platforms :)
-
- * arlad/messages.c (viocvenuslog): print cell status
-
- * lib/ko/kocell.c: rename cell_info to cell_status, like other
- modules
- * lib/ko/ko.h: rename cell_info to cell_status, like other modules
-
- * arlad/messages.c (xfs_message_getdata): use message_get_data
- when perfetching
-
-2002-05-17 Harald Barth <haba@pdc.kth.se>
-
- * arlad/messages.c (xfs_message_getdata): Fetch offset as
- requested from the read instead of taking a random value
- and bracketing it with prefetchsize and filesize.
-
-2002-05-17 Love <lha@stacken.kth.se>
-
- * appl/lib/arlalib.c (arlalib_get_viceid_servers): make sure res
- is inited
-
- * lib/ko/kocell.c (dns_lookup_cell): init lowest_ttl to INT_MAX
- and lets catch it in the end of the function.
-
- * lib/ko/kocell.c (cell_info): print all cell info
-
- * lib/ko/ko.h: add cell_info()
-
- * doc/pioctl.texi: add types of data for
- STATISTICS_OPCODE_GETENTRY
-
- * appl/fs/fs_statistics.c (stat_types): order types
-
- * appl/fs/fs.1: getstatistics docu
-
- * appl/fs/fs_statistics.c: enable stats on fetch status, and while
- i'm here, have a table of name and value to have one place where
- they exist
-
- * arlad/fcache.c (write_attr): store stats on storestatus
-
- * include/kafs.h: add STATISTICS_REQTYPE_STORESTATUS
-
-2002-05-17 Hans Insulander <hin@stacken.kth.se>
-
- * **/*: diffrent -> different
-
-2002-05-16 Jimmy Engelbrecht <jimmy@stacken.kth.se>
-
- * appl/fs/fs_statistics.c: statisticscode does now care about writes
- * arlad/fcache.c: statisticscode does now care about writes
- * include/kafs.h: statisticscode does now care about writes
-
-2002-05-16 Love <lha@stacken.kth.se>
-
- * arlad/messages.c (message_get_data): pass in wanted_length so we
- can use the function for files that we don't want to fetch the
- whole file.
-
-2002-05-16 Hans Insulander <hin@stacken.kth.se>
-
- * **/*.[0-9]: Lots of manpage nitpicking. More to come the next
- time i'm bored...
-
-2002-05-16 Love <lha@stacken.kth.se>
-
- * xfs/bsd/xfs_node-bsd.c (free_all_xfs_nodes): FreeBSD and OpenBSD
- uses diffrent semantics, FreeBSD have does vrele and OpenBSD does
- vgone.
-
- * xfs/bsd/xfs_wrap-bsd.c: print less cryptic message when loading
- kernel module, also print out arla and xfs protocol version. From
- idea of Lex Wennmacher <wennmach@netbsd.org>
-
- * xfs/bsd/xfs_vnodeops-netbsd.c (xfs_netbsd_{read,write}): return
- EISDIR for VDIR, return EFBIG for negative offsets, update
- read/write creds
-
- * arlad/messages.c (possibly_have_network): new function, return
- non zero if there possibly is network connectivity
- (viocconnect): when going to disconnectivity mode, check for if there
- is network with possibly_have_network() before giving up callbacks
-
- * arlad/volcache.c (volcache_getby{name,id}): if the volume
- changed (stablep == FALSE), then remove all markings since they
- will not be correct now
-
- * arlad/fcache.h: remove fs_server_context.conns[].status, it
- should never have been there and its wasn't used either.
-
- * arlad/poller.[ch]: new file
-
- * arlad/Makefile.in: common_SRCS,common_OBJS += poller.[co]
-
- * arlad/arla.c (arla_init): init poller
-
- * arlad/arla_local.h: move up hash.h, add heap.h and poller.h
-
- * arlad/volcache.c (volcache_timeout): volcache entry timeout
- (recycle_entry): clear status
- (volcache_process_marks): process mark on the connection
- (volume_uptodatep): volume not uptodate of the volume is too old
- (get_info_common): set timeout time
- (get_info_loop): change signature to allow passing in a nvldbentry to
- be update instead of e->entry.
- (get_info_byid): change signature to fit get_info_loop
- (get_info_byname): change signature to fit get_info_loop, wake up any
- waiters when done.
- (volcache_getbyname): instead of passing in a VolCacheEntry, use a
- nvldbentry when comparing the entry with the data to determin if
- its stable.
- (volcache_getbyid): ditto
- (volume_downp): test if it was a volume error
- (volcache_mark_down): mark the site down appropriately
- (volcache_reliablep_el): return true if the site is a good one
- (volcache_reliable_el): set that the site is a good one
- (volcache_reliablep): rename from volcache_reliable
- (volume_make_uptodate): changed signature of get_info_byname
-
- * arlad/volcache.h (volcacheentry): add timeout and status entry,
- remove last_fetch add volume server/partion fags
- (volume_downp): new function
- (void volcache_mark_down): ditto
- (void volcache_process_marks): ditto
- (volcache_reliablep_el): ditto
- (volcache_reliable_el): ditto
- (volcache_reliablep): old volcache_reliable
- (VOLCACHE_TIMEOUT): timeout
-
- * arlad/messages.c: s/volcache_reliable/volcache_reliablep/
- (setrxkcrypt): only clear rxkad conns
-
- * arlad/fcache.c (collectstats_stop): simplify and use data that
- now in connection and volcache entry (passes in)
- (fs_probe): export
- (fcache_poller_unref): new function
- (fcache_poller_reref): new function
- (throw_entry): remove ref to poller
- (create_nodes): init entry->poll to NULL
- (invalidator): remove ref to poller
- (fs_rtt_cmp): new function, compare to pointers to two fs_server_entry.
- (find_partition): find partition of the context that we used
- (find_next_fs): rework, now an error is passed in and the old
- entry/site is marked dead if there was such an error, if there was
- no error with last volume, mark it good. Modify to changes of the
- fs_server_context.
- (free_fs_server_context): Modify to changes of the fs_server_context,
- also call volcache_process_marks().
- (find_first_fs): insert a middle case, between the server is bad
- (INT_MAX) and the server it up (smoth rtt) there is volume bad
- (INT_MAX / 2). Modify to changes of the fs_server_context.
- (stale): remove ref to poller
- (update_entry): pass in a conn instead of a ip-address, it is to make
- it eaiser to find the real identity of the server we talked to.
- ref the poller if we have connection, and unref the poller in
- there was none (disconnected)
- (update_attr_entry): pass in a conn instead of a ip-address.
- (resolve_mp): fetch the whole symlink
- (*): deal with that update_entry, update_attr_entry, find_next_fs
- use conn_ref the make it possible to send conn's around.
-
- * arlad/fcache.h (FCacheEntry): add poller pointer
- (fs_server_context): add status and entry number for a conns[N]
- (fs_probe): export function
-
- * arlad/conn.[ch] (conn_ref): new function
-
- * arlad/dump_state.c (prefix): use ARLACACHEDIR
- (print_fcache_entry): print the cache node index
-
-2002-05-12 Love <lha@stacken.kth.se>
-
- * arlad/cmcb.c: update (c)
-
- * appl/mpp/mpp.c (main): use growing hashtable
-
- * util/hash.[ch]: growing hashtable support, api compatible
-
- * util/arlamath.[ch],Makefile.in,util-tester.c: prime-number testing
- functions, by mattiasa@e.kth.se, testing by me
-
- * arlad/fcache.c (new_fetched_length): common code that caculates
- the new fetched length
- (*): use new_fetched_length
-
-2002-05-10 Love <lha@stacken.kth.se>
-
- * rx/rx_rdwr.c: turn a #ifndef to a #ifdef (like on the other
- places ADAPT_WINDOW is used) make the code somewhat easier to
- follow
-
- * lib/ko/koerror.c: move #includes to avoid `MAXKTCTICKETLEN'
- redefined problem
-
-2002-05-07 Love <lha@stacken.kth.se>
-
- * appl/mpp/mpp.c (macro_define): make it handle value == NULL
- (process_define): when there is no value, pass in NULL
-
- * tests/*: make !-fast test less verbose when running in -fast mode
-
- * lib/cmd/Makefile.in: use DESTDIR when installing man page
-
- * arlad/fcache.c (trucate_file): mirror code from write_data, now
- files don't get full of NULL when using program that ftruncate()
- files before they close() them (like rcs and install)
-
- * doc/themis.texi: add common things to exclude and default
- exclude items
-
- * arlad/fcache.c: (write_data): If the hole file is fetched as we
- last saw it, lets write down the whole file to the fileserver. If
- the file is shrinking, make sure we don't cache non-existing
- bytes.
-
- This fixes problems with previous commit that I should have
- noticed
-
- * tests/part-files: make test smaller/faster, add some comments
-
- * tests/run-tests.in (ARLA_TESTS): add part-files
-
- * tests/part-files: test if files are written/read correctly when
- they are partly modified
-
- * arlad/fcache.c (write_data): only write the content of the file
- we have fetched
-
-2002-05-06 Love <lha@stacken.kth.se>
-
- * arlad/arla.c (conf_params): trim it to make newer gcc happy
-
- * xfs/linux/xfs_inodeops.c (xfs_release_file): only look at the
- I_DIRTY_DATASYNC|I_DIRTY_PAGES flags, not at all flags I_DIRTY
- since that is also set for meta data changes (atime modifcation)
-
- * util/util-tester.c (test_hash): hashtab's are freed by
- hashtabrelease()
-
- * appl/mpp/mpp.c: add macro undefine (-U and %undef)
-
- * arlad/arla.conf.5, conf/arla.conf: document sysname
-
- * arlad/fcache.[ch],adir.c: We need to keep track of how much of
- file is cached so when the truncate is done we wont use and NUL
- after the cache file
-
- XXX optimization: if we have the whole file and we are truncating
- to a larger will, we already have the data, so we should update
- fetched_length to the new size.
-
-2002-05-05 Love <lha@stacken.kth.se>
-
- * configure.in (AC_OUTPUT): added appl/mpp/Makefile
-
- * appl/Makefile.in (SUBDIRS): add mpp
-
- * appl/mpp/mpp.1: manpage
-
- * appl/mpp/mpp.c: add command line parsing, fix space (' ')
- problems
-
-2002-04-30 Love <lha@stacken.kth.se>
-
- * appl/mpp: add a almost compatible mpp processor, memory hungry
- and with a bad attitude toward space
-
- * arlad/fcache.c (collectstats_getentry): replace some 32 that
- really was HISTOGRAM_SLOTS
-
- * arlad/messages.c (aioc_statistics): use constants, rewrite if
- ().. to switch()
-
-2002-04-29 Love <lha@stacken.kth.se>
-
- * arlad/arla.c (read_conffile): enable parser to parse strings too
- (*): keep up with above change
- init varibles
-
- * arlad/arla-cli.c: renamed the holder of the sysname passed in
- vid the argv (and getarg()) to argv_sysname, arla_init changed
- signature
-
- * arlad/arlad.c: renamed the holder of the sysname passed in vid
- the argv (and getarg()) to argv_sysname, arla_init changed
- signature
-
- * arlad/arla_local.h: arla_init changed signature, renamed the
- holder of the sysname passed in vid the argv (and getarg()) to
- argv_sysname
-
- * arlad/messages.c (vioc_afs_sysname): rename the variable that
- hold the temporary sysname
-
- * arlad/fcache.c (fprioritylevel): set default level here
-
- * appl/vos/vos_examine.c (print_extended_stats): when in extented
- mode, print out filecount too
- (print_volume): change where \n are added
-
- * doc/pioctl.texi: arla pioctl
-
- * configure.in: AM_CONDITIONAL's that roken will check (and
- disable if necessary) before roken fragment
-
- * configure.in: reverse the libtool vs automake stuff
-
- * HACKING: depend on libtool too
-
- * appl/cbdebug/Makefile.in: sl depend on readline
-
- * configure.in: move down the kerberos tests to after we check for
- libroken
-
- * cf/check-roken.m4: when using an external roken, use -L$dir
- -lroken, its not sure that there exists a .a file
-
- * cf/check-kerberos.m4: check for system kerberos 5 headers first,
- this mirrors the pattern of searching for a lib
-
-2002-04-29 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * xfs/bsd/xfs_vnodeops-osf.c: (1.23.2.4 -> 1.23.2.5) (xfs_fsync) do
- ubc_flush_dirty even if !(fflags & FSYNC)
- * xfs/bsd/xfs_vnodeops-osf.c: (xfs_fsync): Flush dirty ubc buffers
-
-2002-04-29 Love <lha@stacken.kth.se>
-
- * ydr/output.c (encode_varray): varray's w/o limit is of size 0,
- not -1
-
- * arlad/messages.c: sprinkel some all_powerful_p()
-
-2002-04-28 Love <lha@stacken.kth.se>
-
- * rx/{rx_dumptrace.c,rx_trace.[ch]}: these are covered by IBM (c)
-
- * rx/Makefile.in: remove hack to build rx_trace
-
- * rx/rx_trace.h: add stuff that is shared between rx_trace.c and
- rx_dumptrace.c
-
- * rx/rx_trace.c: remove stuff that is shared with rx_dumptrace.c
-
- * rx/rx_dumptrace.c: debug program part of rx_trace.c
-
- * rx/rx_knet.c: remove, not part of arla rx but rather openafs rx
-
- * rx/rx_user.c (rxi_GetUDPSocket,rxi_Listener): keep track of all
- sockets we open rxi_Listener can only probe those sockets that are
- are rx's instead of iterating over all sockets 0 ->
- rx_maxSocketNumber. This matters for win32 enviroment where
- sockets typically are large numbers.
-
- (rxi_Listener): always use IOMGR_Select instead of doing select in
- case we are doing a poll since that is was IOMGR select will do
- for us if we send in a "poll-timeval" (sec = usec = 0). This fixes
- the problem found by Tomas Olsson that select() (the system
- version) might have a diffrent calling convention then
- IOMGR_Select(), lets say PASCAL. Casting system() and
- IOMGR_Select() to the same function pointer will have have fatal
- problems.
-
- Also when here, clean up the code some (like use NULL, etc)
-
-2002-04-27 Love <lha@stacken.kth.se>
-
- * TODO: some fixes, some more comments
-
- * HACKING: update what version you need
-
- * xfs/bsd/**[ch]: split xfs_node->cred into rd_cred and wr_cred
- and use appropriately
-
- * acconfig.h: remove, now autoconf/autoheader does this
-
- * configure.in: pacify autoconf 2.53
-
- use AC_HAVE_TYPES instead of AC_GROK_TYPES
-
- do libtool vs automake stuff
-
- * cf/kernel*: use patsubst
-
- * __extentions__.m4: __EXTENSIONS__ hack
-
- * cf/misc.m4: fool autoconf 2.53 by using \x40 instead of \100
-
- * xfs/bsd/bin/mount_xfs.c: start use setprogname()
-
- * arlad/messages.c: cred_list_pag changed signature
-
- * arlad/cred.h: cred_list_pag changed signature
-
- * arlad/cred.c: make the cred list be on the pair `cred,type' to
- make diffrence between CRED_KRB4 and CRED_NONE.
-
- (cred_free): ignore CRED_ROOT_CELL entries, they will be g/c when the
- last referrer releases it.
-
- also make code more consistent.
-
-2002-04-26 Love <lha@stacken.kth.se>
-
- * include/kafs.h: allocate AIOC_PTSNAMETOID
-
- * rxdef/ka.xg: protect MAXKTCTICKETLEN
-
-2002-04-26 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * configure.in: Added -traditional-cpp to CPPFLAGS on Darwin
-
- * Makefile.in: Added CPPFLAGS to ydr's CPP variable
-
-2002-04-26 Love <lha@stacken.kth.se>
-
- * ydr/output.c (generate_hdr_enum): print out the enum too
- * lib/roken/roken.h: now generated
-
- * ydr/output.c: fix some more don't iterate on empty lists
-
- * ydr/output.c: structs w/o members are 0 sized.
-
- * appl/cbdebug/cbdebug.1: new manpage
-
- * **/*.c: use setprogname() and getprogname()
-
- * configure.in: check for <glob.h> and <vis.h> and so
- AM_CONDITIONAL stuff
-
- * cf/check-kerberos.m4: always run AM_CONDITIONAL(KRB{4,5})
-
- * xfs/linux/xfs_dev.c: indent
-
-2002-04-25 Love <lha@stacken.kth.se>
-
- * appl/cbdebug/cbdebug.h,Makefile.in: added real parsing and broke
- out whoareyou code.
-
- * appl/cbdebug/Makefile: some fixes
-
- * appl/cbdebug/whoareyou.c: some fixes
-
- * arlad/cmcb.c: some fixes,
- (init_address): don't fail if there isn't any address
-
- * appl/cbdebug/cbdebug.c: move out all useful things, add sl
- command parsing
-
- * appl/cbdebug/whoareyou.c (print_addr): move here
- (whoareyou): add agetarg command parsing
-
- * arlad/cmcb.c (init_address): break out the initialization
- interfaceAddr
- (RXAFSCB_InitCallBackState2): use init_address()
- (RXAFSCB_WhoAreYou): use init_address()
-
-2002-04-24 Love <lha@stacken.kth.se>
-
- * NEWS: added UUID
-
- * appl/Makefile.in (SUBDIRS): add cbdebug
-
- * include/Makefile.in: add ifaddrs.h and rtbl.h
-
- * configure.in: check for <ifaddrs.h> and provide automake glue
- add appl/cbdebug
-
- * lib/ko/afs_uuid.[ch]: const poison compare functions
-
- * arlad/arla_local.h: added <ifaddrs.h>
-
- * arlad/cmcb.c: implement RXAFSCB_ProbeUUID, RXAFSCB_WhoAreYou,
- RXAFSCB_InitCallBackState2, and, RXAFSCB_InitCallBackState3
-
- InitCallBackState{2,3} functions are implemented by simply calling
- the common part of InitCallBackState
-
- Move the InitCallBackState functions next to each other.
-
- XXX Need to fix the mtu detection and netmask-less ifa's
- * appl/cbdebug/cbdebug.c: add <afs_uuid.h>
-
- * appl/cbdebug: a simple callback manager debug program
-
- * include/Makefile.in: added afs_uuid.h
-
- * arlad/arla_local.h: "afs_uuid.h"
-
- * lib/ko/Makefile.in: LIB_{SOURCES,OBJECTS} += afs_uuid.[ch]
-
- * lib/ko/afs_uuid.c: fix comment about MS GUID
-
- * lib/ko/afs_uuid.c: protect the headers <net/if.h>,
- <net/if_dl.h>, and <net/if_types.h>
-
- * configure.in: check after <net/if.h>, <net/if_dl.h>, and
- <net/if_types.h>
-
- * lib/ko/Makefile.in: sort LIB_OBJECTS and LIB_SOURCES
-
- * have-struct-field.m4: fix another autoconf 2.52 fallout
-
- * cf/have-linux-kernel-types.m4: make it work with autoconf 2.52
-
- * cf/have-linux-kernel-type.m4: make it work with autoconf 2.52's
- AC_MSG_RESULT
-
- * HACKING: update what version you need, enable users to pass in
- ACLOCAL_EXTRA_ARGS as enviroment variable
-
-2002-04-23 Love <lha@stacken.kth.se>
-
- * **/Makefile.in: use libtool
-
- * arlad/arla-cli.c,arlad.c,dump_state.c: use <version.h> again
-
- * configure.in, acconfig.h, missing:
- update to 2.52, use libtool and update to
-
- * appl/afsmgr/Makefile.in: remove udebug, its not built here
-
- * lib/roken/*: merge heimdal 2002-04-23 code
-
- * cf/*: merge heimdal 2002-04-22 code
-
-2002-04-23 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * appl/mac/arlacmm/permwin.c:
- Add beep when apply fails. Make Apply button inactive when not needed
-
- * appl/mac/arlacmm/arlacmm.h: Added aclcopy to ArlaCMMType
-
- * appl/mac/arlacmm/dialog.nib/objects.xib,
- appl/mac/arlacmm/dialog.nib/info.nib: adduser: make ok button
- default
-
- * appl/mac/arlacmm/permwin.c (addAclItem): added duplicate check
-
- * appl/mac/arlacmm/arlacmm.h: Added cfstring_to_utf8 and verifyname
-
- * appl/mac/arlacmm/util.c: Added cfstring_to_utf8
-
- * appl/mac/arlacmm/adduserwin.c, appl/mac/arlacmm/permwin.c,
- appl/mac/arlacmm/arlacmm.h: Add user
-
- * appl/mac/arlacmm/permwin.c: Added remove command
-
-2002-04-23 Love <lha@stacken.kth.se>
-
- * arlad/{fcache,messages}.c,arla_local.h:
- hack to disable kernelp asserts, the bug/feature of xfs should
- really be fixed but I don't have a clue to how to fix it now
-
-2002-04-23 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * appl/mac/arlacmm/main.c, appl/mac/arlacmm/arlacmm.h,
- appl/mac/arlacmm/pioctl.c: Only show permissions in the contextual
- menu if it is a directory
-
- * appl/mac/arlacmm/dialog.nib/objects.xib,
- appl/mac/arlacmm/dialog.nib/info.nib, appl/mac/arlacmm/pioctl.c,
- appl/mac/arlacmm/main.c, appl/mac/arlacmm/permwin.c,
- appl/mac/arlacmm/arlacmm.h, appl/mac/arlacmm/infowin.c,
- appl/mac/arlacmm/Makefile.in, appl/mac/arlacmm/adduserwin.c: Added
- info window and fix CFRelease bug
-
- * appl/mac/arlacmm/permwin.c: Added an event handler for window
- closing
-
- * appl/mac/arlacmm/permwin.c (applyAcl): Added
-
- * appl/mac/arlacmm/pioctl.c: Added setacl
-
- * appl/mac/arlacmm/arlacmm.h: Added path and setacl
-
- * appl/mac/arlacmm/Makefile.in: Use install instead of tar
-
- * appl/mac/arlacmm/permwin.c (changeAclItem): added
-
- * appl/mac/arlacmm/adduserwin.c (fillAddUserGroupsList): group
- array is immutable
-
- * appl/mac/arlacmm/arlacmm.h: acl and group arrays are mutable
-
-2002-04-21 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * fs_getprio.c (getprio_cmd): correct arg usage
-
- * fs.c (setprio_cmd): correct arg usage
- (getmaxprio_cmd): correct arg usage
-
- * conn.c (pinger): ignore hosts in disconnected mode
-
- * fcache.c (fcache_reobtain_callbacks): use cred
- (fcache_get): check if volume is cached before creating entry
- (fcache_verify_attr): get all rights when disconnected
-
- * fcache.h: fcache_reobtain_callbacks takes cred
-
- * messages.c:
- Always set XFS_ATTR_R in fcacheentry before installing attr
- (viocconnect): call fcache_reobtain_callbacks with creds
-
- * volcache.c (get_info_common): don't return -1
- (volcache_getbyname): return ENETDOWN if disconnected and volume
- isn't cached
-
-2002-04-21 Love <lha@stacken.kth.se>
-
- * xfs/bsd/xfs_syscalls-common.c: do the XFS_NOT_LKM right for
- xfs_setgroups
-
- * xfs/bsd/xfs_syscalls-common.c: XFS_NOT_LKM: symbol that tells us
- that we are no an lkm/kld/...
-
- * xfs/bsd/xfs_wrap-bsd.c (freebsd): name the module arlaxfsdev
- instead of xfsdev
-
- * xfs/bsd/xfs_wrap-bsd.c: freebsd don't support LKM, remove ifdef
-
- * xfs/bsd/xfs_vfsops-freebsd.c (xfs_vget_freebsd): provide now
- that freebsd have 4 argument (extra argument, locking flags), and
- use it.
-
- * cf/check-kernel.m4: use to nm trick for freebsd5 too
-
- * xfs/bsd/xfs_syscalls-common.c: Create a xfs_crcopy that works
- around the problem that around freebsd version 500026, crcopy
- changed semantics.
-
- * xfs/bsd/xfs_common-bsd.c (xfs_suser): freebsd current have
- changed from struct proc * to struct thread * as argument to
- suser() in current
-
- * xfs/bsd/xfs/xfs_locl.h: move those things that depend on
- HAVE_FREEBSD_THREAD to after we define it
-
- * lib/ko/afs_uuid.c (afsUUID_from_string): implement
-
-2002-04-20 Love <lha@stacken.kth.se>
-
- * lib/ko/afs_uuid.[ch]: ncs/dce/afs/guid generator
-
- * arlad/messages.c (gettok_func): new healper function to
- viocgettok()
- (viocgettok): use the new cred api to iterate over the creds
- this brings the cpu usage of arla down from 50-60% to 4% on my
- laptop (with 5 tokens) when doing:
-
- while :; do tokens >/dev/null ; done
-
- * arlad/cred.c: All creds in the same pag (xfs_cred_t) are now
- stored on a linked list to make it possible to iterate over all
- creds in the same pag fast.
-
- The head is inserted in the hash, use the magic cellid == -1 to
- mark a head.
-
- (list_pag_func): helper function, iterate over all creds in same pag
- (cred_list_pag): iterator function that lets user iterate over all
- cred in same pag
- (recycle_entry): if not root entry, remove it from the list
- (cred_free): assert its not a root entry
- (root_free): remove the entry from the pag-list and if the list is
- empty, free the root-head.
- (add_to_root_entry): add the entry to the root head, create the
- root head if it doesn't exist.
-
-
- * arlad/cred.h (CredCacheEntry): add the pag union
- (cred_list_pag): new function
-
- * util/list.c: implement listfree()
-
- * util/list.h: add listfree()
-
- * appl/kalog/kalog.c appl/lib/appl_locl.h appl/lib/ka-procs.c
- arlad/arla_local.h arlad/cred.h lib/ko/koerror.c
- milko/appl/perf/perf.c milko/bos/bos_locl.h milko/fs/fsrv_locl.h
- milko/lib/msecurity/msecurity.c milko/lib/msecurity/netinit.c
- milko/pts/pr.c milko/pts/ptserver.c milko/vldb/vldb_locl.h
- rxkad/rxkad_locl.h: if using openssl, include <openssl/des.h>
- instead of <des.h>, work for everything using openssl except Mac
- OS X, oh joy
-
-2002-04-18 Love <lha@stacken.kth.se>
-
- * appl/fs/fs_statistics.c (getstatistics_cmd): host is not a type
-
-2002-04-17 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c (stale): only so throw_data if there is data
- (flags->datap)
-
- * arlad/fcache.c (stale): if its a directory, lets throw the data
- directly, this mirrors the behavior in the kernel
-
- * arlad/messages.c: change signature of getvolstat
-
- * arlad/fcache.c: change signature of getvolstat, now pass length
- of data, this make sure we know the length of the target string
- and can use it (and not the size of the pointer)
-
- * arlad/fcache.h: change signature of getvolstat
-
- * rxdef/cb.xg: %#include <fs.h>
- * rxdef/vldb.xg: %#include <fs.h>
-
- * rxdef/common.h: remove the definition of struct afsUUID and
- instead include "afsuuid.h"
-
- * rxdef/Makefile.in: make vldb and cb files depend on fs.h
-
- * rxdef/fs.xg: define AFSUUID_GENERATE
-
-2002-04-16 Love <lha@stacken.kth.se>
-
- * rxdef/afsuuid.h: struct afsUUID;
-
- * arlad/dynroot.c: remove the local variable dynrootcell and start
- to use DYNROOT_CELLID
-
- * lib/ko/ko.h: export DYNROOT_CELLID
-
- * lib/ko/kocell.c (update_cell): dynroot cell is uptodate, this
- stops zillions of dns lookups
-
- * appl/vos/vos_listvldb.c: be compatible with transarc/openafs,
- its not ... Site %s, but %s Site
-
-2002-04-15 Love <lha@stacken.kth.se>
-
- * ydr/output.c: do bounce checking of TVARRAY types
- s/bcopy/memcpy/
-
- * rx/rx.c (rx_NewConnection): if RXS_NewConnection fails, set its
- error to conn->error, not really right, but then the interface
- isn't that good
- (rx_NewService): when creating a new service call RXS_NewService()
-
- * rx/rx.h: define RXS_NewService and use appropriate element in
- rx_securityClass
-
- * Checking in lex.l, parse.y, sym.h, symbol.c, types.c, types.h:
- add support for __attribute__ on structs, specifically __nogenerate__
-
- * ydr/output.c: generate the max-size for definitions for limited
- dynamic types too
-
-2002-04-12 Love <lha@stacken.kth.se>
-
- * appl/fs/fs.c (cmds): give "sp" to setserverprefs since
- setpriority isn't used (and never has been used), compat with
- openafs/transarc afs, ident
-
- * tests/blocks-new-file.c: make the file smaller (64K instead of
- 1M), this makes the test fly by when running on a slow link
-
- * arlad/{messages.c,fcache.c,inter.c}:
-
- Change fcache_verify_data() to fcache_get_data() on users that
- will use the data later, now all callers don't need to first
- fcache_verify_attr() and then get ->wanted_length since
- fcache_get_data() will do that for them.
-
- Due to the signature diffrence of fcache_verify_data() and
- fcache_get_data() there is some prototype changes on other
- functions to deal with this.
-
- * arlad/messages.c (read_mount_point): update wanted_length so we
- don't fall over when doing a fs lsm on a (data) uncached entry
-
-2002-04-10 Johan Danielsson <joda@pdc.kth.se>
-
- * conf/arla.conf: spelling
-
- * appl/fs/fs.c: add some more command aliases
-
-2002-04-10 Love <lha@stacken.kth.se>
-
- * arlad/*.[ch]: multi-sysname implementation
-
- * arlad/.gdbinit: print out the thread index too in lwp_ps
-
- * arlad/messages.c (xfs_message_inactivenode): comment out the
- kernelp assert for now
-
- * xfs/linux/xfs_inodeops.c (xfs_mightwrite_p): new function that
- checks if a vma will write to disk
- (*): use xfs_mightwrite_p
-
-2002-04-09 Love <lha@stacken.kth.se>
-
- * scripts/mingwin.sh: bootstrap arla with mingw
-
-2002-04-08 Love <lha@stacken.kth.se>
-
- * xfs/include/xfs/xfs_messages.h,xfs/bsd/xfs_messages.c,
- xfs/bsd/xfs_vnodeops-netbsd.c: use temporary flag XFS_VMOPEN when
- the node is locked so installdata/attr wont touch the vnode,
- should stop useing genfs instead
-
- * arlad/arlad.c: update copyright
-
- * xfs/bsd/Makefile.in: generate function prototypes for the VOPS
-
- * xfs/bsd/xfs_node-bsd.c: init genfs node for netbsd
-
- * xfs/bsd/xfs_vfsops-netbsd.c: init the vnodeopv_desc depending on
- if we are using ubc or not, (xfs_mount_netbsd): init mnt_*_bshift
- for genfs
-
- * xfs/bsd/xfs_vnodeops-bsd.c: make all xfs vops global
- (xfs_pushdirty): make to work for netbsd UBC
-
- * xfs/bsd/xfs_vnodeops-common.c: (xfs_open_common): make it always
- store the cred, it will be needed
- (xfs_close_common): push dirty block in case of a VREG
- (xfs_uio_end_length): rename uio_end_length from export and optimize
- (*): use changed signature of xfs_uio_end_length
-
- * xfs/bsd/xfs/xfs_locl.h: move xfs_pushdirty() to later, include
- genfs stuff for netbsd ubc code, netbsd have removed UVM define,
- provide a macro for XFS_VOP_DEF that creates a prototype for all VOPs
-
- * xfs/bsd/xfs_vnodeops-netbsd.c: netbsd UBC code
-
- * xfs/bsd/xfs/xfs_node.h: include genfs for netbsd ubc
- * xfs/bsd/xfs/xfs_vnodeops.h: add prototype for xfs_uio_end_length
-
-2002-04-02 Love <lha@stacken.kth.se>
-
- * appl/amon/Makefile.in: set LDFLAGS to @LDFLAGS@ so we use it
-
- * xfs/linux/xfs_inodeops.c: change all occasions of VM_MAYWRITE to
- VM_WRITE since linux maps binaries on i383 with
- VM_MAPWRITE. VM_MAY flags are "maximum rights" for mprotect as I
- understands it.
-
-2002-03-22 Love <lha@stacken.kth.se>
-
- * configure.in: openbsd might need CPPFLAGS too for kernel flags
- test in the future, give to them
-
-2002-03-19 Tomas Olsson <tol@stacken.kth.se>
-
- * xfs/winnt/bin/wakeup.c: added
- * xfs/winnt/bin/makefile: add wakeup, clean a bit
- * xfs/winnt/bin/xfs-helper.c: make it work
- * xfs/winnt/{inc,src}/*: read (sort of)
- * lib/bufdir/fdir.c (first_slotp): add & use
- * lib/bufdir/afs_dir.h: added AFSDIR_FIRST
-
-2002-03-14 Love <lha@stacken.kth.se>
-
- * xfs/bsd/xfs_vnodeops-common.c (xfs_fsync_common): replace
- ubc_pushdirty() with xfs_pushdirty()
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_pushdirty): flush dirty blocks
- to disk
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_putpages): netbsd-ubc case, only
- mark VREG files dirty if they are
-
-2002-03-12 Love <lha@stacken.kth.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_putpages): only mark node as
- dirty if there are dirty pages in the cache node in the
- netbsd-current case.
-
- XXX needs to be fixed a better way
-
- * tests/asu.c: If the test is ran w/o pag, we can't switch user
- since that will mean we will loose credentials.
-
-2002-03-11 Love <lha@stacken.kth.se>
-
- * xfs/bsd/xfs_vnodeops-bsd.c (xfs_putpages): When a directory node
- is reclaimed because of a xfs_message_invalidnode, vinvalbuf is
- called which triggers a VOP_PUTPAGES, but then there is no data
- the underlaing VOP_PUTPAGES can't be called.
-
- So, if you want to avoid getting (bogus) tar errors (when run as
- root) with creds, you better run in a pag.
-
-2002-03-08 Love <lha@stacken.kth.se>
-
- * arlad/arla-cli.c: output formating error, from kolya@mit.edu
- * appl/fs/fs_diskfree.c: formating errors, from kolya@mit.edu
-
-2002-03-07 Love <lha@stacken.kth.se>
-
- * arlad/fcache.c: Make (cm_f)truncate(_file) take a storestatus
- argument to avoid a race with changing permissions, modify the
- filesize after the rpc completes with nonerror. Bug noticed by
- kolya@mit.edu.
- * arlad/fcache.h: Ditto
- * arlad/inter.c: Ditto
- * arlad/inter.h: Ditto
- * arlad/messages.c: Ditto
- * arlad/reconnect.c: Ditto
-
-2002-03-06 Tomas Olsson <tol@stacken.kth.se>
-
- * arlad/messages.c (xfs_message_create): use fcache_conv_file_name
- * arlad/inter.c (cm_open): use fcache_conv_file_name
- * arlad/arla-cli.c (print_dir{,long}): return int
- * arlad/fcache.c (fcache_conv_file_name): added
- (fcache_fh{open,get}): adjust for cygwin
- (bulkstat_help_func): return int
-
- * arlad/fcache.h: added fcache_conv_file_name()
- * arlad/adir.h (adir_readdir): use new fdir_readdir_func
- * arlad/adir.c (adir_readdir): call fdir_readdir the new way
- * arlad/kernel.c (tcp_open): use the right address, return socket
- (tcp_write): error checking
-
- * arlad/unknown-subr.c: adjust for cygwin/nt
- * include/Makefile.in: added fids.h
- * lib/ko/kocell.c (fetch_host,dns_lookup_cell): don't get RR if we
- don't know how
- * lib/bufdir/fbuf.h: ifdef for kernel
- * lib/bufdir/fdir.h (fdir_readdir_func): return int (time to stop?)
- (fdir_readdir): accept offset
-
- * lib/bufdir/fdir.c (fdir_readdir): accept & maintain offset make
- kernel safe
- * arla/lib/bufdir/fids.h added, contains AFSfid & VenusFid
-
-2002-03-04 Jimmy Engelbrecht <jimmy@heliga-birgitta.stacken.kth.se>
-
- * arlad/messages.c, include/kafs.h, appl/lib/fs_lib.c:
- Merged in VIOC to AIOC interface change for [VA]IOC_STATISTICS from
- 0.35-branch
-
-2002-03-04 Mattias Amnefelt <mattiasa@heliga-birgitta.stacken.kth.se>
-
- * arla_local.h: rx/rxgencon.h is included in rx.h
-
-2002-03-04 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * xfs/linux/xfs/xfs_locl.h: made xfs_dcount() arg const
- * arlad/arla_local.h: rx/rxgencon.h is included in rx.h
-
-2002-03-02 Love <lha@stacken.kth.se>
-
- * ydr/lex.l: handle afs_int32 and afs_uint32
-
-2002-02-27 Love <lha@stacken.kth.se>
-
- * conf/CellServDB: add dementia.org and grand.central.org
-
- * util/mmaptime{,_test}.c: make it work when there is not working mmap
-
- * rx/Makefile.in: don't link rxdebug or rx_trace with libcmd since
- it doesn't use it
-
- * configure.in: check for winsock.h, add case for mingw
-
- * appl/lib/arlalib.c: (key_to_key): remove unused function,
- (arlalib_get_cred_krb): kill some const warnings by coping the
- string
-
- * lib/cmd/Makefile.in: don't install testc_1_MAN
-
-2002-02-25 Love <lha@stacken.kth.se>
-
- * Release 0.35.7, see the branch for relevant patches
-
- * scripts/run-tests.sh: release testing
- * scripts/extract-result.sh: extract test info from run-tests
- * scripts/build-arla.sh: release build test script
-
-2002-02-24 Love <lha@stacken.kth.se>
-
- * tests/fhbench.c: 1.6->1.6.2.1: include timevalsub and rename it
- to tvsub
-
- * xfs/linux/xfs_{common,message}.c: (print_aliases): print out if
- the name is on (name)hash or not
- (users of ->d_count): use helper function xfs_dcount
-
-2002-02-24 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * tools/gnats/Makefile.in: install into DESTDIR
-
-2002-02-18 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * doc/themis.texi: Document the M directive and the P flag.
-
-2002-02-08 Love <lha@stacken.kth.se>
-
- * xfs/linux/xfs_inodeops.c (xfs_file_mmap): pass in the xfs-inode
- to data_valid instead of the cache-node
-
-2002-02-07 Love <lha@stacken.kth.se>
-
- * All files:
-
- s/u_int17_t/uint17_t/
- s/libutil.a/libarlautil.a/
- remove things from arla's libroken that doesn't belong there
- (that is, it doesn't exists in other-libroken), and move
- then to arlautil
- make compile on netbsd-current (CPPFLAGS i needed, more <sys/time.h>)
- remove things that isn't needed in <xfs/xfs_message.h>
- to operating system depended headers/arlad headers
- this is to make it easier to use code in kernel
-
- * configure.in: how the roken thingy work now, you have
- to specify --with-roken if there you are going to link agaist a
- roken in the kerberos test. This is due to that we now link agaist
- the .a lib directly.
-
-2002-02-06 Love <lha@stacken.kth.se>
-
- * xfs/bsd/xfs_syscalls-common.c (remote_pioctl): not that it is
- used, set the message size in the message header to unconfuse
- readers
-
- * xfs/linux/xfs_dev.c (free_node): create yet another free
- function, this one does consistency checks and replaces
- xfs_free(xn, XFS_MEM_XNODE)
- (xfs_queue_inactive): if the channel is closed, just free the node
- (xfs_process_inactive_queue): use free_node()
- (xfs_empty_inactive_queue): use free_node()
-
- * xfs/linux/xfs_syscalls.c (xfs_fh_to_dentry): linux-2.4: after a
- get_super, we need to drop_super(), w/o this, the we will fail to
- unmount the super block of the cache-filesystem.
-
-2002-02-04 Love <lha@stacken.kth.se>
-
- * ydr/*.[chly]: rename Tfoo symbols to YDR_Tfoo to avoid clashes
- with toolchains with TCHAR
-
-2002-02-01 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * appl/mac/Arla_Configuration/ReadCells.m: Added static on local
- functions
- * appl/mac/Arla_Configuration/Makefile.in: Use install instead of
- tar
- * appl/mac/Arla_Configuration/DataSource.m: Added static on local
- functions
- (checkdaemonpid): give -p to ps
-
-2002-02-01 Love <lha@stacken.kth.se>
-
- * cf/check-roken.m4: 1.1->1.1.2.1: Reference libroken directly
- instead of with -l
-
- * lwp/Makefile.in: 1.58->1.58.2.1: Remove superfluous -lroken
-
- * xfs/linux: dual license xfs for linux under bsd/gpl, update
- copyright years. See xfs/linux/license for more detailed
- information.
-
- * conf/CellServDB (theory.cornell.edu): removed, from Ruth
- Mitchell <mitchell@tc.cornell.edu> on info-afs@transarc.com
-
- * xfs/linux/xfs_dev.c (xfs_process_inactive_queue): make sure we
- don't add node twice if we race with someone to
- xfs_queue_inactive()
-
- * xfs/linux/xfs_message.c: minimize diff to 0.35-branch
-
-2002-01-31 Love <lha@stacken.kth.se>
-
- * arlad/arlad.c (arla_start): after chroot(), do a chdir("/")
-
- * cf/linux-func-init-mutex.m4: make test work when init_MUTEX is a
- macro (late linux-2.2)
-
-2002-01-27 Love <lha@stacken.kth.se>
-
- * scripts/arla-release.sh: spelling
-
-2002-01-26 Love <lha@stacken.kth.se>
-
- * conf/CellServDB: added su.se
-
- * tests/run-tests.in: add new option -fail that make test-run stop
- after the first failure
-
- * xfs/linux/xfs_inodeops.c: (xfs_d_delete): use
- xfs_queue_inactive() again since it correct
-
- * xfs/linux/xfs_message.c (xfs_invalid_xnode): use
- xfs_queue_inactive() again since it correct
-
- * xfs/linux/xfs_dev.c (xfs_queue_inactive): make sure we don't
- enter an node twice on the inactive_list
- (xfs_process_inactive_queue): use list_del_init so the inactive_list
- have known state
- (xfs_empty_inactive_queue): don't free nodes that have shouldn't
- be freed
-
- * xfs/linux/xfs_vfsops.c (print_nodes): use new node_list list
- macro and protect
- (xfs_read_super): init the node_list and node_sem fields
-
- * xfs/linux/xfs_node.c (xfs_iget): move the null address space ops
- here, and update the code
- (xfs_iget): use new node_list list macro and protect
- (free_xfs_node): ditto
- (free_all_xfs_nodes): ditto
- (xfs_node_find): ditto
-
- * xfs/linux/xfs_message.c (xfs_invalid_xnode): use
- xfs_message_send to notify userland that node is inactive,
- xfs_queue_inactive() have unwanted side-effects
- (xfs_message_gc_nodes): remove the case where we gc all nodes. its not
- used for arlad, and locking became horrible to solve.
-
- * xfs/linux/xfs_inodeops.c:
- o don't provide dummy crash hooks for address_mapping functions o
- rename xfs_mmap to xfs_file_mmap
- o rewrite xfs_file_mmap in case of 2.4 to make use of
- xfs_file_vm_ops we can do this now since `filemap_nopage' is
- exported.
- o rewrite xfs_d_delete since in case of 2.4 it may not sleep, so
- when we are detecting that a xnode needs to be cleaned away
- return a 1 (that will remove the dentry directly in d_delete())
- also, use xfs_message_send() to notify useland that the node is
- unused, xfs_queue_inactive() have unwanted side-effects
-
- * xfs/linux/xfs/{xfs_fs.h,xfs_node.h}: change home cooked list to
- linux list macro, protect it will mutex
-
- * xfs/linux/xfs_dev.c: remove some ifdef's and use init_MUTEX
- directly
- * xfs/linux/xfs_common.c: if we have the flag GFP_FS, pass that in
- to malloc
-
- * xfs/linux/xfs/xfs_locl.h: if missing: define init_MUTEX, add
- function list_del_init() add list_for_each_safe,
-
- * configure.in: (linux): check for list_del_init
- * cf/linux-check-list-del-init.m4: new test
-
- * xfs/linux/Makefile.in: added modules_install: target
- * scripts/linux.gdb: xps
-
-2002-01-25 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * appl/mac/install/Arla: Don't start arla if there is no network
- (from William Uther <will+@cs.cmu.edu>)
-
- * arlad/arla-cli.c (arla_put): allow overwriting
-
-2002-01-25 Love <lha@stacken.kth.se>
-
- * configure.in: Disable (arlad/fbuf) mmap for darwin for now, we
- get 0 byte long files sometime.
-
-2002-01-22 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * appl/lib/Makefile.in: Pass SYSCONFDIR
-
- * appl/lib/arlalib.c (arlalib_get_cred_krb): Added support for
- localauth
- o (key_to_key): Added
-
- * rxdef/common.h, rxdef/vldb.xg: Moved voltypes to common.h
-
-2002-01-22 Love <lha@stacken.kth.se>
-
- * configure.in: unbreak the --enable-smp for both linux and
- freebsd, for freebsd is plainly didn't work, and for linux it
- didn't autoprobe
-
- * lib/ko/kocell.c: (parse_simple_file): remove the newline from
- the row (if there is one)
-
- * rx/ChangeLog.c: enable softack and add dependences for rx_globs.o
-
- * rx/{rx.c,rx.h,rx_globs.h,rx_pkt.c,rx_pkt.h,rx_rdwr.c}:
- o Added softack support (acking packet on the recv side)
- o Make sure we send full-sized packets
- o Allocate packet buffer before we start, this way we will not use
- the two first fullsized packets
- o Added variables needed for congestion avoidance
-
- * rx/rx_clock.h: ident
- * rx/rx_user.c: do not use the mtu of the local loopback interface
-
-2002-01-15 Love <lha@stacken.kth.se>
-
- * lwp/plwp.h: waste memory and make lwp_debug an int (get away of
- signedness problem of char)
- * lwp/lwp_asm.h: waste memory and make lwp_debug an int (get away of
- signedness problem of char)
-
-2002-01-11 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * rxdef/volumeserver.xg: Use string instead of char * in
- AFSVolSignalRestore and AFSVolSetIdsTypes
-
-2002-01-07 Assar Westerlund <assar@kth.se>
-
- * xfs/bsd/xfs/xfs_locl.h: FreeBSD 4.5 does define d_thread_t
-
- * xfs/bsd/xfs_message.c, xfs/bsd/xfs_node-bsd.c: handle struct
- mount.mnt_nvnodelist
- (FreeBSD 4.5 and higher)
-
- * configure.in (FreeBSD): never set smp flags to "no"
- (FreeBSD): test for struct mount.mnt_nvnodelist (the new name for
- mnt_vnodelist in 4.5 and above)
-
-2002-01-05 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * configure.in: Check for statvfs
-
-For older ChangeLog entries see ChangeLog.2001
diff --git a/usr.sbin/afs/src/HACKING b/usr.sbin/afs/src/HACKING
deleted file mode 100644
index bdde6c14621..00000000000
--- a/usr.sbin/afs/src/HACKING
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-# $arla: HACKING,v 1.22 2003/06/10 19:24:18 lha Exp $
-#
-# * Configuration stuff
-#
-# Arla uses GNU autoconf for configuration. If you want to modify
-# configure.in (or acconfig.h) you'll need autoconf 2.53 (or later),
-# automake 1.6 (or later), and libtool 1.4a (or later, depending on
-# your platform). To re-create the configuration files, run
-# these commands:
-
-libtoolize -c
-aclocal -I cf $ACLOCAL_EXTRA_ARGS
-autoheader || { echo autoheader broken; exit 1; }
-autoconf || { echo autoconf broken; exit 1; }
-automake -a -c \
- util/Makefile \
- ydr/Makefile \
- rxkad/Makefile \
- lib/Makefile \
- lib/vers/Makefile \
- lib/roken/Makefile \
- lib/sl/Makefile \
- lib/ko/Makefile \
- appl/afstool/Makefile \
- appl/udebug/Makefile
-
-# aclocal creates a file `aclocal.m4' from all the tests in the `cf'
-# directory. autoheader will create `include/config.h.in' and autoconf
-# the `configure' script.
-
-exit 0
diff --git a/usr.sbin/afs/src/INSTALL b/usr.sbin/afs/src/INSTALL
deleted file mode 100644
index 43b31f204ac..00000000000
--- a/usr.sbin/afs/src/INSTALL
+++ /dev/null
@@ -1,425 +0,0 @@
-Id: INSTALL,v 1.93 2002/09/07 10:41:43 lha Exp $arla: $)
-
-* Building arla
-
-Arla is configured with autoconf. Start the configuration process by
-typing:
-
-- `./configure' in the source directory, or
-- `SRCDIR/configure' in the directory where you want to build arla.
- (this is the recommended way but requires a make that understands VPATH)
-
-If you want to install somewhere different from the default
-`/usr/arla' give `--prefix=PATH' as an argument to configure. Note
-that if you change your prefix from the default your kerberos
-libraries may have problems that your kerberos/afs libraries are
-unable to find what cell you belong to.
-
-Note that the kernel module is fairly specific to a particular version
-of the OS kernel, so you should make sure that you have built Arla for
-the same version that are you are running on.
-
-There are also some arla-specific arguments to configure:
-
- --with-arlacachedir=dir use dir as cachedir instead of $prefix/cache
- --with-arlaconffile=file use file for configuration instead of $prefix/etc/arla.conf
- --with-krb4=dir use kerberos 4 in dir
- --with-krb4-lib=dir use krb4-lib in dir
- --with-krb4-include=dir use krb4-include in dir
- --with-krbafs=dir use krbafs lib. For non kth-krb users, see README
- for more information about libkrbafs)
- --with-krb5=dir use kerberos 4 compat from kerberos 5 in dir
- --with-sl=dir use the sl in dir
- --with-sl-lib=dir use the sl library in dir
- --with-sl-include=dir use the sl includes in dir
- --disable-mmap don't use mmap at all
- --disable-dynamic-afs don't use loaded AFS library with AIX
- --enable-smp compile for SMP (currently only on Linux and FreeBSD)
- --enable-knfs enable code to nfsmount AFS (*BSD only).
- --enable-kld build KLD modules (for FreeBSD[34]-current)
- --disable-nnpfs do not build NNPFS
- --without-x don't build X code
- --with-pthreads=dir use the pthreads library in dir
- --with-sys=dir The base directory of your kernel source
- (compile-tree in case of osf)
-
- --with-readline=dir link against readline in dir
- --with-readline-lib=dir (readline's library is in dir)
- --with-readline-include=dir (readline's headers are in dir)
-
- --with-roken=dir The with-roken options are for the users
- --with-roken-include=dir that knowns what they do and want to use
- --with-roken-lib=dir another roken the default. You will shot off
- your feet using this option.
- If you use a roken, you want to use it from
- KTH-KRB1.2 or Heimdal 0.4e (or later)
- --with-bsd-make=prog When using a bsd and cross compiling we need
- to know your make, default /usr/bin/make
- --without-lwp-redzone LWP creates a redzone page on top of all
- thread stacks with mmap(), if this causes
- you problem you can turn it of with this option.
-
-By default configure will use gcc if it finds it. If you want to use
-a specific compiler or some special options you can specify that when
-running configure.
-
-If you change CFLAGS you might also have to set KERNEL_CFLAGS. The
-reason for having different variables is that lots of times totally
-different compilation environment are required (64-bit and 32-bit on
-linux/sparcv9 and MacOS for example).
-
-Type:
-
- env CC=my-compiler CFLAGS='magic-flags' ./configure
-
-If there's no kernel support for your operating system, configure will
-print a warning to that effect and only the user-level stuff will be
-configured.
-
-Solaris 2.7, 2.8 (or Solaris 7, 8)
-
-On Solaris 2.7, 2.8 the kernel itself can be either 32 bit or 64 bit.
-The nnpfs kernel module needs to be of the same type as the kernel. You
-can find out what type of kernel you have from `dmesg'. It should say
-something like:
-
-If it says:
-
- SunOS Release 5.7 Version Generic [UNIX(R) System V Release 4.0]
-
-that means it's a 32 bit kernel, but if it says:
-
- SunOS Release 5.7 Version Generic 64-bit [UNIX(R) System V Release 4.0]
-
-then it's 64 bit.
-
-To build a 32 bit arla you don't need to do anything special. If you
-however want a 64 bit one the magic incarnation of configure is:
-
-env CC='cc -xarch=v9' AS='as -xarch=v9' configure sparc64-sun-solaris2.7
-
-Once configured has completed, just run `make'.
-
-One common problem is the file lwp/process.S. This has to be
-preprocessed with the appropriate defines and then assembled. If the
-magic in lwp/make-process.o.sh.in for some reason fails, try doing it
-by hand. Then figure out what should be added and send us a patch to
-lwp/make-process.o.sh.in.
-
-Mac OS X/Darwin
-
-The platforms we have tested are Mac OS X 10.2. You must install the
-Developer Tools CD before you can compile Arla.
-
-There is documentation to configure the native kerberos in Mac OS X provided by MIT here: <http://web.mit.edu/macdev/Development/MITKerberos/Common/Documentation/preferences.html>
-
-If you choose to use the native Kerberos stuff you'll need krbafs, see
-the README where to find it.
-
-Linux
-
-RedHat ships in the 7.0 release a gcc that can't compile the linux
-kernel. To remedy this problem they also ship a kgcc that should be
-used to compile the linux kernel and kernel modules. When running
-configure on such a computer, please set KERNEL_CC to kgcc. Example:
-
- env KERNEL_CC=kgcc ./configure --argument-to-configure-if-any
-
-If you are running a kernel that isn't the kernel symlinked/unpacked
-to/in /usr/src/linux you will need to use --with-sys=dir
-option (see <http://www.pathname.com/fhs/2.0/fhs-6.1.6.html>).
-Without it will not work, either you will get error when doing
-insmod or strange error when accessing files in /afs.
-
-You need to have run make config (or make xconfig or make menuconfig)
-and make dep before you run arla's configure. This since
-header files (like linux/version.h) need to have right datestamp to
-please make. Another problem is that all symbol-rewrite #defines
-doesn't exists.
-
-{Net,Free,Open}BSD
-
-You will need the kernel source installed in /usr/src/sys.
-
-NetBSD
-
-NetBSD 1.5 include kth-krb and heimdal and due to that arla and
-kth-krb uses a common library (libroken) there might be some
-collisions you should run configure like this:
-
-configure \
- --with-roken=yes \
- --with-roken-include=/usr/include/krb5 \
- --with-roken-lib=/usr/lib
-
-Tru64 Unix (aka Digital Unix (aka OSF/1)):
-
-We recommend building with Digital's cc, since that's what the rest of
-the kernel is built with. We suggest using env CC='cc -std1' configure.
-
-Solaris
-
-Solaris does not have an memcpy function in the kernel and gcc can
-sometimes generate calls to this function. If you get unresolved
-symbol errors on memcpy, either compile with Sun's compiler or define
-memcpy in terms of bcopy.
-
-* Installing arla
-
-Run `make install'. It will create and populate these directories:
-
-/usr/arla/bin all user binaries
-/usr/arla/sbin arla-cli and the startarla script
-/usr/arla/libexec the arlad
-/usr/arla/cache the cached files will be stored here
- (core-dumps from arlad as well)
-/usr/arla/etc configuration files:
- ThisCell, CellServDB, arla.conf
-/usr/arla/lib random libraries
-
-If you're already part of an AFS cell, modify /usr/arla/etc/ThisCell
-and make sure your cell is mentioned in /usr/arla/etc/CellServDB. If
-you don't have a cell you'll still be able to run as a client in the
-cell `stacken.kth.se' and access all cells listed in CellServDB.
-
-* Services
-
-Everything works fine even if your /etc/services is not updated, but
-you might not get netstat, tcpdump, and other programs might not print
-the symbolic names. To make all of this work, add the
-contents of SRCDIR/conf/services to /etc/services.
-
- cat SRCDIR/conf/services >> /etc/services
-
-* Starting arla
-
-To start Arla just run `/usr/arla/sbin/startarla'. (On Linux there is
-also a rc.d-based script, see below).
-
-Here are some detailed quirks for some operating systems and
-instructions as to what to try when startarla does not give you
-full and complete satisfaction.
-
-Linux:
-
- Use the script /usr/arla/sbin/startarla to start Arla. There's also
- a SysV-based init script called arla.init you can install into
- /etc/rc.d (or where your init files are located).
-
- If you are using Linux 2.2 and libc4, libc5 or glibc 2.0,
- (or programs that use these version of libc, such as Matlab)
- you may want to enable the getcwd syscall, which works much better
- than the old way of doing getcwd. In order to do this, follow
- these steps:
-
- 1. Copy /usr/arla/lib/libgetcwd.so.X (where X is the arla version)
- to /lib.
- 2. Run "/sbin/ldconfig".
- 3. Run "LD_PRELOAD=/lib/libgetcwd.so.0 /bin/pwd". If this fails
- with "/bin/pwd: can't load library '/lib/libgetcwd.so.0'" or
- some other error message, report this error.
- 4. If the previous step went well, add this line to /etc/ld.so.preload:
- /lib/libgetcwd.so.0
-
- DO NOT load the file from /usr/arla/lib, since /usr probably is not
- part of the root partition of your system. If you do this, your system
- will probably not be able to boot, even in single user, since in most
- Linux installations, init, sh, mount and other programs are dynamically
- linked.
-
- If you use glibc 2.1 or later, the above method is unnecessary and
- the line /lib/libgetcwd.so.0 should be removed from /etc/ld.so.preload
- if present.
-
-SunOS4:
-
- modload /usr/arla/bin/libnnpfs.o
- modstat
- mknod /dev/nnpfs0 c <C-major from modstat> 0
- mkdir /afs
- /usr/arla/bin/mount_nnpfs /afs /dev/nnpfs0
- /usr/arla/libexec/arlad
-
-{Net|Open}BSD:
-
- You can not load kernel modules (the modload step) when your
- securelevel is above zero. There are two ways to make sure that you
- can load kernel modules:
-
- * You can compile a new kernel with "option INSECURE". This will make
- the securelevel be zero in multiuser. Then you can load the modules
- with the above commands. Some people might consider this a security
- risk.
-
- * You can load the modules in /etc/lkm.conf (for NetBSD) or
- /etc/rc.securelevel (for OpenBSD).
-
-FreeBSD:
-
- Do like in {Net|Open} except that after the first time (when /dev/nnpfs0
- exists) you can skip the modload since the module with automatically
- be loaded by mount_nnpfs assuming you have copied nnpfs_mod.o to /modules with
- something like the following commands:
-
- mkdir /modules
- cp /usr/arla/bin/nnpfs.ko /modules
-
- And mount_nnpfs will load the filesystem into the kernel.
-
- As with other BSDs, /usr/arla/bin/startarla should do everything for you.
-
-Solaris:
-
- Just use /usr/arla/sbin/startarla. If that does not work, see the
- more detailed explanation here.
-
- Add a line to /etc/name_to_major with (138 should be any unused number)
-
- nnpfs 138
-
- and another one to /etc/name_to_sysnum (105 is the preferred system
- call number by Solaris < 7 and 73 for Solaris 7). If that's already
- used by Transarc AFS on your machine pick some other number. You can
- only pick system calls that are marked as loadable, namely these
- system calls on Solaris 7:
- 40, 42, 45, 49, 51 - 53, 64-78, 82, 83, 101, 102, 110, 111, 127, 140,
- 150, 151, 176 - 184, 226 - 229
-
- nnpfs 105
-
- (or)
-
- nnpfs 73
-
- You might have to reboot for these changes to take effect. Then, type:
-
- modload nnpfs
-
- You should probably add a file in /usr/kernel/drv/nnpfs.conf with:
-
- name="nnpfs" parent="pseudo" instance=0;
-
- and then run:
-
- drvconfig -i nnpfs
-
- Create a /dev link and a directory:
-
- ln -s "/devices/pseudo/nnpfs@0:" /dev/nnpfs0
- mkdir /afs
-
- Now you can try mounting the file system and start the daemon:
-
- /usr/arla/bin/mount_nnpfs /dev/nnpfs0 /afs
- /usr/arla/libexec/arlad
-
- Note that if you are using a syscall other than 105, you have to use a
- new kth-krb (with afssys.c 1.59 or newer) and set AFS_SYSCALL=nnpfs
- before starting arlad.
-
- If you want to, you can copy the nnpfs/solaris/nnpfs module to /kernel/fs
- and nnpfs/solaris/bin/mount_nnpfs to /lib/fs/nnpfs/mount which enables you to
- automatically load the nnpfs module when mounting the nnpfs file system.
-
-AIX:
-
- Create the device node:
-
- mknod /dev/nnpfs0 c 100 0
-
- And add a line like the following to /etc/vfs:
-
- arla 8 none none
-
- Now you can try mounting the file system and start the daemon:
-
- /usr/arla/bin/nnpfs_load /usr/arla/bin/nnpfs
- /usr/arla/bin/mount_nnpfs /dev/nnpfs0 /afs
- /usr/arla/libexec/arlad
-
-Tru64 Unix (aka Digital Unix (aka OSF/1)):
-
- Copy the nnpfs.mod to some of /subsys, /var/subsys, /sys/BINARY,
- or /subsystems. Depending on what your kloadsrv thinks is the
- right thing<tm>.
-
- Load (configure) the module with sysconfig -c nnpfs
-
- Query the module to see if it loaded ok and get the
- character device and syscall number from it with:
- sysconfig -q nnpfs
-
- Create the char-device "mknod /dev/nnpfs0 c <MAJOR> 0"
- where <MAJOR> is the number obtained above.
-
- Create the afs directory: mkdir /afs
-
- Mount the device and start the daemon:
- /usr/arla/bin/mount_nnpfs /dev/nnpfs0 /afs
- /usr/arla/libexec/arlad
-
- It could look something like this:
-
- datan:~# sysconfig -c nnpfs
- datan:~# sysconfig -q nnpfs
- syscall = 34
- major = 68
- debug = 255
- datan:~# mknod /dev/nnpfs0 c 68 0
- datan:~# mkdir /afs
- datan:~# /usr/arla/bin/mount_nnpfs /dev/nnpfs0 /afs
- datan:~# /usr/arla/libexec/arlad
- datan:~# ls /afs | head
- .stacken.kth.se
- afs.brain.de
- afs.hursley.ibm.com
- afs1.scri.fsu.edu
-
-* command-line mode
-
-If Arla does not work completely, if you do not have root permission
-on your machine or want to test for some other reason, there is a
-user-space command-line based program called arla-cli, that you can
-use to to access AFS. When starting, it should print some messages
-and then give you the prompt `arla>'. There are very minimal commands
-for navigating the AFS space (ls, cd and cat). Type `help' to get a
-list of all the commands.
-
-Run `arla-cli --help' for a list of the options supported.
-
-* Tests
-
-There are a number of tests in the `tests' directory. Use a command
-similar to the following to run them:
-
-env WORKDIR=workdir ./run-tests
-
-where `workdir' is a temporary directory in AFS space where you have
-read and write permission. run-tests takes lots of options, try
-`-help'. You should probably start by running `-fast -all' and if you
-have a lot of patience and time try `-all'. The `-fast -all' tests
-test most of the common operations and is a good general test run.
-The test that aren't marked `fast' do a rather unkind stress test of
-things and takes a few hours to run.
-
-* Firewalls
-
-If you have to use Arla thru a firewall, it is useful to review how
-Arla communicates. Arla uses UDP in the following way:
-
-arlad Server
-7001(*) <--> 7000,7003
-
-Tools(**) Server
-whatever(***) <--> 7002,7003,7005
-
-(*) arla older then 0.36 used 4711
-
-(**) vos/pts/bos
-
-(***) dynamically assigned port numbers, depends on your OS
-
-If your server is on the other side of a firewall and the
-configuration allows connections to be opened only one way, your
-client will probably miss file updates from other clients, even if
-your file system looks good after startup.
diff --git a/usr.sbin/afs/src/LIESMICH b/usr.sbin/afs/src/LIESMICH
deleted file mode 100644
index b379489f132..00000000000
--- a/usr.sbin/afs/src/LIESMICH
+++ /dev/null
@@ -1,195 +0,0 @@
-LIESMICH für arla-0.35 ($arla: $)
-$arla: LIESMICH,v 1.9 2002/09/07 10:41:44 lha Exp $
-
-Für alle, die zuerst 'mal lieber auf Deutsch lesen. Die Lektüre von
-README wird aber trotzdem empfohlen.
-
-1. Was ist Arla?
-
-Arla ist eine freie Implementation des AFS Cacheverwalters.
-
-2. Wo finde ich diese Datei?
-
-Diese Datei ist enthalten in
-ftp://ftp.stacken.kth.se/pub/arla/arla-0.35.tar.gz
-(d.h. /afs/stacken.kth.se/ftp/pub/arla/arla-0.35.tar.gz).
-
-3. Was ist AFS?
-
-AFS ist ein weltweit verbreitetes Dateisystem. Lesen Sie
-<http://www.transarc.com/afs/transarc.com/public/www/Product/AFS/FAQ/faq.html>
-für mehr Informationen.
-
-4. Was ist in Arla enthalten?
-
-Kerneltreiber (mit verschieden guter Unterstützung)
-für folgende Operativsysteme:
-
-- FreeBSD 3.x, 4.,x und 5.x
-- OpenBSD 2.2-2.7
-- NetBSD 1.2, 1.3, 1.4 und 1.5
-- Linux 2.0.x, 2.1.x, 2.2.x, 2.3.x, 2.4.x
-- SunOS 4
-- Solaris 2.5, 2.6, 7 und 8
-- AIX 4.x
-- IRIX 6.x
-- Digital Unix 4.0, 5.0 (OSF/1)
-- Darwin (MacOS DP3)
-
-Nur auf Anwenderniveau:
-- Ultrix 4.4
-
-Der Cacheverwalter (arlad) der sowohl im "user-level" als auch mit
-den Kerneltreibern angewendet werden kann. Im "user-level" Modus
-ist er sehr gut zu portieren und ist (mit den Cygwin32 Bibliotheken)
-sogar unter Windows NT gefahren.
-
-Einige einfache Programme (amon, fs, klog, tokens, vos, udebug, und pts).
-
-Einen experimentellen AFS server, Milko genannt.
-
-5. Auf welchem Niveau befindet sich Arla?
-
-Dies ist noch vor den berühmten griechischen Buchstaben.
-
-Doch funktioniert das meiste. Dateien können gelesen und geschrieben
-werden, mit oder ohne Identitätskontrolle. Es ist noch nicht so stabil
-und schnell wie wir wünschen. Der Cache funktioniert nur für ganze
-Dateien, aber das reicht wohl fürs Erste.
-
-6. Was brauche ich um Arla anzuwenden?
-
-Mit einem der oben genannten Systeme sollte es Ihnen möglich sein das
-AFS Dateiensystem zu montieren (und vielleicht auch Ihrem Kernel einen
-Panic zu verpassen).
-
-Die Anwenderprogramme dürften auf fast jedem Unixdialekt compilieren
-und funktionieren.
-
-Wenn sie die Identitätskontrolle anwenden wollen brauchen Sie auch
-Kerberos V4. Wir empfehlen wärmstens die von
-<http://www.pdc.kth.se/kth-krb/>.
-
-Ab OpenBSD 2.3 ist kth-krb schon dabei. Doch muß die Zeile 'AFS=yes'
-in /etc/mk.conf hinzugefügt und libkafs und afslog neu compiliert
-werden (sind unter /usr/src/kerberosIV/{kafs,afslog} zu finden).
-
-Hier haben wir einen Abschnitt über MIT-Kerberos (eigentlich nur für
-unsere amerikanischen Anwender) ausgelassen (ist im README zu lesen).
-
-Falls Sie kein Kerberos Anwender sind sollte es Ihnen möglich sein die
-Funktion zu testen, doch wo ist dann der Witz der Sache? Wir testen
-Arla auch nicht ohne Kerberos.
-
-7. Wie installiere ich Arla?
-
-Das steht in der Datei INSTALL (bis jetzt nur auf Englisch).
-
-8. Was mache ich wenn ich einen Fehler finde?
-
-Schreiben Sie einen so detaillierten Rapport wie möglich (auf Englisch)
-an <arla-drinkers@stacken.kth.se>. Patches sind auch willkommen.
-
-Falls Sie einen "Bug" finden und keine Ahnung haben was da denn falsch
-gelaufen sein könnte, versuchen Sie es noch einmal mit
-`arlad -n -z --debug=almost-all' und legen sie den produzierten Text
-dem Email bei. Sie können auch das Debugniveau eines laufenden arlad
-(als root) mit `fs arladebug <debug-level>' ändern. Das gleiche gilt
-für den Kerneltreiber mit `fs nnpfsdebug <debug-level>'. Das Ergebnis
-landet in Ihrem syslog (/var/log/messages, /var/adm/messages oder so
-ähnlich).
-
-Falls arlad abstürzt, wenden sie bitte gdb an um dem core mit `bt'
-einen Backtrace zu entziehen. Auch können Werte der Variabeln nützlich
-sein. Falls kein core produziert wird kann arlad unter gdb (mit -n -z)
-gestartet werden.
-
-Im Falle eines Kernelabsturtzes, versuchen Sie mit den Mitteln Ihres
-Betriebssystems einen Dump zu erzeugen und den Debugger
-anzuwenden. Die Dokumentation Ihres Betriebssystems hilft Ihnen
-hoffentlich weiter.
-
-Ohne diese Information können wir Ihnen nicht helfen.
-
-9. Wie kann ich die Menge der Debuginformation steuern?
-
-Sowohl arlad als auch nnpfs (der Kerneltreiber) haben Variabeln mit
-denen die Art der Debuginformation (und damit die Menge) kontrolliert
-werden kann.
-
-Arlad anwendet `--debug' und nach dem Start `fs arladebug'. Für
-den Kerneltreiber wendet man `fs nnpfsdebug' an.
-
-10. Wie schwierig ist es Arla auf ein neues Betriebssystem zu
- portieren?
-
-Nicht sehr. Im user-level sind die Unterschiede gering zwischen
-verschiedenen Betriebssystemen. Für den Kernel kann man mit einem
-anderen ähnlichen System (in nnpfs/SYSTEM) anfangen. Falls Sie sich für
-so etwas interessieren oder sogar Arla auf einem oben nicht genannten
-Betriebssystem laufen haben, schicken Sie ein Email an
-<arla-drinkers@stacken.kth.se>.
-
-11. Bekannte Probleme.
-
-OpenBSD hat auf einigen Architekturen Probleme mit mmap. In diesen
-Fällen kann auf configure mit `--disable-mmap' ausgewichen werden. Wir
-haben das auf sun4m bemerkt.
-
-Falls Sie Probleme mit dem Cache bemerken, entfernen sie den cache
-(normalerweise `/usr/arla/cache') und starten Sie dann arlad neu.
-
-Mit Digitals cc Program brauchen Sie wahrscheinlich -std1 (d.h. CC als
-"cc -std1" definieren wenn sie configure anwenden).
-
-Solaris hat keine Memcpy-funktion im Kernel, gcc generiert aber
-manchmal trotzdem solche Anrufe. Falls das passiert, verwenden sie
-entweder Suns Compilator oder schreiben Sie die memcpy Anrufe m.H. von
-bcopy um.
-
-12. Wie kann ich behilflich sein?
-
-Mit Quellkod. Bugreports und Patches sind immer willkommen.
-
-13. Gibt es Emaillisten?
-
-arla-drinkers@stacken.kth.se Allgemeine Diskussion.
-arla-announce@stacken.kth.se Nur Neuigkeiten.
-
-Senden Sie eine Email an <LIST>-request@stacken.kth.se um Mitglied zu
-werden.
-
-14. Gibt es eine Webpage?
-
-Ja, http://www.stacken.kth.se/projekt/arla/
-
-15. Wie ist die Lage mit Copyrights für Arla?
-
-lwp und rx haben Copyright von IBM. Wir danken Derrick J Brashear
-<shadow@dementia.org> und Jim Doyle <jrd@bu.edu> die es möglich
-gemacht haben sie anzuwenden.
-
-Die rxkad Implementation ist von Björn Grönvall <bg@sics.se> und ist auch
-in kth-krb enthalten.
-
-Editline ist von Simmule Turner und Rich Salz.
-
-Der Kod für den nicht angeschlossenen Modus ist von Wuwei Shen.
-
-Der Kod um all das zusammenzuhalten ist von uns selbst.
-
-<arla-drinkers@stacken.kth.se>
-
-16. Was ist seit * passiert?
-
-Steht in NEWS und ChangeLog.
-
-17. Und was bedeutet `arla'?
-
-- Arla ist ein schwedisches Wort für `früh'. Der größte Teil von
-Arla wurde am frühen Morgen verfaßt.
-
-- Arla is auch der Name des grössten schwedischen Produzenten für
-Milchprodukte. Sie produzieren unter anderem `fil' (schwed. filmjölk
-ist eine Art Sauermilch). `Fil' ist auch das schwedische Wort für
-Datei.
diff --git a/usr.sbin/afs/src/Makefile.in b/usr.sbin/afs/src/Makefile.in
deleted file mode 100644
index 7e27c2cf511..00000000000
--- a/usr.sbin/afs/src/Makefile.in
+++ /dev/null
@@ -1,56 +0,0 @@
-# $KTH: Makefile.in,v 1.29.2.1 2001/09/15 13:33:35 mattiasa Exp $
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-SHELL = /bin/sh
-
-SUBDIRS = include lib util ydr lwp rxdef lib/ko rx lib/bufdir \
- @RXKAD@ xfs arlad conf appl tests doc
-
-all:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-clean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-realclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-distclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
- rm -f Makefile
- rm -f conf/arla.spec
- rm -f include/arla-version.h
- rm -f config.cache config.status config.log include/config.h
-
-mostlyclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-install:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-uninstall:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-Makefile: Makefile.in config.status
- $(SHELL) config.status
-
-config.status: configure
- $(SHELL) config.status --recheck
-
-.PHONY: all clean realclean distclean mostlyclean install uninstall
diff --git a/usr.sbin/afs/src/NEWS b/usr.sbin/afs/src/NEWS
deleted file mode 100644
index d5036c5da7c..00000000000
--- a/usr.sbin/afs/src/NEWS
+++ /dev/null
@@ -1,707 +0,0 @@
-Changes in release 0.35.7
-
-* Support for Linux 2.4
-
-* Support FreeBSD 4.5
-
-* Bug fixes
-
-Changes in release 0.35.6
-
-* Handle moved volumes better
-
-* Support for Mac OS X 10.1
-
-* Fix "server is down" problem
-
-* Fix xfs for FreeBSD 4.4
-
-* Fix Linux unmount problem
-
-* Fix unlink kernel crash on Mac OS X
-
-* Bug fixes
-
-Changes in release 0.35.5
-
-* Security fix
-
-* Save and restore the signal masks (SIGIO, SIGALRM, SIGVTALRM) on OSF 5.x
-
-* Bug fixes
-
-Changes in release 0.35.4
-
-* Configuration program for Mac OS X
-
-* General update of the osf/1 code, might even work now
-
-* Erroneous reuse of cache nodes fixed
-
-* Bug fixes
-
-Changes in release 0.35.3
-
-* Linux S/390 support
-
-* Userland applications improved
-
-* Bug fixes
-
-Changes in release 0.35.2:
-
-* Bug fixes
-
-Changes in release 0.35.2:
-
-* Bug fixes
-
-Changes in release 0.35.1:
-
-* Bug fixes
-
-Changes in release 0.35:
-
-* Added a klog like program called kalog that talkes directly to the
-ka-server.
-
-* removed advertising clause.
-
-* split arlad to a commadline client, arla-cli and a daemon arlad,
-this makes us not depend of things like libreadline.so.
-
-* add man-pages
-
-* handle there being no root volume when starting
-
-* improve installation procedure on solaris
-
-* improve stability on solaris/smp
-
-* Even more bug fixes
-
-Changes in release 0.34.6:
-
-* Bug fixes
-
-Changes in release 0.34.5:
-
-* Bug fixes
-
-Changes in release 0.34.4:
-
-* Bug fixes
-
-Changes in release 0.34.3:
-
-* Make BSD more stable
-
-* Update parts of libroken
-
-* Always read SuidCells
-
-* m68k fixes in LWP
-
-* make arlad more robust against a busy fileserver
-
-Changes in release 0.34.2:
-
-* make it work on Solaris/x86
-
-* make it build on NetBSD 1.5
-
-* cache-recover is no longer the default in arlad
-
-* fix directory invalidation bug on Linux
-
-Changes in release 0.34.1:
-
-* make it work on solaris
-
-Changes in release 0.34:
-
-* support for fake mount points. When just stating a mount point,
-arlad makes up some reasonable information for the mount point, and
-the actual data for the volume is not retrieved until the contents is
-needed. This speeds up GUIs, `ls -l /afs', and other user operations.
-Enabled with the `--fake-mp' option to arlad.
-
-* new `bos' program
-
-* update to more recent Linux (2.3.99-pre and 2.4.0-test series)
-
-* added cmd compatible lib
-
-* handle write-back of mmap-ed pages after close better
-
-* update to *BSD
-
-* even more mit-kerberos compat
-
-* more stability
-
-* bug fixes
-
-Changes in release 0.33.1:
-
-* fixes for FreeBSD and OSF
-
-Changes in release 0.33:
-
-* port to Darwin/MacOS X 10.0
-
-* updates for linux 2.3.x/2.4.x
-
-* update for NetBSD-current
-
-* fix for failing readdir on Solaris with 32-bit kernels
-
-* fix for Linux/m68k
-
-* have pts loop over all db servers
-
-* lots of new tests
-
-* some bug fixes
-
-Changes in release 0.32:
-
-* working on linux 2.3.x
-
-* fix abort bug on solaris
-
-* handle several xfs devices on linux
-
-* make `fs lq' return a volume name
-
-* bug fixes
-
-Changes in release 0.31:
-
-* better handling of out-of-memory situations under Linux
-
-* better and more robust configure
-
-* linuxconf glue, RPM spec file
-
-* some more linux 2.3 support. remove 2.0 support.
-
-* updated to *BSD-current
-
-* solaris improvements
-
-* performance improvements
-
-* bug fixes
-
-Changes in release 0.30:
-
-* basic BulkStatus support
-
-* update to *BSD/current
-
-* more NAT friendly
-
-* rewrote cleaner-part
-
-* bug fixes
-
-Changes in release 0.29.1:
-
-* bug fixes
-
-Changes in release 0.29:
-
-* update to *BSD/current
-
-* some updating to Linux 2.3 (there are some mmap problems)
-
-* bug fixes
-
-Changes in release 0.28:
-
-* support SMP on FreeBSD
-
-* better error messages in lots of places
-
-* make mount points in a Transarc-compatible way (mode bits 0111)
-
-* a tiny bit of Transarc-compatible library code
-
-* beginning of xfs code for Windows NT and port of LWP to NT native threads
-
-* ydr now supports multiple packages in one .xg file
-
-* fixed a leak of fs-context's that caused tokens to be expired.
-
-* afsaclmgr: an acl manager written in guile-gtk
-
-* more portability
-
-* more test cases
-
-* lots of bug fixes
-
-Changes in release 0.27:
-
-* better support for Solaris 7 in 64-bit mode. Now 32 bit pioctl's
- should also be handled. See INSTALL for more information on how to
- build in 64-bits mode.
-
-* new transarc-compatible programs klog, unlog, and tokens by Chris
- Wing <wingc@engin.umich.edu>
-
-* support for the getattr inode_operation on Linux which should give
- ``better'' inode numbers to the applications, requires the
- getattr-patch to Linux.
-
-* cache files in two levels of directories. NOTE: you should remove
- your old cache files (rm /usr/arla/cache/* or similar) since these
- will use different names
-
-* support for generating root.afs in the client (dynroot)
-
-* more bugs related to deleting files fixed
-
-* uses the syscalls fhopen and getfh on NetBSD-current
-
-* more test cases
-
-* some more bug fixes
-
-Changes in release 0.26:
-
-* the OSF/1 port now works somewhat better than it used to do;
- read-only mmap:ing of files in AFS should now work (this is required
- to run programs), putpages is still not implemented so writing to
- mmap:ed pages does not work, as does linking files in AFS (ld does
- funny things).
-
-* fix bugs related to close in cvs and rm -rf failing
-
-* make it work on more recent NetBSD-current and FreeBSD-current
-
-* some bug fixes in the solaris port
-
-* update rhapsody port
-
-* arlad creates a /var/run/arlad.pid file
-
-* should build (and work) on Solaris 7 in 64 bits mode with a modern as
-
-* vos lock and unlock implemented
-
-* milko bug fixes
-
-Changes in release 0.25:
-
-* add milko mark three --- aka filbunke
-
-* make it build on irix, netbsd 1.4, linux 2.3.2, solaris 7, freebsd-current
-
-* compat with devfs on linux
-
-* re-written signal handling in the xfs module for linux.
-
-* restart rx_clock timer when it expires
-
-* change the names of converted cache directories to handle more cache
- nodes
-
-* disconnected write-mode is more functional
-
-* make setgroups preserve the pag
-
-* more tests
-
-* re-organize configure
-
-* some fixes for non-gnu make
-
-Changes in release 0.24:
-
-* fixed bug when overwriting volume name in `fs setquota'
-
-* bug fixes
-
-Changes in release 0.23:
-
-* changed volume cache
-
-* bsd: lock node when vget
-
-* updated vos command
-
-* removed Solaris umount_xfs command
-
-* flush kernel acl when doing setacl
-
-* Linux devfs support
-
-* misc. bugfixes
-
-Changes in release 0.22:
-
-* getcwd magic for linux
-
-* added fallback code for old vl-servers
-
-* added plwp, LWP on pthreads form Derrick J Brashear <shadow@dementia.org>
-
-* port to Irix 6.4
-
-* random bugfixes
-
-Changes in release 0.21:
-
-* improve libgetcwd.so installation procedure
-
-* correct some bugs with the counting of used bytes
-
-* return better error codes
-
-* should work with KLD/LKMs on FreeBSD [34]
-
-* correct errors when setting and reading sysnames
-
-* make --with-sys work
-
-* fix refcount bug in volcache
-
-* works once again on NT/cygwin
-
-* add cellstatus and suid cells
-
-* update tests
-
-* port to Solaris 2.7 in 64-bit mode
-
-Changes in release 0.20:
-
-* more correct error codes
-
-* fs newcell
-
-* fs apropos (command locate by keyword)
-
-* linux getcwd fix from Brandon S. Allbery <allbery@ece.cmu.edu>
-
-* some code reorganized
-
-* lots of bug fixes
-
-Changes in release 0.19:
-
-* support for Solaris 7
-
-* tests: add support for running somewhere else than /afs
-
-* some more bug fixes
-
-Changes in release 0.18:
-
-* implement selection of filservers based on rtts
-
-* fix bugs related to 8bit characters in filenames
-
-* revised error messages in vol/fcache
-
-* lots of new test cases
-
-* new shell-script run-tests to run tests
-
-* implement `fs checkservers' and `fs rmm'
-
-* return correct number of blocks on linux
-
-* the usual collection of bug fixes
-
-Changes in release 0.17.1:
-
-* fixed memory leak bug
-
-Changes in release 0.17:
-
-* new graphical program `amon' for monitoring the state of the cache.
-
-* `fs xfsdebug' and `fs arladebug' for manipulating the details of the
- debug output.
-
-* more warning messages from arla (when credentials expire, hosts go
- up and down, volumes are busy, ...)
-
-* keep track of which servers are up and down, probe them periodically
- and fallback to servers that are up.
-
-* more test-cases
-
-* work-around a bug in Linux 2.1.131 that made it impossible to have
- filenames with 8bit characters
-
-* correct timestamps (use ClientModTime instead of ServerModTime)
-
-* bug fixes
-
-Changes in release 0.16:
-
-* better handling of large directories
-
-* even more bug fixes
-
-Changes in release 0.15:
-
-* added disconnected mode code from WUWEI SHEN <wwshen@engin.umich.edu>
-
-* more support for FreeBSD3.0
-
-* multiple worker-threads
-
-* bugfixes
-
-* more test cases
-
-Changes in release 0.14.1:
-
-* now even builds
-
-Changes in release 0.14:
-
-* added an experimental pre-greek letter AFS server, milko
-
-* FreeBSD 3.0 support
-
-* more Digital UNIX support
-
-* updated IRIX port
-
-* transarc compat gc pag support in fs appl
-
-* new pts functions implemented
-
-* Linux SMP fixes
-
-* arlad now supports viocgetcacheparams
-
-* lwp now supports Fujitsu UXP/V architecture
-
-* cookies implemented in xfs_readdir
-
-* many bug fixes
-
-Changes in release 0.13:
-
-* irix port much improved
-
-* smp detection on Linux works better
-
-* plugged some memory leaks in the linux kernel module
-
-* random bug fixes
-
-Changes in release 0.12:
-
-* works better on OpenBSD and Linux
-
-* builds SMP-able modules on Linux
-
-* lwp stack size bumped
-
-Changes in release 0.11:
-
-* works better on NetBSD and modern Linux
-
-* bug fixes
-
-Changes in release 0.10:
-
-* cache files are now opened using inode number on BSD and Solaris
-
-* lots of bug fixes
-
-Changes in release 0.9:
-
-* merging of all BSD codes
-
-* support for more pioctl calls
-
-* use readpage instead of bmap in linux 2.0
-
-* lots of bug fixes
-
-Changes in release 0.8:
-
-* It should build with all makes
-
-* port to Rhapsody (contributed by Alexandra Ellwood <lxs@MIT.EDU>)
-
-* more functionality in arlad --test (from Alec Wolman <wolman@cs.washington.edu>)
-
-* port to OSF/1 (by Johan Danielsson <joda@pdc.kth.se>)
-
-* create the cache vnodes in the background
-
-* invalidate nodes when the callback expires
-
-* better linux 2.[01] support
-
-* handle the case of different user and kernel types with glibc
-
-* udebug program added
-
-* some documentation written
-
-* lots of bug fixes
-
-Changes in release 0.7.2:
-
-* New way of building process.o
-
-Changes in release 0.7.1:
-
-* Bug fixes
-
-Changes in release 0.7:
-
-* IRIX support added though it does need more work
-
-* Autodetection of Linux htonl weirdness
-
-* Linux xfs now includes modversions.h to get versioned names
- of exported kernel symbols
-
-* New arlad option for recovering (not) stored state
-
-* Merged token clearing bugfix which fixed some panics
-
-Changes in release 0.6:
-
-* AIX support added
-
-* Linux 2.1 support added
-
-* Linux/alpha support in process.S
-
-* Solaris support updated with some new vnode ops
-
-* New --root-vol option to arlad
-
-* Expiring credential handling
-
-* Added fs library
-
-* Added fpriority to arlad
-
-Changes in release 0.5:
-
-* reserved major number for Linux
-
-* pts added
-
-* minor fixes for Solaris 2.6
-
-* moved almost all pioctl handling to arlad
-
-* fs {sa,lq,sq} now works
-
-* fixed pioctl handling in Linux (lookup of fid)
-
-* cred deletion added
-
-* updated getargs to handle options the transarc way
-
-* arlad now forks off per default
-
-* new debug levels to arlad
-
-* mkdir/rmdir in Linux added
-
-* Linux xfs access control fixed
-
-* df now produces something interesting in Linux
-
-* several new autoconf tests
-
-* arlad -t now works with cygwin32
-
-* time can now be mmaped to improve performance
-
-Changes in release 0.4:
-
-* bug that caused linux xfs module to loop fixed.
-
-* fix seek error on NetBSD
-
-* copy in arguments to xfs_mount which makes it not panic on some
- NetBSD ports.
-
-* collect message statistics in arlad
-
-* fs getcrypt and fs setcrypt
-
-* set `d_type' in BSD directories which fixes lots of
- directory-related problems.
-
-* some code reorganization.
-
-* fs getacl works
-
-* support for linking with the compatability libraries of krb 5.
-
-* support for reading cell information from /usr/vice/etc as a
- fallback for /usr/arla/etc
-
-* now using the inconsistent interpretation of the unix mode bits on
- directories to be compatible
-
-* some malloc/free related errors fixed
-
-Changes in release 0.3:
-
-* solaris port working
-
-* doc/ created with some introducing docs on Arla.
-
-* Local access checks introduced. (until now the rights were "shared" by
- all users on the system)
-
-* arlad now reported to work on powerpc after a minimal fix.
-
-* xfs/Linux bugfixed and should work readonly
-
-Changes in release 0.2:
-
-* Improved directory handling code.
-
-* arlad now uses getarg for parsing arguments. New arguments:
- --test (-t) test mode
- --conffile (-c) configuration file
- --log (-l) write log here
- --device (-d) device used by xfs (default /dev/xfs0)
- --rxkad-level (-r) minimum rxkad level
- --version
- --help
-
-* Fix reading from kernel space on Linux/i386.
-
-* Removed GCC-isms from the code.
-
-* More efficient.
-
-* arlad stores state between runs.
-
-* Only read new data when needed.
-
-* Handle volume callbacks.
-
-* arlad in test mode follows symlinks.
-
-* autoconf test for presence of `krb_principal'. This makes it much
-easier to build with other kerberos distributions than kth-krb.
-
-* Bug fixes.
-
-* More stuff that I have repressed.
-
-Changes in release 0.1:
-
-* I don't remember any longer. Try looking at the ChangeLog.
diff --git a/usr.sbin/afs/src/README b/usr.sbin/afs/src/README
deleted file mode 100644
index d81e29dd9b4..00000000000
--- a/usr.sbin/afs/src/README
+++ /dev/null
@@ -1,188 +0,0 @@
-README for arla-0.35 ($arla: $)
-$arla: README,v 1.87 2003/07/15 16:22:58 lha Exp $
-
-1. What is arla?
-
-Arla is a free AFS cache-manager implementation.
-
-2. Where do I find this file?
-
-This file is contained inside
-ftp://ftp.stacken.kth.se/pub/arla/arla-0.35.tar.gz
-(aka /afs/stacken.kth.se/ftp/pub/arla/arla-0.35.tar.gz).
-
-3. What is AFS?
-
-AFS is a world-wide distributed file system. See
-<http://www.transarc.com/afs/transarc.com/public/www/Product/AFS/FAQ/faq.html>
-for more information.
-
-4. What's included in arla?
-
-There is kernel support (with different level of functionality) for
-the following operating systems:
-
-- FreeBSD 4.5 (and later), and 5.1 and later
-- OpenBSD 3.1 - 3.2
-- NetBSD 1.5 and 1.6
-- Linux 2.2.x, 2.4.x
-- SunOS 4
-- Solaris 2.6, 7, and 8
-- AIX 4.x
-- IRIX 6.x
-- Digital Unix 4.0, Compaq Tru64 5.0 (OSF/1)
-- Mac OS X 10.0 and 10.2 (and Darwin)
-
-A cache manager (arlad) that works both in user-level mode and with
-the kernel module. The user-level mode is quite portable and has even
-been working under Windows NT (with the cygwin32 libraries).
-
-Some simple programs (amon, bos, fs, pts, tokens, vos, and udebug).
-
-An experimental AFS server called milko.
-
-5. What's the status of arla?
-
-- Working stable client (currently cacheing whole files)
- Arlad caches ranges of files, from the first byte to the last requested.
-- Authentication (using kth-krb4 or any other krb4 implantation)
-- Used in production systems with OpenBSD, FreeBSD, NetBSD, Linux, and
- Mac OS X
-- Some administration programs (bos, fs, vos, pts and bos)
-- An experimental AFS server (milko)
-- Graphical program, amon, for monitoring the state of the cache.
-- A graphical interface for managing ACLs (for MacOS X only)
-- A configuration utility for Mac OS X
-
-6. What do I need to run arla?
-
-If you have one of the systems listed above you will be able to mount
-afs as a file system (and probably to panic your kernel as well).
-
-The user-level programs should work and build on almost any other unix
-dialect.
-
-If you want to use authentication, you will also need a Kerberos v4
-implementation. We use and recommend the one at
-<http://www.pdc.kth.se/kth-krb/>.
-
-OpenBSD 2.3 and above already ships with kth-krb. On OpenBSD 2.3 only, you'll
-have to add the line 'AFS=yes' to /etc/mk.conf and rebuild libkafs and
-afslog. (can be found in /usr/src/kerberosIV/{kafs,afslog}) (versions
-since 2.3 have AFS=yes on by default, except for m88k).
-
-If you are using MIT-Kerberos or CNS Kerberos you can find a replacement
-for libkafs in http://web.mit.edu/openafs/krbafs/. Then you
-need to use the --with-krbafs=dir option when running configure.
-Thanks to Derrick J Brashear <shadow@dementia.org> and Alexandra
-Ellwood <lxs@mit.edu> for making this available for the MIT kerberos
-users.
-
-If you don't have Kerberos, you should still be able to test that it
-works, but there's not much point in running unauthenticated, and it's
-not very tested.
-
-7. How do I compile/install/start arla?
-
-See the file INSTALL
-
-8. What do I do when I find a bug?
-
-Report it with as much detail as possible (including patches) to
-<arla-drinkers@stacken.kth.se>.
-
-If you find a bug, and do not have a clue what is wrong, please run
-arlad with `arlad -n -z --debug=almost-all' and append the output the
-the mail. You can also turn on debug on an already running arlad with
-`fs arladebug <debug-level>'. To enable debugging in the nnpfs kernel
-module, use `fs nnpfsdebug <debug-level>'. The output will end up in
-your syslog (like /var/log/messages or /var/adm/messages).
-
-If arlad crashes, at least run gdb on the core dump and do a `bt'.
-Print out variables around where it crashes if they seem useful. If
-you don't get a core dump, try starting arlad under gdb (the `-n'
-option is useful here) and then do the same thing when it crashes.
-
-If the kernel crashes, try to obtain a crash dump by whatever means
-your OS has for this and then run the debugger on it. The
-documentation on your OS should have more information on how to
-perform this task.
-
-Without this info we are probably as lost as you are.
-
-9. How do I adjust the amount of debug information?
-
-Both arlad and the nnpfs (the kernel module) have variables for
-controlling what type of debug messages should be printed.
-
-They are controlled by the `--debug' option to arlad and then by
-running `fs arladebug' and `fs nnpfsdebug'.
-
-10. How hard is it to port arla to a new operating system?
-
-It's not hard. The user-level code is quite portable and is not much
-different between different operating systems. The kernel module is
-system-specific but not that large and you can probably start with the
-one in `nnpfs/SYSTEM' that's most similar to your system. If you're
-interested in doing the port or even run Arla on an OS not mentioned
-above, send mail to
-<arla-drinkers@stacken.kth.se>.
-
-11. Known problems.
-
-OpenBSD on some architectures have serious problems with mmap. If arlad
-doesn't seem to work om your system run configure with `--disable-mmap'.
-This problem has only been noticed on sun4m platforms.
-
-The same problem exists on Mac OS X 10.1 (Darwin 1.4). Use the
---disable-mmap option.
-
-If you have problems with stale data cached or arlad is misbehaving a
-lot try zapping the entire cache directory (`/usr/arla/cache' per
-default) and restarting arlad.
-
-12. How can I help?
-
-With code. Send us bug-reports and/or patches.
-
-13. Are there any mailing lists for arla?
-
-arla-drinkers@stacken.kth.se general discussion
-arla-announce@stacken.kth.se only announcements
-
-Send mail to <LIST>-request@stacken.kth.se to subscribe.
-
-14. Is there a web page?
-
-Yes, http://www.stacken.kth.se/project/arla/
-
-15. Are there any copyrights on parts of arla?
-
-lwp and rx are copyrighted by IBM. We're grateful to Derrick J
-Brashear <shadow@dementia.org> and Jim Doyle <jrd@bu.edu> for making
-them available.
-
-The rxkad implementation was written by Björn Grönvall <bg@sics.se>
-and is also part of the kth-krb distribution.
-
-editline was written by Simmule Turner and Rich Salz.
-
-The code for disconnected operation was written by Wuwei Shen.
-
-The code for gluing these together were written by ourselves.
-
-<arla-drinkers@stacken.kth.se>
-
-16. What has changed since *?
-
-See NEWS and ChangeLog.
-
-17. What does `arla' mean?
-
-- Arla in Swedish means `early'. Most of the code has been written
-early in the morning.
-
-- Arla is also the name of the largest producer of dairy products in
-Sweden. They produce, among others, a milk product called `fil'
-(filmjölk = sour milk) which also happens to be the swedish word for
-`file'.
diff --git a/usr.sbin/afs/src/THANKS b/usr.sbin/afs/src/THANKS
deleted file mode 100644
index e44d5499855..00000000000
--- a/usr.sbin/afs/src/THANKS
+++ /dev/null
@@ -1,62 +0,0 @@
-The following persons have sent in bug reports, fixes, patches or
-contributed in some other way.
-
-If you have done something and are not mentioned here, please send
-mail to <arla-drinkers@stacken.kth.se>.
-
-If you are mentioned here and have not contributed, that's because we
-expect you to.
-
-Aaron M. Ucko <amu@MIT.EDU>
-Alec Wolman <wolman@cs.washington.edu>
-Alexandra Ellwood <lxs@MIT.EDU>
-Brad Keryan <keryan@andrew.cmu.edu>
-Chaskiel Grundman
-Constantine Sapuntzakis <csapuntz@openbsd.org>
-Dan Winship <danw@MIT.EDU>
-Derrick J Brashear <shadow@dementia.org>
-Harald Barth <haba@pdc.kth.se>
-Jim Doyle <jrd@bu.edu>
-John Davison <davisoja@clarkson.edu>
-John Hawkinson <jhawk@MIT.EDU>
-Karl Ramm <kcr@MIT.EDU>
-Mark Eichin <eichin@kitten.gen.ma.us>
-Per Boussard T/ED <Per.Boussard@era-t.ericsson.se>
-Dima Ruban <dima@best.net>
-Max <davros@cyclone.Stanford.EDU>
-Andrzej Filinski <andrzej@daimi.aau.dk>
-Chuck Lever <chuckl@netscape.com>
-WUWEI SHEN <wwshen@engin.umich.edu>
-Cheng Jin <chengjin@eecs.umich.edu>
-Paul Callaway <pcallawa@umich.edu>
-Brandon S. Allbery <allbery@ece.cmu.edu>
-Ken Raeburn <raeburn@raeburn.org>
-Jeffrey Hutzelman <jhutz+@cmu.edu>
-Hee-Seok Heo <hsheo@postech.ac.kr>
-Paul Ewing Jr. <ewing@ima.umn.edu>
-Niklas Hallqvist <niklas@appli.se>
-Marko Asplund <aspa@hip.fi>
-Christopher Wing <wingc@engin.umich.edu>
-Simon Josefsson <jas@pdc.kth.se>
-Magnus Lindström <magnus.lindstrom@s3.kth.se>
-Greg Stark <gsstark@mit.edu>
-Matt <deberg@mit.edu>
-Björn Grönvall <bg@sics.se>
-Tino Schwarze <tino.schwarze@informatik.tu-chemnitz.de>
-David Sanderson <david@transarc.ibm.com>
-Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
-Michael Sperber <sperber@informatik.uni-tuebingen.de>
-Dr. Lex Wennmacher <wennmach@geo.Uni-Koeln.DE>
-Janne Johansson <jj@dynarc.se>
-Dr A V Le Blanc <LeBlanc@mcc.ac.uk>
-Dave Morrison <dave@bnl.gov>
-Jochen Saile <saile@sfs.nphil.uni-tuebingen.de>
-Chris Kuklewicz <chrisk@MIT.EDU>
-Nickolai Zeldovich <kolya@MIT.EDU>
-Adam Thornton <adam@sinenomine.net>
-Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
-Hidvegi <hzoli@austin.ibm.com>
-Todd T. Fries <todd@fries.net>
-Andrea Campi <andrea@webcom.it>
-William Uther <will+@cs.cmu.edu>
-Richard Nyberg <rnyberg@it.su.se>
diff --git a/usr.sbin/afs/src/TODO b/usr.sbin/afs/src/TODO
deleted file mode 100644
index 79f007e9f71..00000000000
--- a/usr.sbin/afs/src/TODO
+++ /dev/null
@@ -1,90 +0,0 @@
-
- $KTH: TODO,v 1.140 2001/01/07 18:36:47 lha Exp $
-
- Release 0.36:
- Check Solaris
- SMP
- xfs_map/xfs_getpage (check why patch doesn't work)
- Linux
- webserver (symlink loose contents)
-
- Release 0.35:
- MacOS X
- run-tests
- ran (find fd/vnode leek)
- Check with E people is bugs are fixed (rename of volume, ...)
-
- TODO-list, in no particular order.
-
-Please mail arla-drinkers@stacken.kth.se if you want to work on
-any of these things so we don't do double work.
-
-- fix weirdness with fake mount points
- installattr (token w/o data) (ls -l ; ls foo ; ls bar)
-
-arlad: add regular pinging of file servers
-
-fs flushall:
--volume ?
-is this really good ?
-
-xfs/linux:
-check that we DTRT wrt Documentation/filesystem/Locking.txt
-
-xfs/*: teach xfs to read AFS directories for readdir
-
-xfs/linux: check if we can hook into vm_operations/address_space to
-figure out when cache pages are dirty and need to flushed.
-
-*/Makefile.in: allow creation of shared libraries
-
-*/Makefile.in: homogenize
-
-arlad/xfs: return from open before fetching the whole file
-
-arlad/xfs: cache in blocks (iff ?) file too large to fit in cache ?
-
-arlad/xfs: implement advisory locking
-
-arlad: more improvements on writing in disconnected mode
-
-arlad: fallback to disconnected mode if networking is not working (possibly per cell)
-
-arlad: more consistency checks before recovering state
-
-arlad: remove unused stuff from FCacheEntry
-
-xfs/aix: figure out where the PAG should be stored
-
-xfs/irix: fix syscall and implement setgroups wrapper
-
-xfs/irix: port to Irix 6.5
-
-xfs/solaris: verify multithreadness, merge xnode and vnode mutex locks
-
-xfs/sunos: implement setgroups wrapper
-
-xfs: support building as part of the kernel
-
-OPTIMIZATIONS
-
-This is a list of posible optimizations that could be done to different parts
-of arla.
-
- - Delay reads and writes to cache and AFS-servers. Make the more operations
- in one batch. (possible with rx?) Especially directories don't have to be
- synced for every operation.
-
- - send more messages to/from arlad in one sweep. (lookup on whole path in one
- message, getattr+getdata, etc..)
-
-MILKO
-
-Filbunke, the nnp-class-server generation:
-- callbacks
-- logging
-- fsck/salvage, stability, more tests
-- SPEED, real i*op
-- volser (?)
-- pts,vldb
-- security
diff --git a/usr.sbin/afs/src/acconfig.h b/usr.sbin/afs/src/acconfig.h
deleted file mode 100644
index 7bc6a5ca8c6..00000000000
--- a/usr.sbin/afs/src/acconfig.h
+++ /dev/null
@@ -1,36 +0,0 @@
-@BOTTOM@
-
-/* RCSID */
-#define RCSID(msg) \
-static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
-
-/* Maximum values on all known systems */
-#define MaxHostNameLen (64+4)
-#define MaxPathLen (1024+4)
-
-/* we always have stds.h */
-#define HAVE_STDS_H
-
-/*
- * Defintions that are ugly but needed to get all the symbols used
- */
-
-/*
- * Defining this enables lots of useful (and used) extensions on
- * glibc-based systems such as Linux
- */
-
-#define _GNU_SOURCE
-
-/*
- * Defining this enables us to get the definition of `sigset_t' and
- * other importatnt definitions on Solaris.
- */
-
-#ifndef __EXTENSIONS__
-#define __EXTENSIONS__
-#endif
-
-#ifndef HAVE___ATTRIBUTE__
-#define __attribute__(x)
-#endif
diff --git a/usr.sbin/afs/src/acinclude.m4 b/usr.sbin/afs/src/acinclude.m4
deleted file mode 100644
index bd8d651a530..00000000000
--- a/usr.sbin/afs/src/acinclude.m4
+++ /dev/null
@@ -1,9 +0,0 @@
-dnl $KTH: acinclude.m4,v 1.1 1999/05/15 22:48:04 assar Exp $
-dnl
-dnl Only put things that for some reason can't live in the `cf'
-dnl directory in this file.
-dnl
-
-dnl $KTH: misc.m4,v 1.1 1997/12/14 15:59:04 joda Exp $
-dnl
-define(upcase,`echo $1 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`)dnl
diff --git a/usr.sbin/afs/src/appl/Makefile.in b/usr.sbin/afs/src/appl/Makefile.in
deleted file mode 100644
index 5db5bcf895c..00000000000
--- a/usr.sbin/afs/src/appl/Makefile.in
+++ /dev/null
@@ -1,50 +0,0 @@
-# $KTH: Makefile.in,v 1.63.2.1 2001/10/23 23:30:31 ahltorp Exp $
-
-srcdir = @srcdir@
-top_builddir = ..
-VPATH = @srcdir@
-
-SHELL = /bin/sh
-
-SUBDIRS = lib @APPL_SUBDIRS@ pts udebug vos bos
-
-all:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-clean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-realclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-distclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-mostlyclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-install:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-uninstall:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-Makefile: Makefile.in ../config.status
- cd .. ; CONFIG_FILES=appl/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-
-.PHONY: all clean realclean distclean mostlyclean install uninstall
diff --git a/usr.sbin/afs/src/appl/aafs-perl/AAFS.pm b/usr.sbin/afs/src/appl/aafs-perl/AAFS.pm
deleted file mode 100644
index 9a1e80c4826..00000000000
--- a/usr.sbin/afs/src/appl/aafs-perl/AAFS.pm
+++ /dev/null
@@ -1,56 +0,0 @@
- #
- # Copyright (c) 2002, Stockholms Universitet
- # (Stockholm University, Stockholm Sweden)
- # All rights reserved.
- #
- # Redistribution and use in source and binary forms, with or without
- # modification, are permitted provided that the following conditions
- # are met:
- #
- # 1. Redistributions of source code must retain the above copyright
- # notice, this list of conditions and the following disclaimer.
- #
- # 2. Redistributions in binary form must reproduce the above copyright
- # notice, this list of conditions and the following disclaimer in the
- # documentation and/or other materials provided with the distribution.
- #
- # 3. Neither the name of the university nor the names of its contributors
- # may be used to endorse or promote products derived from this software
- # without specific prior written permission.
- #
- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- # POSSIBILITY OF SUCH DAMAGE.
-
-
-#include "EXTERN.h"
-#include "perl.h"
-#include "XSUB.h"
-
-package AAFS;
-
-BEGIN { require 5.004_04 }
-
-use strict;
-use vars qw($VERSION @ISA @EXPORT $AUTOLOAD);
-
-require Exporter;
-require DynaLoader;
-@ISA = qw(Exporter DynaLoader);
-@EXPORT = qw(aafs_cell_create
- aafs_volume_create
- aafs_volume_examine_nvldb
- );
-
-$AAFS::VERSION = sprintf("%d.%02d", q/0.1/ =~ /(\d+)\.(\d+)/);
-
-bootstrap AAFS;
-1;
diff --git a/usr.sbin/afs/src/appl/aafs-perl/AAFS.xs b/usr.sbin/afs/src/appl/aafs-perl/AAFS.xs
deleted file mode 100644
index 1389f833b8a..00000000000
--- a/usr.sbin/afs/src/appl/aafs-perl/AAFS.xs
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "EXTERN.h"
-#include "perl.h"
-#include "XSUB.h"
-
-#include <vldb.h>
-#include <volumeserver.h>
-
-#include <aafs/aafs_cell.h>
-#include <aafs/aafs_volume.h>
-#include <aafs/aafs_vldb.h>
-
-#include <ko.h>
-
-typedef struct aafs_cell aafs_cell;
-typedef struct aafs_volume aafs_volume;
-
-static void
-hv_store_val(HV *h, char *k, int32_t val)
-{
- hv_store(h, k, strlen(k), newSViv(val), 0);
-}
-
-static void
-hv_store_str(HV *h, char *k, const char *str)
-{
- hv_store(h, k, strlen(k), newSVpvn(str, strlen(str)), 0);
-}
-
-
-MODULE = AAFS PACKAGE = AAFS
-
-aafs_cell *
-aafs_cell_create(cell, sec_type = 0)
- char *cell
- int sec_type
- PREINIT:
- aafs_cell *c;
- CODE:
- aafs_init(NULL); /* XXX */
- if (aafs_cell_create(cell, sec_type, &c) != 0)
- XSRETURN_UNDEF;
- RETVAL = c;
- OUTPUT:
- RETVAL
-
-
-aafs_volume *
-aafs_volume_create(cell, name, flags = 0)
- aafs_cell *cell
- char *name
- int flags
- PREINIT:
- struct aafs_volume *v;
- int error;
- CODE:
- error = aafs_volume_create(cell, name, flags, &v);
- if (error)
- XSRETURN_UNDEF;
- RETVAL = v;
- OUTPUT:
- RETVAL
-
-HV *
-aafs_volume_examine_nvldb(volume)
- aafs_volume *volume
- PREINIT:
- HV *h, *sh;
- AV *s;
- int error, i;
- struct nvldbentry vldb;
- CODE:
- error = aafs_volume_examine_nvldb(volume, 0, &vldb);
- if (error)
- XSRETURN_UNDEF;
-
- h = (HV *)sv_2mortal((SV *)newHV());
-
- hv_store_str(h, "name", vldb.name);
- hv_store_val(h, "nServers", vldb.nServers);
- s = (AV *)sv_2mortal((SV *)newAV());
- for (i = 0; i < vldb.nServers; i++) {
- sh = (HV *)sv_2mortal((SV *)newHV());
- hv_store_val(sh, "number", vldb.serverNumber[i]);
- hv_store_val(sh, "partition", vldb.serverPartition[i]);
- hv_store_val(sh, "serverFlags", vldb.serverFlags[i]);
- av_push(s, newRV((SV *)sh));
- }
- hv_store(h, "Servers", 7, newRV((SV *)s), 0);
- if (vldb.volumeId[RWVOL])
- hv_store_val(h, "RW-ID", vldb.volumeId[RWVOL]);
- if (vldb.volumeId[ROVOL])
- hv_store_val(h, "RO-ID", vldb.volumeId[ROVOL]);
- if (vldb.volumeId[BACKVOL])
- hv_store_val(h, "BU-ID", vldb.volumeId[BACKVOL]);
- if (vldb.cloneId)
- hv_store_val(h, "Clone-ID", vldb.cloneId);
- hv_store_val(h, "flags", vldb.flags & VLOP_ALLOPERS);
- hv_store_val(h, "matchindex", vldb.matchindex);
-
- RETVAL = h;
- OUTPUT:
- RETVAL
-
-
-AV *
-aafs_volume_examine_info(volume, flags = VOL_EXA_VOLINFO_ALL)
- aafs_volume *volume
- int flags
- PREINIT:
- struct aafs_volume_info *info;
- struct aafs_volume_info_ctx *ctx;
- struct aafs_volume_info_entry *se;
- struct aafs_server *server;
- aafs_partition partition;
- struct aafs_site *site;
- xvolintInfo v;
- int error, i;
- HV *sh;
- AV *s, *es;
- CODE:
- error = aafs_volume_examine_info(volume, flags, &info);
- if (error)
- XSRETURN_UNDEF;
-
- s = (AV *)sv_2mortal((SV *)newAV());
-
- for (se = aafs_volume_info_first(info, &ctx);
- se != NULL;
- se = aafs_volume_info_next(ctx))
- {
- char sn[1024], pn[30];
-
- sh = (HV *)sv_2mortal((SV *)newHV());
-
- av_push(s, newRV((SV *)sh));
-
- site = aafs_volume_info_get_site(se);
-
- server = aafs_site_server(site);
- partition = aafs_site_partition(site);
-
- aafs_server_get_name(server, sn, sizeof(sn));
- aafs_partition_name(partition, pn, sizeof(pn));
-
- hv_store_str(sh, "Server", sn);
- hv_store_str(sh, "Partition", pn);
-
- aafs_object_unref(server, "server");
- aafs_object_unref(site, "site");
-
- aafs_volume_info_get_volinfo(se, &v);
-
- hv_store_str(sh, "Status",
- v.status == VOK ? "On-line" : "Busy");
- hv_store_str(sh, "Type",
- volumetype_from_volsertype(v.type));
- hv_store_val(sh, "Usage", v.size);
-
- if (v.status != VOK)
- continue;
-
- hv_store_val(sh, "MaxQuota", v.maxquota);
- hv_store_val(sh, "CreationDate", v.creationDate);
- hv_store_val(sh, "LastUpdate", v.updateDate);
- hv_store_val(sh, "NumAccess", v.dayUse);
- hv_store_val(sh, "FileCount", v.filecount);
-
- hv_store_val(sh, "FileCount", v.filecount);
-
- es = (AV *)sv_2mortal((SV *)newAV());
- for (i = 0; i < 4; i++)
- av_push(es, newRV(newSVnv(v.stat_reads[i])));
-
- hv_store(sh, "ReadStats", 9, (SV *)newRV((SV *)es), 0);
-
- es = (AV *)sv_2mortal((SV *)newAV());
- for (i = 0; i < 4; i++)
- av_push(es, newRV(newSVnv(v.stat_writes[i])));
-
- hv_store(sh, "WriteStats", 9, (SV *)newRV((SV *)es), 0);
- }
- aafs_volume_info_destroy_ctx(ctx);
-
- RETVAL = s;
-
- OUTPUT:
- RETVAL
-
-
-
-AV *
-aafs_vldb_query(cell, attrref)
- aafs_cell *cell
- SV * attrref
- PREINIT:
- struct aafs_vldb_query_attrs *attrs;
- struct aafs_server *server;
- struct aafs_vldb_list *ql;
- struct aafs_vldb_ctx *vq;
- struct aafs_volume *v;
- int error;
- HV *sh, *attr;
- AV *s, *es;
- SV **hs;
- CODE:
-
- if ((!SvROK(attrref))
- || (SvTYPE(SvRV(attrref)) != SVt_PVHV)) {
- crook(" attrref no pointer to hash\n");
- XSRETURN_UNDEF;
- }
-
- attr = (HV *)SvRV(attrref);
-
- s = (AV *)sv_2mortal((SV *)newAV());
-
- error = aafs_vldb_query_attr_create(&attrs);
- if (error)
- XSRETURN_UNDEF;
-
- hs = hv_fetch(attr, "-server", 7, 0);
-
- if (hs) {
- uint32_t server_number;
-
- if (!SvPOK(*hs)) {
- XSRETURN_UNDEF;
- aafs_vldb_query_attr_free(attrs);
- }
-
- error = aafs_server_create_by_name(cell,
- SvPV_nolen(*hs), &server);
- if (error) {
- aafs_vldb_query_attr_free(attrs);
- XSRETURN_UNDEF;
- }
-
- error = aafs_server_get_long(server, &server_number);
- if (error) {
- aafs_object_unref(server, "server");
- aafs_vldb_query_attr_free(attrs);
- XSRETURN_UNDEF;
- }
- aafs_vldb_query_attr_set_server(attrs, ntohl(server_number));
- }
-
- hs = hv_fetch(attr, "-partition", 10, 0);
- if (hs) {
- if (!SvPOK(*hs)) {
- aafs_vldb_query_attr_free(attrs);
- XSRETURN_UNDEF;
- }
- aafs_vldb_query_attr_set_partition(attrs,
- aafs_partition_from_name(SvPV_nolen(*hs)));
- }
-
- error = aafs_vldb_query(cell, attrs, &ql);
- if (error) {
- aafs_vldb_query_attr_free(attrs);
- XSRETURN_UNDEF;
- }
-
- aafs_vldb_query_attr_free(attrs);
-
- for (v = aafs_vldb_iterate_first(ql, &vq);
- v != NULL;
- v = aafs_vldb_iterate_next(vq))
- {
- SV *sv = sv_newmortal();
- sv_setref_pv(sv, "aafs_volumePtr", (void*)v);
- av_push(s, newRV(sv));
- }
-
- aafs_vldb_iterate_done(vq);
- aafs_vldb_query_free(ql);
-
- RETVAL = s;
-
- OUTPUT:
- RETVAL
-
-
-
-MODULE = AAFS PACKAGE = aafs_cellPtr PREFIX = aafsc_
-
-void
-aafsc_DESTROY(cell)
- aafs_cell * cell
- CODE:
-
-MODULE = AAFS PACKAGE = aafs_volumePtr PREFIX = aafsv_
-
-void
-aafsv_DESTROY(volume)
- aafs_volume * volume
- CODE:
- aafs_volume_free(volume);
diff --git a/usr.sbin/afs/src/appl/aafs-perl/su/check-home.pl b/usr.sbin/afs/src/appl/aafs-perl/su/check-home.pl
deleted file mode 100644
index 25c1ac86c94..00000000000
--- a/usr.sbin/afs/src/appl/aafs-perl/su/check-home.pl
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/pkg/bin/perl -w
-# $arla: check-home.pl,v 1.1 2002/06/03 02:03:43 lha Exp $
-
-use strict;
-use AAFS;
-
-my $cell = AAFS::aafs_cell_create("su.se");
-
-my $vldblist = AAFS::aafs_vldb_query($cell, {});
-
-my @foo = grep {
- &AAFS::aafs_volume_examine_nvldb($$_)->{'name'} =~ /user\..*/;
-} @$vldblist;
-
-print "Found ", $#foo, " entries.\n";
-
-foreach my $v (@foo) {
- my $q = AAFS::aafs_volume_examine_nvldb($$v);
-
- my $info = AAFS::aafs_volume_examine_info($$v, 1);
-
- my $p; my $warn = "";
- if ($info->[0]->{'MaxQuota'} eq 0) {
- $p = sprintf("Unlimited (using %d MB)", $info->[0]->{'Usage'} / 1000);
- } else {
- $p = sprintf("%2.1f %%",
- $info->[0]->{'Usage'} / $info->[0]->{'MaxQuota'} * 100);
- if ($info->[0]->{'Usage'} / $info->[0]->{'MaxQuota'} > 0.95 &&
- abs($info->[0]->{'MaxQuota'} - $info->[0]->{'Usage'}) < 20000) {
- $warn = " <<<WARN";
- }
- }
-
- printf("%-30s\t%7s%s\n",
- $q->{name},
- $p, $warn);
-}
diff --git a/usr.sbin/afs/src/appl/aafs-perl/t/test.pl b/usr.sbin/afs/src/appl/aafs-perl/t/test.pl
deleted file mode 100644
index 0958ac245fc..00000000000
--- a/usr.sbin/afs/src/appl/aafs-perl/t/test.pl
+++ /dev/null
@@ -1,32 +0,0 @@
-# $arla: test.pl,v 1.1 2002/06/03 02:03:44 lha Exp $
-use AAFS;
-use Data::Dumper;
-
-my $cell = AAFS::aafs_cell_create("e.kth.se");
-
-my $vol = AAFS::aafs_volume_create($cell, "root.afs");
-
-my $vldb = AAFS::aafs_volume_examine_nvldb($vol);
-
-print "name ->>", $vldb->{'name'}, "<<- \n";
-
-print Dumper($vldb);
-
-my $info = AAFS::aafs_volume_examine_info($vol);
-
-print Dumper($info);
-
-my $query = {
- -server=>'mim.e.kth.se',
- -partition=>'/vicepe',
-};
-
-my $vldblist = AAFS::aafs_vldb_query($cell, $query);
-
-print "Found ", $#$vldblist, " entries.\n";
-
-foreach my $v (@$vldblist) {
- my $q = AAFS::aafs_volume_examine_nvldb($$v);
- print $q->{'name'}, ",";
-}
-print "\n";
diff --git a/usr.sbin/afs/src/appl/aafs-perl/typemap b/usr.sbin/afs/src/appl/aafs-perl/typemap
deleted file mode 100644
index d72f0cd23ba..00000000000
--- a/usr.sbin/afs/src/appl/aafs-perl/typemap
+++ /dev/null
@@ -1,4 +0,0 @@
-TYPEMAP
-
-aafs_cell * T_PTROBJ
-aafs_volume * T_PTROBJ
diff --git a/usr.sbin/afs/src/appl/aafs/aafs_cell.h b/usr.sbin/afs/src/appl/aafs/aafs_cell.h
deleted file mode 100644
index 2fa4b2e5f9b..00000000000
--- a/usr.sbin/afs/src/appl/aafs/aafs_cell.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef AAFS_CELL_H
-#define AAFS_CELL_H 1
-
-#include <aafs/aafs_security.h>
-#include <aafs/aafs_partition.h>
-
-#include <log.h>
-
-struct aafs_cell;
-struct aafs_uuid;
-struct aafs_server;
-
-/* a site is a server/partition combination */
-struct aafs_site;
-struct aafs_site_list;
-struct aafs_site_ctx; /* used when iterating over sites */
-
-struct afsUUID;
-
-int
-aafs_init(Log_method *log_method);
-
-int
-aafs_cell_create(const char *cell,
- aafs_sec_type sec_type,
- struct aafs_cell **);
-
-int
-aafs_cell_create_secobj(const char *cell,
- struct aafs_security *,
- struct aafs_cell **);
-
-int
-aafs_cell_rx_secclass(struct aafs_cell *cell,
- void *secobj, int *secidx);
-
-/* server commands */
-
-int
-aafs_server_create_by_name(struct aafs_cell *cell,
- const char *server,
- struct aafs_server **ret_server);
-
-int
-aafs_server_create_by_long(struct aafs_cell *cell,
- uint32_t server,
- struct aafs_server **ret_server);
-
-int
-aafs_server_get_long(struct aafs_server *server,
- uint32_t *server_number);
-
-char *
-aafs_server_get_name(struct aafs_server *server, char *buf, size_t sz);
-
-void
-aafs_server_free(struct aafs_server *server);
-
-
-/* site commands */
-
-int
-aafs_site_create(struct aafs_cell *,
- struct aafs_server *server,
- aafs_partition partition,
- struct aafs_site **);
-
-void
-aafs_site_free(struct aafs_site *);
-
-char *
-aafs_site_print(struct aafs_site *site, char *buf, size_t sz);
-
-struct aafs_server *
-aafs_site_server(struct aafs_site *);
-
-aafs_partition
-aafs_site_partition(struct aafs_site *);
-
-struct aafs_site *
-aafs_site_iterate_first(struct aafs_site_list *,
- struct aafs_site_ctx **);
-
-struct aafs_site *
-aafs_site_iterate_next(struct aafs_site_ctx *);
-
-void
-aafs_site_iterate_done(struct aafs_site_ctx *);
-
-/*
- * Cell db communication functions
- */
-
-struct rx_connection;
-struct aafs_cell_db_ctx;
-
-struct rx_connection *
-aafs_cell_first_db(struct aafs_cell *cell,
- int port,
- int service,
- struct aafs_cell_db_ctx **ret_context);
-
-struct rx_connection *
-aafs_cell_next_db(struct aafs_cell_db_ctx *ctx);
-
-int
-aafs_cell_try_next_db (int error);
-
-void
-cell_db_free_context(struct aafs_cell_db_ctx *ctx);
-
-#endif /* AAFS_CELL_H */
diff --git a/usr.sbin/afs/src/appl/aafs/aafs_conn.h b/usr.sbin/afs/src/appl/aafs/aafs_conn.h
deleted file mode 100644
index 55929af5db2..00000000000
--- a/usr.sbin/afs/src/appl/aafs/aafs_conn.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef AAFS_CONN_H
-#define AAFS_CONN_H 1
-
-struct rx_connection;
-
-struct rx_connection *
-aafs_conn_byaddr(struct aafs_cell *cell,
- struct sockaddr *so,
- socklen_t slen,
- short port,
- uint32_t service);
-
-struct rx_connection *
-aafs_conn_byname(struct aafs_cell *cell,
- const char *hostname,
- short port,
- uint32_t service);
-
-struct rx_connection *
-aafs_conn_byserver(struct aafs_server *server,
- short port,
- uint32_t service);
-
-
-void
-aafs_conn_free(struct rx_connection *);
-
-#endif /* AAFS_CONN_H */
diff --git a/usr.sbin/afs/src/appl/aafs/aafs_partition.h b/usr.sbin/afs/src/appl/aafs/aafs_partition.h
deleted file mode 100644
index 05abca4131a..00000000000
--- a/usr.sbin/afs/src/appl/aafs/aafs_partition.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef AAFS_PARTITION_H
-#define AAFS_PARTITION_H 1
-
-typedef int aafs_partition;
-
-aafs_partition
-aafs_partition_from_name(const char *partition);
-
-aafs_partition
-aafs_partition_from_number(int32_t partition);
-
-char *
-aafs_partition_name(aafs_partition, char *buf, size_t sz);
-
-int
-aafs_partition_validate(const char *partition);
-
-#endif /* AAFS_PARTITION_H */
diff --git a/usr.sbin/afs/src/appl/aafs/aafs_private.h b/usr.sbin/afs/src/appl/aafs/aafs_private.h
deleted file mode 100644
index 573d81a77ad..00000000000
--- a/usr.sbin/afs/src/appl/aafs/aafs_private.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#ifndef AAFS_PRIVATE_H
-#define AAFS_PRIVATE_H 1
-
-#include <aafs/aafs_cell.h>
-#include <fs.h>
-
-#include <log.h>
-
-struct aafs_object {
- const char *type;
- int refcount;
- void (*destruct)(void *, const char *);
-};
-
-void *aafs_object_create(size_t, const char *, void (*)(void *, const char *));
-void *aafs_object_ref(void *, const char *type);
-void aafs_object_unref(void *, const char *type);
-
-void *aafs_cell_ref(struct aafs_cell *);
-void aafs_cell_unref(struct aafs_cell *);
-
-struct aafs_cell;
-
-struct aafs_server {
- struct aafs_object obj;
- struct aafs_cell *cell;
- unsigned flags;
-#define SERVER_HAVE_ADDR 1
-#define SERVER_HAVE_UUID 2
- int num_addr;
- struct site_addr {
- struct sockaddr_storage addr;
- int addrlen;
- } *addr;
- afsUUID uuid;
-};
-
-
-#endif /* AAFS_CELL_H */
diff --git a/usr.sbin/afs/src/appl/aafs/aafs_security.h b/usr.sbin/afs/src/appl/aafs/aafs_security.h
deleted file mode 100644
index 1cb3dba274e..00000000000
--- a/usr.sbin/afs/src/appl/aafs/aafs_security.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef AAFS_SECURITY_H
-#define AAFS_SECURITY_H 1
-
-struct aafs_security;
-
-typedef enum {
- AAFS_SEC_NULL,
- AAFS_SEC_KAD,
- AAFS_SEC_GSS,
- AAFS_SEC_ANY
-} aafs_sec_type;
-
-struct aafs_security *
-aafs_security_create(aafs_sec_type type, const char *cell);
-
-#if 0
-struct aafs_security *
-aafs_security_create_null(const char *cell);
-
-struct aafs_security *
-aafs_security_create_kad_pass(const char *cell, const char *user, const char *pw);
-
-struct aafs_security *
-aafs_security_create_kad_cred(const char *cell);
-#endif
-
-int
-aafs_security_rx_secclass(struct aafs_security *sec,
- void *secobj, int *secidx);
-
-#endif /* AAFS_SECURITY_H */
diff --git a/usr.sbin/afs/src/appl/aafs/aafs_vldb.h b/usr.sbin/afs/src/appl/aafs/aafs_vldb.h
deleted file mode 100644
index feec8126c25..00000000000
--- a/usr.sbin/afs/src/appl/aafs/aafs_vldb.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef AAFS_VLDB_H
-#define AAFS_VLDB_H 1
-
-#include <aafs/aafs_cell.h>
-#include <aafs/aafs_volume.h>
-
-struct aafs_vldb_list;
-struct aafs_vldb_ctx;
-
-struct aafs_vldb_query_attrs;
-
-int
-aafs_vldb_query(struct aafs_cell *cell,
- struct aafs_vldb_query_attrs *attrs,
- struct aafs_vldb_list **query);
-
-int
-aafs_vldb_query_free(struct aafs_vldb_list *query);
-
-int
-aafs_vldb_query_attr_create(struct aafs_vldb_query_attrs **attrs);
-
-int
-aafs_vldb_query_attr_set_partition(struct aafs_vldb_query_attrs *attrs,
- aafs_partition partition);
-
-int
-aafs_vldb_query_attr_set_server(struct aafs_vldb_query_attrs *attrs,
- uint32_t server);
-
-#ifdef not_yet
-int
-aafs_vldb_query_attr_set_uuid(struct aafs_vldb_query_attrs *attrs,
- afsUUID *uuid);
-#endif
-
-int
-aafs_vldb_query_attr_set_volumeid(struct aafs_vldb_query_attrs *attrs,
- int32_t volumeid);
-
-int
-aafs_vldb_query_attr_set_flag(struct aafs_vldb_query_attrs *attrs,
- int32_t flag);
-
-int
-aafs_vldb_query_attr_free(struct aafs_vldb_query_attrs *attrs);
-
-struct aafs_volume *
-aafs_vldb_iterate_first(struct aafs_vldb_list *,
- struct aafs_vldb_ctx **);
-
-struct aafs_volume *
-aafs_vldb_iterate_next(struct aafs_vldb_ctx *);
-
-void
-aafs_vldb_iterate_done(struct aafs_vldb_ctx *);
-
-#endif /* AAFS_VLDB_H */
diff --git a/usr.sbin/afs/src/appl/aafs/aafs_volume.h b/usr.sbin/afs/src/appl/aafs/aafs_volume.h
deleted file mode 100644
index ae0203625d8..00000000000
--- a/usr.sbin/afs/src/appl/aafs/aafs_volume.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef AAFS_VOLUME_H
-#define AAFS_VOLUME_H 1
-
-#include <aafs/aafs_cell.h>
-
-struct aafs_volume;
-
-/*
- * create a `volume' object for `volumename' in `cell' with `flags',
- * volume information is fetched from the vldb and volser when needed
- */
-
-int
-aafs_volume_create(struct aafs_cell *cell,
- const char *volumename,
- unsigned long flags,
- struct aafs_volume **volume);
-
-#define AAFS_VOL_CREATE_CREATE 1
-#define AAFS_VOL_CREATE_NO_CANONICALIZE 2
-
-int
-aafs_volume_attach(struct aafs_cell *cell,
- unsigned long flags,
- nvldbentry *vldb,
- struct aafs_volume **volume);
-
-
-void
-aafs_volume_free(struct aafs_volume *volume);
-
-char *
-aafs_volume_name(struct aafs_volume *volume, char *volname, size_t sz);
-
-int
-aafs_volume_examine_nvldb(struct aafs_volume *volume,
- unsigned long flags,
- struct nvldbentry *vldb);
-
-int
-aafs_volume_print_nvldb(struct aafs_volume *volume, FILE *f,
- unsigned long flags);
-
-#define VOL_PRINT_VLDB_SKIP_NAME 1
-
-struct aafs_volume_info;
-struct aafs_volume_info_entry;
-struct aafs_volume_info_ctx;
-
-int
-aafs_volume_examine_info(struct aafs_volume *volume,
- unsigned long flags,
- struct aafs_volume_info **info);
-
-#define VOL_EXA_VOLINFO_RW 1
-#define VOL_EXA_VOLINFO_RO 2
-#define VOL_EXA_VOLINFO_BU 4
-
-#define VOL_EXA_VOLINFO_ALL (VOL_EXA_VOLINFO_RW|VOL_EXA_VOLINFO_RO|VOL_EXA_VOLINFO_BU)
-
-struct aafs_volume_info_entry *
-aafs_volume_info_first(struct aafs_volume_info *,
- struct aafs_volume_info_ctx **);
-
-struct aafs_volume_info_entry *
-aafs_volume_info_next(struct aafs_volume_info_ctx *ctx);
-
-int
-aafs_volume_info_destroy_ctx(struct aafs_volume_info_ctx *);
-
-struct aafs_site *
-aafs_volume_info_get_site(struct aafs_volume_info_entry *);
-
-int
-aafs_volume_info_get_volinfo(struct aafs_volume_info_entry *, xvolintInfo *);
-
-#define AAFS_VOLUME_INFO_ENTRY_OK 0
-#define AAFS_VOLUME_INFO_ENTRY_DEAD 1
-
-int
-aafs_volume_status_print(FILE *f, int flags,
- struct aafs_volume_info_entry *status);
-
-#define AAFS_VOLUME_STATUS_PRINT_EXTENDED 1
-#define AAFS_VOLUME_STATUS_PRINT_SUMMERY 2
-
-int
-aafs_volume_status_have_type(struct aafs_volume *volume,
- int volume_type);
-int
-aafs_volume_sitelist(struct aafs_volume *,
- struct aafs_site_list **);
-
-
-/*
- * modification ops
- */
-
-int
-aafs_volume_add_readonly(struct aafs_volume *,
- struct aafs_site *);
-
-int
-aafs_volume_remove_readonly(struct aafs_volume *,
- struct aafs_site *);
-
-int
-aafs_volume_move_readwrite(struct aafs_volume *volume,
- struct aafs_site *site,
- unsigned long flags);
-
-#define AAFS_VOL_MOVE_MOVE_RO_TOO 0x01
-#define AAFS_VOL_MOVE_NO_RELEASE 0x02
-
-int
-aafs_volume_release(struct aafs_volume *volume,
- unsigned long flags);
-
-#define AFS_VOL_RELEASE_FORCE 0x1
-
-#if 0
-
-/* I'm not sure this interface should openly be provided to
- * consumers */
-
-int
-aafs_volume_zap(struct aafs_volume *volume,
- int voltype,
- struct aafs_site *site);
-int
-aafs_volume_vldbremove(struct aafs_volume *volume,
- int voltype,
- struct aafs_site *site);
-int
-aafs_volume_lock(struct aafs_volume *volume);
-int
-aafs_volume_unlock(struct aafs_volume *volume);
-
-#endif
-
-
-
-/*
- */
-
-#endif /* AAFS_VOLUME_H */
diff --git a/usr.sbin/afs/src/appl/aafs/cell.c b/usr.sbin/afs/src/appl/aafs/cell.c
deleted file mode 100644
index 175508add31..00000000000
--- a/usr.sbin/afs/src/appl/aafs/cell.c
+++ /dev/null
@@ -1,554 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <assert.h>
-#include <netdb.h>
-
-#include <aafs/aafs_cell.h>
-#include <aafs/aafs_conn.h>
-#include <aafs/aafs_private.h>
-#include <ko.h>
-#include <fs.h>
-#include <ubik.h>
-#include <afs_uuid.h>
-#include <ports.h>
-
-#include <log.h>
-
-#include <roken.h>
-
-struct aafs_cell {
- struct aafs_object obj;
- char *name;
- int last_good_server;
- struct aafs_security *sec;
-};
-
-/* a site is a server/partition combination */
-struct aafs_site {
- struct aafs_object obj;
- struct aafs_server *server;
- aafs_partition part;
-};
-
-struct aafs_site_list {
- int numsl;
- struct aafs_site *sl;
-};
-
-struct aafs_site_ctx {
- int current;
- struct aafs_site_list *list;
-};
-
-Log_method *aafs_log_method = NULL;
-
-
-int
-aafs_init(Log_method *log_method)
-{
- if (log_method == NULL)
- log_method = log_open(getprogname(), "/dev/stdout");
-
- aafs_log_method = log_method;
-
- cell_init(4711, aafs_log_method);
-
- rx_Init(0);
- ports_init();
-
- return 0;
-}
-
-static void
-cell_destruct(void *ptr, const char *name)
-{
- struct aafs_cell *c = ptr;
- if (c->name)
- free(c->name);
- if (c->sec)
- aafs_object_unref(c->sec, "sec");
-}
-
-int
-aafs_cell_create(const char *cellname,
- aafs_sec_type sec_type,
- struct aafs_cell **cell)
-{
- struct aafs_security *s;
- struct aafs_cell *c;
- cell_entry *e;
-
- *cell = NULL;
-
- if ((s = aafs_security_create(sec_type, cellname)) == NULL)
- return ENOENT;
-
- if ((e = cell_get_by_name(cellname)) == NULL) {
- aafs_object_unref(s, "sec");
- return ENOENT;
- }
-
- c = aafs_object_create(sizeof(*c), "cell", cell_destruct);
-
- if ((c->name = strdup(cellname)) == NULL) {
- aafs_object_unref(c, "cell");
- return ENOMEM;
- }
-
- if (cell_get_by_name(c->name) == NULL) {
- aafs_object_unref(c, "cell");
- return ENOENT;
- }
-
- c->sec = s;
-
- *cell = c;
-
- return 0;
-}
-
-int
-aafs_cell_create_secobj(const char *cell,
- struct aafs_security *,
- struct aafs_cell **);
-
-
-int
-aafs_cell_rx_secclass(struct aafs_cell *cell,
- void *secobj, int *secidx)
-{
- return aafs_security_rx_secclass(cell->sec, secobj, secidx);
-}
-
-
-void *
-aafs_cell_ref(struct aafs_cell *cell)
-{
- return aafs_object_ref(&cell->obj, "cell");
-}
-
-void
-aafs_cell_unref(struct aafs_cell *cell)
-{
- aafs_object_unref(cell, "cell");
-}
-
-static void
-server_destruct(void *ptr, const char *name)
-{
- struct aafs_server *s = ptr;
- if (s->cell)
- aafs_cell_unref(s->cell);
- if (s->addr)
- free(s->addr);
-}
-
-
-int
-aafs_server_create_by_name(struct aafs_cell *cell,
- const char *servername,
- struct aafs_server **ret_server)
-{
- struct aafs_server *server;
- struct addrinfo *res, *res0, hints;
- int ret, num_addr;
-
- *ret_server = NULL;
- server = aafs_object_create(sizeof(*server), "server", server_destruct);
-
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = 0;
- hints.ai_socktype = SOCK_STREAM;
- hints.ai_flags = AI_PASSIVE;
-
- server->cell = aafs_cell_ref(cell);
-
- ret = getaddrinfo(servername, NULL, &hints, &res0);
- if (ret) {
- aafs_object_unref(server, "server");
- return ret;
- }
-
- server->addr = NULL;
-
- for (res = res0, num_addr = 0; res; res = res->ai_next, num_addr++) {
- server->addr = erealloc(server->addr,
- (num_addr+1) * sizeof(struct site_addr));
- memcpy(&server->addr[num_addr].addr, res->ai_addr, res->ai_addrlen);
- server->addr[num_addr].addrlen = res->ai_addrlen;
- num_addr += 1;
- }
- server->num_addr = num_addr;
-
- freeaddrinfo(res0);
-
- server->flags = SERVER_HAVE_ADDR;
-
- *ret_server = server;
- return 0;
-}
-
-int
-aafs_server_create_by_long(struct aafs_cell *cell,
- uint32_t server_number,
- struct aafs_server **ret_server)
-{
- struct aafs_server *server;
- struct sockaddr_in *sin;
-
- *ret_server = NULL;
- server = aafs_object_create(sizeof(*server), "server", server_destruct);
-
- server->cell = aafs_cell_ref(cell);
-
- server->addr = malloc(sizeof(struct site_addr));
-
- server->addr[0].addrlen = sizeof(*sin);
-
- sin = (struct sockaddr_in *)&server->addr[0].addr;
- memset(sin, 0, sizeof(*sin));
-
- sin->sin_family = AF_INET;
-#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
- sin->sin_len = sizeof(*sin);
-#endif
- sin->sin_addr.s_addr = server_number;
-
- server->num_addr = 1;
-
- server->flags = SERVER_HAVE_ADDR;
-
- *ret_server = server;
- return 0;
-}
-
-char *
-aafs_server_get_name(struct aafs_server *server, char *buf, size_t sz)
-{
- int i, j, ret;
- int flags[] = { 0 , NI_NUMERICSERV };
-
- for (j = 0; j < sizeof(flags)/sizeof(flags[0]); j++) {
- for (i = 0; i < server->num_addr; i++) {
- ret = getnameinfo((struct sockaddr *)&server->addr[i].addr,
- server->addr[i].addrlen,
- buf, sz, NULL, 0, flags[j]);
- if (ret == 0)
- break;
- }
- if (ret == 0)
- break;
- }
- if (i == server->num_addr)
- snprintf(buf, sz, "<failed to find addr>");
- return buf;
-}
-
-int
-aafs_server_get_long(struct aafs_server *server,
- uint32_t *server_number)
-{
- struct sockaddr_in *sin;
- int i;
-
- *server_number = 0;
-
- if ((server->flags & SERVER_HAVE_ADDR) == 0)
- return ENOENT;
-
- for (i = 0; i < server->num_addr; i++) {
- sin = (struct sockaddr_in *)&server->addr[0].addr;
- if (sin->sin_family != AF_INET)
- break;
- *server_number = sin->sin_addr.s_addr;
- break;
- }
-
- if (i == server->num_addr)
- return ENOENT;
-
- return 0;
-}
-
-void
-aafs_server_free(struct aafs_server *s)
-{
- aafs_object_unref(s, "server");
-}
-
-/* site commands */
-
-static void
-site_destruct(void *ptr, const char *name)
-{
- struct aafs_site *s = ptr;
- aafs_object_unref(s->server, "server");
-}
-
-int
-aafs_site_create(struct aafs_cell *cell,
- struct aafs_server *server,
- aafs_partition partition,
- struct aafs_site **site)
-{
- struct aafs_site *s;
-
- *site = NULL;
-
- s = aafs_object_create(sizeof(*s), "site", site_destruct);
-
- s->server = aafs_object_ref(server, "server");
- s->part = partition;
-
- *site = s;
- return 0;
-}
-
-void
-aafs_site_free(struct aafs_site *site)
-{
- aafs_object_unref(site, "site");
-}
-
-char *
-aafs_site_print(struct aafs_site *site, char *buf, size_t sz)
-{
- char hn[NI_MAXHOST], pn[12];
- snprintf(buf, sz, "Server: %s\t\tPartition: %s",
- aafs_server_get_name(site->server, hn, sizeof(hn)),
- aafs_partition_name(site->part, pn, sizeof(pn)));
- return buf;
-}
-
-struct aafs_server *
-aafs_site_server(struct aafs_site *site)
-{
- return aafs_object_ref(site->server, "server");
-}
-
-aafs_partition
-aafs_site_partition(struct aafs_site *site)
-{
- return site->part;
-}
-
-
-struct aafs_site *
-aafs_site_iterate_first(struct aafs_site_list *,
- struct aafs_site_ctx **);
-
-struct aafs_site *
-aafs_site_iterate_enxt(struct aafs_site_ctx *);
-
-void
-aafs_site_iterate_done(struct aafs_site_ctx *);
-
-void *
-aafs_object_create(size_t sz, const char *type,
- void (*destruct)(void *, const char *))
-{
- void *ptr = malloc(sz);
- struct aafs_object *obj = ptr;
- if (ptr == NULL)
- errx(1, "out of memory when creating object for %s", type);
- memset(ptr, 0, sz);
- obj->type = type;
- obj->refcount = 1;
- obj->destruct = destruct;
- return ptr;
-}
-
-void *
-aafs_object_ref(void *p, const char *type)
-{
- struct aafs_object *obj = p;
- assert(obj);
- assert(strcmp(obj->type, type) == 0);
- assert(obj->refcount > 0);
- obj->refcount++;
- return obj;
-}
-
-void
-aafs_object_unref(void *p, const char *type)
-{
- struct aafs_object *obj = p;
- assert(obj);
- assert(strcmp(obj->type, type) == 0);
- assert(obj->refcount > 0);
- obj->refcount--;
- if (obj->refcount == 0) {
- if (obj->destruct)
- (*obj->destruct)(obj, type);
- free(obj);
- }
-}
-
-
-/*
- * DB server connection support warpper
- */
-
-struct aafs_cell_db_ctx {
- struct aafs_object obj;
- struct aafs_cell *cell;
- int port;
- int service;
- int nhosts;
- int curhost;
- struct aafs_cell_db_host {
- const char *hostname;
- struct rx_connection *conn;
- } *conns;
-};
-
-
-/*
- * Initialize `context' for a db connection to cell `cell', looping
- * over all db servers if `host' == NULL, and else just try that host.
- * `port', `service', and `auth' specify where and how the connection works.
- * Return a rx connection or NULL
- */
-
-static void
-celldb_destruct(void *ptr, const char *name)
-{
- struct aafs_cell_db_ctx *c = ptr;
- int i;
-
- aafs_cell_unref(c->cell);
-
- if (c->conns) {
- for (i = 0; i < c->nhosts; i++)
- aafs_conn_free(c->conns[i].conn);
- free(c->conns);
- }
-}
-
-
-struct rx_connection *
-aafs_cell_first_db(struct aafs_cell *cell,
- int port,
- int service,
- struct aafs_cell_db_ctx **ret_context)
-{
- const cell_entry *c_entry;
- struct aafs_cell_db_ctx *ctx;
- int i;
-
- *ret_context = NULL;
-
- c_entry = cell_get_by_name(cell->name);
- if (c_entry == NULL) {
- warn("Cannot find cell %s", cell->name);
- return NULL;
- }
- if (c_entry->ndbservers == 0) {
- warn("No DB servers for cell %s", cell->name);
- return NULL;
- }
-
- ctx = aafs_object_create(sizeof(*ctx), "cell-db",
- celldb_destruct);
-
- ctx->cell = aafs_cell_ref(cell);
- ctx->port = port;
- ctx->service = service;
-
- ctx->nhosts = c_entry->ndbservers;
-
- ctx->conns = malloc(ctx->nhosts * sizeof(struct aafs_cell_db_host));
- if (ctx->conns == NULL) {
- aafs_object_unref(ctx, "cell-db");
- return NULL;
- }
-
- for (i = 0; i < ctx->nhosts; i++) {
- ctx->conns[i].hostname = c_entry->dbservers[i].name;
- ctx->conns[i].conn = aafs_conn_byname(cell,
- ctx->conns[i].hostname,
- port,
- service);
- }
-
- ctx->curhost = -1;
- *ret_context = ctx;
- return aafs_cell_next_db(ctx);
-}
-
-/*
- * Return next connection from `context' or NULL.
- */
-
-struct rx_connection *
-aafs_cell_next_db(struct aafs_cell_db_ctx *ctx)
-{
- for (ctx->curhost += 1; ctx->curhost < ctx->nhosts; ctx->curhost += 1) {
- if (ctx->conns[ctx->curhost].conn)
- return ctx->conns[ctx->curhost].conn;
- }
- return NULL;
-}
-
-/*
- * return TRUE iff error makes it worthwhile to try the next db.
- */
-
-int
-aafs_cell_try_next_db (int error)
-{
- switch (error) {
- case ARLA_CALL_DEAD:
- case UNOTSYNC :
- case ENETDOWN :
- return TRUE;
- case 0 :
- default :
- return FALSE;
- }
-}
-
-/*
- * free all memory associated with `context'
- */
-
-void
-cell_db_free_context(struct aafs_cell_db_ctx *ctx)
-{
- aafs_object_unref(ctx, "cell-db");
-}
-
diff --git a/usr.sbin/afs/src/appl/aafs/conn.c b/usr.sbin/afs/src/appl/aafs/conn.c
deleted file mode 100644
index f9b4a890892..00000000000
--- a/usr.sbin/afs/src/appl/aafs/conn.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-
-#include <aafs/aafs_private.h>
-#include <aafs/aafs_cell.h>
-#include <aafs/aafs_conn.h>
-
-#include <rx/rx.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <netdb.h>
-
-#include <roken.h>
-
-#include <atypes.h>
-
-struct rx_connection *
-aafs_conn_byaddr(struct aafs_cell *cell,
- struct sockaddr *so,
- socklen_t slen,
- short port,
- uint32_t service)
-{
- uint32_t addr;
- struct rx_securityClass *secobj;
- int secidx;
-
- if (so->sa_family != PF_INET)
- return NULL;
-
- addr = ((struct sockaddr_in *)so)->sin_addr.s_addr;
-
- aafs_cell_rx_secclass(cell, &secobj, &secidx);
-
- return rx_NewConnection(addr, port, service, secobj, secidx);
-}
-
-struct rx_connection *
-aafs_conn_byserver(struct aafs_server *server,
- short port,
- uint32_t service)
-{
- struct rx_connection *conn;
- int i;
-
- if ((server->flags & SERVER_HAVE_ADDR) == 0)
- return NULL;
-
- if (server->num_addr <= 0)
- return NULL;
-
- for (i = 0; i < server->num_addr; i++) {
- conn = aafs_conn_byaddr(server->cell,
- (struct sockaddr *)&server->addr[i].addr,
- server->addr[i].addrlen,
- port, service);
- if (conn)
- return conn;
- }
- return NULL;
-}
-
-struct rx_connection *
-aafs_conn_byname(struct aafs_cell *cell,
- const char *hostname,
- short port,
- uint32_t service)
-{
- struct addrinfo hints, *res, *res0;
- struct rx_connection *conn = NULL;
- int error;
-
- memset (&hints, 0, sizeof(hints));
- hints.ai_family = 0;
- hints.ai_socktype = SOCK_DGRAM;
- hints.ai_flags = AI_PASSIVE;
-
- error = getaddrinfo(hostname, NULL, &hints, &res0);
- if (error) {
- fprintf (stderr, "Cannot find host %s\n", hostname);
- return NULL;
- }
-
- for(res = res0; res != NULL; res = res->ai_next) {
- switch(res->ai_family) {
-#ifdef RX_SUPPORTS_INET6
- case PF_INET6:
-#endif
- case PF_INET:
- conn = aafs_conn_byaddr(cell, res->ai_addr, res->ai_addrlen,
- port, service);
- break;
- }
- if (conn)
- break;
- }
-
- freeaddrinfo(res0);
-
- return conn;
-}
-
-void
-aafs_conn_free(struct rx_connection *conn)
-{
- free(conn);
-}
diff --git a/usr.sbin/afs/src/appl/aafs/partition.c b/usr.sbin/afs/src/appl/aafs/partition.c
deleted file mode 100644
index 390ee79a964..00000000000
--- a/usr.sbin/afs/src/appl/aafs/partition.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-
-#include <aafs/aafs_partition.h>
-
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#include <atypes.h>
-
-aafs_partition
-aafs_partition_from_name(const char *name)
-{
- int ret;
-
- if (strncmp(name, "/vicep", 6) == 0)
- name += 6;
- else if (strncmp(name, "vicep", 5) == 0)
- name += 5;
-
- if (*name == '\0')
- return -1;
-
- if(*(name+1) == '\0') {
- if(isalpha((unsigned char)*name)) {
- ret = tolower((unsigned char)*name) - 'a';
- } else
- return -1;
- } else if (name[2] == '\0') {
- if (isalpha((unsigned char)name[0])
- && isalpha((unsigned char)name[1])) {
- ret = 26 * (tolower((unsigned char)*(name)) - 'a' + 1)
- + tolower((unsigned char)*(name+1)) - 'a';
- } else
- return -1;
- } else
- return -1;
-
- if(ret > 255)
- return -1;
-
- return ret;
-}
-
-aafs_partition
-aafs_partition_from_number(int32_t partition)
-{
- return partition;
-}
-
-char *
-aafs_partition_name(aafs_partition id, char *buf, size_t sz)
-{
- if (id > 26 * 26)
- snprintf(buf, sz, "<invalid partition>");
- else if (id > 26)
- snprintf (buf, sz, "/vicep%c%c",
- 'a' + id / 26 - 1, 'a' + id % 26);
- else
- snprintf (buf, sz, "/vicep%c", 'a' + id);
-
- return buf;
-}
diff --git a/usr.sbin/afs/src/appl/aafs/security.c b/usr.sbin/afs/src/appl/aafs/security.c
deleted file mode 100644
index 64589eb853b..00000000000
--- a/usr.sbin/afs/src/appl/aafs/security.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <rx/rx.h>
-#include <rx/rx_null.h>
-
-#include <aafs/aafs_security.h>
-#include <aafs/aafs_cell.h>
-#include <aafs/aafs_private.h>
-
-struct aafs_security {
- struct aafs_object obj;
- aafs_sec_type type;
- struct rx_securityClass *secobj;
- int secidx;
-};
-
-static void
-sec_destruct(void *ptr, const char *name)
-{
- struct aafs_security *s = ptr;
- switch(s->type) {
- case AAFS_SEC_ANY:
- break;
- default:
- exit(-1);
- }
-}
-
-
-struct aafs_security *
-aafs_security_create(aafs_sec_type type, const char *cell)
-{
- struct aafs_security *sec;
- struct rx_securityClass *secobj;
- int secidx;
-
- switch(type) {
- case AAFS_SEC_NULL:
- case AAFS_SEC_ANY:
- secidx = 0;
- secobj = rxnull_NewClientSecurityObject();
- type = AAFS_SEC_NULL;
- break;
- case AAFS_SEC_KAD:
- case AAFS_SEC_GSS:
- return NULL;
- }
-
- sec = aafs_object_create(sizeof(*sec), "sec", sec_destruct);
-
- sec->type = type;
- sec->secidx = secidx;
- sec->secobj = secobj;
-
- return sec;
-}
-
-int
-aafs_security_rx_secclass(struct aafs_security *sec,
- void *secobj, int *secidx)
-{
- struct rx_securityClass **rxsecobj = secobj;
-
- *rxsecobj = sec->secobj;
- *secidx = sec->secidx;
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/aafs/test_aafs.c b/usr.sbin/afs/src/appl/aafs/test_aafs.c
deleted file mode 100644
index b250a7bd5ff..00000000000
--- a/usr.sbin/afs/src/appl/aafs/test_aafs.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdio.h>
-
-#include <vldb.h>
-#include <volumeserver.h>
-
-#include <aafs/aafs_cell.h>
-#include <aafs/aafs_volume.h>
-#include <aafs/aafs_vldb.h>
-
-#include <roken.h>
-
-int
-main(int argc, char **argv)
-{
- struct aafs_cell *c;
- struct aafs_volume *v;
- struct aafs_volume_info *i;
- struct nvldbentry nvldb;
- int ret;
-
- setprogname(argv[0]);
-
- if ((ret = aafs_init(NULL)) != 0)
- errx(1, "aafs_init");
-
- if ((ret = aafs_cell_create("e.kth.se", AAFS_SEC_NULL, &c)) != 0)
- errx(1, "aafs_cell_create");
-
- if ((ret = aafs_volume_create(c, "root.cell", 0, &v)) != 0)
- errx(1, "aafs_volume_create");
-
- if ((ret = aafs_volume_examine_nvldb(v, 0, &nvldb)) != 0)
- errx(1, "aafs_volume_examine_nvldb");
-
- aafs_volume_print_nvldb(v, stdout, 0);
-
- printf("\n");
-
- if ((ret = aafs_volume_examine_info(v, VOL_EXA_VOLINFO_ALL, &i)) != 0)
- errx(1, "aafs_volume_examine_info");
-
- {
- struct aafs_volume_info_ctx *ctx;
- struct aafs_volume_info_entry *se;
- struct aafs_site *site;
-
- for (se = aafs_volume_info_first(i, &ctx);
- se != NULL;
- se = aafs_volume_info_next(ctx))
- {
- char sn[1024];
-
- site = aafs_volume_info_get_site(se);
- printf("%s\n", aafs_site_print(site, sn, sizeof(sn)));
- aafs_object_unref(site, "site");
-
- aafs_volume_status_print(stdout, 0, se);
- printf("\n");
- }
- aafs_volume_info_destroy_ctx(ctx);
- }
-
- /* list vldb */
- {
- struct aafs_vldb_query_attrs *attrs;
- struct aafs_vldb_list *ql;
- struct aafs_vldb_ctx *vq;
- char vn[VLDB_MAXNAMELEN];
-
- if ((ret = aafs_vldb_query_attr_create(&attrs)) != 0)
- errx(1, "aafs_vldb_query_attr_create");
-
- if ((ret = aafs_vldb_query(c, attrs, &ql)) != 0)
- errx(1, "aafs_vldb_query");
-
- for (v = aafs_vldb_iterate_first(ql, &vq);
- v != NULL;
- v = aafs_vldb_iterate_next(vq))
- {
- aafs_volume_print_nvldb(v, stdout, 0);
- }
-
- aafs_vldb_query_free(ql);
-
- }
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/aafs/vldb.c b/usr.sbin/afs/src/appl/aafs/vldb.c
deleted file mode 100644
index f46775452f0..00000000000
--- a/usr.sbin/afs/src/appl/aafs/vldb.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <vldb.cs.h>
-#include <volumeserver.h>
-
-#include <aafs/aafs_private.h>
-#include <aafs/aafs_vldb.h>
-
-#include <ports.h>
-#include <service.h>
-
-#include <atypes.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <roken.h>
-
-struct aafs_vldb_list {
- struct aafs_object obj;
- int nvolumes;
- struct aafs_volume **volumes;
-};
-
-struct aafs_vldb_ctx {
- struct aafs_object obj;
- struct aafs_vldb_list *list;
- int current;
-
-};
-
-struct aafs_vldb_query_attrs {
- struct aafs_object obj;
- VldbListByAttributes vlattrs;
-};
-
-static void
-vldb_destruct(void *ptr, const char *name)
-{
- struct aafs_vldb_list *l = ptr;
- if (l->volumes) {
- int i;
- for (i = 0; i < l->nvolumes; i++)
- aafs_object_unref(l->volumes[i], "volume");
- free(l->volumes);
- }
-}
-
-
-int
-aafs_vldb_query(struct aafs_cell *cell,
- struct aafs_vldb_query_attrs *attrs,
- struct aafs_vldb_list **ret_query)
-{
- struct aafs_cell_db_ctx *ctx;
- struct aafs_vldb_list *query;
- struct rx_connection *conn;
- int32_t nentries;
- nbulkentries entries;
- int32_t ret;
- int i;
-
- *ret_query = NULL;
-
- query = aafs_object_create(sizeof(*query), "vldb-query", vldb_destruct);
-
- conn = aafs_cell_first_db(cell,
- htons(afsvldbport),
- VLDB_SERVICE_ID,
- &ctx);
-
- while(conn) {
- entries.len = 0;
- entries.val = NULL;
- nentries = 0;
-
- ret = VL_ListAttributesN(conn, &attrs->vlattrs, &nentries, &entries);
-
- if (!aafs_cell_try_next_db(ret))
- conn = NULL;
- else
- conn = aafs_cell_next_db(ctx);
-
- if (ret && conn == NULL) {
- if (entries.val)
- free(entries.val);
- aafs_object_unref(query, "vldb-query");
- cell_db_free_context(ctx);
- return ret;
- }
- }
-
- cell_db_free_context(ctx);
-
- query->volumes = emalloc(entries.len * sizeof(*query->volumes));
- query->nvolumes = entries.len;
-
- for (i = 0; i < entries.len; i++)
- aafs_volume_attach(cell, 0, &entries.val[i], &query->volumes[i]);
-
- if (entries.val)
- free(entries.val);
-
- *ret_query = query;
-
- return 0;
-}
-
-int
-aafs_vldb_query_free(struct aafs_vldb_list *query)
-{
- aafs_object_unref(query, "vldb-query");
- return 0;
-}
-
-int
-aafs_vldb_query_attr_create(struct aafs_vldb_query_attrs **ret_attrs)
-{
- struct aafs_vldb_query_attrs *attrs;
-
- attrs = aafs_object_create(sizeof(*attrs), "vldb-query-attr", NULL);
-
- *ret_attrs = attrs;
-
- return 0;
-}
-
-int
-aafs_vldb_query_attr_set_partition(struct aafs_vldb_query_attrs *attrs,
- aafs_partition partition)
-{
- attrs->vlattrs.Mask |= VLLIST_PARTITION;
- attrs->vlattrs.partition = partition;
- return 0;
-}
-
-int
-aafs_vldb_query_attr_set_server(struct aafs_vldb_query_attrs *attrs,
- uint32_t server)
-{
- attrs->vlattrs.Mask |= VLLIST_SERVER;
- attrs->vlattrs.server = server;
- return 0;
-}
-
-#ifdef not_yet
-int
-aafs_vldb_query_attr_set_uuid(struct aafs_vldb_query_attrs *attrs,
- afsUUID *uuid)
-{
- return 0;
-}
-#endif
-
-int
-aafs_vldb_query_attr_set_volumeid(struct aafs_vldb_query_attrs *attrs,
- int32_t volumeid)
-{
- attrs->vlattrs.Mask |= VLLIST_VOLUMEID;
- attrs->vlattrs.volumeid = volumeid;
- return 0;
-}
-
-int
-aafs_vldb_query_attr_set_flag(struct aafs_vldb_query_attrs *attrs,
- int32_t flag)
-{
- attrs->vlattrs.Mask |= VLLIST_FLAG;
- attrs->vlattrs.flag = flag;
- return 0;
-}
-
-int
-aafs_vldb_query_attr_free(struct aafs_vldb_query_attrs *attrs)
-{
- aafs_object_unref(attrs, "vldb-query-attr");
- return 0;
-}
-
-static void
-vldb_iter_destruct(void *ptr, const char *name)
-{
- struct aafs_vldb_ctx *c = ptr;
- aafs_object_unref(c->list, "vldb-query");
-}
-
-struct aafs_volume *
-aafs_vldb_iterate_first(struct aafs_vldb_list *list,
- struct aafs_vldb_ctx **ret_ctx)
-{
- struct aafs_vldb_ctx *ctx;
-
- *ret_ctx = NULL;
-
- if (list->nvolumes <= 0)
- return NULL;
-
- ctx = aafs_object_create(sizeof(*ctx), "vldb-iter", vldb_iter_destruct);
-
- ctx->list = aafs_object_ref(list, "vldb-query");
- ctx->current = -1;
- *ret_ctx = ctx;
- return aafs_vldb_iterate_next(ctx);
-}
-
-struct aafs_volume *
-aafs_vldb_iterate_next(struct aafs_vldb_ctx *ctx)
-{
- ctx->current++;
- if (ctx->current < ctx->list->nvolumes)
- return aafs_object_ref(ctx->list->volumes[ctx->current], "volume");
- return NULL;
-}
-
-void
-aafs_vldb_iterate_done(struct aafs_vldb_ctx *ctx)
-{
- if (ctx)
- aafs_object_unref(ctx, "vldb-iter");
-}
diff --git a/usr.sbin/afs/src/appl/aafs/volume.c b/usr.sbin/afs/src/appl/aafs/volume.c
deleted file mode 100644
index ece7cae7e85..00000000000
--- a/usr.sbin/afs/src/appl/aafs/volume.c
+++ /dev/null
@@ -1,583 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <volumeserver.cs.h>
-#include <vldb.cs.h>
-#include <ko.h>
-#include <ports.h>
-#include <service.h>
-
-#include <aafs/aafs_volume.h>
-#include <aafs/aafs_conn.h>
-#include <aafs/aafs_private.h>
-#include <aafs/aafs_partition.h>
-
-#include <roken.h>
-
-struct aafs_volume {
- struct aafs_object obj;
- char name[VLDB_MAXNAMELEN];
- struct aafs_cell *cell;
- unsigned long flags;
-#define AAFS_VOLUME_HAVE_VLDB_INFO 1
- nvldbentry vldb;
-};
-
-static void
-volume_destruct(void *ptr, const char *name)
-{
- struct aafs_volume *v = ptr;
- if (v->cell)
- aafs_cell_unref(v->cell);
-}
-
-int
-aafs_volume_create(struct aafs_cell *cell,
- const char *volumename,
- unsigned long flags,
- struct aafs_volume **ret_volume)
-{
- struct aafs_volume *v;
-
- *ret_volume = NULL;
-
- v = aafs_object_create(sizeof(*v), "volume", volume_destruct);
-
- v->cell = aafs_cell_ref(cell);
-
- strlcpy(v->name, volumename, sizeof(v->name));
-
- if ((flags & AAFS_VOL_CREATE_NO_CANONICALIZE) == 0)
- volname_canonicalize(v->name);
-
- v->flags = 0;
-
- *ret_volume = v;
-
- return 0;
-}
-
-int
-aafs_volume_attach(struct aafs_cell *cell,
- unsigned long flags,
- nvldbentry *vldb,
- struct aafs_volume **volume)
-{
- int ret;
- struct aafs_volume *v;
-
- if ((ret = aafs_volume_create(cell, vldb->name, flags, volume)) != 0)
- return ret;
- v = *volume;
- v->flags = AAFS_VOLUME_HAVE_VLDB_INFO;
- memcpy(&v->vldb, vldb, sizeof(v->vldb));
- return 0;
-}
-
-void
-aafs_volume_free(struct aafs_volume *v)
-{
- aafs_object_unref(v, "volume");
-}
-
-char *
-aafs_volume_name(struct aafs_volume *volume, char *volname, size_t sz)
-{
- snprintf(volname, sz, "%s", volume->name);
- return volname;
-}
-
-
-int
-aafs_volume_examine_nvldb(struct aafs_volume *volume,
- unsigned long flags,
- struct nvldbentry *nvldb)
-{
- struct aafs_cell_db_ctx *ctx;
- struct rx_connection *conn;
- int oldservers = 0;
- int ret;
-
- if (volume->flags & AAFS_VOLUME_HAVE_VLDB_INFO) {
- memcpy(nvldb, &volume->vldb, sizeof(*nvldb));
- return 0;
- }
-
-
- retry:
- conn = aafs_cell_first_db(volume->cell,
- htons(afsvldbport),
- VLDB_SERVICE_ID,
- &ctx);
-
- while(conn) {
- if (oldservers) {
- vldbentry vldb;
-
- ret = VL_GetEntryByName(conn, volume->name, &vldb);
- if (ret == 0)
- vldb2vldbN(&vldb, nvldb);
- } else
- ret = VL_GetEntryByNameN(conn, volume->name, nvldb);
-
- if (ret == RXGEN_OPCODE) {
- oldservers = 1;
- cell_db_free_context(ctx);
- goto retry;
- }
-
- if (!aafs_cell_try_next_db(ret))
- conn = NULL;
- else
- conn = aafs_cell_next_db(ctx);
- }
-
- cell_db_free_context(ctx);
-
- if (ret == 0) {
- nvldb->name[VLDB_MAXNAMELEN-1] = '\0';
- memcpy(&volume->vldb, nvldb, sizeof(*nvldb));
- volume->flags |= AAFS_VOLUME_HAVE_VLDB_INFO;
- }
-
- return ret;
-}
-
-int
-aafs_volume_print_nvldb(struct aafs_volume *v, FILE *f, unsigned long flags)
-{
- struct nvldbentry *vldb = &v->vldb;
- char server_name[MAXHOSTNAMELEN];
- char part_name[17];
- int i;
-
- if ((v->flags & AAFS_VOLUME_HAVE_VLDB_INFO) == 0)
- return ENOENT;
-
- if ((flags & VOL_PRINT_VLDB_SKIP_NAME) == 0)
- fprintf(f, "%.*s\n", VLDB_MAXNAMELEN, vldb->name);
-
- printf(" ");
- if(vldb->flags & VLF_RWEXISTS)
- printf("RWrite: %u\t", vldb->volumeId[RWVOL]);
- if(vldb->flags & VLF_ROEXISTS)
- printf("ROnly: %u\t", vldb->volumeId[ROVOL]);
- if(vldb->flags & VLF_BACKEXISTS)
- printf("Backup: %u\t", vldb->volumeId[BACKVOL]);
-
- printf("\n number of sites -> %d\n", vldb->nServers );
-
- for (i = 0; i < vldb->nServers; i++) {
- struct aafs_server *s;
- aafs_partition part;
-
- printf(" ");
-
- aafs_server_create_by_long(v->cell, htonl(vldb->serverNumber[i]), &s);
- aafs_server_get_name(s, server_name, sizeof(server_name));
- aafs_server_free(s);
-
- part = aafs_partition_from_number(vldb->serverPartition[i]);
- aafs_partition_name(part, part_name, sizeof(part_name));
- printf("server %s partition %s %s Site",
- server_name, part_name,
- volumetype_from_serverflag(vldb->serverFlags[i]));
-
- if (vldb->serverFlags[i] & VLSF_DONTUSE)
- printf(" -- not replicated yet");
-
- printf("\n");
-
- }
-
- if (vldb->flags & VLOP_ALLOPERS) {
- char msg[100];
-
- printf("Volume is currently LOCKED, reson: %s\n",
- vol_getopname(vldb->flags, msg, sizeof(msg)));
- }
-
-
- return 0;
-}
-
-struct aafs_volume_info_entry {
- struct aafs_site *site;
- int status;
- xvolintInfo info;
-};
-
-struct aafs_volume_info {
- struct aafs_object obj;
- struct aafs_volume *volume;
- int num_info;
- struct aafs_volume_info_entry *info;
-};
-
-struct aafs_volume_info_ctx {
- struct aafs_object obj;
- struct aafs_volume_info *info;
- int current;
-};
-
-static void
-info_destruct(void *ptr, const char *name)
-{
- struct aafs_volume_info *info = ptr;
- int i;
-
- for (i = 0; i < info->num_info; i++)
- aafs_object_unref(info->info[i].site, "site");
- free(info->info);
- aafs_object_unref(info->volume, "volume");
-}
-
-
-int
-aafs_volume_examine_info(struct aafs_volume *volume,
- unsigned long flags,
- struct aafs_volume_info **ret_info)
-{
- struct aafs_volume_info *info;
- struct nvldbentry vldb;
- xvolEntries ie;
- struct rx_connection *conn;
- struct aafs_server *server;
- int ret, i, j, done;
- uint32_t serverflags, serverflagsmask;
-
- *ret_info = NULL;
-
- ret = aafs_volume_examine_nvldb(volume, 0, &vldb);
- if (ret)
- return ret;
-
- info = aafs_object_create(sizeof(*info), "volume-info", info_destruct);
-
- info->volume = aafs_object_ref(volume, "volume");
- info->num_info = 0;
- info->info = NULL;
-
- for (i = 0; i < vldb.nServers; i++) {
- uint32_t volid;
-
- conn = NULL;
-
- ie.val = NULL;
-
- serverflagsmask = 0;
- if (flags & VOL_EXA_VOLINFO_RW)
- serverflagsmask |= VLSF_RWVOL;
- if (flags & VOL_EXA_VOLINFO_RO)
- serverflagsmask |= VLSF_ROVOL;
- if (flags & VOL_EXA_VOLINFO_BU)
- serverflagsmask |= VLSF_BACKVOL;
-
- if ((serverflagsmask & vldb.serverFlags[i]) == 0)
- continue;
-
- ret = aafs_server_create_by_long(volume->cell,
- htonl(vldb.serverNumber[i]),
- &server);
- if (ret)
- continue;
-
- conn = aafs_conn_byserver(server, htons(afsvolport), VOLSER_SERVICE_ID);
- if (conn == NULL) {
- aafs_object_unref(server, "server");
- continue;
- }
-
- done = 1;
- serverflags = vldb.serverFlags[i]&(VLSF_RWVOL|VLSF_ROVOL|VLSF_BACKVOL);
-
- /*
- * Half of this mumbojumbo is to support site's that
- * RW/RO/BACK in the same entry. It seems like its not unsupported.
- */
-
- do {
- volid = 0;
-
- /*
- * check if we have done this volume type, if not check it
- * now and remove it from the set we are going to check
- */
-
- if (serverflags & VLSF_RWVOL) {
- volid = vldb.volumeId[RWVOL];
- serverflags &= ~VLSF_RWVOL;
- if (serverflags & VLSF_RWVOL)
- done = 0;
- } else if (vldb.serverFlags[i] & VLSF_ROVOL) {
- volid = vldb.volumeId[ROVOL];
- serverflags &= ~VLSF_ROVOL;
- if (serverflags & VLSF_ROVOL)
- done = 0;
- } else if (vldb.serverFlags[i] & VLSF_BACKVOL) {
- volid = vldb.volumeId[BACKVOL];
- serverflags &= ~VLSF_BACKVOL;
- if (serverflags & VLSF_BACKVOL)
- done = 0;
- }
-
- if (volid == 0)
- break;
-
- ret = VOLSER_AFSVolXListOneVolume(conn, vldb.serverPartition[i],
- volid, &ie);
- if (ret)
- ie.len = 1;
-
- for (j = 0; j < ie.len; j++) {
-
- info->info = erealloc(info->info,
- (info->num_info + 1)
- * sizeof(info->info[0]));
- if (ret == 0) {
- memcpy(&info->info[info->num_info].info,
- &ie.val[j], sizeof(ie.val[0]));
- info->info[info->num_info].status =
- AAFS_VOLUME_INFO_ENTRY_OK;
- } else {
- memset(&info->info[info->num_info].info, 0,
- sizeof(info->info[info->num_info].info));
- info->info[info->num_info].status =
- AAFS_VOLUME_INFO_ENTRY_DEAD;
- }
-
- aafs_site_create(volume->cell, server, vldb.serverPartition[i],
- &info->info[info->num_info].site);
- info->num_info++;
- }
-
- if (ie.val)
- free(ie.val);
- } while (!done);
- }
-
- aafs_object_unref(server, "server");
-
- *ret_info = info;
-
- return 0;
-}
-
-
-static void
-info_ctx_destruct(void *ptr, const char *name)
-{
- struct aafs_volume_info_ctx *c = ptr;
- aafs_object_unref(c->info, "volume-info");
-}
-
-
-struct aafs_volume_info_entry *
-aafs_volume_info_first(struct aafs_volume_info *list,
- struct aafs_volume_info_ctx **ret_ctx)
-{
- struct aafs_volume_info_ctx *c;
-
- *ret_ctx = NULL;
-
- c = aafs_object_create(sizeof(*c), "volume-info-ctx", info_ctx_destruct);
- c->current = -1;
- c->info = aafs_object_ref(list, "volume-info");
-
- *ret_ctx = c;
- return aafs_volume_info_next(c);
-}
-
-struct aafs_volume_info_entry *
-aafs_volume_info_next(struct aafs_volume_info_ctx *c)
-{
- c->current++;
-
- if (c->info->num_info <= c->current)
- return NULL;
-
- return &c->info->info[c->current];
-}
-
-int
-aafs_volume_info_destroy_ctx(struct aafs_volume_info_ctx *ctx)
-{
- aafs_object_unref(ctx, "volume-info-ctx");
- return 0;
-}
-
-struct aafs_site *
-aafs_volume_info_get_site(struct aafs_volume_info_entry *e)
-{
- return aafs_object_ref(e->site, "site");
-}
-
-int
-aafs_volume_info_get_volinfo(struct aafs_volume_info_entry *e,
- xvolintInfo *info)
-{
- if (e->status == AAFS_VOLUME_INFO_ENTRY_OK)
- memcpy(info, &e->info, sizeof(*info));
- return e->status;
-}
-
-
-int
-aafs_volume_status_print(FILE *f, int flags,
- struct aafs_volume_info_entry *status)
-{
- xvolintInfo *v = &status->info;
- char timestr[128];
- struct tm tm;
-
- printf("\n");
- printf(" Status %s\t\tVolume type: %s\n",
- v->status == VOK ? "On-line" : "Busy",
- volumetype_from_volsertype(v->type));
- printf(" Usage %10d K\n", v->size);
-
- if (flags & AAFS_VOLUME_STATUS_PRINT_SUMMERY)
- return 0;
-
- if (v->status != VOK)
- return 0;
-
- printf(" MaxQuota %10d K\n", v->maxquota);
-
- memset (&tm, 0, sizeof(tm));
- strftime (timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S %Z",
- localtime_r((time_t*) &v->creationDate, &tm));
- printf(" Creation %s\n", timestr);
-
- memset (&tm, 0, sizeof(tm));
- strftime (timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S %Z",
- localtime_r((time_t*) &v->updateDate, &tm));
- printf(" Last Update %s\n", timestr);
-
- printf(" %d accesses in the past day (i.e., vnode references)\n",
- v->dayUse);
-
- if (flags & AAFS_VOLUME_STATUS_PRINT_EXTENDED) {
- printf(" File count:\t%d\n\n", v->filecount);
-
- printf(" Raw Read/Write Stats\n"
- " |-------------------------------------------|\n"
- " | Same Network | Diff Network |\n"
- " |----------|----------|----------|----------|\n"
- " | Total | Auth | Total | Auth |\n"
- " |----------|----------|----------|----------|\n");
- printf("Reads |%9d |%9d |%9d |%9d |\n",
- v->stat_reads[0],
- v->stat_reads[1],
- v->stat_reads[2],
- v->stat_reads[3]);
- printf("Writes |%9d |%9d |%9d |%9d |\n",
- v->stat_writes[0],
- v->stat_writes[1],
- v->stat_writes[2],
- v->stat_writes[3]);
- printf(" |-------------------------------------------|\n");
- printf("\n");
- printf(" Writes Affecting Authorship\n"
- " |-------------------------------------------|\n"
- " | File Authorship | Directory Authorship|\n"
- " |----------|----------|----------|----------|\n"
- " | Same | Diff | Same | Diff |\n"
- " |----------|----------|----------|----------|\n");
- printf("0-60 sec |%9d |%9d |%9d |%9d |\n",
- v->stat_fileSameAuthor[0], v->stat_fileDiffAuthor[0],
- v->stat_dirSameAuthor[0], v->stat_dirDiffAuthor[0]);
- printf("1-10 min |%9d |%9d |%9d |%9d |\n",
- v->stat_fileSameAuthor[1], v->stat_fileDiffAuthor[1],
- v->stat_dirSameAuthor[1], v->stat_dirDiffAuthor[1]);
- printf("10min-1hr |%9d |%9d |%9d |%9d |\n",
- v->stat_fileSameAuthor[2], v->stat_fileDiffAuthor[2],
- v->stat_dirSameAuthor[2], v->stat_dirDiffAuthor[2]);
- printf("1hr-1day |%9d |%9d |%9d |%9d |\n",
- v->stat_fileSameAuthor[3], v->stat_fileDiffAuthor[3],
- v->stat_dirSameAuthor[3], v->stat_dirDiffAuthor[3]);
- printf("1day-1wk |%9d |%9d |%9d |%9d |\n",
- v->stat_fileSameAuthor[4], v->stat_fileDiffAuthor[4],
- v->stat_dirSameAuthor[4], v->stat_dirDiffAuthor[4]);
- printf("> 1wk |%9d |%9d |%9d |%9d |\n",
- v->stat_fileSameAuthor[5], v->stat_fileDiffAuthor[5],
- v->stat_dirSameAuthor[5], v->stat_dirDiffAuthor[5]);
- printf(" |-------------------------------------------|\n");
- }
- return 0;
-}
-
-int
-aafs_volume_status_have_type(struct aafs_volume *volume,
- int volume_type)
-{
- return 0;
-}
-
-int
-aafs_volume_sitelist(struct aafs_volume *volume,
- struct aafs_site_list **sitelist)
-{
- *sitelist = NULL;
- return 0;
-}
-
-/*
- * modification ops
- */
-
-int
-aafs_volume_add_readonly(struct aafs_volume *volume,
- struct aafs_site *site)
-{
- return 0;
-}
-
-int
-aafs_volume_move_readwrite(struct aafs_volume *volume,
- struct aafs_site *site,
- unsigned long flags)
-{
- return 0;
-}
-
-
-int
-aafs_volume_release(struct aafs_volume *volume,
- unsigned long flags)
-{
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/afsmgr/Makefile.in b/usr.sbin/afs/src/appl/afsmgr/Makefile.in
deleted file mode 100644
index 83f1f7a6bcf..00000000000
--- a/usr.sbin/afs/src/appl/afsmgr/Makefile.in
+++ /dev/null
@@ -1,98 +0,0 @@
-# $KTH: Makefile.in,v 1.3 2000/10/25 07:16:13 lha Exp $
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-LN_S = @LN_S@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-transform = @program_transform_name@
-EXECSUFFIX = @EXECSUFFIX@
-
-APPL_BIN = afsaclmgr
-
-DEFS = @DEFS@
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-X_CFLAGS = @X_CFLAGS@
-
-ETAGS = etags
-MAKEDEPEND = makedepend
-RXKADINC = -I$(srcdir)/../../rxkad
-INCLUDES =
-DEFINES =
-REALCFLAGS =
-RXKAD_LIBS =
-KERNEL_INCLUDE =
-LIB_tgetent =
-READLINE_lib =
-KAFS_LIBS =
-LIBS =
-LIBDEPENDS =
-PROGS = afsaclmgr
-UDEBUG_SRCS =
-SRCS =
-UDEBUG_OBJS =
-HDRS =
-
-GUILE_GTK = @GUILE_GTK@
-
-all: $(PROGS)
-
-.PHONY: all install uninstall depend tags clean
-
-afsaclmgr: afsaclmgr.in
- sed -e "s!%GUILE_GTK%!$(GUILE_GTK)!" $(srcdir)/afsaclmgr.in > $@
- chmod +x $@
-
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(bindir)/$$f; \
- done ;\
-
-uninstall:
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
- done
-
-udebug: $(UDEBUG_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(UDEBUG_OBJS) $(LIBS)
-
-Makefile: Makefile.in ../../config.status
- cd ../..; CONFIG_FILES=appl/afsmgr/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(CFILES)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(PROGS) $(OBJS) *~ *.o core
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/appl/afsmgr/afsaclmgr.in b/usr.sbin/afs/src/appl/afsmgr/afsaclmgr.in
deleted file mode 100644
index ffa55b883ce..00000000000
--- a/usr.sbin/afs/src/appl/afsmgr/afsaclmgr.in
+++ /dev/null
@@ -1,314 +0,0 @@
-#! %GUILE_GTK% -s
--*-scheme-*-
-!#
-
-;;
-;; A AFS ACL/PTS manager
-;;
-
-;;
-;; $arla: afsaclmgr.in,v 1.3 1999/10/23 17:49:56 lha Exp $
-;;
-
-(use-modules (gtk gtk))
-(use-modules (ice-9 popen))
-
-;;
-;;
-;;
-
-(define name-window #f)
-
-(define (acl-new-name path main-window)
- (if name-window
- (gtk-widget-destroy name-window))
- (set! name-window (gtk-window-new 'dialog))
- (let ((main-panel (gtk-vbox-new #f 3))
- (text-box (gtk-entry-new-with-max-length 40))
- (ok-button (gtk-button-new-with-label "Ok"))
- (cancel-button (gtk-button-new-with-label "Cancel")))
- (define (name-close-window)
- (gtk-widget-destroy name-window)
- (set! name-window #f))
-
- (gtk-window-set-title name-window "New Name")
- (gtk-container-add name-window main-panel)
-
- (gtk-signal-connect cancel-button
- "clicked"
- name-close-window)
-
- (gtk-signal-connect ok-button
- "clicked"
- (lambda ()
- (let ((user (gtk-entry-get-text text-box)))
- (name-close-window)
- (display path) (newline)
- (display user) (newline)
- (acl-magic-window path user "rl" main-window))))
-
- (gtk-box-pack-start main-panel text-box #t #t 0)
- (gtk-box-pack-start main-panel ok-button #f #f 0)
- (gtk-box-pack-end main-panel cancel-button #f #f 0)
-
- (gtk-widget-show-all name-window)))
-
-;;
-;;
-;;
-
-(define acl-titles #("Name" "R" "L" "I" "D" "W" "K" "A"))
-
-(define acl-window #f)
-
-(define (acl-magic-window path user rights main-window)
- (if acl-window
- (gtk-widget-destroy acl-window))
- (set! acl-window (gtk-window-new 'dialog))
- (let ((main-panel (gtk-vbox-new #f 3))
- (button-panel (gtk-hbox-new #f 2))
- (status-bar (gtk-statusbar-new))
- (acl-foo (gtk-clist-new-with-titles acl-titles))
- (ok-button (gtk-button-new-with-label "Ok"))
- (cancel-button (gtk-button-new-with-label "Cancel")))
- (define (clicked-func row col event)
- (let ((user '(#f))
- (ace '(#f)))
- (gtk-clist-get-text acl-foo row 0 user)
- (gtk-clist-get-text acl-foo row col ace)
- (cond ((eq? col 0) '())
- ((string=? (car ace) "X") (set! ace (list " ")))
- ((string=? (car ace) " ") (set! ace (list "X")))
- (else (die-in-horror)))
- (gtk-clist-set-text acl-foo row col (car ace))))
- (define (map-acl-to-X user clist acl)
- (gtk-clist-append
- acl-foo
- (cons user
- (map
- (lambda (x)
- (if (member x (string->list acl))
- "X"
- " "))
- (string->list "rlidwka")))))
- (define (acl-close-window)
- (gtk-widget-destroy acl-window)
- (set! acl-window #f))
-
- (gtk-window-set-title acl-window "ACL")
- (gtk-container-add acl-window main-panel)
-
- (for-each
- (lambda (col size)
- (gtk-clist-set-column-width acl-foo col size))
- '(0 1 2 3 4 5 6 7)
- '(200 10 10 10 10 10 10 10))
-
-
- (map-acl-to-X user acl-foo rights)
-
- (gtk-signal-connect
- acl-foo
- "unselect-row"
- clicked-func)
-
- (gtk-signal-connect acl-foo "select-row" clicked-func)
-
- (gtk-box-pack-start button-panel ok-button #t #t 0)
- (gtk-box-pack-end button-panel cancel-button #t #t 0)
-
- (gtk-signal-connect
- ok-button "clicked"
- (lambda ()
- (define (get-text col text)
- (let ((dummy '(#f)))
- (gtk-clist-get-text acl-foo 0 col dummy)
- (if (and (car dummy)
- (string=? (car dummy) "X"))
- text
- "")))
- (begin
- (acl-set
- path
- user
- (let ((ace (apply string
- (map get-text
- '(1 2 3 4 5 6 7)
- '("r" "l" "i" "d" "w" "k" "a")))))
- (if (string=? ace "")
- "none"
- ace))))
- (acl-update-clist path main-window)
- (acl-close-window)))
-
- (gtk-signal-connect cancel-button
- "clicked"
- acl-close-window)
-
-
- (gtk-box-pack-start main-panel acl-foo #t #t 0)
- (gtk-box-pack-start main-panel button-panel #t #t 0)
- (gtk-box-pack-end main-panel status-bar #f #f 0)
-
- (gtk-widget-show-all acl-window)))
-
-
-(define acl-error-rx (make-regexp "^fs: Invalid argument; it is possible"))
-(define acl-split-rx (make-regexp "^ +([^ ]+) +([rlidwka]+)"))
-
-;;
-;; Get acl for given path.
-;;
-;; If path not in afs, #f is returned
-;;
-
-(define (read-to-char port ch)
- (let ((next (read-char port)))
- (cond ((eof-object? next) next)
- ((equal? next ch) "")
- (else (string next (read-to-char port ch))))))
-
-(define (acl-list path)
- (define (parse-output pipe)
- (let ((first (read-to-char pipe #\newline)))
- (if (or (eof-object? first)
- (regexp-exec acl-error-rx first))
- #f
- (let ((second (read-to-char pipe #\newline)))
- (if (not (eof-object? first))
- (let foo ((str (read-to-char pipe #\newline)))
- (if (eof-object? str)
- '()
- (let* ((acl (regexp-exec acl-split-rx str))
- (arg1 (vector-ref acl 2))
- (arg2 (vector-ref acl 3))
- (bar1 (substring str (car arg1) (cdr arg1)))
- (bar2 (substring str (car arg2) (cdr arg2))))
- (cons (list bar1 bar2)
- (foo (read-to-char pipe #\newline)))))))))))
- (let* ((pipe (open-input-pipe
- (string "/usr/afsws/bin/fs la " path " 2>&1")))
- (ret (parse-output pipe)))
- (close-port pipe)
- ret))
-
-;;
-;; Set `acl´ for `name´ on `path´.
-;;
-
-(define (acl-set path name acl)
- (define (parse-output pipe)
- (let ((first (read-to-char pipe #\newline)))
- (not (or (eof-object? first)
- (regexp-exec acl-error-rx first)))))
- (let* ((pipe (open-input-pipe
- (string "/usr/afsws/bin/fs sa " path " "
- name " " acl " 2>&1")))
- (ret (parse-output pipe)))
- (close-port pipe)
- ret))
-
-;;
-;; Update the `clist' for to reflect `path'
-;;
-
-(define (acl-update-clist path clist)
- (let ((acl (acl-list path)))
- (if acl
- (begin
- (gtk-clist-clear clist)
- (for-each
- (lambda (x)
- (gtk-clist-append
- clist
- (vector (car x) (cadr x))))
- acl)))))
-
-;;
-;; Main
-;;
-
-(define user-selected #f)
-(define acl-selected #f)
-
-(define main-titles #("user" "acl"))
-
-(let ((window (gtk-window-new 'toplevel))
- (main-panel (gtk-vbox-new #f 2))
- (button-panel (gtk-hbox-new #f 5))
- (scrolled-window (gtk-scrolled-window-new))
- (clist (gtk-clist-new-with-titles main-titles))
- (add-button (gtk-button-new-with-label "Add"))
- (modify-button (gtk-button-new-with-label "Modify"))
- (refresh-button (gtk-button-new-with-label "Refresh"))
- (delete-button (gtk-button-new-with-label "Delete"))
- (quit-button (gtk-button-new-with-label "Quit")))
-
- (define (reset-selection)
- (set! user-selected #f)
- (set! acl-selected #f))
-
-
- (gtk-window-set-title window "AFS ACLManager")
-
- (gtk-widget-set-usize clist 400 200)
- (gtk-clist-set-column-width clist 0 200)
-
- (acl-update-clist "." clist)
-
- (gtk-container-add window main-panel)
-
- (gtk-box-pack-start main-panel scrolled-window #t #t 0)
- (gtk-box-pack-end main-panel button-panel #f #f 0)
-
- (gtk-box-pack-start button-panel add-button #t #t 0)
- (gtk-box-pack-start button-panel modify-button #t #t 0)
- (gtk-box-pack-start button-panel refresh-button #t #t 0)
- (gtk-box-pack-start button-panel delete-button #t #t 0)
- (gtk-box-pack-end button-panel quit-button #t #t 0)
-
- (gtk-container-add scrolled-window clist)
-
- (gtk-signal-connect delete-button "clicked"
- (lambda ()
- (if user-selected
- (begin
- (acl-set "." user-selected "none")
- (reset-selection)
- (acl-update-clist "." clist)))))
-
- (gtk-signal-connect refresh-button "clicked"
- (lambda ()
- (acl-update-clist "." clist)))
-
- (gtk-signal-connect clist "select-row"
- (lambda (row col event)
- (let ((dummy '(#f)))
- (gtk-clist-get-text clist row 0 dummy)
- (set! user-selected (car dummy))
- (gtk-clist-get-text clist row 1 dummy)
- (set! acl-selected (car dummy)))))
-
- (gtk-signal-connect add-button "clicked"
- (lambda ()
- (acl-new-name "." clist)))
-
- (gtk-signal-connect modify-button "clicked"
- (lambda ()
- (if user-selected
- (begin
- (acl-magic-window
- "." user-selected acl-selected
- clist)
- (reset-selection)
- (acl-update-clist "." clist)))))
-
- (gtk-signal-connect quit-button "clicked"
- (lambda ()
- (gtk-widget-destroy window)
- (quit)))
-
- (gtk-widget-show-all window)
- (gtk-standalone-main window))
-
-(quit)
diff --git a/usr.sbin/afs/src/appl/afstool/afstool.1 b/usr.sbin/afs/src/appl/afstool/afstool.1
deleted file mode 100644
index dc607f62ca9..00000000000
--- a/usr.sbin/afs/src/appl/afstool/afstool.1
+++ /dev/null
@@ -1,149 +0,0 @@
-.\" Copyright (c) 2003 Kungliga Tekniska Högskolan
-.\" (Royal Institute of Technology, Stockholm, Sweden).
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" 3. Neither the name of the Institute nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $arla: afstool.1,v 1.12 2003/03/06 16:35:02 lha Exp $
-.Dd March 4, 2003
-.Dt AFSTOOL 1
-.Os
-.Sh NAME
-.Nm afstool
-.Nd tool for AFS maintence
-.Sh SYNOPSIS
-.Nm
-.Ar command
-.Op Ar args
-.Sh DESCRIPTION
-The
-.Nm
-probes, display, modifies and maintain the
-.Nm AFS
-system
-.Pp
-The commands are:
-.Pp
-.Bl -inset -compact
-.It Ic cachemanager localcell
-.It Ic cachemanager whoareyou
-.It Ic fileserver flushcps
-.It Ic fileserver getcapabilities
-.It Ic fileserver gettime
-.It Ic version
-.It Ic ubik debug
-.El
-.Pp
-For each subclass there are some common commands
-.Pp
-.Bl -inset -compact
-.It Ic apropos
-.It Ic help
-.El
-.Pp
-All the detail of the commands
-.Nm
-commands:
-.Pp
-.Bl -inset
-.It Ic cachemanager localcell
-.Op Fl -port Ar portnumber
-.Op Fl -cell Ar cellname
-.Op Fl -no-auth
-.Ar host ...
-.Bd -filled -offset indent -compact
-Query a callback manager on
-.Ar hostname
-(or localhost if not given) for the local cellname on
-.Ar port
-is default 7001 (the port arlad is using).
-.Ed
-.It Ic cachemanager whoareyou
-.Op Fl -port Ar portnumber
-.Op Fl -cell Ar cellname
-.Op Fl -no-auth
-.Ar hostname ...
-.Bd -filled -offset indent -compact
-Query a callback manager on
-.Ar hostname
-(or localhost if not given) for interface information. The
-.Ar port
-is default 7001 (the port arlad is using).
-.Ed
-.It Ic fileserver flushcps
-.Op Fl -hosts=cache-managers
-.Op Fl -viceids=vice-ids
-.Op Fl -cell=cellname
-.Op Fl -no-auth
-.Op Fl -verbose
-.Ar host ...
-.Bd -filled -offset indent -compact
-Flush the Current Protection Set (CPS) from the fileserver either
-specifed by AFS user-id (viceid) or hostname/address of cache-managers.
-.Ed
-.It Ic fileserver getcapabilities
-.Op Fl -cell=cellname
-.Op Fl -no-auth
-.Op Fl -verbose
-.Ar host ...
-.Bd -filled -offset indent -compact
-Displays the capabilities of the fileserver.
-.Ed
-.It Ic fileserver gettime
-.Op Fl -cell=cellname
-.Op Fl -no-auth
-.Op Fl -verbose
-.Ar host ...
-.Bd -filled -offset indent -compact
-Fetches the time from the fileserver.
-.Ed
-.It Ic version
-.Bd -filled -offset indent -compact
-Display the version number of
-.Nm
-.Ed
-.It Ic ubik debug
-.Op Fl -port=portname
-.Op Fl -cell=cellname
-.Op Fl -no-auth
-.Op Fl -verbose
-.Ar host ...
-.Bd -filled -offset indent -compact
-print ubik debug information from ubik voting service.
-Common ubik servers are running on the
-.Nm afs3-prserver (7002),
-and
-.Nm afs3-vlserver (7003).
-.Ed
-.El
-.Sh SEE ALSO
-.Xr pts 1 ,
-.Xr fs 8 ,
-.Xr vos 8
-.Sh AUTHORS
-The Arla project <http://www.stacken.kth.se/project/arla/>.
diff --git a/usr.sbin/afs/src/appl/afstool/afstool.c b/usr.sbin/afs/src/appl/afstool/afstool.c
deleted file mode 100644
index 5034401db7d..00000000000
--- a/usr.sbin/afs/src/appl/afstool/afstool.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Copyright (c) 2002 - 2003, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "at_locl.h"
-
-RCSID("$arla: afstool.c,v 1.7 2003/03/05 14:55:47 lha Exp $");
-
-#if 0
-
-#include <krb5/krb5.h>
-#include <krb5/krb5_asn1.h>
-#include <kerberosIV/krb.h>
-#include <kerberosIV/kafs.h>
-
-static int
-set5tok(void)
-{
- CREDENTIALS c;
- char *key;
- int auth_len;
- char *auth;
- krb5_error_code ret;
- krb5_creds in_creds, *out_creds;
- krb5_context ctx;
- krb5_ccache id;
- int kvno;
- char *realm = "NXS.SE";
- int realm_len = strlen(realm);
-
- krb5_init_context(&ctx);
-
- if (!k_hasafs())
- return 0;
-
- ret = krb5_cc_default (ctx, &id);
- if (ret)
- return ret;
-
- memset(&in_creds, 0, sizeof(in_creds));
- ret = krb5_build_principal(ctx, &in_creds.server,
- realm_len, realm, "afs", NULL);
- if(ret)
- return ret;
- ret = krb5_build_principal(ctx, &in_creds.client,
- realm_len, realm, "lha", NULL);
- if(ret){
- krb5_free_principal(ctx, in_creds.server);
- return ret;
- }
- in_creds.session.keytype = KEYTYPE_DES;
- ret = krb5_get_credentials(ctx, 0, id, &in_creds, &out_creds);
- krb5_free_principal(ctx, in_creds.server);
- krb5_free_principal(ctx, in_creds.client);
- if(ret)
- return ret;
-
- memset(&c, 0, sizeof(c));
-
- if (0) {
- kvno = 256;
- auth_len = out_creds->ticket.length;
- auth = out_creds->ticket.data;
-
- } else {
- Ticket t5;
- int siz;
- char buf[2000];
-
- kvno = 213;
-
- ret = decode_Ticket(out_creds->ticket.data, out_creds->ticket.length,
- &t5, &siz);
- if (ret)
- return ret;
- if (t5.tkt_vno != 5)
- return -1;
-
- ret = encode_EncryptedData(buf + sizeof(buf) - 1, sizeof(buf),
- &t5.enc_part, &siz);
- if (ret)
- return ret;
-
- memmove(buf, buf + sizeof(buf) - siz, siz);
-
- auth_len = siz;
- auth = buf;
-
- free_Ticket(&t5);
- }
-
- if (out_creds->session.keyvalue.length != 8) {
- printf("a des key that isn't 8 bytes ?\n");
- return 1;
- }
-
- key = out_creds->session.keyvalue.data;
-
- printf("auth_len %d\n", auth_len);
-
- c.kvno = kvno; /* v5 */
- memcpy(c.session, key, sizeof(c.session));
- c.issue_date = out_creds->times.starttime;
- c.lifetime = krb_time_to_life(out_creds->times.starttime,
- out_creds->times.endtime);
-
- if (auth_len > MAX_KTXT_LEN) {
- printf("auth len too long %d\n", auth_len);
- return 1;
- }
-
- c.ticket_st.length = auth_len;
- memcpy(c.ticket_st.dat, auth, auth_len);
-
- ret = kafs_settoken("nxs.se", getuid(), &c);
- if (ret)
- printf("kafs_settoken failed with %d\n", ret);
-
- return ret;
-}
-#endif
-
-/*
- *
- */
-
-struct rx_connection *
-cbgetconn(const char *cell, const char *host, const char *portstr,
- uint32_t service, int auth)
-{
- struct rx_connection *conn;
- int portnum;
-
- if (portstr) {
- portnum = atoi(portstr);
- if (portnum == 0)
- errx(1, "invalid port number");
- } else
- portnum = afscallbackport;
-
- conn = arlalib_getconnbyname(cell, host, portnum, service,
- auth ? AUTHFLAGS_ANY : AUTHFLAGS_NOAUTH);
- if (conn == NULL)
- errx(1, "getconnbyname");
-
- return conn;
-}
-
-/*
- *
- */
-
-AT_STANDARD_SL_CMDS(afstool,cmds,"");
-
-/*
- * command table
- */
-
-static SL_cmd cmds[] = {
- { "apropos", afstool_apropos_cmd, "apropos"},
- { "cachemanager", cm_cmd, "query and modify cache manager"},
- { "cm" },
- { "fileserver", fs_cmd, "query and modify fileserver"},
- { "fs" },
- { "help", afstool_help_cmd, "print help"},
- { "?"},
- { "version", arlalib_version_cmd, "print version"},
- { "ubik", u_cmd, "query the ubiq data"},
- { NULL }
-};
-
-/*
- *
- */
-
-int
-main(int argc, char **argv)
-{
- Log_method *method;
-
- setprogname(argv[0]);
- tzset();
-
- setprogname(argv[0]);
-
- method = log_open (getprogname(), "/dev/stderr:notime");
- if (method == NULL)
- errx (1, "log_open failed");
- cell_init(0, method);
- ports_init();
- rx_Init(0);
-
-#if 0
- ret = set5tok();
- if (ret)
- printf("set5tok failed with %d\n", ret);
-#endif
-
- return afstool_cmd(argc, argv);
-}
diff --git a/usr.sbin/afs/src/appl/afstool/at_cachemgr.c b/usr.sbin/afs/src/appl/afstool/at_cachemgr.c
deleted file mode 100644
index f5fce4fde72..00000000000
--- a/usr.sbin/afs/src/appl/afstool/at_cachemgr.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2003, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "at_locl.h"
-
-RCSID("$arla: at_cachemgr.c,v 1.2 2003/03/05 14:22:17 lha Exp $");
-
-AT_STANDARD_SL_CMDS(cm,cm_cmds,"cachemanager");
-
-static SL_cmd cm_cmds[] = {
- { "apropos", cm_apropos_cmd, "apropos" },
- { "help", cm_help_cmd, "print help" },
- { "localcell", cm_localcell_cmd, "get cell of cachemanager" },
- { "whoareyou", cm_whoareyou_cmd, "who are you" },
- { "?"},
- { NULL }
-};
diff --git a/usr.sbin/afs/src/appl/afstool/at_cm_localcell.c b/usr.sbin/afs/src/appl/afstool/at_cm_localcell.c
deleted file mode 100644
index 5b7a241ced6..00000000000
--- a/usr.sbin/afs/src/appl/afstool/at_cm_localcell.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "at_locl.h"
-
-RCSID("$arla: at_cm_localcell.c,v 1.5 2003/03/05 14:55:47 lha Exp $");
-
-static int helpflag;
-static char *portstr = NULL;
-static char *cell = NULL;
-static int auth = 1;
-static int helpflag = 0;
-
-static struct getargs args[] = {
- {"port", 0, arg_string, &portstr, "what port to use", NULL},
- {"cell", 0, arg_string, &cell, "what cell to use", NULL},
- {"auth", 0, arg_negative_flag, &auth, "no authentication", NULL},
- {"help", 0, arg_flag, &helpflag, NULL, NULL}
-};
-
-static void
-usage(void)
-{
- char helpstring[100];
-
- snprintf(helpstring, sizeof(helpstring), "%s localcell", getprogname());
- arg_printusage(args, sizeof(args)/sizeof(args[0]), helpstring, "host ...");
-}
-
-int
-cm_localcell_cmd (int argc, char **argv)
-{
- struct rx_connection *conn;
- int optind = 0;
- int ret, i;
- char cellname[AFSNAMEMAX];
-
- if (getarg (args, sizeof(args)/sizeof(args[0]), argc, argv, &optind)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc == 0) {
- printf("missing host\n");
- return 0;
- }
-
- for (i = 0 ; i < argc; i++) {
- conn = cbgetconn(cell, argv[i], portstr, CM_SERVICE_ID, auth);
-
- ret = RXAFSCB_GetLocalCell(conn, cellname);
- if (ret == 0)
- printf("localcell: %s\n", cellname);
- else
- printf("%s returned %s %d\n", argv[i], koerr_gettext(ret), ret);
-
- arlalib_destroyconn(conn);
- argc--;
- argv++;
- }
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/afstool/at_cm_whoareyou.c b/usr.sbin/afs/src/appl/afstool/at_cm_whoareyou.c
deleted file mode 100644
index 3b04235104d..00000000000
--- a/usr.sbin/afs/src/appl/afstool/at_cm_whoareyou.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "at_locl.h"
-#include <rtbl.h>
-
-RCSID("$arla: at_cm_whoareyou.c,v 1.5 2003/03/05 14:55:48 lha Exp $");
-
-/*
- * Print the afs cache manager `name's interfaceAddress `addr'
- * information.
- */
-
-static void
-print_addr(const char *name, interfaceAddr *addr)
-{
- char uuid[1024];
- rtbl_t tbl;
- int i;
-
- printf("client %s\n\n", name);
-
- afsUUID_to_string(&addr->uuid, uuid, sizeof(uuid));
-
- printf(" uuid: %s\n\n", uuid);
-
- if (addr->numberOfInterfaces > AFS_MAX_INTERFACE_ADDR) {
- printf("too many addresses (%d)\n\n",
- addr->numberOfInterfaces);
- addr->numberOfInterfaces = AFS_MAX_INTERFACE_ADDR;
- } else if (addr->numberOfInterfaces == 0) {
- printf(" There is no addresses\n\n");
- return;
- } else if (addr->numberOfInterfaces == 1)
- printf(" There is one address\n\n");
- else
- printf(" Number of addresses is %d\n\n",
- addr->numberOfInterfaces);
-
- tbl = rtbl_create();
-
- rtbl_add_column(tbl, "Address", 0);
- rtbl_add_column(tbl, "Netmask", 0);
- rtbl_add_column(tbl, "MTU", 0);
-
- for (i = 0; i < addr->numberOfInterfaces ; i++) {
- struct in_addr in;
- char mtu[100];
-
- in.s_addr = addr->addr_in[i];
- rtbl_add_column_entry(tbl, "Address", inet_ntoa(in));
- in.s_addr = addr->subnetmask[i];
- rtbl_add_column_entry(tbl, "Netmask", inet_ntoa(in));
- snprintf(mtu, sizeof(mtu), "%d", addr->mtu[i]);
- rtbl_add_column_entry(tbl, "MTU", mtu);
- }
-
- rtbl_set_prefix (tbl, " ");
-
- rtbl_format(tbl, stdout);
-
- rtbl_destroy(tbl);
-}
-
-static int helpflag;
-static char *host = NULL;
-static char *portstr = NULL;
-static char *cell = NULL;
-static int auth = 1;
-static int helpflag = 0;
-
-
-static struct getargs args[] = {
- {"port", 0, arg_string, &portstr, "what port to use", NULL},
- {"cell", 0, arg_string, &cell, "what cell to use", NULL},
- {"auth", 0, arg_negative_flag, &auth, "no authentication", NULL},
- {"help", 0, arg_flag, &helpflag, NULL, NULL}
-};
-
-static void
-usage(void)
-{
- char helpstring[100];
-
- snprintf(helpstring, sizeof(helpstring), "%s whoareyou", getprogname());
- arg_printusage(args, sizeof(args)/sizeof(args[0]), helpstring, "host ...");
-}
-
-int
-cm_whoareyou_cmd (int argc, char **argv)
-{
- struct rx_connection *conn;
- interfaceAddr addr;
- int optind = 0;
- int ret, i;
-
- if (getarg (args, sizeof(args)/sizeof(args[0]), argc, argv, &optind)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc == 0) {
- printf("missing host\n");
- return 0;
- }
-
- for (i = 0 ; i < argc; i++) {
- conn = cbgetconn(cell, argv[i], portstr, CM_SERVICE_ID, auth);
-
- ret = RXAFSCB_WhoAreYou(conn, &addr);
- if (ret == 0)
- print_addr(host, &addr);
- else
- printf("%s returned %s %d\n", argv[i], koerr_gettext(ret), ret);
-
- arlalib_destroyconn(conn);
- argc--;
- argv++;
- }
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/afstool/at_fileserver.c b/usr.sbin/afs/src/appl/afstool/at_fileserver.c
deleted file mode 100644
index e000235f69a..00000000000
--- a/usr.sbin/afs/src/appl/afstool/at_fileserver.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2003, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "at_locl.h"
-
-RCSID("$arla: at_fileserver.c,v 1.5 2003/03/06 16:35:03 lha Exp $");
-
-AT_STANDARD_SL_CMDS(fs,fs_cmds,"fileserver");
-
-static SL_cmd fs_cmds[] = {
- { "apropos", fs_apropos_cmd, "apropos" },
- { "flushcps", fs_FlushCPS_cmd, "flush ip acls" },
- { "getcapabilities",fs_getcap_cmd,
- "get capabilities of fileserver" },
- { "gettime", fs_gettime_cmd, "get time" },
- { "help", fs_help_cmd, "print help" },
- { "?"},
- { NULL}
-};
diff --git a/usr.sbin/afs/src/appl/afstool/at_fs_flush_cps.c b/usr.sbin/afs/src/appl/afstool/at_fs_flush_cps.c
deleted file mode 100644
index 26fffda5c2e..00000000000
--- a/usr.sbin/afs/src/appl/afstool/at_fs_flush_cps.c
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright (c) 2003, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "at_locl.h"
-
-RCSID("$arla: at_fs_flush_cps.c,v 1.4 2003/03/10 20:58:07 lha Exp $");
-
-static char *cellname;
-static int auth;
-static int helpflag;
-static int verbose;
-static struct getarg_strings viceids_strings, hosts_strings;
-
-static struct getargs args[] = {
- {"viceids", 0, arg_strings, &viceids_strings, "id", NULL},
- {"hosts", 0, arg_strings, &hosts_strings, "host", NULL},
- {"cell", 0, arg_string, &cellname, "cell", NULL},
- {"auth", 0, arg_negative_flag, &auth, "don't authenticate", NULL},
- {"verbose", 0, arg_flag, &verbose, "verbose output", NULL},
- {"help", 0, arg_flag, &helpflag, NULL, NULL}
-};
-
-static void
-usage(void)
-{
- arg_printusage(args, sizeof(args)/sizeof(args[0]),
- "afstool fileserver flushcps", "fileserver ...");
-}
-
-int
-fs_FlushCPS_cmd(int argc, char **argv)
-{
- struct rx_connection *conn;
- int32_t viceids[FLUSHMAX];
- int32_t hosts[FLUSHMAX];
- arlalib_authflags_t auth;
- int32_t spare2,spare3;
- const char *cell;
- ViceIds vids;
- IPAddrs ipaddrs;
- int optind = 0;
- int i, ret;
-
- memset(viceids, 0, sizeof(vids));
- memset(hosts, 0, sizeof(hosts));
- memset(&vids, 0, sizeof(vids));
- memset(&ipaddrs, 0, sizeof(ipaddrs));
-
- conn = NULL;
-
- if (getarg (args, sizeof(args)/sizeof(args[0]), argc, argv, &optind)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- if (cellname)
- cell = cellname;
- else
- cell = cell_getthiscell();
-
- if (viceids_strings.num_strings == 0 && hosts_strings.num_strings == 0) {
- printf("missing viceid or hostid\n");
- return 0;
- }
-
- if (viceids_strings.num_strings > FLUSHMAX) {
- printf("too many vice id strings\n");
- return 0;
- }
-
- vids.len = 0;
- vids.val = viceids;
-
- for(i = 0; i < viceids_strings.num_strings; i++) {
- if (verbose)
- printf("viceid: %s\n", viceids_strings.strings[i]);
- ret = arlalib_get_viceid(viceids_strings.strings[i],
- cell, &vids.val[vids.len]);
- if (ret == 0) {
- if (verbose)
- printf("%s is userid %d\n",
- viceids_strings.strings[i], viceids[vids.len]);
- vids.len++;
- } else
- printf("failed to parse user `%s', got error %d\n",
- viceids_strings.strings[i], ret);
- }
-
- ipaddrs.len = 0;
- ipaddrs.val = hosts;
-
- for(i = 0; i < hosts_strings.num_strings; i++) {
- struct addrinfo hints, *res0, *res;
- int error;
-
- if (verbose)
- printf("hosts: %s\n", hosts_strings.strings[i]);
-
- memset (&hints, 0, sizeof(hints));
- hints.ai_family = PF_INET;
- hints.ai_socktype = SOCK_DGRAM;
-
- error = getaddrinfo(hosts_strings.strings[i], NULL, &hints, &res0);
- if (error) {
- fprintf (stderr, "Cannot find host %s: %s\n",
- hosts_strings.strings[i], gai_strerror(error));
- continue;
- }
-
- for (res = res0; res != NULL; res = res->ai_next) {
- if (res->ai_socktype == AF_INET)
- break;
- }
- if (res) {
- ipaddrs.val[ipaddrs.len] =
- ((struct sockaddr_in *)res->ai_addr)->sin_addr.s_addr;
- ipaddrs.len++;
- } else
- printf("Failed to find IPv4 address for %s.\n",
- hosts_strings.strings[i]);
-
- freeaddrinfo(res0);
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc == 0) {
- printf("no fileserver given\n");
- return 0;
- }
-
- for (i = 0; i < argc; i++) {
- struct rx_connection *conn;
- int32_t ret;
-
- if (verbose)
- printf("fileserver: %s\n", argv[i]);
-
- conn = cbgetconn(cell, argv[i], "7000", FS_SERVICE_ID, auth);
- if (conn == NULL) {
- printf("failed to get conn for %s", argv[i]);
- continue;
- }
-
- ret = RXAFS_FlushCPS(conn, &vids, &ipaddrs, 0, &spare2, &spare3);
- if (ret)
- printf("FlushCPS failed with %d for host %s", ret, argv[i]);
-
- arlalib_destroyconn(conn);
- }
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/afstool/at_fs_getcap.c b/usr.sbin/afs/src/appl/afstool/at_fs_getcap.c
deleted file mode 100644
index f572a980c28..00000000000
--- a/usr.sbin/afs/src/appl/afstool/at_fs_getcap.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2003, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "at_locl.h"
-
-RCSID("$arla: at_fs_getcap.c,v 1.2 2003/03/06 17:09:40 lha Exp $");
-
-static char *cellname;
-static int auth = 1;
-static int helpflag;
-static int verbose;
-
-static struct getargs args[] = {
- {"cell", 0, arg_string, &cellname, "cell", NULL},
- {"auth", 0, arg_negative_flag, &auth, "don't authenticate", NULL},
- {"verbose", 0, arg_flag, &verbose, "verbose output", NULL},
- {"help", 0, arg_flag, &helpflag, NULL, NULL}
-};
-
-static void
-usage(void)
-{
- arg_printusage(args, sizeof(args)/sizeof(args[0]),
- "afstool fileserver getcap", "fileserver ...");
-}
-
-struct units cap1[] = {
- { "UAE", 0x1 },
- { NULL }
-};
-
-static void
-print_cap_flags(Capabilities *capabilities, int num, const struct units *cap)
-{
- char buf[1024];
- assert(num > 0);
-
- if (capabilities->len < num)
- return;
-
- unparse_flags(capabilities->val[num - 1], cap, buf, sizeof(buf));
- printf("\t%s\n", buf);
-}
-
-
-int
-fs_getcap_cmd(int argc, char **argv)
-{
- const char *cell;
- int optind = 0;
- int ret, i;
-
- if (getarg (args, sizeof(args)/sizeof(args[0]), argc, argv, &optind)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- if (cellname)
- cell = cellname;
- else
- cell = cell_getthiscell();
-
- argc -= optind;
- argv += optind;
-
- if (argc == 0) {
- printf("no fileserver given\n");
- return 0;
- }
-
- for (i = 0; i < argc; i++) {
- struct rx_connection *conn;
- Capabilities capabilities;
-
- if (verbose)
- printf("fileserver: %s\n", argv[i]);
-
- conn = cbgetconn(cell, argv[i], "7000", FS_SERVICE_ID, auth);
- if (conn == NULL) {
- printf("failed to get conn for %s", argv[i]);
- continue;
- }
-
- capabilities.len = 0;
- capabilities.val = NULL;
- ret = RXAFS_GetCapabilities(conn, &capabilities);
- if (ret == RXGEN_OPCODE) {
- printf("fileserver %s doesn't support capabilities\n", argv[i]);
- } else if (ret) {
- printf("GetCapabilities failed with %d for host %s\n",
- ret, argv[i]);
- } else if (capabilities.len == 0) {
- printf("%s support capabilities but doesn't list any\n", argv[i]);
- } else {
- int j;
-
- printf("%s supports:\n", argv[i]);
- print_cap_flags(&capabilities, 1, cap1);
-
- if (verbose)
- for (j = 0; j < capabilities.len; j++)
- printf("\tcap flags %d: 0x%08x\n", j, capabilities.val[j]);
- }
-
- free(capabilities.val);
- arlalib_destroyconn(conn);
- }
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/afstool/at_fs_gettime.c b/usr.sbin/afs/src/appl/afstool/at_fs_gettime.c
deleted file mode 100644
index c777c1bfb42..00000000000
--- a/usr.sbin/afs/src/appl/afstool/at_fs_gettime.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2003, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "at_locl.h"
-
-RCSID("$arla: at_fs_gettime.c,v 1.4 2003/03/08 02:05:02 lha Exp $");
-
-static char *cellname;
-static int auth = 1;
-static int helpflag;
-static int verbose;
-
-static struct getargs args[] = {
- {"cell", 0, arg_string, &cellname, "cell", NULL},
- {"auth", 0, arg_negative_flag, &auth, "don't authenticate", NULL},
- {"verbose", 0, arg_flag, &verbose, "verbose output", NULL},
- {"help", 0, arg_flag, &helpflag, NULL, NULL}
-};
-
-static void
-usage(void)
-{
- arg_printusage(args, sizeof(args)/sizeof(args[0]),
- "afstool fileserver gettime", "");
-}
-
-int
-fs_gettime_cmd(int argc, char **argv)
-{
- const char *cell;
- int32_t sec, msec;
- int optind = 0;
- int i, ret;
-
- if (getarg (args, sizeof(args)/sizeof(args[0]), argc, argv, &optind)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- if (cellname)
- cell = cellname;
- else
- cell = cell_getthiscell();
-
- argc -= optind;
- argv += optind;
-
- if (argc == 0) {
- printf("no fileserver given\n");
- return 0;
- }
-
- mini_cachemanager_init();
-
- for (i = 0; i < argc; i++) {
- struct rx_connection *conn;
- char timebuf[128];
- struct tm t;
- time_t ti;
-
- if (verbose)
- printf("fileserver: %s\n", argv[i]);
-
- conn = cbgetconn(cell, argv[i], "7000", FS_SERVICE_ID, auth);
- if (conn == NULL) {
- printf("failed to get conn for %s", argv[i]);
- continue;
- }
-
- ret = RXAFS_GetTime(conn, &sec, &msec);
- if (ret)
- printf("GetTime failed with %d for host %s", ret, argv[i]);
-
- ti = sec;
- if (strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S %Z",
- localtime_r(&ti, &t)) > 0)
- printf("%s time is %s", argv[i], timebuf);
- printf("\n");
-
- arlalib_destroyconn(conn);
- }
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/afstool/at_locl.h b/usr.sbin/afs/src/appl/afstool/at_locl.h
deleted file mode 100644
index 39beeed742c..00000000000
--- a/usr.sbin/afs/src/appl/afstool/at_locl.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2002 - 2003, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include <getarg.h>
-#include <vers.h>
-
-#include <afs_uuid.h>
-#include <cb.cs.h>
-
-/* $arla: at_locl.h,v 1.7 2003/03/06 16:35:06 lha Exp $ */
-
-void mini_cachemanager_init (void);
-
-#define AT_SL_CMD(commandname) int commandname##_cmd(int, char **)
-
-AT_SL_CMD(afstool);
-AT_SL_CMD(cm);
-AT_SL_CMD(cm_whoareyou);
-AT_SL_CMD(cm_localcell);
-AT_SL_CMD(fs);
-AT_SL_CMD(fs_FlushCPS);
-AT_SL_CMD(fs_gettime);
-AT_SL_CMD(fs_getcap);
-AT_SL_CMD(u);
-AT_SL_CMD(u_debug);
-
-struct rx_connection *
-cbgetconn(const char *, const char *, const char *, uint32_t, int);
-
-
-#define AT_STANDARD_SL_CMDS(at_std_name,at_std_cmds,at_std_str) \
- \
-static SL_cmd at_std_cmds[]; \
- \
-static int \
-at_std_name##_help_cmd(int argc, char **argv) \
-{ \
- sl_help(at_std_cmds, argc, argv); \
- return 0; \
-} \
- \
-static int \
-at_std_name##_apropos_cmd(int argc, char **argv) \
-{ \
- if (argc < 2) { \
- printf ("apropos: missing topic\n"); \
- return 0; \
- } \
- \
- sl_apropos(at_std_cmds, argv[1]); \
- return 0; \
-} \
- \
-int \
-at_std_name##_cmd(int argc, char **argv) \
-{ \
- int ret; \
- \
- if (argc < 2) { \
- char *str; \
- asprintf(&str, "%s%s%s", getprogname(), \
- at_std_str[0] == '\0' ? "": " ", \
- at_std_str); \
- print_version(getprogname()); \
- printf("\nusage:\t%s command ...\n", str); \
- printf("\ttry \"%s help\" for help\n", str); \
- free(str); \
- exit (1); \
- } \
- \
- ret = sl_command(at_std_cmds, argc - 1, argv + 1); \
- if (ret != 0) \
- sl_help(at_std_cmds, argc, argv); \
- \
- return 0; \
-}
diff --git a/usr.sbin/afs/src/appl/afstool/at_mini_cm.c b/usr.sbin/afs/src/appl/afstool/at_mini_cm.c
deleted file mode 100644
index 02053eba389..00000000000
--- a/usr.sbin/afs/src/appl/afstool/at_mini_cm.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Copyright (c) 1999 - 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "at_locl.h"
-#include "cb.ss.h"
-
-RCSID("$arla: at_mini_cm.c,v 1.1 2003/03/05 11:41:24 lha Exp $");
-
-/*
- * Each client need a callbackserver, here we go...
- */
-
-int
-SRXAFSCB_Probe (struct rx_call *a_rxCallP)
-{
- return 0;
-}
-
-int
-SRXAFSCB_InitCallBackState (struct rx_call *a_rxCallP)
-{
- return 0;
-}
-
-int
-SRXAFSCB_CallBack (struct rx_call *a_rxCallP,
- const AFSCBFids *a_fidArrayP,
- const AFSCBs *a_callBackArrayP)
-{
- return 0;
-}
-
-
-int
-SRXAFSCB_GetLock(struct rx_call *a_rxCallP,
- int32_t index,
- AFSDBLock *lock)
-{
- return 1;
-}
-
-int
-SRXAFSCB_GetCE(struct rx_call *a_rxCallP,
- int32_t index,
- AFSDBCacheEntry *dbentry)
-{
- return 1;
-}
-
-int
-SRXAFSCB_XStatsVersion(struct rx_call *a_rxCallP,
- int32_t *version)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_GetXStats(struct rx_call *a_rxCallP,
- int32_t client_version_num,
- int32_t collection_number,
- int32_t *server_version_number,
- int32_t *time,
- AFSCB_CollData *stats)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_InitCallBackState2(struct rx_call *a_rxCallP,
- interfaceAddr *addr)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_WhoAreYou(struct rx_call *a_rxCallP,
- interfaceAddr *addr)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_InitCallBackState3(struct rx_call *a_rxCallP,
- const afsUUID *server_uuid)
-{
- return 0;
-}
-
-int
-SRXAFSCB_ProbeUUID(struct rx_call *a_rxCallP,
- const afsUUID *uuid)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_GetCellServDB(struct rx_call *a_rxCallP,
- const int32_t cellIndex,
- char *cellName,
- serverList *cellHosts)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_GetLocalCell(struct rx_call *a_rxCallP,
- char *cellName)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_GetCacheConfig(struct rx_call *a_rxCallP,
- const uint32_t callerVersion,
- uint32_t *serverVersion,
- uint32_t *configCount,
- cacheConfig *config)
-{
- *serverVersion = 0;
- *configCount = 0;
- config->len = 0;
- config->val = NULL;
-
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_GetCellByNum(struct rx_call *call,
- const int32_t cellNumber,
- char *cellName,
- serverList *cellHosts)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_TellMeAboutYourself(struct rx_call *call,
- struct interfaceAddr *addr,
- Capabilities *capabilities)
-{
- capabilities->len = 0;
- capabilities->val = NULL;
- return RXGEN_OPCODE;
-}
-
-void
-mini_cachemanager_init (void)
-{
- static struct rx_securityClass *nullSecObjP;
- static struct rx_securityClass *(securityObjects[1]);
-
- nullSecObjP = rxnull_NewClientSecurityObject ();
- if (nullSecObjP == NULL) {
- printf("Cannot create null security object.\n");
- return;
- }
-
- securityObjects[0] = nullSecObjP;
-
- if (rx_NewService (0, CM_SERVICE_ID, "cm", securityObjects,
- sizeof(securityObjects) / sizeof(*securityObjects),
- RXAFSCB_ExecuteRequest) == NULL ) {
- printf("Cannot install service.\n");
- return;
- }
- rx_StartServer (0);
-}
diff --git a/usr.sbin/afs/src/appl/afstool/at_u_debug.c b/usr.sbin/afs/src/appl/afstool/at_u_debug.c
deleted file mode 100644
index f915e5b3dc8..00000000000
--- a/usr.sbin/afs/src/appl/afstool/at_u_debug.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Copyright (c) 1998 - 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "at_locl.h"
-
-RCSID("$arla: at_u_debug.c,v 1.3 2003/03/08 02:03:42 lha Exp $");
-
-static int verbose;
-static char *cell;
-static char *portstr;
-static int auth = 1;
-static int helpflag;
-
-static const char *
-myctime(time_t time, char *datestr, size_t sz)
-{
- struct tm tm;
- if (strftime (datestr, sz, "%Y-%m-%d %H:%M:%S %Z",
- localtime_r(&time, &tm)) <= 0)
- strlcpy(datestr, "unknown-time", sz);
- return datestr;
-}
-
-static int
-probehost(struct rx_connection *conn, arlalib_authflags_t auth)
-{
- struct in_addr server;
- ubik_debug db;
- uint16_t port;
- int error;
-
- server.s_addr = rx_HostOf(rx_PeerOf(conn));
- port = rx_PortOf(rx_PeerOf(conn));
-
- error = Ubik_Debug(conn, &db);
- if (error)
- return error;
-
-#define ABS_COMP_DB(dbname,field) (abs(db.now - dbname.field))
-
- {
- struct timeval tv;
- char datestring[128];
-
- gettimeofday(&tv, NULL);
-
- printf("Host %s time is %s\n",
- inet_ntoa(server),
- myctime(db.now, datestring, sizeof(datestring)));
- printf("Localtime is %s, differ %d seconds\n",
- myctime(tv.tv_sec, datestring, sizeof(datestring)),
- abs(db.now - tv.tv_sec));
- server.s_addr = htonl(db.syncHost);
- printf("Last yes vote for %s secs was %d ago (at %s)\n",
- inet_ntoa(server),
- ABS_COMP_DB(db,lastYesTime),
- myctime(db.lastYesTime, datestring, sizeof(datestring)));
- printf("Last vote started %d secs ago (at %s)\n",
- ABS_COMP_DB(db,syncTime),
- myctime(db.lastYesTime, datestring, sizeof(datestring)));
- printf("Local db version is %u.%u\n",
- db.localVersion.epoch,
- db.localVersion.counter);
- printf("Syncsite db version is %u.%u\n",
- db.syncVersion.epoch,
- db.syncVersion.counter);
- printf("%d locked pages, %d of them for write\n",
- db.anyReadLocks + db.anyWriteLocks, db.anyWriteLocks);
-
- if (db.amSyncSite) {
-
- printf("I'm the synchost for %d seconds more (%s)\n",
- db.syncSiteUntil - db.now,
- myctime(db.syncSiteUntil, datestring, sizeof(datestring)));
- } else if (db.syncHost == 0) {
- printf("I'm not the synchost and I don't know who is either!!!\n");
- } else {
- server.s_addr = htonl(db.syncHost);
- printf("I'm not the synchost, but %s is.\n",
- inet_ntoa(server));
- }
-
- if ((verbose && db.syncHost != 0) || db.amSyncSite) {
- int i,j;
- ubik_sdebug sdb;
-
- if (!db.amSyncSite) {
- struct rx_connection *sync_conn;
-
- sync_conn = arlalib_getconnbyaddr(NULL, server.s_addr,
- NULL, port,
- VOTE_SERVICE_ID, auth);
- if (conn == NULL)
- return ENETDOWN;
- error = Ubik_Debug(conn, &db);
- if (error)
- return error;
-
- arlalib_destroyconn(sync_conn);
- }
-
- printf("Recover state is 0x%x\n", db.recoveryState);
- printf("Last time a new db version was laballed was:\n"
- "\t\t%d secs ago (at %s)\n\n",
- ABS_COMP_DB(db,epochTime),
- myctime(db.epochTime, datestring, sizeof(datestring)));
-
- for (i = 0; i < db.nServers - 1; i++) {
-
- error = Ubik_SDebug(conn, i, &sdb);
- if (error) {
- printf("Problem with host %d\n\n", i);
- continue;
- }
-
- server.s_addr = htonl(sdb.addr);
- printf("Server (%s", inet_ntoa(server));
- for(j = 0; (sdb.altAddr[j] && (j < UBIK_MAX_INTERFACE_ADDR-1)) ; j++) {
- server.s_addr = htonl(sdb.altAddr[j]);
- printf(" %s", inet_ntoa(server));
- }
- printf("): (db %u.%u)\n",
- sdb.remoteVersion.epoch,
- sdb.remoteVersion.counter);
- printf("\tlast vote recived %d secs ago (at %s)\n",
- ABS_COMP_DB(sdb,lastVoteTime),
- myctime(sdb.lastVoteTime,
- datestring, sizeof(datestring)));
- printf("\tlast beacon sent %d secs ago (at %s)\n",
- ABS_COMP_DB(sdb,lastBeaconSent),
- myctime(sdb.lastBeaconSent,
- datestring, sizeof(datestring)));
- printf("\tdbcurrent=%d, up=%d, beaconSince=%u\n",
- sdb.currentDB,
- sdb.up,
- sdb.beaconSinceDown);
-
- printf("\n");
-
- }
- }
- }
- return 0;
-}
-
-static struct getargs args[] = {
- {"verbose", 0, arg_flag, &verbose, "verbose", NULL},
- {"port", 0, arg_string, &portstr, "what port to use", NULL},
- {"cell", 0, arg_string, &cell, "what cell to use", NULL},
- {"auth", 0, arg_negative_flag, &auth, "no authentication", NULL},
- {"help", 0, arg_flag, &helpflag, NULL, NULL}
-};
-
-static void
-usage(void)
-{
- char helpstring[100];
-
- snprintf(helpstring, sizeof(helpstring), "%s ubik debug", getprogname());
- arg_printusage(args, sizeof(args)/sizeof(args[0]), helpstring, "host ...");
-}
-
-int
-u_debug_cmd (int argc, char **argv)
-{
- int optind = 0;
- int i;
-
- if (getarg (args, sizeof(args)/sizeof(args[0]), argc, argv, &optind)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (portstr == NULL)
- portstr = "7003";
-
- if (argc == 0) {
- printf("missing host\n");
- return 0;
- }
-
- for (i = 0 ; i < argc; i++) {
- struct rx_connection *conn;
- int ret;
-
- if (verbose)
- printf("Host: %s\n", argv[i]);
-
- conn = cbgetconn(cell, argv[i], portstr, VOTE_SERVICE_ID, auth);
-
- ret = probehost(conn, auth ? AUTHFLAGS_ANY : AUTHFLAGS_NOAUTH);
- if (ret)
- printf("\n%s returned %s %d\n", argv[i], koerr_gettext(ret), ret);
-
- arlalib_destroyconn(conn);
- }
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/afstool/at_ubik.c b/usr.sbin/afs/src/appl/afstool/at_ubik.c
deleted file mode 100644
index 49080a2bcdc..00000000000
--- a/usr.sbin/afs/src/appl/afstool/at_ubik.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2003, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "at_locl.h"
-
-RCSID("$arla: at_ubik.c,v 1.1 2003/03/05 14:22:23 lha Exp $");
-
-AT_STANDARD_SL_CMDS(u,u_cmds,"ubik");
-
-static SL_cmd u_cmds[] = {
- { "apropos", u_apropos_cmd, "apropos" },
- { "debug", u_debug_cmd, "print debug information" },
- { "help", u_help_cmd, "print help" },
- { "?"},
- { NULL}
-};
diff --git a/usr.sbin/afs/src/appl/afsutils/Makefile.in b/usr.sbin/afs/src/appl/afsutils/Makefile.in
deleted file mode 100644
index 1ef2c4b2014..00000000000
--- a/usr.sbin/afs/src/appl/afsutils/Makefile.in
+++ /dev/null
@@ -1,167 +0,0 @@
-# $KTH: Makefile.in,v 1.15.2.3 2001/10/23 23:47:41 ahltorp Exp $
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-LN_S = @LN_S@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-mandir = @mandir@
-transform = @program_transform_name@
-EXECSUFFIX = @EXECSUFFIX@
-
-APPL_BIN = aklog klog tokens unlog up
-MANPAGES = tokens.1 unlog.1 aklog.1 klog.1
-
-DEFS = @DEFS@
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-X_CFLAGS = @X_CFLAGS@
-LDFLAGS = @LDFLAGS@
-
-ETAGS = etags
-MAKEDEPEND = makedepend
-RXKADINC = -I$(srcdir)/../../rxkad
-INCLUDES = -I$(srcdir)/../.. \
- -I$(srcdir)/../../include \
- -I$(srcdir)/../lib \
- -I$(srcdir)/../../lib/cmd \
- -I../../include \
- -I../../rxdef \
- -I. \
- $(KERNEL_INCLUDE) \
- -I$(srcdir)/../../xfs/include \
- -I$(srcdir)/../../arlad \
- $(RXKADINC)
-
-DEFINES =
-REALCFLAGS = $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) \
- $(X_CFLAGS) @PLWP_INC_FLAGS@ @INC_roken@
-RXKAD_LIBS = @MILKO_RXKAD_LIBS@
-KERNEL_INCLUDE = @KERNEL_INCLUDE@
-KAFS_LIBS = @AIX_EXTRA_KAFS@ @KAFS_LIBS@
-LIBS = -L../lib -larlalib \
- -L../../rxdef -lrxdefclient \
- -L../../lib/cmd -lcmd \
- -L../../rx -lrx \
- -L../../lwp -llwp @PLWP_LIB_FLAGS@ \
- -L../../lib/ko -lko -L../../util -lutil \
- @LIB_roken@ \
- $(RXKAD_LIBS) \
- $(KAFS_LIBS) \
- $(RXKAD_LIBS) @LIBS@
-
-LIBDEPENDS = ../../rxdef/librxdefclient.a ../../rx/librx.a ../../lwp/liblwp.a \
- ../../util/libutil.a ../../lib/sl/libsl.a \
- ../../lib/ko/libko.a ../lib/libarlalib.a
-
-PROGS = aklog klog sys tokens unlog up
-AKLOG_SRCS = aklog.c
-KLOG_SRCS = klog.c
-SYS_SRCS = sys.c
-TOKENS_SRCS = tokens.c
-UNLOG_SRCS = unlog.c
-UP_SRCS = up.c
-SRCS = $(AKLOG_SRCS) \
- $(KLOG_SRCS) \
- $(SYS_SRCS) \
- $(TOKENS_SRCS) \
- $(UNLOG_SRCS) \
- $(UP_SRCS)
-AKLOG_OBJS = aklog.o
-KLOG_OBJS = klog.o
-SYS_OBJS = sys.o
-TOKENS_OBJS = tokens.o
-UNLOG_OBJS = unlog.o
-UP_OBJS = up.o
-HDRS =
-
-all: $(PROGS)
-
-.PHONY: all install uninstall depend tags clean
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(bindir) ; \
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(bindir)/$$f; \
- done ;\
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir) ; \
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$$e ; \
- $(INSTALL_DATA) $(srcdir)/$$x \
- $(DESTDIR)$(mandir)/man$$e/$$f.$$e; \
- done
-
-
-uninstall:
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
- done ; \
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- rm -rf $(DESTDIR)$(mandir)/$$f.$$e; \
- done
-
-
-aklog: $(AKLOG_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(AKLOG_OBJS) $(LIBS)
-
-klog: $(KLOG_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(KLOG_OBJS) $(LIBS)
-
-sys: $(SYS_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(SYS_OBJS) $(LIBS)
-
-tokens: $(TOKENS_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(TOKENS_OBJS) $(LIBS)
-
-unlog: $(UNLOG_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(UNLOG_OBJS) $(LIBS)
-
-up: $(UP_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(UP_OBJS) $(LIBS)
-
-Makefile: Makefile.in ../../config.status
- cd ../..; CONFIG_FILES=appl/afsutils/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(CFILES)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(PROGS) $(OBJS) *~ *.o core
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/appl/afsutils/README.afsutils b/usr.sbin/afs/src/appl/afsutils/README.afsutils
deleted file mode 100644
index 00321f13db8..00000000000
--- a/usr.sbin/afs/src/appl/afsutils/README.afsutils
+++ /dev/null
@@ -1,61 +0,0 @@
-These are re-implementations of the traditional user utilities 'klog',
-'tokens', and 'unlog' from AFS. The code is mostly written from scratch
-with the appropriate bits of glue and insight taken from KTH-KRB.
-
-The main goal in writing these programs was to achieve maximum
-compatibility with the original programs by the same name (minus any truly
-stupid bugs or security holes). In many cases, I believe users will find
-themselves in a heterogeneous environment where Arla will be used
-alongside the official AFS client on different machines, but with the same
-shared user accounts.
-
-It is not reasonable to expect such users to be forced to learn different
-syntax for the same commands on both platforms. Indeed, even small
-semantic differences quickly annoy users, and mercilessly cause scripts to
-break.
-
-While it is possible to do much of what these programs can do by using
-script wrappers on the programs from KTH-KRB, it is not possible to get
-100% of the features.
-
-These features include:
-
-[ klog ]
- - looking up the correct ViceId for the stored token, so that the
- output of 'tokens' is more meaningful for those with access to
- several AFS accounts
-
- - a new -timeout option, so that authentication won't hang forever
- if the network is down
-
- - support for the -pipe and -setpag options from the original klog
-
-[ tokens ]
- - the return code of the program can be used from a script to find
- out if any (valid) tokens are present
-
- - the output format is identical to the original 'tokens' by
- default
-
-[ unlog ]
- - you can now unlog yourself from one or more cells only, leaving
- the rest of your tokens intact
-
-
-appl/klog.c
-appl/klog.h
-appl/tokens.c
-appl/tokens.h
-appl/unlog.c
-appl/unlog.h
-doc/README.afsutils
-doc/TODO.afsutils
-man/klog.1
-man/tokens.1
-man/unlog.1
-
-
-Enjoy,
-
-Chris Wing
-wingc@engin.umich.edu
diff --git a/usr.sbin/afs/src/appl/afsutils/TODO.afsutils b/usr.sbin/afs/src/appl/afsutils/TODO.afsutils
deleted file mode 100644
index 54abb86bad8..00000000000
--- a/usr.sbin/afs/src/appl/afsutils/TODO.afsutils
+++ /dev/null
@@ -1,23 +0,0 @@
-[general]
- - man pages don't format right on >80 column terminal
-
- - check to see if these programs break any scripts written for
- official AFS utilities
-
- - (tokens, unlog) Is 128 bytes always enough to hold a token?
-
-[klog]
- - deal properly with cells where the realm name differs from the
- name of cell
-
- - make -servers option actually try to get a TGT/token from
- listed servers
-
- ( fixing the above problems will require hacking in the Kerberos
- library, not Arla )
-
- - it might be nice to make klog still work even if the AFS
- client isn't there (and still get a Kerberos TGT, etc.)
-
-[unlog]
- - new pioctl to remove one token at a time?
diff --git a/usr.sbin/afs/src/appl/afsutils/aklog.1 b/usr.sbin/afs/src/appl/afsutils/aklog.1
deleted file mode 100644
index 3173059bb92..00000000000
--- a/usr.sbin/afs/src/appl/afsutils/aklog.1
+++ /dev/null
@@ -1,119 +0,0 @@
-.\" Copyright (c) 2000 Kungliga Tekniska Högskolan
-.\" (Royal Institute of Technology, Stockholm, Sweden).
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" 3. Neither the name of the Institute nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $arla: aklog.1,v 1.8 2003/06/04 12:08:45 tol Exp $
-.\"
-.Dd August 06, 2000
-.Dt AKLOG 1
-.Os "The Arla Project"
-.Sh NAME
-.Nm aklog
-.Nd
-Fetches tokens from your ticket-file.
-.Sh SYNOPSIS
-.Nm
-.Op Fl cell Ar <cell name>
-.Op Fl createuser Ar <cell name>
-.Op Fl debug Ar <cell name>
-.Op Fl help Ar <cell name>
-.Op Fl hosts Ar <cell name>
-.Op Fl krbrealm Ar <cell name>
-.Op Fl noprdb Ar <cell name>
-.Op Fl path Ar <cell name>
-.Op Fl quiet Ar <cell name>
-.Op Fl unlog Ar <cell name>
-.Op Fl version Ar <cell name>
-.Op Fl zsubs Ar <cell name>
-.Ar <cell or path>
-.Sh DESCRIPTION
-Supported options:
-.Bl -tag -width Ds
-.It Fl cell Ar <cell name>
-cell to authenticate to
-.It Fl createuser Ar <cell name>
-create PTS user in remote cell
-.It Fl debug Ar <cell name>
-print debugging information
-.It Fl help Ar <cell name>
-print help
-.It Fl hosts Ar <cell name>
-print host address information (unimplemented)
-.It Fl krbrealm Ar <cell name>
-kerberos realm for cell
-.It Fl noprdb Ar <cell name>
-don't try to determine AFS ID
-.It Fl path Ar <cell name>
-AFS path to authenticate to
-.It Fl quiet Ar <cell name>
-fail silently if no ticket cache
-.It Fl unlog Ar <cell name>
-discard tokens
-.It Fl version Ar <cell name>
-print version
-.It Fl zsubs Ar <cell name>
-update zephyr subscriptions (unimplemented)
-.El
-.Sh ENVIRONMENT
-.Nm
-will look at the environment variable
-.Ev AFSCELL
-for the default cellname.
-If will also use
-.Ev HOME
-to find the file ~/.TheseCells
-.Sh FILES
-.Nm
-will look for the files
-.Pa ThisCell ,
-.Pa TheseCells ,
-and
-.Pa CellServDB
-in the directories
-.Pa /usr/arla/etc
-and
-.Pa /usr/vice/etc
-.Sh DIAGNOSTICS
-For debugging you can use the flag
-.Ar Fl d
-for debugging.
-.Pp
-.Bd -literal
-datan# aklog -d
-aklog: get_afs_id for lha in cell e.kth.se using pts-db
-aklog: get_afs_id for lha@e.kth.se in cell stacken.kth.se using pts-db
-aklog: get_afs_id for lha@e.kth.se in cell nada.kth.se using pts-db
-aklog: get_afs_id for lha@e.kth.se in cell pdc.kth.se using pts-db
-.Ed
-.Sh SEE ALSO
-.Xr aklog 1,
-.Xr klog 1 ,
-.Xr tokens 1 ,
-.Xr unlog 1
diff --git a/usr.sbin/afs/src/appl/afsutils/aklog.c b/usr.sbin/afs/src/appl/afsutils/aklog.c
deleted file mode 100644
index cd93056b41e..00000000000
--- a/usr.sbin/afs/src/appl/afsutils/aklog.c
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * allbery@ece.cmu.edu 2000-05-13
- * Lifted from kth-krb, bodged parts of klog.c into it. The result is that
- * it gets the AFS token for your Kerberos principal, not your user ID.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-RCSID("$arla: aklog.c,v 1.10 2002/04/26 16:11:39 lha Exp $");
-
-#include "appl_locl.h"
-#include "kafs.h"
-
-#ifndef KERBEROS
-
-int
-main(int argc, char **argv)
-{
- errx (1, "Kerberos support isn't compiled in");
- return 1;
-}
-
-#else
-
-#ifndef HAVE_KRB_AFSLOG_UID
-static int
-krb_afslog_uid (const char *cell, const char *realm, uid_t afsid)
-{
- return k_afsklog_uid(cell, realm, afsid);
-}
-#endif
-
-#ifndef HAVE_KRB_GET_DEFAULT_PRINCIPAL
-
-/* stolen from krb4's lib/krb/get_default_principal.c */
-
-static int
-krb_get_default_principal(char *name, char *instance, char *realm)
-{
- char *file;
- int ret;
- char *p;
-
- file = tkt_string ();
-
- ret = krb_get_tf_fullname(file, name, instance, realm);
- if(ret == KSUCCESS)
- return 0;
-
- p = getenv("KRB4PRINCIPAL");
- if(p && kname_parse(name, instance, realm, p) == KSUCCESS)
- return 1;
-
-#ifdef HAVE_PWD_H
- {
- struct passwd *pw;
- pw = getpwuid(getuid());
- if(pw == NULL){
- return -1;
- }
-
- strlcpy (name, pw->pw_name, ANAME_SZ);
- strlcpy (instance, "", INST_SZ);
- krb_get_lrealm(realm, 1);
-
- if(strcmp(name, "root") == 0) {
- p = NULL;
-#if defined(HAVE_GETLOGIN) && !defined(POSIX_GETLOGIN)
- p = getlogin();
-#endif
- if(p == NULL)
- p = getenv("USER");
- if(p == NULL)
- p = getenv("LOGNAME");
- if(p){
- strlcpy (name, p, ANAME_SZ);
- strlcpy (instance, "root", INST_SZ);
- }
- }
- return 1;
- }
-#else
- return -1;
-#endif
-}
-#endif
-
-static int debug = 0;
-
-static void __attribute__((format (printf, 1, 2)))
-DEBUG (const char *fmt, ...)
-{
- va_list ap;
- if (debug) {
- va_start(ap, fmt);
- vwarnx(fmt, ap);
- va_end(ap);
- }
-}
-
-static char krb_name[ANAME_SZ];
-static char krb_instance[INST_SZ];
-static char krb_realm[REALM_SZ];
-static char name_inst[ANAME_SZ+INST_SZ+2];
-static char *arg_cell = NULL;
-static int arg_createuser = 0;
-static int arg_debug = 0;
-static int arg_help = 0;
-static int arg_hosts = 0;
-static char *arg_realm = NULL;
-static int arg_noprdb = 0;
-static char *arg_path = NULL;
-static int arg_quiet = 0;
-static int arg_unlog = 0;
-static int arg_version = 0;
-static int arg_zsubs = 0;
-
-/*
- * Figure out the AFS ID of a user name
- */
-
-static uint32_t
-get_afs_id (const char *username, const char *cell, int dontuseafs_p)
-{
- int32_t returned_id;
- int ret;
- struct passwd *pwd;
-
- DEBUG ("get_afs_id for %s in cell %s %susing pts-db", username, cell,
- dontuseafs_p ? "not ": "");
-
- if (dontuseafs_p == 0) {
- ret = arlalib_get_viceid (username, cell, &returned_id);
- if (ret == 0)
- return returned_id;
- DEBUG ("arlalib_get_viceid failed with: %s (%d).",
- koerr_gettext(ret), ret);
- }
-
- /*
- * If we failed to talk to any server, try various stupid means of
- * guessing the AFS ID
- */
-
- pwd = getpwnam(krb_name);
- if(pwd == NULL) {
- returned_id = getuid();
- warnx ("Couldn't get AFS ID for %s%s, using current UID (%d)",
- username, cell, returned_id);
- } else {
- returned_id = pwd->pw_uid;
- warnx ("Couldn't get AFS ID for %s@%s, using %d "
- "from /etc/passwd",
- username, cell, returned_id);
- }
- return (returned_id);
-}
-
-static int
-createuser (const char *username, const char *remotecell)
-{
- char cmd[1024];
-
- snprintf (cmd, sizeof(cmd), "pts createuser %s -cell %s",
- username, remotecell);
- DEBUG("Executing %s", cmd);
- return system(cmd);
-}
-
-static void
-get_tokens (const char **cells,
- const char *localcell,
- const char *realm)
-{
- uint32_t afsid;
- int rc;
-
- while (*cells) {
- char *username;
- /*
- * If the `*cells' isn't local cell, try the username
- * `username@localcell'
- */
- if (strcasecmp (localcell, *cells) != 0)
- asprintf (&username, "%s@%s", name_inst, localcell);
- else
- username = name_inst;
-
- afsid = get_afs_id (username, *cells, arg_noprdb);
- rc = krb_afslog_uid(*cells, realm, afsid);
- if (rc)
- warnx ("Failed getting tokens for cell %s.", *cells);
-
- /* If not localcell, create user (if wanted) and free username) */
- if (name_inst != username) {
- if (arg_createuser && createuser(username, *cells))
- warnx ("Failed creating user in cell %s", *cells);
- free (username);
- }
- cells++;
- }
-}
-
-
-struct agetargs args[] = {
- {"cell", 0, aarg_string, &arg_cell,
- "cell to authenticate to", "cell name", aarg_optional},
- {"createuser", 0, aarg_flag, &arg_createuser,
- "create PTS user in remote cell", NULL, aarg_optional},
- {"debug", 0, aarg_flag, &arg_debug,
- "print debugging information", NULL, aarg_optional},
- {"help", 0, aarg_flag, &arg_help,
- "print help", NULL, aarg_optional},
- {"hosts", 0, aarg_flag, &arg_hosts,
- "print host address information (unimplemented)", NULL, aarg_optional},
- {"krbrealm", 0, aarg_string, &arg_realm,
- "kerberos realm for cell", "kerberos realm", aarg_optional},
- {"noprdb", 0, aarg_flag, &arg_noprdb,
- "don't try to determine AFS ID", NULL, aarg_optional},
- {"path", 0, aarg_string, &arg_path,
- "AFS path to authenticate to", "path", aarg_optional},
- {"quiet", 0, aarg_flag, &arg_quiet,
- "fail silently if no ticket cache", NULL, aarg_optional},
- {"unlog", 0, aarg_flag, &arg_unlog,
- "discard tokens", NULL, aarg_optional},
- {"version", 0, aarg_flag, &arg_version,
- "print version", NULL, aarg_optional},
- {"zsubs", 0, aarg_flag, &arg_zsubs,
- "update zephyr subscriptions (unimplemented)"},
- {NULL, 0, aarg_end, NULL, NULL},
-};
-
-static void
-usage (int exit_code)
-{
- aarg_printusage (args, NULL, "<cell or path>", AARG_AFSSTYLE|AARG_USEFIRST);
- exit (exit_code);
-}
-
-/*
- *
- */
-
-int
-main (int argc, char **argv)
-{
- const char *cell = NULL;
- char cellbuf[64];
- const char *localcell;
- Log_method *method;
- int optind = 0;
- int rc;
-
- setprogname(argv[0]);
-
- ports_init();
- method = log_open (getprogname(), "/dev/stderr:notime");
- if (method == NULL)
- errx (1, "log_open failed");
- cell_init(0, method);
- localcell = cell_getthiscell();
-
- rc = agetarg(args, argc, argv, &optind, AARG_AFSSTYLE|AARG_USEFIRST);
- if(rc && *argv[optind] == '-') {
- warnx ("Bad argument: %s", argv[optind]);
- usage (1);
- }
-
- if(arg_help)
- usage (0);
-
- if(arg_version)
- errx (0, "part of %s-%s", PACKAGE, VERSION);
-
- if (arg_debug)
- debug = 1;
-
- if(!k_hasafs())
- errx (1, "AFS support is not loaded.");
-
- /*
- * get the realm and name of the user
- */
-
- if (krb_get_default_principal(krb_name, krb_instance, krb_realm) < 0) {
- if (!arg_quiet)
- warnx ("Could not even figure out who you are");
- exit (1);
- }
- snprintf(name_inst, sizeof(name_inst),
- "%s%s%s",
- krb_name, *krb_instance ? "." : "", krb_instance);
-
- if (arg_cell)
- cell = cell_expand_cell(arg_cell);
-
- if (arg_unlog) {
- rc = k_unlog();
- exit (rc);
- }
- if (arg_hosts)
- warnx ("Argument -hosts is not implemented.");
- if (arg_zsubs)
- warnx ("Argument -zsubs is not implemented.");
-
- if (rc && argv[optind]) {
- if (strcmp(argv[optind], ".") == 0
- || strcmp(argv[optind], "..") == 0
- || strchr(argv[optind], '/')) {
- DEBUG ("I guess that \"%s\" is a filename.", argv[optind]);
- arg_path = argv[optind];
- } else {
- cell = cell_expand_cell(argv[optind]);
- DEBUG ("I guess that %s is cell %s.", argv[optind], cell);
- }
- }
-
- if (arg_path) {
- if (k_afs_cell_of_file(arg_path, cellbuf, sizeof(cellbuf)))
- errx (1, "No cell found for file \"%s\".", arg_path);
- cell = cellbuf;
- }
-
- /*
- * If not given an argument, use TheseCells to fetch tokens,
- * If given argument, do as the user tells us.
- */
-
- if (cell == NULL && arg_realm == NULL && arg_path == NULL) {
- const char **cells = cell_thesecells ();
- get_tokens (cells, localcell, NULL);
- } else {
- const char *cells[2] = { NULL, NULL };
- cells[0] = cell;
- get_tokens (cells, localcell, arg_realm);
- }
-
- return 0;
-}
-
-#endif /* KERBEROS */
diff --git a/usr.sbin/afs/src/appl/afsutils/klog.1 b/usr.sbin/afs/src/appl/afsutils/klog.1
deleted file mode 100644
index fd15f161987..00000000000
--- a/usr.sbin/afs/src/appl/afsutils/klog.1
+++ /dev/null
@@ -1,196 +0,0 @@
-.\" $KTH: klog.1,v 1.4 2000/08/06 18:12:21 lha Exp $
-.\"
-.Dd July 7, 1999
-.Dt KLOG 1
-.Os "The Arla Project"
-.Sh NAME
-.Nm klog
-.Nd
-A program to get AFS tokens and possibly other things
-.Sh SYNOPSIS
-.Nm
-.Op Fl principal Ar Kerberos principal
-.Op Fl cell Ar AFS cell
-.Op Fl lifetime Ar token lifetime in hrs:min:sec
-.Op Fl tmp
-.Op Fl setpag
-.Op Fl pipe
-.Op Fl password Ar Kerberos password
-.Op Fl realm Ar Kerberos realm (optional)
-.Op Fl servers Ar AFS kaservers to contact
-.Op Fl silent
-.Op Fl timeout Ar network timeout
-.Op Fl help
-.Op Ar user@cell
-.Sh DESCRIPTION
-The
-.Nm
-command obtains AFS tokens and possibly a Kerberos ticket granting ticket
-as well. By default it only gets an AFS token for the named principal and
-cell.
-.Pp
-This command can be invoked more than once to acquire AFS tokens in
-multiple cells. There is no way at present to write Kerberos TGTs for
-different realms into the same ticket file.
-.Pp
-If
-.Nm
-is successful in getting a token and you already have a token for the same
-cell in your current PAG, it will be overwritten by the new token. An
-existing token will not be erased if a new token cannot be acquired.
-.Pp
-You can specify part or whole of a Kerberos principal on the command line;
-for instance:
-.Pp
-.Nm
-username
-.Pp
-or
-.Nm
-username@cell.name
-.Pp
-or just
-.Nm
-@cell.name
-.Pp
-If neither is specified, the default is your current user name and the
-local AFS cell.
-.Pp
-The following flags are supported:
-.Bl -tag -width xxxx
-.It Fl principal
-Principal to get tokens for. If not specified,
-.Nm
-tries to use your user name, which is guessed from $USER or from the UID
-that
-.Nm
-is run as.
-.It Fl lifetime
-Lifetime for the Kerberos TGT and/or AFS token. This can be specified as:
-.Pp
-.Nm
-.Fl lifetime hours
-.Pp
-or
-.Nm
-.Fl lifetime hours:minutes
-.Pp
-or
-.Nm
-.Fl lifetime hours:minutes:seconds
-.Pp
-If this option is not specified, the default lifetime of 720 hours (30
-days) is used; however, the administrators of your cell may have chosen a
-lesser maximum lifetime.
-.Pp
-Please note that in Kerberos 4, only 255 discrete lifetimes are possible
-spanning the range from 5 minutes to 30 days. The lifetime that you
-specify will be rounded up to the next possible lifetime.
-.It Fl cell
-AFS cell to get tokens for. If not specified,
-.Nm
-guesses your local cell.
-.It Fl password
-You can specify the Kerberos password on the command line. This is a
-really, really, really, bad idea on most systems out there, since any user
-can use the \fBps\fP command to examine the command line of any running
-process.
-.Pp
-You should not use this option.
-.It Fl realm
-Most AFS cells are set up in such a way that the Kerberos realm name is
-the same as the cell name (except in upper case). If the name of your AFS
-cell differs from your Kerberos realm, however,
-.Nm
-may not be able to automatically fetch your tokens without specifying the
-correct realm name with this option.
-.It Fl servers
-You can list one or more kaservers to contact directly here.
-.Nm
-will attempt to contact each of them until it finds one that works.
-.It Fl timeout
-You can specify the number of seconds that
-.Nm
-will wait for a network operation to complete. (there are 3 network
-operations performed by
-.Nm
-- the AFS ID is looked up from the dbserver, the Kerberos 4 TGT must be
-obtained, and the AFS token must be fetched.
-.Pp
-If you do not use this option,
-.Nm
-will wait forever if necessary.
-.Pp
-.It Fl silent
-This causes
-.Nm
-not to write to the standard error channel. By default, error messages are
-sent to stderr.
-.It Fl pipe
-If this flag is given, then
-.Nm
-will not write to the standard output, and will only accept a password
-written to the standard input. Error messages will still be printed to
-standard error unless the \fB-silent\fP option is also specified.
-.Pp
-Because it does not attempt to verify that the TTY is safe, this should
-only be used from scripts.
-.It Fl setpag
-Stores the AFS token in a new PAG, and then
-\fBexec()\fPs a shell. The environment variable KRBTKFILE is set to point
-to a unique name in /ticket, so that the Kerberos TGT gathered (if any) is
-written to a safe place. The shell is chosen via \fBgetpwnam()\fP called
-with the principal's name; if that fails, then \fBgetpwuid()\fP is tried
-with your current UID; if this fails,
-.Nm
-attempts to execute /bin/sh.
-.It Fl tmp
-Actually get a Kerberos TGT and writes it to /tmp (or the file specified
-in the KRBTKFILE environment variable). By default, only an AFS token is
-acquired.
-.Pp
-This is a poor choice of name, as in reality writing Kerberos tickets to
-/tmp is a bad idea and often a security risk. This name is only here for
-compatibility with other AFS implementations. (\fB-tgt\fP would have been
-a better choice of name)
-.Pp
-.It Fl help
-Prints out a help message.
-.Sh EXIT STATUS
-.Nm
-returns with exit status 0 (true) if and only if a Kerberos 4 TGT was
-successfully acquired and an AFS token was successfully stored. In all
-other cases, the return value is non-zero.
-.Pp
-It is possible to call
-.Nm
-from scripts or other programs for automated authentication with the
-.Fl pipe
-option, although discretion and caution is advised when doing
-so.
-.Sh NOTES
-By default,
-.Nm
-tries to look up your Kerberos principal in the kaserver's database to
-figure out the proper AFSId to use. As far as I know, this only affects
-the output of the \fBtokens\fP program.
-.Pp
-The minimum token lifetime is 5 minutes.
-.El
-.Sh SEE ALSO
-.Xr aklog 1 ,
-.Xr kauth 1 ,
-.Xr kf 1 ,
-.Xr kinit 1 ,
-.Xr tokens 1 ,
-.Xr unlog 1 ,
-.Xr kauthd 8
-.Sh BUGS
-The
-.Fl servers
-option only affects where the AFS ID is looked up, not
-which servers are actually contacted to get the TGT or token.
-.Pp
-.Nm
-should automatically deal with the case where the Kerberos realm is not
-the same as the AFS cell name.
diff --git a/usr.sbin/afs/src/appl/afsutils/klog.c b/usr.sbin/afs/src/appl/afsutils/klog.c
deleted file mode 100644
index a31fe55daaa..00000000000
--- a/usr.sbin/afs/src/appl/afsutils/klog.c
+++ /dev/null
@@ -1,818 +0,0 @@
-/*
- * Copyright (c) 1999 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- klog.c - a version of 'klog' for Arla
-
- Written by Chris Wing - wingc@engin.umich.edu
- based on examples of AFS code: pts.c (Arla) and kauth.c (KTH-KRB)
-
- Hacked to use agetarg by Love Hörnquist-Åstrand <lha@stacken.kth.se>
-
- Hacked to use agetarg and still work properly by Chris Wing
-
- This is a reimplementation of klog from AFS. The following new features
- have been added:
- -timeout Number of seconds to wait for Kerberos operations
- to finish. By default, we will wait forever.
-*/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-RCSID("$arla: klog.c,v 1.38 2003/06/04 11:46:31 hin Exp $");
-
-#include "appl_locl.h"
-#include "klog.h"
-#include "kafs.h"
-
-/*
- * State variables
- */
-
-/* Lifetime in seconds. Default token lifetime is 720 hours (30 days) */
-static int lifetime = 720 * 60 * 60;
-
-/*
- * arguments passed to program
- */
-
-static char *arg_principal = NULL;
-static char *arg_cell = NULL;
-static char *arg_realm = NULL;
-static char *arg_password = NULL;
-static agetarg_strings arg_servers;
-static char *arg_lifetime = NULL;
-static int arg_timeout = 0;
-static int arg_pipe = 0;
-static int arg_setpag = 0;
-static int arg_silent = 0;
-static int arg_getkrbtgt = 0;
-static int arg_version = 0;
-static int arg_help = 0;
-static char *arg_kname = NULL;
-
-/* AFS ID */
-static int afsid = 0;
-
-/* Password */
-static char *password = NULL;
-
-/* Did the attempted network command time out? */
-static int timed_out = 0;
-
-#ifdef KERBEROS
-
-/* Do we have a ticket file lying around we'd like to get rid of? */
-static int have_useless_ticket_file = 0;
-
-/* Kerberos ticket file */
-static char *tkfile = NULL;
-
-#endif
-
-/* Did we get a token that will sit around unused if not destroyed? */
-static int have_useless_token = 0;
-
-/*
- * Erase passwords from memory and remove tokens and tickets that
- * shouldn't be left laying around.
- */
-
-static void
-final_cleanup (void)
-{
- /* Make sure to clear out the password in this process's memory image
- before exiting */
- if(password)
- memset(password, 0, PASSWD_MAX);
-
- /* Destroy any useless tokens that we acquired */
- if(have_useless_token)
- k_unlog();
-
-#ifdef KERBEROS
- /* Destroy any temporary ticket files lying around. */
- if(have_useless_ticket_file)
- dest_tkt();
-#endif
-}
-
-/* Death function that erases password before exiting */
-
-void
-die (int retcode)
-{
- final_cleanup ();
-
- exit(retcode);
-}
-
-/* Die, print out an error message, and interpret errno
- Remember that *err*() from roken prints out a trailing newline. */
-
-void
-diet (int retcode, char *fmt, ...)
-{
- va_list ap;
-
- final_cleanup ();
-
- va_start(ap, fmt);
- verr (retcode, fmt, ap);
- va_end(ap);
-}
-
-/* Die and print out an error message. Do not interpret errno. */
-
-void
-dietx (int retcode, char *fmt, ...)
-{
- va_list ap;
-
- final_cleanup ();
-
- va_start(ap, fmt);
- verrx (retcode, fmt, ap);
- va_end(ap);
-}
-
-
-/*
- * Figure out the AFS ID of a user name
- */
-
-int
-get_afs_id(void)
-{
- int32_t returned_id;
- const char **servers = (const char **)arg_servers.strings; /* ARGH */
-
- arlalib_get_token_id_servers (arg_principal,
- arg_cell,
- arg_servers.num_strings,
- servers,
- &returned_id);
- return returned_id;
-}
-
-#ifndef KRB_TICKET_GRANTING_TICKET
-#define KRB_TICKET_GRANTING_TICKET "krbtgt"
-#endif
-
-/* Get a Kerberos 4 TGT */
-
-int
-get_k4_ticket(void)
-{
- int rc;
-
- int krb_lifetime;
-
- /* The minimum lifetime is 5 minutes */
- if(lifetime < 5 * 60)
- krb_lifetime = 1;
-#ifdef KERBEROS
- else
- krb_lifetime = krb_time_to_life(0, lifetime);
-#endif
-
- /* If a ridiculously high lifetime is given to krb_time_to_life,
- 0 may be returned as a result... */
- if( (krb_lifetime > 255) || (krb_lifetime == 0) )
- krb_lifetime = 255;
-
-#ifdef KERBEROS
- rc = krb_get_pw_in_tkt(arg_principal, "", arg_realm,
- KRB_TICKET_GRANTING_TICKET, arg_realm,
- krb_lifetime, password);
- if(rc)
- warnx("Unable to authenticate to Kerberos: %s",
- krb_get_err_text(rc));
-#else
- warnx ("No kerberos included");
- return (1);
-#endif /* KERBEROS */
-
- return(rc);
-}
-
-
-/* Get an AFS token */
-
-int get_afs_token(void)
-{
- int rc;
-
- /* FIXME: This will happily store a token for one cell with the
- name of another cell, and this makes Arla
- misbehave :( */
-
-#ifdef KERBEROS
-#ifdef HAVE_KRB_AFSLOG_UID
- rc = krb_afslog_uid(arg_cell, arg_realm, afsid);
-#else
- rc = k_afsklog_uid(arg_cell, arg_realm, afsid);
-#endif
- if(rc)
- warnx("Unable to get an AFS token: %s", krb_get_err_text(rc));
-#else
- warnx ("Unable to get an AFS token since there is no kerberos");
- return (1);
-#endif
-
- return(rc);
-}
-
-
-/*
- * Generalized machinery for performing a timeout on an arbitrary
- * function returning an integer. Fun, eh?
- */
-
-int
-do_timeout (int (*function)(void) )
-{
- int pipearr[2];
- int reader, writer;
- pid_t pid;
- int status;
-
- timed_out = 0;
-
- /* Don't bother with all this jibba jabba if we don't want to timeout */
- if(arg_timeout == 0)
- return (function());
-
- if(pipe(pipearr) == -1)
- diet (1, "do_timeout(): Can't make a pipe");
-
- reader = pipearr[0];
- writer = pipearr[1];
-
- /* :) */
- fflush(stdout);
- fflush(stderr);
-
- pid = fork();
-
- if(pid == -1)
- diet (1, "do_timeout: Can't fork");
-
- if(pid) {
- /* parent's thread of execution */
-
- fd_set readfds;
- struct timeval tv;
- int retval;
- int result;
- ssize_t len;
-
- close(writer);
-
- if (reader >= FD_SETSIZE)
- diet (1, "do_timeout(): fd too large");
-
- /* this is how you set up a select call */
- FD_ZERO(&readfds);
- FD_SET(reader, &readfds);
-
- /* Wait as many as timeout seconds. */
- tv.tv_sec = arg_timeout;
- tv.tv_usec = 0;
-
- retval = select(reader+1, &readfds, NULL, NULL, &tv);
-
- /* Kill the child process in any case */
- kill(pid, SIGKILL);
-
- if(!retval) {
- timed_out = 1;
- } else {
- /* okay, what happened */
-
- len = read(reader, &result, sizeof(int));
- }
-
- /* no matter what, we must wait on the child or else we will
- accumulate zombies */
- waitpid(pid, &status, 0);
-
- /* close the other end of the pipe */
- close(reader);
-
- if(timed_out)
- return(1);
- else
- return(result);
-
- /* PARENT ENDS HERE */
-
- } else {
- /* child's thread of execution */
- int retval;
- ssize_t len;
-
- close(reader);
-
- retval = function();
-
- len = write(writer, &retval, sizeof(int));
-
- /* Destroy the copy of the password in the child's memory image */
- memset(password, 0, PASSWD_MAX);
-
- exit(0);
-
- /* CHILD ENDS HERE */
- }
-}
-
-/*
- * randfilename()
- * Return a "random" file name, for use, e.g., as a ticket file
- * use umich compat basename of ticket.
- */
-
-#ifndef TKT_ROOT
-#define TKT_ROOT "/tmp"
-#endif
-
-char *
-randfilename(void)
-{
- const char *base;
- char *filename;
- int fd, i;
-
- /*
- * this kind of sucks, before we use an array but in some kerberos
- * dists TKT_ROOT isn't a constant (its a function) so we needed
- * to stop using that.
- */
-
- for (i = 0; i < 3; i++) {
- base = NULL;
- switch (i) {
-#ifdef HAVE_KRB_GET_DEFAULT_TKT_ROOT
- case 0:
- base = krb_get_default_tkt_root ();
- break;
-#endif
- case 1:
- base = KLOG_TKT_ROOT;
- break;
- case 2:
- base = TKT_ROOT;
- break;
- }
-
- if (base == NULL)
- continue;
-
- asprintf (&filename, "%s_%u_XXXXXX", base, (unsigned)getuid());
- if (filename == NULL)
- dietx (1, "out of memory");
-
- fd = mkstemp(filename);
- if (fd >= 0) {
- close(fd);
- return filename;
- }
- free (filename);
- }
- dietx (1, "could not create ticket file");
-}
-
-struct agetargs args[] = {
- { "principal", 0, aarg_string, &arg_principal,
- "principal to obtain token for",
- "user name", aarg_optional},
- { "password", 0, aarg_string, &arg_password,
- "password to use (NOT RECOMMENDED TO USE)",
- "AFS password", aarg_optional},
- { "servers", 0, aarg_strings, &arg_servers,
- "list of servers to contact",
- "AFS dbservers", aarg_optional},
- { "lifetime", 0, aarg_string, &arg_lifetime,
- "lifetime given in hh[:mm[:ss]]",
- "hh:mm:ss", aarg_optional},
- { "pipe", 0, aarg_flag, &arg_pipe,
- "read password from stdin and close stdout",
- NULL, aarg_optional},
- { "timeout", 0, aarg_integer, &arg_timeout,
- "network timeout given in seconds (default is forever)",
- "seconds", aarg_optional},
- { "setpag", 0, aarg_flag, &arg_setpag,
- "store token in new PAG and spawn a shell",
- NULL, aarg_optional},
- { "silent", 0, aarg_flag, &arg_silent,
- "close stderr",
- NULL, aarg_optional},
- { "tmp", 0, aarg_flag, &arg_getkrbtgt,
- "get a Kerberos TGT (possibly overwriting any current one)",
- NULL, aarg_optional},
- { "cell", 0, aarg_string, &arg_cell,
- "cell where to obtain token",
- "cell name", aarg_optional},
- { "realm", 0, aarg_string, &arg_realm,
- "Kerberos realm to get TGT in (default same as AFS cell)",
- "Kerberos realm", aarg_optional},
- { "help", 0, aarg_flag, &arg_help, "help",
- NULL, aarg_optional},
- { "version", 0, aarg_flag, &arg_version, "print version",
- NULL, aarg_optional},
- { NULL, 0, aarg_generic_string, &arg_kname, "Kerberos identity",
- "user@cell", aarg_optional},
- { NULL, 0, aarg_end, NULL, NULL }
-};
-
-/*
- *
- */
-
-static void
-do_help (int exitval)
-{
- aarg_printusage(args, NULL, NULL, AARG_AFSSTYLE);
- exit(exitval);
-}
-
-/*
- * If we dont have kerberos support, bail out.
- */
-
-#ifndef KERBEROS
-
-int
-main(int argc, char **argv)
-{
- errx (1, "Kerberos support isn't compiled in");
- return 1;
-}
-#else
-
-/*
- * The core of this evil
- */
-
-int
-main(int argc, char **argv)
-{
- char prompt[PW_PROMPT_MAX];
- int rc;
- int optind = 0;
- Log_method *method;
-
- char pwbuf[PASSWD_MAX];
-
- set_progname (argv[0]);
-
- method = log_open (getprogname(), "/dev/stderr:notime");
- if (method == NULL)
- errx (1, "log_open failed");
- cell_init(0, method);
- ports_init();
-
- rc = agetarg(args, argc, argv, &optind, AARG_AFSSTYLE);
- if(rc) {
- warnx ("Bad argument: %s", argv[optind]);
- do_help(1);
- }
-
- if (arg_help)
- do_help(0);
-
- if (arg_version)
- dietx (0, "part of %s-%s", PACKAGE, VERSION);
-
- if (arg_password)
- warnx ("WARNING: The use of -password is STRONGLY DISCOURAGED");
-
- /* manually parse a string of the form user@cell, we used to use
- kname_parse(), but this no longer works properly as of krb4-1.0 */
- if (arg_kname) {
- char *at = strchr(arg_kname, '@');
- char *tmp_principal = arg_kname;
- char *tmp_cell;
-
- if(at) {
- *at = '\0';
-
- tmp_principal = arg_kname;
- at++;
- tmp_cell = at;
-
- if(*tmp_cell != '\0')
- arg_cell = tmp_cell;
- }
-
- if(*tmp_principal != '\0')
- arg_principal = tmp_principal;
- }
-
- if (arg_lifetime) {
- int h = 0, m = 0, s = 0;
- int matched;
-
- matched = sscanf(arg_lifetime, "%u:%u:%u", &h, &m, &s);
-
- if(matched < 1 || matched > 3)
- dietx (1, "Bad argument for -lifetime: %s", arg_lifetime);
-
- lifetime = h * 3600 + m * 60 + s;
- }
-
- /* Simplest way to prevent any output from this command */
- if(arg_pipe)
- freopen("/dev/null", "r+", stdout);
-
- /* Simplest way to prevent any output from this command */
- if(arg_silent)
- freopen("/dev/null", "r+", stderr);
-
- if(!k_hasafs())
- dietx (1, "Hmm, your machine doesn't seem to have kernel support "
- "for AFS");
-
- /* Try to get a new PAG, but don't abort if we can't */
- if(arg_setpag) {
- if (k_setpag() == -1)
- warnx ("Couldn't get new PAG");
- }
-
- /* Figure out the AFS cell to use */
- if (arg_cell == NULL) {
- arg_cell = (char *)cell_getthiscell();
-
- if (arg_cell == NULL)
- dietx (1, "Can't find local cell!");
- }
-
- /* FIXME: Figure out a way to automatically deal with setups where the
- Kerberos realm is not just an uppercase version of the
- AFS cell
-
- if libkafs exported kafs_realm_of_cell(), we could use that.
-
- libkafs now does, but that isn't enough. kafs_realm_of_cell
- is currently implemented by looking up the first entry in
- CellServDB for the given cell, doing an inverse DNS lookup,
- and then using the domain name of the resulting host name as
- the Kerberos realm (subject to remapping via krb.realms)
-
- This is bad, because (a) it requires a resolver call, which
- can hang for an arbitrary amount of time, and (b) it
- requires playing silly games with krb.realms and hoping that
- the inverse DNS entry for the first server for a cell will
- not change.
-
- libkafs should recognize a file called "CellRealms", or
- something like that, which yields a correct mapping between
- a given AFS cell and a Kerberos realm; otherwise it should
- just uppercase the cell name and be done with it.
-
- For now, give the user the option to specify a specific
- realm to use via -realm. */
-
- if(arg_realm == NULL) {
- char *p;
-
- arg_realm = estrdup(arg_cell);
-
- /* convert name to upper case */
- p = arg_realm;
- while(*p != '\0') {
- *p = toupper(*p);
- p++;
- }
- }
-
- /* Figure out the Kerberos principal we are going to use */
- if (arg_principal == NULL) {
- struct passwd *pwd = getpwuid (getuid ());
-
- if (pwd == NULL)
- dietx (1, "Could not get default principal");
-
- arg_principal = pwd->pw_name;
- }
-
- /* Figure out the db server we are going to contact */
- if (arg_servers.num_strings == 0) {
- arg_servers.strings = emalloc (sizeof(char *));
- arg_servers.strings[0] = (char *)cell_findnamedbbyname (arg_cell);
-
- if(arg_servers.strings[0] == NULL)
- dietx (1, "Can't find any db server for cell %s", arg_cell);
-
- arg_servers.num_strings = 1;
- }
-
- /*
- * Get the password
- */
-
- if(arg_password == NULL) {
- password = pwbuf;
-
- if(arg_pipe) {
- if (fgets (pwbuf, sizeof(pwbuf), stdin) == NULL)
- dietx (1, "EOF reading password");
- pwbuf[strcspn(pwbuf, "\n")] = '\0';
- } else {
- snprintf(prompt, PW_PROMPT_MAX,
- "%s@%s's Password:", arg_principal, arg_cell);
-
- if (des_read_pw_string(password, PW_PROMPT_MAX-1, prompt, 0))
- dietx (1, "Unable to login because can't read password "
- "from terminal.");
-
- }
- } else {
- /* Truncate user-specified password to PASSWD_MAX */
- /* This also lets us use memset() to clear it later */
-
- strlcpy(pwbuf, arg_password, PASSWD_MAX);
-
- password = pwbuf;
-
- {
- /* Have to clear out this copy of the password too from the
- memory image */
-
- /*
- * FIXME: we should also erase the copy in argv[].
- * Is it safe to overwrite bits of argv, and is there
- * any nice way to do this from the agetarg()
- * framework?
- */
- int pwlen;
- pwlen=strlen(arg_password);
- memset(arg_password, 0, pwlen);
- }
- }
-
- /* A familiar AFS warning message */
- if (password == NULL || *password == '\0')
- dietx (1, "Unable to login because zero length password is illegal.");
-
- /*
- * Create a secure random ticket file if we are running with -setpag,
- * because we can set the environment variable in the child shell.
- */
-
- if(arg_setpag) {
- tkfile = randfilename();
- have_useless_ticket_file = 1;
- } else {
- if (arg_getkrbtgt) {
- tkfile = getenv("KRBTKFILE");
- if(tkfile == NULL) {
- /* the insecure default ticket file :( */
- tkfile = TKT_FILE;
- }
- } else {
- /* Create a unique temporary file to get the temporary TGT */
- tkfile = randfilename();
- have_useless_ticket_file = 1;
- }
- }
-
- setenv ("KRBTKFILE", tkfile, 1);
- krb_set_tkt_string (tkfile);
-
- /* Get the Kerberos TGT */
- rc = do_timeout (get_k4_ticket);
- if(timed_out)
- dietx (1, "Timed out trying to get Kerberos ticket for %s@%s",
- arg_principal, arg_realm);
-
- /* get_k4_ticket() will already have printed out an error message. */
- if(rc)
- die(rc);
-
- /* We can now clear the password from the memory image */
- memset(password, 0, PASSWD_MAX);
-
- /* Only keep this ticket file around if we were invoked as -tmp; this way,
- the user will still be able to get a Kerberos TGT even if he/she cannot
- obtain a token */
- if(arg_getkrbtgt)
- have_useless_ticket_file = 0;
- else
- have_useless_ticket_file = 1;
-
- /*
- * Figure out the AFS ID to store with the token.
- * Moved this after the TGT-gathering stage because it may want to
- * get a ticket to talk to the dbserver?
- */
-
- afsid = do_timeout (get_afs_id);
- if(timed_out)
- warnx("Timed out trying to get AFS ID for %s@%s",
- arg_principal, arg_cell);
-
- /* Get the AFS token */
- rc = do_timeout (get_afs_token);
- if(timed_out)
- dietx (1, "Timed out trying to get AFS token for %s@%s",
- arg_principal, arg_realm);
-
- /* get_afs_token() will already have printed out an error message. */
- if(rc)
- die(rc);
-
- /* Destroy the temporary Kerberos TGT if we didn't need it */
- if(!arg_getkrbtgt) {
- dest_tkt();
-
- /* Avoid calling dest_tkt() twice-- may be security risk */
- have_useless_ticket_file = 0;
- }
-
- /*
- * Exec a shell if the user specified -setpag, because otherwise the
- * new PAG will magically disappear when the program exits
- */
-
- if(arg_setpag) {
- /*
- * Get the default shell of the PRINCIPAL we are kloging as.
- * This is the only thing that makes sense, as we are going to
- * be opening up a session for this principal.
- * Perhaps we should also change to this principal's home
- * directory, as the shell will fail if the command was run in
- * a restricted directory owned by a different AFS principal
- */
-
- struct passwd *pwd;
- char *shell;
-
- pwd = getpwnam(arg_principal);
- if(pwd == NULL) {
- pwd = getpwuid(getuid());
- if(pwd == NULL) {
-
- shell = getenv("SHELL");
- if (shell == NULL) {
- warnx ("Can't get default shell for user %s, using "
- "fallback (/bin/sh) shell.", arg_principal);
- shell = "/bin/sh";
- }
-
- } else {
- warnx ("Can't get default shell for user %s, "
- "using default shell for UID %d",
- arg_principal, getuid());
-
- shell = pwd->pw_shell;
- }
- } else {
- shell = pwd->pw_shell;
- }
-
- execl(shell, shell, NULL);
-
- /* the AFS token is useless if the shell exec fails, because it
- is in a PAG that will soon go away. */
- have_useless_token = 1;
-
- diet (1, "Can't exec shell: %s", shell);
- }
-
- return 0;
-}
-#endif /* KERBEROS */
diff --git a/usr.sbin/afs/src/appl/afsutils/klog.ctx b/usr.sbin/afs/src/appl/afsutils/klog.ctx
deleted file mode 100644
index 73b3b296d12..00000000000
--- a/usr.sbin/afs/src/appl/afsutils/klog.ctx
+++ /dev/null
@@ -1,221 +0,0 @@
-#
-# $KTH: klog.ctx,v 1.1 2000/06/01 18:38:34 lha Exp $
-#
-
-%name description
-
- get AFS tokens
-
-%name os
-
- "Arla, KTH"
-
-%name section
-
- 1
-
-%section history
-
- Written by Chris Wing <wingc@engin.umich.edu>. Made nonworking
- by Love Hörnquist-Åstrand <lha@stacken.kth.se> serveral times.
-
-%section see also
-
- .Xr kauth 1 ,
- .Xr kinit 1 ,
- .Xr kauthd 8 ,
- .Xr unlog 1 ,
- .Xr tokens 1 ,
- .Xr afslog 1
-
-%section authors
-
- Chris Wing <wingc@engin.umich.edu>
- \&...
-
-%section description
-
- Get you a token from a kerberos server (not kaserver).
-
-%section bugs
-
- The
- .Ar servers
- option only affects where the AFS ID is looked up, not
- which servers are actually contacted to get the TGT or token.
- .Pp
- .Nm
- should automatically deal with the case where the Kerberos realm is not
- the same as the AFS cell name.
-
-%command _main
-
- .Nm
- obtains AFS tokens and possibly a Kerberos ticket granting ticket
- as well. By default it only gets an AFS token for the named
- principal and cell.
- .Pp
- .Nm
- can be invoked more than once to acquire AFS
- tokens in multiple cells. There is no way at present to write
- Kerberos TGTs for different realms into the same ticket file.
- .Pp
- If
- .Nm
- is successful in getting a token and you already have a token for the same
- cell in your current PAG, it will be overwritten by the new token. An
- existing token will not be erased if a new token cannot be
- acquired.
- .Pp
- You can specify part or whole of a Kerberos principal on the command line;
- for instance:
- .Pp
- .Nm
- username
- .Pp
- or
- .Nm
- username@cell.name
- .Pp
- or just
- .Nm
- @cell.name
- .Pp
- If neither is specified, the default is your current user name and the
- local AFS cell.
- .Pp
- The following flags are supported:
- .Bl -tag -width principal
- .It Fl principal
- Principal to get tokens for. If not specified,
- .Nm
- tries to use your user name, which is guessed from $USER or from the UID
- that
- .Nm
- is run as.
- .It Fl lifetime
- Lifetime for the Kerberos TGT and/or AFS token. This can be specified as:
- .Nm
- .Ar lifetime
- hours
- .Pp
- or
- .Nm
- .Ar lifetime
- hours:minutes
- .Pp
- or
- .Nm
- .Ar lifetime
- hours:minutes:seconds
- .Pp
- If this option is not specified, the default lifetime of 720 hours (30
- days) is used; however, the administrators of your cell may
- have chosen a lesser maximum lifetime.
- .Pp
- Please note that in Kerberos 4, only 255 discrete lifetimes are possible
- spanning the range from 5 minutes to 30 days. The lifetime
- that you specify will be rounded up to the next possible lifetime.
- .It Fl cell
- AFS cell to get tokens for. If not specified,
- .Nm
- guesses your local cell.
- .It Fl password
- You can specify the Kerberos password on the command line. This is a
- really, really, really, bad idea on most systems out there, since any user
- can use the
- .Xr ps(1)
- command to examine the command line of any running process.
- .Pp
- You should not use this option.
- .It Fl realm
- Most AFS cells are set up in such a way that the Kerberos realm name is
- the same as the cell name (except in upper case). If the name
- of your AFS cell differs from your Kerberos realm, however,
- .Nm
- may not be able to automatically fetch your tokens without specifying the
- correct realm name with this option.
- .It Fl servers
- You can list one or more kaservers to contact directly here.
- .Nm
- will attempt to contact each of them until it finds one that works.
- .It Fl timeout
- You can specify the number of seconds that
- .Nm
- will wait for a network operation to complete. (there are 3 network
- operations peformed by
- .Nm
- - the AFS ID is looked up from the dbserver, the Kerberos 4 TGT must be
- obtained, and the AFS token must be fetched.
- .Pp
- If you do not use this option,
- .Nm
- will wait forever if necessary.
- .It Fl silent
- This causes
- .Nm
- not to write to the standard error channel. By default, error
- messages are sent to stderr.
- .It Fl pipe
- If this flag is given, then
- .Nm
- will not write to the standard output, and will only accept a password
- written to the standard input. Error messages will still be
- printed to standard error unless the
- .Ar silent
- option is also specified.
- .Pp
- Because it does not attempt to verify that the TTY is safe, this should
- only be used from scripts.
- .It Fl setpag
- Stores the AFS token in a new PAG, and then
- .Fn exec
- s a shell. The environment variable
- .Ev KRBTKFILE
- is set to point
- to a unique name in
- .Va /ticket,
- so that the Kerberos TGT gathered (if any) is written to a
- safe place. The shell is chosen via
- .Fn getpwnam
- called with the principal's name; if that fails, then
- .Fn getpwuid
- is tried with your current UID; if this fails,
- .Nm
- attempts to execute
- .Va /bin/sh.
- .It Fl tmp
- Actually get a Kerberos TGT and writes it to
- .Pa /tmp
- (or the file specified in the
- .Ev KRBTKFILE
- environment variable). By default, only an AFS token is acquired.
- .Pp
- This is a poor choice of name, as in reality writing Kerberos tickets to
- .Pa /tmp
- is a bad idea and often a security risk. This name is only here for
- compatibility with other AFS implementations. (
- .Ar tgt
- would have been a better choice of name)
- .It Fl help
- Prints out a help message.
- .El
- .Sh EXIT STATUS
- .Nm
- returns with exit status 0 (true) if and only if a Kerberos 4 TGT was
- successfully acquired and an AFS token was successfully stored. In all
- other cases, the return value is non-zero.
- .Pp
- It is possible to call
- .Nm
- from scripts or other programs for automated authentication with the
- .Ar pipe
- option, although discretion and caution is advised when doing so.
- .Sh NOTES
- By default,
- .Nm
- tries to look up your Kerberos principal in the kaserver's database to
- figure out the proper AFSId to use. As far as I know, this only affects
- the output of the
- .Xr tokens(1)
- program.
diff --git a/usr.sbin/afs/src/appl/afsutils/klog.h b/usr.sbin/afs/src/appl/afsutils/klog.h
deleted file mode 100644
index 521bd1a9450..00000000000
--- a/usr.sbin/afs/src/appl/afsutils/klog.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: klog.h,v 1.4 2000/10/03 00:06:24 lha Exp $ */
-
-/* Function prototypes for klog.c */
-
-int get_afs_id(void);
-
-/* prototype for die et al */
-
-void
-die (int retcode)
- __attribute__ ((noreturn));
-
-void
-diet (int retcode, char *fmt, ...)
- __attribute__ ((noreturn, format (printf, 2, 3)));
-
-void
-dietx (int retcode, char *fmt, ...)
- __attribute__ ((noreturn, format (printf, 2, 3)));
-
-int get_k4_ticket(void);
-
-int get_afs_token(void);
-
-int do_timeout( int (*function)(void) );
-
-char *randfilename(void);
-
-
-/* Feel free to correct these definitions with the actual numbers. */
-
-#define CELL_MAX REALM_SZ
-#define REALM_MAX REALM_SZ
-
-/* According to code in arla/rxdef, max principal name length is 64. */
-#define PRINCIPAL_MAX 64
-
-#define PASSWD_MAX 200
-#define PW_PROMPT_MAX 256
-
-/* We use this and make it mode 1733; you should too */
-#define KLOG_TKT_ROOT "/ticket/"
diff --git a/usr.sbin/afs/src/appl/afsutils/sys.c b/usr.sbin/afs/src/appl/afsutils/sys.c
deleted file mode 100644
index 9da38fa2770..00000000000
--- a/usr.sbin/afs/src/appl/afsutils/sys.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * sys - a version of the sys command
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-RCSID("$arla: sys.c,v 1.3 2000/10/03 00:06:30 lha Exp $");
-
-#include "appl_locl.h"
-
-int
-main (int argc, char **argv)
-{
- const char *sysname = arla_getsysname();
- char buf[2048];
- int ret;
-
- if (sysname == NULL)
- sysname = "unknown";
-
- if (!k_hasafs()) {
- printf ("%s\n", sysname);
- exit (0);
- }
-
- ret = fs_get_sysname (buf, sizeof(buf));
- if (ret) {
- printf ("%s\n", sysname);
- } else {
- printf ("%s\n", buf);
- }
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/afsutils/tokens.1 b/usr.sbin/afs/src/appl/afsutils/tokens.1
deleted file mode 100644
index 6c1aa47d6cd..00000000000
--- a/usr.sbin/afs/src/appl/afsutils/tokens.1
+++ /dev/null
@@ -1,68 +0,0 @@
-.\" Copyright (c) 2000 Kungliga Tekniska Högskolan
-.\" $arla: tokens.1,v 1.6 2003/04/25 18:10:26 lha Exp $
-.\"
-.Dd July 7, 1999
-.Dt TOKENS 1
-.Os "The Arla Project"
-.Sh NAME
-.Nm tokens
-.Nd
-lists all AFS tokens in your current PAG.
-.Sh SYNOPSIS
-.Nm
-.Op Fl verbose , v
-.Sh DESCRIPTION
-The following flags are supported:
-.Bl -tag -width xxxx
-.It Fl verbose , v
-Generate slightly more verbose output (not particularly useful except for
-debugging purposes)
-.El
-.Pp
-The
-.Nm
-lists all AFS tokens in your current PAG.
-.Pp
-It looks something like this:
-.Bd -literal
-
-Tokens held by Arla:
-
-User's (AFS ID 913) tokens for afs@su.se [Expires Feb 15 02:27]
-User's (AFS ID 913) tokens for afs@pdc.kth.se [Expires Feb 15 02:27]
-User's (AFS ID 913) tokens for afs@nada.kth.se [Expires Feb 15 02:27]
-User's (AFS ID 913) tokens for afs@stacken.kth.se [Expires Feb 15 02:27]
-User's (AFS ID 913) tokens for afs@e.kth.se [Expires Feb 15 02:28]
- --End of list--
-.Ed
-.Pp
-If there isn't any AFS tokens,
-.Nm
-just doesn't list any tokens
-.Bd -literal
-Tokens held by Arla:
-
- --End of list--
-.Ed
-.Pp
-.Sh EXIT STATUS
-.Nm
-returns with exit status 0 (true) if the current PAG has at least 1 valid
-AFS token. Otherwise, the exit status of
-.Nm
-is 1.
-.Pp
-Thus, you can call this program from a script to determine whether or not
-AFS tokens are present. (e.g. in a login script)
-.Sh NOTES
-The AFS ID printed out may be arbitrary; it can be chosen at the time the
-token is set and does not necessarily correspond to the actual AFS ID on
-the kaserver.
-.Pp
-If you have AFS tokens, but they are all expired, the exit status of
-.Nm
-will be 1, not 0.
-.Sh SEE ALSO
-.Xr klist 1 ,
-.Xr klog 1 ,
-.Xr unlog 1
diff --git a/usr.sbin/afs/src/appl/afsutils/tokens.c b/usr.sbin/afs/src/appl/afsutils/tokens.c
deleted file mode 100644
index 2ecf427082d..00000000000
--- a/usr.sbin/afs/src/appl/afsutils/tokens.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- tokens.c - a version of 'tokens' for Arla
-
- Written by Chris Wing - wingc@engin.umich.edu
- based on examples of AFS code: klist.c and libkafs (KTH-KRB)
-
- This is a reimplementation of tokens from AFS. The following new
- features have been added:
- -athena Output format similar to the 'klist' program
- in Kerberos 4
-
- -v, -verbose Slightly more verbose output
-*/
-
-/*
- * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- *
- * Lists your current Kerberos tickets.
- * Written by Bill Sommerfeld, MIT Project Athena.
- */
-
-#include "appl_locl.h"
-
-RCSID("$arla: tokens.c,v 1.10 2001/01/21 15:33:36 lha Exp $");
-
-#include "tokens.h"
-
-
-/*
- * State variables
- */
-
-/* produce verbose output? */
-static int arg_verbose = 0;
-
-/* produce kerberos4 style output? */
-static int arg_athena = 0;
-
-/* print out help message */
-static int arg_help = 0;
-
-/* print out version number */
-static int arg_version = 0;
-
-/* do we actually have any valid AFS tokens? */
-static int got_tokens = 0;
-
-/* do we have any AFS tokens, valid or not? */
-static int got_anything = 0;
-
-
-/* arguments for agetarg() */
-
-struct agetargs args[] = {
- { "athena", 0, aarg_flag, &arg_athena,
- "generate 'klist' style output instead of AFS style",
- NULL, aarg_optional},
- { "verbose", 'v', aarg_flag, &arg_verbose,
- "generate verbose output",
- NULL, aarg_optional},
- { "help", 0, aarg_flag, &arg_help,
- "display this message",
- NULL, aarg_optional},
- { "version", 0, aarg_flag, &arg_version,
- "print version",
- NULL, aarg_optional},
- { NULL, 0, aarg_end, NULL, NULL }
-};
-
-/*
- * Helper functions
- */
-
-
-/* Print out a help message and exit */
-
-static void
-do_help(int exitval)
-{
- aarg_printusage(args, NULL, NULL, AARG_AFSSTYLE);
- exit(exitval);
-}
-
-/* ASCII time formatting function from klist.c (Kerberos 4) */
-
-static char *short_date(int32_t dp)
-{
- char *cp;
- time_t t = (time_t)dp;
-
- if (t == (time_t)(-1L)) return "*** Never *** ";
- cp = ctime(&t) + 4;
-
- /* Only display seconds in 'athena' mode */
- if(arg_athena)
- cp[15] = '\0';
- else
- cp[12] = '\0';
-
- return (cp);
-}
-
-
-/*
- *
- */
-
-static int
-print_token (const char *secret, size_t secret_sz,
- const struct ClearToken *ct,
- const char *cell, void *arg)
-{
- static int did_banner = 0;
- struct timeval tv;
- char start_time[20];
- char end_time[20];
-
- got_anything = 1;
-
- if ( (did_banner == 0) && (arg_athena) ) {
- printf("\nTokens held by Arla:\n\n");
- printf(" Issued Expires Principal\n");
-
- did_banner = 1;
- }
-
-#ifdef HAVE_KRB_KDCTIMEOFDAY
- krb_kdctimeofday (&tv);
-#else
- gettimeofday (&tv, NULL);
-#endif
- strlcpy (start_time, short_date(ct->BeginTimestamp), sizeof(start_time));
- if (arg_verbose || tv.tv_sec < ct->EndTimestamp)
- strlcpy (end_time, short_date(ct->EndTimestamp), sizeof(end_time));
- else
- strlcpy (end_time, ">>> Expired <<<", sizeof(end_time));
-
- /* only return success if we have non-expired tokens */
- if (tv.tv_sec < ct->EndTimestamp)
- got_tokens = 1;
-
- if(arg_athena) {
- /* Athena klist style output */
-
- printf("%s %s ", start_time, end_time);
-
- if ((ct->EndTimestamp - ct->BeginTimestamp) & 1)
- printf("User's (AFS ID %d) tokens for %s", ct->ViceId, cell);
- else
- printf("Tokens for %s", cell);
-
- if (arg_verbose)
- printf(" (%d)", ct->AuthHandle);
-
- putchar('\n');
- } else {
- /* Traditional AFS output format */
-
- if ((ct->EndTimestamp - ct->BeginTimestamp) & 1)
- printf("User's (AFS ID %d) tokens for afs@%s", ct->ViceId, cell);
- else
- printf("Tokens for afs@%s", cell);
-
- if (arg_verbose || tv.tv_sec < ct->EndTimestamp)
- printf(" [Expires %s]\n", end_time);
- else
- printf(" [%s]\n", end_time);
- }
- return 0;
-}
-
-
-/* Display list of tokens */
-
-void
-display_tokens(void)
-{
- /* AFS-style always displays the banner */
- if(!arg_athena)
- printf("\nTokens held by Arla:\n\n");
-
- arlalib_token_iter (NULL, print_token, NULL);
-
- /* Ick. Deal with AFS-style output and athena style output */
-
- if (got_anything) {
- if (!arg_athena)
- printf(" --End of list--\n");
- } else {
- if (arg_athena)
- printf("You have no AFS tokens.\n");
- }
-}
-
-
-int
-main(int argc, char **argv)
-{
- int optind = 0;
-
-#ifndef KERBEROS
- errx (1, "kerberos support isn't compiled in");
-#endif
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- warnx ("Bad argument: %s", argv[optind]);
- do_help(1);
- }
-
- if (arg_help)
- do_help(0);
-
- if (arg_version)
- errx (0, "part of %s-%s", PACKAGE, VERSION);
-
- if (k_hasafs())
- display_tokens();
- else
- errx (1, "You don't seem to have AFS running");
-
- if (!got_tokens)
- return 1;
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/afsutils/tokens.h b/usr.sbin/afs/src/appl/afsutils/tokens.h
deleted file mode 100644
index 569caa8f76f..00000000000
--- a/usr.sbin/afs/src/appl/afsutils/tokens.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Function prototypes for tokens.c */
-
-static char *short_date(int32_t dp);
-
-void display_tokens(void);
diff --git a/usr.sbin/afs/src/appl/afsutils/unlog.1 b/usr.sbin/afs/src/appl/afsutils/unlog.1
deleted file mode 100644
index db4e008d901..00000000000
--- a/usr.sbin/afs/src/appl/afsutils/unlog.1
+++ /dev/null
@@ -1,91 +0,0 @@
-.\" Copyright (c) 2000 Kungliga Tekniska Högskolan
-.\" (Royal Institute of Technology, Stockholm, Sweden).
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" 3. Neither the name of the Institute nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $arla: unlog.1,v 1.6 2003/04/25 18:12:22 lha Exp $
-.\"
-.Dd July 7, 1999
-.Dt UNLOG 1
-.Os "The Arla Project"
-.Sh NAME
-.Nm unlog
-.Nd
-A program to destroy some or all of your AFS tokens
-.Sh SYNOPSIS
-.Nm
-.Op Fl cell Ar cells...
-.Op Ar cells...
-.Op Fl help
-.Sh DESCRIPTION
-The following flags are supported:
-.Bl -tag -width xxxx
-.It Fl cell
-List of cells to remove tokens from. You do not need to specify this flag;
-you can execute the command simply as:
-.Pp
-.Nm
-cellname cellname ...
-.It Fl help
-Prints out a help message.
-.El
-.Sh EXAMPLES
-Remove all tokens for cell umich.edu
-.Pp
-.Nm
-umich.edu
-.Pp
-Remove all tokens for umich.edu engin.umich.edu
-.Pp
-.Nm
-umich.edu engin.umich.edu
-.Sh EXIT STATUS
-If any errors occur during the unlog process, the exit status of
-.Nm
-is 1, otherwise it is 0.
-.Sh NOTES
-.Nm
-works by first stashing the tokens you want to keep in a safe place,
-then removing all your tokens, and then restoring the tokens that
-you didn't want to get rid of.
-For this reason, if you use
-.Nm
-to remove only some tokens, there will be a brief period while this
-program runs during which time your current PAG will have no tokens,
-leading to a so called "authentication outage".
-This may be problematic if a program is running simultaneously which
-requires constant authenticated access to AFS.
-.Sh SEE ALSO
-.Xr aklog 1 ,
-.Xr kauth 1 ,
-.Xr klog 1 ,
-.Xr tokens 1
-.Sh BUGS
-Arla should implement a specicial AFS pioctl to allow removing only
-one token at a time, to prevent the aforementioned problem.
diff --git a/usr.sbin/afs/src/appl/afsutils/unlog.c b/usr.sbin/afs/src/appl/afsutils/unlog.c
deleted file mode 100644
index 8ebc4c0c2fd..00000000000
--- a/usr.sbin/afs/src/appl/afsutils/unlog.c
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- unlog.c - a version of 'unlog' for Arla
-
- Written by Chris Wing - wingc@engin.umich.edu
- based on examples of AFS code in klist.c and libkafs (KTH-KRB)
-
- This is a reimplementation of unlog from AFS.
-*/
-
-#include "appl_locl.h"
-
-RCSID("$arla: unlog.c,v 1.10 2002/02/07 17:58:09 lha Exp $");
-
-#include "unlog.h"
-
-
-/*
- * State variables
- */
-
-/* Holding space for saved tokens */
-struct token *saved_tokens;
-
-/* Number of saved tokens */
-static int numtokens;
-
-/* Did we lose any tokens when trying to restore? */
-static int lost_tokens = 0;
-
-static int unlog_version = 0;
-static int unlog_help = 0;
-static agetarg_strings unlog_cells, unlog_cells_no_argument;
-
-/*
- * Various helper functions that we call
- */
-
-/* Get token # 'tnum' and store it into buffer pointed at by 'tok'
- Return pointer to cell name for convenience */
-
-char *gettoken(int tnum, struct token *tok)
-{
- uint32_t i;
- struct ViceIoctl parms;
-
- int32_t zero_length = 0;
-
- i = tnum;
-
- parms.in = (void *)&i;
- parms.in_size = sizeof(i);
- parms.out = (void *)tok->tbuf;
- parms.out_size = 128 * sizeof(char);
-
- if(k_pioctl(NULL, VIOCGETTOK, &parms, 0) != 0)
- return(NULL);
- else {
- int32_t size_secret_tok, size_public_tok, size_cell_name;
- unsigned char *r = tok->tbuf;
-
- /* get length of secret token */
- memcpy(&size_secret_tok, r, sizeof(size_secret_tok));
-
- /* skip over secret token + length */
- r += size_secret_tok + sizeof(size_secret_tok);
- /* get length of public token */
- memcpy(&size_public_tok, r, sizeof(size_public_tok));
-
- r += size_public_tok + sizeof(size_public_tok);
-
- /* get length of cell name */
- memcpy(&size_cell_name, r, sizeof(size_cell_name));
-
- /* FIXME: it seems we must set this value to 0 in order
- 'not to mark this as the primary cell' when we re-store
- the token. Is this right? */
- memcpy(r, &zero_length, sizeof(zero_length));
-
- r += sizeof(size_cell_name);
-
- tok->size = size_secret_tok + size_public_tok + size_cell_name + 1
- + 3 * sizeof(int32_t);
-
- tok->cell = (char *)r;
-
- /* handle overflows of cellname */
- if(tok->size > 128) {
- tok->size = 128;
- tok->tbuf[127] = '\0';
- fprintf(stderr, "Cell name overflowed: %s\n", tok->cell);
- }
-
- return(tok->cell);
- }
-}
-
-
-/* Restore token from buffer 'tok' */
-
-void restoretoken(struct token *tok)
-{
- struct ViceIoctl parms;
- int ret;
-
- parms.in = tok->tbuf;
- parms.in_size = tok->size;
- parms.out = 0;
- parms.out_size = 0;
- ret = k_pioctl(0, VIOCSETTOK, &parms, 0);
-
- if(ret) {
- fprintf(stderr, "Lost token for cell: %s\n", tok->cell);
- lost_tokens = 1;
- }
-
- return;
-}
-
-/*
- * options to program
- */
-
-struct agetargs args[] = {
- { "cell", 0, aarg_strings, &unlog_cells,
- "only remove tokens for this cell or cells",
- "AFS cell name(s)", aarg_optional},
- { NULL, 0, aarg_generic_string, &unlog_cells_no_argument,
- "only remove tokens for this cell or cells",
- "AFS cell name(s)", aarg_optional},
- { "help", 0, aarg_flag, &unlog_help, "help",
- NULL, aarg_optional},
- { "version", 0, aarg_flag, &unlog_version, "print version",
- NULL, aarg_optional},
- { NULL, 0, aarg_end, NULL, NULL }
-};
-
-/*
- * Print out a help message and exit
- */
-
-static void
-do_help(int exitval)
-{
- aarg_printusage(args, NULL, NULL, AARG_AFSSTYLE);
- exit(exitval);
-}
-
-/*
- * Main program code
- */
-
-int
-main(int argc, char **argv)
-{
- int i, j, optind = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- warnx("Bad argument: %s", argv[optind]);
- do_help(1);
- }
-
- if (unlog_help)
- do_help(0);
-
- if (unlog_version)
- errx (0, "part of %s-%s", PACKAGE, VERSION);
-
- if(!k_hasafs())
- errx (1, "You don't seem to have AFS running");
-
- if(unlog_cells_no_argument.num_strings)
- unlog_cells = unlog_cells_no_argument;
-
- /* Save tokens if need be */
- if(unlog_cells.num_strings) {
- char *cell;
- struct token *save;
- int token_overflow = 0;
-
- /* allocate space for 1 more token in case of overflow */
- saved_tokens = malloc( (MAX_TOKENS + 1) * sizeof(struct token));
-
- if(!saved_tokens) {
- fprintf(stderr, "Can't malloc space to store tokens!\n");
- exit(1);
- }
-
- numtokens = 0;
- i=0;
-
- save = saved_tokens;
- while((cell = gettoken(i, &saved_tokens[numtokens]))) {
- int keep_this_token = 1;
-
- i++;
-
- if(token_overflow) {
- fprintf(stderr,
- "Ran out of space to save token in cell %s\n",
- cell);
- lost_tokens = 1;
- }
-
- for (j = 0 ; j < unlog_cells.num_strings; j++)
- if (strcmp (unlog_cells.strings[j], cell) == 0)
- keep_this_token = 0;
-
- if(keep_this_token) {
- numtokens++;
- save++;
- }
-
- if(numtokens == MAX_TOKENS) {
- numtokens = MAX_TOKENS-1;
- token_overflow = 1;
- }
- }
- }
-
- /* Now destroy all tokens */
- if(k_unlog() != 0) {
- fprintf(stderr, "pioctl(VIOCUNLOG) returned error!\n");
-
- /* make sure the program exits with status 1 */
- lost_tokens = 1;
- }
-
- /* Now restore tokens we want to keep */
- if(numtokens) {
- for(i=0; i<numtokens; i++) {
- restoretoken(&saved_tokens[i]);
- }
-
- /* Erase the copy of all saved tokens in the process's
- memory image! */
- memset(saved_tokens, 0, MAX_TOKENS * sizeof(struct token));
-
- /* Return an error code if we lost some tokens somehow, or if the
- unlog pioctl failed */
- exit(lost_tokens);
- }
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/afsutils/unlog.h b/usr.sbin/afs/src/appl/afsutils/unlog.h
deleted file mode 100644
index d4252decab4..00000000000
--- a/usr.sbin/afs/src/appl/afsutils/unlog.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Our silly token storage data structure */
-
-struct token {
- /* FIXME: Is 128 bytes always enough? */
- char tbuf[128];
- int32_t size;
- char *cell;
-};
-
-
-/* Function prototypes for unlog.c */
-
-char *gettoken(int tnum, struct token *tok);
-
-void restoretoken(struct token *tok);
-
-
-/* Maximum number of tokens to save */
-
-#define MAX_TOKENS 32
-
diff --git a/usr.sbin/afs/src/appl/afsutils/up.c b/usr.sbin/afs/src/appl/afsutils/up.c
deleted file mode 100644
index 0397237647f..00000000000
--- a/usr.sbin/afs/src/appl/afsutils/up.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (c) 1995-2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-
-#include "appl_locl.h"
-#include <kafs.h>
-
-RCSID("$arla: up.c,v 1.6 2000/10/03 00:06:41 lha Exp $");
-
-static void do_help (int exitval);
-static int copyacl (char *from, char *to);
-
-static int arg_help = 0;
-static int arg_verbose = 0;
-static int arg_one = 0;
-static int arg_force = 0;
-static int arg_backup = 0;
-static int arg_savedate = 0;
-
-struct agetargs args[] = {
- { NULL , 'h', aarg_flag, &arg_help,
- "verbose", NULL, aarg_optional},
- { NULL , 'v', aarg_flag, &arg_verbose,
- "verbose", NULL, aarg_optional},
- { NULL , '1', aarg_flag, &arg_one,
- "top level only", NULL, aarg_optional},
- { NULL , 'f', aarg_flag, &arg_force,
- "force", NULL, aarg_optional},
- { NULL , 'r', aarg_flag, &arg_backup,
- "verbose", NULL, aarg_optional},
- { NULL , 'x', aarg_flag, &arg_savedate,
- "verbose", NULL, aarg_optional},
- { NULL, 0, aarg_end, NULL, NULL }
-};
-
-static void
-do_help (int exitval)
-{
- aarg_printusage(args, NULL,
- "<from-directory> <to-directory>",
- AARG_SHORTARG);
- exit(exitval);
-}
-
-
-static int
-copyacl (char *from, char *to)
-{
- struct ViceIoctl a_params;
- char buf[AFSOPAQUEMAX];
-
- a_params.in_size = 0;
- a_params.in = NULL;
- a_params.out_size = sizeof(buf);
- a_params.out = buf;
-
- if (k_pioctl (from, VIOCGETAL, &a_params, 1) != 0) {
- fprintf (stderr, "k_pioctl(\"%s\", VIOCGETAL) failed %d\n",
- from, errno);
- return errno;
- }
-
- a_params.in_size = sizeof(buf);
- a_params.in = buf;
- a_params.out_size = 0;
- a_params.out = NULL;
-
- if (k_pioctl (to, VIOCSETAL, &a_params, 1) != 0) {
- fprintf (stderr, "k_pioctl(\"%s\", VIOCSETAL) failed %d\n",
- to, errno);
- return errno;
- }
- return 0;
-}
-
-
-static int
-check_source_dir (const char *path)
-{
- struct stat sb;
- int ret;
-
- ret = lstat (path, &sb);
- if (ret) {
- if (errno == ENOENT)
- errx (1, "source diretory `%s' doesn't exist", path);
- else
- err (1, "check_source_dir: lstat: path `%s'", path);
- }
-
- /* XXX */
-
- return 0;
-}
-
-
-
-int
-main(int argc, char **argv)
-{
- int optind = 0;
- char *fromdir;
- char *todir;
- int ret;
-
- if (agetarg (args, argc, argv, &optind, AARG_SHORTARG))
- do_help(1);
-
- if (arg_help)
- do_help(0);
-
- argc -= optind;
- argv += optind;
-
- if (argc != 2)
- do_help(1);
-
- if (!k_hasafs())
- errx (1, "there seam to be no AFS no this computer");
-
- fromdir = argv[0];
- todir = argv[1];
-
- if (arg_verbose)
- printf ("fromdir: \"%s\" todir: \"%s\"\n", fromdir, todir);
-
- check_source_dir (todir);
- ret = copyacl (fromdir, todir);
- if (ret)
- errx (1, "copyacl failed with %s (%d)", strerror(ret), ret);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/amon/Makefile.in b/usr.sbin/afs/src/appl/amon/Makefile.in
deleted file mode 100644
index ea2e8338720..00000000000
--- a/usr.sbin/afs/src/appl/amon/Makefile.in
+++ /dev/null
@@ -1,121 +0,0 @@
-# $KTH: Makefile.in,v 1.8.2.1 2001/05/28 11:31:55 mattiasa Exp $
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-LN_S = @LN_S@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-transform = @program_transform_name@
-EXECSUFFIX = @EXECSUFFIX@
-
-APPL_BIN = @MAKE_X_PROGS_BIN@
-
-DEFS = @DEFS@
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-X_CFLAGS = @X_CFLAGS@
-
-ETAGS = etags
-MAKEDEPEND = makedepend
-AFSWSROOT = /usr/afsws
-RXKADINC = -I$(srcdir)/../../rxkad
-INCLUDES = -I$(srcdir)/../lib \
- -I$(srcdir)/../.. \
- -I$(srcdir)/../../include \
- -I../../include \
- -I../../rxdef \
- $(KERNEL_INCLUDE) \
- -I$(srcdir)/../../xfs/include \
- -I$(srcdir)/../../arlad \
- $(RXKADINC)
-
-DEFINES =
-REALCFLAGS = $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) \
- $(X_CFLAGS) @PLWP_INC_FLAGS@ @INC_roken@
-RXKAD_LIBS = @MILKO_RXKAD_LIBS@
-KERNEL_INCLUDE = @KERNEL_INCLUDE@
-KAFS_LIBS = @AIX_EXTRA_KAFS@ @KAFS_LIBS@
-LIB_tgetent = @LIB_tgetent@
-LIBS = -L../lib -larlalib \
- -L../../rxdef -lrxdefclient \
- -L../../rx -lrx \
- -L../../lwp -llwp @PLWP_LIB_FLAGS@ \
- -L../../lib/ko -lko -L../../util -lutil \
- -L../../lib/sl -lsl \
- @LIB_readline@ \
- $(RXKAD_LIBS) \
- $(KAFS_LIBS) \
- $(RXKAD_LIBS) \
- @LIB_roken@ @LIBS@
-
-AMON_LIBS = @X_LIBS@ \
- -lXaw -lXt -lXmu -lXext @X_PRE_LIBS@ -lX11 @X_EXTRA_LIBS@
-
-LIBDEPENDS = ../../rxdef/librxdefclient.a ../../rx/librx.a ../../lwp/liblwp.a \
- ../../util/libutil.a ../../lib/sl/libsl.a \
- ../../lib/ko/libko.a ../lib/libarlalib.a
-
-X_PROGS_BIN = amon
-PROGS = @MAKE_X_PROGS_BIN@
-AMON_SRCS = amon.c
-SRCS = $(AMON_SRCS)
-AMON_OBJS = amon.o
-
-all: $(PROGS)
-
-.PHONY: all install uninstall depend tags clean
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(bindir)/$$f; \
- done ;
-
-uninstall:
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
- done
-
-amon: $(AMON_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(AMON_OBJS) $(LIBS) $(AMON_LIBS)
-
-Makefile: Makefile.in ../../config.status
- cd ../..; CONFIG_FILES=appl/amon/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(CFILES)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(PROGS) $(OBJS) *~ *.o core arladeb.c
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/appl/amon/amon.c b/usr.sbin/afs/src/appl/amon/amon.c
deleted file mode 100644
index 284ddb56dd1..00000000000
--- a/usr.sbin/afs/src/appl/amon/amon.c
+++ /dev/null
@@ -1,474 +0,0 @@
-/*
- * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-
-#include <stdio.h>
-#include <X11/Intrinsic.h>
-#include <X11/IntrinsicP.h>
-#include <X11/StringDefs.h>
-#include <X11/Xaw/XawInit.h>
-#include <X11/Xaw/StripCharP.h>
-#include <X11/Xmu/Converters.h>
-#include <X11/Xatom.h>
-#include <X11/StringDefs.h>
-#include <X11/Shell.h>
-
-#include <X11/Xaw/Cardinals.h>
-#include <X11/Xaw/StripChart.h>
-#include <X11/Xaw/Box.h>
-#include <X11/Xaw/Label.h>
-#include <X11/Xaw/Paned.h>
-#include <X11/Xmu/SysUtil.h>
-
-#include <parse_bytes.h>
-
-#include "appl_locl.h"
-
-RCSID("$arla: amon.c,v 1.12 2003/01/17 03:23:32 lha Exp $");
-
-#if 0
-static XrmOptionDescRec options[] = {};
-#endif
-
-int debug = 0;
-XtAppContext app_con;
-
-#if 0
-/*
- * Create a widget for doing the same thing as stripChartWidgetClass
- * but add two lines
- */
-
-#ifndef XtNmaxScale
-#define XtNmaxScale "XtNmaxScale"
-#endif
-
-/*
- * Class
- */
-typedef struct {int dummy;} StripChartMinMaxClassPart;
-
-typedef struct _StripChartMinMaxClassRec {
- CoreClassPart core_class;
- SimpleClassPart simple_class;
- StripChartClassPart strip_chart_class;
- StripChartMinMaxClassPart strip_minmax_class;
-} StripChartMinMaxClassRec;
-
-/*
- * Instance
- */
-
-typedef struct {
- GC sGC;
-
- int min_value;
- int max_value;
-} StripChartMinMaxRec_local;
-
-typedef struct _StripChartMinMaxRec {
- CorePart core;
- SimplePart simple;
- StripChartPart strip_chart;
- StripChartMinMaxRec_local strip_minmax;
-} StripChartMinMaxRec;
-
-typedef struct _StripChartMinMaxRec *StripChartMinMaxWidget;
-
-
-#define offset(field) XtOffsetOf(StripChartMinMaxRec, field)
-
-static XtResource resources[] = {
- {XtNminScale, XtCScale, XtRInt, sizeof(int),
- offset(strip_minmax.min_value), XtRImmediate, (XtPointer) 0},
- {XtNmaxScale, XtCScale, XtRInt, sizeof(int),
- offset(strip_minmax.min_value), XtRImmediate, (XtPointer) 0}
-};
-
-
-/*
- * Prototypes
- */
-
-static void Initialize (Widget greq, Widget gnew, ArgList args,
- Cardinal *num_args);
-static void Destroy (Widget widget);
-static void SetPoints(Widget widget);
-static void Redisplay(Widget w, XEvent *event, Region region);
-static Boolean SetValues (Widget current, Widget request, Widget new,
- ArgList args, Cardinal *num_args);
-
-
-/*
- * The class struct
- */
-
-
-StripChartMinMaxClassRec stripChartMinMaxClassRec = {
- { /* core fields */
- /* superclass */ (WidgetClass) &stripChartClassRec,
- /* class_name */ "StripChartMinMax",
- /* size */ sizeof(StripChartMinMaxRec),
- /* class_initialize */ XawInitializeWidgetSet,
- /* class_part_initialize */ NULL,
- /* class_inited */ FALSE,
- /* initialize */ Initialize,
- /* initialize_hook */ NULL,
- /* realize */ XtInheritRealize,
- /* actions */ NULL,
- /* num_actions */ 0,
- /* resources */ resources,
- /* num_resources */ XtNumber(resources),
- /* xrm_class */ NULLQUARK,
- /* compress_motion */ TRUE,
- /* compress_exposure */ XtExposeCompressMultiple |
- XtExposeGraphicsExposeMerged,
- /* compress_enterleave */ TRUE,
- /* visible_interest */ FALSE,
- /* destroy */ Destroy,
- /* resize */ SetPoints,
- /* expose */ Redisplay,
- /* set_values */ SetValues,
- /* set_values_hook */ NULL,
- /* set_values_almost */ NULL,
- /* get_values_hook */ NULL,
- /* accept_focus */ NULL,
- /* version */ XtVersion,
- /* callback_private */ NULL,
- /* tm_table */ NULL,
- /* query_geometry */ XtInheritQueryGeometry,
- /* display_accelerator */ XtInheritDisplayAccelerator,
- /* extension */ NULL
- },
- { /* Simple class fields */
- /* change_sensitive */ XtInheritChangeSensitive
- }
-};
-
-WidgetClass stripChartMinMaxWidgetClass =
- (WidgetClass) &stripChartMinMaxClassRec;
-
-
-/*
- *
- *
- */
-
-static void
-Initialize (Widget greq, Widget gnew,
- ArgList args, Cardinal *num_args)
-{
- printf ("initialize\n");
-#if 0
- (stripChartMinMaxClassRec.core_class.superclass->core_class.initialize) (greq, gnew, args, num_args);
-#endif
-}
-
-static void
-Destroy (Widget widget)
-{
- printf ("destroy\n");
-#if 0
- (stripChartMinMaxClassRec.core_class.superclass->core_class.destroy) (widget);
-#endif
-}
-
-static void
-SetPoints(Widget widget)
-{
- printf ("resize\n");
-#if 0
- (stripChartMinMaxClassRec.core_class.superclass->core_class.resize) (widget);
-#endif
-}
-
-static void
-Redisplay(Widget w, XEvent *event, Region region)
-{
- printf ("expose\n");
-#if 0
- (stripChartMinMaxClassRec.core_class.superclass->core_class.expose) (w, event, region);
-#endif
-}
-
-static Boolean
-SetValues (Widget current, Widget request, Widget new,
- ArgList args, Cardinal *num_args)
-{
- printf ("set_values\n");
-#if 0
- return (stripChartMinMaxClassRec.core_class.superclass->core_class.set_values) (current, request, new, args, num_args);
-#endif
-}
-
-#endif
-
-static void
-SetTitleOfLabel (Widget w_label, String string)
-{
- Arg title_args[1];
-
- XtSetArg (title_args[0], XtNlabel, string);
- XtSetValues (w_label, title_args, ONE);
-}
-
-static void
-SetNotPaned (Widget w)
-{
- Arg paned_args[1];
-
- XtSetArg (paned_args[0], XtNshowGrip, FALSE);
- XtSetValues (w, paned_args, ONE);
-}
-
-
-/*
- * The program
- */
-
-static void
-GetUsedBytes(Widget w, XtPointer closure, XtPointer call_data)
-{
- int64_t max_bytes;
- int64_t used_bytes;
- static char str[100];
- char ub[100], mb[100];
-
- Widget label = (Widget) closure;
-
- double *bytesavg = (double *)call_data;
- int err;
-
- err = fs_getfilecachestats (&max_bytes, &used_bytes, NULL,
- NULL, NULL, NULL);
-
- if (err) {
- warnx ("bytes: fs_getfilecachestats returned %d", err);
- *bytesavg = 1.0;
- return;
- }
-
- if (max_bytes == 0) {
- *bytesavg = 1.0;
- warnx ("bytes: will not divide with zero (used: %ld)",
- (long)used_bytes);
- return;
- }
-
- *bytesavg = (float) used_bytes / max_bytes;
-
- if (debug)
- warnx ("kbytes: max: %ld used: %ld usage: %f",
- (long)max_bytes, (long)used_bytes, *bytesavg);
-
- ub[0] = mb[0] = '\0';
- unparse_bytes_short ((long)used_bytes, ub, sizeof(ub));
- unparse_bytes_short ((long)max_bytes, mb, sizeof(mb));
-
- snprintf (str, sizeof(str), "(%s/%s)", ub, mb);
- SetTitleOfLabel (label, str);
-}
-
-static void
-GetUsedVnodes(Widget w, XtPointer closure, XtPointer call_data)
-{
- int64_t max_vnodes;
- int64_t used_vnodes;
- static char str[100];
-
- Widget label = (Widget) closure;
-
- double *vnodeavg = (double *)call_data;
- int err;
-
-
- err = fs_getfilecachestats (NULL, NULL, NULL,
- &max_vnodes, &used_vnodes, NULL);
-
- if (err) {
- *vnodeavg = 1.0;
- warnx ("vnodes: fs_getfilecachestats returned %d", err);
- return;
- }
-
- if (max_vnodes == 0) {
- *vnodeavg = 1.0;
- warnx ("vnodes: will not divide with zero (used: %ld)",
- (long)used_vnodes);
- return;
- }
-
- *vnodeavg = (float) used_vnodes / max_vnodes;
-
- if (debug)
- warnx ("vnode: max: %ld used: %ld usage: %f",
- (long)max_vnodes, (long)used_vnodes, *vnodeavg);
-
- snprintf (str, sizeof(str), "vnodes# (%ld/%ld)",
- (long)used_vnodes, (long)max_vnodes);
- SetTitleOfLabel (label, str);
-}
-
-#ifdef VIOC_AVIATOR
-static void
-GetUsedWorkers(Widget w, XtPointer closure, XtPointer call_data)
-{
- uint32_t max_workers;
- uint32_t used_workers;
- static char str[100];
-
- Widget label = (Widget) closure;
-
- double *workeravg = (double *)call_data;
- int err;
-
- err = fs_getaviatorstats (&max_workers, &used_workers);
-
- if (err) {
- *workeravg = 1.0;
- warnx ("workers: fs_getfilecachestats returned %d", err);
- return;
- }
-
- if (max_workers == 0) {
- *workeravg = 1.0;
- warnx ("workers: will not divide with zero (used: %d)", used_workers);
- return;
- }
-
- *workeravg = (float) used_workers / max_workers;
-
- if (debug)
- warnx ("workers: max: %d used: %d usage: %f",
- max_workers, used_workers, *workeravg);
-
- snprintf (str, sizeof(str), "workers (%d/%d)", used_workers, max_workers);
- SetTitleOfLabel (label, str);
-}
-#endif
-
-static void
-CreateMonitorBar (Widget frame, XtCallbackProc proc, String name)
-{
- Widget box, bar, label;
- Arg pretty_args[] = {
- {XtNborderWidth, (XtArgVal)0},
- };
-
- box = XtCreateManagedWidget ("box", panedWidgetClass,
- frame, (ArgList) NULL, ZERO);
-
- label = XtCreateManagedWidget ("label", labelWidgetClass,
- box, pretty_args,
- XtNumber(pretty_args));
-
- SetTitleOfLabel (label, name);
- SetNotPaned (label);
-
- bar = XtCreateManagedWidget ("bar", stripChartWidgetClass,
- box, NULL, ZERO);
- XtAddCallback (bar, XtNgetValue, proc, label);
- SetNotPaned (bar);
-}
-
-
-
-/*
- * Actions
- */
-
-static void
-quit(Widget widget, XEvent *event, String *params, Cardinal *num_parms)
-{
- XtDestroyApplicationContext(app_con);
- exit(0);
-}
-
-
-/*
- *
- */
-
-int main (int argc, char **argv)
-{
- Widget top, frame;
-
- XtActionsRec Actions[] = {
- { "quit", quit}
- };
-
- if (debug)
- warnx ("has afs");
-
- if (!k_hasafs())
- errx (1, "no afs");
-
- if (debug)
- warnx ("init Xt");
-
- top = XtAppInitialize(&app_con, "amon", NULL, ZERO,
- /* options, XtNumber(options), */
- &argc, argv, NULL, NULL, (Cardinal) 0);
-
- if (argc != 1) {
- print_version(NULL);
- errx (1, "usage");
- }
-
- if (debug)
- warnx ("creating windows");
-
- XtAppAddActions (app_con, Actions, XtNumber(Actions));
-
-
- frame = XtCreateManagedWidget ("frame", panedWidgetClass,
- top, (ArgList) NULL, ZERO);
-
- XtOverrideTranslations(frame,
- XtParseTranslationTable("<Key>q:quit()\n"));
-
- /* XXX */
- CreateMonitorBar (frame, GetUsedBytes," bytes (0/0) ");
- CreateMonitorBar (frame, GetUsedVnodes, "vnode# (0/0)");
-#ifdef VIOC_AVIATOR
- CreateMonitorBar (frame, GetUsedWorkers, "workers# (0/0)");
-#endif
-
- XtRealizeWidget (top);
-
- if (debug)
- warnx ("X-loop");
-
- XtAppMainLoop(app_con);
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/asrvutil/Makefile.in b/usr.sbin/afs/src/appl/asrvutil/Makefile.in
deleted file mode 100644
index bda594261ae..00000000000
--- a/usr.sbin/afs/src/appl/asrvutil/Makefile.in
+++ /dev/null
@@ -1,120 +0,0 @@
-# $KTH: Makefile.in,v 1.6.2.1 2001/05/28 11:32:00 mattiasa Exp $
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-LN_S = @LN_S@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-transform = @program_transform_name@
-EXECSUFFIX = @EXECSUFFIX@
-
-APPL_BIN = asrvutil
-
-DEFS = @DEFS@
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-X_CFLAGS = @X_CFLAGS@
-
-ETAGS = etags
-MAKEDEPEND = makedepend
-RXKADINC = -I$(srcdir)/../../rxkad
-INCLUDES = -I$(srcdir)/../.. \
- -I$(srcdir)/../../include \
- -I$(srcdir)/../lib \
- -I../../include \
- -I../../rxdef \
- -I. \
- $(KERNEL_INCLUDE) \
- -I$(srcdir)/../../xfs/include \
- -I$(srcdir)/../../arlad \
- @INC_roken@ \
- $(RXKADINC)
-
-DEFINES =
-REALCFLAGS = $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) \
- $(X_CFLAGS) @PLWP_INC_FLAGS@
-RXKAD_LIBS = @MILKO_RXKAD_LIBS@
-KERNEL_INCLUDE = @KERNEL_INCLUDE@
-READLINE_lib = @LIB_readline@
-KAFS_LIBS = @AIX_EXTRA_KAFS@ @KAFS_LIBS@
-LIB_tgetent = @LIB_tgetent@
-LIBS = -L../lib -larlalib \
- -L../../rxdef -lrxdefclient -lkaclient \
- -L../../rx -lrx \
- -L../../lwp -llwp @PLWP_LIB_FLAGS@ \
- -L../../lib/ko -lko -L../../util -lutil \
- -L../../lib/sl -lsl \
- $(READLINE_lib) \
- $(RXKAD_LIBS) \
- $(KAFS_LIBS) \
- $(RXKAD_LIBS) \
- @ROKEN@ @LIBS@
-
-LIBDEPENDS = ../../rxdef/librxdefclient.a ../../rx/librx.a ../../lwp/liblwp.a \
- ../../util/libutil.a ../../lib/sl/libsl.a ../../lib/roken/libroken.a \
- ../../lib/ko/libko.a ../lib/libarlalib.a
-
-PROGS = asrvutil
-ASRVUTIL_SRCS = asrvutil.c
-SRCS = $(ASRVUTIL_SRCS)
-ASRVUTIL_OBJS = asrvutil.o
-HDRS =
-
-all: $(PROGS)
-
-.PHONY: all install uninstall depend tags clean
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(bindir)/$$f; \
- done ;\
-
-uninstall:
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
- done
-
-asrvutil: $(ASRVUTIL_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(ASRVUTIL_OBJS) $(LIBS)
-
-Makefile: Makefile.in ../../config.status
- cd ../..; CONFIG_FILES=appl/asrvutil/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(CFILES)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(PROGS) $(OBJS) *~ *.o core
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/appl/asrvutil/README b/usr.sbin/afs/src/appl/asrvutil/README
deleted file mode 100644
index 6168b21af74..00000000000
--- a/usr.sbin/afs/src/appl/asrvutil/README
+++ /dev/null
@@ -1,10 +0,0 @@
-CURRENT STATUS:
-===============
-
-It seems to me that you can't get equivalent of changepw/kerberos thru
-the kerberos server running in the KA-server.
-
-Now I haven't found any documentation how you really get tokens from
-the ka-server. If someone helps me with that, ending the program is
-trivial (ahm, a least it should be).
-
diff --git a/usr.sbin/afs/src/appl/asrvutil/asrvutil.c b/usr.sbin/afs/src/appl/asrvutil/asrvutil.c
deleted file mode 100644
index 014af347eff..00000000000
--- a/usr.sbin/afs/src/appl/asrvutil/asrvutil.c
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sl.h>
-#include "appl_locl.h"
-#include <ka.h>
-#include <ka.cs.h>
-#include <err.h>
-
-RCSID("$KTH: asrvutil.c,v 1.7 2000/10/03 00:06:52 lha Exp $");
-
-static int help_cmd (int argc, char **argv);
-
-/*
- * This code is pretty much just stolen out of ksrvutil_get.c
- */
-
-void
-safe_write(char *filename, int fd, void *buf, size_t len)
-{
- if (write(fd, buf, len) != len) {
- warn("write %s", filename);
- close(fd);
- errx(1, "safe_write: In progress srvtab in this file. %s", filename);
- }
-}
-
-#ifndef ANAME_SZ
-#define ANAME_SZ 40
-#define REALM_SZ 40
-#define SNAME_SZ 40
-#define INST_SZ 40
-#endif
-
-void
-add_key_to_file (char *file,
- kaname *name,
- kaname *instance,
- int32_t kvno,
- const EncryptionKey *key)
-{
- char sname[ANAME_SZ]; /* name of service */
- char sinst[INST_SZ]; /* instance of service */
- char srealm[REALM_SZ]; /* realm of service */
- char realm[REALM_SZ]; /* realm of service */
- int8_t skvno;
- des_cblock skey;
- int fd;
-
- strlcpy (realm, cell_getthiscell(), sizeof(realm));
-
- {
- char *cp;
- for (cp = realm; *cp; cp++)
- *cp = toupper(*cp);
- }
-
-
- if (file == NULL)
- file = "/etc/srvtab";
-
- fd = open (file, O_RDWR|O_CREAT, 0600);
- if (fd < 0)
- err (1, "add_key_to_file: open");
-
- lseek(fd, 0, SEEK_SET);
-
- while(getst(fd, sname, SNAME_SZ) > 0 &&
- getst(fd, sinst, INST_SZ) > 0 &&
- getst(fd, srealm, REALM_SZ) > 0 &&
- read(fd, &skvno, sizeof(skvno)) > 0 &&
- read(fd, skey, sizeof(skey)) > 0) {
-
- if(strcmp((char *)name, sname) == 0 &&
- strcmp((char *)instance, sinst) == 0 &&
- strcasecmp(realm, srealm) == 0) {
- lseek(fd, lseek(fd,0,SEEK_CUR)-(sizeof(skvno) + sizeof(skey)),
- SEEK_SET);
- safe_write(file, fd, &kvno, sizeof(kvno));
- safe_write(file, fd, (EncryptionKey *)key,
- sizeof(EncryptionKey));
- if (close (fd))
- err (1, "add_key_to_file: close");
- return;
- }
- }
- safe_write(file, fd, name, strlen((char *)name) + 1);
- safe_write(file, fd, instance, strlen((char *)instance) + 1);
- safe_write(file, fd, realm, strlen(realm) + 1);
- safe_write(file, fd, &kvno, sizeof(kvno));
- safe_write(file, fd, (EncryptionKey *)key,
- sizeof(EncryptionKey));
-
- if (close (fd))
- err (1, "add_key_to_file: close");
-}
-
-/*
- *
- */
-
-static void
-asrvutil_usage(char *progname)
-{
- printf("asrvutil - manages srvtabs. An afs replacement for ksrvutil\n");
- printf("Type \"%s help\" to get a list of commands.\n",
- progname);
- exit(1);
-}
-
-/*
- *
- */
-
-void
-get_usage(void)
-{
- printf("Usage: get [-cell <cell>] [-noauth] [-help]\n");
-}
-
-/*
- *
- */
-
-static int
-get_cmd (int argc, char **argv)
-{
- int optind = 0;
- int ret;
- struct rx_connection *connkadb = NULL;
- kaname name, instance;
- kaentryinfo entry;
- EncryptionKey key;
- des_cblock deskey;
- int32_t dbhost = 0;
- char *file = NULL;
-
- char *cell = (char *) cell_getthiscell();
- int noauth = 0;
-
- static struct agetargs get_args[] = {
- {"name", 0, arg_string, NULL, "what name to use",
- NULL},
- {"instance", 0, arg_string, NULL, "what instance to use",
- NULL},
- {"cell", 0, arg_string, NULL, "what cell to use",
- NULL},
- {"noauth", 0, arg_flag, NULL, "don't authenticate", NULL},
- {NULL, 0, arg_end, NULL}}, *arg;
-
- memset (&name, 0, sizeof(name));
- memset (&instance, 0, sizeof(instance));
-
- arg = get_args;
- arg->value = &name; arg++;
- arg->value = &instance;arg++;
- arg->value = &cell; arg++;
- arg->value = &noauth; arg++;
-
- if (getarg (get_args, argc, argv, &optind, AARG_AFSSTYLE)) {
- get_usage();
- return 0;
- }
-
- memset (&entry, 0, sizeof(entry));
- memset (&key, 0, sizeof(key));
-
- if (name[0] == '\0') {
- printf ("name: ");
- fflush (stdout);
- if (read(0, name, sizeof(name)-1) < 0) {
- err(1, "get: read stdin");
- }
- name[sizeof(name)-1] = 0;
- }
-
- if (instance[0] == '\0') {
- printf ("instace: ");
- fflush (stdout);
- if (read(0, instance, sizeof(instance)-1) < 0) {
- err(1, "get: read stdin");
- }
- instance[sizeof(instance)-1] = 0;
- }
-
- /* XXX should really try all dbservers */
-
- ret = arlalib_getsyncsite (cell, NULL, afskaport,
- &dbhost,
- arlalib_getauthflag (noauth, 0, 0, 0));
- if (ret) {
- warnx ("get: arlalib_getsyncsite: %s (%d)",
- koerr_gettext(ret), ret);
- return 0;
- }
- if (dbhost == 0)
- errx (1, "arlalib_getsyncsite: returned dbhost == 0, that not valid");
-
- printf ("dbhost: %d\n", dbhost);
-
-
- connkadb = arlalib_getconnbyaddr(cell,
- dbhost,
- NULL,
- afskaport,
- KA_MAINTENANCE_SERVICE_ID,
- arlalib_getauthflag (noauth, 0, 0, 0));
-
- if (connkadb == NULL)
- errx(1, "Could not connect to kaserver");
-
- des_new_random_key (&deskey);
- assert (sizeof (key) == sizeof(deskey));
- memcpy (&key, &deskey, sizeof(deskey));
- memset (&key, 0, sizeof(key));
-
- ret = KAM_GetEntry (connkadb, name, instance, KAMAJORVERSION, &entry);
- switch (ret) {
- case 0:
- /* Entry does already exist, just get password */
-
- ret = KAM_SetPassword (connkadb, name, instance,
- entry.key_version + 1, key);
- if (ret)
- warnx ("get: KAM_SetPassword returned %s (%d)",
- koerr_gettext(ret), ret);
-
- add_key_to_file (file, &name, &instance, entry.key_version + 1, &key);
-
- break;
- case KANOENT:
- /* Entry doesn't exist, create (and with that set password) */
-
- ret = KAM_CreateUser (connkadb, name, instance, key);
- if (ret)
- warnx ("get: KAM_CreateUser returned %s (%d)",
- koerr_gettext(ret), ret);
-
- add_key_to_file (file, &name, &instance, 1, &key);
-
- break;
- default:
- warnx ("get: KAM_GetEntry returned %s (%d)",
- koerr_gettext(ret), ret);
-
- ret = 0;
- break;
- }
-
- memset (&key, 0, sizeof(key));
- arlalib_destroyconn(connkadb);
- return ret;
-}
-
-/*
- *
- */
-
-static SL_cmd cmds[] = {
- {"get", get_cmd, "get a new cred"},
- {"help", help_cmd, "get help on pts"},
- {"?"},
- {NULL}
-};
-
-/*
- *
- */
-
-static int
-help_cmd (int argc, char **argv)
-{
- sl_help(cmds, argc, argv);
- return 0;
-}
-
-/*
- *
- */
-
-int
-main (int argc, char **argv)
-{
- int ret;
-
- set_progname(argv[0]);
-
- method = log_open (get_progname(), "/dev/stderr:notime");
- if (method == NULL)
- errx (1, "log_open failed");
- cell_init(0, method);
- ports_init();
-
- if(argc > 1) {
- ret = sl_command(cmds, argc - 1, argv + 1);
- if (ret == -1)
- printf("%s: Unknown command\n", argv[1]);
- }
- else
- asrvutil_usage(argv[0]);
-
- return 0;
-}
-
diff --git a/usr.sbin/afs/src/appl/bos/Makefile.in b/usr.sbin/afs/src/appl/bos/Makefile.in
deleted file mode 100644
index a4386b6471b..00000000000
--- a/usr.sbin/afs/src/appl/bos/Makefile.in
+++ /dev/null
@@ -1,138 +0,0 @@
-# $KTH: Makefile.in,v 1.10.2.2 2001/10/23 23:49:18 ahltorp Exp $
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-LN_S = @LN_S@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-mandir = @mandir@
-
-transform = @program_transform_name@
-EXECSUFFIX = @EXECSUFFIX@
-
-APPL_BIN = bos
-MANPAGES = bos.8
-
-DEFS = @DEFS@
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-X_CFLAGS = @X_CFLAGS@
-LDFLAGS = @LDFLAGS@
-
-ETAGS = etags
-MAKEDEPEND = makedepend
-RXKADINC = -I$(srcdir)/../../rxkad
-INCLUDES = -I$(srcdir)/../.. \
- -I$(srcdir)/../../include \
- -I$(srcdir)/../lib \
- -I../../include \
- -I../../rxdef \
- -I. \
- $(KERNEL_INCLUDE) \
- -I$(srcdir)/../../xfs/include \
- -I$(srcdir)/../../arlad \
- $(RXKADINC) \
- @INC_roken@
-
-DEFINES =
-REALCFLAGS = $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) \
- $(X_CFLAGS) @PLWP_INC_FLAGS@
-RXKAD_LIBS = @MILKO_RXKAD_LIBS@
-KERNEL_INCLUDE = @KERNEL_INCLUDE@
-READLINE_lib = @LIB_readline@
-KAFS_LIBS = @AIX_EXTRA_KAFS@ @KAFS_LIBS@
-LIB_tgetent = @LIB_tgetent@
-LIBS = -L../lib -larlalib \
- -L../../rxdef -lrxdefclient \
- -L../../rx -lrx \
- -L../../lwp -llwp @PLWP_LIB_FLAGS@ \
- -L../../lib/ko -lko -L../../util -lutil \
- -L../../lib/sl -lsl \
- $(READLINE_lib) \
- @LIB_roken@ \
- $(RXKAD_LIBS) \
- $(KAFS_LIBS) \
- $(RXKAD_LIBS) @LIBS@
-
-LIBDEPENDS = ../../rxdef/librxdefclient.a ../../rx/librx.a ../../lwp/liblwp.a \
- ../../util/libutil.a ../../lib/sl/libsl.a \
- ../../lib/ko/libko.a ../lib/libarlalib.a
-
-PROGS = bos
-BOS_SRCS = bos.c bos_status.c bos_adduser.c bos_getrestart.c bos_listhosts.c bos_listusers.c
-SRCS = $(BOS_SRCS)
-BOS_OBJS = bos.o bos_status.o bos_adduser.o bos_getrestart.o bos_listhosts.o bos_listusers.o
-HDRS =
-
-all: $(PROGS)
-
-.PHONY: all install uninstall depend tags clean
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(bindir)/$$f; \
- done ;\
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$$e ; \
- $(INSTALL_DATA) $(srcdir)/$$x \
- $(DESTDIR)$(mandir)/man$$e/$$f.$$e; \
- done
-
-uninstall:
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
- done ;\
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- rm -rf $(DESTDIR)$(mandir)/$$f.$$e; \
- done
-
-bos: $(BOS_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(BOS_OBJS) $(LIBS)
-
-Makefile: Makefile.in ../../config.status
- cd ../..; CONFIG_FILES=appl/bos/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(CFILES)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(PROGS) $(OBJS) *~ *.o core
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/appl/bos/bos.8 b/usr.sbin/afs/src/appl/bos/bos.8
deleted file mode 100644
index a174b03144b..00000000000
--- a/usr.sbin/afs/src/appl/bos/bos.8
+++ /dev/null
@@ -1,304 +0,0 @@
-.\" Copyright (c) 2000 - 2003 Kungliga Tekniska Högskolan
-.\" (Royal Institute of Technology, Stockholm, Sweden).
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" 3. Neither the name of the Institute nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $arla: bos.8,v 1.12 2003/06/06 12:53:42 hin Exp $
-.\"
-.Dd April 1, 2003
-.Dt BOS 8
-.Os "The Arla Project"
-.Sh NAME
-.Nm bos
-.Nd is the client part of the Basic Overseer Daemon that manages
-AFS server processes.
-.Sh SYNOPSIS
-.Nm bos
-.Op Ar addhost | addkey | adduser | create
-.Op Ar args
-.Nm bos
-.Op Ar delete | exec | getdate | getlog
-.Op Ar args
-.Nm bos
-.Op Ar getrestart | install | listhosts | listkeys
-.Op Ar args
-.Nm bos
-.Op Ar listusers | prune | removehost | removekey
-.Op Ar args
-.Nm bos
-.Op Ar removeuser | restart | salvage | setauth
-.Op Ar args
-.Nm bos
-.Op Ar setcellname | setrestart | shutdown | start
-.Op Ar args
-.Nm bos
-.Op Ar stop | uninstall
-.Op Ar args
-.Sh DESCRIPTION
-The
-.Nm
-utility is the client part of the Basic overseer daemon that manage
-AFS server processes.
-.Pp
-.Pp
-Most
-.Nm
-commands accept the following general arguments:
-.Pp
-.Bd -filled -offset indent -compact
-.Op Fl cell Ar cellname
-Specifies which AFS cell to use, if the default cell is not to be used.
-.Pp
-.Op Fl noauth
-Specifies that
-.Nm
-should not try to authenticate the connection to the server.
-This may be
-useful with shell scripts, or if there is a problem with the AFS cell.
-Note that the server will reject many commands if
-.Fl noauth
-is specified.
-.Pp
-.Op Fl localauth
-Create a ticket using the AFS server key, that is, you don't need a token.
-This will generally only work on AFS servers, and is very useful for
-performing automatic tasks.
-.Ed
-.Pp
-.Nm
-has several subcommands:
-.Pp
-.Ic addhost
-.Fl server Ar server
-.Fl host Ar host
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl localauth
-.Bd -filled -offset indent -compact
-Add a new
-.Ar host
-to the CellServDB on the
-.Ar server Ns .
-This makes the database server consider
-.Ar host
-as a peer and will use when they synchronize their databases (the
-database servers) need to be restarted.
-.Ed
-.Pp
-.Ic addkey
-.Fl server Ar server
-.Op Fl key Ar key
-.Op Fl kvno Ar keyversionnumber
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl localauth
-.Bd -filled -offset indent -compact
-Add a new afs-key to the KeyFile.
-Add the ticket specified in
-.Ar key
-with
-.Ar keyversionnumber
-to the
-.Ar server .
-.Ed
-.Pp
-.Ic adduser
-.Fl server Ar server
-.Fl user Ar user
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl localauth
-.Bd -filled -offset indent -compact
-Add a new user the SuperUser file on the fileserver
-.Ar server ,
-thus giving that user the right to manage volumes and bosserver.
-.Ed
-.Pp
-.Ic create
-.Fl server Ar server
-.Fl instance Ar serverprocessname
-.Fl type Ar servertype
-.Fl cmd Ar command
-.Op Fl notifier Ar program
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl localauth
-.Bd -filled -offset indent -compact
-Create a new service
-.Ar instance
-at the
-.Ar server
-of
-.Ar type.
-The instance will depending on type run the
-.Ar command
-command.
-.Ed
-.Pp
-.Ic delete
-.Fl server Ar server
-.Fl instance Ar instance
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl localauth
-.Bd -filled -offset indent -compact
-Delete the
-.Ar instance
-from the
-.Ar server .
-.Ed
-.Pp
-.Ic exec
-.Bd -filled -offset indent -compact
-.Fl server Ar server
-.Fl cmd Ar command
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl localauth
-Execute
-.Ar command
-on the server
-.Ar server .
-.Ed
-.Pp
-.Ic getdate
-.Fl server Ar server
-.Fl files Ar checkfiles
-.Op Fl dir Ar dir
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl localauth
-.Bd -filled -offset indent -compact
-Get dates for
-.Ar checkfiles
-in server-root directory (that can be specified with
-.Ar dir
-if that is needed) on
-.Ar server.
-.Ed
-.Pp
-.Ic getlog
-.Fl server Ar server
-.Fl file Ar logfile
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl localauth
-.Bd -filled -offset indent -compact
-List the content of the
-.Ar logfile
-that resides on the
-.Ar server.
-.Ed
-.Pp
-.Ic getrestart
-.Fl server Ar server
-.Op Fl dir Ar dest
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl localauth
-.Bd -filled -offset indent -compact
-Get the restart time from
-.Ar server.
-.Ed
-.Pp
-.Ic install
-.Bd -filled -offset indent -compact
-.Ed
-.Pp
-.Ic listhosts
-.Bd -filled -offset indent -compact
-.Ed
-.Pp
-.Ic listkeys
-.Bd -filled -offset indent -compact
-.Ed
-.Pp
-.Ic listusers
-.Bd -filled -offset indent -compact
-.Ed
-.Pp
-.Ic prune
-.Bd -filled -offset indent -compact
-.Ed
-.Pp
-.Ic removehost
-.Bd -filled -offset indent -compact
-.Ed
-.Pp
-.Ic removekey
-.Bd -filled -offset indent -compact
-.Ed
-.Pp
-.Ic removeuser
-.Bd -filled -offset indent -compact
-.Ed
-.Pp
-.Ic restart
-.Bd -filled -offset indent -compact
-.Ed
-.Pp
-.Ic salvage
-.Bd -filled -offset indent -compact
-.Ed
-.Pp
-.Ic setauth
-.Bd -filled -offset indent -compact
-.Ed
-.Pp
-.Ic setcellname
-.Bd -filled -offset indent -compact
-.Ed
-.Pp
-.Ic setrestart
-.Bd -filled -offset indent -compact
-.Ed
-.Pp
-.Ic shutdown
-.Bd -filled -offset indent -compact
-.Ed
-.Pp
-.Ic start
-.Bd -filled -offset indent -compact
-.Ed
-.Pp
-.Ic stop
-.Bd -filled -offset indent -compact
-.Ed
-.Pp
-.Ic uninstall
-.Bd -filled -offset indent -compact
-.Ed
-.Pp
-.Sh SEE ALSO
-.Xr fs 1 ,
-.Xr pts 1 ,
-.Xr afsd 8 ,
-.Xr vos 8
-.Sh BUGS
-Quite a lot of commands are not implemented yet.
diff --git a/usr.sbin/afs/src/appl/bos/bos.c b/usr.sbin/afs/src/appl/bos/bos.c
deleted file mode 100644
index 3166d50a250..00000000000
--- a/usr.sbin/afs/src/appl/bos/bos.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "bos_local.h"
-
-RCSID("$arla: bos.c,v 1.11 2003/01/17 03:24:48 lha Exp $");
-
-int bos_interactive = 0;
-
-static int empty_cmd(int argc, char **argv);
-static int quit_cmd(int argc, char **argv);
-static int help_cmd(int argc, char **argv);
-static int apropos_cmd(int argc, char **argv);
-
-
-/*
- * command table
- */
-
-static SL_cmd cmds[] = {
- {"addhost", bos_addhost, "add host to cell database"},
- {"addkey", empty_cmd, "not yet implemented"},
- {"adduser", bos_adduser, "add users to super-user list"},
- {"apropos", apropos_cmd, "apropos help"},
- {"create", empty_cmd, "not yet implemented"},
- {"delete", empty_cmd, "not yet implemented"},
- {"exec", empty_cmd, "not yet implemented"},
- {"exit", quit_cmd, "exit interactive mode"},
- {"getdate", empty_cmd, "not yet implemented"},
- {"getlog", empty_cmd, "not yet implemented"},
- {"getrestart", bos_getrestart, "get restart times"},
- {"help", help_cmd, "print help"},
- {"install", empty_cmd, "not yet implemented"},
- {"listhosts", bos_listhosts, "list VLDB-servers"},
- {"listkeys", empty_cmd, "not yet implemented"},
- {"listusers", bos_listusers, "list super-users"},
- {"prune", empty_cmd, "not yet implemented"},
- {"removehost", bos_removehost, "remove host from cell database"},
- {"removekey", empty_cmd, "not yet implemented"},
- {"removeuser", empty_cmd, "not yet implemented"},
- {"restart", bos_restart, "restarts an instace"},
- {"salvage", empty_cmd, "not yet implemented"},
- {"setauth", empty_cmd, "not yet implemented"},
- {"setcellname", empty_cmd, "not yet implemented"},
- {"setrestart", empty_cmd, "not yet implemented"},
- {"shutdown", empty_cmd, "not yet implemented"},
- {"start", bos_start, "start a server instance"},
- {"status", bos_status,
- "Show volume server transactions"},
- {"stop", bos_stop, "stop a server instance"},
- {"version", arlalib_version_cmd, "print version"},
- {"uninstall", empty_cmd, "not yet implemented"},
- {"quit", quit_cmd, "exit interactive mode"},
- {NULL}
-};
-
-/*
- * Dummy command
- */
-
-static int
-empty_cmd(int argc, char **argv)
-{
- printf("%s%s has not been implemented yet!\n", PROGNAME, argv[0]);
- return 0;
-}
-
-/*
- * quit
- */
-
-static int
-quit_cmd(int argc, char **argv)
-{
- printf("exiting\n");
- return 1;
-}
-
-/*
- * help
- */
-
-static int
-help_cmd (int argc, char **argv)
-{
- SL_cmd *cmd;
-
- for (cmd = cmds; cmd->name != NULL; ++cmd)
- if (cmd->usage != NULL)
- printf ("%-20s%s\n", cmd->name, cmd->usage);
-
- return 0;
-}
-
-/*
- * apropos
- */
-
-static int
-apropos_cmd(int argc, char **argv)
-{
- if (argc == 0) {
- fprintf (stderr, "apropos: missing topic");
- return 0;
- }
-
- sl_apropos(cmds, argv[1]);
- return 0;
-}
-
-
-/*
- * Main program
- */
-
-int
-main(int argc, char **argv)
-{
- Log_method *method;
- int ret = 0;
-
- method = log_open (__progname, "/dev/stderr:notime");
- if (method == NULL)
- errx (1, "log_open failed");
- cell_init(0, method);
- ports_init();
-
- if (argc > 1)
- ret = sl_command(cmds, argc - 1, argv + 1);
- else {
- bos_interactive = 1;
- printf("bos - an arla tool for administrating AFS-servers.\n");
- printf("Type \"help\" to get a list of commands.\n");
- ret = sl_loop(cmds, __progname": ");
- }
- return ret;
-}
diff --git a/usr.sbin/afs/src/appl/bos/bos_addhost.c b/usr.sbin/afs/src/appl/bos/bos_addhost.c
deleted file mode 100644
index 87eec5b2813..00000000000
--- a/usr.sbin/afs/src/appl/bos/bos_addhost.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "bos_local.h"
-#include <bos.h>
-#include <bos.cs.h>
-
-
-RCSID("$arla: bos_addhost.c,v 1.1 2001/05/15 16:23:35 jimmy Exp $");
-
-static int
-addhost(const char *cell, const char *server, const char *host,
- int noauth, int localauth, int verbose)
-{
- struct rx_connection *conn = NULL;
- int error;
-
- conn = arlalib_getconnbyname(cell,
- server,
- afsbosport,
- BOS_SERVICE_ID,
- arlalib_getauthflag(noauth, localauth,0,0));
- if (conn == NULL)
- return -1;
-
- error = BOZO_AddCellHost(conn, host);
- switch (error) {
- case BZACCESS:
- printf ("bos addhost: You are not allowed to add the host %s "
- "to the serverlist on server %s\n", host, server);
- break;
- case 0:
- printf ("bos addhost: Server %s added to the serverlist on "
- "server %s\n", host, server);
- break;
- default:
- printf("bos addhost: GetStat failed with: %s (%d)\n",
- koerr_gettext(error), error);
- break;
- }
-
- arlalib_destroyconn(conn);
- return 0;
-}
-
-
-static int helpflag;
-static const char *server;
-static const char *cell;
-static const char *host;
-static int noauth;
-static int localauth;
-static int verbose;
-
-static struct agetargs args[] = {
- {"server", 0, aarg_string, &server, "server", NULL, aarg_mandatory},
- {"host", 0, aarg_string, &host, "host", NULL, aarg_mandatory},
- {"cell", 0, aarg_string, &cell, "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth, "do not authenticate", NULL},
- {"local", 0, aarg_flag, &localauth, "localauth"},
- {"verbose", 0, aarg_flag, &verbose, "be verbose", NULL},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL, 0, aarg_end, NULL, NULL, NULL}
-};
-
-static void
-usage (void)
-{
- aarg_printusage (args, "bos addhost", "", AARG_AFSSTYLE);
-}
-
-int
-bos_addhost(int argc, char **argv)
-{
- int optind = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (server == NULL) {
- printf ("bos addhost: missing -server\n");
- return 0;
- }
-
- if (cell == NULL)
- cell = cell_getcellbyhost (server);
-
- addhost (cell, server, host, noauth, localauth, verbose);
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/bos/bos_adduser.c b/usr.sbin/afs/src/appl/bos/bos_adduser.c
deleted file mode 100644
index f3efd7667c7..00000000000
--- a/usr.sbin/afs/src/appl/bos/bos_adduser.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "bos_local.h"
-#include <bos.h>
-#include <bos.cs.h>
-
-
-RCSID("$arla: bos_adduser.c,v 1.6 2000/10/03 00:07:02 lha Exp $");
-
-static int
-adduser(const char *cell, const char *host, const char *user,
- int noauth, int localauth, int verbose)
-{
- struct rx_connection *conn = NULL;
- int error;
-
- conn = arlalib_getconnbyname(cell,
- host,
- afsbosport,
- BOS_SERVICE_ID,
- arlalib_getauthflag(noauth, localauth,0,0));
- if (conn == NULL)
- return -1;
-
- error = BOZO_AddSUser(conn, user);
- switch (error) {
- case BZACCESS:
- printf ("bos adduser: You are not allowed to add the user %s "
- "to the userlist on server %s\n", user, host);
- break;
- case EEXIST:
- printf ("bos adduser: User %s alredy exists on the userlist "
- "on host %s\n", user, host);
- break;
- case EIO:
- printf ("bos adduser: the UserList-file could not be opened or "
- "closed on server %s\n", host);
- break;
- case 0:
- printf ("bos adduser: User %s added to the UserList on "
- "server %s\n", user, host);
- break;
- default:
- printf("bos adduser: GetStat failed with: %s (%d)\n",
- koerr_gettext(error), error);
- break;
- }
-
- arlalib_destroyconn(conn);
- return 0;
-}
-
-
-static int helpflag;
-static const char *server;
-static const char *cell;
-static const char *user;
-static int noauth;
-static int localauth;
-static int verbose;
-
-static struct agetargs args[] = {
- {"server", 0, aarg_string, &server, "server", NULL, aarg_mandatory},
- {"user", 0, aarg_string, &user, "user", NULL, aarg_mandatory},
- {"cell", 0, aarg_string, &cell, "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth, "do not authenticate", NULL},
- {"local", 0, aarg_flag, &localauth, "localauth"},
- {"verbose", 0, aarg_flag, &verbose, "be verbose", NULL},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL, 0, aarg_end, NULL, NULL, NULL}
-};
-
-static void
-usage (void)
-{
- aarg_printusage (args, "bos adduser", "", AARG_AFSSTYLE);
-}
-
-int
-bos_adduser(int argc, char **argv)
-{
- int optind = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (server == NULL) {
- printf ("bos adduser: missing -server\n");
- return 0;
- }
-
- if (cell == NULL)
- cell = cell_getcellbyhost (server);
-
- adduser (cell, server, user, noauth, localauth, verbose);
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/bos/bos_getrestart.c b/usr.sbin/afs/src/appl/bos/bos_getrestart.c
deleted file mode 100644
index bfc277b3d0e..00000000000
--- a/usr.sbin/afs/src/appl/bos/bos_getrestart.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "bos_local.h"
-#include <bos.h>
-#include <bos.cs.h>
-
-RCSID("$arla: bos_getrestart.c,v 1.6 2000/10/03 00:07:07 lha Exp $");
-
-static int
-printrestart(const char *cell, const char *host,
- int noauth, int localauth, int verbose)
-{
- struct rx_connection *conn;
- struct bozo_netKTime time;
- int error;
-
- conn = arlalib_getconnbyname(cell,
- host,
- afsbosport,
- BOS_SERVICE_ID,
- arlalib_getauthflag(noauth, localauth,0,0));
-
- if (conn == NULL) {
- printf ("bos restart: failed to open connection to %s\n", host);
- return 0;
- }
-
- error = BOZO_GetRestartTime(conn, BOZO_RESTARTTIME_GENERAL, &time);
- if (error) {
- printf("bos: GetRestartTime(GENERAL) failed with: %s (%d)\n",
- koerr_gettext(error), error);
- return 0;
- }
- printf ("Server %s restarts at %02d:%02d:%02d at day %d\n",
- host, time.hour, time.min, time.sec, time.day);
-
- error = BOZO_GetRestartTime(conn, BOZO_RESTARTTIME_NEWBIN, &time);
- if (error) {
- printf("bos: GetRestartTime(NEWBIN) failed with: %s (%d)\n",
- koerr_gettext(error), error);
- return 0;
- }
- printf ("Server %s restarts for new binaries at %02d:%02d:%02d at day %d\n",
- host, time.hour, time.min, time.sec, time.day);
-
- arlalib_destroyconn(conn);
- return 0;
-}
-
-
-static int helpflag;
-static const char *server;
-static const char *cell;
-static int noauth;
-static int localauth;
-static int verbose;
-
-static struct agetargs args[] = {
- {"server", 0, aarg_string, &server, "server", NULL, aarg_mandatory},
- {"cell", 0, aarg_string, &cell, "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth, "do not authenticate", NULL},
- {"local", 0, aarg_flag, &localauth, "localauth"},
- {"verbose", 0, aarg_flag, &verbose, "be verbose", NULL},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL, 0, aarg_end, NULL, NULL, NULL}
-};
-
-static void
-usage (void)
-{
- aarg_printusage (args, "bos getrestart", "", AARG_AFSSTYLE);
-}
-
-int
-bos_getrestart(int argc, char **argv)
-{
- int optind = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (server == NULL) {
- printf ("bos getrestart: missing -server\n");
- return 0;
- }
-
- if (cell == NULL)
- cell = cell_getcellbyhost (server);
-
- printrestart (cell, server, noauth, localauth, verbose);
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/bos/bos_listhosts.c b/usr.sbin/afs/src/appl/bos/bos_listhosts.c
deleted file mode 100644
index 0c55ffb56d3..00000000000
--- a/usr.sbin/afs/src/appl/bos/bos_listhosts.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "bos_local.h"
-#include <bos.h>
-#include <bos.cs.h>
-
-
-RCSID("$arla: bos_listhosts.c,v 1.7 2000/10/03 00:07:13 lha Exp $");
-
-static int
-printhosts(const char *cell, const char *host,
- int noauth, int localauth, int verbose, int cellservdb,
- const char *comment_text)
-{
- struct rx_connection *conn = NULL;
- unsigned int nservers, i;
- int error;
- char **server_names = NULL;
- char cell_name[BOZO_BSSIZE];
-
- if (comment_text == NULL)
- comment_text = "";
-
- conn = arlalib_getconnbyname(cell,
- host,
- afsbosport,
- BOS_SERVICE_ID,
- arlalib_getauthflag(noauth, localauth,0,0));
-
- if (conn == NULL)
- return -1;
-
- /* which cell is this anyway ? */
- error = BOZO_GetCellName(conn, cell_name);
- if (error) {
- printf ("bos GetCellName %s: %s\n", host, koerr_gettext (error));
- return 0;
- }
-
- /* Who are the DB-servers ? */
- nservers = 0;
- while (1) {
- server_names = erealloc (server_names,
- (nservers + 1) * sizeof(*server_names));
- server_names[nservers] = emalloc (BOZO_BSSIZE);
- error = BOZO_GetCellHost(conn, nservers, server_names[nservers]);
- if (error)
- break;
- nservers++;
- }
-
- if (error != BZDOM) {
- printf ("bos listhosts: %s\n", koerr_gettext (error));
- } else {
- if (!cellservdb) {
- printf("Cell name is %s\n", cell_name);
- for (i = 0; i < nservers; i++)
- printf ("\t%s\n", server_names[i]);
- } else {
- printf (">%s #%s\n", cell_name, comment_text);
- for (i = 0; i < nservers; i++) {
- struct hostent *he;
- char *addr;
- struct in_addr inaddr;
-
- he = gethostbyname(server_names[i]);
- if (he == NULL)
- addr = "not-in-dns";
- else {
- memcpy(&inaddr, he->h_addr, sizeof(inaddr));
- addr = inet_ntoa(inaddr);
- }
- printf ("%s #%s\n", addr, server_names[i]);
- }
- }
- }
- for (i = 0; i < nservers; i++)
- free (server_names[i]);
- free (server_names);
-
- arlalib_destroyconn(conn);
- return 0;
-}
-
-
-static int helpflag;
-static int dbflag;
-static const char *comment_text;
-static const char *server;
-static const char *cell;
-static int noauth;
-static int localauth;
-static int verbose;
-
-static struct agetargs args[] = {
- {"server", 0, aarg_string, &server, "server", NULL, aarg_mandatory},
- {"db", 0, aarg_flag, &dbflag, "print in CellServDB format", NULL},
- {"comment", 0, aarg_string, &comment_text,
- "comment text when CellServDB format is used", NULL},
- {"cell", 0, aarg_string, &cell, "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth, "do not authenticate", NULL},
- {"local", 0, aarg_flag, &localauth, "localauth"},
- {"verbose", 0, aarg_flag, &verbose, "be verbose", NULL},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL, 0, aarg_end, NULL, NULL, NULL}
-};
-
-static void
-usage (void)
-{
- aarg_printusage (args, "bos listhosts", "", AARG_AFSSTYLE);
-}
-
-int
-bos_listhosts(int argc, char **argv)
-{
- int optind = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (server == NULL) {
- printf ("bos listhosts: missing -server\n");
- return 0;
- }
-
- if (cell == NULL)
- cell = cell_getcellbyhost (server);
-
- printhosts (cell, server, noauth, localauth, verbose, dbflag,
- comment_text);
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/bos/bos_listusers.c b/usr.sbin/afs/src/appl/bos/bos_listusers.c
deleted file mode 100644
index 1868b7f7954..00000000000
--- a/usr.sbin/afs/src/appl/bos/bos_listusers.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "bos_local.h"
-#include <bos.h>
-#include <bos.cs.h>
-
-
-RCSID("$arla: bos_listusers.c,v 1.7 2001/04/18 13:49:06 lha Exp $");
-
-static int
-printusers(const char *cell, const char *host,
- int noauth, int localauth, int verbose)
-{
- struct rx_connection *conn = NULL;
- int i, error, done;
- char user_name[BOZO_BSSIZE];
-
- conn = arlalib_getconnbyname(cell,
- host,
- afsbosport,
- BOS_SERVICE_ID,
- arlalib_getauthflag(noauth, localauth,0,0));
- if (conn == NULL)
- return -1;
-
- printf("SUsers are: ");
- done = i = 0;
- while (!done) {
- error = BOZO_ListSUsers(conn, i, user_name);
- switch (error) {
- case 1:
- if (i == 0) {
- printf ("bos listusers: UserList could not be opened or no "
- "users on this server\n");
- return 0;
- }
- done = 1;
- break;
- case 0:
- printf("%s ", user_name);
- break;
- default:
- printf ("bos listusers: %s(%d)\n",
- koerr_gettext (error), error);
- return 0;
- }
-
- i++;
- }
- printf("\n");
-
- arlalib_destroyconn(conn);
- return 0;
-}
-
-
-static int helpflag;
-static const char *server;
-static const char *cell;
-static int noauth;
-static int localauth;
-static int verbose;
-
-static struct agetargs args[] = {
- {"server", 0, aarg_string, &server, "server", NULL, aarg_mandatory},
- {"cell", 0, aarg_string, &cell, "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth, "do not authenticate", NULL},
- {"local", 0, aarg_flag, &localauth, "localauth"},
- {"verbose", 0, aarg_flag, &verbose, "be verbose", NULL},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL, 0, aarg_end, NULL, NULL, NULL}
-};
-
-static void
-usage (void)
-{
- aarg_printusage (args, "bos listusers", "", AARG_AFSSTYLE);
-}
-
-int
-bos_listusers(int argc, char **argv)
-{
- int optind = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (server == NULL) {
- printf ("bos listusers: missing -server\n");
- return 0;
- }
-
- if (cell == NULL)
- cell = cell_getcellbyhost (server);
-
- printusers (cell, server, noauth, localauth, verbose);
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/bos/bos_local.h b/usr.sbin/afs/src/appl/bos/bos_local.h
deleted file mode 100644
index ee631390df4..00000000000
--- a/usr.sbin/afs/src/appl/bos/bos_local.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * RCSID("$arla: bos_local.h,v 1.5 2001/05/15 16:23:38 jimmy Exp $");
- */
-
-/*
-#define LISTVOL_PART 0x1
-#define LISTVOL_NOAUTH 0x2
-#define LISTVOL_LOCALAUTH 0x4
-#define LISTVOL_FAST 0x8
-*/
-
-/* this program needs __progname defined as a macro */
-#define __progname "bos"
-#define PROGNAME (bos_interactive ? "" : __progname" ")
-
-/* if this is set the program runs in interactive mode */
-extern int bos_interactive;
-
-int bos_status (int, char **);
-int bos_listhosts (int, char **);
-int bos_listusers (int, char **);
-int bos_adduser (int, char **);
-int bos_getrestart (int, char **);
-int bos_stop (int, char **);
-int bos_start (int, char **);
-int bos_addhost (int, char **);
-int bos_removehost (int, char **);
-int bos_restart (int, char **);
diff --git a/usr.sbin/afs/src/appl/bos/bos_removehost.c b/usr.sbin/afs/src/appl/bos/bos_removehost.c
deleted file mode 100644
index 438c1f81e92..00000000000
--- a/usr.sbin/afs/src/appl/bos/bos_removehost.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "bos_local.h"
-#include <bos.h>
-#include <bos.cs.h>
-
-
-RCSID("$arla: bos_removehost.c,v 1.1 2001/05/15 16:23:40 jimmy Exp $");
-
-static int
-removehost(const char *cell, const char *server, const char *host,
- int noauth, int localauth, int verbose)
-{
- struct rx_connection *conn = NULL;
- int error;
-
- conn = arlalib_getconnbyname(cell,
- server,
- afsbosport,
- BOS_SERVICE_ID,
- arlalib_getauthflag(noauth, localauth,0,0));
- if (conn == NULL)
- return -1;
-
- error = BOZO_DeleteCellHost(conn, host);
- switch (error) {
- case BZACCESS:
- printf ("bos removehost: You are not allowed to delete the host %s "
- "from the serverlist on server %s\n", host, server);
- break;
- case 0:
- printf ("bos removehost: Server %s deleted from the serverlist on "
- "server %s\n", host, server);
- break;
- default:
- printf("bos removehost: GetStat failed with: %s (%d)\n",
- koerr_gettext(error), error);
- break;
- }
-
- arlalib_destroyconn(conn);
- return 0;
-}
-
-
-static int helpflag;
-static const char *server;
-static const char *cell;
-static const char *host;
-static int noauth;
-static int localauth;
-static int verbose;
-
-static struct agetargs args[] = {
- {"server", 0, aarg_string, &server, "server", NULL, aarg_mandatory},
- {"host", 0, aarg_string, &host, "host", NULL, aarg_mandatory},
- {"cell", 0, aarg_string, &cell, "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth, "do not authenticate", NULL},
- {"local", 0, aarg_flag, &localauth, "localauth"},
- {"verbose", 0, aarg_flag, &verbose, "be verbose", NULL},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL, 0, aarg_end, NULL, NULL, NULL}
-};
-
-static void
-usage (void)
-{
- aarg_printusage (args, "bos removehost", "", AARG_AFSSTYLE);
-}
-
-int
-bos_removehost(int argc, char **argv)
-{
- int optind = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (server == NULL) {
- printf ("bos removehost: missing -server\n");
- return 0;
- }
-
- if (cell == NULL)
- cell = cell_getcellbyhost (server);
-
- removehost (cell, server, host, noauth, localauth, verbose);
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/bos/bos_restart.c b/usr.sbin/afs/src/appl/bos/bos_restart.c
deleted file mode 100644
index b5228d6fb88..00000000000
--- a/usr.sbin/afs/src/appl/bos/bos_restart.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "bos_local.h"
-#include <bos.h>
-#include <bos.cs.h>
-
-
-RCSID("$arla: bos_restart.c,v 1.1 2001/05/15 16:23:43 jimmy Exp $");
-
-static int
-restart(const char *cell, const char *host, const char *instance,
- int noauth, int localauth, int verbose)
-{
- struct rx_connection *conn = NULL;
- int error;
-
- conn = arlalib_getconnbyname(cell,
- host,
- afsbosport,
- BOS_SERVICE_ID,
- arlalib_getauthflag(noauth, localauth,0,0));
- if (conn == NULL)
- return -1;
-
- error = BOZO_Restart(conn, instance);
- switch (error) {
- case BZACCESS:
- printf ("bos restart: You are not allowed to restart the instance"
- "%s on server %s\n", instance, host);
- break;
- case BZNOENT:
- printf ("bos restart: the instance %s does not exsist on server %s\n"
- , instance, host);
- break;
- case 0:
- printf ("bos restart: Instance %s restarted on server %s\n", instance, host);
- break;
- default:
- printf("bos restart: GetStat failed with: %s (%d)\n",
- koerr_gettext(error), error);
- break;
- }
-
- arlalib_destroyconn(conn);
- return 0;
-}
-
-
-static int helpflag;
-static const char *server;
-static const char *cell;
-static const char *instance;
-static int noauth;
-static int localauth;
-static int verbose;
-
-static struct agetargs args[] = {
- {"server", 0, aarg_string, &server, "server", NULL, aarg_mandatory},
- {"instance",0, aarg_string, &instance, "instance", NULL, aarg_mandatory},
- {"cell", 0, aarg_string, &cell, "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth, "do not authenticate", NULL},
- {"local", 0, aarg_flag, &localauth, "localauth"},
- {"verbose", 0, aarg_flag, &verbose, "be verbose", NULL},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL, 0, aarg_end, NULL, NULL, NULL}
-};
-
-static void
-usage (void)
-{
- aarg_printusage (args, "bos restart", "", AARG_AFSSTYLE);
-}
-
-int
-bos_restart(int argc, char **argv)
-{
- int optind = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (server == NULL) {
- printf ("bos restart: missing -server\n");
- return 0;
- }
-
- if (cell == NULL)
- cell = cell_getcellbyhost (server);
-
- restart (cell, server, instance, noauth, localauth, verbose);
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/bos/bos_start.c b/usr.sbin/afs/src/appl/bos/bos_start.c
deleted file mode 100644
index 22dca947223..00000000000
--- a/usr.sbin/afs/src/appl/bos/bos_start.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "bos_local.h"
-#include <bos.h>
-#include <bos.cs.h>
-
-
-RCSID("$arla: bos_start.c,v 1.1 2001/05/15 15:11:31 jimmy Exp $");
-
-static int
-start(const char *cell, const char *host, const char *instance,
- int noauth, int localauth, int verbose)
-{
- struct rx_connection *conn = NULL;
- int error;
-
- conn = arlalib_getconnbyname(cell,
- host,
- afsbosport,
- BOS_SERVICE_ID,
- arlalib_getauthflag(noauth, localauth,0,0));
- if (conn == NULL)
- return -1;
-
- error = BOZO_SetTStatus(conn, instance, BSTAT_NORMAL);
- switch (error) {
- case BZACCESS:
- printf ("bos start: You are not allowed to start the instance"
- "%s on server %s\n", instance, host);
- break;
- case BZNOENT:
- printf ("bos start: the instance %s does not exsist on server %s\n"
- , instance, host);
- break;
- case 0:
- printf ("bos start: Instance %s started on server %s\n", instance, host);
- break;
- default:
- printf("bos start: GetStat failed with: %s (%d)\n",
- koerr_gettext(error), error);
- break;
- }
-
- arlalib_destroyconn(conn);
- return 0;
-}
-
-
-static int helpflag;
-static const char *server;
-static const char *cell;
-static const char *instance;
-static int noauth;
-static int localauth;
-static int verbose;
-
-static struct agetargs args[] = {
- {"server", 0, aarg_string, &server, "server", NULL, aarg_mandatory},
- {"instance",0, aarg_string, &instance, "instance", NULL, aarg_mandatory},
- {"cell", 0, aarg_string, &cell, "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth, "do not authenticate", NULL},
- {"local", 0, aarg_flag, &localauth, "localauth"},
- {"verbose", 0, aarg_flag, &verbose, "be verbose", NULL},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL, 0, aarg_end, NULL, NULL, NULL}
-};
-
-static void
-usage (void)
-{
- aarg_printusage (args, "bos start", "", AARG_AFSSTYLE);
-}
-
-int
-bos_start(int argc, char **argv)
-{
- int optind = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (server == NULL) {
- printf ("bos start: missing -server\n");
- return 0;
- }
-
- if (cell == NULL)
- cell = cell_getcellbyhost (server);
-
- start (cell, server, instance, noauth, localauth, verbose);
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/bos/bos_status.c b/usr.sbin/afs/src/appl/bos/bos_status.c
deleted file mode 100644
index 7b0fce7762e..00000000000
--- a/usr.sbin/afs/src/appl/bos/bos_status.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "bos_local.h"
-#include <bos.h>
-#include <bos.cs.h>
-
-
-RCSID("$arla: bos_status.c,v 1.12 2001/10/23 08:09:29 lha Exp $");
-
-/*
- *
- */
-
-static void
-print_instance_status (char *instance_name,
- int getstatus_int,
- char *getstatus_str)
-{
- switch (getstatus_int) {
- case BSTAT_SHUTDOWN:
- printf("Instance %s, disabled, currently shutdown.\n",
- instance_name);
- break;
- case BSTAT_NORMAL:
- printf("Instance %s, currently running normally.\n",
- instance_name);
- break;
- case BSTAT_SHUTTINGDOWN:
- printf("Instance %s, temporarily disabled, "
- "currently shutting down.\n",
- instance_name);
- break;
- case BSTAT_STARTINGUP:
- printf("Instance %s, currently starting up.\n",
- instance_name);
- break;
- default:
- printf (" unknown Status = %d (%s)\n",
- getstatus_int, getstatus_str);
- break;
- }
-
- if (getstatus_str[0] != '\0')
- printf(" Auxiliary status is: %s.\n", getstatus_str);
-}
-
-/*
- *
- */
-
-static int
-printstatus(const char *cell,
- const char *host,
- int noauth,
- int localauth,
- int verbose)
-{
- struct rx_connection *conn;
- unsigned int i;
- int error;
- int getstatus_int;
- char instance_name[BOZO_BSSIZE];
- char getstatus_str[BOZO_BSSIZE];
-
- conn = arlalib_getconnbyname(cell,
- host,
- afsbosport,
- BOS_SERVICE_ID,
- arlalib_getauthflag(noauth,localauth,0,0));
-
- if (conn == NULL)
- return -1;
-
- i = 0;
- do {
- error = BOZO_EnumerateInstance(conn, i, instance_name);
- if (error == 0) {
- getstatus_str[0] = '\0';
- error = BOZO_GetStatus(conn, instance_name,
- &getstatus_int, getstatus_str);
- getstatus_str[BOZO_BSSIZE-1] = '\0';
- if (error == -1) {
- warnx ("failed to contact host's bosserver (%s) "
- "(communications failure (-1)).",
- host);
- } else if (error != 0) {
- warnx ("GetStatus(%s) failed with: %s (%d)",
- instance_name,
- koerr_gettext(error),
- error);
- } else {
- print_instance_status (instance_name,
- getstatus_int,
- getstatus_str);
- }
- error = 0;
- }
- i++;
- } while (error == 0);
- if (error != BZDOM)
- warnx ("%s: %s", host, koerr_gettext (error));
-
- arlalib_destroyconn(conn);
- return 0;
-}
-
-/*
- *
- */
-
-static int helpflag;
-static const char *server;
-static const char *cell;
-static int noauth;
-static int localauth;
-static int verbose;
-
-static struct agetargs args[] = {
- {"server", 0, aarg_string, &server, "server", NULL, aarg_mandatory},
- {"cell", 0, aarg_string, &cell, "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth, "do not authenticate", NULL},
- {"local", 0, aarg_flag, &localauth, "localauth"},
- {"verbose", 0, aarg_flag, &verbose, "be verbose"},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL, 0, aarg_end, NULL, NULL, NULL}
-};
-
-/*
- *
- */
-
-static int
-usage (int exit_code)
-{
- aarg_printusage (args, "bos status", "", AARG_AFSSTYLE);
- return exit_code;
-}
-
-/*
- *
- */
-
-int
-bos_status(int argc, char **argv)
-{
- int optind = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE))
- return usage (0);
-
- if (helpflag)
- return usage (0);
-
- argc -= optind;
- argv += optind;
-
- if (server == NULL) {
- printf ("bos status: missing -server\n");
- return 0;
- }
-
- if (cell == NULL)
- cell = cell_getcellbyhost (server);
-
- printstatus (cell, server, noauth, localauth, verbose);
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/bos/bos_stop.c b/usr.sbin/afs/src/appl/bos/bos_stop.c
deleted file mode 100644
index 71d0c5dc1d8..00000000000
--- a/usr.sbin/afs/src/appl/bos/bos_stop.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "bos_local.h"
-#include <bos.h>
-#include <bos.cs.h>
-
-
-RCSID("$arla: bos_stop.c,v 1.1 2001/05/15 15:11:34 jimmy Exp $");
-
-static int
-stop(const char *cell, const char *host, const char *instance,
- int noauth, int localauth, int verbose)
-{
- struct rx_connection *conn = NULL;
- int error;
-
- conn = arlalib_getconnbyname(cell,
- host,
- afsbosport,
- BOS_SERVICE_ID,
- arlalib_getauthflag(noauth, localauth,0,0));
- if (conn == NULL)
- return -1;
-
- error = BOZO_SetTStatus(conn, instance, BSTAT_SHUTDOWN);
- switch (error) {
- case BZACCESS:
- printf ("bos stop: You are not allowed to stop the instance"
- " %s on server %s\n", instance, host);
- break;
- case BZNOENT:
- printf ("bos stop: the instance %s does not exsist on server %s\n"
- , instance, host);
- break;
- case 0:
- printf ("bos stop: Instance %s stopped on server %s\n", instance, host);
- break;
- default:
- printf("bos stop: GetStat failed with: %s (%d)\n",
- koerr_gettext(error), error);
- break;
- }
-
- arlalib_destroyconn(conn);
- return 0;
-}
-
-
-static int helpflag;
-static const char *server;
-static const char *cell;
-static const char *instance;
-static int noauth;
-static int localauth;
-static int verbose;
-
-static struct agetargs args[] = {
- {"server", 0, aarg_string, &server, "server", NULL, aarg_mandatory},
- {"instance",0, aarg_string, &instance, "instance", NULL, aarg_mandatory},
- {"cell", 0, aarg_string, &cell, "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth, "do not authenticate", NULL},
- {"local", 0, aarg_flag, &localauth, "localauth"},
- {"verbose", 0, aarg_flag, &verbose, "be verbose", NULL},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL, 0, aarg_end, NULL, NULL, NULL}
-};
-
-static void
-usage (void)
-{
- aarg_printusage (args, "bos stop", "", AARG_AFSSTYLE);
-}
-
-int
-bos_stop(int argc, char **argv)
-{
- int optind = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (server == NULL) {
- printf ("bos stop: missing -server\n");
- return 0;
- }
-
- if (cell == NULL)
- cell = cell_getcellbyhost (server);
-
- stop (cell, server, instance, noauth, localauth, verbose);
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/Makefile.in b/usr.sbin/afs/src/appl/fs/Makefile.in
deleted file mode 100644
index 0cb69e7c74e..00000000000
--- a/usr.sbin/afs/src/appl/fs/Makefile.in
+++ /dev/null
@@ -1,141 +0,0 @@
-# $KTH: Makefile.in,v 1.11.2.2 2001/10/23 23:50:43 ahltorp Exp $
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-LN_S = @LN_S@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-mandir = @mandir@
-transform = @program_transform_name@
-EXECSUFFIX = @EXECSUFFIX@
-
-APPL_BIN = fs
-MANPAGES = fs.1
-
-DEFS = @DEFS@
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-X_CFLAGS = @X_CFLAGS@
-LDFLAGS = @LDFLAGS@
-
-ETAGS = etags
-MAKEDEPEND = makedepend
-RXKADINC = -I$(srcdir)/../../rxkad
-INCLUDES = -I$(srcdir)/../.. \
- -I$(srcdir)/../../include \
- -I$(srcdir)/../lib \
- -I../../include \
- -I../../rxdef \
- -I. \
- $(KERNEL_INCLUDE) \
- -I$(srcdir)/../../xfs/include \
- -I$(srcdir)/../../arlad \
- @INC_roken@ \
- $(RXKADINC)
-
-DEFINES =
-REALCFLAGS = $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) \
- $(X_CFLAGS) @PLWP_INC_FLAGS@
-RXKAD_LIBS = @MILKO_RXKAD_LIBS@
-KERNEL_INCLUDE = @KERNEL_INCLUDE@
-READLINE_lib = @LIB_readline@
-KAFS_LIBS = @AIX_EXTRA_KAFS@ @KAFS_LIBS@
-LIB_tgetent = @LIB_tgetent@
-LIBS = -L../lib -larlalib \
- -L../../rxdef -lrxdefclient \
- -L../../rx -lrx \
- -L../../lwp -llwp @PLWP_LIB_FLAGS@ \
- -L../../lib/ko -lko -L../../util -lutil \
- -L../../lib/sl -lsl \
- $(READLINE_lib) \
- $(RXKAD_LIBS) \
- $(KAFS_LIBS) \
- $(RXKAD_LIBS) \
- @LIB_roken@ @LIBS@
-
-LIBDEPENDS = ../../rxdef/librxdefclient.a ../../rx/librx.a ../../lwp/liblwp.a \
- ../../util/libutil.a ../../lib/sl/libsl.a \
- ../../lib/ko/libko.a ../lib/libarlalib.a
-
-PROGS = fs
-FS_SRCS = fs.c arladebu.c
-SRCS = $(FS_SRCS)
-FS_OBJS = fs.o arladebu.o
-HDRS =
-
-all: $(PROGS)
-
-.PHONY: all install uninstall depend tags clean
-
-arladebu.c: $(srcdir)/../../arlad/arladebu.c
- test -f arladebu.c || $(LN_S) $(srcdir)/../../arlad/arladebu.c arladebu.c
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(bindir)/$$f; \
- done ;\
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir) ; \
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$$e ; \
- $(INSTALL_DATA) $(srcdir)/$$x \
- $(DESTDIR)$(mandir)/man$$e/$$f.$$e; \
- done
-
-uninstall:
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
- done ; \
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- rm -rf $(DESTDIR)$(mandir)/$$f.$$e; \
- done
-
-fs: $(FS_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(FS_OBJS) $(LIBS)
-
-Makefile: Makefile.in ../../config.status
- cd ../..; CONFIG_FILES=appl/fs/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(CFILES)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(PROGS) $(OBJS) *~ *.o core arladebu.c
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/appl/fs/fs.1 b/usr.sbin/afs/src/appl/fs/fs.1
deleted file mode 100644
index 829a8af308d..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs.1
+++ /dev/null
@@ -1,736 +0,0 @@
-.\" Copyright (c) 2000 - 2003 Kungliga Tekniska Högskolan
-.\" (Royal Institute of Technology, Stockholm, Sweden).
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" 3. Neither the name of the Institute nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $arla: fs.1,v 1.17 2003/06/06 12:53:48 hin Exp $
-.\" $OpenBSD: fs.1,v 1.15 2005/04/25 07:45:47 jmc Exp $
-.\"
-.Dd March 29, 2000
-.Dt FS 1
-.Os "The Arla Project"
-.Sh NAME
-.Nm fs
-.Nd Manage AFS directories
-.Sh SYNOPSIS
-.Nm
-.Op Ar command
-.Op Ar args
-.Sh DESCRIPTION
-The
-.Nm
-utility is used to manipulate the AFS filesystem.
-Note that the
-.Nm
-utility does
-.Em not
-modify the traditional
-.Ux
-filesystem, only files in AFS.
-.Pp
-The
-.Nm
-utility provides several commands:
-.Pp
-.Bl -tag -width setmaxpriority -compact
-.It Cm apropos
-locate commands by keyword
-.It Cm arladebug
-tweek arla-debugging flags
-.It Cm checkservers
-check if servers are up
-.It Cm checkvolumes
-check that all volume mapping are correct
-.It Cm cleanacl
-not yet implemented
-.It Cm copyacl
-not yet implemented
-.It Cm diskfree
-show free partition space
-.It Cm examine
-examine volume status
-.It Cm flush
-remove file from cache
-.It Cm flushvolume
-remove volumedata (and files in volume) from cache
-.It Cm gcpags
-garbage collect pags
-.It Cm getcacheparms
-get cache usage
-.It Cm getcrypt
-get encrypt status
-.It Cm getcellstatus
-get suid cell status
-.It Cm getfid
-get fid
-.It Cm getserverprefs
-not yet implemented
-.It Cm getstatistics
-get statistics from the cache manager
-.It Cm getpriority
-get priority of a file/dir
-.It Cm gp
-shorthand for the
-.Cm getpriority
-command
-.It Cm getmaxpriority
-get max priority for a file gc
-.It Cm gmp
-shorthand for the
-.Cm getmaxpriority
-command
-.It Cm help
-get help for
-.Nm
-.It Cm incompat
-report interface of the pioctl interface
-.It Cm listacl
-show acl
-.It Cm la
-shorthand for the
-.Cm listacl
-command
-.It Cm listcells
-list cells that the cache handler can communicate with
-.It Cm listquota
-show volume quota
-.It Cm lq
-shorthand for the
-.Cm listquota
-command
-.It Cm quota
-shorthand for the
-.Cm listquota
-command
-.It Cm lsmount
-show a mount point
-.It Cm messages
-not yet implemented
-.It Cm mkmount
-create mount point
-.It Cm mkm
-shorthand of the
-.Cm mkmount
-command
-.It Cm connect
-connect mode
-.It Cm monitor
-set remote logging host
-.It Cm newcell
-add new cell
-.It Cm nop
-do a pioctl-nop
-.It Cm quit
-leave interactive mode
-.It Cm exit
-leave interactive mode
-.It Cm rmmount
-delete a mount point
-.It Cm removepriority
-remove priority from file/directory
-.It Cm rmp
-shorthand for the
-.Cm removepriority
-command
-.It Cm setacl
-add an acl entry on a directory
-.It Cm sa
-shorthand for the
-.Cm setacl
-command
-.It Cm setcachesize
-change disk cache size
-.It Cm setcell
-change cell status
-.It Cm setpriority
-set priority of a file/directory
-.It Cm sp
-shorthand for the
-.Cm setpriority
-command
-.It Cm setmaxpriority
-set upper limit of prio gc
-.It Cm smq
-shorthand for the
-.Cm setmaxpriority
-command.
-.It Cm setquota
-change quota on a volume
-.It Cm sq
-shorthand for the
-.Cm setquota
-command
-.It Cm setserverprefs
-not yet implemented
-.It Cm setcrypt
-set encryption on/off
-.It Cm setvol
-not yet implemented
-.It Cm suidcells
-list status of cells
-.It Cm sysname
-read/change sysname
-.It Cm version
-get version of fs and fs_lib
-.It Cm venuslog
-make arlad print status
-.It Cm whereis
-show server(s) of file
-.It Cm whichcell
-show cell of file
-.It Cm wscell
-display cell of workstation
-.It Cm nnpfsdebug
-tweek nnpfs-debugging flags
-.It Cm nnpfsprint
-make nnpfs print debug info
-.El
-.Pp
-Most
-.Nm
-commands accept the following general arguments:
-.Pp
-.Bd -filled -offset indent -compact
-.Op Fl cell Ar cellname
-Specifies which AFS cell to use, if the default cell is not to be used.
-.Pp
-.Op Fl noauth
-Specifies that
-.Nm
-should not try to authenticate the connection to the server.
-This may be
-useful with shell scripts, or if there is a problem with the AFS cell.
-Note that the server will reject many commands if
-.Fl noauth
-is specified.
-.Pp
-.Ed
-The syntax of the
-.Nm
-commands:
-.Pp
-.Ic fs apropos
-.Bd -filled -offset indent -compact
-Locate commands by keyword
-.Ed
-.Pp
-.Ic fs arladebug
-.Op Ar flags
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Bd -filled -offset indent -compact
-Tweek arla-debugging flags.
-.Ed
-.Pp
-.Ic fs checkservers
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl nopoll
-.Bd -filled -offset indent -compact
-Check if the servers in a cell are available.
-If
-.Fl nopoll
-is specified, the servers are not contactad; only internal information is
-printed.
-.Ed
-.Pp
-.Ic fs checkvolumes
-.Bd -filled -offset indent -compact
-Check that all volume mapping are correct and flush all mountpoints
-from the cache to force them to be reread.
-.Ed
-.Pp
-.Ic fs cleanacl
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic fs copyacl
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic fs diskfree
-.Ar path
-.Bd -filled -offset indent -compact
-Show free space on the partition where the file or directory
-.Ar path
-is stored
-.Ed
-.Pp
-.Ic fs examine
-.Op Ar path
-.Bd -filled -offset indent -compact
-Print detailed information about the volume mounted on the specified
-.Ar path
-or the current directory.
-.Ed
-.Pp
-.Ic fs flush
-.Ar file
-.Bd -filled -offset indent -compact
-Flush
-.Ar file
-from the cache, causing it to be stored on the fileserver.
-.Ed
-.Pp
-.Ic fs flushvolume
-.Ar file
-.Bd -filled -offset indent -compact
-Flush all the files in the volume where the
-.Ar file
-is stored, causing them to be stored on the fileserver.
-Meta information about the volume is also flushed.
-.Ed
-.Pp
-.Ic fs gcpags
-.Bd -filled -offset indent -compact
-Remove unused PAGs from the kernel.
-.Ed
-.Pp
-.Ic fs getcacheparms
-.Bd -filled -offset indent -compact
-Print information about cache usage.
-.Ed
-.Pp
-.Ic fs getcrypt
-.Bd -filled -offset indent -compact
-Display whether traffic between the client and server is encrypted.
-.Ed
-.Pp
-.Ic fs getcellstatus
-.Ar cellname
-.Bd -filled -offset indent -compact
-Indicate if the setuid bit on executable files are honored for
-the specified cell.
-.Ed
-.Pp
-.Ic fs getfid
-.Ar path
-.Bd -filled -offset indent -compact
-Print fid information for a file.
-.Ed
-.Pp
-.Ic fs getserverprefs
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic fs getstatistics
-.Bd -filled -offset indent -compact
-Get statistics from the cache manager. Possible type to get statistics
-for are fetchstatus, fetchdata, storestatus, storedata, bulkstatus.
-.Ed
-.Pp
-.Ic fs getpriority
-.Bd -filled -offset indent -compact
-Display priority of a file or directory.
-.Ed
-.Pp
-.Ic fs gp
-.Bd -filled -offset indent -compact
-Shorthand for the
-.Cm getpriority
-command
-.Ed
-.Pp
-.Ic fs getmaxpriority
-.Bd -filled -offset indent -compact
-Display max priority for a file.
-.Ed
-.Pp
-.Ic fs gmp
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Bd -filled -offset indent -compact
-Shorthand for the
-.Cm getmaxpriority
-command.
-.Ed
-.Pp
-.Ic fs help
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Bd -filled -offset indent -compact
-Get help for
-.Nm
-.Ed
-.Pp
-.Ic fs incompat
-.Bd -filled -offset indent -compact
-returns what interface of the pioctl interface currently is in use.
-.Ed
-.Ic fs listacl
-.Ar path
-.Bd -filled -offset indent -compact
-Show acl for the specified path or the current directory.
-.Ed
-.Pp
-.Ic fs la
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Bd -filled -offset indent -compact
-Shorthand for the
-.Cm listacl
-command.
-.Ed
-.Pp
-.Ic fs listcells
-.Bd -filled -offset indent -compact
-List cells that the cache handler can communicate with.
-These are the cells listed in the file
-.Pa /etc/afs/CellServDB .
-.Ed
-.Pp
-.Ic fs listquota
-.Op Ar path
-.Bd -filled -offset indent -compact
-Show the quota for the volume of the
-.Ar path
-specified.
-.Ed
-.Pp
-.Ic fs lq
-.Op Ar path
-.Bd -filled -offset indent -compact
-Shorthand for the
-.Cm listquota
-command
-.Ed
-.Pp
-.Ic fs quota
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Bd -filled -offset indent -compact
-Shorthand for the
-.Ic listquota
-command.
-.Ed
-.Pp
-.Ic fs lsmount
-.Ar path
-.Bd -filled -offset indent -compact
-Show a mount point.
-.Ed
-.Pp
-.Ic fs messages
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic fs mkmount
-.Ar directory
-.Ar volume
-.Op Fl cell Ar cell
-.Op Fl rw
-.Bd -filled -offset indent -compact
-Create a mountpoint point to
-.Ar volume
-in optional
-.Ar cell .
-If
-.Fl rw
-is given, a mountpoint to the readwrite volume is created.
-.Pp
-Note that there must not exist a directory named like
-the mount point you are creating.
-.Ed
-.Pp
-.Ic fs connect
-.Op Ar mode
-.Bd -filled -offset indent -compact
-Set or get connected mode, if a
-.Ar mode
-is specified, the cache manager will be set to that mode.
-If not, the current mode will be printed.
-.Pp
-Valid modes are:
-.Bl -tag -width -Fl -compact
-.It Cm connected
-Connected mode - this is the normal operating mode.
-.It Cm fetch
-Fetch only mode - files are retrieved from fileserver but are not stored back.
-.It Cm disconnected
-Disconnected mode - files are read and written from/to the cache, and no
-attempt is made to contact a fileserver-
-.El
-.Pp
-Disconnected mode is very useful for machines that are not connected to
-the network at all times, such as laptops.
-Disconnected mode is to be considered very experimental at this stage.
-.Ed
-.Pp
-.Ic fs monitor
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic fs newcell
-.Fl cell Ar cellname
-.Fl servers Ar vldb-servers
-.Op Fl help
-.Bd -filled -offset indent -compact
-Add a new cell to the running configuration of the cache manager, or update
-already existing information.
-This information should also be entered in the file
-.Pa /etc/afs/CellServDB .
-.Ed
-.Pp
-.Ic fs nop
-.Bd -filled -offset indent -compact
-Do a pioctl-nop.
-This is useful for debugging.
-.Ed
-.Pp
-.Ic fs quit
-.Bd -filled -offset indent -compact
-Leave interactive mode.
-.Ed
-.Pp
-.Ic fs exit
-.Bd -filled -offset indent -compact
-Leave interactive mode.
-.Ed
-.Pp
-.Ic fs rmmount
-.Ar mountpoint
-.Bd -filled -offset indent -compact
-Delete
-.Ar mountpoint .
-.Ed
-.Pp
-.Ic fs removepriority
-.Ar path
-.Bd -filled -offset indent -compact
-Remove priority from file or directory
-.Ar path .
-.Ed
-.Pp
-.Ic fs rmp
-.Bd -filled -offset indent -compact
-Shorthand for the
-.Cm removepriority
-command.
-.Ed
-.Pp
-.Ic fs setacl
-.Bd -filled -offset indent -compact
-Add an acl entry on a directory.
-Each entry consists of two components:
-a user or group and a character string describing the permissions granted
-for that user or group.
-These characters and the permission they represent are:
-.Bl -tag -width Fl -compact
-.It Cm r
-read the files
-.It Cm l
-list the files
-.It Cm i
-insert new files
-.It Cm d
-delete files
-.It Cm w
-write (change) the files
-.It Cm k
-lock files
-.It Cm a
-administer the acl, that is, to change the acl
-.El
-.Pp
-There are also a few convinience strings recognized by
-.Ic fs setacl :
-.Bl -tag -width Fl -compact
-.It Cm none
-removes all permissions.
-.It Cm read
-adds 'rl' permissions, which are suitable for a read-only directory.
-.It Cm write
-adds all permissions except 'a', that is, the user/group can read, write,
-delete etc. but not change the acl of the directory.
-.It Cm all
-add all permissions.
-.El
-.Pp
-Note that in AFS you set the permissions on a directory, and the permissions
-of a file are those of their directory.
-So, if you move a file from one
-directory to another, you might change the permission of the file, as
-the two directories may have different permissions.
-.Pp
-Of the traditional
-.Ux
-permission bits only the user part is honored, and is used for any
-user permissioned by the directorys acl.
-The group and world permission bits are ignored, but they are stored.
-.Ed
-.Pp
-.Ic fs sa
-.Bd -filled -offset indent -compact
-Shorthand for the
-.Cm setacl
-command
-.Ed
-.Pp
-.Ic fs setcachesize
-.Ar lowvnodes
-.Op Ar highvnodes Ar lowbytes Ar highbytes
-.Bd -filled -offset indent -compact
-Set the size of the disk cache.
-.Ed
-.Pp
-.Ic fs setcell
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic fs setpriority
-.Ar file
-.Ar priority
-.Bd -filled -offset indent -compact
-Set priority of a file/directory.
-.Ed
-.Pp
-.Ic fs sp
-.Bd -filled -offset indent -compact
-Shorthand for the
-.Cm setpriority
-command.
-.Ed
-.Pp
-.Ic fs setmaxpriority
-.Ar priority
-.Bd -filled -offset indent -compact
-Set upper limit of priority.
-.Ed
-.Pp
-.Ic fs smq
-.Bd -filled -offset indent -compact
-Shorthand for the
-.Cm setmaxpriority
-command.
-.Ed
-.Pp
-.Ic fs setquota
-.Ar path
-.Ar quota
-.Bd -filled -offset indent -compact
-Set the
-.Ar quota
-(in Kbytes) on a volume pointed out by
-.Ar path .
-.Ed
-.Pp
-.Ic fs sq
-.Bd -filled -offset indent -compact
-Shorthand for the
-.Cm setquota
-command.
-.Ed
-.Pp
-.Ic fs setserverprefs
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic fs setcrypt
-.Ar yes | no
-.Bd -filled -offset indent -compact
-If
-.Ar no
-is specified, encryption of the traffic to/from fileservers is
-disabled, and if
-.Ar yes
-is specified, it is enabled.
-.Ed
-.Pp
-.Ic fs setvol
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic fs suidcells
-.Bd -filled -offset indent -compact
-Print cells and whether setuid execution is allowed for them.
-.Ed
-.Pp
-.Ic fs sysname
-.Op Ar sysname
-.Bd -filled -offset indent -compact
-Get or set the value of the '@sys' value.
-.Ed
-.Pp
-.Ic fs version
-.Bd -filled -offset indent -compact
-Print version of fs and fs_lib.
-.Ed
-.Pp
-.Ic fs venuslog
-.Bd -filled -offset indent -compact
-Make arlad print status.
-.Ed
-.Pp
-.Ic fs whereis
-.Op Ar path
-.Bd -filled -offset indent -compact
-Show server(s) of the specified file or the current directory.
-.Ed
-.Pp
-.Ic fs whichcell
-.Op Ar path
-.Bd -filled -offset indent -compact
-Show cell of a file or the current directory.
-.Ed
-.Pp
-.Ic fs wscell
-.Bd -filled -offset indent -compact
-Display default cell of the client.
-.Ed
-.Pp
-.Ic fs nnpfsdebug
-.Bd -filled -offset indent -compact
-Tweek nnpfs-debugging flags
-.Ed
-.Pp
-.Ic fs nnpfsprint
-.Op Ar flags
-.Bd -filled -offset indent -compact
-Make nnpfs print debug info.
-.Ed
-.Sh SEE ALSO
-.Xr pts 1 ,
-.Xr afsd 8 ,
-.Xr bos 8 ,
-.Xr vos 8
-.Sh STANDARDS
-The Arla authors are trying to mimic the behaviour of the original AFS
-utilities.
-.Sh AUTHORS
-The Arla project <http://www.stacken.kth.se/project/arla/>.
-.Sh BUGS
-Some commands are not implemented yet.
diff --git a/usr.sbin/afs/src/appl/fs/fs.c b/usr.sbin/afs/src/appl/fs/fs.c
deleted file mode 100644
index 4e2be5f1586..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs.c
+++ /dev/null
@@ -1,522 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs.c,v 1.111 2003/01/17 03:16:18 lha Exp $");
-
-static int empty_cmd (int argc, char **argv);
-static int setmaxprio_cmd (int argc, char **argv);
-static int setprio_cmd (int argc, char **argv);
-static int incompat_cmd (int argc, char **argv);
-static int invalidate_cmd (int argc, char **argv);
-static int getmaxprio_cmd (int argc, char **argv);
-static int quit_cmd (int argc, char **argv);
-static int rmprio_cmd (int argc, char **argv);
-static int gc_cmd (int argc, char **argv);
-static int getcrypt_cmd (int argc, char **argv);
-static int nop_cmd (int argc, char **argv);
-static int sysname_cmd (int argc, char **argv);
-static int venuslog_cmd (int argc, char **argv);
-static int checkvolumes_cmd (int argc, char **argv);
-static int calculate_cmd (int argc, char **argv);
-static int apropos_cmd (int argc, char **argv);
-static int help_cmd (int argc, char **argv);
-
-/* if this is set the program runs in interactive mode */
-int fs_interactive = 0;
-
-static int
-empty_cmd (int argc, char **argv)
-{
- printf ("%s%s not implemented yet!\n", PROGNAME, argv[0]);
- return 0;
-}
-
-static
-int setmaxprio_usage()
-{
- fprintf(stderr, "usage: setmaxprio maxprio");
- return 0;
-}
-
-static int
-setmaxprio_cmd (int argc, char **argv)
-{
- int prio_tmp;
- int16_t maxprio;
- int ret;
-
- if (argc != 1)
- return setmaxprio_usage();
-
- if (sscanf(argv[1], "%d", &prio_tmp) != 1)
- return setmaxprio_usage();
-
- maxprio = prio_tmp;
-
- ret = fs_setmaxfprio(maxprio);
- if (ret) {
- fserr(PROGNAME, ret, argv[1]);
- return 0;
- }
-
- return 0;
-}
-
-static int
-setprio_usage(void)
-{
- fprintf(stderr, "usage: file prio\n");
- return 0;
-}
-
-static int
-setprio_cmd (int argc, char **argv)
-{
- VenusFid fid;
- int prio_tmp;
- int16_t prio;
- int ret;
-
- argc--;
- argv++;
-
- if (argc != 2)
- return setprio_usage();
-
- if (sscanf(argv[1], "%d", &prio_tmp) != 1)
- return setprio_usage();
-
- prio = prio_tmp;
-
- ret = fs_getfid(argv[0], &fid);
- if (ret) {
- fserr(PROGNAME, ret, argv[0]);
- return 0;
- }
-
- ret = fs_setfprio(fid, prio);
- if (ret) {
- fserr(PROGNAME, ret, argv[0]);
- return 0;
- }
-
- return 0;
-}
-
-static int
-incompat_cmd (int argc, char **argv)
-{
- int status, ret;
-
- ret = fs_incompat_renumber(&status);
- if (ret) {
- fserr(PROGNAME, ret, NULL);
- } else {
- if (status)
- printf ("new interface\n");
- else
- printf ("old interface\n");
- }
- return 0;
-}
-
-static int
-invalidate_cmd (int argc, char **argv)
-{
- unsigned int i;
-
- argc--;
- argv++;
-
- if(!argc)
- fs_invalidate(".");
- else
- for(i=0;i<argc;i++) {
- if(i)
- printf("\n");
- fs_invalidate(argv[i]);
- }
-
- return 0;
-}
-
-static int
-getmaxprio_cmd (int argc, char **argv)
-{
- int16_t prio;
- int ret;
-
- argc--;
- argv++;
-
- if (argc != 0)
- fprintf(stderr, "getmaxprio: extraneous argumets ignored\n");
-
- ret = fs_getmaxfprio(&prio);
- if (ret) {
- fserr(PROGNAME, ret, NULL);
- return 0;
- }
-
- return 0;
-}
-
-static int
-quit_cmd (int argc, char **argv)
-{
- printf ("Exiting...\n");
- return 1;
-}
-
-static int
-rmprio_usage(void)
-{
- printf("usage: rmpriority file ...\n");
- return 0;
-}
-
-static int
-rmprio_cmd(int argc, char **argv)
-{
- VenusFid fid;
- int ret, i;
- char *path;
-
- if (argc == 0)
- return rmprio_usage();
-
- for (i = 0; i < argc; i++) {
- path = argv[i];
-
- ret = fs_getfid(path, &fid);
- if (ret) {
- fserr(PROGNAME, ret, path);
- return 0;
- }
-
- ret = fs_setfprio(fid, 0);
- if (ret) {
- fserr(PROGNAME, ret, path);
- return 0;
- }
- }
- return 0;
-}
-
-static int
-gc_cmd (int argc, char **argv)
-{
- int ret;
-
- argc--;
- argv++;
-
- if (argc != 0)
- printf ("gcpags: extraneous arguments ignored\n");
-
- ret = fs_gcpags();
- if (ret)
- fserr(PROGNAME, ret, NULL);
-
- return 0;
-}
-
-static int
-getcrypt_cmd (int argc, char **argv)
-{
- uint32_t n;
- int ret;
-
- argc--;
- argv++;
-
- if (argc != 0)
- printf ("getcrypt: extraneous arguments ignored\n");
-
- ret = fs_getcrypt (&n);
- if (ret) {
- fserr(PROGNAME, ret, NULL);
- return 0;
- }
-
- switch (n) {
- case 0 :
- printf ("not encrypted\n");
- break;
- case 1 :
- printf ("encrypted\n");
- break;
- default :
- printf ("getcrypt: unknown reply %d\n", n);
- }
- return 0;
-}
-
-static int
-nop_cmd(int argc, char **argv)
-{
- if (argc > 1)
- fprintf(stderr, "extraneous arguments ignored\n");
-
- printf("VIOCNOP returns %d\n", fs_nop());
-
- return 0;
-}
-
-/*
- * Print current sysname.
- */
-
-void
-afs_print_sysname (void)
-{
- int ret;
- char buf[2048];
-
- ret = fs_get_sysname (buf, sizeof(buf));
- if (ret)
- fserr (PROGNAME, ret, NULL);
- else
- printf ("Current sysname is '%s'\n", buf);
-}
-
-/*
- * Set sysname
- */
-
-void
-afs_set_sysname (const char *sys)
-{
- int ret;
-
- ret = fs_set_sysname (sys);
- if (ret)
- fserr (PROGNAME, ret, NULL);
- else
- printf ("fs: new sysname set to `%s'\n", sys);
-}
-
-static int
-sysname_cmd (int argc, char **argv)
-{
- argc--;
- argv++;
- if (argc == 0)
- afs_print_sysname ();
- else
- afs_set_sysname (argv[0]);
-
- return 0;
-}
-
-static int
-venuslog_cmd (int argc, char **argv)
-{
- int ret = fs_venuslog();
- if (ret)
- fserr (PROGNAME, ret, NULL);
- return 0;
-}
-
-static int
-checkvolumes_cmd (int argc, char **argv)
-{
- int ret;
-
- ret = fs_checkvolumes();
- if (ret)
- fserr (PROGNAME, ret, NULL);
- return 0;
-}
-
-static int
-calculate_cmd (int argc, char **argv)
-{
- int ret;
- uint32_t used, calc;
-
- ret = fs_calculate_cache(&calc, &used);
- if (ret)
- warn ("fs_calculate_cache");
- else
- printf ("usedbytes: %10d\n"
- "calculated: %10d\n"
- "diff: c - u %10d\n",
- used, calc, calc - used );
-
- return 0;
-}
-
-static SL_cmd cmds[] = {
- {"apropos", apropos_cmd, "locate commands by keyword"},
- {"arladebug", arladebug_cmd, "change arla-debugging flags"},
- {"calculate cache", calculate_cmd, "calculate the usage of cache"},
- {"checkservers", checkservers_cmd,"check if servers are up"},
- {"checkvolumes", checkvolumes_cmd,
- "lookup mappings between volume-ids and names"},
- {"cleanacl", empty_cmd, "clear out numeric acl-entries"},
- {"copyacl", copyacl_cmd, "copy acl"},
- {"ca" },
- {"diskfree", diskfree_cmd, "show free partition space"},
- {"df"},
- {"examine", examine_cmd, "examine volume status"},
- {"listvol"},
- {"lv"},
- {"flush", flush_cmd, "remove file from cache"},
- {"flushvolume", flushvolume_cmd,
- "remove volumedata (and files in volume) from cache"},
- {"gcpags", gc_cmd, "garbage collect pags"},
- {"getcacheparms", getcache_cmd, "get cache usage"},
- {"getcrypt", getcrypt_cmd, "get encryption status"},
- {"getcellstatus", getcellstatus_cmd, "get suid cell status"},
-#if 0
- {"getclientaddrs", empty_cmd,
- "get client network interface addresses"},
- {"gc"},
-#endif
- {"getfid", getfid_cmd, "get fid"},
- {"getserverprefs", empty_cmd, "show server rank"},
- {"gp"},
- {"getstatistics", getstatistics_cmd, "get statistics"},
- {"getpriority", getprio_cmd, "get priority of a file/dir"},
- {"gp"},
- {"getmaxpriority", getmaxprio_cmd, "get max priority for file gc"},
- {"gmp"},
- {"help", help_cmd, "help for commands"},
- {"incompat", incompat_cmd, "using old interface"},
- {"invalidate", invalidate_cmd, "invalidate (callback) path"},
- {"listacl", listacl_cmd, "show acl"},
- {"la"},
- {"listcells", listcells_cmd, "show cells configured"},
- {"listquota", listquota_cmd, "show volume quota"},
- {"lq"},
- {"lsmount", lsmount_cmd, "show mount point"},
- {"messages", empty_cmd, "change arlad logging"},
- {"mkmount", mkmount_cmd, "create mount point"},
- {"connect", connect_cmd, "connect mode"},
- {"monitor", empty_cmd, "set remote logging host"},
- {"newcell", newcell_cmd, "add new cell"},
- {"nop", nop_cmd, "do a pioctl-nop"},
- {"quit", quit_cmd, "leave interactive mode"},
- {"exit"},
- {"quota", quota_cmd, "show quota"},
- {"rmmount", rmmount_cmd, "delete mount point"},
- {"removepriority", rmprio_cmd, "remove priority from file/directory"},
- {"rmp"},
- {"setacl", setacl_cmd, "set acl"},
- {"sa"},
- {"setcachesize", setcache_cmd, "change cache size"},
- {"setcell", empty_cmd, "change cell status"},
-#if 0
- {"setclientaddrs", empty_cmd,
- "set client network interface addresses"},
- {"sc"},
-#endif
- {"setpriority", setprio_cmd, "set priority of a file/directory"},
- {"setmaxpriority", setmaxprio_cmd, "set upper limit of prio gc"},
- {"smq"},
- {"setquota", setquota_cmd, "change maxquota on volume"},
- {"sq"},
- {"setserverprefs", empty_cmd, "change server query order"},
- {"sp"}, /* this is what openafs uses */
- {"setcrypt", setcrypt_cmd, "set encryption on/off"},
- {"setvol", empty_cmd, "change status of volume"},
- {"sv"},
-#if 0
- {"storebehind", empty_cmd, ""},
- {"sb"},
-#endif
- {"strerror", strerror_cmd, "translate errorcode to message"},
- {"suidcells", suidcells_cmd, "list status of cells"},
- {"sysname", sysname_cmd, "read/change sysname"},
- {"version", arlalib_version_cmd, "print version"},
- {"venuslog", venuslog_cmd, "make arlad print status"},
- {"whereis", whereis_cmd, "show server(s) of file"},
- {"whichcell", whichcell_cmd, "show cell of file"},
- {"wscell", wscell_cmd, "display cell of workstation"},
- {"nnpfsdebug", nnpfsdebug_cmd, "change nnpfs-debugging flags"},
- {"nnpfsprint", nnpfsdebug_print_cmd,"make nnpfs print debug info"},
- {NULL}
-};
-
-static int
-apropos_cmd (int argc, char **argv)
-{
- if (argc == 0) {
- printf ("apropos: missing topic\n");
- return 0;
- }
-
- sl_apropos (cmds, argv[1]);
- return 0;
-}
-
-static int
-help_cmd (int argc, char **argv)
-{
- SL_cmd *cmd;
-
- for (cmd = cmds; cmd->name != NULL; ++cmd)
- if (cmd->usage != NULL)
- printf ("%-20s%s\n", cmd->name, cmd->usage);
-
- return 0;
-}
-
-int
-main(int argc, char **argv)
-{
- int ret = 0;
-
- if(!k_hasafs()) {
- printf ("Error detecting AFS\n");
- exit(1);
- }
-
- if (argc > 1) {
- ret = sl_command(cmds, argc - 1, argv + 1);
- if (ret == -1)
- printf ("%s: Unknown command\n", argv[1]);
- }
- else {
- fs_interactive = 1;
- printf("fs - an arla tool for administrating AFS files.\n");
- printf("Type \"help\" to get a list of commands.\n");
- ret = sl_loop(cmds, __progname": ");
- }
-
- return ret;
-}
-
diff --git a/usr.sbin/afs/src/appl/fs/fs_arladebug.c b/usr.sbin/afs/src/appl/fs/fs_arladebug.c
deleted file mode 100644
index d821207ecc2..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_arladebug.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_arladebug.c,v 1.1 2001/09/24 23:50:11 mattiasa Exp $");
-
-int
-arladebug_cmd (int argc, char **argv)
-{
- int ret;
- int flags;
-
- if ((argc > 1 && strncmp("-h", argv[1], 2) == 0) || argc > 2) {
- fprintf (stderr, "arladebug [-h] [");
- arla_log_print_levels (stderr);
- fprintf (stderr, "]\n");
- return 0;
- }
-
- ret = arla_debug (-1, &flags);
- if (ret) {
- fprintf (stderr, "arla_debug: %s\n", strerror(ret));
- return 0;
- }
-
- if (argc == 1) {
- char buf[1024];
-
- unparse_flags (flags, arla_deb_units, buf, sizeof(buf));
- printf ("arladebug is: %s\n", buf);
- } else if (argc == 2) {
- const char *textflags = argv[1];
-
- ret = parse_flags (textflags, arla_deb_units, flags);
- if (ret < 0) {
- fprintf (stderr, "arladebug: unknown/bad flags `%s'\n",
- textflags);
- return 0;
- }
-
- flags = ret;
- ret = arla_debug (flags, NULL);
- if (ret)
- fprintf (stderr, "arla_debug: %s\n", strerror(ret));
- }
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_checkservers.c b/usr.sbin/afs/src/appl/fs/fs_checkservers.c
deleted file mode 100644
index 329aaf25405..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_checkservers.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_checkservers.c,v 1.2 2002/02/07 17:58:19 lha Exp $");
-
-int
-checkservers_cmd (int argc, char **argv)
-{
- char *cell = NULL;
- int flags = 0;
- int nopoll = 0;
- int optind = 0;
- uint32_t hosts[CKSERV_MAXSERVERS + 1];
- int ret;
- int i;
-
- struct agetargs cksargs[] = {
- {"cell", 0, aarg_string, NULL, "cell", NULL},
- {"nopoll", 0, aarg_flag, NULL, "dont ping each server, "
- "use internal info", NULL},
- {NULL, 0, aarg_end, NULL}},
- *arg;
-
- arg = cksargs;
- arg->value = &cell; arg++;
- arg->value = &nopoll; arg++;
-
- if (agetarg (cksargs, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(cksargs, "checkservers", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- if (cell)
- flags |= CKSERV_FSONLY;
- if (nopoll)
- flags |= CKSERV_DONTPING;
-
- ret = fs_checkservers(cell, flags, hosts, sizeof(hosts)/sizeof(hosts[0]));
- if (ret) {
- if (ret == ENOENT)
- fprintf (stderr, "%s: cell `%s' doesn't exist\n",
- PROGNAME, cell);
- else
- fserr (PROGNAME, ret, NULL);
- return 0;
- }
-
- if (hosts[0] == 0)
- printf ("All servers are up");
-
- for (i = 1; i < min(CKSERV_MAXSERVERS, hosts[0]) + 1; ++i) {
- if (hosts[i]) {
- struct hostent *he;
-
- he = gethostbyaddr ((char *)&hosts[i], sizeof(hosts[i]), AF_INET);
-
- if (he != NULL) {
- printf ("%s ", he->h_name);
- } else {
- struct in_addr in;
-
- in.s_addr = hosts[i];
- printf ("%s ", inet_ntoa(in));
-
- }
- }
- }
- printf("\n");
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_connect.c b/usr.sbin/afs/src/appl/fs/fs_connect.c
deleted file mode 100644
index 5ab6d79da3b..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_connect.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_connect.c,v 1.2 2003/03/04 13:05:08 lha Exp $");
-
-static int
-connect_usage(void)
-{
- printf("connect [connected|fetch|disconnected|callback-connected]\n");
- return 0;
-}
-
-int
-connect_cmd(int argc, char **argv)
-{
- int ret;
- int32_t flags;
-
- argc--;
- argv++;
-
- if (argc == 0) {
- ret = fs_connect(CONNMODE_PROBE, &flags);
- if (ret) {
- fserr(PROGNAME, ret, NULL);
- return 0;
- }
-
- switch(flags) {
- case CONNMODE_CONN:
- printf("Connected mode\n");
- break;
- case CONNMODE_FETCH:
- printf("Fetch only mode\n");
- break;
- case CONNMODE_DISCONN:
- printf("Disconnected mode\n");
- break;
- default:
- printf("Unknown or error\n");
- break;
- }
- return 0;
- }
-
- if (strncmp("dis", *argv, 3) == 0)
- ret = fs_connect(CONNMODE_DISCONN, &flags);
- else if (strncmp("fetch", *argv, 5) == 0)
- ret = fs_connect(CONNMODE_FETCH, &flags);
- else if (strncmp("conn", *argv, 4) == 0)
- ret = fs_connect(CONNMODE_CONN, &flags);
- else if (strncmp(*argv, "call", 4) == 0)
- ret = fs_connect(CONNMODE_CONN_WITHCALLBACKS, &flags);
- else
- return connect_usage();
-
- if (ret)
- fserr(PROGNAME, ret, NULL);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_copyacl.c b/usr.sbin/afs/src/appl/fs/fs_copyacl.c
deleted file mode 100644
index 236a924c756..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_copyacl.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_copyacl.c,v 1.2 2003/04/08 00:01:17 lha Exp $");
-
-static void
-afs_copyacl(char *fromdir, char *todir)
-{
- struct Acl *acl;
- struct AclEntry *position;
- struct ViceIoctl a_params;
- int i, l, len;
- char acltext[MAXSIZE];
-
- if((acl=afs_getacl(fromdir))==NULL)
- exit(1);
-
- l = snprintf(acltext, sizeof(acltext), "%d\n%d\n",
- acl->NumPositiveEntries,
- acl->NumNegativeEntries);
- len = l;
- if (len == -1 || len >= sizeof(acltext)) {
- fserr(PROGNAME, ERANGE, todir);
- return;
- }
- position=acl->pos;
- for(i=0; i<acl->NumPositiveEntries; i++) {
- l = snprintf(acltext + len, sizeof(acltext) - len,
- "%s %d\n", position->name, position->RightsMask);
- len += l;
- if (l == -1 || len >= sizeof(acltext)) {
- fserr(PROGNAME, ERANGE, todir);
- return;
- }
- position=position->next;
- }
- position=acl->neg;
- for(i=0; i<acl->NumNegativeEntries; i++) {
- l = snprintf(acltext + len, sizeof(acltext) - len,
- "%s %d\n", position->name, position->RightsMask);
- len += l;
- if (l == -1 || len >= sizeof(acltext)) {
- fserr(PROGNAME, ERANGE, todir);
- return;
- }
- position=position->next;
- }
-
- a_params.in_size=len;
- a_params.out_size=0;
- a_params.in=acltext;
- a_params.out=0;
-
- if(k_pioctl(todir,VIOCSETAL,&a_params,1)==-1) {
- fserr(PROGNAME, errno, todir);
- return;
- }
-}
-
-int
-copyacl_cmd (int argc, char **argv)
-{
- argc--;
- argv++;
-
- if (argc != 2) {
- printf ("fs: copyacl: Too many or too few arguments\n");
- return 0;
- }
-
- afs_copyacl (argv[0], argv[1]);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_diskfree.c b/usr.sbin/afs/src/appl/fs/fs_diskfree.c
deleted file mode 100644
index d9e0278e37d..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_diskfree.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_diskfree.c,v 1.3 2003/01/24 07:25:44 lha Exp $");
-
-static void
-afs_diskfree (char *path)
-{
- struct ViceIoctl a_params;
- struct VolumeStatus *status;
-
- a_params.in_size = 0;
- a_params.out_size = MAXSIZE;
- a_params.in = NULL;
- a_params.out = malloc (MAXSIZE);
-
- if (a_params.out == NULL) {
- printf ("fs: Out of memory\n");
- return;
- }
-
- if (k_pioctl (path, VIOCGETVOLSTAT, &a_params, 1) == -1) {
- fserr(PROGNAME, errno, path);
- free(a_params.out);
- return;
- }
-
- status = (struct VolumeStatus *) a_params.out;
-
- printf ("%-20s %10d %10d %10d %6.0f%%\n",
- a_params.out + sizeof (struct VolumeStatus),
- status->PartMaxBlocks,
- status->PartMaxBlocks - status->PartBlocksAvail,
- status->PartBlocksAvail,
- (float) (status->PartMaxBlocks - status->PartBlocksAvail) / status->PartMaxBlocks * 100);
-
- free (a_params.out);
-}
-
-int
-diskfree_cmd (int argc, char **argv)
-{
- int i;
-
- argc--;
- argv++;
-
- printf ("Volume Name kbytes used avail %%used\n");
-
- if (argc == 0)
- afs_diskfree (".");
- else
- for (i = 0; i < argc; i++)
- afs_diskfree (argv[i]);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_examine.c b/usr.sbin/afs/src/appl/fs/fs_examine.c
deleted file mode 100644
index 33d98920df7..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_examine.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_examine.c,v 1.1 2001/09/24 23:50:13 mattiasa Exp $");
-
-static void
-afs_examine (char *path)
-{
- struct ViceIoctl a_params;
- struct VolumeStatus *status;
-
- a_params.in_size = 0;
- a_params.out_size = MAXSIZE;
- a_params.in = NULL;
- a_params.out = malloc (MAXSIZE);
-
- if (a_params.out == NULL) {
- printf ("fs: Out of memory\n");
- return;
- }
-
- if (k_pioctl (path, VIOCGETVOLSTAT, &a_params, 1) == -1) {
- fserr(PROGNAME, errno, path);
- free(a_params.out);
- return;
- }
-
- status = (struct VolumeStatus *) a_params.out;
-
- printf ("Volume status for vid = %d named %s\n", status->Vid,
- a_params.out + sizeof (struct VolumeStatus));
- printf ("Current disk quota is %d\n", status->MaxQuota);
- printf ("Current blocks used are %d\n", status->BlocksInUse);
- printf ("The partition has %d blocks available out of %d\n\n", status->PartBlocksAvail, status->PartMaxBlocks);
-
- free (a_params.out);
-}
-
-int
-examine_cmd (int argc, char **argv)
-{
- int i;
-
- argc--;
- argv++;
-
- if (argc == 0)
- afs_examine (".");
- else
- for (i = 0; i < argc; i++)
- afs_examine (argv[i]);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_flush.c b/usr.sbin/afs/src/appl/fs/fs_flush.c
deleted file mode 100644
index 5ac709ebf20..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_flush.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_flush.c,v 1.1 2001/09/24 23:50:13 mattiasa Exp $");
-
-int
-flush_cmd (int argc, char **argv)
-{
- int i;
-
- argc--;
- argv++;
-
- if (argc == 0)
- fs_flush (".");
- else
- for (i = 0; i < argc; i++)
- fs_flush (argv[i]);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_flushvol.c b/usr.sbin/afs/src/appl/fs/fs_flushvol.c
deleted file mode 100644
index d292f9365b5..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_flushvol.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_flushvol.c,v 1.1 2001/09/24 23:50:14 mattiasa Exp $");
-
-int
-flushvolume_cmd (int argc, char **argv)
-{
- int i;
-
- argc--;
- argv++;
-
- if (argc == 0)
- fs_flushvolume (".");
- else
- for (i = 0; i < argc; i++)
- fs_flushvolume (argv[i]);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_getcache.c b/usr.sbin/afs/src/appl/fs/fs_getcache.c
deleted file mode 100644
index e0fd4a5b0dc..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_getcache.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_getcache.c,v 1.3 2002/06/02 17:50:49 lha Exp $");
-
-/*
- *
- */
-
-int
-getcache_cmd (int argc, char **argv)
-{
- int ret, help = 0;
- int64_t max_bytes, used_bytes, max_vnodes, used_vnodes;
- int optind = 0, bytes_flag = 0;
-
- struct agetargs ncargs[] = {
- {"byte", 'b', aarg_flag,
- NULL, "show result in byte instead of kbyte", NULL},
- {"help", 'h', aarg_flag,
- NULL, "get help", NULL},
- {NULL, 0, aarg_end, NULL}},
- *arg;
-
- arg = ncargs;
- arg->value = &bytes_flag; arg++;
- arg->value = &help; arg++;
-
- if (agetarg (ncargs, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(ncargs, "getcacheparams", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- if (help) {
- aarg_printusage(ncargs, "getcacheparams", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
-
- ret = fs_getfilecachestats (&max_bytes,
- &used_bytes,
- NULL,
- &max_vnodes,
- &used_vnodes,
- NULL);
- if (ret) {
- fserr (PROGNAME, ret, NULL);
- return 0;
- }
- if (bytes_flag) {
- printf("Arla is using %lu of the cache's available "
- "%lu byte blocks\n",
- (unsigned long)used_bytes, (unsigned long)max_bytes);
- if (max_vnodes)
- printf("(and %lu of the cache's available %lu vnodes)\n",
- (unsigned long)used_vnodes, (unsigned long)max_vnodes);
- } else {
- printf("Arla is using %lu of the cache's available "
- "%lu 1K byte blocks\n",
- (unsigned long)used_bytes/1024, (unsigned long)max_bytes/1024);
- if (max_vnodes)
- printf("(and %lu of the cache's available %lu vnodes)\n",
- (unsigned long)used_vnodes, (unsigned long)max_vnodes);
- }
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_getcellstat.c b/usr.sbin/afs/src/appl/fs/fs_getcellstat.c
deleted file mode 100644
index 3137dac87fb..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_getcellstat.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_getcellstat.c,v 1.2 2002/02/07 17:58:22 lha Exp $");
-
-static void
-afs_getcellstatus (char *cell)
-{
- uint32_t flags;
- int ret;
-
- ret = fs_getcellstatus (cell, &flags);
- if (ret) {
- fserr(PROGNAME, ret, cell);
- return;
- }
- printf ("Cell %s status: %ssetuid allowed\n", cell,
- !SETUID_HONORED(flags) ? "no " : "");
-}
-
-int
-getcellstatus_cmd (int argc, char **argv)
-{
- int i;
-
- argc--;
- argv++;
-
- if (argc == 0)
- printf ("%s: Missing required parameter '-cell'\n", PROGNAME);
- else
- for (i = 0; i < argc; i++)
- afs_getcellstatus (argv[i]);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_getfid.c b/usr.sbin/afs/src/appl/fs/fs_getfid.c
deleted file mode 100644
index 2d9e8e3d4d4..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_getfid.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_getfid.c,v 1.1 2001/09/24 23:50:15 mattiasa Exp $");
-
-static void
-afs_getfid(char *path)
-{
- VenusFid fid;
- int ret;
- char cellname[MAXNAME];
-
- ret = fs_getfid(path, &fid);
- if (ret) {
- fserr(PROGNAME, ret, path);
- return;
- }
-
- ret = fs_getfilecellname(path, cellname, sizeof(cellname));
- if (ret) {
- fserr(PROGNAME, ret, path);
- return;
- }
-
- printf("Fid: %u.%u.%u in %s (%u) \n", fid.fid.Volume,
- fid.fid.Vnode, fid.fid.Unique, cellname, fid.Cell);
-}
-
-int
-getfid_cmd(int argc, char **argv)
-{
- argc--;
- argv++;
-
- if (argc == 0)
- printf("%s: Missing required parameter '-path'\n", PROGNAME);
- else if (argc == 1)
- afs_getfid(*argv);
- else
- while (argc) {
- afs_getfid(*argv);
- argc--;
- argv++;
- }
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_getprio.c b/usr.sbin/afs/src/appl/fs/fs_getprio.c
deleted file mode 100644
index f6cfdfafae6..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_getprio.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_getprio.c,v 1.2 2002/04/21 23:49:28 ahltorp Exp $");
-
-static int
-getprio_usage(void)
-{
- fprintf(stderr, "usage getprio file ...\n");
- return 0;
-}
-
-int
-getprio_cmd (int argc, char **argv)
-{
- VenusFid fid;
- int16_t prio;
- int ret, i;
- char *path;
- char cell[MAXNAME];
-
- argc--;
- argv++;
-
- if (argc == 0)
- return getprio_usage();
-
- for (i = 0; i < argc; i++) {
- path = argv[i];
-
- ret = fs_getfid(path, &fid);
- if (ret) {
- fserr(PROGNAME, ret, path);
- continue;
- }
-
- ret = fs_getfprio(fid, &prio);
- if (ret) {
- fserr(PROGNAME, ret, path);
- continue;
- }
-
- ret = fs_getfilecellname(path, cell, sizeof(cell));
- if (ret) {
- fserr(PROGNAME, ret, path);
- continue;
- }
-
- printf("File %s(%s %d.%d.%d) have priority %d\n",
- path, cell, fid.fid.Volume, fid.fid.Vnode,
- fid.fid.Unique, prio);
- }
- return 0;
-}
-
diff --git a/usr.sbin/afs/src/appl/fs/fs_la.c b/usr.sbin/afs/src/appl/fs/fs_la.c
deleted file mode 100644
index 26f0d1fde28..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_la.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_la.c,v 1.2 2003/05/06 09:13:03 lha Exp $");
-
-static void
-skipline(char **curptr)
-{
- while(**curptr!='\n') (*curptr)++;
- (*curptr)++;
-}
-
-struct Acl *
-afs_getacl(char *path)
-{
- struct Acl *oldacl;
- struct ViceIoctl a_params;
- struct AclEntry *pos=NULL;
- struct AclEntry *neg=NULL;
- char *curptr;
- char tmpname[MAXNAME];
- int tmprights;
- int i;
-
- oldacl=(struct Acl *) malloc(sizeof(struct Acl));
- if(oldacl == NULL) {
- printf("fs: Out of memory\n");
- return NULL;
- }
-
- a_params.in_size=0;
- a_params.out_size=MAXSIZE;
- a_params.in=NULL;
- a_params.out=malloc(MAXSIZE);
-
- if(a_params.out == NULL) {
- printf ("fs: Out of memory\n");
- free (oldacl);
- return NULL;
- }
-
- if(k_pioctl(path,VIOCGETAL,&a_params,1)==-1) {
- fserr(PROGNAME, errno, path);
- free (oldacl);
- free(a_params.out);
- return NULL;
- }
-
- curptr=a_params.out;
-
- /* Number of pos/neg entries parsing */
- sscanf(curptr, "%d\n%d\n", &oldacl->NumPositiveEntries,
- &oldacl->NumNegativeEntries);
- skipline(&curptr);
- skipline(&curptr);
-
- if(oldacl->NumPositiveEntries)
- for(i=0; i<oldacl->NumPositiveEntries; i++) {
- sscanf(curptr, "%99s %d", tmpname, &tmprights);
- skipline(&curptr);
- if(!i) {
- pos=malloc(sizeof(struct AclEntry));
- oldacl->pos=pos;
- }
- else {
- pos->next=malloc(sizeof(struct AclEntry));
- pos=pos->next;
- }
- pos->RightsMask=tmprights;
- strlcpy(pos->name, tmpname, sizeof(pos->name));
- pos->next=NULL;
- }
-
- if(oldacl->NumNegativeEntries)
- for(i=0; i<oldacl->NumNegativeEntries; i++) {
- sscanf(curptr, "%99s %d", tmpname, &tmprights);
- skipline(&curptr);
- if(!i) {
- neg=malloc(sizeof(struct AclEntry));
- oldacl->neg=neg;
- }
- else {
- neg->next=malloc(sizeof(struct AclEntry));
- neg=neg->next;
- }
- neg->RightsMask=tmprights;
- strlcpy(neg->name, tmpname, sizeof(neg->name));
- neg->next=NULL;
- }
-
- free(a_params.out);
- return oldacl;
-}
-
-static void
-afs_listacl(char *path)
-{
- struct Acl *acl;
- struct AclEntry *position;
- int i;
-
- acl = afs_getacl(path);
- if (acl == NULL) {
- if (errno == EACCES)
- return;
- else
- exit(1);
- }
-
- printf("Access list for %s is\n", path);
- if(acl->NumPositiveEntries) {
- printf("Normal rights:\n");
-
- position=acl->pos;
- for(i=0;i<acl->NumPositiveEntries;i++) {
- printf(" %s ", position->name);
- if(position->RightsMask&PRSFS_READ)
- printf("r");
- if(position->RightsMask&PRSFS_LOOKUP)
- printf("l");
- if(position->RightsMask&PRSFS_INSERT)
- printf("i");
- if(position->RightsMask&PRSFS_DELETE)
- printf("d");
- if(position->RightsMask&PRSFS_WRITE)
- printf("w");
- if(position->RightsMask&PRSFS_LOCK)
- printf("k");
- if(position->RightsMask&PRSFS_ADMINISTER)
- printf("a");
- printf("\n");
- position=position->next;
- }
- }
- if(acl->NumNegativeEntries) {
- printf("Negative rights:\n");
-
- position=acl->neg;
- for(i=0;i<acl->NumNegativeEntries;i++) {
- printf(" %s ", position->name);
- if(position->RightsMask&PRSFS_READ)
- printf("r");
- if(position->RightsMask&PRSFS_LOOKUP)
- printf("l");
- if(position->RightsMask&PRSFS_INSERT)
- printf("i");
- if(position->RightsMask&PRSFS_DELETE)
- printf("d");
- if(position->RightsMask&PRSFS_WRITE)
- printf("w");
- if(position->RightsMask&PRSFS_LOCK)
- printf("k");
- if(position->RightsMask&PRSFS_ADMINISTER)
- printf("a");
- printf("\n");
- position=position->next;
- }
- }
-}
-
-int
-listacl_cmd (int argc, char **argv)
-{
- unsigned int i;
-
- argc--;
- argv++;
-
- if(!argc)
- afs_listacl(".");
- else
- for(i=0;i<argc;i++) {
- if(i)
- printf("\n");
- afs_listacl(argv[i]);
- }
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_listcell.c b/usr.sbin/afs/src/appl/fs/fs_listcell.c
deleted file mode 100644
index aa518b29d73..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_listcell.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_listcell.c,v 1.2 2002/02/07 17:58:23 lha Exp $");
-
-/*
- * List all the known cells, with servers iff printservers, resolving
- * IP addresses to names iff resolve and printing suid status iff
- * suid.
- */
-
-static int
-afs_listcells (int printservers, int resolve, int suid)
-{
- struct in_addr addr;
- int i, j;
- char cellname[MAXSIZE];
- uint32_t servers[8];
- int ret;
- unsigned max_servers = sizeof(servers)/sizeof(servers[0]);
-
- for (i = 1;
- (ret = fs_getcells (i, servers,
- max_servers,
- cellname, sizeof (cellname))) == 0;
- ++i) {
- printf ("%s", cellname);
-
- if (printservers) {
- printf (": ");
-
- for (j = 0; j < max_servers && servers[j]; ++j) {
- struct hostent *h = NULL;
- addr.s_addr = servers[j];
- if (resolve)
- h = gethostbyaddr ((const char *) &addr,
- sizeof(addr),
- AF_INET);
- if (h == NULL) {
- printf (" %s", inet_ntoa (addr));
- } else {
- printf (" %s", h->h_name);
- }
- }
- }
- if (suid) {
- uint32_t status;
-
- ret = fs_getcellstatus (cellname, &status);
- if (ret)
- fserr (PROGNAME, ret, NULL);
- else {
- if (status & CELLSTATUS_SETUID)
- printf (", suid cell");
- }
- }
- printf (".\n");
- }
-
- if (errno != EDOM)
- fserr(PROGNAME, errno, NULL);
-
- return 0;
-}
-
-int
-listcells_cmd (int argc, char **argv)
-{
- int printhosts = 1;
- int resolve = 1;
- int printsuid = 0;
- int optind = 0;
-
- struct agetargs lcargs[] = {
- {"servers", 's', aarg_negative_flag,
- NULL,"do not print servers in cell", NULL},
- {"resolve", 'r', aarg_negative_flag,
- NULL,"do not resolve hostnames", NULL},
- {"suid", 'p', aarg_flag,
- NULL,"print if cell is suid", NULL },
- {NULL, 0, aarg_end, NULL}},
- *arg;
-
- arg = lcargs;
- arg->value = &printhosts; arg++;
- arg->value = &resolve; arg++;
- arg->value = &printsuid; arg++;
-
- if (agetarg (lcargs, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(lcargs, "listcells", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- printf ("%d %d %d\n", printhosts, resolve, printsuid);
-
- afs_listcells (printhosts,resolve,printsuid);
-
- return 0;
-}
-
-int
-suidcells_cmd (int argc, char **argv)
-{
- afs_listcells (0, 0, 1);
-
- return 0;
-}
-
diff --git a/usr.sbin/afs/src/appl/fs/fs_listquota.c b/usr.sbin/afs/src/appl/fs/fs_listquota.c
deleted file mode 100644
index 9e337975f0a..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_listquota.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_listquota.c,v 1.2 2003/01/28 14:34:00 lha Exp $");
-
-static void
-afs_listquota(char *path)
-{
- struct ViceIoctl a_params;
- struct VolumeStatus *vs;
- char *name;
- double used_vol, used_part;
-
- a_params.in_size=0;
- a_params.out_size=MAXSIZE;
- a_params.in=NULL;
- a_params.out=malloc(MAXSIZE);
-
- if (a_params.out == NULL) {
- printf ("fs: Out of memory\n");
- return;
- }
-
- if(k_pioctl(path,VIOCGETVOLSTAT,&a_params,1)==-1) {
- fserr(PROGNAME, errno, path);
- free(a_params.out);
- return;
- }
-
- vs=(struct VolumeStatus *) a_params.out;
- name=a_params.out+sizeof(struct VolumeStatus);
-
- if (vs->MaxQuota)
- used_vol = ((double) vs->BlocksInUse / vs->MaxQuota) * 100;
- else
- used_vol = 0.0;
-
- if (vs->PartMaxBlocks)
- used_part = (1.0 - (double) vs->PartBlocksAvail / vs->PartMaxBlocks)
- * 100;
- else
- used_part = 0.0;
-
- printf("%-20s %10d %10d%9.0f%%%s%9.0f%%%s%s\n",
- name,
- vs->MaxQuota,
- vs->BlocksInUse,
- used_vol,
- used_vol > 90 ? "<<" : " ",
- used_part,
- used_part > 97 ? "<<" : " ",
-
- /* Print a warning if more than 90% on home volume or 97% on */
- /* the partition is being used */
- (used_vol > 90 || used_part > 97) ? "\t<<WARNING" : "");
-
- free(a_params.out);
-}
-
-int
-listquota_cmd (int argc, char **argv)
-{
- int i;
-
- argc--;
- argv++;
-
- printf("Volume Name "
- "Quota Used %% Used Partition\n");
-
- if (argc == 0)
- afs_listquota (".");
- else
- for (i = 0; i < argc; i++)
- afs_listquota (argv[i]);
-
- return 0;
-}
-
diff --git a/usr.sbin/afs/src/appl/fs/fs_local.h b/usr.sbin/afs/src/appl/fs/fs_local.h
deleted file mode 100644
index 35f149aa0f6..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_local.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * $arla: fs_local.h,v 1.34 2003/01/17 03:06:09 lha Exp $
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include <kafs.h>
-#include <parse_units.h>
-#include <nnpfs/nnpfs_debug.h>
-#include <nnpfs/nnpfs_deb.h>
-#include <arladeb.h>
-
-#include <vers.h>
-
-#define MAXNAME 100
-#define MAXSIZE 2048
-
-int arladebug_cmd (int argc, char **argv);
-int checkservers_cmd (int argc, char **argv);
-int copyacl_cmd (int argc, char **argv);
-int diskfree_cmd (int argc, char **argv);
-int examine_cmd (int argc, char **argv);
-int flush_cmd (int argc, char **argv);
-int flushvolume_cmd (int argc, char **argv);
-int getcache_cmd (int argc, char **argv);
-int getcellstatus_cmd (int argc, char **argv);
-int getfid_cmd (int argc, char **argv);
-int getstatistics_cmd (int argc, char **argv);
-int getprio_cmd (int argc, char **argv);
-int listacl_cmd (int argc, char **argv);
-int listcells_cmd (int argc, char **argv);
-int suidcells_cmd (int argc, char **argv);
-int listquota_cmd (int argc, char **argv);
-int lsmount_cmd (int argc, char **argv);
-int mkmount_cmd (int argc, char **argv);
-int connect_cmd (int argc, char **argv);
-int newcell_cmd (int argc, char **argv);
-int quota_cmd (int argc, char **argv);
-int rmmount_cmd (int argc, char **argv);
-int setacl_cmd (int argc, char **argv);
-int setcache_cmd (int argc, char **argv);
-int setquota_cmd (int argc, char **argv);
-int setcrypt_cmd (int argc, char **argv);
-int strerror_cmd (int argc, char **argv);
-int whereis_cmd (int argc, char **argv);
-int whichcell_cmd (int argc, char **argv);
-int wscell_cmd (int argc, char **argv);
-int nnpfsdebug_cmd (int argc, char **argv);
-int nnpfsdebug_print_cmd (int argc, char **argv);
-
-struct Acl {
- int NumPositiveEntries;
- int NumNegativeEntries;
- struct AclEntry *pos;
- struct AclEntry *neg;
-};
-
-struct AclEntry {
- struct AclEntry *next;
- int32_t RightsMask;
- char name[MAXNAME];
-};
-
-struct VolumeStatus {
- int32_t Vid;
- int32_t ParentId;
- char Online;
- char InService;
- char Blessed;
- char NeedsSalvage;
- int32_t Type;
- int32_t MinQuota;
- int32_t MaxQuota;
- int32_t BlocksInUse;
- int32_t PartBlocksAvail;
- int32_t PartMaxBlocks;
-};
-
-/* Flags for cell status */
-#define PRIMARY_CELL(flags) ((flags) & CELLSTATUS_PRIMARY)
-#define SETUID_HONORED(flags) ((flags) & CELLSTATUS_SETUID)
-#define OBSOLETE_VERSION(flags) ((flags) & CELLSTATUS_OBSOLETE_VL)
-
-struct Acl *afs_getacl(char *path);
-void afs_sysname(char *name);
-void afs_lsmount(const char *path);
-void afs_rmmount(const char *path);
-void afs_quota (char *path);
-int afs_connect(int32_t type);
-int afs_getcrypt (void);
-int afs_setcrypt (int n);
-void afs_print_sysname (void);
-void afs_set_sysname (const char *sys);
-
-/* if this is set the program runs in interactive mode */
-extern int fs_interactive;
-
-/* this program needs __progname defined as a macro */
-#define __progname "fs"
-#define PROGNAME (fs_interactive ? "" : __progname" ")
diff --git a/usr.sbin/afs/src/appl/fs/fs_lsm.c b/usr.sbin/afs/src/appl/fs/fs_lsm.c
deleted file mode 100644
index ffd6500fbeb..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_lsm.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_lsm.c,v 1.1 2001/09/24 23:50:17 mattiasa Exp $");
-
-int
-lsmount_cmd (int argc, char **argv)
-{
- int i, ret;
-
- argc--;
- argv++;
-
- if (argc == 0) {
- printf ("fs: Required parameter '-dir' missing\n");
- return 0;
- }
-
- for (i = 0; i < argc; i++) {
- ret = fs_lsmount (argv[i]);
- if (ret == EINVAL)
- fserr (PROGNAME, ret, argv[i]);
- else if (ret)
- printf ("'%s' is not a mount point.\n", argv[i]);
- }
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_mkm.c b/usr.sbin/afs/src/appl/fs/fs_mkm.c
deleted file mode 100644
index f5eadeab4d4..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_mkm.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_mkm.c,v 1.1 2001/09/24 23:50:18 mattiasa Exp $");
-
-int
-mkmount_cmd (int argc, char **argv)
-{
- char buf[MAXSIZE];
- char prefix;
- char *dirname = NULL;
- char *volname = NULL;
- char *cell = NULL;
- int rwflag = 0;
- int helpflag = 0;
- int optind = 0;
-
- struct agetargs mkmargs[] = {
- {"dir", 0, aarg_string, NULL, "mount point directory name",
- "directory", aarg_mandatory},
- {"vol", 0, aarg_string, NULL, "volume to mount",
- "volume", aarg_mandatory},
- {"cell", 0, aarg_string, NULL, "cell of volume",
- "cell", aarg_optional_swless},
- {"rw", 0, aarg_flag, NULL, "mount read-write", NULL},
- {"help", 0, aarg_flag, NULL, NULL, NULL},
- {NULL, 0, aarg_end, NULL}}, *arg;
-
- arg = mkmargs;
- arg->value = &dirname; arg++;
- arg->value = &volname; arg++;
- arg->value = &cell; arg++;
- arg->value = &rwflag; arg++;
- arg->value = &helpflag; arg++;
-
- if (agetarg (mkmargs, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(mkmargs, "fs mkmount", "", AARG_AFSSTYLE);
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc) {
- printf("unknown option %s\n", *argv);
- return 0;
- }
-
- if (rwflag)
- prefix = '%';
- else
- prefix = '#';
- if (cell)
- snprintf(buf, sizeof(buf), "%c%s:%s.", prefix, cell, volname);
- else
- snprintf(buf, sizeof(buf), "%c%s.", prefix, volname);
-
- if (symlink (buf, dirname) == -1) {
- perror ("fs");
- return 0;
- }
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_newcell.c b/usr.sbin/afs/src/appl/fs/fs_newcell.c
deleted file mode 100644
index 841bc2d46dc..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_newcell.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_newcell.c,v 1.1 2001/09/24 23:50:18 mattiasa Exp $");
-
-int
-newcell_cmd (int argc, char **argv)
-{
- char *cell = NULL;
- agetarg_strings servers = { 0, NULL };
- int ret, help = 0;
- int optind = 0;
-
- struct agetargs ncargs[] = {
- {"cell", 'c', aarg_string,
- NULL, "new cell", NULL, aarg_mandatory},
- {"servers", 's', aarg_strings,
- NULL, "server in cell", "one server"},
- {"help", 'h', aarg_flag,
- NULL, "get help", NULL},
- {NULL, 0, aarg_end, NULL}},
- *arg;
-
- arg = ncargs;
- arg->value = &cell; arg++;
- arg->value = &servers; arg++;
- arg->value = &help; arg++;
-
- if (agetarg (ncargs, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(ncargs, "newcell", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- if (help) {
- aarg_printusage(ncargs, "newcell", NULL, AARG_AFSSTYLE);
- goto out;
- }
-
- if (servers.num_strings == 0) {
- fprintf (stderr, "You didn't give servers, will use DNS\n");
- goto out;
- }
-
- ret = fs_newcell (cell, servers.num_strings, servers.strings);
- if (ret)
- fprintf (stderr, "fs_newcell failed with %s (%d)\n",
- koerr_gettext(ret), ret);
-
- out:
- if (servers.strings)
- free (servers.strings);
-
- return 0;
-}
-
diff --git a/usr.sbin/afs/src/appl/fs/fs_nnpfsdebug.c b/usr.sbin/afs/src/appl/fs/fs_nnpfsdebug.c
deleted file mode 100644
index be67a2d8254..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_nnpfsdebug.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_nnpfsdebug.c,v 1.2 2002/09/07 10:42:18 lha Exp $");
-
-static const unsigned all = (0
-#ifdef HAVE_XDEBDEV
- | XDEBDEV
-#endif
-#ifdef HAVE_XDEBMSG
- | XDEBMSG
-#endif
-#ifdef HAVE_XDEBDNLC
- | XDEBDNLC
-#endif
-#ifdef HAVE_XDEBNODE
- | XDEBNODE
-#endif
-#ifdef HAVE_XDEBVNOPS
- | XDEBVNOPS
-#endif
-#ifdef HAVE_XDEBVFOPS
- | XDEBVFOPS
-#endif
-#ifdef HAVE_XDEBLKM
- | XDEBLKM
-#endif
-#ifdef HAVE_XDEBSYS
- | XDEBSYS
-#endif
-#ifdef HAVE_XDEBMEM
- | XDEBMEM
-#endif
-#ifdef HAVE_XDEBREADDIR
- | XDEBREADDIR
-#endif
-#ifdef HAVE_XDEBLOCK
- | XDEBLOCK
-#endif
-#ifdef HAVE_XDEBCACHE
- | XDEBCACHE
-#endif
- );
-
-static const unsigned almost_all_mask = (0
-#ifdef HAVE_XDEBDEV
- | XDEBDEV
-#endif
-#ifdef HAVE_XDEBMEM
- | XDEBMEM
-#endif
-#ifdef HAVE_XDEBREADDIR
- | XDEBREADDIR
-#endif
- );
-
-static struct units nnpfsdebug_units[] = {
- {"all", 0},
- {"almost-all", 0},
-#ifdef HAVE_XDEBCACHE
- {"cache", XDEBCACHE},
-#endif
-#ifdef HAVE_XDEBLOCK
- {"lock", XDEBLOCK},
-#endif
-#ifdef HAVE_XDEBREADDIR
- {"readdir", XDEBREADDIR},
-#endif
-#ifdef HAVE_XDEBMEM
- {"mem", XDEBMEM},
-#endif
-#ifdef HAVE_XDEBSYS
- {"sys", XDEBSYS},
-#endif
-#ifdef HAVE_XDEBLKM
- {"lkm", XDEBLKM},
-#endif
-#ifdef HAVE_XDEBVFOPS
- {"vfsops", XDEBVFOPS},
-#endif
-#ifdef HAVE_XDEBVNOPS
- {"vnops", XDEBVNOPS},
-#endif
-#ifdef HAVE_XDEBNODE
- {"node", XDEBNODE},
-#endif
-#ifdef HAVE_XDEBDNLC
- {"dnlc", XDEBDNLC},
-#endif
-#ifdef HAVE_XDEBMSG
- {"msg", XDEBMSG},
-#endif
-#ifdef HAVE_XDEBDEV
- {"dev", XDEBDEV},
-#endif
- {"none", 0 },
- { NULL, 0 }
-};
-
-int
-nnpfsdebug_cmd (int argc, char **argv)
-{
- int ret;
- int flags;
-
- nnpfsdebug_units[0].mult = all;
- nnpfsdebug_units[1].mult = all & ~almost_all_mask;
-
- if ((argc > 1 && strncmp(argv[1], "-h", 2) == 0) || argc > 2) {
- fprintf (stderr, "usage: nnpfsdebug [-h] [");
- print_flags_table (nnpfsdebug_units, stderr);
- fprintf (stderr, "]\n");
- return 0;
- }
-
- ret = nnpfs_debug (-1, &flags);
- if (ret) {
- fprintf (stderr, "nnpfs_debug: %s\n", strerror(ret));
- return 0;
- }
-
- if (argc == 1) {
- char buf[1024];
-
- unparse_flags (flags, nnpfsdebug_units, buf, sizeof(buf));
- printf("nnpfsdebug is: %s\n", buf);
- } else if (argc == 2) {
- char *textflags;
-
- textflags = argv[1];
-
- ret = parse_flags (textflags, nnpfsdebug_units, flags);
-
- if (ret < 0) {
- fprintf (stderr, "nnpfsdebug: unknown/bad flags `%s'\n",
- textflags);
- return 0;
- }
-
- flags = ret;
- ret = nnpfs_debug(flags, NULL);
- if (ret)
- fprintf (stderr, "nnpfs_debug: %s\n", strerror(ret));
- }
- return 0;
-}
-
-int
-nnpfsdebug_print_cmd (int argc, char **argv)
-{
- int ret;
- int flags = 0;
- char *textflags;
-
- nnpfsdebug_units[0].mult = all;
- nnpfsdebug_units[1].mult = all & ~almost_all_mask;
-
- if (argc != 2 && argc != 3) {
- fprintf (stderr, "usage: nnpfsprint <");
- print_flags_table (nnpfsdebug_units, stderr);
- fprintf (stderr, "> [filename]\n");
- return 0;
- }
-
- textflags = argv[1];
-
- ret = parse_flags (textflags, nnpfsdebug_units, flags);
-
- if (ret < 0) {
- fprintf (stderr, "nnpfsprint: unknown/bad flags `%s'\n",
- textflags);
- return 0;
- }
-
- flags = ret;
- ret = nnpfs_debug_print(flags, argv[2]);
- if (ret)
- fprintf (stderr, "nnpfsprint: %s\n", strerror(ret));
- return 0;
-}
-
diff --git a/usr.sbin/afs/src/appl/fs/fs_quota.c b/usr.sbin/afs/src/appl/fs/fs_quota.c
deleted file mode 100644
index a972823379c..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_quota.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_quota.c,v 1.1 2001/09/24 23:50:19 mattiasa Exp $");
-
-void
-afs_quota (char *path)
-{
- struct ViceIoctl a_params;
- struct VolumeStatus *status;
-
- a_params.in_size = 0;
- a_params.out_size = MAXSIZE;
- a_params.in = NULL;
- a_params.out = malloc (MAXSIZE);
-
- if (a_params.out == NULL) {
- printf ("fs: Out of memory\n");
- return;
- }
-
- if (k_pioctl (path, VIOCGETVOLSTAT, &a_params, 1) == -1) {
- fserr(PROGNAME, errno, path);
- free(a_params.out);
- return;
- }
-
- status = (struct VolumeStatus *) a_params.out;
-
- printf("%.0f%% of quota used.\n",
- ((float) status->BlocksInUse / status->MaxQuota) * 100);
-
- free(a_params.out);
-}
-
-int
-quota_cmd (int argc, char **argv)
-{
- int i;
-
- argc--;
- argv++;
-
- if (argc == 0)
- afs_quota (".");
- else
- for (i = 0; i < argc; i++)
- afs_quota (argv[i]);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_rmm.c b/usr.sbin/afs/src/appl/fs/fs_rmm.c
deleted file mode 100644
index 11710f6b699..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_rmm.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_rmm.c,v 1.1 2001/09/24 23:50:19 mattiasa Exp $");
-
-int
-rmmount_cmd (int argc, char **argv)
-{
- int i, ret;
-
- argc--;
- argv++;
-
- if (argc == 0) {
- printf ("fs: Required parameter '-dir' missing\n");
- return 0;
- }
-
- for (i = 0; i < argc; i++) {
- ret = fs_rmmount (argv[i]);
- if (ret == EINVAL)
- fserr (PROGNAME, ret, argv[i]);
- else if (ret)
- printf ("'%s' is not a mount point.\n", argv[i]);
- }
- return 0;
-}
-
diff --git a/usr.sbin/afs/src/appl/fs/fs_setacl.c b/usr.sbin/afs/src/appl/fs/fs_setacl.c
deleted file mode 100644
index 80b2f1d1bfb..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_setacl.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_setacl.c,v 1.1 2001/09/24 23:50:20 mattiasa Exp $");
-
-static void
-afs_setacl(char *path, char *user, char *rights)
-{
- struct Acl *acl;
- struct AclEntry *position;
- struct ViceIoctl a_params;
- int i;
- int newrights=0;
- int foundit=0;
- char *ptr;
- char acltext[MAXSIZE];
- char tmpstr[MAXSIZE];
-
- if((acl=afs_getacl(path))==NULL)
- exit(1);
-
- if(!strcmp(rights,"read"))
- newrights=PRSFS_READ | PRSFS_LOOKUP;
- else if(!strcmp(rights,"write"))
- newrights=PRSFS_READ | PRSFS_LOOKUP | PRSFS_INSERT | PRSFS_DELETE |
- PRSFS_DELETE | PRSFS_WRITE | PRSFS_LOCK;
- else if(!strcmp(rights,"mail"))
- newrights=PRSFS_INSERT | PRSFS_LOCK | PRSFS_LOOKUP;
- else if(!strcmp(rights,"all"))
- newrights=PRSFS_READ | PRSFS_LOOKUP | PRSFS_INSERT | PRSFS_DELETE |
- PRSFS_WRITE | PRSFS_LOCK | PRSFS_ADMINISTER;
- else {
- ptr=rights;
- while(*ptr!=0) {
- if(*ptr=='r')
- newrights|=PRSFS_READ;
- if(*ptr=='l')
- newrights|=PRSFS_LOOKUP;
- if(*ptr=='i')
- newrights|=PRSFS_INSERT;
- if(*ptr=='d')
- newrights|=PRSFS_DELETE;
- if(*ptr=='w')
- newrights|=PRSFS_WRITE;
- if(*ptr=='k')
- newrights|=PRSFS_LOCK;
- if(*ptr=='a')
- newrights|=PRSFS_ADMINISTER;
- ptr++;
- }
- }
-
- position=acl->pos;
- for(i=0; i<acl->NumPositiveEntries; i++) {
- if(!strncmp(user, position->name, 100)) {
- position->RightsMask=newrights;
- foundit=1;
- }
- if(position->next)
- position=position->next;
- }
-
- if(!foundit) {
- if (position) {
- position->next=malloc(sizeof(struct AclEntry));
- position=position->next;
- } else {
- acl->pos = malloc(sizeof(struct AclEntry));
- position = acl->pos;
- }
- if(position==NULL) {
- printf("fs: Out of memory\n");
- exit(1);
- }
- acl->NumPositiveEntries++;
-
- position->next=NULL;
- strlcpy(position->name, user, sizeof(position->name));
- position->RightsMask=newrights;
- }
-
- acltext[0] = 0;
- for(position=acl->pos;
- position && acl->NumPositiveEntries;
- position = position->next) {
- if (position->RightsMask) {
- snprintf(tmpstr, sizeof(tmpstr), "%s %d\n",
- position->name, position->RightsMask);
- strlcat(acltext, tmpstr, sizeof(acltext));
- } else
- acl->NumPositiveEntries--;
- }
- for(position=acl->neg;
- position && acl->NumNegativeEntries;
- position = position->next) {
- if (position->RightsMask) {
- snprintf(tmpstr, sizeof(tmpstr), "%s %d\n",
- position->name, position->RightsMask);
- strlcat(acltext, tmpstr, sizeof(acltext));
- } else
- acl->NumNegativeEntries--;
- }
- strlcpy (tmpstr, acltext, sizeof(tmpstr));
- snprintf(acltext, sizeof(acltext), "%d\n%d\n%s",
- acl->NumPositiveEntries, acl->NumNegativeEntries, tmpstr);
-
- a_params.in_size=strlen(acltext);
- a_params.out_size=0;
- a_params.in=acltext;
- a_params.out=0;
-
-
- if(k_pioctl(path,VIOCSETAL,&a_params,1)==-1) {
- fserr(PROGNAME, errno, path);
- return;
- }
-
- /* XXX free(oldacl); and its contents */
-}
-
-int
-setacl_cmd (int argc, char **argv)
-{
- argc--;
- argv++;
-
- if (argc != 3) {
- printf ("fs: setacl: Too many or too few arguments\n");
- return 0;
- }
-
- afs_setacl (argv[0], argv[1], argv[2]);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_setcache.c b/usr.sbin/afs/src/appl/fs/fs_setcache.c
deleted file mode 100644
index 614b47233f5..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_setcache.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_setcache.c,v 1.1 2001/09/24 23:50:20 mattiasa Exp $");
-
-static void
-setcache_usage()
-{
- fprintf(stderr, "Usage: setcachesize <lowvnodes> [<highvnodes> "
- "<lowbytes> <highbytes>]\n");
-
-}
-
-static int
-afs_setcache(int lv, int hv, int lb, int hb)
-{
- int ret;
-
- ret = fs_setcache (lv, hv, lb, hb);
- if (ret)
- fserr(PROGNAME, ret, ".");
- return ret;
-}
-
-int
-setcache_cmd (int argc, char **argv)
-{
- int lv, hv, lb, hb;
-
- argc--;
- argv++;
-
- if (argc != 1 && argc != 4) {
- setcache_usage();
- return 0;
- }
-
- if (argc == 4) {
- if (sscanf(argv[0], "%d", &lv) &&
- sscanf(argv[1], "%d", &hv) &&
- sscanf(argv[2], "%d", &lb) &&
- sscanf(argv[3], "%d", &hb))
- afs_setcache(lv, hv, lb, hb);
- else
- setcache_usage();
- } else {
- if (sscanf(argv[0], "%d", &lv))
- afs_setcache(lv, 0, 0, 0);
- else
- setcache_usage();
- }
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_setcrypt.c b/usr.sbin/afs/src/appl/fs/fs_setcrypt.c
deleted file mode 100644
index 7566ae2db49..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_setcrypt.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_setcrypt.c,v 1.3 2002/09/07 19:22:46 mattiasa Exp $");
-
-static void
-usage()
-{
- fprintf(stderr, "Usage: setcrypt <on|off>\n");
- return;
-}
-
-int
-setcrypt_cmd (int argc, char **argv)
-{
- uint32_t n;
- int ret ;
-
- --argc;
- ++argv;
-
- if (argc != 1) {
- usage();
- return 0;
- }
- if (strcasecmp(argv[0], "on") == 0)
- n = 1;
- else if(strcasecmp(argv[0], "off") == 0)
- n = 0;
- else if(strcasecmp(argv[0], "-help") ==0) {
- usage();
- return 0;
- }
- else {
- printf ("setcrypt: Unknown parameter '%s'\n", argv[0]);
- return 0;
- }
- ret = fs_setcrypt (n);
- if (ret)
- fserr(PROGNAME, ret, NULL);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_setquota.c b/usr.sbin/afs/src/appl/fs/fs_setquota.c
deleted file mode 100644
index 0ee19d82dd2..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_setquota.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_setquota.c,v 1.1 2001/09/24 23:50:21 mattiasa Exp $");
-
-static void
-afs_setmaxquota(char *path, int32_t maxquota)
-{
- struct ViceIoctl a_params;
- struct VolumeStatus *vs;
- int insize;
-
- a_params.in_size=0;
- a_params.out_size=MAXSIZE;
- a_params.in=NULL;
- a_params.out=malloc(MAXSIZE);
-
- if (a_params.out == NULL) {
- printf ("fs: Out of memory\n");
- return;
- }
-
- /* Read the old volume status */
- if(k_pioctl(path,VIOCGETVOLSTAT,&a_params,1)==-1) {
- fserr(PROGNAME, errno, path);
- free(a_params.out);
- return;
- }
-
- insize=sizeof(struct VolumeStatus)+strlen(path)+2;
-
- a_params.in_size=MAXSIZE<insize?MAXSIZE:insize;
- a_params.out_size=0;
- a_params.in=a_params.out;
- a_params.out=NULL;
-
- vs=(struct VolumeStatus *) a_params.in;
- vs->MaxQuota=maxquota;
-
- if(k_pioctl(path,VIOCSETVOLSTAT,&a_params,1)==-1) {
- fserr(PROGNAME, errno, path);
- free(a_params.in);
- return;
- }
-
- free(a_params.in);
-}
-
-int
-setquota_cmd (int argc, char **argv)
-{
- char *path = NULL;
- int quota = 0;
- int helpflag = 0;
- int optind = 0;
-
- struct agetargs sqargs[] = {
- {"path", 0, aarg_string, NULL, "pathname to file/directory",
- "pathname", aarg_mandatory},
- {"max", 0, aarg_integer, NULL, "max quota in kbytes",
- "kbytes", aarg_mandatory},
- {"help", 0, aarg_flag, NULL },
- {NULL, 0, aarg_end, NULL}}, *arg;
-
- arg = sqargs;
- arg->value = &path; arg++;
- arg->value = &quota; arg++;
- arg->value = &helpflag; arg++;
-
- if (agetarg (sqargs, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(sqargs, "fs setquota", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- if (helpflag) {
- aarg_printusage(sqargs, "fs setquota", NULL, AARG_AFSSTYLE);
- return 0;
- }
- argc -= optind;
- argv += optind;
-
- if (argc) {
- printf("unknown option %s\n", *argv);
- return 0;
- }
-
- afs_setmaxquota(path, quota);
-
- return 0;
-}
-
diff --git a/usr.sbin/afs/src/appl/fs/fs_statistics.c b/usr.sbin/afs/src/appl/fs/fs_statistics.c
deleted file mode 100644
index 2276a8cef18..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_statistics.c
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_statistics.c,v 1.7 2002/05/16 22:52:59 lha Exp $");
-
-static void
-printtimeslot(uint32_t slot)
-{
- int v;
-
- v = 1 << slot;
-
- if (v < 1000) {
- printf("%3d us ", v);
- return;
- }
- if (v < 1000000) {
- printf("%3d ms ", v / 1000);
- return;
- }
- printf("%3d s ", v / 1000000);
-}
-
-static void
-printsizeslot(uint32_t slot)
-{
- int v;
-
- v = 1 << slot;
-
- if (v < 1024) {
- printf("%3d ", v);
- return;
- }
- if (v < 1000000) {
- printf("%3d K ", v / 1000);
- return;
- }
- printf("%3d M ", v / 1000000);
-}
-
-static void
-print_stat_header(char *server, char *part,
- int type, int time, int size, int *once)
-{
- if (*once)
- return;
- *once = 1;
- printf("%30s %10s\n", server, part);
-
- if (time)
- printf("%6s ", "tmrng");
-
- if (size)
- printf("%5s ", "szrng");
-
- printf("%6s ", "#req");
-
- printf("%8s ", "tot KB");
- printf("%8s ", "tot us");
- printf("%8s ", "avg us");
- printf("%8s\n", "KB/s");
-}
-
-static void
-print_statistics(int64_t count, int64_t items_total, int64_t total_time,
- int timeslot, int sizeslot, int time, int size)
-{
- if (time)
- printtimeslot(timeslot);
- if (size)
- printsizeslot(sizeslot);
-
- printf("%6lld %8lld %8lld %8lld %8lld\n",
- count, items_total,
- total_time,
- total_time/count,
- items_total*1000LL/total_time);
-}
-
-struct stat_type {
- char *name;
- int value;
-} stat_types[] = {
- { "fetchdata", STATISTICS_REQTYPE_FETCHDATA },
- { "storedata", STATISTICS_REQTYPE_STOREDATA },
- { "fetchstatus", STATISTICS_REQTYPE_FETCHSTATUS },
- { "storestatus", STATISTICS_REQTYPE_STORESTATUS },
- { "bulkstatus", STATISTICS_REQTYPE_BULKSTATUS },
- { NULL, 0 }
-};
-
-static int
-getstatistics_help (struct agetargs *args, int argc, char **argv)
-{
- struct stat_type *t;
-
- aarg_printusage(args, "getstatistics", NULL, AARG_AFSSTYLE);
- fprintf(stderr, "type can be either of: \n");
- for (t = stat_types; t->name != NULL; t++)
- fprintf(stderr, " %s\n", t->name);
- return 0;
-}
-
-int
-getstatistics_cmd (int argc, char **argv)
-{
- uint32_t host[100];
- uint32_t part[100];
- int n = 100;
- int i;
- int j;
- int k;
- char server_name[100];
- char partition_name[100];
- uint32_t count[32];
- int64_t items_total[32];
- int64_t total_time[32];
- int64_t tot_total_time;
- int64_t tot_count;
- int64_t tot_items_total;
- int error;
- int type;
- char *reqtype = NULL;
- char *filter_host = NULL;
- int time = 0, size = 0, help = 0;
- int optind = 0;
- int printed_header = 0;
- struct stat_type *t, *t_best;
-
- struct agetargs statargs[] = {
- {"type", 0, aarg_string,
- NULL, "request type", "type", aarg_mandatory},
- {"host", 0, aarg_string,
- NULL, "host", "hostname", aarg_optional},
- {"time", 0, aarg_flag,
- NULL, "time statistics", NULL},
- {"size", 0, aarg_flag,
- NULL, "size statistics", NULL},
- {"help", 0, aarg_flag,
- NULL, "get help", NULL},
- {NULL, 0, aarg_end, NULL}},
- *arg;
-
- arg = statargs;
- arg->value = &reqtype; arg++;
- arg->value = &filter_host; arg++;
- arg->value = &time; arg++;
- arg->value = &size; arg++;
- arg->value = &help; arg++;
-
-
- if (agetarg (statargs, argc, argv, &optind, AARG_AFSSTYLE))
- return getstatistics_help(statargs, argc, argv);
-
- if (help)
- return getstatistics_help(statargs, argc, argv);
-
- i = strlen(reqtype);
- t_best = NULL;
- for (t = stat_types; t->name != NULL; t++) {
- if (strncmp(reqtype, t->name, i) == 0) {
- if (i == strlen(t->name))
- break;
- if (t_best != NULL) {
- warnx("ambitious type argument");
- return 0;
- }
- t_best = t;
- }
- }
- if (t->name == NULL && t_best != NULL)
- t = t_best;
- if (t->name == NULL) {
- warnx("no type argument");
- return getstatistics_help(statargs, argc, argv);
- }
-
- type = t->value;
-
- error = fs_statistics_list(host, part, &n);
- if (error) {
- fserr(PROGNAME, error, NULL);
- return 0;
- }
-
- for (i = 0; i < n; i++) {
- printed_header = 0;
- arlalib_host_to_name(host[i], server_name, 100);
- if (filter_host && strcmp(filter_host, server_name) != 0)
- continue;
- partition_num2name(part[i], partition_name, 100);
-
- tot_total_time = 0;
- tot_count = 0;
- tot_items_total = 0;
- for (j = 0; j < 32; j++) {
- error = fs_statistics_entry(host[i], part[i], type,
- j, count, items_total, total_time);
- if (error) {
- fserr(PROGNAME, error, NULL);
- return 0;
- }
- if (size) {
- tot_total_time = 0;
- tot_count = 0;
- tot_items_total = 0;
- }
- for (k = 0; k < 32; k++) {
- if (count[k]) {
- if (time && size) {
- print_stat_header(server_name, partition_name,
- type, time, size, &printed_header);
- print_statistics(count[k], items_total[k],
- total_time[k], k, j,
- time, size);
- }
- tot_total_time += total_time[k];
- tot_count += count[k];
- tot_items_total += items_total[k];
- }
- }
- if (!time && size && tot_count) {
- print_stat_header(server_name, partition_name,
- type, time, size, &printed_header);
- print_statistics(tot_count, tot_items_total,
- tot_total_time, 0, j,
- time, size);
- }
- }
- if (!time && !size && tot_count) {
- print_stat_header(server_name, partition_name,
- type, time, size, &printed_header);
- print_statistics(tot_count, tot_items_total,
- tot_total_time, 0, 0,
- time, size);
- }
- }
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_strerror.c b/usr.sbin/afs/src/appl/fs/fs_strerror.c
deleted file mode 100644
index 8e2363a17c7..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_strerror.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_strerror.c,v 1.1 2001/09/24 23:50:22 mattiasa Exp $");
-
-int
-strerror_cmd (int argc, char **argv)
-{
- if (argc == 0) {
- fprintf (stderr, "usage: fs strerror errno ...\n");
- } else {
- int error;
- argv++;
-
- while (--argc) {
- if (sscanf (argv[0], "%d", &error) != 1) {
- fprintf (stderr, "warning: %s isn't a number\n", argv[0]);
- } else {
- printf ("%d => %s\n", error, koerr_gettext(error));
- }
- argv++;
- }
- }
-
- return 0;
-}
-
diff --git a/usr.sbin/afs/src/appl/fs/fs_whereis.c b/usr.sbin/afs/src/appl/fs/fs_whereis.c
deleted file mode 100644
index f196ad132d3..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_whereis.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_whereis.c,v 1.1 2001/09/24 23:50:22 mattiasa Exp $");
-
-static void
-afs_whereis(char *path)
-{
- struct ViceIoctl a_params;
- struct in_addr addr;
- int32_t *curptr;
- int i=0;
-
- a_params.in_size=0;
- a_params.out_size=8*sizeof(int32_t);
- a_params.in=NULL;
- a_params.out=malloc(8*sizeof(int32_t));
-
- if(a_params.out == NULL) {
- printf ("fs: Out of memory\n");
- return;
- }
-
- if(k_pioctl(path,VIOCWHEREIS,&a_params,1)==-1) {
- fserr(PROGNAME, errno, path);
- free(a_params.out);
- return;
- }
-
- curptr=(int32_t *) a_params.out;
- printf("File %s is on host%s", path, curptr[0]&&curptr[1]?"s":"");
-
- while(curptr[i] && i<8) {
- struct hostent *h;
- addr.s_addr = curptr[i];
- h=gethostbyaddr((const char *) &addr, sizeof(addr), AF_INET);
- if (h == NULL)
- printf (" %s", inet_ntoa (addr));
- else {
- printf(" %s", h->h_name);
- }
- i++;
- }
- printf("\n");
- free(a_params.out);
-}
-
-int
-whereis_cmd (int argc, char **argv)
-{
- argc--;
- argv++;
- if (argc == 0)
- afs_whereis (".");
- else
- afs_whereis (argv[0]);
-
- return 0;
-}
-
diff --git a/usr.sbin/afs/src/appl/fs/fs_whichcell.c b/usr.sbin/afs/src/appl/fs/fs_whichcell.c
deleted file mode 100644
index e6aedf0f6d4..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_whichcell.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_whichcell.c,v 1.1 2001/09/24 23:50:23 mattiasa Exp $");
-
-static void
-afs_whichcell (char *path)
-{
- struct ViceIoctl a_params;
-
- a_params.in_size = 0;
- a_params.out_size = MAXSIZE;
- a_params.in = NULL;
- a_params.out = malloc (MAXSIZE);
-
- if (a_params.out == NULL) {
- printf ("fs: Out of memory\n");
- return;
- }
-
- if (k_pioctl (path, VIOC_FILE_CELL_NAME, &a_params, 0) == -1) {
- fserr(PROGNAME, errno, path);
- free(a_params.out);
- return;
- }
-
- printf ("File %s lives in cell '%s'\n", path, a_params.out);
- free (a_params.out);
-}
-
-int
-whichcell_cmd (int argc, char **argv)
-{
- int i;
-
- argc--;
- argv++;
-
- if (argc == 0) {
- afs_whichcell (".");
- }
-
- for (i = 0; i < argc; i++)
- afs_whichcell (argv[i]);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/fs/fs_wscell.c b/usr.sbin/afs/src/appl/fs/fs_wscell.c
deleted file mode 100644
index 6682a59c808..00000000000
--- a/usr.sbin/afs/src/appl/fs/fs_wscell.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fs_local.h"
-
-RCSID("$arla: fs_wscell.c,v 1.1 2001/09/24 23:50:23 mattiasa Exp $");
-
-static void
-afs_wscell (void)
-{
- char buf[2048];
- int ret;
-
- ret = fs_wscell (buf, sizeof(buf));
- if (ret) {
- fserr (PROGNAME, ret, NULL);
- return;
- }
-
- printf ("This workstation belongs to cell '%s'\n", buf);
-}
-
-int
-wscell_cmd (int argc, char **argv)
-{
- argc--;
- argv++;
-
- afs_wscell ();
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/kalog/Makefile.in b/usr.sbin/afs/src/appl/kalog/Makefile.in
deleted file mode 100644
index 972cfd905b0..00000000000
--- a/usr.sbin/afs/src/appl/kalog/Makefile.in
+++ /dev/null
@@ -1,135 +0,0 @@
-# $KTH: Makefile.in,v 1.7.2.1 2001/05/28 11:32:13 mattiasa Exp $
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-LN_S = @LN_S@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-mandir = @mandir@
-transform = @program_transform_name@
-EXECSUFFIX = @EXECSUFFIX@
-
-APPL_BIN = kalog
-MANPAGES = kalog.1
-
-DEFS = @DEFS@
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-X_CFLAGS = @X_CFLAGS@
-
-ETAGS = etags
-MAKEDEPEND = makedepend
-RXKADINC = -I$(srcdir)/../../rxkad
-INCLUDES = -I$(srcdir)/../.. \
- -I$(srcdir)/../../include \
- -I$(srcdir)/../lib \
- -I../../include \
- -I../../rxdef \
- -I. \
- $(KERNEL_INCLUDE) \
- -I$(srcdir)/../../xfs/include \
- -I$(srcdir)/../../arlad \
- @INC_roken@ \
- $(RXKADINC)
-
-DEFINES =
-REALCFLAGS = $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) \
- $(X_CFLAGS) @PLWP_INC_FLAGS@
-RXKAD_LIBS = @MILKO_RXKAD_LIBS@
-KERNEL_INCLUDE = @KERNEL_INCLUDE@
-READLINE_lib = @LIB_readline@
-KAFS_LIBS = @AIX_EXTRA_KAFS@ @KAFS_LIBS@
-LIB_tgetent = @LIB_tgetent@
-LIBS = -L../lib -larlalib \
- -L../../rxdef -lkaclient -lrxdefclient \
- -L../../rx -lrx \
- -L../../lwp -llwp @PLWP_LIB_FLAGS@ \
- -L../../lib/ko -lko -L../../util -lutil \
- @LIB_roken@ \
- $(RXKAD_LIBS) \
- $(KAFS_LIBS) \
- $(RXKAD_LIBS) @LIBS@
-
-LIBDEPENDS = ../../rxdef/librxdefclient.a ../../rx/librx.a ../../lwp/liblwp.a \
- ../../util/libutil.a ../../lib/sl/libsl.a \
- ../../lib/ko/libko.a ../lib/libarlalib.a
-
-PROGS = kalog
-kalog_SRCS = kalog.c
-SRCS = $(fs_SRCS)
-kalog_OBJS = kalog.o
-HDRS =
-
-all: $(PROGS)
-
-.PHONY: all install uninstall depend tags clean
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(bindir)/$$f; \
- done ;\
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir) ; \
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$$e ; \
- $(INSTALL_DATA) $(srcdir)/$$x \
- $(DESTDIR)$(mandir)/man$$e/$$f.$$e; \
- done
-
-uninstall:
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
- done ; \
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- rm -rf $(DESTDIR)$(mandir)/$$f.$$e; \
- done
-
-kalog: $(kalog_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(kalog_OBJS) $(LIBS)
-
-Makefile: Makefile.in ../../config.status
- cd ../..; CONFIG_FILES=appl/kalog/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(CFILES)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(PROGS) $(OBJS) *~ *.o core *.core
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/appl/kalog/kalog.1 b/usr.sbin/afs/src/appl/kalog/kalog.1
deleted file mode 100644
index 613f6ff9976..00000000000
--- a/usr.sbin/afs/src/appl/kalog/kalog.1
+++ /dev/null
@@ -1,57 +0,0 @@
-.\" Copyright (c) 2000 Kungliga Tekniska Högskolan
-.\" (Royal Institute of Technology, Stockholm, Sweden).
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" 3. Neither the name of the Institute nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $arla: kalog.1,v 1.4 2003/04/01 14:07:21 lha Exp $
-.\"
-.Dd April 1, 2003
-.Dt KALOG 1
-.Os "The Arla Project"
-.Sh NAME
-.Nm kalog
-.Nd
-A program to get AFS tokens from a ka-server
-.Sh SYNOPSIS
-.Nm
-.Op user@cell
-.Sh DESCRIPTION
-.Nm
-fetches AFS-tokens for the
-.Ar user
-in
-.Ar cell .
-.Pp
-It uses the ka-protocol to fetch the tokens, not the kerberos protocol.
-.Sh SEE ALSO
-.Xr aklog 1 ,
-.Xr kf 1 ,
-.Xr kinit 1 ,
-.Xr tokens 1 ,
-.Xr unlog 1
diff --git a/usr.sbin/afs/src/appl/kalog/kalog.c b/usr.sbin/afs/src/appl/kalog/kalog.c
deleted file mode 100644
index 3b659ccd348..00000000000
--- a/usr.sbin/afs/src/appl/kalog/kalog.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-RCSID("$arla: kalog.c,v 1.8 2003/01/17 03:30:21 lha Exp $");
-
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <assert.h>
-
-#include <ko.h>
-#include <ports.h>
-#include <log.h>
-
-#include <arlalib.h>
-
-#include <ka.cs.h>
-#ifdef HAVE_OPENSSL
-#include <openssl/des.h>
-#else
-#include <des.h>
-#endif
-#include <krb.h>
-
-#include <ka-procs.h>
-
-#include <roken.h>
-#include <err.h>
-
-#include <vers.h>
-
-static void
-parse_user (char *argv1, const char **user, const char **cell)
-{
- char *at = strchr(argv1, '@');
- char *tmp_cell;
-
- if(at) {
- *at = '\0';
-
- *user = argv1;
- at++;
- tmp_cell = at;
-
- if(*tmp_cell != '\0')
- *cell = tmp_cell;
- } else {
- *user = argv1;
- }
-
-}
-
-int
-main (int argc, char **argv)
-{
- int ret;
- Log_method *method;
- const char *cellname;
- const char *user;
-
- set_progname (argv[0]);
- tzset();
-
- method = log_open (getprogname(), "/dev/stderr:notime");
- if (method == NULL)
- errx (1, "log_open failed");
- cell_init(0, method);
- ports_init();
-
- cellname = cell_getthiscell();
-
- if (argc == 1)
- user = get_default_username();
- else if (strcmp("-version", argv[1]) == 0) {
- print_version(NULL);
- return 0;
- } else if (argc == 2)
- parse_user (argv[1], &user, &cellname);
- else {
- fprintf (stderr, "usage: %s [-version] [username[@cell]]\n",
- getprogname());
- exit (1);
- }
-
- printf ("Getting ticket for %s@%s\n", user, cellname);
- ret = ka_authenticate (user, "", cellname, NULL, 8 * 3600,
- KA_AUTH_TICKET|KA_AUTH_TOKEN);
- if (ret)
- errx (1, "ka_authenticate failed with %s (%d)",
- koerr_gettext(ret), ret);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/lib/Makefile.in b/usr.sbin/afs/src/appl/lib/Makefile.in
deleted file mode 100644
index 2f3d15adc0c..00000000000
--- a/usr.sbin/afs/src/appl/lib/Makefile.in
+++ /dev/null
@@ -1,119 +0,0 @@
-#
-# $KTH: Makefile.in,v 1.13 2001/01/07 13:09:00 lha Exp $
-#
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-INCLUDES = -I. \
- -I$(srcdir) \
- -I../../include \
- -I$(srcdir)/../../include \
- -I../.. -I$(srcdir)/../.. \
- -I../../rxdef \
- -I$(srcdir)/../../arlad \
- -I$(srcdir)/../../xfs/include \
- @INC_roken@ \
- @KRB4_INC_FLAGS@ \
-
-CFLAGS = @CFLAGS@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-LN_S = @LN_S@
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-includedir = @includedir@
-libdir = @libdir@
-sysconfdir = @sysconfdir@
-ARLACACHEDIR = @ARLACACHEDIR@
-ARLACONFFILE = @ARLACONFFILE@
-
-target_os = @target_os@
-target_vendor = @target_vendor@
-target_cpu = @target_cpu@
-
-#PICFLAGS = @PICFLAGS@
-
-LIBNAME = $(LIBPREFIX)arlalib
-#LIBEXT = @LIBEXT@
-LIBEXT = a
-#SHLIBEXT = @SHLIBEXT@
-#LIBPREFIX = @LIBPREFIX@
-LIBPREFIX = lib
-#LDSHARED = @LDSHARED@
-LIB = $(LIBNAME).$(LIBEXT)
-
-DEFS = @DEFS@
-
-LIB_SOURCES = arlalib.c fs_lib.c ka-procs.c tokens.c
-
-SOURCES = $(LIB_SOURCES)
-
-HEADERS = arlalib.h ka-procs.h
-
-LIB_OBJECTS = arlalib.o fs_lib.o ka-procs.o tokens.o
-
-OBJECTS = $(LIB_OBJECTS)
-
-all: $(LIB)
-
-Wall:
- make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS) $(PICFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
- $(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/$(LIB)
- for i in $(HEADERS); do \
- $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/$$i; \
- done
-
-uninstall:
- rm -f $(DESTDIR)$(libdir)/$(LIB)
- for i in $(HEADERS); do \
- rm -f $(DESTDIR)$(includedir)/$$i; \
- done
-
-TAGS: $(SOURCES)
- etags $(SOURCES)
-
-check:
-
-clean:
- rm -f $(LIB) $(PROGS) *.o *.a
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *~
-
-realclean: distclean
- rm -f TAGS
-
-$(LIBNAME).a: $(LIB_OBJECTS)
- rm -f $@
- $(AR) cr $@ $(LIB_OBJECTS)
- -$(RANLIB) $@
-
-#$(LIBNAME).$(SHLIBEXT): $(LIB_OBJECTS)
-# rm -f $@
-# $(LDSHARED) -o $@ $(LIB_OBJECTS)
-
-$(OBJECTS): ../../include/config.h
-
-Makefile: Makefile.in ../../config.status
- cd ../..; CONFIG_FILES=appl/lib/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-
-.PHONY: all install uninstall check clean mostlyclean distclean realclean
diff --git a/usr.sbin/afs/src/appl/lib/appl_locl.h b/usr.sbin/afs/src/appl/lib/appl_locl.h
deleted file mode 100644
index ae86a8687ee..00000000000
--- a/usr.sbin/afs/src/appl/lib/appl_locl.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: appl_locl.h,v 1.36 2003/06/12 05:23:52 lha Exp $ */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <time.h>
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_SYS_IOCCOM_H
-#include <sys/ioccom.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
-#include <atypes.h>
-#include <roken.h>
-#include <agetarg.h>
-#include <err.h>
-
-#include <assert.h>
-
-#include <cb.h>
-#include <time.h>
-#include <lock.h>
-#include <ctype.h>
-#include <rx/rx.h>
-#include <rx/rx_null.h>
-#include <rx/rxgencon.h>
-#ifdef HAVE_KRB5
-#include <krb5.h>
-#endif /* HAVE_KRB5 */
-#ifdef HAVE_OPENSSL
-#include <openssl/des.h>
-#else
-#include <des.h>
-#endif /* HAVE_OPENSSL */
-#ifdef HAVE_KRB4
-#include <krb.h>
-#endif /* HAVE_KRB4 */
-#include <rxkad.h>
-#include <kafs.h>
-#ifdef HAVE_STDS_H
-#include <stds.h>
-#endif
-
-#include "arlalib.h"
-
-#include <service.h>
-#include <ports.h>
-#include <volumeserver.h>
-#include <volumeserver.cs.h>
-#include <vldb.h>
-#include <vldb.cs.h>
-#include <fs.h>
-#include <fs.cs.h>
-#include <ubik.h>
-#include <ubik.cs.h>
-#include <pts.h>
-#include <pts.cs.h>
-
-#include <ko.h>
-#include <part.h>
-
-#include <parse_time.h>
-
-
-
-
diff --git a/usr.sbin/afs/src/appl/lib/arlalib.c b/usr.sbin/afs/src/appl/lib/arlalib.c
deleted file mode 100644
index 0ce533265ff..00000000000
--- a/usr.sbin/afs/src/appl/lib/arlalib.c
+++ /dev/null
@@ -1,964 +0,0 @@
-/*
- * Copyright (c) 1995 - 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-
-RCSID("$arla: arlalib.c,v 1.60 2003/06/12 05:29:15 lha Exp $");
-
-#ifdef HAVE_KRB4
-
-static int
-get_cred(const char *princ, const char *inst, const char *krealm,
- struct ClearToken *ct, char *ticket, size_t ticket_len,
- size_t *ticket_len_out)
-{
- CREDENTIALS c;
- int kret;
-
- kret = krb_get_cred((char*)princ, (char*)inst, (char*)krealm, &c);
-
- if(kret != KSUCCESS) {
- KTEXT_ST foo;
- kret = krb_mk_req(&foo, (char*)princ, (char*)inst, (char*)krealm, 0);
- if (kret == KSUCCESS)
- kret = krb_get_cred((char*)princ, (char*)inst, (char*)krealm, &c);
- }
- if (kret == KSUCCESS) {
- ct->AuthHandle = c.kvno;
- memcpy(ct->HandShakeKey, c.session, sizeof(ct->HandShakeKey));
- ct->BeginTimestamp = c.issue_date;
- ct->EndTimestamp = krb_life_to_time(c.issue_date, c.lifetime);
- ct->ViceId = getuid();
-
- if (ticket_len <= c.ticket_st.length)
- return EINVAL;
- *ticket_len_out = c.ticket_st.length;
- memcpy(ticket, c.ticket_st.dat, c.ticket_st.length);
- }
-
- return kret;
-}
-#endif /* HAVE_KRB4 */
-
-#ifdef HAVE_KRB5
-
-#ifndef HAVE_KRB4
-
-/* v4 glue */
-
-#define MAX_KTXT_LEN 1250
-
-#define ANAME_SZ 40
-#define REALM_SZ 40
-#define SNAME_SZ 40
-#define INST_SZ 40
-
-struct ktext {
- unsigned int length; /* Length of the text */
- unsigned char dat[MAX_KTXT_LEN]; /* The data itself */
- u_int32_t mbz; /* zero to catch runaway strings */
-};
-
-struct credentials {
- char service[ANAME_SZ]; /* Service name */
- char instance[INST_SZ]; /* Instance */
- char realm[REALM_SZ]; /* Auth domain */
- des_cblock session; /* Session key */
- int lifetime; /* Lifetime */
- int kvno; /* Key version number */
- struct ktext ticket_st; /* The ticket itself */
- int32_t issue_date; /* The issue time */
- char pname[ANAME_SZ]; /* Principal's name */
- char pinst[INST_SZ]; /* Principal's instance */
-};
-
-typedef struct credentials CREDENTIALS;
-
-#define TKTLIFENUMFIXED 64
-#define TKTLIFEMINFIXED 0x80
-#define TKTLIFEMAXFIXED 0xBF
-#define TKTLIFENOEXPIRE 0xFF
-#define MAXTKTLIFETIME (30*24*3600) /* 30 days */
-#ifndef NEVERDATE
-#define NEVERDATE ((time_t)0x7fffffffL)
-#endif
-
-static const int _tkt_lifetimes[TKTLIFENUMFIXED] = {
- 38400, 41055, 43894, 46929, 50174, 53643, 57352, 61318,
- 65558, 70091, 74937, 80119, 85658, 91581, 97914, 104684,
- 111922, 119661, 127935, 136781, 146239, 156350, 167161, 178720,
- 191077, 204289, 218415, 233517, 249664, 266926, 285383, 305116,
- 326213, 348769, 372885, 398668, 426234, 455705, 487215, 520904,
- 556921, 595430, 636601, 680618, 727680, 777995, 831789, 889303,
- 950794, 1016537, 1086825, 1161973, 1242318, 1328218, 1420057, 1518247,
- 1623226, 1735464, 1855462, 1983758, 2120925, 2267576, 2424367, 2592000
-};
-
-static time_t
-_arla_krb_life_to_time(int start, int life_)
-{
- unsigned char life = (unsigned char) life_;
-
- if (life == TKTLIFENOEXPIRE)
- return NEVERDATE;
- if (life < TKTLIFEMINFIXED)
- return start + life*5*60;
- if (life > TKTLIFEMAXFIXED)
- return start + MAXTKTLIFETIME;
- return start + _tkt_lifetimes[life - TKTLIFEMINFIXED];
-}
-
-#define krb_life_to_time _arla_krb_life_to_time
-
-
-#endif
-
-/*
- *
- */
-
-static int
-v4_to_kt(CREDENTIALS *c, struct ClearToken *ct,
- char *ticket, size_t ticket_len, size_t *ticket_len_out)
-{
- if (c->ticket_st.length > ticket_len)
- return EINVAL;
-
- *ticket_len_out = c->ticket_st.length;
- memcpy(ticket, c->ticket_st.dat, c->ticket_st.length);
-
- /*
- * Build a struct ClearToken
- */
- ct->AuthHandle = c->kvno;
- memcpy (ct->HandShakeKey, c->session, sizeof(c->session));
- ct->ViceId = getuid();
- ct->BeginTimestamp = c->issue_date;
- ct->EndTimestamp = krb_life_to_time(c->issue_date, c->lifetime);
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-get_cred5(const char *princ, const char *inst, const char *krealm,
- struct ClearToken *ct, char *ticket,
- size_t ticket_len, size_t *ticket_len_out)
-{
- krb5_context context = NULL;
- krb5_error_code ret;
- krb5_creds in_creds, *out_creds;
- krb5_ccache id = NULL;
- CREDENTIALS cred4;
-
- ret = krb5_init_context(&context);
- if (ret)
- return ret;
-
- ret = krb5_cc_default(context, &id);
- if (ret)
- goto out;
-
- memset(&in_creds, 0, sizeof(in_creds));
- ret = krb5_425_conv_principal(context, princ, inst, krealm,
- &in_creds.server);
- if(ret)
- goto out;
-
- ret = krb5_cc_get_principal(context, id, &in_creds.client);
- if(ret){
- krb5_free_principal(context, in_creds.server);
- goto out;
- }
- in_creds.session.keytype = KEYTYPE_DES;
- ret = krb5_get_credentials(context, 0, id, &in_creds, &out_creds);
- krb5_free_principal(context, in_creds.server);
- krb5_free_principal(context, in_creds.client);
- if(ret)
- goto out;
-
- ret = krb524_convert_creds_kdc_ccache(context, id, out_creds, &cred4);
- krb5_free_creds(context, out_creds);
- if (ret)
- goto out;
-
- ret = v4_to_kt(&cred4, ct, ticket, ticket_len, ticket_len_out);
-
- out:
- if (id)
- krb5_cc_close(context, id);
- if (context)
- krb5_free_context(context);
-
- return ret;
-}
-
-#endif /* HAVE_KRB5 */
-
-static int
-arlalib_get_cred_krb (const char *cell, const char *host,
- struct ClearToken *ct,
- unsigned char *ticket,
- size_t ticket_len,
- size_t *ticket_len_out,
- arlalib_authflags_t auth)
-{
- char krealm[REALM_SZ];
-#ifdef HAVE_KRB4
- char *rrealm;
-#endif
- int ret;
-
- memset(ct, 0, sizeof(*ct));
-
-
-#ifdef HAVE_KRB4
- if (auth & AUTHFLAGS_LOCALAUTH) {
- des_cblock key, session;
- KTEXT_ST kticket;
- char kcell[REALM_SZ];
- time_t t;
-
- rrealm = krb_realmofhost(host);
- strlcpy(krealm, rrealm, sizeof(krealm));
- strlcpy(kcell, cell, sizeof(kcell));
-
- ret = srvtab_to_key("afs", kcell, krealm,
- SYSCONFDIR "/srvtab", &key);
-
- if (ret && strcasecmp(krealm, kcell) == 0) {
-
- ret = srvtab_to_key("afs", "", krealm,
- SYSCONFDIR "/srvtab", &key);
- }
-
- if (ret)
- return ret;
-
- des_random_key(&session);
-
- t = time(NULL);
-
- ret = krb_create_ticket(&kticket, 0,
- "afs", "", krealm,
- 0 /* XXX flags */, session,
- 0xFF, t, "afs", "", &key);
- if (ret)
- return ret;
-
- if (kticket.length >= ticket_len)
- errx(-1, "kticket length >= ticket_len");
-
- ct->ViceId = getuid();
- ct->AuthHandle = 0;
- memcpy(ct->HandShakeKey, &session, sizeof(ct->HandShakeKey));
- ct->BeginTimestamp = t;
- ct->EndTimestamp = t + 3600 * 10;
-
- memcpy(ticket, kticket.dat, kticket.length);
- *ticket_len_out = kticket.length;
-
- return 0;
- }
-#endif
-
- if (auth & (AUTHFLAGS_TICKET|AUTHFLAGS_ANY)) {
-
- if(cell) {
- strlcpy(krealm, cell, REALM_SZ);
- strupr(krealm);
-
-#ifdef HAVE_KRB5
- ret = get_cred5("afs", "", krealm, ct, ticket, ticket_len,
- ticket_len_out);
- if (ret == 0)
- return 0;
-#endif
-#ifdef HAVE_KRB4
- ret = get_cred("afs", "", krealm, ct, ticket, ticket_len,
- ticket_len_out);
- if (ret == KSUCCESS)
- return ret;
-#endif
- }
-
-#ifdef HAVE_KRB5
- ret = get_cred5("afs", cell ? cell : "", krealm,
- ct, ticket, ticket_len, ticket_len_out);
- if (ret == 0)
- return ret;
- else {
- ret = get_cred5("afs", "", krealm,
- ct, ticket, ticket_len, ticket_len_out);
- if (ret == 0)
- return ret;
- }
-
-#endif
-#ifdef HAVE_KRB4
- rrealm = krb_realmofhost(host);
- strlcpy(krealm, rrealm, REALM_SZ);
-
- ret = get_cred("afs", cell ? cell : "", krealm,
- ct, ticket, ticket_len, ticket_len_out);
- if (ret != KSUCCESS)
- ret = get_cred("afs", "", krealm,
- ct, ticket, ticket_len, ticket_len_out);
- if (ret == KSUCCESS)
- return ret;
-#endif
- }
-
- ret = EINVAL;
-
- return ret;
-}
-
-struct find_token_arg {
- struct ClearToken *ct;
- char *ticket;
- size_t ticket_len;
-};
-
-static int
-find_token (const char *secret, size_t secret_sz,
- const struct ClearToken *ct,
- const char *cell, void *arg)
-{
- struct find_token_arg *c = (struct find_token_arg *)arg;
-
- if (c->ticket_len <= secret_sz)
- return EINVAL;
- memcpy(c->ticket, secret, secret_sz) ;
- c->ticket_len = secret_sz;
- *c->ct = *ct;
-
- return 0;
-}
-
-static int
-arlalib_get_cred_afs (const char *cell,
- struct ClearToken *ct,
- unsigned char *ticket,
- size_t ticket_len,
- size_t *ticket_len_out,
- arlalib_authflags_t auth)
-{
- struct find_token_arg c;
- int ret;
-
- c.ct = ct;
- c.ticket = ticket;
- c.ticket_len = ticket_len;
-
- if (cell == NULL)
- cell = cell_getthiscell();
-
- ret = arlalib_token_iter (cell, find_token, &c);
- *ticket_len_out = c.ticket_len;
-
- return ret;
-}
-
-
-int
-arlalib_getservername(uint32_t serverNumber, char **servername)
-{
- struct hostent *he;
-
- he = gethostbyaddr((char*) &serverNumber, sizeof(serverNumber), AF_INET);
-
- if (he != NULL)
- *servername = strdup(he->h_name);
- else {
- struct in_addr addr;
- addr.s_addr = serverNumber;
-
- *servername = strdup(inet_ntoa(addr));
- }
-
- return (*servername == NULL);
-}
-
-
-struct rx_securityClass*
-arlalib_getsecurecontext(const char *cell, const char *host,
- arlalib_authflags_t auth, int *secidx)
-{
- struct rx_securityClass* sec = NULL;
-
- if (auth) {
- int ret;
- struct ClearToken ct;
- char ticket[MAXKRB4TICKETLEN];
- size_t ticket_len, ticket_len_out;
-
- ticket_len = sizeof(ticket);
-
- ret = arlalib_get_cred_krb (cell, host, &ct,
- ticket,
- ticket_len, &ticket_len_out,
- auth);
- if (ret)
- ret = arlalib_get_cred_afs (cell, &ct,
- ticket,
- ticket_len,
- &ticket_len_out,
- auth);
-
- if (ret == 0) {
- sec = rxkad_NewClientSecurityObject(rxkad_auth,
- ct.HandShakeKey,
- ct.AuthHandle,
- ticket_len,
- ticket);
- *secidx = 2;
- } else {
- fprintf(stderr, "Can't get a token for cell %s\n",
- cell ? cell : cell_getthiscell());
- }
- }
-
- if (sec == NULL) {
- sec = rxnull_NewClientSecurityObject();
- *secidx = 0;
- }
-
- return sec;
-}
-
-
-struct rx_connection *
-arlalib_getconnbyaddr(const char *cell, int32_t addr,
- const char *host, int32_t port, int32_t servid,
- arlalib_authflags_t auth)
-{
- struct rx_securityClass *secobj;
- struct rx_connection *conn;
- char *serv = NULL;
- int secidx;
-
- rx_Init(0);
-
- if (host == NULL) {
- arlalib_getservername(addr, &serv);
- host = serv;
- }
-
- if ((secobj = arlalib_getsecurecontext(cell, host, auth, &secidx)) == NULL)
- return NULL;
-
- conn = rx_NewConnection (addr, htons (port), servid,
- secobj, secidx);
-
- if (conn == NULL)
- fprintf (stderr, "Cannot start rx-connection, something is WRONG\n");
-
- if (serv)
- free(serv);
-
- return conn;
-}
-
-struct rx_connection *
-arlalib_getconnbyname(const char *cell, const char *host,
- int32_t port, int32_t servid,
- arlalib_authflags_t auth)
-{
- struct addrinfo hints, *res;
- int error;
- int32_t addr;
-
- memset (&hints, 0, sizeof(hints));
- hints.ai_family = PF_INET;
- hints.ai_socktype = SOCK_DGRAM;
-
- error = getaddrinfo(host, NULL, &hints, &res);
- if (error) {
- fprintf (stderr, "Cannot find host %s\n", host);
- return NULL;
- }
-
- assert (res->ai_family == PF_INET);
- addr = ((struct sockaddr_in *)res->ai_addr)->sin_addr.s_addr;
- freeaddrinfo(res);
-
- return arlalib_getconnbyaddr(cell, addr, host, port, servid, auth);
-}
-
-int
-arlalib_destroyconn(struct rx_connection *conn)
-{
- if (conn == NULL)
- return 0 ;
-
- rx_DestroyConnection(conn);
- return 0;
-}
-
-/*
- * arlalib_getsyncsite
- *
- * if cell and host is NULL, local cell is assumed and a local dbserver is used
- * if cell is NULL and host not, cell is figured out
- * (if that fail, localcell is assumed)
- * if cell is set but not host, host is found i CellServerDB or DNS
- *
- *
- * RETURNS: 0 is ok, otherwise an error that should be handled to
- * koerr_gettext()
- */
-
-int
-arlalib_getsyncsite(const char *cell, const char *host, int32_t port,
- uint32_t *synchost, arlalib_authflags_t auth)
-{
- struct rx_connection *conn;
- ubik_debug db;
- int error;
-
- if (synchost == NULL)
- return EINVAL;
-
- if (cell == NULL && host != NULL)
- cell = cell_getcellbyhost(host);
- if (cell == NULL) {
- cell = cell_getthiscell();
- if (cell == NULL)
- return ENOENT;
- }
- if (host == NULL) {
- host = cell_findnamedbbyname (cell);
- if (host == NULL)
- return ENOENT;
- }
-
- conn = arlalib_getconnbyname(cell,
- host,
- port,
- VOTE_SERVICE_ID,
- auth);
-
- if (conn == NULL)
- return ENETDOWN;
-
- error = Ubik_Debug(conn, &db);
- if (!error) {
- if (db.amSyncSite)
- *synchost = rx_HostOf(rx_PeerOf(conn));
- else
- *synchost = htonl(db.syncHost);
- }
- arlalib_destroyconn(conn);
-
- return error;
-}
-
-
-/*
- * get a arlalib_authflags_t type
- */
-
-arlalib_authflags_t
-arlalib_getauthflag (int noauth,
- int localauth,
- int ticket,
- int token)
-{
- arlalib_authflags_t ret = AUTHFLAGS_ANY;
-
- if (noauth)
- ret = AUTHFLAGS_NOAUTH;
- if (localauth)
- ret |= AUTHFLAGS_LOCALAUTH;
- if (ticket)
- ret |= AUTHFLAGS_TICKET;
- if (token)
- ret |= AUTHFLAGS_TOKEN;
-
- return ret;
-}
-
-
-/*
- * set `viceId' to the(a) id for username@cellname
- * return 0 or error
- */
-
-int
-arlalib_get_viceid (const char *username, const char *cellname,
- int32_t *viceId)
-{
- const cell_db_entry *db_entry;
- int32_t cell;
- int num;
- const char **servers;
- int i;
- int ret;
-
- cell = cell_name2num (cellname);
- if (cell == -1)
- return -1;
-
- db_entry = cell_dbservers_by_id (cell, &num);
- if (NULL)
- return -1;
-
- servers = malloc (num * sizeof(*servers));
- if (servers == NULL)
- return -1;
-
- for (i = 0; i < num; ++i)
- servers[i] = db_entry[i].name;
-
- ret = arlalib_get_viceid_servers (username, cellname,
- num, servers, viceId);
- free (servers);
- return ret;
-}
-
-/*
- * * set `viceId' to the(a) id for username@cellname
- * use nservers, servers to query for pt database.
- * return 0 or error
- */
-
-int
-arlalib_get_viceid_servers (const char *username, const char *cellname,
- int nservers, const char *servers[],
- int32_t *viceId)
-{
- int i=0;
- int32_t returned_id;
- int32_t res;
-
-/* FIXME: Should we use authorization when connecting to the dbserver?
- noauth=0 sometimes gives warnings, e.g. if the realm name is
- not the same as the name of the cell...
-*/
- int noauth = 1;
-
- struct rx_connection *connptdb = NULL;
- namelist nlist;
- idlist ilist;
- prname pr_name_buf;
-
- /* set up necessary crap to use PR_NameToID */
- nlist.len = 1;
- nlist.val = &pr_name_buf;
-
- ilist.len = 1;
- ilist.val = &returned_id;
-
- strlcpy (pr_name_buf, username, sizeof(pr_name_buf));
-
- /* try all known servers :) */
- for (i = 0; i < nservers; i++) {
- connptdb = arlalib_getconnbyname(cellname,
- servers[i],
- afsprport,
- PR_SERVICE_ID,
- arlalib_getauthflag (noauth, 0,
- 0, 0));
- if (connptdb == NULL)
- return ENETDOWN;
- }
-
- if (connptdb) {
- res = PR_NameToID(connptdb, &nlist, &ilist);
-
- arlalib_destroyconn(connptdb);
-
- if (res == 0) {
- *viceId = ilist.val[0];
- return 0;
- }
- } else
- res = ENETDOWN;
-
- return res;
-}
-
-/*
- * try to come with a reasonable uid to use for tokens
- */
-
-static void
-fallback_vice_id (const char *username, const char *cellname,
- int32_t *token_id)
-{
- struct passwd *pwd;
-
- pwd = getpwnam(username);
- if(pwd == NULL) {
- *token_id = getuid();
- warnx ("Couldn't get AFS ID for %s@%s, using current UID (%d)",
- username, cellname, (int)*token_id);
- } else {
- *token_id = pwd->pw_uid;
- warnx ("Couldn't get AFS ID for %s@%s, using %d from /etc/passwd",
- username, cellname, (int)*token_id);
- }
-}
-
-/*
- * Come with a number to use in a token for for username@cellname
- * in token_id
- */
-
-int
-arlalib_get_token_id (const char *username, const char *cellname,
- int32_t *token_id)
-{
- int ret;
-
- ret = arlalib_get_viceid (username, cellname, token_id);
- if (ret == 0)
- return ret;
-
- fallback_vice_id (username, cellname, token_id);
- return 0;
-}
-
-/*
- * Come with a number to use in a token for for username@cellname
- * in token_id
- * use nservers, servers for querying
- */
-
-int
-arlalib_get_token_id_servers (const char *username, const char *cellname,
- int nservers, const char *servers[],
- int32_t *token_id)
-{
- int ret;
-
- ret = arlalib_get_viceid_servers (username, cellname,
- nservers, servers, token_id);
- if (ret == 0)
- return ret;
-
- fallback_vice_id (username, cellname, token_id);
- return 0;
-}
-
-/*
- * Initialize `context' for a db connection to cell `cell', looping
- * over all db servers if `host' == NULL, and else just try that host.
- * `port', `serv_id', and `auth' specify where and how the connection works.
- * Return a rx connection or NULL
- */
-
-struct rx_connection *
-arlalib_first_db(struct db_server_context *context,
- const char *cell,
- const char *host,
- int port,
- int serv_id,
- arlalib_authflags_t auth)
-{
- const cell_entry *c_entry;
- int i;
-
- if (cell == NULL) {
- cell = cell_getthiscell();
- if (cell == NULL)
- return NULL;
- }
-
- /* Set struct values from args */
- context->cell = cell;
- context->port = port;
- context->serv_id = serv_id;
- context->auth = auth;
-
- if (host != NULL) {
- context->nhosts = 1;
- context->hosts = malloc (sizeof (char *));
- if (context->hosts == NULL)
- return NULL;
- context->hosts[0] = host;
- } else {
- /* Calculate missing context values */
- c_entry = cell_get_by_name(cell);
- if (c_entry == NULL) {
- warn("Cannot find cell %s", cell);
- return NULL;
- }
- if (c_entry->ndbservers == 0) {
- warn("No DB servers for cell %s", cell);
- return NULL;
- }
- context->nhosts = c_entry->ndbservers;
- context->hosts = malloc(context->nhosts * sizeof(char *));
- if (context->hosts == NULL)
- return NULL;
- for(i = 0; i < context->nhosts; i++)
- context->hosts[i] = c_entry->dbservers[i].name;
- }
-
- /* Try to get connection handles until we have one */
- context->conn = malloc(context->nhosts * sizeof(struct rx_connection*));
- if (context->conn == NULL) {
- free (context->hosts);
- return NULL;
- }
- for (i = 0; i < context->nhosts; ++i)
- context->conn[i] = NULL;
-
- context->curhost = -1;
- return arlalib_next_db(context);
-}
-
-/*
- * Return next connection from `context' or NULL.
- */
-
-struct rx_connection*
-arlalib_next_db(struct db_server_context *context)
-{
- int i;
-
- for(i = context->curhost + 1; i < context->nhosts; i++) {
- context->curhost = i;
- context->conn[i] = arlalib_getconnbyname(context->cell,
- context->hosts[i],
- context->port,
- context->serv_id,
- context->auth);
- if(context->conn[i] != NULL)
- return context->conn[i];
- }
- return NULL;
-}
-
-/*
- * return TRUE iff error makes it worthwhile to try the next db.
- */
-
-int
-arlalib_try_next_db (int error)
-{
- switch (error) {
- case ARLA_CALL_DEAD:
- case UNOTSYNC :
- case ENETDOWN :
- return TRUE;
- case 0 :
- default :
- return FALSE;
- }
-}
-
-/*
- * free all memory associated with `context'
- */
-
-void
-free_db_server_context(struct db_server_context *context)
-{
- int i;
-
- for (i = 0; i < context->nhosts; i++) {
- if (context->conn[i] != NULL)
- arlalib_destroyconn(context->conn[i]);
- }
- free(context->hosts);
- free(context->conn);
-}
-
-/*
- * give a name for the server `addr'
- */
-
-void
-arlalib_host_to_name (uint32_t addr, char *str, size_t str_sz)
-{
- struct sockaddr_in sock;
- int error;
-
- memset (&sock, 0, sizeof(sock));
-#if HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
- sock.sin_len = sizeof(sock);
-#endif
- sock.sin_family = AF_INET;
- sock.sin_port = 0;
- sock.sin_addr.s_addr = addr;
-
- error = getnameinfo((struct sockaddr *)&sock, sizeof(sock),
- str, str_sz, NULL, 0, 0);
- if (error)
- strlcpy (str, "<unknown>", str_sz);
-}
-
-/*
- * give an address for the server 'srv'
- */
-int
-arlalib_name_to_host (const char *str, uint32_t *addr)
-{
-
- struct addrinfo *addr_info, *p;
- struct sockaddr_in *sin;
- int error;
-
- error = getaddrinfo(str, NULL, NULL, &addr_info);
- if(error)
- return error;
-
- p = addr_info;
- while(p != NULL) {
- if(p->ai_family == AF_INET) {
- sin = (struct sockaddr_in *)p->ai_addr;
- *addr = sin->sin_addr.s_addr;
- return 0;
- }
- }
-
- return EAI_NONAME;
-}
-
-/*
- *
- */
-
-int
-arlalib_version_cmd(int argc, char **argv)
-{
- print_version(NULL);
- return 0;
-}
-
diff --git a/usr.sbin/afs/src/appl/lib/arlalib.h b/usr.sbin/afs/src/appl/lib/arlalib.h
deleted file mode 100644
index b105bb5afcd..00000000000
--- a/usr.sbin/afs/src/appl/lib/arlalib.h
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: arlalib.h,v 1.50 2003/04/24 11:51:24 lha Exp $ */
-
-#ifndef ARLALIB_H
-#define ARLALIB_H 1
-
-/*
- * Credentinals
- */
-
-typedef enum { AUTHFLAGS_NOAUTH = 0x0,
- AUTHFLAGS_ANY = 0x1,
- AUTHFLAGS_LOCALAUTH = 0x2,
- AUTHFLAGS_TICKET = 0x4,
- AUTHFLAGS_TOKEN = 0x8,
- AUTHFLAGS_DISALLOW_NOAUTH = 0x10
-} arlalib_authflags_t;
-
-arlalib_authflags_t
-arlalib_getauthflag (int noauth,
- int localauth,
- int ticket,
- int token);
-
-/*
- * Connections
- */
-
-struct rx_connection *
-arlalib_getconnbyaddr(const char *cell, int32_t addr, const char *host,
- int32_t port, int32_t servid,
- arlalib_authflags_t auth);
-
-struct rx_connection *
-arlalib_getconnbyname(const char *cell, const char *host,
- int32_t port, int32_t servid,
- arlalib_authflags_t auth);
-
-int arlalib_destroyconn(struct rx_connection *conn);
-int arlalib_getservername(uint32_t serverNumber, char **servername);
-struct rx_securityClass*
-arlalib_getsecurecontext(const char *cell, const char *host,
- arlalib_authflags_t auth, int *secidx);
-int arlalib_getsyncsite(const char *cell, const char *host, int32_t port,
- uint32_t *synchost, arlalib_authflags_t auth);
-
-
-/*
- * Token management
- */
-
-struct ClearToken;
-
-typedef int (*arlalib_token_iter_func) (const char *secret, size_t secret_sz,
- const struct ClearToken *ct,
- const char *cell,
- void *arg);
-
-int
-arlalib_token_iter (const char *cell,
- arlalib_token_iter_func func, void *arg);
-
-
-/*
- * Wrappers around pioctl calls
- */
-
-void fserr(const char *progname, int error, const char *realpath);
-
-int fs_getfid (char *path, VenusFid *fid);
-int fs_getfilecellname (char *path, char *cell, size_t len);
-int fs_nop(void);
-
-/* arla extensions */
-
-int fs_setcrypt (uint32_t level);
-int fs_getcrypt (uint32_t *level);
-
-int fs_connect (int32_t type, int32_t *flags);
-
-int fs_setfprio(VenusFid fid, int16_t prio);
-int fs_getfprio(VenusFid fid, int16_t *prio);
-int fs_setmaxfprio(int16_t maxprio);
-int fs_getmaxfprio(int16_t *maxprio);
-
-int fs_gcpags(void);
-
-int fs_calculate_cache(uint32_t *calculated,
- uint32_t *usedbytes);
-
-int fs_getfilecachestats(int64_t *max_bytes,
- int64_t *used_bytes,
- int64_t *low_bytes,
- int64_t *max_vnodes,
- int64_t *used_vnodes,
- int64_t *low_vnodes);
-
-int fs_getaviatorstats(uint32_t *max_workers,
- uint32_t *used_workers);
-
-int fs_checkservers(char *cell, int32_t flags,
- uint32_t *hosts, int numhosts);
-
-int fs_checkvolumes (void);
-
-int
-fs_set_sysname (const char *sys);
-
-int
-fs_get_sysname (char *sys, size_t sys_sz);
-
-int
-fs_setcache(int lv, int hv, int lb, int hb);
-
-int
-fs_wscell (char *cell, size_t cell_sz);
-
-int
-fs_flushvolume (const char *path);
-
-int
-fs_flush (const char *path);
-
-int
-fs_venuslog (void);
-
-int
-fs_newcell (const char *cell, int nservers, char **servers);
-
-int
-fs_getcells (int32_t num, uint32_t *server, int numservers,
- char *cell, size_t cell_sz);
-
-int
-fs_getcellstatus (char *cellname, uint32_t *flags);
-
-int
-fs_invalidate (const char *path);
-
-int
-fs_lsmount (const char *path);
-
-int
-fs_rmmount (const char *path);
-
-int
-fs_incompat_renumber (int *ret);
-
-int
-fs_statistics_list(uint32_t *host, uint32_t *part, int *n);
-
-int
-fs_statistics_entry(uint32_t host, uint32_t part, uint32_t type,
- uint32_t items_slot, uint32_t *count,
- int64_t *items_total, int64_t *total_time);
-
-int
-arlalib_get_viceid (const char *username, const char *cellname,
- int32_t *viceId);
-
-int
-arlalib_get_viceid_servers (const char *username, const char *cellname,
- int nservers, const char *servers[],
- int32_t *viceId);
-
-int nnpfs_debug(int inflags, int *outflags);
-int nnpfs_debug_print(int inflags, char *);
-int arla_debug(int inflags, int *outflags);
-
-/* db server context */
-
-struct db_server_context {
- const char *cell;
- int port;
- int serv_id;
- arlalib_authflags_t auth;
- const char **hosts;
- int nhosts;
- int curhost;
- struct rx_connection **conn;
-};
-
-struct rx_connection*
-arlalib_first_db(struct db_server_context *context, const char *cell,
- const char *host,
- int port, int serv_id, arlalib_authflags_t auth);
-
-struct rx_connection*
-arlalib_next_db(struct db_server_context *context);
-
-int
-arlalib_try_next_db (int error);
-
-void
-free_db_server_context(struct db_server_context *context);
-
-int
-arlalib_get_token_id (const char *username, const char *cellname,
- int32_t *token_id);
-
-int
-arlalib_get_token_id_servers (const char *username, const char *cellname,
- int nservers, const char *servers[],
- int32_t *token_id);
-
-void
-arlalib_host_to_name (uint32_t addr, char *str, size_t str_sz);
-
-int
-arlalib_name_to_host (const char *str, uint32_t *addr);
-
-int
-arlalib_version_cmd(int argc, char **argv);
-
-#endif /* ARLALIB_H */
diff --git a/usr.sbin/afs/src/appl/lib/fs_lib.c b/usr.sbin/afs/src/appl/lib/fs_lib.c
deleted file mode 100644
index 9754a657158..00000000000
--- a/usr.sbin/afs/src/appl/lib/fs_lib.c
+++ /dev/null
@@ -1,1104 +0,0 @@
-/*
- * Copyright (c) 1998 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <kafs.h>
-
-RCSID("$arla: fs_lib.c,v 1.41 2003/01/17 03:04:47 lha Exp $");
-
-enum { PIOCTL_MAXSIZE = 2000 };
-
-/*
- * fserr, try to implement a generic function for fs error messages
- */
-
-void
-fserr(const char *progname, int error, const char *realpath)
-{
- const char *path = realpath ? realpath : "[unknown path]";
-
- switch(error) {
- case EACCES:
- fprintf(stderr, "%s: You don't have the required access rights on"
- " '%s'\n", progname, path);
- break;
- case EINVAL:
- fprintf(stderr, "%s: Invalid argument; it is possible that %s is"
- " not in AFS.\n", progname, path);
- break;
- case ENOENT:
- fprintf(stderr, "%s: '%s' doesn't exist\n", progname, path);
- break;
- case EPERM:
- fprintf(stderr, "%s: You do not have the required rights to do"
- " this operation\n", progname);
- break;
- case ESRCH:
- fprintf (stderr, "%s: Home cell information not available\n",
- progname);
- break;
- case EDOM:
- default:
- fprintf(stderr, "%s: error %s (%d) return from pioctl\n",
- progname, koerr_gettext(error), error);
- break;
- }
-}
-
-/*
- * fs_getfid, the the `fid' that `path' points on.
- */
-
-int
-fs_getfid(char *path, VenusFid *fid)
-{
- struct ViceIoctl a_params;
-
- if (path == NULL || fid == NULL)
- return EINVAL;
-
- a_params.in_size=0;
- a_params.out_size=sizeof(*fid);
- a_params.in=NULL;
- a_params.out=(void*) fid;
-
- if(k_pioctl(path,VIOCGETFID,&a_params,1) == -1)
- return errno;
-
- return 0;
-}
-
-/*
- * Do nothing
- */
-
-int
-fs_nop(void)
-{
- struct ViceIoctl a_params;
-
- a_params.in_size=0;
- a_params.out_size=0;
- a_params.in=NULL;
- a_params.out=NULL;
-
- if (k_pioctl(NULL,VIOCNOP,&a_params,1) == -1)
- return errno;
-
- return 0;
-}
-
-/*
- * Get the `cell' that the `path' ends up in
- */
-
-int
-fs_getfilecellname(char *path, char *cell, size_t len)
-{
- struct ViceIoctl a_params;
-
- a_params.in_size=0;
- a_params.out_size=len;
- a_params.in=NULL;
- a_params.out=cell;
-
- if (k_pioctl(path,VIOC_FILE_CELL_NAME,&a_params,1) == -1)
- return errno;
-
- return 0;
-}
-
-/*
- * set the level of crypt
- */
-
-#ifdef VIOC_SETRXKCRYPT
-int
-fs_setcrypt (uint32_t n)
-{
- struct ViceIoctl a_params;
-
- a_params.in_size = sizeof(n);
- a_params.out_size = 0;
- a_params.in = (char *)&n;
- a_params.out = NULL;
-
- if (k_pioctl (NULL, VIOC_SETRXKCRYPT, &a_params, 0) == -1)
- return errno;
-
- return 0;
-}
-#endif
-
-/*
- * get currernt level of crypt
- */
-
-#ifdef VIOC_GETRXKCRYPT
-int
-fs_getcrypt (uint32_t *level)
-{
- struct ViceIoctl a_params;
-
- a_params.in_size = 0;
- a_params.out_size = sizeof(*level);
- a_params.in = NULL;
- a_params.out = (char *) level;
-
- if (k_pioctl (NULL, VIOC_GETRXKCRYPT, &a_params, 0) == -1)
- return errno;
-
- return 0;
-}
-#endif
-
-/*
- * get and set the connect-mode
- */
-
-int
-fs_connect(int32_t type, int32_t *flags)
-{
- struct ViceIoctl a_params;
-
- a_params.in_size = sizeof(type);
- a_params.out_size = sizeof (int32_t);
- a_params.in = (char *) &type;
- a_params.out = (char *) flags;
-
- if (k_pioctl (NULL, VIOCCONNECTMODE, &a_params, 0) == -1)
- return errno;
-
- return 0;
-}
-
-/*
- *
- */
-
-#ifdef VIOC_FPRIOSTATUS
-int
-fs_setfprio(VenusFid fid, int16_t prio)
-{
- struct ViceIoctl a_params;
- struct vioc_fprio fprio;
-
- fprio.cmd = FPRIO_SET;
- fprio.Cell = fid.Cell;
- fprio.Volume = fid.fid.Volume;
- fprio.Vnode = fid.fid.Vnode;
- fprio.Unique = fid.fid.Unique;
- fprio.prio = prio;
-
- a_params.in_size = sizeof(fprio);
- a_params.out_size = 0;
- a_params.in = (char *) &fprio;
- a_params.out = NULL;
-
- if (k_pioctl (NULL, VIOC_FPRIOSTATUS , &a_params, 0) == -1)
- return errno;
-
- return 0;
-}
-#endif
-
-#ifdef VIOC_FPRIOSTATUS
-int
-fs_getfprio(VenusFid fid, int16_t *prio)
-{
- struct ViceIoctl a_params;
- struct vioc_fprio fprio;
-
- fprio.cmd = FPRIO_GET;
- fprio.Cell = fid.Cell;
- fprio.Volume = fid.fid.Volume;
- fprio.Vnode = fid.fid.Vnode;
- fprio.Unique = fid.fid.Unique;
-
- a_params.in_size = sizeof(fprio);
- a_params.out_size = sizeof(*prio);
- a_params.in = (char *) &fprio;
- a_params.out = (char *) prio;
-
- if (k_pioctl (NULL, VIOC_FPRIOSTATUS , &a_params, 0) == -1)
- return errno;
-
- return 0;
-}
-#endif
-
-#ifdef VIOC_FPRIOSTATUS
-int
-fs_setmaxfprio(int16_t maxprio)
-{
- struct ViceIoctl a_params;
- struct vioc_fprio fprio;
-
- fprio.cmd = FPRIO_SETMAX;
- fprio.prio = maxprio;
-
- a_params.in_size = sizeof(fprio);
- a_params.out_size = 0;
- a_params.in = (char *) &fprio;
- a_params.out = NULL;
-
- if (k_pioctl (NULL, VIOC_FPRIOSTATUS , &a_params, 0) == -1)
- return errno;
-
- return 0;
-}
-#endif
-
-#ifdef VIOC_FPRIOSTATUS
-int
-fs_getmaxfprio(int16_t *maxprio)
-{
- struct ViceIoctl a_params;
- struct vioc_fprio fprio;
-
- fprio.cmd = FPRIO_GETMAX;
-
- a_params.in_size = sizeof(fprio);
- a_params.out_size = sizeof(*maxprio);
- a_params.in = (char *) &fprio;
- a_params.out = (char *) maxprio;
-
- if (k_pioctl (NULL, VIOC_FPRIOSTATUS , &a_params, 0) == -1)
- return errno;
-
- return 0;
-}
-#endif
-
-/*
- *
- */
-
-static int
-getcacheparam(int32_t opcode, int64_t *val)
-{
- struct ViceIoctl a_params;
-
- a_params.in_size = sizeof(opcode);
- a_params.out_size = sizeof(*val);
- a_params.in = (char *)&opcode;
- a_params.out = (char *)val;
-
- if (k_pioctl (NULL, AIOC_GETCACHEPARAMS , &a_params, 0) == -1)
- return errno;
- return 0;
-}
-
-int
-fs_getfilecachestats(int64_t *max_bytes,
- int64_t *used_bytes,
- int64_t *low_bytes,
- int64_t *max_vnodes,
- int64_t *used_vnodes,
- int64_t *low_vnodes)
-{
- uint32_t oldparms[16];
- struct ViceIoctl a_params;
-
-#define query(o,v) \
- if (v && getcacheparam(GETCACHEPARAMS_OPCODE_##o,v)) goto old
-
- query(HIGHBYTES, max_bytes);
- query(USEDBYTES, used_bytes);
- query(LOWBYTES, low_bytes);
- query(HIGHVNODES, max_vnodes);
- query(USEDVNODES, used_vnodes);
- query(LOWVNODES, low_vnodes);
-
-#undef query
-
- return 0;
-
- old:
- /* old interface */
-
- a_params.in_size = 0;
- a_params.out_size = sizeof(oldparms);
- a_params.in = NULL;
- a_params.out = (char *) oldparms;
-
- memset (oldparms, 0, sizeof(oldparms));
-
- if (k_pioctl (NULL, VIOCGETCACHEPARAMS , &a_params, 0) == -1)
- return errno;
-
- /* param[0] and param[1] send maxbytes and usedbytes in kbytes */
-
- if (max_vnodes)
- *max_vnodes = oldparms[2];
- if (used_vnodes)
- *used_vnodes = oldparms[3];
- if (max_bytes)
- *max_bytes = oldparms[4];
- if (used_bytes)
- *used_bytes = oldparms[5];
- if (low_bytes)
- *low_bytes = 0;
- if (low_vnodes)
- *low_vnodes = 0;
-
- return 0;
-}
-
-
-/*
- *
- */
-
-#ifdef VIOC_AVIATOR
-int
-fs_getaviatorstats(uint32_t *max_workers,
- uint32_t *used_workers)
-{
- uint32_t parms[16];
- struct ViceIoctl a_params;
-
- a_params.in_size = 0;
- a_params.out_size = sizeof(parms);
- a_params.in = NULL;
- a_params.out = (char *) parms;
-
- if (k_pioctl (NULL, VIOC_AVIATOR , &a_params, 0) == -1)
- return errno;
-
- if (max_workers)
- *max_workers = parms[0];
- if (used_workers)
- *used_workers = parms[1];
-
- return 0;
-}
-#endif
-
-/*
- *
- */
-
-#ifdef VIOC_GCPAGS
-int
-fs_gcpags(void)
-{
- struct ViceIoctl a_params;
-
- a_params.in_size = 0;
- a_params.out_size = 0;
- a_params.in = NULL;
- a_params.out = NULL;
-
-
- if (k_pioctl(NULL, VIOC_GCPAGS, &a_params, 0) != 0)
- return errno;
-
- return 0;
-}
-#endif
-
-/*
- *
- */
-
-#ifdef VIOC_CALCULATE_CACHE
-int
-fs_calculate_cache(uint32_t *calculated,
- uint32_t *usedbytes)
-{
- uint32_t parms[16];
- struct ViceIoctl a_params;
-
- a_params.in_size = 0;
- a_params.out_size = sizeof(parms);
- a_params.in = NULL;
- a_params.out = (char *) parms;
-
- if (k_pioctl (NULL, VIOC_CALCULATE_CACHE , &a_params, 0) == -1)
- return errno;
-
- if (calculated)
- *calculated = parms[0];
- if (usedbytes)
- *usedbytes = parms[1];
-
- return 0;
-}
-#endif
-
-/*
- *
- */
-
-int
-fs_invalidate (const char *path)
-{
- struct ViceIoctl a_params;
-
- a_params.in_size = 0;
- a_params.out_size = 0;
- a_params.in = NULL;
- a_params.out = NULL;
-
- if (k_pioctl ((char *)path, VIOC_BREAKCALLBACK, &a_params, 0) < 0)
- return errno;
- else
- return 0;
-}
-
-/*
- * Get/set debug levels with pioctl_cmd.
- *
- * inflags == -1 -> don't change
- * outflags == NULL -> don't return
- */
-
-static int
-debug (int pioctl_cmd, int inflags, int *outflags, char *pathname)
-{
- struct ViceIoctl a_params;
-
- int32_t rinflags = inflags;
- int32_t routflags;
-
- if (inflags != -1) {
- a_params.in_size = sizeof(rinflags);
- a_params.in = (char *) &rinflags;
- } else {
- a_params.in_size = 0;
- a_params.in = NULL;
- }
-
- if (outflags) {
- a_params.out_size = sizeof(routflags);
- a_params.out = (char *) &routflags;
- } else {
- a_params.out_size = 0;
- a_params.out = NULL;
- }
-
- if (k_pioctl (pathname, pioctl_cmd, &a_params, 0) == -1)
- return errno;
-
- if (outflags)
- *outflags = routflags;
-
- return 0;
-}
-
-/*
- * nnpfs_debug
- */
-
-#ifdef VIOC_NNPFSDEBUG
-int
-nnpfs_debug(int inflags, int *outflags)
-{
- return debug (VIOC_NNPFSDEBUG, inflags, outflags, NULL);
-}
-#endif
-
-/*
- * nnpfs_debug_print
- */
-
-#ifdef VIOC_NNPFSDEBUG_PRINT
-int
-nnpfs_debug_print(int inflags, char *pathname)
-{
- return debug (VIOC_NNPFSDEBUG_PRINT, inflags, NULL, pathname);
-}
-#endif
-
-/*
- * arla_debug
- */
-
-#ifdef VIOC_ARLADEBUG
-int
-arla_debug (int inflags, int *outflags)
-{
- return debug (VIOC_ARLADEBUG, inflags, outflags, NULL);
-}
-#endif
-
-/*
- * checkservers
- *
- * flags is the same flags as in CKSERV flags
- *
- */
-
-int
-fs_checkservers(char *cell, int32_t flags, uint32_t *hosts, int numhosts)
-{
- struct ViceIoctl a_params;
- char *in = NULL;
- int ret;
- size_t insize;
-
- if (cell != NULL) {
- insize = strlen(cell) + sizeof(int32_t) + 1;
- in = malloc (insize);
- if (in == NULL)
- errx (1, "malloc");
-
- memcpy (in, &flags, sizeof(flags));
-
- memcpy (in + sizeof(int32_t), cell, strlen(cell));
- in[sizeof(int32_t) + strlen(cell)] = '\0';
-
- a_params.in_size = insize;
- a_params.in = in;
- } else {
- a_params.in_size = sizeof(flags);
- a_params.in = (caddr_t )&flags;
- }
-
- a_params.out_size = numhosts * sizeof(uint32_t);
- a_params.out = (caddr_t)hosts;
-
- ret = 0;
-
- if (k_pioctl (NULL, VIOCCKSERV, &a_params, 0) == -1)
- ret = errno;
-
- if (in)
- free(in);
-
- return ret;
-}
-
-/*
- * check validity of cached volume information
- */
-
-int
-fs_checkvolumes (void)
-{
- struct ViceIoctl a_params;
-
- a_params.in = NULL;
- a_params.in_size = 0;
- a_params.out = NULL;
- a_params.out_size = 0;
-
- if (k_pioctl (NULL, VIOCCKBACK, &a_params, 0) < 0)
- return errno;
- else
- return 0;
-}
-
-/*
- * return current sysname in `sys' (of max length `sys_sz')
- */
-
-int
-fs_get_sysname (char *sys, size_t sys_sz)
-{
- struct ViceIoctl a_params;
- int32_t set = 0;
- char *buf;
-
- buf = malloc (sys_sz + 4);
- if (buf == NULL)
- return ENOMEM;
-
- a_params.in = (caddr_t)&set;
- a_params.in_size = sizeof(set);
- a_params.out = buf;
- a_params.out_size = sys_sz + 4;
-
- if(k_pioctl (NULL, VIOC_AFS_SYSNAME, &a_params, 1) < 0)
- return errno;
- else {
- strlcpy (sys, buf + 4, sys_sz);
- return 0;
- }
-}
-
-/*
- * set current sysname to `sys'
- */
-
-int
-fs_set_sysname (const char *sys)
-{
- struct ViceIoctl a_params;
- int32_t set = 1;
- size_t len;
-
- len = strlen(sys) + 1;
- a_params.in_size = sizeof(set) + len;
- a_params.in = malloc(a_params.in_size);
- if (a_params.in == NULL)
- return ENOMEM;
- a_params.out = NULL;
- a_params.out_size = 0;
- memcpy (a_params.in, &set, sizeof(set));
- strlcpy (a_params.in + sizeof(set), sys, len);
-
- if(k_pioctl (NULL, VIOC_AFS_SYSNAME, &a_params, 1) < 0)
- return errno;
- else
- return 0;
-}
-
-/*
- *
- */
-
-int
-fs_setcache(int lv, int hv, int lb, int hb)
-{
- struct ViceIoctl a_params;
- uint32_t s[4];
-
- s[0] = lv;
- s[1] = hv;
- s[2] = lb;
- s[3] = hb;
-
- a_params.in_size = ((hv == 0) ? 1 : 4) * sizeof(uint32_t);
- a_params.out_size = 0;
- a_params.in = (void *)s;
- a_params.out = NULL;
-
- if (k_pioctl(NULL, VIOCSETCACHESIZE, &a_params, 0) < 0)
- return errno;
- else
- return 0;
-}
-
-/*
- * return the local cell in `cell' (of size `cell_sz').
- */
-
-int
-fs_wscell (char *cell, size_t cell_sz)
-{
- struct ViceIoctl a_params;
-
- a_params.in_size = 0;
- a_params.in = NULL;
- a_params.out_size = cell_sz;
- a_params.out = cell;
-
- if (k_pioctl (NULL, VIOC_GET_WS_CELL, &a_params, 0) < 0)
- return errno;
- return 0;
-}
-
-/*
- * Flush the contents of the volume pointed to by `path'.
- */
-
-int
-fs_flushvolume (const char *path)
-{
- struct ViceIoctl a_params;
-
- a_params.in_size = 0;
- a_params.out_size = 0;
- a_params.in = NULL;
- a_params.out = NULL;
-
- if (k_pioctl ((char *)path, VIOC_FLUSHVOLUME, &a_params, 0) < 0)
- return errno;
- else
- return 0;
-}
-
-/*
- * Flush the file `path' from the cache.
- */
-
-int
-fs_flush (const char *path)
-{
- struct ViceIoctl a_params;
-
- a_params.in_size = 0;
- a_params.out_size = 0;
- a_params.in = NULL;
- a_params.out = NULL;
-
- if (k_pioctl ((char *)path, VIOCFLUSH, &a_params, 0) < 0)
- return errno;
- else
- return 0;
-}
-
-/*
- *
- */
-
-int
-fs_venuslog (void)
-{
- struct ViceIoctl a_params;
- int32_t status = 0; /* XXX not really right, but anyway */
-
- a_params.in_size = sizeof(int32_t);
- a_params.out_size = 0;
- a_params.in = (caddr_t) &status;
- a_params.out = NULL;
-
- if (k_pioctl (NULL, VIOC_VENUSLOG, &a_params, 0) < 0)
- return errno;
- else
- return 0;
-}
-
-/*
- * Create a new cell (or change servers for an existing one), with
- * name `cell' and `nservers' servers in `servers'.
- */
-
-int
-fs_newcell (const char *cell, int nservers, char **servers)
-{
- struct ViceIoctl a_params;
- int len, l;
- char *buf;
- int i, ret;
- uint32_t *hp;
-
- nservers = min (nservers, 8);
-
- l = strlen(cell) + 1;
- len = 8 * sizeof(u_int32_t) + l;
- buf = malloc (len);
- if (buf == NULL)
- return errno;
-
- memset (buf, 0, len);
- strlcpy (buf + 8 * sizeof(u_int32_t), cell, l);
- hp = (u_int32_t *)buf;
- for (i = 0; i < nservers; ++i) {
- struct addrinfo hints, *res;
-
- memset (&hints, 0, sizeof(hints));
- hints.ai_family = PF_INET;
- hints.ai_socktype = SOCK_DGRAM;
-
- ret = getaddrinfo(servers[i], NULL, &hints, &res);
- if (ret) {
- free (buf);
- return EINVAL;
- }
- assert (res->ai_family == PF_INET);
- hp[i] = ((struct sockaddr_in *)res->ai_addr)->sin_addr.s_addr;
- freeaddrinfo(res);
- }
-
- a_params.in_size = len;
- a_params.out_size = 0;
- a_params.in = (caddr_t)buf;
- a_params.out = NULL;
-
- ret = k_pioctl (NULL, VIOCNEWCELL, &a_params, 0);
- free (buf);
- if (ret < 0)
- return errno;
- return 0;
-}
-
-/*
- * Fetch cell status for cell `num', and put the ip-numbers to the servers
- * in the array `server' of length `numservers'. `Cell' is the name
- * of the cell and has length `sell_sz'.
- */
-
-int
-fs_getcells (int32_t num, uint32_t *server, int numservers,
- char *cell, size_t cell_sz)
-{
- struct ViceIoctl a_params;
- int32_t *server_list;
- int i;
-
- if (server == NULL && numservers != 0)
- return EINVAL;
-
- memset(server, 0, numservers * sizeof(*server));
-
-#define GETCELL_MAXSERVER 8
- a_params.in_size = sizeof (num);
- a_params.out_size = sizeof (uint32_t) * GETCELL_MAXSERVER + cell_sz + 1;
- a_params.in = (char *) &num;
- a_params.out = malloc (a_params.out_size);
-
- if (a_params.out == NULL)
- return ENOMEM;
-
- server_list = (int32_t *) a_params.out;
-
- if (k_pioctl (NULL, VIOCGETCELL, &a_params, 0) != 0)
- return errno;
-
- if (numservers > GETCELL_MAXSERVER)
- numservers = GETCELL_MAXSERVER;
- for (i = 0 ; i < numservers; i++)
- server[i] = server_list[i];
-
- strlcpy (cell,
- (char *) a_params.out + GETCELL_MAXSERVER * sizeof(uint32_t),
- cell_sz);
-
- return 0;
-}
-
-/*
- * Get status for `cell' and put the flags in `flags'.
- */
-
-int
-fs_getcellstatus (char *cellname, uint32_t *flags)
-{
- struct ViceIoctl a_params;
-
- a_params.in_size = strlen (cellname) + 1;
- a_params.out_size = sizeof (uint32_t);
- a_params.in = cellname;
- a_params.out = (caddr_t) flags;
-
- if (k_pioctl (NULL, VIOC_GETCELLSTATUS, &a_params, 0) < 0)
- return errno;
- else
- return 0;
-}
-
-/*
- * Separate `path' into directory and last component and call
- * pioctl with `pioctl_cmd'.
- */
-
-static int
-internal_mp (const char *path, int pioctl_cmd, char **res)
-{
- struct ViceIoctl a_params;
- char *last;
- char *path_bkp;
- int error;
-
- path_bkp = strdup (path);
- if (path_bkp == NULL) {
- printf ("fs: Out of memory\n");
- return ENOMEM;
- }
-
- a_params.out = malloc (PIOCTL_MAXSIZE);
- if (a_params.out == NULL) {
- printf ("fs: Out of memory\n");
- free (path_bkp);
- return ENOMEM;
- }
-
- /* If path contains more than the filename alone - split it */
-
- last = strrchr (path_bkp, '/');
- if (last != NULL) {
- *last = '\0';
- a_params.in = last + 1;
- } else
- a_params.in = (char *)path;
-
- a_params.in_size = strlen (a_params.in) + 1;
- a_params.out_size = PIOCTL_MAXSIZE;
-
- error = k_pioctl (last ? path_bkp : "." ,
- pioctl_cmd, &a_params, 1);
- if (error < 0) {
- error = errno;
- free (path_bkp);
- free (a_params.out);
- return error;
- }
-
- if (res != NULL)
- *res = a_params.out;
- else
- free (a_params.out);
- free (path_bkp);
- return 0;
-}
-
-int
-fs_lsmount (const char *path)
-{
- char *res;
- int error = internal_mp (path, VIOC_AFS_STAT_MT_PT, &res);
-
- if (error == 0) {
- printf ("'%s' is a mount point for volume '%s'\n", path, res);
- free (res);
- }
- return error;
-}
-
-int
-fs_rmmount (const char *path)
-{
- return internal_mp (path, VIOC_AFS_DELETE_MT_PT, NULL);
-}
-
-int
-fs_incompat_renumber (int *ret)
-{
- struct ViceIoctl a_params;
- unsigned char buf[1024];
-
- a_params.in_size = 0;
- a_params.out_size = sizeof(buf);
- a_params.in = 0;
- a_params.out = (caddr_t) buf;
-
- /* getcrypt or getinitparams */
- if (k_pioctl (NULL, _VICEIOCTL(49), &a_params, 0) < 0) {
- if (errno == EINVAL) {
-
- /* not openafs or old openafs */
-
- a_params.in_size = 0;
- a_params.out_size = 4;
- a_params.in = 0;
- a_params.out = (caddr_t) buf;
-
- if (k_pioctl (NULL, _VICEIOCTL(49), &a_params, 0) < 0) {
- if (errno == EINVAL) {
-
- a_params.in_size = 0;
- a_params.out_size = 4;
- a_params.in = 0;
- a_params.out = (caddr_t) buf;
-
- /* might be new interface */
-
- if (k_pioctl (NULL, _VICEIOCTL(55), &a_params, 0) < 0)
- return errno; /* dunno */
-
- *ret = 1;
- return 0;
- } else {
- return errno;
- }
- }
- *ret = 0;
- return 0;
- } else
- return errno;
- }
- *ret = 1;
- return 0;
-}
-
-
-/*
- *
- */
-
-int
-fs_statistics_list(uint32_t *host, uint32_t *part, int *n)
-{
- uint32_t data[512];
- uint32_t indata;
- struct ViceIoctl a_params;
- int i;
-
- indata = STATISTICS_OPCODE_LIST;
-
- a_params.in_size = sizeof(indata);
- a_params.out_size = sizeof(data);
- a_params.in = (char *) &indata;
- a_params.out = (char *) data;
-
- memset (data, 0, sizeof(data));
-
- if (k_pioctl (NULL, AIOC_STATISTICS , &a_params, 0) == -1)
- return errno;
-
- if (data[0] < *n)
- *n = data[0];
-
- for (i = 0; i < *n; i++) {
- host[i] = data[2 * i + 1];
- part[i] = data[2 * i + 2];
- }
-
- return 0;
-}
-
-int
-fs_statistics_entry(uint32_t host, uint32_t part, uint32_t type,
- uint32_t items_slot, uint32_t *count,
- int64_t *items_total, int64_t *total_time)
-{
- uint32_t data[160];
- uint32_t indata[5];
- struct ViceIoctl a_params;
- int i;
- int j;
-
- indata[0] = STATISTICS_OPCODE_GETENTRY;
- indata[1] = host;
- indata[2] = part;
- indata[3] = type;
- indata[4] = items_slot;
-
- a_params.in_size = sizeof(indata);
- a_params.out_size = sizeof(data);
- a_params.in = (char *) indata;
- a_params.out = (char *) data;
-
- memset (data, 0, sizeof(data));
-
- if (k_pioctl (NULL, AIOC_STATISTICS , &a_params, 0) == -1)
- return errno;
-
- j = 0;
- for (i = 0; i < 32; i++) {
- count[i] = data[j++];
- }
- for (i = 0; i < 32; i++) {
- memcpy(&items_total[i], &data[j], 8);
- j+=2;
- }
- for (i = 0; i < 32; i++) {
- memcpy(&total_time[i], &data[j], 8);
- j+=2;
- }
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/lib/ka-procs.c b/usr.sbin/afs/src/appl/lib/ka-procs.c
deleted file mode 100644
index da4a3445682..00000000000
--- a/usr.sbin/afs/src/appl/lib/ka-procs.c
+++ /dev/null
@@ -1,633 +0,0 @@
-/*
- * Copyright (c) 2000 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * This file implements wrapper functions around the interfaces
- * (KAA,KAT,KAM) that is available from ka-server.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-RCSID("$arla: ka-procs.c,v 1.13 2003/06/10 16:14:48 lha Exp $");
-
-#ifdef HAVE_KRB4
-
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <assert.h>
-
-#ifdef HAVE_OPENSSL
-#include <openssl/des.h>
-#else
-#include <des.h>
-#endif
-#include <krb.h>
-
-#include <ko.h>
-#include <ports.h>
-#include <log.h>
-
-#include <arlalib.h>
-
-#include <roken.h>
-#include <err.h>
-
-#include <service.h>
-
-#include <rx/rx.h>
-#include <ka.h>
-#include <ka.cs.h>
-
-#include <ka-procs.h>
-
-#include <kafs.h>
-
-/*
- * The ka preauth data-blob. Used in KAA_Authenticate. Encrypted with
- * des_pcbc_encrypt() and the user's key.
- */
-
-struct ka_preauth {
- int32_t time;
- char label[KA_LABELSIZE];
-};
-
-/*
- * Used to communicate over start and endtime of a ticket in
- * KAT_GetTicket(). Encrypted with des_ecb_encrypt (for some reson)
- * and the session key.
- */
-
-struct ka_times {
- int32_t start_time;
- int32_t end_time;
-};
-
-/*
- *
- */
-
-static void
-decode_u_int32 (uint32_t *number, unsigned char **buf, size_t *sz)
-{
- memcpy (number, *buf, 4);
- *number = ntohl(*number);
- *sz -= 4; *buf += 4;
-}
-
-/*
- *
- */
-
-static int
-decode_stringz (char *str, size_t str_sz, unsigned char **buf, size_t *sz)
-{
- char *s = (char *)*buf;
- size_t l = strlen (s) + 1;
- if (strlcpy (str, s, str_sz) >= str_sz)
- return 0;
- *sz -= l; *buf += l;
- return(1);
-}
-
-/*
- * Decode the getticket
- *
- * confounder int32_t
- * challange int32_t
- * sessionkey byte * 8
- * start time int32_t
- * end time int32_t
- * kvno int32_t
- * ticket length int32_t
- * client name stringz
- * client instance stringz
- * realm ? stringz
- * server name stringz
- * server instance stringz
- * ticket byte * <ticket length>
- * label (tgsT in tgt case) byte * 4
- * padding to make sure it's on a 8 byte bondery
- *
- * blam heimdal authors if it's wrong
- */
-
-static int
-decode_answer (char *label, unsigned char *buf, size_t sz,
- struct ka_Answer *answer)
-{
- uint32_t confounder, kvno_int32, ticket_sz;
-
- assert (sz % 8 == 0);
-
- if (sz < 32 + 1+1+1 + 1+1)
- goto fail;
-
- decode_u_int32 (&confounder, &buf, &sz);
- decode_u_int32 (&answer->challange, &buf, &sz);
- memcpy (answer->sessionkey, buf, 8);
- buf += 8; sz -= 8;
- decode_u_int32 (&answer->start_time, &buf, &sz);
- decode_u_int32 (&answer->end_time, &buf, &sz);
- decode_u_int32 (&kvno_int32, &buf, &sz);
- answer->kvno = (int)kvno_int32;
- decode_u_int32 (&ticket_sz, &buf, &sz);
- if (ticket_sz > MAX_KTXT_LEN)
- goto fail;
-
-#define destrz(f) decode_stringz(answer->f,sizeof(answer->f), &buf, &sz)
- if (!destrz(user) ||
- destrz(instance) ||
- destrz(realm) ||
- destrz(server_user) ||
- destrz(server_instance))
- goto fail;
-#undef destrz
- if (sz < ticket_sz)
- goto fail;
-
- answer->ticket.length = ticket_sz;
- memcpy (&answer->ticket.dat, buf, ticket_sz);
- answer->ticket.mbz = 0;
- sz -= ticket_sz;
- buf += ticket_sz;
-
- if (sz < 4)
- goto fail;
- memcpy (answer->label, buf, 4);
- sz -= 4;
- buf += 4;
-
- if (memcmp (answer->label, label, 4) != 0)
- goto fail;
-
- assert (sz >= 0);
-
- return 0;
- fail:
- memset(answer->sessionkey, 0, sizeof(answer->sessionkey));
- return 1;
-}
-
-/*
- * Get the the password des-`key' for `realm' (and its make sure that
- * the cell is lowercase) using `password'. If `password' is NULL, the
- * user is queried.
- */
-
-static int
-get_password (const char *realm, const char *password, des_cblock *key)
-{
- int ret;
- char buf[1024];
- char cell[1024];
-
- if (password == NULL) {
- ret = des_read_pw_string (buf, sizeof(buf), "Password: ", 0);
- if (ret)
- return ret;
- password = buf;
- }
- strlcpy (cell, realm, sizeof(cell));
- strlwr (cell);
-
- afs_string_to_key (password, realm, key);
- memset (buf, 0, sizeof(buf));
-
- return 0;
-}
-
-/*
- * Make sure `answer' have a good realm, or set to it `realm'
- */
-
-static void
-fixup_realm (struct ka_Answer *answer, const char *realm)
-{
- if (strcmp (answer->realm, "") == 0) {
- strlcpy(answer->realm, realm,
- sizeof(answer->realm));
- strupr(answer->realm);
- }
-}
-
-/*
- * Authenticate `user'.`instance'@`cell' with `password' and get
- * `lifetime' second long tickets. If `password' is NULL, user is
- * queried for password. `flags' is used to specify behavior of the
- * function.
- */
-
-int
-ka_authenticate (const char *user, const char *instance, const char *cell,
- const char *password, uint32_t lifetime,
- ka_auth_flags_t flags)
-{
- des_cblock key;
- ka_auth_data_t adata;
- ka_ticket_data_t tdata;
- struct ka_cell_query cinfo;
- char filename[MAXPATHLEN];
- int ret;
- int save_ticket, do_afslog = 0;
-
- filename[0] = '\0';
- if (cell == NULL)
- cell = cell_getthiscell();
- if (instance == NULL)
- instance = "";
-
- memset (&cinfo, 0, sizeof(cinfo));
-
- save_ticket = (flags & KA_AUTH_TICKET) == KA_AUTH_TICKET;
- do_afslog = (flags & KA_AUTH_TOKEN) == KA_AUTH_TOKEN;
-
- ret = get_password (cell, password, &key);
- if (ret)
- goto out;
-
- ret = ka_auth (user, instance, cell, &key, &adata, lifetime,
- &cinfo);
- if (ret)
- goto out;
-
- if (save_ticket) {
- strlcpy (filename, tkt_string(), sizeof(filename));
- } else if (do_afslog) {
- snprintf (filename, sizeof(filename), "%sXXXXXXXX", tkt_string());
- ret = mkstemp (filename);
- if (ret) {
- ret = errno;
- goto out;
- }
- }
-
- if (save_ticket || do_afslog) {
- ret = ka_auth_create (filename, &adata);
- if (ret)
- goto out;
- }
-
- if (do_afslog) {
- ret = ka_getticket ("afs", "", cell, &adata, &tdata, &cinfo);
- if (ret)
- goto out;
-
- ret = ka_write_ticket (filename, &tdata);
- if (ret)
- goto out;
-
- if (k_hasafs()) {
-#ifdef HAVE_KRB_AFSLOG_UID
- ret = krb_afslog (cell, cell);
-#else
- ret = k_afsklog_uid (cell, cell);
-#endif
- if (ret) {
- warnx ("failed inserting tokens for cell %s", cell);
- }
- ret = 0;
- }
- }
-
- if (!save_ticket)
- dest_tkt();
-
- out:
- memset (&key, 0, sizeof (key));
- memset (&adata, 0, sizeof(adata));
- memset (&tdata, 0, sizeof(tdata));
- memset (&cinfo, 0, sizeof(cinfo));
- if (ret) {
- if (filename[0] != '\0')
- unlink(filename);
- }
-
- return ret;
-}
-
-#ifndef DES_ENCRYPT
-#if defined(DESKRB_ENCRYPT)
-#define DES_ENCRYPT DESKRB_ENCRYPT
-#define DES_DECRYPT DESKRB_DECRYPT
-#elif defined(ENCRYPT)
-#define DES_ENCRYPT ENCRYPT
-#define DES_DECRYPT DECRYPT
-#else
-#error DES_ENCRYPT not defined in des.h
-#endif
-#endif
-
-/*
- * Authenticate `user'.`instance'@`cell' with `key' to get a tgt for
- * with a lifetime `lifetime' seconds. Return ticket in
- * `adata'. `cinfo' is used to specify how to query cell.
- */
-
-int
-ka_auth (const char *user, const char *instance, const char *cell,
- des_cblock *key, ka_auth_data_t *adata,
- uint32_t lifetime, struct ka_cell_query *cinfo)
-{
- struct db_server_context conn_context;
- struct rx_connection *conn;
- struct ka_preauth f;
- struct timeval tv;
- char buf[8];
- char return_data[400];
- ka_CBS request;
- ka_BBS answer;
- int ret;
- struct ka_Answer *auth_answer = (struct ka_Answer *)adata;
- des_key_schedule schedule;
- uint32_t req_challange;
- uint32_t start_time;
- uint32_t end_time;
-
- /*
- * Init the time-stamps
- */
-
- gettimeofday (&tv, NULL);
-
- start_time = tv.tv_sec;
- end_time = start_time + lifetime;
-
- /*
- * Reset stuff that is sent over the network
- */
-
- memset(buf, 0, sizeof(buf));
- memset(return_data, 0, sizeof(return_data));
-
- /*
- * Cook pre-auth
- */
-
- f.time = htonl(tv.tv_sec);
- strncpy (f.label, "gTGS", 4);
- req_challange = tv.tv_sec;
-
- des_set_key (key, schedule);
- des_pcbc_encrypt ((des_cblock *)&f,
- (des_cblock *)&buf,
- sizeof(f),
- schedule,
- key,
- DES_ENCRYPT);
-
- request.Seq.val = buf;
- request.Seq.len = sizeof(buf);
-
- /*
- * Setup query stuff
- */
-
- answer.MaxSeqLen = sizeof(buf);
- answer.Seq.val = return_data;
- answer.Seq.len = sizeof(return_data);
- answer.MaxSeqLen = sizeof(return_data);
-
- /*
- * Send the request
- */
-
- ret = ENETDOWN;
- for (conn = arlalib_first_db(&conn_context,
- cell, NULL, afskaport,
- KA_AUTHENTICATION_SERVICE,
- arlalib_getauthflag (1, 0, 0, 0));
- conn != NULL && arlalib_try_next_db(ret);
- conn = arlalib_next_db(&conn_context)) {
-
- ret = KAA_Authenticate (conn, user, instance, start_time, end_time,
- &request, &answer);
- }
- free_db_server_context(&conn_context);
- if (ret)
- return ret;
-
- /*
- * Decrypt it
- */
-
- des_set_key (key, schedule);
- des_pcbc_encrypt ((des_cblock *)answer.Seq.val,
- (des_cblock *)answer.Seq.val,
- answer.Seq.len,
- schedule,
- key,
- DES_DECRYPT);
- memset (key, 0, sizeof(*key));
-
- ret = decode_answer ("tgsT", answer.Seq.val, answer.Seq.len,
- auth_answer);
- memset (return_data, 0, sizeof (return_data));
- memset (answer.Seq.val, 0, answer.Seq.len);
- free (answer.Seq.val);
- if (ret)
- return ret;
-
-
- /*
- * Consistency checks
- */
-
- if (strcmp(auth_answer->user, user) != 0
- || strcmp(auth_answer->instance, instance) != 0) {
- printf ("server returned different user the asked for\n");
- return 1;
- }
-
- if (auth_answer->challange != req_challange + 1) {
- printf ("server didn't respond with right challange\n");
- return 1;
- }
-
- fixup_realm (auth_answer, cell);
-
- return ret;
-}
-
-/*
- * Get a ticket for `suser'.`sinstance'@`srealm' using `adata' to
- * authenticate. The returning ticket is retrurned in `tdata'. `cinfo'
- * is used for special cell handling.
- */
-
-int
-ka_getticket (const char *suser, const char *sinstance, const char *srealm,
- ka_auth_data_t *adata, ka_ticket_data_t *tdata,
- struct ka_cell_query *cinfo)
-{
- struct db_server_context conn_context;
- struct rx_connection *conn;
- int ret;
- struct ka_times ktimes;
- char times_buf[8];
- char return_data[400];
- ka_CBS times;
- ka_CBS ka_ticket;
- ka_BBS answer;
- des_key_schedule schedule;
- struct timeval tv;
- uint32_t start_time;
- uint32_t end_time;
-
- /*
- * Cook time limit of ticket, use enddate of tgt
- */
-
- gettimeofday (&tv, NULL);
-
- start_time = tv.tv_sec;
- end_time = adata->end_time;
-
- ktimes.start_time = htonl(start_time);
- ktimes.end_time = htonl(end_time);
-
- des_set_key (&adata->sessionkey, schedule);
- des_ecb_encrypt ((des_cblock *)&ktimes,
- (des_cblock *)times_buf,
- schedule,
- DES_ENCRYPT);
-
- /*
- * Set up request
- */
-
- times.Seq.len = sizeof(times_buf);
- times.Seq.val = times_buf;
-
- ka_ticket.Seq.len = adata->ticket.length;
- ka_ticket.Seq.val = adata->ticket.dat;
-
- answer.MaxSeqLen = sizeof(return_data);
- answer.Seq.len = sizeof(return_data);
- answer.Seq.val = return_data;
-
- ret = ENETDOWN;
- for (conn = arlalib_first_db(&conn_context,
- adata->realm, NULL, afskaport,
- KA_TICKET_GRANTING_SERVICE,
- arlalib_getauthflag (1, 0, 0, 0));
- conn != NULL && arlalib_try_next_db(ret);
- conn = arlalib_next_db(&conn_context)) {
-
- ret = KAT_GetTicket(conn, adata->kvno, "", &ka_ticket,
- suser, sinstance, &times, &answer);
- }
- free_db_server_context(&conn_context);
- if (ret)
- return ret;
-
- /* decrypt it */
- des_set_key (&adata->sessionkey, schedule);
- des_pcbc_encrypt ((des_cblock *)answer.Seq.val,
- (des_cblock *)answer.Seq.val,
- answer.Seq.len,
- schedule,
- &adata->sessionkey,
- DES_DECRYPT);
-
- ret = decode_answer ("gtkt", answer.Seq.val, answer.Seq.len, tdata);
- if (ret)
- return ret;
-
- fixup_realm (tdata, adata->realm);
- return 0;
-}
-
-/*
- * Create a new credential cache `filename' and add the TGT `data'.
- */
-
-int
-ka_auth_create (char *filename, ka_auth_data_t *data)
-{
- int ret;
-
- unlink (filename);
-
- ret = tf_create (filename);
- if (ret)
- return ret;
-
- if (tf_put_pname(data->user) != KSUCCESS ||
- tf_put_pinst(data->instance) != KSUCCESS) {
- tf_close();
- return INTK_ERR;
- }
-
- ret = tf_save_cred (data->server_user,
- data->server_instance,
- data->realm,
- data->sessionkey,
- data->end_time - data->start_time,
- data->kvno,
- &data->ticket,
- data->start_time);
- tf_close();
- return ret;
-}
-
-/*
- * Append new ticket `data' to the existing cred cache `filename'
- */
-
-int
-ka_write_ticket (char *filename, ka_ticket_data_t *data)
-{
- int ret;
-
- ret = tf_init(filename, W_TKT_FIL);
- if (ret)
- return ret;
-
- ret = tf_save_cred (data->server_user,
- data->server_instance,
- data->realm,
- data->sessionkey,
- data->end_time - data->start_time,
- data->kvno,
- &data->ticket,
- data->start_time);
- tf_close();
- return ret;
-}
-
-#endif /* HAVE_KRB4 */
diff --git a/usr.sbin/afs/src/appl/lib/ka-procs.h b/usr.sbin/afs/src/appl/lib/ka-procs.h
deleted file mode 100644
index ccae217b02e..00000000000
--- a/usr.sbin/afs/src/appl/lib/ka-procs.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * $arla: ka-procs.h,v 1.4 2002/05/16 22:09:43 hin Exp $
- */
-
-#ifndef _ARLA_KA_PROCS_H
-#define _ARLA_KA_PROCS_H 1
-
-#include <ka.h>
-
-struct ka_Answer {
- uint32_t challange;
- des_cblock sessionkey;
- uint32_t start_time;
- uint32_t end_time;
- int kvno;
- char user[MAXKANAMELEN];
- char instance[MAXKANAMELEN];
- char realm[MAXKANAMELEN];
- char server_user[MAXKANAMELEN];
- char server_instance[MAXKANAMELEN];
- KTEXT_ST ticket;
- char label[KA_LABELSIZE];
-};
-
-typedef struct ka_Answer ka_auth_data_t;
-typedef struct ka_Answer ka_ticket_data_t;
-
-/*
- * `ka_cell_query' will be used to enable the interface to query
- * different servers then in the cell database.
- */
-
-struct ka_cell_query {
- int foo;
-};
-
-/*
- *
- */
-
-typedef enum { KA_AUTH_TICKET = 1,
- KA_AUTH_TOKEN = 2 } ka_auth_flags_t;
-
-int
-ka_authenticate (const char *user, const char *instance, const char *cell,
- const char *password, uint32_t lifetime,
- ka_auth_flags_t flags);
-
-int
-ka_auth (const char *user, const char *instance, const char *cell,
- des_cblock *key, ka_auth_data_t *adata,
- uint32_t lifetime, struct ka_cell_query *cinfo);
-
-int
-ka_getticket (const char *suser, const char *sinstance, const char *srealm,
- ka_auth_data_t *adata, ka_ticket_data_t *tdata,
- struct ka_cell_query *cinfo);
-
-/*
- * store requests to disk in form of a kerberos v4 ticket.
- */
-
-int
-ka_auth_create (char *filename, ka_auth_data_t *data);
-
-int
-ka_write_ticket (char *filename, ka_ticket_data_t *data);
-
-#endif /* _ARLA_KA_PROCS_H */
diff --git a/usr.sbin/afs/src/appl/lib/tokens.c b/usr.sbin/afs/src/appl/lib/tokens.c
deleted file mode 100644
index 472d350e9d8..00000000000
--- a/usr.sbin/afs/src/appl/lib/tokens.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2001, 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-
-RCSID("$arla: tokens.c,v 1.9 2003/02/01 17:01:11 lha Exp $");
-
-/*
- * Iterate over all tokens and apply `func' on all of them, passing
- * the user argument `arg' to func. If `cell' is used, only the token
- * of cell is passed to func.
- */
-
-int
-arlalib_token_iter (const char *cell, arlalib_token_iter_func func, void *arg)
-{
- uint32_t i;
- unsigned char data[4256];
- struct ViceIoctl parms;
- char token_cell[128];
- unsigned char secret[4000];
- size_t secret_sz;
- struct ClearToken ct;
- int ret;
-
- if (!k_hasafs())
- return ENOSYS;
-
- for (i = 0;; i++) {
- uint32_t sz;
- unsigned char *t = data;
-
- parms.in = (void *)&i;
- parms.in_size = sizeof(i);
- parms.out = (void *)data;
- parms.out_size = sizeof(data);
-
- if(k_pioctl(NULL, VIOCGETTOK, &parms, 0) != 0) {
- if(errno == EDOM)
- break;
- return EINVAL;
- }
-
- /* secret token, v4 or v5 ticket */
- memcpy (&sz, t, sizeof(sz));
- t += sizeof(sz);
- if (parms.out_size < t - data + sz)
- continue;
- if (sz > sizeof(secret))
- continue;
- memcpy (secret, t, sz);
- secret_sz = sz;
- t += sz;
-
- /* clear token */
- memcpy (&sz, t, sizeof(sz));
- t += sizeof(sz);
- if (parms.out_size < t - data + sz)
- continue;
- if (sz != sizeof(ct))
- continue;
- memcpy (&ct, t, sz);
- t += sz;
-
- t += 4; /* skip primary cell flag */
-
- /* cell name */
- data[sizeof(data) - 1] = '\0'; /* it should be zero terminated,
- but make sure it is */
- strlcpy(token_cell, t, sizeof(token_cell));
-
- if (cell == NULL || strcasecmp(token_cell, cell) == 0) {
- ret = (*func) (secret, secret_sz, &ct, token_cell, arg);
- memset (data, 0, sizeof(data));
- if (cell != NULL)
- return ret;
- }
- }
- memset (data, 0, sizeof(data));
- if (cell)
- return ENOENT;
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/mac/Arla_Configuration/Controller.h b/usr.sbin/afs/src/appl/mac/Arla_Configuration/Controller.h
deleted file mode 100644
index 178f6aa300c..00000000000
--- a/usr.sbin/afs/src/appl/mac/Arla_Configuration/Controller.h
+++ /dev/null
@@ -1,48 +0,0 @@
-#import <Cocoa/Cocoa.h>
-#include <Security/Authorization.h>
-#include <Security/AuthorizationTags.h>
-#import "DataSource.h"
-
-@interface Controller : NSObject
-{
- IBOutlet DataSource *dataSource;
- IBOutlet NSTableView *tableView;
- IBOutlet NSTabViewItem *cellSetupTab;
- IBOutlet NSTabViewItem *generalTab;
- IBOutlet NSTextField *authText;
- IBOutlet NSControl *saveButton;
- IBOutlet NSTextField *newCellName;
- IBOutlet NSControl *addButton;
- IBOutlet NSWindow *mainWindow;
- IBOutlet NSButton *startButton;
- IBOutlet NSControl *startText;
- IBOutlet NSControl *statusText;
- IBOutlet NSControl *startAtBoot;
- IBOutlet NSControl *maxBytes;
- IBOutlet NSControl *minBytes;
- IBOutlet NSControl *maxFiles;
- IBOutlet NSControl *minFiles;
- IBOutlet NSControl *defaultButton;
- IBOutlet NSControl *currentBytesText;
- IBOutlet NSProgressIndicator *currentBytesMeter;
- IBOutlet NSControl *maxBytesText;
- IBOutlet NSControl *currentFilesText;
- IBOutlet NSProgressIndicator *currentFilesMeter;
- IBOutlet NSControl *maxFilesText;
- IBOutlet NSButton *authButton;
- AuthorizationRef gAuthorization;
- Boolean gIsLocked;
- Boolean authColChanged;
- Boolean showColChanged;
- Boolean confChanged;
- int daemonState;
-}
-- (IBAction)addCell:(id)sender;
-- (IBAction)auth:(id)sender;
-- (IBAction)save:(id)sender;
-- (IBAction)startButton:(id) sender;
-- (IBAction)defaultButton:(id) sender;
-- (IBAction)confChanged:(id) sender;
-- (void) showChanged;
-- (void) authChanged;
-@end
diff --git a/usr.sbin/afs/src/appl/mac/Arla_Configuration/Controller.m b/usr.sbin/afs/src/appl/mac/Arla_Configuration/Controller.m
deleted file mode 100644
index b0779de05ff..00000000000
--- a/usr.sbin/afs/src/appl/mac/Arla_Configuration/Controller.m
+++ /dev/null
@@ -1,394 +0,0 @@
-#import "Controller.h"
-
-@implementation Controller
-
-- (IBAction)addCell:(id)sender
-{
- const char *s;
-
- if ([[newCellName stringValue] length] == 0)
- return;
- s = [[newCellName stringValue] cString];
- if (strchr(s, ' ')) {
- NSBeginAlertSheet(@"Error", @"OK", nil, nil, [tableView window], nil, nil, nil, NULL,
- @"Cell cannot contain spaces");
- return;
- }
- [ dataSource addRowWithAuth: [[NSNumber alloc] initWithInt: NSOnState]
- show: [[NSNumber alloc] initWithInt: NSOnState]
- cell: [newCellName stringValue]];
- [ tableView reloadData ];
- [ tableView scrollRowToVisible: ([tableView numberOfRows] - 1)];
-}
-
-- (BOOL) isChanged {
- if (authColChanged || showColChanged || confChanged)
- return TRUE;
- else
- return FALSE;
-}
-
-- (void) updateSaveButton {
- if ([self isChanged] &&
- !gIsLocked) {
- [saveButton setEnabled: TRUE];
- } else {
- [saveButton setEnabled: FALSE];
- }
-}
-
-- (void) showChanged {
- showColChanged = TRUE;
- [self updateSaveButton];
-}
-
-- (void) authChanged {
- authColChanged = TRUE;
- [self updateSaveButton];
-}
-
-- (void) confChanged {
- confChanged = TRUE;
- [self updateSaveButton];
-}
-
-- (void) setEnabled: (BOOL) status {
- int i;
- NSArray *cols;
-
- cols = [tableView tableColumns];
- for (i = 0; i < [cols count]; i++) {
- [[[cols objectAtIndex: i] dataCell] setEnabled: status];
- }
- [tableView setNeedsDisplay];
- [addButton setEnabled: status];
- [newCellName setEnabled: status];
- [maxBytes setEnabled: status];
- [minBytes setEnabled: status];
- [maxFiles setEnabled: status];
- [minFiles setEnabled: status];
- [defaultButton setEnabled: status];
- [startAtBoot setEnabled: status];
-}
-
-- (void) drawAuthState {
- NSImage *lockImage;
- NSBundle *mainBundle;
- NSString *lockImageName;
-
- mainBundle = [NSBundle mainBundle];
- if (gIsLocked)
- lockImageName = [mainBundle pathForResource: @"lock" ofType: @"tiff"];
- else
- lockImageName = [mainBundle pathForResource: @"unlock" ofType: @"tiff"];
-
- lockImage = [[NSImage alloc] initWithContentsOfFile: lockImageName];
-
- if (gIsLocked) {
- [authText setStringValue: @"Click the lock to make changes."];
- [self setEnabled: FALSE];
- } else {
- [authText setStringValue: @"Click the lock to prevent further changes."];
- [self setEnabled: TRUE];
- }
- [self updateSaveButton];
- [authButton setImage: lockImage];
-}
-
-- (void) drawDaemonState {
- if (gIsLocked) {
- [statusText setStringValue: @"Status unknown"];
- [startText setStringValue: @"You are unauthenticated"];
- [startButton setTitle: @"Start"];
- [startButton setEnabled: FALSE];
- return;
- }
- if (daemonState == 1) {
- [statusText setStringValue: @"AFS Client On"];
- [startText setStringValue: @"Click Stop to turn off the Arla AFS Client"];
- [startButton setTitle: @"Stop"];
- [startButton setEnabled: TRUE];
- } else {
- [statusText setStringValue: @"AFS Client Off"];
- [startText setStringValue: @"Click Start to turn on the Arla AFS Client"];
- [startButton setTitle: @"Start"];
- [startButton setEnabled: TRUE];
- }
-}
-
-- (void) setAuthState: (AuthorizationFlags) flags {
- AuthorizationItem rights[] =
- {
- { kAuthorizationRightExecute, 0, NULL, 0 }
- };
- AuthorizationRights rightSet = { 1, rights };
- OSStatus status;
-
- status = AuthorizationCopyRights(gAuthorization, &rightSet, kAuthorizationEmptyEnvironment, flags, NULL);
- if (status == errAuthorizationSuccess)
- gIsLocked = false;
- else
- gIsLocked = true;
-
- [self drawAuthState];
-}
-
-- (void) destroyAuthState {
- OSStatus status;
-
- status = AuthorizationFree(gAuthorization, kAuthorizationFlagDestroyRights);
- status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &gAuthorization);
- gIsLocked = true;
- [self drawAuthState];
-}
-
-- (void) setBytesMeter: (int) current max: (int) max {
- [currentBytesMeter setMaxValue: max];
- [currentBytesMeter setDoubleValue: current];
- [currentBytesText setStringValue: [NSString stringWithFormat: @"%d megabytes", current]];
- [maxBytesText setIntValue: max];
-}
-
-- (void) setFilesMeter: (int) current max: (int) max {
- [currentFilesMeter setMaxValue: max];
- [currentFilesMeter setDoubleValue: current];
- [currentFilesText setStringValue: [NSString stringWithFormat: @"%d files", current]];
- [maxFilesText setIntValue: max];
-}
-
-- (void) initCacheValues {
- int maxbytes, curbytes, maxfiles, curfiles, minbytes, minfiles;
-
- [dataSource getCache: gAuthorization
- maxBytes: &maxbytes minBytes: &minbytes
- maxFiles: &maxfiles minFiles: &minfiles
- curBytes: &curbytes curFiles: &curfiles];
-
- [self setBytesMeter: curbytes / (1024*1024) max: maxbytes / (1024*1024)];
- [self setFilesMeter: curfiles max: maxfiles];
-
- if (!confChanged) {
- [maxBytes setIntValue: maxbytes / (1024*1024)];
- [minBytes setIntValue: minbytes / (1024*1024)];
- [maxFiles setIntValue: maxfiles];
- [minFiles setIntValue: minfiles];
- }
-}
-
-- (void) awakeFromNib {
- AuthorizationFlags flags;
- OSStatus status;
-
- flags = kAuthorizationFlagDefaults;
-
- status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, flags, &gAuthorization);
-
- if (status == errAuthorizationSuccess) {
- [self setAuthState: flags];
- } else {
- gIsLocked = true;
- [self drawAuthState];
- }
- authColChanged = FALSE;
- showColChanged = FALSE;
- confChanged = FALSE;
- if (gIsLocked) {
- daemonState = -1;
- [self drawDaemonState];
- [startAtBoot setIntValue: 0];
- } else {
- daemonState = [DataSource getDaemonStatus: gAuthorization];
- [self drawDaemonState];
- [startAtBoot setIntValue: [dataSource getStartAtBoot: gAuthorization]];
- [self initCacheValues];
- }
-}
-
-- (IBAction)startButton: (id) sender {
- BOOL newDaemonState;
-
- [self setAuthState: kAuthorizationFlagDefaults];
-
- if (gIsLocked)
- return;
-
- if (daemonState == 1)
- [DataSource stopDaemon: gAuthorization];
- else {
- [DataSource startDaemon: gAuthorization];
- [self initCacheValues];
- }
-
- newDaemonState = [DataSource getDaemonStatus: gAuthorization];
- if ((newDaemonState == daemonState) || (newDaemonState == -1)) {
- if (daemonState)
- NSBeginAlertSheet(@"Error", @"OK", nil, nil, mainWindow, nil, nil, nil, NULL,
- @"Cannot stop Arla");
- else
- NSBeginAlertSheet(@"Error", @"OK", nil, nil, mainWindow, nil, nil, nil, NULL,
- @"Cannot start Arla");
- }
- daemonState = newDaemonState;
- [self drawDaemonState];
-}
-
-- (IBAction)auth:(id)sender {
- AuthorizationFlags flags;
-
- flags = kAuthorizationFlagInteractionAllowed | kAuthorizationFlagExtendRights;
-
- [self setAuthState: kAuthorizationFlagDefaults];
-
- if (gIsLocked) {
- [self setAuthState: flags];
- if (gIsLocked)
- return;
- daemonState = [DataSource getDaemonStatus: gAuthorization];
- [self drawDaemonState];
- [self initCacheValues];
- [startAtBoot setIntValue: [dataSource getStartAtBoot: gAuthorization]];
- } else {
- [self destroyAuthState];
- daemonState = -1;
- [self drawDaemonState];
- [self initCacheValues];
- [startAtBoot setIntValue: 0];
- }
-}
-
-
-- (IBAction)save:(id)sender {
- OSStatus status;
-
- [self setAuthState: kAuthorizationFlagDefaults];
-
- if (gIsLocked)
- return;
-
- if (authColChanged) {
- status = [dataSource saveAuthData: gAuthorization];
- if (status != noErr) {
- return;
- }
- authColChanged = FALSE;
- }
-
- if (showColChanged) {
- status = [dataSource saveShowData: gAuthorization];
- if (status != noErr) {
- return;
- }
- showColChanged = FALSE;
- }
-
- if (confChanged) {
- if ([maxBytes intValue] == 0) {
- NSBeginAlertSheet(@"Error", @"OK", nil, nil, mainWindow,
- nil, nil, nil, NULL,
- @"Maximum bytes must be non-zero");
- return;
- }
- if ([minBytes intValue] == 0) {
- NSBeginAlertSheet(@"Error", @"OK", nil, nil, mainWindow,
- nil, nil, nil, NULL,
- @"Minimum bytes must be non-zero");
- return;
- }
- if ([maxFiles intValue] == 0) {
- NSBeginAlertSheet(@"Error", @"OK", nil, nil, mainWindow,
- nil, nil, nil, NULL,
- @"Maximum files must be non-zero");
- return;
- }
- if ([minFiles intValue] == 0) {
- NSBeginAlertSheet(@"Error", @"OK", nil, nil, mainWindow,
- nil, nil, nil, NULL,
- @"Minimum files must be non-zero");
- return;
- }
- status = [dataSource saveConfData: gAuthorization
- maxBytes: [maxBytes intValue] * 1024 * 1024
- minBytes: [minBytes intValue] * 1024 * 1024
- maxFiles: [maxFiles intValue]
- minFiles: [minFiles intValue]
- startAtBoot: [startAtBoot intValue]
- ];
- if (status != noErr) {
- return;
- }
- confChanged = FALSE;
- [self initCacheValues];
- }
- [self updateSaveButton];
-}
-
-- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication {
- return YES;
-}
-
-- (void)windowWillClose:(NSNotification *)aNotification {
- mainWindow = nil;
-}
-
-- (void)willEndCloseSheet:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo {
- NSWindow *window = contextInfo;
-
- if (returnCode == NSAlertAlternateReturn) { /* "Don't Save" */
- [window close];
- [NSApp replyToApplicationShouldTerminate:YES];
- }
-}
-
-- (void)didEndCloseSheet:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo {
- NSWindow *window = contextInfo;
-
- if (returnCode == NSAlertDefaultReturn) { /* "Save" */
- [self save: self];
- [window close];
- [NSApp replyToApplicationShouldTerminate:YES];
- } else if (returnCode == NSAlertOtherReturn) { /* "Cancel" */
- [NSApp replyToApplicationShouldTerminate:NO];
- }
-}
-
-- (BOOL) windowShouldClose: (id) sender {
- [self setAuthState: kAuthorizationFlagDefaults];
-
- if ([self isChanged] && !gIsLocked) {
- NSBeginAlertSheet(@"Close", @"Save", @"Don't save", @"Cancel", sender, self,
- @selector(willEndCloseSheet:returnCode:contextInfo:),
- @selector(didEndCloseSheet:returnCode:contextInfo:),
- sender,
- @"Do you want to save changes before closing?");
- return NO;
- } else {
- [NSApp replyToApplicationShouldTerminate:YES];
- return YES;
- }
-}
-
-- (NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication *) app {
- if (mainWindow != nil) {
- [mainWindow performClose: self];
- return NSTerminateLater;
- } else
- return NSTerminateNow;
-}
-
-- (IBAction)defaultButton:(id) sender {
- [maxBytes abortEditing];
- [maxBytes setIntValue: 100];
- [minBytes abortEditing];
- [minBytes setIntValue: 90];
- [maxFiles abortEditing];
- [maxFiles setIntValue: 4000];
- [minFiles abortEditing];
- [minFiles setIntValue: 3000];
- [self confChanged];
-}
-
-- (IBAction)confChanged:(id) sender {
- [self confChanged];
-}
-
-@end
diff --git a/usr.sbin/afs/src/appl/mac/Arla_Configuration/DataSource.h b/usr.sbin/afs/src/appl/mac/Arla_Configuration/DataSource.h
deleted file mode 100644
index c2472b2f191..00000000000
--- a/usr.sbin/afs/src/appl/mac/Arla_Configuration/DataSource.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#import <Cocoa/Cocoa.h>
-#include <Security/Authorization.h>
-#include <Security/AuthorizationTags.h>
-
-@interface DataSource : NSObject
-{
- IBOutlet id authColumn;
- IBOutlet id cellNameColumn;
- IBOutlet id showColumn;
- IBOutlet id tableView;
- IBOutlet id controller;
-}
-- (void)addRowWithAuth: (NSNumber*)auth show: (NSNumber*)show cell: (NSString*)cell;
-- (OSStatus)saveShowData: (AuthorizationRef) gAuthorization;
-- (OSStatus)saveAuthData: (AuthorizationRef) gAuthorization;
-- (OSStatus)saveConfData: (AuthorizationRef) gAuthorization
- maxBytes: (int) maxBytes minBytes: (int) minBytes
- maxFiles: (int) maxFiles minFiles: (int) minFiles
- startAtBoot: (int) startAtBoot;
-- (int) getStartAtBoot: (AuthorizationRef) authorization;
-+ (int) getDaemonStatus: (AuthorizationRef) gAuthorization;
-+ (void) startDaemon: (AuthorizationRef) gAuthorization;
-+ (void) stopDaemon: (AuthorizationRef) gAuthorization;
-- (OSStatus)getCache: (AuthorizationRef) authorization
-maxBytes: (int *) maxBytes minBytes: (int *) minBytes
-maxFiles: (int *) maxFiles minFiles: (int *) minFiles
-curBytes: (int *) curBytes curFiles: (int *) curFiles;
-@end
diff --git a/usr.sbin/afs/src/appl/mac/Arla_Configuration/DataSource.m b/usr.sbin/afs/src/appl/mac/Arla_Configuration/DataSource.m
deleted file mode 100644
index bfa056cd9aa..00000000000
--- a/usr.sbin/afs/src/appl/mac/Arla_Configuration/DataSource.m
+++ /dev/null
@@ -1,704 +0,0 @@
-#import "DataSource.h"
-#import "ReadCells.h"
-#import "Controller.h"
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include <kafs.h>
-#include "config.h"
-#include <roken.h>
-#include <parse_units.h>
-#include <sys/wait.h>
-
-static struct units size_units[] = {
- { "M", 1024 * 1024 },
- { "k", 1024 },
- { NULL, 0 }
-};
-
-static void
-drainfile(FILE *f)
-{
- char buffer[100];
- while(fread(buffer, 1, sizeof(buffer), f) != 0);
-}
-
-static void
-drainproc()
-{
- pid_t pid;
- int status;
- do {
- pid = wait(&status);
- } while (pid != -1);
-}
-
-static int
-getdaemonpid(AuthorizationRef authorization, char *buffer, int len)
-{
- char *argv[3];
- OSStatus status;
- FILE *output;
- int n;
-
- argv[0] = "/var/run/arlad.pid";
- argv[1] = NULL;
-
- status = AuthorizationExecuteWithPrivileges(authorization, "/bin/cat", 0, argv, &output);
- if (status == noErr) {
- n = fread(buffer, 1, len - 1, output);
- if (n == 0) {
- fclose(output);
- return -1;
- }
- buffer[n] = '\0';
- fclose(output);
- drainproc();
- return 0;
- } else {
- return -1;
- }
-}
-
-static int
-checkdaemonpid(AuthorizationRef authorization, char *pid)
-{
- char *argv[4];
- OSStatus status;
- FILE *output;
- char buffer[1000];
- int n;
-
- argv[0] = "cocommand=";
- argv[1] = "-p";
- argv[2] = pid;
- argv[3] = NULL;
- status = AuthorizationExecuteWithPrivileges(authorization, "/bin/ps", 0, argv, &output);
- n = fread(buffer, 1, sizeof(buffer) - 1, output);
- if (n == 0) {
- fclose(output);
- return -1;
- }
- buffer[n] = '\0';
- fclose(output);
- drainproc();
- if (strcmp(buffer, "\narlad\n") == 0)
- return 1;
- return 0;
-}
-
-static int
-xfs_umount(AuthorizationRef authorization)
-{
- char *argv[2];
- OSStatus status;
- FILE *output;
-
- argv[0] = "/afs";
- argv[1] = NULL;
-
- status = AuthorizationExecuteWithPrivileges(authorization, "/usr/arla/sbin/umount_xfs", 0, argv, &output);
- if (status == noErr) {
- drainfile(output);
- fclose(output);
- drainproc();
- return 0;
- } else {
- return -1;
- }
-}
-
-static int
-xfs_mount(AuthorizationRef authorization)
-{
- char *argv[3];
- OSStatus status;
- FILE *output;
-
- argv[0] = "/dev/xfs0";
- argv[1] = "/afs";
- argv[2] = NULL;
-
- status = AuthorizationExecuteWithPrivileges(authorization, "/usr/arla/sbin/mount_xfs", 0, argv, &output);
- if (status == noErr) {
- drainfile(output);
- fclose(output);
- drainproc();
- return 0;
- } else {
- return -1;
- }
-}
-
-static int
-disktool_refresh(AuthorizationRef authorization)
-{
- char *argv[2];
- OSStatus status;
- FILE *output;
-
- argv[0] = "-r";
- argv[1] = NULL;
-
- status = AuthorizationExecuteWithPrivileges(authorization, "/usr/sbin/disktool", 0, argv, &output);
- if (status == noErr) {
- drainfile(output);
- fclose(output);
- drainproc();
- return 0;
- } else {
- return -1;
- }
-}
-
-static int
-stoparlad(AuthorizationRef authorization)
-{
- char *argv[3];
- OSStatus status;
- FILE *output;
- char pid[100];
- int ret;
-
- ret = getdaemonpid(authorization, pid, sizeof(pid));
- if (ret == -1)
- return -1;
-
- argv[0] = pid;
- argv[1] = NULL;
-
- status = AuthorizationExecuteWithPrivileges(authorization, "/bin/kill", 0, argv, &output);
- if (status == noErr) {
- drainfile(output);
- fclose(output);
- drainproc();
- return 0;
- } else {
- return -1;
- }
-}
-
-static int
-startarlad(AuthorizationRef authorization)
-{
- char *argv[3];
- OSStatus status;
- FILE *output;
-
- argv[0] = "-D";
- argv[1] = NULL;
-
- status = AuthorizationExecuteWithPrivileges(authorization, "/usr/arla/libexec/arlad", 0, argv, &output);
- if (status == noErr) {
- drainfile(output);
- fclose(output);
- drainproc();
- return 0;
- } else {
- return -1;
- }
-}
-
-static int
-kmodunload(AuthorizationRef authorization)
-{
- char *argv[3];
- OSStatus status;
- FILE *output;
-
- argv[0] = "-n";
- argv[1] = "xfs";
- argv[2] = NULL;
-
- status = AuthorizationExecuteWithPrivileges(authorization, "/sbin/kmodunload", 0, argv, &output);
- if (status == noErr) {
- drainfile(output);
- fclose(output);
- drainproc();
- return 0;
- } else {
- return -1;
- }
-}
-
-static int
-kmodload(AuthorizationRef authorization)
-{
- char *argv[3];
- OSStatus status;
- FILE *output;
-
- argv[0] = "/usr/arla/bin/xfs_mod.o";
- argv[1] = NULL;
-
- status = AuthorizationExecuteWithPrivileges(authorization, "/sbin/kmodload", 0, argv, &output);
- if (status == noErr) {
- drainfile(output);
- fclose(output);
- drainproc();
- return 0;
- } else {
- return -1;
- }
-}
-
-static int
-mkafsdir(AuthorizationRef authorization)
-{
- char *argv[3];
- OSStatus status;
- FILE *output;
-
- argv[0] = "/afs";
- argv[1] = NULL;
-
- status = AuthorizationExecuteWithPrivileges(authorization, "/bin/mkdir",
- 0, argv, &output);
- if (status == noErr) {
- drainfile(output);
- fclose(output);
- drainproc();
- return 0;
- } else {
- return -1;
- }
-}
-
-static int
-getcache(int *max_bytes, int *used_bytes, int *max_vnodes, int *used_vnodes,
- int *min_bytes, int *min_vnodes)
-{
- u_int32_t parms[16];
- struct ViceIoctl a_params;
-
- a_params.in_size = 0;
- a_params.out_size = sizeof(parms);
- a_params.in = NULL;
- a_params.out = (char *) parms;
-
- memset (parms, 0, sizeof(parms));
-
- if (!k_hasafs())
- return ENOSYS;
-
- if (k_pioctl (NULL, VIOCGETCACHEPARAMS , &a_params, 0) == -1)
- return errno;
-
- /* param[0] and param[1] send maxbytes and usedbytes in kbytes */
-
- if (max_vnodes)
- *max_vnodes = parms[2];
- if (used_vnodes)
- *used_vnodes = parms[3];
- if (max_bytes)
- *max_bytes = parms[4];
- if (used_bytes)
- *used_bytes = parms[5];
- if (min_bytes)
- *min_bytes = parms[6];
- if (min_vnodes)
- *min_vnodes = parms[7];
-
- return 0;
-}
-
-static int
-setcache(int max_bytes, int min_bytes, int max_vnodes, int min_vnodes,
- AuthorizationRef authorization)
-{
- char *argv[6];
- OSStatus status;
- FILE *output;
-
- argv[0] = "setcachesize";
- argv[1] = malloc(100);
- argv[2] = malloc(100);
- argv[3] = malloc(100);
- argv[4] = malloc(100);
- argv[5] = NULL;
-
- snprintf(argv[1], 100, "%d", min_vnodes);
- snprintf(argv[2], 100, "%d", max_vnodes);
- snprintf(argv[3], 100, "%d", min_bytes);
- snprintf(argv[4], 100, "%d", max_bytes);
-
- status = AuthorizationExecuteWithPrivileges(authorization,
- "/usr/arla/bin/fs",
- 0, argv, &output);
- if (status == noErr) {
- drainfile(output);
- fclose(output);
- drainproc();
- return 0;
- } else {
- return -1;
- }
-
- return 0;
-}
-
-@implementation DataSource
-
-NSMutableArray *authArray;
-NSMutableArray *showArray;
-NSMutableArray *cellArray;
-
-- (int) numberOfRowsInTableView:(NSTableView *) aTableView {
- return [ authArray count ];
-}
-
-- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int) row {
- if (tableColumn == authColumn)
- return [ authArray objectAtIndex: row ];
- else if (tableColumn == showColumn)
- return [ showArray objectAtIndex: row ];
- else if (tableColumn == cellNameColumn)
- return [ cellArray objectAtIndex: row ];
- else
- return nil;
-}
-
-- (void)tableView:(NSTableView *)aTableView setObjectValue:(id)anObject forTableColumn:(NSTableColumn *)aTableColumn
-row:(int)row {
- if (aTableColumn == authColumn) {
- NSTableView *t = tableView;
- NSNumber *value = anObject;
- [ authArray replaceObjectAtIndex: row withObject: anObject ];
- [controller authChanged];
- if ([value intValue] == NSOnState) {
- [ showArray replaceObjectAtIndex: row withObject: anObject ];
- [controller showChanged];
- }
- [ t reloadData ];
- }
- else if (aTableColumn == showColumn) {
- [ showArray replaceObjectAtIndex: row withObject: anObject ];
- [controller showChanged];
- }
- else if (aTableColumn == cellNameColumn) {
- [ cellArray replaceObjectAtIndex: row withObject: anObject ];
- }
-}
-
-- (void) awakeFromNib {
- NSButtonCell *aCell = [ [NSButtonCell alloc] init ];
- NSTableView *t = tableView;
-
- [aCell setButtonType: NSSwitchButton ];
- [aCell setTitle: @""];
-
- [authColumn setDataCell: aCell];
- [showColumn setDataCell: aCell];
- [aCell release];
-
- authArray = [ [NSMutableArray alloc] init ];
- showArray = [ [NSMutableArray alloc] init ];
- cellArray = [ [NSMutableArray alloc] init ];
-
- [ReadCells auth: authArray show: showArray cell: cellArray];
- [ t reloadData ];
-}
-
-- (void)addRowWithAuth: (NSNumber*)auth show: (NSNumber*)show cell: (NSString*)cell {
- [ authArray addObject: auth ];
- [ showArray addObject: show ];
- [ cellArray addObject: cell ];
- [ controller authChanged];
- [ controller showChanged];
-}
-
-- (void)deleteRow:(unsigned)row {
- [ authArray removeObjectAtIndex: row ];
- [ showArray removeObjectAtIndex: row ];
- [ cellArray removeObjectAtIndex: row ];
-}
-
-- (NSString *)getDataForArray: anArray {
- NSNumber *aNumber;
- NSString *resultString;
- int i;
- int count;
-
- count = [anArray count];
-
- resultString = @"";
-
- for (i = 0; i < count; i++) {
- aNumber = [anArray objectAtIndex: i];
- if ([aNumber intValue] == NSOnState) {
- resultString = [resultString stringByAppendingString: [cellArray objectAtIndex: i]];
- resultString = [resultString stringByAppendingString: @"\n"];
- }
- }
-
- return resultString;
-}
-
-- (OSStatus) fetchData: (NSMutableString *) data file: (char *) file auth: (AuthorizationRef) authorization {
- char *argv[2];
- OSStatus status;
- FILE *output;
- char buffer[1000];
- int n;
-
- argv[0] = file;
- argv[1] = NULL;
-
- status = AuthorizationExecuteWithPrivileges(authorization, "/bin/cat", 0, argv, &output);
- if (status == noErr) {
- n = fread(buffer, 1, sizeof(buffer) - 1, output);
- if (n == 0) {
- fclose(output);
- return -1;
- }
- buffer[n] = '\0';
- fclose(output);
- drainproc();
- [data appendString: [[NSString alloc] initWithCString: buffer]];
- return 0;
- } else {
- return -1;
- }
-}
-
-- (OSStatus) storeData: (NSString *) data file: (char *) file auth: (AuthorizationRef) authorization {
- const char *s;
- char *argv[2];
- OSStatus status;
- FILE *output;
-
- argv[0] = file;
- argv[1] = NULL;
-
- status = AuthorizationExecuteWithPrivileges(authorization, "/usr/bin/tee", 0, argv, &output);
- if (status == noErr) {
- s = [data cString];
- fwrite(s, [data length], 1, output);
- fclose(output);
- drainproc();
- return noErr;
- } else {
- return status;
- }
-}
-
-- (OSStatus)saveShowData: (AuthorizationRef) authorization {
- NSString *data;
- data = [self getDataForArray: showArray];
- return [self storeData: data file: "/usr/arla/etc/DynRootDB" auth: authorization];
-}
-
-- (OSStatus)saveAuthData: (AuthorizationRef) authorization {
- NSString *data;
- data = [self getDataForArray: authArray];
- return [self storeData: data file: "/usr/arla/etc/TheseCells" auth: authorization];
-}
-
-- (NSDictionary *) parseConfLine: (const char *) line {
- char *save = NULL;
- char *n;
- char *v;
- unsigned val;
- char *endptr;
- char *line1;
- NSDictionary *dict;
-
- if (line[0] == '#')
- return nil;
-
- line1 = strdup(line);
- if (line1 == NULL)
- return nil;
-
- n = strtok_r (line1, " \t", &save);
- if (n == NULL) {
- free(line1);
- return nil;
- }
-
- v = strtok_r (NULL, " \t", &save);
- if (v == NULL) {
- free(line1);
- return nil;
- }
-
- val = parse_units(v, size_units, NULL);
- if(val == (unsigned)-1) {
- val = strtol(v, &endptr, 0);
- if (endptr == v) {
- free(line1);
- return nil;
- }
- }
-
- dict = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt: val]
- forKey: [NSString stringWithCString: n]];
- free(line1);
- return dict;
-}
-
-- (void)parseConf: (NSString *) data dict: (NSMutableDictionary *) dict {
- NSRange curRange;
- NSRange nextRange;
- NSMutableCharacterSet *newLine;
- NSDictionary *linedict;
-
- unsigned length = [data length];
-
- newLine = [[NSMutableCharacterSet alloc] init];
- [newLine addCharactersInString: @"\n"];
-
- curRange.location = 0;
- while(1) {
- curRange.length = length - curRange.location;
- nextRange = [data rangeOfCharacterFromSet: newLine
- options: NSLiteralSearch
- range: curRange];
- if (nextRange.length == 0)
- break;
- curRange.length = nextRange.location - curRange.location;
- linedict = [self parseConfLine:
- [[data substringWithRange: curRange] cString]];
- if (dict)
- [dict addEntriesFromDictionary: linedict];
-
- curRange.location = nextRange.location + nextRange.length;
- }
-}
-
-- (void)writeConf: (NSMutableString *) data dict: (NSDictionary *) dict {
-
- NSEnumerator *enumerator = [dict keyEnumerator];
- NSString *key;
-
- while ((key = [enumerator nextObject])) {
- [data appendString: [NSString stringWithFormat: @"%s %d\n",
- [key cString],
- [[dict objectForKey: key] intValue]]];
- }
-}
-
-- (OSStatus)getCache: (AuthorizationRef) authorization
- maxBytes: (int *) maxBytes minBytes: (int *) minBytes
- maxFiles: (int *) maxFiles minFiles: (int *) minFiles
- curBytes: (int *) curBytes curFiles: (int *) curFiles {
- NSMutableString *data;
- NSMutableDictionary *dict;
-
- if (getcache(maxBytes, curBytes, maxFiles, curFiles,
- minBytes, minFiles) == 0)
- return 0;
-
- data = [[[NSMutableString alloc] init] autorelease];
- dict = [[[NSMutableDictionary alloc] init] autorelease];
-
- [self fetchData: data file: "/usr/arla/etc/arla.conf" auth: authorization];
-
- [self parseConf: data dict: dict];
-
- *maxBytes = [[dict objectForKey: @"high_bytes"] intValue];
- *minBytes = [[dict objectForKey: @"low_bytes"] intValue];
- *maxFiles = [[dict objectForKey: @"high_vnodes"] intValue];
- *minFiles = [[dict objectForKey: @"low_vnodes"] intValue];
- *curBytes = 0;
- *curFiles = 0;
-
- return 0;
-}
-
-
-- (OSStatus)saveConfData: (AuthorizationRef) authorization
- maxBytes: (int) maxBytes minBytes: (int) minBytes
- maxFiles: (int) maxFiles minFiles: (int) minFiles
- startAtBoot: (int) startAtBoot {
- NSMutableString *data;
- NSMutableDictionary *dict;
-
- data = [[NSMutableString alloc] init];
- dict = [[NSMutableDictionary alloc] init];
-
- [self fetchData: data file: "/usr/arla/etc/arla.conf" auth: authorization];
-
- [self parseConf: data dict: dict];
-
- [data setString: @""];
-
- [dict setObject: [NSNumber numberWithInt: maxBytes]
- forKey: @"high_bytes"];
- [dict setObject: [NSNumber numberWithInt: minBytes]
- forKey: @"low_bytes"];
- [dict setObject: [NSNumber numberWithInt: maxFiles]
- forKey: @"high_vnodes"];
- [dict setObject: [NSNumber numberWithInt: minFiles]
- forKey: @"low_vnodes"];
-
- [self writeConf: data dict: dict];
-
- [self storeData: data file: "/usr/arla/etc/arla.conf" auth: authorization];
-
- setcache(maxBytes, minBytes, maxFiles, minFiles, authorization);
-
- if (startAtBoot)
- [self storeData: @"yes" file: "/usr/arla/etc/startatboot"
- auth: authorization];
- else
- [self storeData: @"no" file: "/usr/arla/etc/startatboot"
- auth: authorization];
-
- return 0;
-}
-
-- (int) getStartAtBoot: (AuthorizationRef) authorization {
- NSMutableString *data;
- OSStatus status;
-
- data = [[[NSMutableString alloc] init] autorelease];
-
- status = [self fetchData: data
- file: "/usr/arla/etc/startatboot"
- auth: authorization];
- if (status)
- return 0;
- if (strcmp([data cString], "yes") == 0)
- return 1;
- return 0;
-}
-
-+ (int) getDaemonStatus: (AuthorizationRef) authorization {
- int ret;
- char buffer[1000];
-
- ret = getdaemonpid(authorization, buffer, sizeof(buffer));
- if (ret == -1)
- return -1;
-
- ret = checkdaemonpid(authorization, buffer);
- return ret;
-}
-
-+ (void) startDaemon: (AuthorizationRef) authorization {
- int i;
- struct timeval t;
-
- mkafsdir(authorization);
- kmodload(authorization);
- startarlad(authorization);
- for (i = 0; i < 40; i++) {
- if ([self getDaemonStatus: authorization] == 1)
- break;
- t.tv_sec = 0;
- t.tv_usec = 250000;
- select(0, NULL, NULL, NULL, &t);
- }
- xfs_mount(authorization);
- disktool_refresh(authorization);
-}
-
-+ (void) stopDaemon: (AuthorizationRef) authorization {
- xfs_umount(authorization);
- disktool_refresh(authorization);
- stoparlad(authorization);
- kmodunload(authorization);
-}
-
-
-@end
diff --git a/usr.sbin/afs/src/appl/mac/Arla_Configuration/Info.plist.in b/usr.sbin/afs/src/appl/mac/Arla_Configuration/Info.plist.in
deleted file mode 100644
index 885af22a330..00000000000
--- a/usr.sbin/afs/src/appl/mac/Arla_Configuration/Info.plist.in
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
-<plist version="0.9">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>arlaconf</string>
- <key>CFBundleName</key>
- <string>Arla Configuration</string>
- <key>CFBundleIconFile</key>
- <string>arla.icns</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>@VERSION@</string>
- <key>NSMainNibFile</key>
- <string>dialog</string>
- <key>NSPrincipalClass</key>
- <string>NSApplication</string>
-</dict>
-</plist>
diff --git a/usr.sbin/afs/src/appl/mac/Arla_Configuration/Makefile.in b/usr.sbin/afs/src/appl/mac/Arla_Configuration/Makefile.in
deleted file mode 100644
index be6790b7ef0..00000000000
--- a/usr.sbin/afs/src/appl/mac/Arla_Configuration/Makefile.in
+++ /dev/null
@@ -1,116 +0,0 @@
-# $KTH: Makefile.in,v 1.3.2.6 2002/02/01 20:15:50 ahltorp Exp $
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-top_builddir = ../../..
-VPATH = @srcdir@
-
-CC = @CC@
-LN_S = @LN_S@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-mandir = @mandir@
-transform = @program_transform_name@
-EXECSUFFIX = @EXECSUFFIX@
-
-progdir = $(bindir)/ArlaConfiguration.app
-contentsdir = $(progdir)/Contents
-macosdir = $(contentsdir)/MacOS
-resourcesdir = $(contentsdir)/Resources
-
-DEFS = @DEFS@
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-
-ETAGS = etags
-MAKEDEPEND = makedepend
-INCLUDES = -I$(top_srcdir) \
- -I$(top_srcdir)/include \
- -I$(top_srcdir)/appl/lib \
- -I$(top_builddir)/rxdef \
- -I$(top_builddir)/include \
- -I. \
- @INC_roken@ \
-
-DEFINES =
-REALCFLAGS = $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS)
-KERNEL_INCLUDE = @KERNEL_INCLUDE@
-KAFS_LIBS = @AIX_EXTRA_KAFS@ @KAFS_LIBS@
-LIBS = -L../../../lib/ko -lko -L../../../util -lutil \
- -framework Cocoa -framework Security \
- @LIB_roken@ \
- $(KAFS_LIBS) \
- @LIBS@
-
-LIBDEPENDS = ../../../util/libutil.a ../../../lib/ko/libko.a
-
-PROGS = arlaconf
-
-ARLACONF_SRCS = Controller.m DataSource.m ReadCells.m main.m
-
-SRCS = $(ARLACONF_SRCS)
-ARLACONF_OBJS = $(ARLACONF_SRCS:.m=.o)
-
-HDRS = Controller.h DataSource.h ReadCells.h
-
-all: $(PROGS)
-
-.PHONY: all install uninstall depend tags clean
-
-.m.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(progdir)
- $(MKINSTALLDIRS) $(DESTDIR)$(contentsdir)
- $(MKINSTALLDIRS) $(DESTDIR)$(macosdir)
- $(MKINSTALLDIRS) $(DESTDIR)$(resourcesdir)
- $(MKINSTALLDIRS) $(DESTDIR)$(resourcesdir)/dialog.nib
- $(INSTALL_PROGRAM) arlaconf $(DESTDIR)$(macosdir)
- $(INSTALL_DATA) Info.plist $(DESTDIR)$(contentsdir)
- $(INSTALL_DATA) $(srcdir)/PkgInfo $(DESTDIR)$(contentsdir)
- $(INSTALL_DATA) $(srcdir)/arla.icns $(DESTDIR)$(resourcesdir)
- $(INSTALL_DATA) $(srcdir)/lock.tiff $(DESTDIR)$(resourcesdir)
- $(INSTALL_DATA) $(srcdir)/unlock.tiff $(DESTDIR)$(resourcesdir)
- $(INSTALL_DATA) $(srcdir)/dialog.nib/classes.nib $(DESTDIR)$(resourcesdir)/dialog.nib
- $(INSTALL_DATA) $(srcdir)/dialog.nib/info.nib $(DESTDIR)$(resourcesdir)/dialog.nib
- $(INSTALL_DATA) $(srcdir)/dialog.nib/objects.nib $(DESTDIR)$(resourcesdir)/dialog.nib
-
-uninstall:
- rm -rf $(DESTDIR)$(progdir)
-
-arlaconf: $(ARLACONF_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(ARLACONF_OBJS) $(LIBS)
-
-Makefile: Makefile.in ../../../config.status
- cd ../../..; CONFIG_FILES=appl/mac/Arla_Configuration/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(CFILES)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(PROGS) $(OBJS) *~ *.o core
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/appl/mac/Arla_Configuration/PkgInfo b/usr.sbin/afs/src/appl/mac/Arla_Configuration/PkgInfo
deleted file mode 100644
index bd04210fb49..00000000000
--- a/usr.sbin/afs/src/appl/mac/Arla_Configuration/PkgInfo
+++ /dev/null
@@ -1 +0,0 @@
-APPL???? \ No newline at end of file
diff --git a/usr.sbin/afs/src/appl/mac/Arla_Configuration/ReadCells.h b/usr.sbin/afs/src/appl/mac/Arla_Configuration/ReadCells.h
deleted file mode 100644
index 578bd34fa57..00000000000
--- a/usr.sbin/afs/src/appl/mac/Arla_Configuration/ReadCells.h
+++ /dev/null
@@ -1,9 +0,0 @@
-@interface ReadCells : NSObject
-
-+ (int)
-auth: (NSMutableArray *) authArray
-show: (NSMutableArray *) showArray
-cell: (NSMutableArray *) cellArray;
-
-
-@end
diff --git a/usr.sbin/afs/src/appl/mac/Arla_Configuration/ReadCells.m b/usr.sbin/afs/src/appl/mac/Arla_Configuration/ReadCells.m
deleted file mode 100644
index 88d8330b804..00000000000
--- a/usr.sbin/afs/src/appl/mac/Arla_Configuration/ReadCells.m
+++ /dev/null
@@ -1,88 +0,0 @@
-#import <Cocoa/Cocoa.h>
-#import "ReadCells.h"
-#include <stdio.h>
-#include <string.h>
-
-#define CELLSERVDB "/usr/arla/etc/CellServDB"
-#define THESECELLS "/usr/arla/etc/TheseCells"
-#define THISCELL "/usr/arla/etc/ThisCell"
-#define DYNROOTDB "/usr/arla/etc/DynRootDB"
-
-static char *
-getcell (char *line)
-{
- int len;
-
- len = strcspn (line, " \t#");
- line[len] = '\0';
- return line;
-}
-
-@implementation ReadCells
-
-+ (int)
-auth: (NSMutableArray *) authArray
-show: (NSMutableArray *) showArray
-cell: (NSMutableArray *) cellArray {
- FILE *f;
- char line[256];
- int lineno = 0;
- char *cell;
- int arrayindex;
-
- f = fopen (CELLSERVDB, "r");
- if (f != NULL) {
- while (fgets (line, sizeof (line), f)) {
- ++lineno;
- line[strlen(line) - 1] = '\0';
- if (line[0] == '#' || line[0] == '\0')
- continue;
- if (line[0] == '>') {
- cell = getcell (&line[1]);
- [ authArray addObject: [[NSNumber alloc] initWithInt: NSOffState] ];
- [ showArray addObject: [[NSNumber alloc] initWithInt: NSOffState] ];
- [ cellArray addObject: [[NSString alloc] initWithCString: cell] ];
- }
- }
- fclose (f);
- }
-
- f = fopen(THESECELLS, "r");
- if (f != NULL) {
- while (fgets (line, sizeof (line), f)) {
- ++lineno;
- line[strlen(line) - 1] = '\0';
- arrayindex = [cellArray indexOfObject: [[NSString alloc] initWithCString: line]];
- if (arrayindex == NSNotFound) {
- [ authArray addObject: [[NSNumber alloc] initWithInt: NSOnState] ];
- [ showArray addObject: [[NSNumber alloc] initWithInt: NSOffState] ];
- [ cellArray addObject: [[NSString alloc] initWithCString: line] ];
- } else {
- [ authArray replaceObjectAtIndex: arrayindex
- withObject: [[NSNumber alloc] initWithInt: NSOnState]];
- }
- }
- fclose (f);
- }
-
- f = fopen(DYNROOTDB, "r");
- if (f != NULL) {
- while (fgets (line, sizeof (line), f)) {
- ++lineno;
- line[strlen(line) - 1] = '\0';
- arrayindex = [cellArray indexOfObject: [[NSString alloc] initWithCString: line]];
- if (arrayindex == NSNotFound) {
- [ authArray addObject: [[NSNumber alloc] initWithInt: NSOffState] ];
- [ showArray addObject: [[NSNumber alloc] initWithInt: NSOnState] ];
- [ cellArray addObject: [[NSString alloc] initWithCString: line] ];
- } else {
- [ showArray replaceObjectAtIndex: arrayindex
- withObject: [[NSNumber alloc] initWithInt: NSOnState]];
- }
- }
- fclose (f);
- }
-
- return 0;
-}
-@end
diff --git a/usr.sbin/afs/src/appl/mac/Arla_Configuration/arla.icns b/usr.sbin/afs/src/appl/mac/Arla_Configuration/arla.icns
deleted file mode 100644
index 323aa9bbd03..00000000000
--- a/usr.sbin/afs/src/appl/mac/Arla_Configuration/arla.icns
+++ /dev/null
Binary files differ
diff --git a/usr.sbin/afs/src/appl/mac/Arla_Configuration/dialog.nib/classes.nib b/usr.sbin/afs/src/appl/mac/Arla_Configuration/dialog.nib/classes.nib
deleted file mode 100644
index 4b83499f89a..00000000000
--- a/usr.sbin/afs/src/appl/mac/Arla_Configuration/dialog.nib/classes.nib
+++ /dev/null
@@ -1,80 +0,0 @@
-{
- IBClasses = (
- {
- ACTIONS = {
- addCell = id;
- auth = id;
- confChanged = id;
- defaultButton = id;
- save = id;
- startButton = id;
- };
- CLASS = Controller;
- LANGUAGE = ObjC;
- OUTLETS = {
- addButton = id;
- authButton = id;
- authText = id;
- cellSetupTab = id;
- currentBytesMeter = id;
- currentBytesText = id;
- currentFilesMeter = id;
- currentFilesText = id;
- dataSource = id;
- defaultButton = id;
- generalTab = id;
- mainWindow = id;
- maxBytes = id;
- maxBytesText = id;
- maxFiles = id;
- maxFilesText = id;
- minBytes = id;
- minFiles = id;
- newCellName = id;
- saveButton = id;
- startAtBoot = id;
- startButton = id;
- startText = id;
- statusText = id;
- tableView = id;
- };
- SUPERCLASS = NSObject;
- },
- {
- CLASS = DataSource;
- LANGUAGE = ObjC;
- OUTLETS = {
- authColumn = id;
- cellNameColumn = id;
- controller = id;
- showColumn = id;
- tableView = id;
- };
- SUPERCLASS = NSObject;
- },
- {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
- {CLASS = MyMyTableColumn; LANGUAGE = ObjC; SUPERCLASS = MyTableColumn; },
- {CLASS = MyTableColumn; LANGUAGE = ObjC; SUPERCLASS = NSTableColumn; },
- {CLASS = NSActionCell; LANGUAGE = ObjC; SUPERCLASS = NSCell; },
- {
- ACTIONS = {performClick = id; };
- CLASS = NSButtonCell;
- LANGUAGE = ObjC;
- SUPERCLASS = NSActionCell;
- },
- {
- ACTIONS = {
- performClick = id;
- takeDoubleValueFrom = id;
- takeFloatValueFrom = id;
- takeIntValueFrom = id;
- takeObjectValueFrom = id;
- takeStringValueFrom = id;
- };
- CLASS = NSCell;
- LANGUAGE = ObjC;
- SUPERCLASS = NSObject;
- }
- );
- IBVersion = 1;
-} \ No newline at end of file
diff --git a/usr.sbin/afs/src/appl/mac/Arla_Configuration/dialog.nib/info.nib b/usr.sbin/afs/src/appl/mac/Arla_Configuration/dialog.nib/info.nib
deleted file mode 100644
index 7ff55f73a15..00000000000
--- a/usr.sbin/afs/src/appl/mac/Arla_Configuration/dialog.nib/info.nib
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
-<plist version="0.9">
-<dict>
- <key>IBDocumentLocation</key>
- <string>525 124 427 540 0 84 1024 662 </string>
- <key>IBMainMenuLocation</key>
- <string>36 497 336 44 0 84 1024 662 </string>
- <key>IBUserGuides</key>
- <dict>
- <key>Arla Configuration</key>
- <dict>
- <key>guideLocations</key>
- <array>
- <string>Horizontal:80.000000</string>
- <string>Vertical:20.000000</string>
- <string>Horizontal:60.000000</string>
- <string>Vertical:505.000000</string>
- </array>
- <key>guidesLocked</key>
- <string>NO</string>
- </dict>
- <key>Window</key>
- <dict>
- <key>guideLocations</key>
- <array/>
- <key>guidesLocked</key>
- <string>NO</string>
- </dict>
- </dict>
-</dict>
-</plist>
diff --git a/usr.sbin/afs/src/appl/mac/Arla_Configuration/dialog.nib/objects.nib b/usr.sbin/afs/src/appl/mac/Arla_Configuration/dialog.nib/objects.nib
deleted file mode 100644
index 6597ea540d2..00000000000
--- a/usr.sbin/afs/src/appl/mac/Arla_Configuration/dialog.nib/objects.nib
+++ /dev/null
Binary files differ
diff --git a/usr.sbin/afs/src/appl/mac/Arla_Configuration/lock.tiff b/usr.sbin/afs/src/appl/mac/Arla_Configuration/lock.tiff
deleted file mode 100644
index 281696f5ef9..00000000000
--- a/usr.sbin/afs/src/appl/mac/Arla_Configuration/lock.tiff
+++ /dev/null
Binary files differ
diff --git a/usr.sbin/afs/src/appl/mac/Arla_Configuration/main.m b/usr.sbin/afs/src/appl/mac/Arla_Configuration/main.m
deleted file mode 100644
index b849d40786d..00000000000
--- a/usr.sbin/afs/src/appl/mac/Arla_Configuration/main.m
+++ /dev/null
@@ -1,6 +0,0 @@
-#import <Cocoa/Cocoa.h>
-
-int main(int argc, const char *argv[])
-{
- return NSApplicationMain(argc, argv);
-}
diff --git a/usr.sbin/afs/src/appl/mac/Arla_Configuration/unlock.tiff b/usr.sbin/afs/src/appl/mac/Arla_Configuration/unlock.tiff
deleted file mode 100644
index e99e78b7736..00000000000
--- a/usr.sbin/afs/src/appl/mac/Arla_Configuration/unlock.tiff
+++ /dev/null
Binary files differ
diff --git a/usr.sbin/afs/src/appl/mac/Makefile.in b/usr.sbin/afs/src/appl/mac/Makefile.in
deleted file mode 100644
index 71a30221007..00000000000
--- a/usr.sbin/afs/src/appl/mac/Makefile.in
+++ /dev/null
@@ -1,50 +0,0 @@
-# $KTH: Makefile.in,v 1.1.2.1 2001/05/17 18:54:18 ahltorp Exp $
-
-srcdir = @srcdir@
-top_builddir = ..
-VPATH = @srcdir@
-
-SHELL = /bin/sh
-
-SUBDIRS = Arla_Configuration
-
-all:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-clean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-realclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-distclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-mostlyclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-install:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-uninstall:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-Makefile: Makefile.in ../../config.status
- cd ../.. ; CONFIG_FILES=appl/mac/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-
-.PHONY: all clean realclean distclean mostlyclean install uninstall
diff --git a/usr.sbin/afs/src/appl/mac/make-mac-package.sh b/usr.sbin/afs/src/appl/mac/make-mac-package.sh
deleted file mode 100644
index 6873c387a06..00000000000
--- a/usr.sbin/afs/src/appl/mac/make-mac-package.sh
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/sh
-
-name=`basename $0`
-
-if [ $# = 0 ]; then
- echo "$name version"
- exit
-fi
-
-DESTDIR=`pwd`/arlapackage
-
-mkdir $DESTDIR
-mkdir $DESTDIR/usr
-mkdir $DESTDIR/usr/arla
-mkdir $DESTDIR/Applications
-mkdir $DESTDIR/Applications/Arla
-mkdir -p $DESTDIR/Library/StartupItems/Arla
-
-cp -Rp /usr/arla/bin $DESTDIR/usr/arla
-cp -Rp /usr/arla/cache $DESTDIR/usr/arla
-cp -Rp /usr/arla/etc $DESTDIR/usr/arla
-cp -Rp /usr/arla/include $DESTDIR/usr/arla
-cp -Rp /usr/arla/info $DESTDIR/usr/arla
-cp -Rp /usr/arla/lib $DESTDIR/usr/arla
-cp -Rp /usr/arla/libexec $DESTDIR/usr/arla
-cp -Rp /usr/arla/man $DESTDIR/usr/arla
-cp -Rp /usr/arla/sbin $DESTDIR/usr/arla
-cp -Rp "/usr/arla/Arla Configuration.app" $DESTDIR/Applications/Arla
-
-cat > $DESTDIR/Library/StartupItems/Arla/Arla <<'EOF'
-#!/bin/sh
-if [ -f /usr/arla/etc/startatboot ]; then
- if [ `cat /usr/arla/etc/startatboot` = "yes" ]; then
- test -d /afs || mkdir /afs
- /sbin/kmodload /usr/arla/bin/xfs_mod.o
- /usr/arla/libexec/arlad -D
- /usr/arla/sbin/mount_xfs /dev/xfs0 /afs
- /usr/sbin/disktool -r
- fi
-fi
-EOF
-chmod +x $DESTDIR/Library/StartupItems/Arla/Arla
-
-cat > $DESTDIR/Library/StartupItems/Arla/StartupParameters.plist <<EOF
-{
- Description = "Arla AFS Client";
- Provides = ("AFS");
- Requires = ("Network");
- OrderPreference = "None";
- Messages =
- {
- start = "Starting Arla AFS Client";
- stop = "Stopping Arla AFS Client";
- }
-}
-EOF
-
-cat > arla.info <<"EOF"
-Title Arla
-Version $1
-Description
-DefaultLocation /
-Diskname (null)
-DeleteWarning
-NeedsAuthorization YES
-DisableStop NO
-UseUserMask NO
-Application NO
-Relocatable NO
-Required NO
-InstallOnly NO
-RequiresReboot NO
-InstallFat NO
-EOF
-
-/usr/bin/package $DESTDIR arla.info
-tar cf arla-$1.pkg.tar arla.pkg
-gzip arla-$1.pkg.tar
diff --git a/usr.sbin/afs/src/appl/perf/afsfsperf.c b/usr.sbin/afs/src/appl/perf/afsfsperf.c
deleted file mode 100644
index 23c28c42526..00000000000
--- a/usr.sbin/afs/src/appl/perf/afsfsperf.c
+++ /dev/null
@@ -1,912 +0,0 @@
-/*
- * Copyright (c) 1999 - 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-RCSID("$arla: afsfsperf.c,v 1.11 2003/06/10 16:13:39 lha Exp $");
-
-#include <sys/types.h>
-#include <stdio.h>
-#include <assert.h>
-#include <err.h>
-
-#include <service.h>
-
-#include <cb.ss.h>
-#include <fs.cs.h>
-
-#ifdef HAVE_OPENSSL
-#include <openssl/des.h>
-#else
-#include <des.h>
-#endif
-#ifdef HAVE_KRB4
-#include <krb.h>
-#endif
-
-#include <rx/rx.h>
-#include <rx/rx_null.h>
-#include <rx/rxgencon.h>
-#include <rxkad/rxkad.h>
-
-#include <atypes.h>
-
-#include <arlalib.h>
-#include <ports.h>
-#include <service.h>
-
-#include <agetarg.h>
-
-#include <roken.h>
-#include <parse_units.h>
-
-#include <vers.h>
-
-static char *arg_cell = NULL;
-static int arg_smallrun = 0;
-static int arg_version = 0;
-static char *arg_test_to_run = "all";
-
-/*
- * Each client need a callbackserver, here we go...
- */
-
-int
-SRXAFSCB_Probe (struct rx_call *a_rxCallP)
-{
- return 0;
-}
-
-int
-SRXAFSCB_InitCallBackState (struct rx_call *a_rxCallP)
-{
- return 0;
-}
-
-int
-SRXAFSCB_CallBack (struct rx_call *a_rxCallP,
- const AFSCBFids *a_fidArrayP,
- const AFSCBs *a_callBackArrayP)
-{
- return 0;
-}
-
-
-int
-SRXAFSCB_GetLock(struct rx_call *a_rxCallP,
- int32_t index,
- AFSDBLock *lock)
-{
- return 1;
-}
-
-int
-SRXAFSCB_GetCE(struct rx_call *a_rxCallP,
- int32_t index,
- AFSDBCacheEntry *dbentry)
-{
- return 1;
-}
-
-int
-SRXAFSCB_XStatsVersion(struct rx_call *a_rxCallP,
- int32_t *version)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_GetXStats(struct rx_call *a_rxCallP,
- int32_t client_version_num,
- int32_t collection_number,
- int32_t *server_version_number,
- int32_t *time,
- AFSCB_CollData *stats)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_InitCallBackState2(struct rx_call *a_rxCallP,
- interfaceAddr *addr)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_WhoAreYou(struct rx_call *a_rxCallP,
- interfaceAddr *addr)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_InitCallBackState3(struct rx_call *a_rxCallP,
- const afsUUID *server_uuid)
-{
- return 0;
-}
-
-int
-SRXAFSCB_ProbeUUID(struct rx_call *a_rxCallP,
- const afsUUID *uuid)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_GetCellServDB(struct rx_call *a_rxCallP,
- const int32_t cellIndex,
- char *cellName,
- serverList *cellHosts)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_GetLocalCell(struct rx_call *a_rxCallP,
- char *cellName)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_GetCacheConfig(struct rx_call *a_rxCallP,
- const uint32_t callerVersion,
- uint32_t *serverVersion,
- uint32_t *configCount,
- cacheConfig *config)
-{
- *serverVersion = 0;
- *configCount = 0;
- config->len = 0;
- config->val = NULL;
-
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_GetCellByNum(struct rx_call *call,
- const int32_t cellNumber,
- char *cellName,
- serverList *cellHosts)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_TellMeAboutYourself(struct rx_call *call,
- struct interfaceAddr *addr,
- Capabilities *capabilities)
-{
- capabilities->len = 0;
- capabilities->val = NULL;
- return RXGEN_OPCODE;
-}
-
-
-static void
-cmcb_init (void)
-{
- static struct rx_securityClass *nullSecObjP;
- static struct rx_securityClass *(securityObjects[1]);
-
- nullSecObjP = rxnull_NewClientSecurityObject ();
- if (nullSecObjP == NULL) {
- printf("Cannot create null security object.\n");
- return;
- }
-
- securityObjects[0] = nullSecObjP;
-
- if (rx_NewService (0, CM_SERVICE_ID, "cm", securityObjects,
- sizeof(securityObjects) / sizeof(*securityObjects),
- RXAFSCB_ExecuteRequest) == NULL ) {
- printf("Cannot install service.\n");
- return;
- }
- rx_StartServer (0);
-}
-
-/*
- *
- */
-
-static int timer_check = 0;
-
-static void
-start_timer (struct timeval *timer_start)
-{
- timer_check++;
- gettimeofday (timer_start, NULL);
-}
-
-/*
- *
- */
-
-static void
-end_and_print_timer (char *str, int times, int opersp,
- struct timeval *timer_start)
-{
- long long start_l, stop_l;
- struct timeval timer_stop;
-
- timer_check--;
- assert (timer_check >= 0);
- gettimeofday(&timer_stop, NULL);
- start_l = timer_start->tv_sec * 1000000 + timer_start->tv_usec;
- stop_l = timer_stop.tv_sec * 1000000 + timer_stop.tv_usec;
-
- printf("%-21s:\t%8llu msec\t%8.3f %s\n", str,
- (stop_l-start_l)/1000,
- (times*1000000.0)/(stop_l-start_l),
- opersp ? "operations/s" : "Mb/s");
-}
-
-static void
-print_timer_header(void)
-{
- printf("%-21s \t%-13s\t%-12s\n", "Operation", "total time", "summary");
-}
-
-static void
-do_createfile (struct rx_connection *conn, const AFSFid *parent,
- const char *name, AFSFid *child)
-{
- static AFSStoreStatus InStatus = { 0,0,0,0,0 };
- AFSFetchStatus OutFidStatus, OutDirStatus;
- AFSCallBack CallBack;
- AFSVolSync a_volSyncP;
- int ret;
-
- ret = RXAFS_CreateFile (conn, parent, name, &InStatus,
- child, &OutFidStatus, &OutDirStatus,
- &CallBack, &a_volSyncP);
- if (ret)
- errx (1, "RXAFS_CreateFile returned %d", ret);
-}
-
-static void
-do_createfilecontent (struct rx_connection *conn, const AFSFid *parent,
- const char *name, AFSFid *child, int size,
- int times, char *buffer)
-{
- static AFSStoreStatus InStatus = { 0,0,0,0,0 };
- AFSFetchStatus OutFidStatus, OutDirStatus;
- AFSCallBack CallBack;
- AFSVolSync a_volSyncP;
- int ret;
- struct rx_call *call;
- int i;
-
- ret = RXAFS_CreateFile (conn, parent, name, &InStatus,
- child, &OutFidStatus, &OutDirStatus,
- &CallBack, &a_volSyncP);
- if (ret)
- errx (1, "RXAFS_CreateFile returned %d", ret);
-
- call = rx_NewCall (conn);
-
- if (call == NULL)
- errx (1, "rx_NewCall returned NULL");
-
- ret = StartRXAFS_StoreData (call, child, &InStatus,
- 0, size*times, size*times);
-
- if (ret)
- errx (1, "StartRXAFS_StoreData returned %d", ret);
-
- for (i = 0; i < times; i++) {
- ret = rx_Write(call, buffer, size);
- if (ret != size)
- errx (1, "rx_Write returned %d rx error: %d",
- ret, rx_GetCallError(call));
- }
-
- ret = EndRXAFS_StoreData (call, &OutFidStatus, &a_volSyncP);
-
- if (ret)
- errx (1, "StartRXAFS_StoreData returned %d", ret);
-
- ret = rx_EndCall(call, ret);
- if (ret)
- errx (1, "rx_EndCall returned %d", ret);
-}
-
-static void
-do_readfilecontent (struct rx_connection *conn, const AFSFid *fid,
- int size,
- int times, char *buffer)
-{
- AFSFetchStatus OutFidStatus;
- AFSCallBack CallBack;
- AFSVolSync a_volSyncP;
- int ret;
- struct rx_call *call;
- int i;
-
- call = rx_NewCall (conn);
-
- if (call == NULL)
- errx (1, "rx_NewCall returned NULL");
-
- ret = StartRXAFS_FetchData (call, fid, 0, size*times);
-
- if (ret)
- errx (1, "StartRXAFS_FetchData returned %d", ret);
-
- for (i = 0; i < times; i++) {
- ret = rx_Read(call, buffer, size);
- if (ret != size)
- errx (1, "rx_Read returned %d rx error: %d",
- ret, rx_GetCallError(call));
- }
-
- ret = EndRXAFS_FetchData (call, &OutFidStatus, &CallBack,
- &a_volSyncP);
- if (ret)
- errx (1, "StartRXAFS_FetchData returned %d", ret);
-
- ret = rx_EndCall(call, ret);
- if (ret)
- errx (1, "rx_EndCall returned %d", ret);
-}
-
-static void
-do_gtod (struct rx_connection *conn)
-{
- int ret;
- int32_t sec, usec;
-
- ret = RXAFS_GetTime (conn, &sec, &usec);
- if (ret)
- errx (1, "RXAFS_GetTime returned %d", ret);
-}
-
-static void
-do_mkdir (struct rx_connection *conn, const AFSFid *parent,
- const char *name, AFSFid *child)
-{
- static AFSStoreStatus InStatus = { 0,0,0,0,0 };
- AFSFetchStatus OutFidStatus, OutDirStatus;
- AFSCallBack CallBack;
- AFSVolSync a_volSyncP;
- int ret;
-
- ret = RXAFS_MakeDir (conn, parent, name, &InStatus,
- child, &OutFidStatus, &OutDirStatus,
- &CallBack, &a_volSyncP);
- if (ret)
- errx (1, "RXAFS_MakeDir returned %d", ret);
-}
-
-
-static void
-do_rmdir (struct rx_connection *conn, const AFSFid *parent,
- const char *name)
-{
- AFSFetchStatus a_newParentDirStatP;
- AFSVolSync a_volSyncP;
- int ret;
-
- ret = RXAFS_RemoveDir (conn, parent, name, &a_newParentDirStatP,
- &a_volSyncP);
- if (ret)
- errx (1, "RXAFS_RemoveDir returned %d", ret);
-}
-
-static void
-do_removefile (struct rx_connection *conn, const AFSFid *parent,
- const char *name)
-{
- AFSFetchStatus a_newParentDirStatP;
- AFSVolSync a_volSyncP;
- int ret;
-
- ret = RXAFS_RemoveFile (conn, parent, name, &a_newParentDirStatP,
- &a_volSyncP);
- if (ret)
- errx (1, "RXAFS_RemoveDir returned %d", ret);
-}
-
-
-
-static void
-bulkstat (struct rx_connection *conn, const AFSFid *parent,
- int num, AFSFid *fids, int lim)
-{
- AFSCBFids FidsArray;
- AFSBulkStats StatArray;
- AFSCBs CBArray;
- AFSVolSync Sync;
- char *stamp;
- struct timeval timer_start;
- int ret, i;
-
- asprintf (&stamp, "bulkstatus %d/%d/%d total", num, lim,
- (num + lim - 1)/lim);
- start_timer(&timer_start);
-
- for (i = 0 ; i < num; i += min(num - i, lim)) {
-
- FidsArray.val = &fids[i];
- FidsArray.len = min(num - i, lim);
-
- ret = RXAFS_BulkStatus (conn, &FidsArray, &StatArray, &CBArray, &Sync);
- if (ret)
- errx (1, "RXAFS_BulkStatus faile with %d", ret);
-
- free (StatArray.val);
- free (CBArray.val);
- }
- end_and_print_timer (stamp, num, 1, &timer_start);
- free (stamp);
-}
-
-/*
- *
- */
-
-static void
-do_bulkstat (struct rx_connection *conn, const AFSFid *parent,
- int num, AFSFid *fids)
-{
- int i, addr;
-
- if (arg_smallrun)
- addr = 4;
- else
- addr = 1;
-
- for (i = 1; i <= 50; i += addr)
- bulkstat(conn, parent, num, fids, i);
-}
-
-/*
- *
- */
-
-typedef void (*create_many_create)(struct rx_connection *conn,
- const AFSFid *parent,
- const char *name,
- AFSFid *child);
-typedef void (*create_many_op)(struct rx_connection *conn,
- const AFSFid *parent,
- int len,
- AFSFid *child);
-typedef void (*create_many_remove)(struct rx_connection *conn,
- const AFSFid *parent,
- const char *name);
-
-static void
-create_many_entry (struct rx_connection *conn, AFSFid *parentfid, int num,
- create_many_create create,
- create_many_op op,
- create_many_remove remove,
- const char *entry_name)
-{
- char *dir, *stamp;
- AFSFid fid;
- AFSFid *files;
- int i;
- char filename[MAXPATHLEN];
- static struct timeval timer_start;
-
- assert (num >= 0);
-
- files = emalloc (num * sizeof (fid));
-
- asprintf (&stamp, "creating %d %ss", num, entry_name);
-
- asprintf (&dir, "create_many_files-%d-time-%d", num, (int)time(NULL));
- do_mkdir (conn, parentfid, dir, &fid);
-
- start_timer(&timer_start);
- for (i = 0; i < num; i++) {
- snprintf (filename, sizeof(filename), "%d", i);
- (*create) (conn, &fid, filename, &files[i]);
- }
- end_and_print_timer (stamp, num, 1, &timer_start);
-
- if (op)
- (*op) (conn, &fid, num, files);
-
- free(stamp);
- asprintf (&stamp, "removing %d %ss", num, entry_name);
-
- start_timer(&timer_start);
- for (i = 0; i < num; i++) {
- snprintf (filename, sizeof(filename), "%d", i);
- (*remove) (conn, &fid, filename);
- }
- end_and_print_timer (stamp, num, 1, &timer_start);
-
- do_rmdir (conn, parentfid, dir);
-
- free (stamp);
- free (dir);
-}
-
-static void
-create_and_read_content (struct rx_connection *conn, AFSFid *parentfid, int size)
-{
- char *dir, *stamp;
- AFSFid fid;
- AFSFid file;
- char *buffer;
- struct timeval timer_start;
-
- asprintf (&stamp, "writing %dM data", size);
-
- asprintf (&dir, "write_big_files-%d-time-%d", size, (int)time(NULL));
- do_mkdir (conn, parentfid, dir, &fid);
-
- buffer = malloc(1024*1024);
- memset(buffer, 'X', 1024*1024);
-
- start_timer(&timer_start);
- do_createfilecontent (conn, &fid, "foo", &file, 1024*1024,
- size, buffer);
- end_and_print_timer (stamp, size, 0, &timer_start);
-
- free (stamp);
-
- asprintf (&stamp, "reading %dM data", size);
- start_timer(&timer_start);
- do_readfilecontent (conn, &file, 1024*1024, size, buffer);
- end_and_print_timer (stamp, size, 0, &timer_start);
-
- free(stamp);
-
- free(buffer);
-
- asprintf (&stamp, "removing %dM data", size);
-
- start_timer(&timer_start);
- do_removefile (conn, &fid, "foo");
- end_and_print_timer (stamp, size, 1, &timer_start);
- do_rmdir (conn, parentfid, dir);
-
- free (stamp);
- free (dir);
-}
-
-static void
-bench_gettime(struct rx_connection *conn, int times)
-{
- struct timeval timer_start;
- char *stamp;
- int i;
-
- asprintf (&stamp, "gettime %d times", times);
-
- start_timer(&timer_start);
- for (i = 0; i < times; i++)
- do_gtod (conn);
- end_and_print_timer (stamp, times, 1, &timer_start);
-
- free (stamp);
-}
-
-/*
- *
- */
-
-static void
-do_gettime(struct rx_connection *conn, AFSFid *root)
-{
- bench_gettime(conn, 1);
- bench_gettime(conn, 100);
- bench_gettime(conn, 1000);
- bench_gettime(conn, 2000);
-}
-
-static void
-do_read_content(struct rx_connection *conn, AFSFid *root)
-{
- create_and_read_content (conn, root, 1);
- create_and_read_content (conn, root, 2);
- create_and_read_content (conn, root, 10);
- create_and_read_content (conn, root, 20);
-
- if (!arg_smallrun) {
- create_and_read_content (conn, root, 30);
- create_and_read_content (conn, root, 40);
- create_and_read_content (conn, root, 50);
- }
-}
-
-static void
-do_create_files(struct rx_connection *conn, AFSFid *root)
-{
- create_many_entry (conn, root, 1000,
- do_createfile, NULL, do_removefile, "file");
-
- if (!arg_smallrun) {
- create_many_entry (conn, root, 2000,
- do_createfile, NULL, do_removefile, "file");
- create_many_entry (conn, root, 4000,
- do_createfile, NULL, do_removefile, "file");
- create_many_entry (conn, root, 8000,
- do_createfile, NULL, do_removefile, "file");
- }
-}
-
-static void
-do_create_dirs(struct rx_connection *conn, AFSFid *root)
-{
- create_many_entry (conn, root, 1000,
- do_mkdir, NULL, do_rmdir, "dir");
- if (!arg_smallrun) {
- create_many_entry (conn, root, 2000,
- do_mkdir, NULL, do_rmdir, "dir");
- create_many_entry (conn, root, 4000,
- do_mkdir, NULL, do_rmdir, "dir");
- create_many_entry (conn, root, 8000,
- do_mkdir, NULL, do_rmdir, "dir");
- }
-}
-
-static void
-do_bulk_status(struct rx_connection *conn, AFSFid *root)
-{
- int num;
-
- if (arg_smallrun)
- num = 500;
- else
- num = 5000;
-
- create_many_entry (conn, root, num,
- do_createfile, do_bulkstat, do_removefile,
- "bulkstat");
-}
-
-/*
- *
- */
-
-static int
-do_readbench(struct rx_connection *conn, int volume, int vnode, int uniq)
-{
- char *stamp;
- char *buffer;
- AFSFid file;
- struct timeval timer_start;
-
- buffer = malloc(1024*1024);
- asprintf (&stamp, "reading %dM data", 10);
- file.Vnode = vnode;
- file.Volume = volume;
- file.Unique = uniq;
- start_timer(&timer_start);
- do_readfilecontent (conn, &file, 1024*1024, 10, buffer);
- end_and_print_timer (stamp, 10, 1, &timer_start);
-
- free(stamp);
- free(buffer);
-
- return 0;
-}
-
-/*
- *
- */
-
-enum {
- BENCH_GETTIME = 0x1,
- BENCH_READ_CONTENT = 0x2,
- BENCH_CREATE_FILES = 0x4,
- BENCH_CREATE_DIRS = 0x8,
- BENCH_BULK_STATUS = 0x10
-};
-
-#define all ( \
- BENCH_GETTIME| \
- BENCH_READ_CONTENT| \
- BENCH_CREATE_FILES| \
- BENCH_CREATE_DIRS| \
- BENCH_BULK_STATUS| \
- 0)
-
-struct units tests_units[] = {
- { "all", all },
- { "get-time", BENCH_GETTIME },
- { "read-content", BENCH_READ_CONTENT },
- { "create-files", BENCH_CREATE_FILES },
- { "create-dirs", BENCH_CREATE_DIRS },
- { "bulk-status", BENCH_BULK_STATUS },
- { NULL }
-};
-
-
-struct {
- char *name;
- int bit;
- void (*func)(struct rx_connection *, AFSFid *);
-} benchmarks[] = {
- { "gettime", BENCH_GETTIME, do_gettime },
- { "readcontent", BENCH_READ_CONTENT, do_read_content },
- { "create-files", BENCH_CREATE_FILES, do_create_files },
- { "create-dirs", BENCH_CREATE_DIRS, do_create_dirs },
- { "bulk-status", BENCH_BULK_STATUS, do_bulk_status }
-};
-
-/*
- *
- */
-
-static char *arg_host = NULL;
-static int arg_volume = 0;
-static int arg_authlevel = 2;
-static int arg_help = 0;
-static int arg_vnode = 0;
-static int arg_uniq = 0;
-
-struct agetargs args[] = {
- {"host", 0, aarg_string, &arg_host,
- "what host to use", "host"},
- {"volume", 0, aarg_integer, &arg_volume,
- "what volume to use", NULL},
- {"authlevel",0, aarg_integer, &arg_authlevel,
- "authlevel (1=no,2=auth,3=crypt)", NULL},
- {"help", 0, aarg_flag, &arg_help,
- "give this help", NULL, aarg_optional},
- {"vnode", 0, aarg_integer, &arg_vnode,
- "what vnode to read from", NULL, aarg_optional},
- {"uniq", 0, aarg_integer, &arg_uniq,
- "what uniq to read from", NULL, aarg_optional},
- {"cell", 0, aarg_string, &arg_cell,
- "cell", NULL, aarg_optional},
- {"tests", 0, aarg_string, &arg_test_to_run,
- "test1,test2", NULL, aarg_optional},
- {"smallrun", 0, aarg_flag, &arg_smallrun,
- "a run a smaller version of the benchmark", NULL, aarg_optional},
- {"version", 0, aarg_flag, &arg_version,
- "version", NULL, aarg_optional},
- { NULL, 0}
-};
-
-static void
-usage (int eval)
-{
- aarg_printusage(args, getprogname(), NULL, AARG_AFSSTYLE);
-
- printf ("\nTips:\n"
- " on errors use `fs strerror <errno>' to figure"
- " out what was wrong\n");
-
- exit (eval);
-}
-
-
-int
-main (int argc, char **argv)
-{
- int ret, optind = 0;
- arlalib_authflags_t auth;
- char *auth_string;
- struct rx_connection *conn;
- int test_to_run, i;
- AFSFid root;
-
- setprogname(argv[0]);
-
- ret = rx_Init (htons(4712));
- if (ret)
- errx (1, "rx_Init returnd %d", ret);
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage (args, "", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- if (arg_version) {
- print_version (NULL);
- exit (0);
- }
-
- if (arg_help)
- usage (0);
-
- printf ("afs low-level fileserver performance tester\n");
- print_version(NULL);
-
- if (arg_host == NULL)
- errx(1, "missing host argument");
- if (arg_volume == 0)
- errx(1, "missing volume argument");
-
- ports_init ();
- cmcb_init();
-
- switch (arg_authlevel) {
- case 1:
- auth = AUTHFLAGS_NOAUTH;
- auth_string = "clear";
- break;
- case 2:
- auth = AUTHFLAGS_TICKET;
- auth_string = "auth";
- rxkad_min_level = rxkad_auth;
- break;
- case 3:
- auth = AUTHFLAGS_TICKET;
- auth_string = "crypt";
- rxkad_min_level = rxkad_crypt;
- break;
- default:
- errx (1, "authlevel: only 1, 2 or 3 is valid (clear, auth, crypt)");
- }
-
- printf ("Perf\n");
- printf ("host: %s, volume: %d, auth: %s\n",
- arg_host, arg_volume, auth_string);
-
- conn = arlalib_getconnbyname (arg_cell, arg_host, afsport,
- FS_SERVICE_ID, auth);
- if (conn == NULL)
- errx (1, "arlalib_getconnbyname failed");
-
- if (arg_vnode && arg_uniq) {
- printf("read one file\n");
- print_timer_header();
- do_readbench(conn, arg_volume, arg_vnode, arg_uniq);
-
- rx_DestroyConnection(conn);
- return 0;
- }
-
- test_to_run = parse_flags (arg_test_to_run, tests_units, 0);
- if (test_to_run == -1) {
- fprintf (stderr, "valid tests are:\n");
- print_flags_table (tests_units, stderr);
- exit(1);
- }
-
- for (i = 0; i < sizeof(benchmarks)/sizeof(benchmarks[0]); i++) {
- root.Volume = arg_volume;
- root.Vnode = 1;
- root.Unique = 1;
- if (benchmarks[i].bit & test_to_run)
- (*benchmarks[i].func)(conn, &root);
-
- }
- printf("done\n");
- rx_DestroyConnection(conn);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/pts/Makefile.in b/usr.sbin/afs/src/appl/pts/Makefile.in
deleted file mode 100644
index 35669d2351d..00000000000
--- a/usr.sbin/afs/src/appl/pts/Makefile.in
+++ /dev/null
@@ -1,138 +0,0 @@
-# $KTH: Makefile.in,v 1.11.2.2 2001/10/23 23:51:06 ahltorp Exp $
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-LN_S = @LN_S@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-mandir = @mandir@
-transform = @program_transform_name@
-EXECSUFFIX = @EXECSUFFIX@
-
-APPL_BIN = pts
-MANPAGES = pts.1
-
-DEFS = @DEFS@
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-X_CFLAGS = @X_CFLAGS@
-LDFLAGS = @LDFLAGS@
-
-ETAGS = etags
-MAKEDEPEND = makedepend
-RXKADINC = -I$(srcdir)/../../rxkad
-INCLUDES = -I$(srcdir)/../.. \
- -I$(srcdir)/../../include \
- -I$(srcdir)/../lib \
- -I../../include \
- -I../../rxdef \
- -I. \
- $(KERNEL_INCLUDE) \
- -I$(srcdir)/../../xfs/include \
- -I$(srcdir)/../../arlad \
- @INC_roken@ \
- $(RXKADINC)
-
-DEFINES =
-REALCFLAGS = $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) \
- $(X_CFLAGS) @PLWP_INC_FLAGS@
-RXKAD_LIBS = @MILKO_RXKAD_LIBS@
-KERNEL_INCLUDE = @KERNEL_INCLUDE@
-READLINE_lib = @LIB_readline@
-KAFS_LIBS = @AIX_EXTRA_KAFS@ @KAFS_LIBS@
-LIB_tgetent = @LIB_tgetent@
-LIBS = -L../lib -larlalib \
- -L../../rxdef -lrxdefclient \
- -L../../rx -lrx \
- -L../../lwp -llwp @PLWP_LIB_FLAGS@ \
- -L../../lib/ko -lko -L../../util -lutil \
- -L../../lib/sl -lsl \
- $(READLINE_lib) \
- @LIB_roken@ \
- $(RXKAD_LIBS) \
- $(KAFS_LIBS) \
- $(RXKAD_LIBS) @LIBS@
-
-LIBDEPENDS = ../../rxdef/librxdefclient.a ../../rx/librx.a ../../lwp/liblwp.a \
- ../../util/libutil.a ../../lib/sl/libsl.a \
- ../../lib/ko/libko.a ../lib/libarlalib.a
-
-PROGS = pts
-PTS_SRCS = pts.c
-SRCS = $(PTS_SRCS)
-PTS_OBJS = pts.o
-HDRS =
-
-all: $(PROGS)
-
-.PHONY: all install uninstall depend tags clean
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(bindir)/$$f; \
- done ;\
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir) ; \
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$$e ; \
- $(INSTALL_DATA) $(srcdir)/$$x \
- $(DESTDIR)$(mandir)/man$$e/$$f.$$e; \
- done
-
-uninstall:
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
- done ; \
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- rm -rf $(DESTDIR)$(mandir)/$$f.$$e; \
- done
-
-pts: $(PTS_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(PTS_OBJS) $(LIBS)
-
-Makefile: Makefile.in ../../config.status
- cd ../..; CONFIG_FILES=appl/pts/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(CFILES)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(PROGS) $(OBJS) *~ *.o core
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/appl/pts/pts.1 b/usr.sbin/afs/src/appl/pts/pts.1
deleted file mode 100644
index 6616be410aa..00000000000
--- a/usr.sbin/afs/src/appl/pts/pts.1
+++ /dev/null
@@ -1,290 +0,0 @@
-.\" Copyright (c) 2000 - 2002 Kungliga Tekniska Högskolan
-.\" (Royal Institute of Technology, Stockholm, Sweden).
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" 3. Neither the name of the Institute nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $arla: pts.1,v 1.8 2003/06/06 12:53:49 hin Exp $
-.\" $OpenBSD: pts.1,v 1.10 2004/01/24 18:53:46 deraadt Exp $
-.\"
-.Dd March 25, 2000
-.Dt PTS 1
-.Os "The Arla Project"
-.Sh NAME
-.Nm pts
-.Nd Manage AFS protection database
-.Sh SYNOPSIS
-.Nm pts
-.Op Ar command
-.Op Ar args
-.Sh DESCRIPTION
-The
-.Nm
-utility is used to manipulate the contents of the AFS Protection Database,
-which contains information about users and groups in AFS.
-Note that the
-.Nm
-utility does
-.Em not
-modify the traditional
-.Ux
-user and group database, only the AFS specific information.
-.Pp
-The
-.Nm
-utility provides several commands:
-.Pp
-.Bl -tag -width "membership groups" -compact
-.It Cm adduser
-add a user to a group
-.It Cm chown
-change owner of user or group
-.It Cm creategroup
-create a new group
-.It Cm cg
-shorthand for
-.Nm creategroup
-.It Cm createuser
-create a new user
-.It Cm dump
-dump pts database
-.It Cm delete
-delete user or group
-.It Cm examine
-examine a user or a group
-.It Cm help
-get help on
-.Nm
-.It Cm \&?
-shorthand for help
-.It Cm listmax
-print largest afs user and group
-.It Cm listowned
-list groups owned by a user or group, or orphaned groups
-.It Cm membership
-list group or user membership
-.It Cm groups
-shorthand for membership
-.It Cm removeuser
-remove a user from a group
-.It Cm rename
-rename a user or a group
-.It Cm setfields
-not yet implemented
-.It Cm setmax
-not yet implemented
-.It Cm syncdb
-not yet implemented
-.El
-.Pp
-Most
-.Nm
-commands accept the following general arguments:
-.Pp
-.Bd -filled -offset indent -compact
-.Op Fl cell Ar cellname
-Specifies which AFS cell to use, if the default cell is not to be used.
-.Pp
-.Op Fl noauth
-Specifies that
-.Nm
-should not try to authenticate the connection to the server.
-This may be
-useful with shell scripts, or if there is a problem with the AFS cell.
-Note that the server will reject many commands if
-.Fl noauth
-is specified.
-.Ed
-.Pp
-The syntax of the
-.Nm
-commands:
-.Pp
-.Ic pts adduser
-.Op Fl name
-.Ar user
-.Op Fl group
-.Ar group
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Bd -filled -offset indent -compact
-Add the specified user to the specified group.
-.Ed
-.Pp
-.Ic pts chown
-.Op Fl name
-.Ar user/group
-.Op Fl owner
-.Ar owner
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Bd -filled -offset indent -compact
-Change owner of a group or user.
-.Ed
-.Pp
-.Ic pts creategroup
-.Op Fl name
-.Ar name
-.Op Fl id Ar idnumber
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Bd -filled -offset indent -compact
-Create a new group.
-If
-.Ar idnumber
-is not specified, a new idnumber is taken automatically.
-.Ed
-.Pp
-.Ic pts cg
-.Bd -filled -offset indent -compact
-Shorthand for
-.Nm creategroup Ns .
-.Ed
-.Pp
-.Ic pts createuser
-.Op Fl name
-.Ar name
-.Op Fl id Ar idnumber
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Bd -filled -offset indent -compact
-Create a new user.
-If
-.Ar idnumber
-is not specified, a new idnumber is taken automatically.
-.Ed
-.Pp
-.Ic pts dump
-.Ar server
-.Op Fl cell cellname
-.Bd -filled -offset indent -compact
-Dump the Protection Database in a human readable form.
-The database is read from the given database server.
-.Ed
-.Pp
-.Ic pts delete
-.Op Fl name
-.Ar name/group
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Bd -filled -offset indent -compact
-Delete a user or group from the database.
-.Ed
-.Pp
-.Ic pts examine
-.Ar user/group
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Bd -filled -offset indent -compact
-Print verbose information about a user or a group.
-.Ed
-.Pp
-.Ic pts help
-or
-.Ic pts ?\&
-.Bd -filled -offset indent -compact
-Print help about
-.Nm
-.Ed
-.Pp
-.Ic pts listmax
-.Op Fl cell Ar cellname
-.Bd -filled -offset indent -compact
-Print the largest uid and gid.
-.Ed
-.Pp
-.Ic pts listowned
-.Op Fl id
-.Ar user/group
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Bd -filled -offset indent -compact
-List the groups owned by a user or group.
-.Ed
-.Pp
-.Ic pts membership
-.Op Fl nameorid Ar user/group
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Bd -filled -offset indent -compact
-List the members of a group, or the groups a user is a member of.
-.Ed
-.Pp
-.Ic pts groups
-.Bd -filled -offset indent -compact
-Shorthand for
-.Nm membership Ns .
-.Ed
-.Pp
-.Ic pts removeuser
-.Op Fl user
-.Ar user
-.Op Fl group
-.Ar group
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Bd -filled -offset indent -compact
-Remove a users membership from a group.
-.Ed
-.Pp
-.Ic pts rename
-.Op Fl from
-.Ar "old name"
-.Op Fl to
-.Ar "new name"
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Bd -filled -offset indent -compact
-Rename a user or group.
-.Ed
-.Pp
-.Ic pts setfields
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic pts setmax
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic pts syncdb
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Sh SEE ALSO
-.Xr fs 1 ,
-.Xr afsd 8 ,
-.Xr vos 8
-.Sh STANDARDS
-The Arla authors are trying to mimic the behaviour of the original AFS
-utilities.
-.Sh AUTHORS
-The Arla project <http://www.stacken.kth.se/project/arla/>.
-.Sh BUGS
-Some commands are not implemented yet.
diff --git a/usr.sbin/afs/src/appl/pts/pts.c b/usr.sbin/afs/src/appl/pts/pts.c
deleted file mode 100644
index 57dc6da50e4..00000000000
--- a/usr.sbin/afs/src/appl/pts/pts.c
+++ /dev/null
@@ -1,1562 +0,0 @@
-/*
- * Copyright (c) 1995 - 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sl.h>
-#include "appl_locl.h"
-
-RCSID("$arla: pts.c,v 1.56 2003/04/13 19:02:41 lha Exp $");
-
-static int help_cmd (int argc, char **argv);
-
-/* Debugging on/off */
-static int prdebug = 0;
-
-extern char *__progname;
-
-static int
-empty_cmd (int argc, char **argv)
-{
- printf ("%s not implemented yet!\n", argv[0]);
- return 0;
-}
-
-/*
- * Dump the pts database
- */
-
-static int
-dump_1 (struct rx_connection *connptdb)
-{
- struct prdebugentry entry;
- struct prheader header;
-
- unsigned int pos;
- int error;
-
- error = PR_DumpEntry(connptdb, 0, (struct prdebugentry *) &header);
- if (error) {
- printf("dump_cmd: DumpEntry failed with: %s (%d)\n",
- koerr_gettext(error),
- error);
- return 0;
- }
-
- for (pos = header.headerSize;
- pos < header.eofPtr;
- pos += sizeof (struct prdebugentry)) {
- error = PR_DumpEntry(connptdb, pos, &entry);
- if (error) {
- printf("dump_cmd: DumpEntry failed with: %s (%d)\n",
- koerr_gettext(error),
- error);
- } else {
- printf("-----\n");
- printf("Name: %s, id: %d, owner: %d, creator: %d,\n",
- entry.name, entry.id, entry.owner, entry.creator);
- printf(" membership: %d, flags:", entry.ngroups);
- if ((entry.flags & PRTYPE) == PRFREE)
- printf (" PRFREE");
- if ((entry.flags & PRTYPE) == PRGRP)
- printf (" PRGRP");
- if ((entry.flags & PRTYPE) == PRCONT)
- printf (" PRCONT");
- if ((entry.flags & PRTYPE) == PRCELL)
- printf (" PRCELL");
- if ((entry.flags & PRTYPE) == PRFOREIGN)
- printf (" PRFOREIGN");
- if ((entry.flags & PRTYPE) == PRINST)
- printf (" PRINST");
- if ((entry.flags & PRTYPE) == PRUSER)
- printf (" PRUSER");
- if ((entry.flags & PRACCESS) == PRACCESS)
- printf (" PRACCESS");
- if ((entry.flags & PRQUOTA) == PRQUOTA)
- printf (" PRQUOTA");
-
- printf (" , group quota: %d.\n",
- entry.ngroups);
- }
- }
- return 0;
-}
-
-/*
- * Dump the pts database, should be replaced with 'pts liste'
- */
-
-static int
-dump_cmd (int argc, char **argv)
-{
- struct rx_connection *conn;
- struct db_server_context conn_context;
- const char *host = NULL;
- const char *cell = (char *) cell_getthiscell();
- int noauth = 0;
- int optind = 0;
- int error = ENETDOWN;
-
- struct agetargs args[] = {
- {"host", 0, aarg_string, NULL, NULL, NULL, aarg_mandatory},
- {"cell", 0, aarg_string, NULL, "what cell to use", NULL},
- {"noauth", 0, aarg_flag, NULL, "don't authenticate", NULL},
- {NULL, 0, aarg_end, NULL}},
- *arg;
- arg = args;
- arg->value = &host; arg++;
- arg->value = &cell; arg++;
- arg->value = &noauth; arg++;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(args, "pts dump", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- cell = cell_expand_cell (cell);
-
- for (conn = arlalib_first_db(&conn_context,
- cell, host, afsprport, PR_SERVICE_ID,
- arlalib_getauthflag (noauth, 0, 0, 0));
- conn != NULL && arlalib_try_next_db(error);
- conn = arlalib_next_db(&conn_context)) {
- error = dump_1 (conn);
- }
- free_db_server_context(&conn_context);
- return error;
-}
-
-static int
-flags_to_string(int flags, char *string, size_t size)
-{
- strlcpy(string, "-----", size);
- if((flags & PRP_STATUS_ANY) != 0)
- string[0]='S';
- else if((flags & PRP_STATUS_MEM) != 0)
- string[0]='s';
- if((flags & PRP_OWNED_ANY) != 0)
- string[1]='O';
- if((flags & PRP_MEMBER_ANY) != 0)
- string[2]='M';
- else if((flags & PRP_MEMBER_MEM) != 0)
- string[2]='m';
- if((flags & PRP_ADD_ANY) != 0)
- string[3]='A';
- else if((flags & PRP_ADD_MEM) != 0)
- string[3]='a';
- if((flags & PRP_REMOVE_MEM) != 0)
- string[4]='r';
- return 0;
-}
-
-static int
-examine_id(struct rx_connection *conn, int32_t id, char *idname)
-{
- prcheckentry ent;
- int error;
- namelist nlist;
- idlist ilist;
- char flags_str[6];
-
- error = PR_ListEntry(conn, id, &ent);
- if (error) {
- fprintf(stderr, "ListEntry in examine: error %s (%d)\n",
- koerr_gettext(error), error);
- return error;
- }
-
- nlist.len = 3;
- nlist.val = malloc(sizeof(prname) * nlist.len);
- if(nlist.val == NULL)
- errx(1, "Out of memory");
-
- ilist.len = 3;
- ilist.val = malloc(sizeof(int32_t) * ilist.len);
- if(ilist.val == NULL)
- errx(1, "Out of memory");
-
- ilist.val[0] = ent.id;
- ilist.val[1] = ent.owner;
- ilist.val[2] = ent.creator;
-
- error = PR_IDToName(conn, &ilist, &nlist);
- if (error) {
- fprintf(stderr, "IDToName in examine: error %s (%d)\n",
- koerr_gettext(error), error);
- return error;
- }
-
- flags_to_string(ent.flags << 16, flags_str, sizeof(flags_str)); /* XXX why do i have to shift by 16? seems strange */
-
- printf("Name: %s, id: %d, owner: %s, creator: %s,\n",
- nlist.val[0], ent.id, nlist.val[1], nlist.val[2]);
- printf(" membership: %d, flags: %s, group quota: %d.\n",
- ent.count, flags_str, ent.ngroups);
- free(ilist.val);
- free(nlist.val);
- return 0;
-}
-
-
-/*
- * convert a `name' to `id'
- */
-
-static int
-pr_name2id(struct rx_connection *conn, const char *name, int32_t *id)
-{
- int error;
- namelist nlist;
- idlist ilist;
- char rname[PR_MAXNAMELEN];
-
- assert(id);
- *id = 0;
-
- if (prdebug)
- printf("pr_name2id(%s, x)", name);
-
- strlcpy(rname, name, sizeof(rname));
-
- nlist.len = 1;
- nlist.val = &rname;
-
- error = PR_NameToID(conn, &nlist, &ilist);
-
- if (prdebug)
- printf(" id = %d, error= %d\n", *id, error);
-
- if (error)
- return error;
-
- if (ilist.len == 1)
- *id = *ilist.val;
- else
- error = PRBADARG;
-
- free(ilist.val);
-
- return error;
-}
-
-/*
- * add `user' to `group' on `conn'. Return 0 or error.
- */
-
-static int
-adduser_1 (struct rx_connection *conn, const char *user, const char *group)
-{
- int32_t uid;
- int32_t gid;
- int error;
-
- error = pr_name2id(conn, user, &uid);
- if (error) {
- if (prdebug)
- warn("Problems finding user %s, error %s (%d)",
- user, koerr_gettext(error), error);
- return error;
- }
-
- error = pr_name2id(conn, group, &gid);
- if (error) {
- if (prdebug)
- warn("Problems finding group %s, error %s (%d)",
- user, koerr_gettext(error), error);
- return error;
- }
-
- if (prdebug)
- printf("PR_AddToGroup(conn, uid = %d, gid = %d);\n", uid, gid);
-
- error = PR_AddToGroup(conn, uid, gid);
- return error;
-}
-
-/*
- * add `user' to `group' in `cell'
- */
-
-static int
-pr_adduser(const char *cell, const char *host,
- const char *user, const char *group,
- arlalib_authflags_t auth)
-{
- int error = ENETDOWN;
- struct rx_connection *conn;
- struct db_server_context conn_context;
-
- for (conn = arlalib_first_db(&conn_context,
- cell, host, afsprport, PR_SERVICE_ID, auth);
- conn != NULL && arlalib_try_next_db(error);
- conn = arlalib_next_db(&conn_context)) {
- error = adduser_1 (conn, user, group);
- }
- free_db_server_context(&conn_context);
- return error;
-}
-
-
-/*
- * create user/group
- * if you want the id returned
- * set *id = 0
- * if you want to decide what the userid is set the *id != 0,
- * id is still returned in this variable.
- *
- */
-
-#define PR_CREATE_USER 0
-#define PR_CREATE_GROUP 2
-
-static int
-pr_create(const char *cell, const char *host,
- const char *name, const char *owner,
- int32_t *id, int flag, arlalib_authflags_t auth)
-{
- int error;
- struct rx_connection *conn;
- struct db_server_context conn_context;
-
- error = ENETDOWN;
- for (conn = arlalib_first_db(&conn_context,
- cell, host, afsprport, PR_SERVICE_ID, auth);
- conn != NULL && arlalib_try_next_db (error);
- conn = arlalib_next_db(&conn_context)) {
- int32_t owner_id = 0;
- int32_t out_id;
-
- if (owner != NULL) {
- error = pr_name2id (conn, owner, &owner_id);
- if (error)
- continue;
- }
-
- if (id == NULL || *id == 0) {
- if (prdebug)
- printf("PR_NewEntry(%s, %d, %d, OUT)\n",
- name, flag, owner_id);
-
- error = PR_NewEntry(conn, name, flag, owner_id, &out_id);
- if (id != NULL && error == 0)
- *id = out_id;
- } else {
- if (prdebug)
- printf("PR_INewEntry(%s, %d, %d, OUT)\n",
- name, *id, owner_id);
-
- error = PR_INewEntry(conn, name, *id, owner_id);
- }
- }
- if(error)
- fprintf(stderr, "pts create: error %s (%d)\n",
- koerr_gettext(error), error);
- free_db_server_context(&conn_context);
- return error;
-}
-
-/*
- *
- */
-
-static int
-delete_1 (struct rx_connection *conn, const char *name)
-{
- int error;
- int32_t id;
-
- error = pr_name2id(conn, name, &id);
- if (error) {
- if (prdebug)
- warn("Problems finding name: %s, error %s (%d)",
- name, koerr_gettext(error), error);
- return error;
- }
-
- if (prdebug)
- printf("PR_Delete(%s, %d)\n", name, id);
-
- error = PR_Delete(conn, id);
- return error;
-}
-
-static int
-pr_delete(const char *cell, const char *host,
- const char *name, arlalib_authflags_t auth)
-{
- int error = ENETDOWN;
- struct rx_connection *conn;
- struct db_server_context conn_context;
-
- for (conn = arlalib_first_db(&conn_context,
- cell, host, afsprport, PR_SERVICE_ID, auth);
- conn != NULL && arlalib_try_next_db(error);
- conn = arlalib_next_db(&conn_context)) {
- error = delete_1 (conn, name);
- }
- free_db_server_context(&conn_context);
- return error;
-}
-
-
-static int
-remove_1(struct rx_connection *conn, const char *user, const char *group)
-{
- int error;
- int32_t uid;
- int32_t gid;
-
- error = pr_name2id(conn, user, &uid);
- if (error) {
- if (prdebug)
- warn("Problems finding name: %s, error %s (%d)",
- user, koerr_gettext(error), error);
- return error;
- }
-
- error = pr_name2id(conn, group, &gid);
- if (error) {
- if (prdebug)
- warn("Problems finding name: %s, error %s (%d)",
- group, koerr_gettext(error), error);
- return error;
- }
-
- if (prdebug)
- printf("PR_RemoveFromGroup(%d, %d)\n", uid, gid);
-
- error = PR_RemoveFromGroup(conn, uid, gid);
- return error;
-}
-
-/*
- *
- */
-
-static int
-pr_removeuser(const char *cell, const char *host,
- const char *user, const char *group,
- arlalib_authflags_t auth)
-{
- int error = ENETDOWN;
- struct rx_connection *conn;
- struct db_server_context conn_context;
-
- for (conn = arlalib_first_db(&conn_context,
- cell, host, afsprport, PR_SERVICE_ID, auth);
- conn != NULL && arlalib_try_next_db(error);
- conn = arlalib_next_db(&conn_context)) {
- error = remove_1 (conn, user, group);
- }
- free_db_server_context(&conn_context);
- return error;
-}
-
-static int
-rename_1 (struct rx_connection *conn,
- const char *fromname, const char *toname)
-{
- int error;
- int32_t id;
-
- error = pr_name2id(conn, fromname, &id);
- if (error) {
- if (prdebug)
- warn("Problems finding name: %s, error %s (%d)",
- fromname, koerr_gettext(error), error);
- return error;
- }
-
- if (prdebug)
- printf("PR_ChangeEntry(%d, %s, 0, 0)\n", id, toname);
-
- error = PR_ChangeEntry(conn, id, toname, 0, 0);
- return error;
-}
-
-/*
- *
- */
-
-static int
-pr_rename(const char *cell, const char *host,
- const char *fromname, const char *toname,
- arlalib_authflags_t auth)
-{
- int error = ENETDOWN;
- struct rx_connection *conn;
- struct db_server_context conn_context;
-
- for (conn = arlalib_first_db(&conn_context,
- cell, host, afsprport, PR_SERVICE_ID, auth);
- conn != NULL && arlalib_try_next_db(error);
- conn = arlalib_next_db(&conn_context)) {
- error = rename_1 (conn, fromname, toname);
- }
- free_db_server_context(&conn_context);
- return error;
-}
-
-static int
-setfields_1 (struct rx_connection *conn, const char *name,
- int mask, int flags, int ngroup, int nusers)
-{
- int error;
- int32_t id;
-
- error = pr_name2id(conn, name, &id);
- if (error) {
- if (prdebug)
- warn("Problems finding name: %s, error %s (%d)",
- name, koerr_gettext(error), error);
- return error;
- }
-
- if (prdebug)
- printf("PR_ChangeFields(%d, %d, %d, %d, %d, 0, 0)\n",
- id, mask, flags, ngroup, nusers);
-
- error = PR_SetFieldsEntry(conn, id, mask, flags, ngroup, nusers, 0, 0);
- return error;
-}
-
-/*
- *
- */
-
-static int
-pr_setfields(const char *cell, const char *host,
- const char *name, int flags, int ngroup, int nusers,
- arlalib_authflags_t auth)
-{
- int error = ENETDOWN;
- struct rx_connection *conn;
- struct db_server_context conn_context;
- int mask = 0;
-
- if (flags != -1)
- mask |= PR_SF_ALLBITS;
- if (ngroup != -1)
- mask |= PR_SF_NGROUPS;
- if (nusers != -1)
- mask |= PR_SF_NUSERS;
-
- for (conn = arlalib_first_db(&conn_context,
- cell, host, afsprport, PR_SERVICE_ID, auth);
- conn != NULL && arlalib_try_next_db(error);
- conn = arlalib_next_db(&conn_context)) {
- error = setfields_1 (conn, name, mask, flags, ngroup, nusers);
- }
- free_db_server_context(&conn_context);
- return error;
-}
-
-static int
-chown1(struct rx_connection *conn, const char *name, const char *owner)
-{
- int error;
- int32_t id;
- int32_t ownerid;
-
- error = pr_name2id(conn, name, &id);
- if (error) {
- if (prdebug)
- warn("Problems finding name: %s, error %s (%d)",
- name, koerr_gettext(error), error);
- return error;
- }
-
- error = pr_name2id(conn, owner, &ownerid);
- if (error) {
- if (prdebug)
- warn("Problems finding name: %s, error %s (%d)",
- name, koerr_gettext(error), error);
- return error;
- }
-
- if (prdebug)
- printf("PR_ChangeEntry(%d, \"\", %d, 0)\n",
- id, ownerid);
-
- error = PR_ChangeEntry(conn, id, "", ownerid, 0);
- return error;
-}
-
-/*
- *
- */
-
-static int
-pr_chown(const char *cell, const char *host,
- const char *name, const char *owner,
- arlalib_authflags_t auth)
-{
- int error = ENETDOWN;
- struct rx_connection *conn;
- struct db_server_context conn_context;
-
- for (conn = arlalib_first_db(&conn_context,
- cell, host, afsprport, PR_SERVICE_ID, auth);
- conn != NULL && arlalib_try_next_db(error);
- conn = arlalib_next_db(&conn_context)) {
- error = chown1 (conn, name, owner);
- }
- free_db_server_context(&conn_context);
- return error;
-}
-
-static int
-pts_id_to_name(struct rx_connection *conn, int id, prname *pr)
-{
- int32_t res = 0;
- namelist nlist;
- idlist ilist;
- nlist.len = 1;
- nlist.val = malloc(sizeof(prname) * nlist.len);
- ilist.len = 1;
- ilist.val = malloc(sizeof(int32_t) * ilist.len);
- if((ilist.val == NULL) || (nlist.val == NULL))
- errx(1, "Out of memory");
- ilist.val[0]=id;
- res = PR_IDToName(conn, &ilist, &nlist);
- if(res == 0)
- strlcpy((char *)pr, (char *)nlist.val[0], PR_MAXNAMELEN);
- free(ilist.val);
- free(nlist.val);
- return res;
-}
-
-static int
-pts_name_to_id(struct rx_connection *conn, const char *name, int32_t *id)
-{
- int32_t res = 0;
- namelist nlist;
- idlist ilist;
- int isdig = 1;
- const char *ptr = name;
-
- while(*ptr && isdig) {
- if(!isdigit((unsigned char)*ptr))
- isdig = 0;
- ptr++;
- }
- if(isdig) {
- *id = atoi(name);
- return 0;
- }
-
- nlist.len = 1;
- nlist.val = malloc(sizeof(prname) * nlist.len);
- ilist.len = 1;
- ilist.val = malloc(sizeof(int32_t) * ilist.len);
- if((nlist.val == NULL) || (ilist.val == NULL))
- errx(1, "Out of memory");
- strlcpy(nlist.val[0], name, sizeof(prname));
- res = PR_NameToID(conn, &nlist, &ilist);
- if (res == 0)
- *id = ilist.val[0];
- if (*id == PR_ANONYMOUSID)
- res = PRNOENT;
- free(ilist.val);
- free(nlist.val);
- return res;
-}
-
-static int
-listowned_1 (struct rx_connection *conn, const char *user)
-{
- int error;
- int32_t id;
- int32_t over;
- prname *name;
- prlist pr;
- int i;
-
- error = pts_name_to_id (conn, user, &id);
- if(error != 0)
- return error;
-
- pr.len = PR_MAXGROUPS;
- pr.val = malloc(sizeof(int32_t) * pr.len);
- if(pr.val == NULL)
- errx(1, "Out of memory");
-
- error = PR_ListOwned(conn, id, &pr, &over);
- if(error != 0)
- return error;
-
- i = 0;
- name = malloc(PR_MAXNAMELEN);
- if(name == NULL)
- errx(1, "Out of memory");
-
- printf("Groups owned by %s (id: %d) are:\n", user, id);
-
- while(pr.val[i] != 0 && i < pr.len) {
- pts_id_to_name(conn, pr.val[i++], name);
- printf(" %s\n", (char *) name);
- }
-
- free(pr.val);
- free(name);
- return 0;
-}
-
-static int
-pr_listowned (const char *cell, const char *host, const char *user,
- arlalib_authflags_t auth)
-{
- int error = ENETDOWN;
- struct rx_connection *conn;
- struct db_server_context conn_context;
-
- for (conn = arlalib_first_db(&conn_context,
- cell, host, afsprport, PR_SERVICE_ID, auth);
- conn != NULL && arlalib_try_next_db(error);
- conn = arlalib_next_db(&conn_context)) {
- error = listowned_1 (conn, user);
- }
- free_db_server_context(&conn_context);
- return error;
-}
-
-/*
- * create user
- */
-
-static int
-create_cmd(int argc, char **argv, int groupp, const char *cmd_name)
-{
- const char *name;
- const char *owner = NULL;
- const char *cell = (char *) cell_getthiscell();
- const char *host = NULL;
- int32_t id = 0;
- int noauth = 0;
- int error;
- int optind = 0;
-
- struct agetargs createuserarg[] = {
- {"name", 0, aarg_string, NULL, NULL, NULL, aarg_mandatory},
- {"owner", 0, aarg_string, NULL, "owner of the group"},
- {"id", 0, aarg_integer, NULL, "id of user", NULL},
- {"cell", 0, aarg_string, NULL, "what cell to use", NULL},
- {"host", 0, aarg_string, NULL, "specified db", NULL},
- {"noauth", 0, aarg_flag, NULL, "don't authenticate", NULL},
- {NULL, 0, aarg_end, NULL}},
- *arg;
-
- arg = createuserarg;
- if (groupp)
- arg->help = "name of user";
- else
- arg->help = "name of group";
- arg->value = &name; arg++;
- arg->value = &owner; arg++;
- arg->value = &id; arg++;
- arg->value = &cell; arg++;
- arg->value = &host; arg++;
- arg->value = &noauth; arg++;
-
- if (!groupp)
- memmove (&createuserarg[1], &createuserarg[2],
- 5 * sizeof(createuserarg[0]));
-
- if (agetarg (createuserarg, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(createuserarg, cmd_name, NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- cell = cell_expand_cell (cell);
-
- error = pr_create(cell, host, name, owner, &id, groupp,
- arlalib_getauthflag (noauth, 0, 0, 0));
- if (error) {
- printf("pr_create failed with: %s (%d)\n",
- koerr_gettext(error), error);
- } else
- printf("%s %s created with id %d\n",
- groupp ? "Group": "User", name, id);
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-createuser_cmd(int argc, char **argv)
-{
- return create_cmd(argc, argv, PR_CREATE_USER, "pts createuser");
-}
-
-/*
- *
- */
-
-static int
-creategroup_cmd(int argc, char **argv)
-{
- return create_cmd(argc, argv, PR_CREATE_GROUP, "pts creategroup");
-}
-
-/*
- *
- */
-
-static int
-adduser_cmd(int argc, char **argv)
-{
- const char *user;
- const char *group;
- const char *cell = cell_getthiscell();
- const char *host = NULL;
- int noauth = 0;
- int error;
- int optind = 0;
-
- struct agetargs addarg[] = {
- {"name", 0, aarg_string, NULL, "username", NULL, aarg_mandatory},
- {"group", 0, aarg_string, NULL, "groupname",NULL, aarg_mandatory},
- {"cell", 0, aarg_string, NULL, "what cell to use", NULL},
- {"host", 0, aarg_string, NULL, "specified db", NULL},
- {"noauth", 0, aarg_flag, NULL, "don't authenticate", NULL},
- {NULL, 0, aarg_end, NULL}},
- *arg;
-
- arg = addarg;
- arg->value = &user; arg++;
- arg->value = &group; arg++;
- arg->value = &cell; arg++;
- arg->value = &host; arg++;
- arg->value = &noauth; arg++;
-
- if (agetarg (addarg, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(addarg, "pts adduser", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- cell = cell_expand_cell (cell);
-
- error = pr_adduser(cell, host, user, group,
- arlalib_getauthflag (noauth, 0, 0, 0));
- if (error) {
- printf("pr_adduser failed with: %s (%d)\n",
- koerr_gettext(error), error);
- }
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-delete_cmd(int argc, char **argv)
-{
- const char *user = NULL;
- const char *cell = cell_getthiscell();
- const char *host = NULL;
- int noauth = 0;
- int error;
- int optind = 0;
-
- struct agetargs deletearg[] = {
- {"name", 0, aarg_string, NULL, "username", NULL, aarg_mandatory},
- {"cell", 0, aarg_string, NULL, "what cell to use", NULL},
- {"host", 0, aarg_string, NULL, "specified db", NULL},
- {"noauth", 0, aarg_flag, NULL, "don't authenticate", NULL},
- {NULL, 0, aarg_end, NULL}},
- *arg;
-
- arg = deletearg;
- arg->value = &user; arg++;
- arg->value = &cell; arg++;
- arg->value = &host; arg++;
- arg->value = &noauth; arg++;
-
- if (agetarg (deletearg, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(deletearg, "pts delete", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- cell = cell_expand_cell (cell);
-
- error = pr_delete(cell, host, user,
- arlalib_getauthflag (noauth, 0, 0, 0));
- if (error) {
- printf("pr_delete failed with: %s (%d)\n",
- koerr_gettext(error), error);
- } else
- if (prdebug)
- printf("Entry %s deleted successful\n", user);
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-removeuser_cmd(int argc, char **argv)
-{
- const char *user = NULL;
- const char *group = NULL;
- const char *cell = cell_getthiscell();
- const char *host = NULL;
- int noauth = 0;
- int error;
- int optind = 0;
-
- struct agetargs removearg[] = {
- {"user", 0, aarg_string, NULL, "username", NULL, aarg_mandatory},
- {"group", 0, aarg_string, NULL, "group", NULL, aarg_mandatory},
- {"cell", 0, aarg_string, NULL, "what cell to use", NULL},
- {"host", 0, aarg_string, NULL, "specified db", NULL},
- {"noauth", 0, aarg_flag, NULL, "don't authenticate", NULL},
- {NULL, 0, aarg_end, NULL}},
- *arg;
-
- arg = removearg;
- arg->value = &user; arg++;
- arg->value = &group; arg++;
- arg->value = &cell; arg++;
- arg->value = &host; arg++;
- arg->value = &noauth; arg++;
-
- if (agetarg (removearg, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(removearg, "pts remove", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- cell = cell_expand_cell (cell);
-
- error = pr_removeuser(cell, host, user, group,
- arlalib_getauthflag (noauth, 0, 0, 0));
- if (error) {
- printf("pr_remove failed with: %s (%d)\n",
- koerr_gettext(error), error);
- } else
- if (prdebug)
- printf("User %s removed from group %s.\n", user, group);
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-rename_cmd(int argc, char **argv)
-{
- const char *fromname = NULL;
- const char *toname = NULL;
- const char *cell = cell_getthiscell();
- const char *host = NULL;
- int noauth = 0;
- int error;
- int optind = 0;
-
- struct agetargs renamearg[] = {
- {"from", 0, aarg_string, NULL, "from name",NULL, aarg_mandatory},
- {"to", 0, aarg_string, NULL, "to name", NULL, aarg_mandatory},
- {"cell", 0, aarg_string, NULL, "what cell to use", NULL},
- {"host", 0, aarg_string, NULL, "specified db", NULL},
- {"noauth", 0, aarg_flag, NULL, "don't authenticate", NULL},
- {NULL, 0, aarg_end, NULL}},
- *arg;
-
- arg = renamearg;
- arg->value = &fromname;arg++;
- arg->value = &toname; arg++;
- arg->value = &cell; arg++;
- arg->value = &host; arg++;
- arg->value = &noauth; arg++;
-
- if (agetarg (renamearg, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(renamearg, "pts rename", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- cell = cell_expand_cell (cell);
-
- error = pr_rename(cell, host, fromname, toname,
- arlalib_getauthflag (noauth, 0, 0, 0));
- if (error) {
- printf("pr_rename failed with: %s (%d)\n",
- koerr_gettext(error), error);
- } else
- if (prdebug)
- printf("Changed name from %s to %s.\n", fromname, toname);
-
- return 0;
-}
-
-
-/*
- *
- */
-
-static int
-setfields_error(void)
-{
- printf("text must be a union of the sets 'SOMA-' and 's-mar'\n");
- return 0;
-}
-
-/*
- *
- */
-
-static int
-setfields_cmd(int argc, char **argv)
-{
- const char *name = NULL;
- const char *strflags = NULL;
- int flags = -1;
- int gquota = -1;
- int uquota = -1;
- const char *cell = cell_getthiscell();
- const char *host = NULL;
- int noauth = 0;
- int error;
- int optind = 0;
-
- struct agetargs setfieldarg[] = {
- {"name", 0, aarg_string, NULL, "name of user/group",
- NULL, aarg_mandatory},
- {"flags", 0, aarg_string, NULL, "flags", NULL},
- {"groupquota", 0, aarg_integer, NULL, "groupquota",NULL},
- {"cell", 0, aarg_string, NULL, "what cell to use", NULL},
- {"host", 0, aarg_string, NULL, "specified db", NULL},
- {"noauth", 0, aarg_flag, NULL, "don't authenticate", NULL},
- {NULL, 0, aarg_end, NULL}},
- *arg;
-
- arg = setfieldarg;
- arg->value = &name; arg++;
- arg->value = &flags; arg++;
- arg->value = &gquota; arg++;
- arg->value = &cell; arg++;
- arg->value = &host; arg++;
- arg->value = &noauth; arg++;
-
- if (agetarg (setfieldarg, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(setfieldarg, "pts setfields", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- if(strflags) {
- if (strlen(strflags) != 5)
- return setfields_error();
-
- flags = 0;
-
- if (strflags[0] == 'S')
- flags |= PRP_STATUS_ANY;
- else if (strflags[0] == 's')
- flags |= PRP_STATUS_MEM;
- else if (strflags[0] != '-')
- return setfields_error();
-
- if (strflags[1] == 'O')
- flags |= PRP_OWNED_ANY;
- else if (strflags[1] != '-')
- return setfields_error();
-
- if (strflags[2] == 'M')
- flags |= PRP_MEMBER_ANY;
- else if (strflags[2] == 'm')
- flags |= PRP_MEMBER_MEM;
- else if (strflags[2] != '-')
- return setfields_error();
-
- if (strflags[3] == 'A') {
- flags |= PRP_ADD_ANY;
- } else if (strflags[3] == 'a')
- flags |= PRP_ADD_MEM;
- else if (strflags[3] != '-')
- return setfields_error();
-
- if (strflags[4] == 'r')
- flags |= PRP_REMOVE_MEM;
- else if (strflags[4] != '-')
- return setfields_error();
- }
-
- cell = cell_expand_cell (cell);
-
- error = pr_setfields(cell, host, name, flags, gquota, uquota,
- arlalib_getauthflag (noauth, 0, 0, 0));
- if (error) {
- printf("pr_setfields failed with: %s (%d)\n",
- koerr_gettext(error), error);
- } else
- if (prdebug)
- printf("Changed fields for %s.\n", name);
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-chown_cmd(int argc, char **argv)
-{
- const char *name = NULL;
- const char *owner = NULL;
- const char *cell = cell_getthiscell();
- const char *host = NULL;
- int noauth = 0;
- int error;
- int optind = 0;
-
- struct agetargs chownarg[] = {
- {"name", 0, aarg_string, NULL, "user or group name",
- NULL, aarg_mandatory},
- {"owner", 0, aarg_string, NULL, "new owner",
- NULL, aarg_mandatory},
- {"host", 0, aarg_string, NULL, "specified db", NULL},
- {"cell", 0, aarg_string, NULL, "what cell to use", NULL},
- {"noauth", 0, aarg_flag, NULL, "don't authenticate", NULL},
- {NULL, 0, aarg_end, NULL}},
- *arg;
-
- arg = chownarg;
- arg->value = &name; arg++;
- arg->value = &owner; arg++;
- arg->value = &cell; arg++;
- arg->value = &host; arg++;
- arg->value = &noauth; arg++;
-
- if (agetarg (chownarg, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(chownarg, "pts chown", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- cell = cell_expand_cell (cell);
-
- error = pr_chown(cell, host, name, owner,
- arlalib_getauthflag (noauth, 0, 0, 0));
- if (error) {
- printf("pr_chown failed with: %s (%d)\n",
- koerr_gettext(error), error);
- } else
- if (prdebug)
- printf("Changed owner of %s to %s.\n", name, owner);
-
- return 0;
-}
-
-/*
- * examine `users' in `cell'
- */
-
-static int
-examine1 (struct rx_connection *conn, agetarg_strings *users)
-{
- namelist nlist;
- idlist ilist;
- int i;
- int error;
-
- nlist.len = users->num_strings;
- nlist.val = malloc(sizeof(prname) * nlist.len);
- if(nlist.val == NULL)
- errx(1, "Out of memory.");
-
- ilist.len = nlist.len;
- ilist.val = malloc(sizeof(int32_t)*ilist.len);
- if(ilist.val == NULL)
- errx(1, "Out of memory.");
-
- for(i = 0; i < nlist.len; i++)
- strlcpy(nlist.val[i], users->strings[i], sizeof(prname));
-
- error = PR_NameToID(conn, &nlist, &ilist);
- if (error) {
- free(nlist.val);
- free(ilist.val);
- return error;
- }
-
- for(i = 0; i < nlist.len; i++) {
- if(ilist.val[i] == PR_ANONYMOUSID) {
- ilist.val[i] = atoi(nlist.val[i]);
- }
- }
-
- for(i = 0; i < nlist.len; i++) {
- error = examine_id(conn, ilist.val[i], nlist.val[i]);
- if (error)
- break;
- }
- free(nlist.val);
- free(ilist.val);
- return error;
-}
-
-
-/*
- *
- */
-
-static int
-examine_cmd (int argc, char **argv)
-{
- const char *cell = cell_getthiscell();
- const char *host = NULL;
- struct rx_connection *connptdb = NULL;
- struct db_server_context conn_context;
- int noauth = 1;
- agetarg_strings users = {0 , NULL };
- int optind = 0;
- int error = -1;
-
- struct agetargs examinearg[] = {
- {"nameorid", 0, aarg_strings, NULL, "user or group name",
- NULL, aarg_mandatory},
- {"cell", 0, aarg_string, NULL, "what cell to use",
- NULL, aarg_optional},
- {"host", 0, aarg_string, NULL, "specified db",
- NULL, aarg_optional},
- {"noauth", 0, aarg_flag, NULL, "don't authenticate",
- NULL, aarg_optional},
- {NULL, 0, aarg_end, NULL}}, *arg;
-
- arg = examinearg;
- arg->value = &users; arg++;
- arg->value = &cell; arg++;
- arg->value = &host; arg++;
- arg->value = &noauth; arg++;
-
- if (agetarg (examinearg, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(examinearg, "pts examine", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- cell = cell_expand_cell (cell);
-
- error = ENETDOWN;
- for (connptdb = arlalib_first_db(&conn_context, cell, host, afsprport,
- PR_SERVICE_ID,
- arlalib_getauthflag (noauth, 0, 0, 0));
- connptdb != NULL && arlalib_try_next_db (error);
- connptdb = arlalib_next_db(&conn_context)) {
- error = examine1 (connptdb, &users);
- }
- free_db_server_context(&conn_context);
- return 0;
-}
-
-static int
-listmax_cmd (int argc, char **argv)
-{
- int error;
- int32_t uid = 0;
- int32_t gid = 0;
- const char *cell = cell_getthiscell();
- const char *host = NULL;
- struct rx_connection *connptdb = NULL;
- struct db_server_context conn_context;
- int optind = 0;
- int noauth = 0;
-
- struct agetargs examinearg[] = {
- {"cell", 0, aarg_string, NULL, "what cell to use",
- NULL, aarg_optional},
- {"host", 0, aarg_string, NULL, "specified db",
- NULL, aarg_optional},
- {"noauth", 0, aarg_flag, NULL, "don't authenticate",
- NULL, aarg_optional},
- {NULL, 0, aarg_end, NULL}}, *arg;
-
- arg = examinearg;
- arg->value = &cell; arg++;
- arg->value = &host; arg++;
- arg->value = &noauth; arg++;
-
- if (agetarg (examinearg, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(examinearg, "pts listmax", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- cell = cell_expand_cell (cell);
-
- error = ENETDOWN;
- for (connptdb = arlalib_first_db(&conn_context, cell, host, afsprport,
- PR_SERVICE_ID,
- arlalib_getauthflag (noauth, 0, 0, 0));
- connptdb != NULL && arlalib_try_next_db (error);
- connptdb = arlalib_next_db(&conn_context)) {
- error = PR_ListMax (connptdb, &uid, &gid);
- }
- free_db_server_context(&conn_context);
- if (error == 0)
- printf("Max user id is %d and max group id is %d.\n", uid, gid);
- else
- warnx("PR_ListMax failed: %s", koerr_gettext (error));
- return 0;
-}
-
-static int
-listmembershipbyname(struct rx_connection *conn, const char *name)
-{
- int32_t res = 0;
- int32_t id = 0;
- int32_t over;
- int i;
- prlist elist;
-
- res = pts_name_to_id(conn, name, &id);
- if(res)
- return res;
-
- elist.len = PR_MAXGROUPS; /* XXX this will allocate 5000 ints, should
- check how many groups first. That will take
- a lot of code though. */
- elist.val = malloc(sizeof(int32_t) * elist.len);
- if(elist.val == NULL)
- errx(1, "Out of memory");
- res = PR_ListElements(conn, id, &elist, &over);
- if(res != 0)
- return res;
-
- if(id>=0)
- printf("Groups %s (id: %d) is a member of:\n", name, id);
- else
- printf("Members of %s (id: %d) are:\n", name, id);
- for(i = 0; i < elist.len; i++) {
- prname pr;
- res = pts_id_to_name(conn, elist.val[i], &pr);
- printf(" %s\n", (char *)&pr);
- }
- free(elist.val);
- return 0;
-}
-
-static int
-member_cmd (int argc, char **argv)
-{
- int error;
- const char *cell = cell_getthiscell ();
- const char *host = NULL;
- struct rx_connection *connptdb = NULL;
- struct db_server_context conn_context;
- int32_t noauth = 0;
- int i = 0;
- int optind = 0;
- agetarg_strings users = {0 , NULL };
-
- struct agetargs memarg[] = {
- {"nameorid", 0, aarg_strings, NULL, "user or group name",
- NULL, aarg_mandatory},
- {"cell", 0, aarg_string, NULL, "what cell to use",
- NULL, aarg_optional},
- {"host", 0, aarg_string, NULL, "specified db", NULL},
- {"noauth", 0, aarg_flag, NULL, "don't authenticate",
- NULL, aarg_optional},
- {NULL, 0, aarg_end, NULL}}, *arg;
-
- arg = memarg;
- arg->value = &users; arg++;
- arg->value = &cell; arg++;
- arg->value = &host; arg++;
- arg->value = &noauth; arg++;
-
- if (agetarg (memarg, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(memarg, "pts membership", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- cell = cell_expand_cell (cell);
-
- memset(&conn_context, '\0', sizeof(struct db_server_context));
-
- error = ENETDOWN;
- for (connptdb = arlalib_first_db(&conn_context, cell, host, afsprport,
- PR_SERVICE_ID,
- arlalib_getauthflag (noauth, 0, 0, 0));
- connptdb != NULL && arlalib_try_next_db (error);
- connptdb = arlalib_next_db(&conn_context)) {
- error = 0;
- for (i = 0; i < users.num_strings; ++i) {
- int tmp = listmembershipbyname(connptdb, users.strings[i]);
- if (error == 0 && tmp != 0)
- error = tmp;
- }
- }
- if (error)
- fprintf(stderr, "membership: %s (%d)\n",
- koerr_gettext(error), error);
- free_db_server_context(&conn_context);
- return 0;
-}
-
-static int
-listowned_cmd(int argc, char **argv)
-{
- int error;
- int optind = 0;
- const char *user = NULL;
- const char *cell = cell_getthiscell();
- const char *host = NULL;
- int noauth = 0;
-
- static struct agetargs listowned_args[] = {
- {"id", 0, aarg_string, NULL, "id of user/group",
- NULL, aarg_mandatory},
- {"cell", 0, aarg_string, NULL, "what cell to use",
- NULL},
- {"host", 0, aarg_string, NULL, "specified db", NULL},
- {"noauth", 0, aarg_flag, NULL, "don't authenticate", NULL},
- {NULL, 0, aarg_end, NULL}}, *arg;
-
- arg = listowned_args;
- arg->value = &user; arg++;
- arg->value = &cell; arg++;
- arg->value = &host; arg++;
- arg->value = &noauth; arg++;
-
- if (agetarg (listowned_args, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage (listowned_args, "pts listowned", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- cell = cell_expand_cell (cell);
-
- error = pr_listowned (cell, host, user,
- arlalib_getauthflag (noauth, 0, 0, 0));
- if (error)
- printf ("pr_listowned failed: %s\n",
- koerr_gettext (error));
- return 0;
-}
-
-static int
-syncdb_cmd(int argc, char **argv)
-{
- printf("sync...not implemented\n");
- return 0;
-}
-
-static void
-pts_usage(void)
-{
- printf("pts - an arla tool for administrating AFS users"
- " and groups.\n");
- printf("Type \"pts help\" to get a list of commands.\n");
- exit(1);
-}
-
-
-/*
- * SL - switch
- */
-
-static SL_cmd cmds[] = {
- {"adduser", adduser_cmd, "add a user to a group"},
- {"chown", chown_cmd, "change owner of user/group"},
- {"creategroup", creategroup_cmd,"create a group"},
- {"cg"},
- {"createuser", createuser_cmd, "create a user"},
- {"dump", dump_cmd, "dump pts database"},
- {"delete", delete_cmd, "delete entry"},
- {"examine", examine_cmd, "examine a user or a group"},
- {"help", help_cmd, "get help on pts"},
- {"?"},
- {"listmax", listmax_cmd, "print largest uid and gid"},
- {"listowned", listowned_cmd, "list groups owned by a user or group, or orphaned groups"},
- {"membership", member_cmd, "list group or user membership"},
- {"groups"},
- {"removeuser", removeuser_cmd, "remove user from group"},
- {"rename", rename_cmd, "rename user/group"},
- {"setfields", setfields_cmd, "not yet implemented"},
- {"setmax", empty_cmd, "not yet implemented"},
- {"syncdb", syncdb_cmd, "sync ptsdb with /etc/passwd"},
- {"version", arlalib_version_cmd, "print version"},
- {NULL}
-};
-
-
-static int
-help_cmd (int argc, char **argv)
-{
- sl_help(cmds, argc, argv);
- return 0;
-}
-
-int
-main(int argc, char **argv)
-{
- int ret = 0;
- Log_method *method;
- char **myargv;
- int pos = 0;
- int i;
-
- tzset();
-
- method = log_open (__progname, "/dev/stderr:notime");
- if (method == NULL)
- errx (1, "log_open failed");
- cell_init(0, method);
- ports_init();
-
- myargv = malloc((argc + 1) * sizeof(char *));
- if (myargv == NULL)
- err(1, "malloc");
-
- for (i = 0; i < argc; ++i)
- myargv[i] = argv[i];
- myargv[argc] = NULL;
-
- if(argc > 1) {
- if (strcmp(myargv[1], "-debug") == 0) {
- prdebug = 1;
- argc--;
- myargv[pos+1] = myargv[pos];
- ++pos;
- }
- ret = sl_command(cmds, argc - 1, &myargv[pos+1]);
- if (ret == -1)
- printf("%s: Unknown command\n", myargv[pos+1]);
- } else
- pts_usage();
-
- return ret;
-}
diff --git a/usr.sbin/afs/src/appl/udebug/Makefile.in b/usr.sbin/afs/src/appl/udebug/Makefile.in
deleted file mode 100644
index b6841d47dd8..00000000000
--- a/usr.sbin/afs/src/appl/udebug/Makefile.in
+++ /dev/null
@@ -1,138 +0,0 @@
-# $KTH: Makefile.in,v 1.11.2.2 2001/10/23 23:52:12 ahltorp Exp $
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-LN_S = @LN_S@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-mandir = @mandir@
-transform = @program_transform_name@
-EXECSUFFIX = @EXECSUFFIX@
-
-APPL_BIN = udebug
-MANPAGES = udebug.1
-
-DEFS = @DEFS@
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-X_CFLAGS = @X_CFLAGS@
-LDFLAGS = @LDFLAGS@
-
-ETAGS = etags
-MAKEDEPEND = makedepend
-RXKADINC = -I$(srcdir)/../../rxkad
-INCLUDES = -I$(srcdir)/../.. \
- -I$(srcdir)/../../include \
- -I$(srcdir)/../lib \
- -I../../include \
- -I../../rxdef \
- -I. \
- $(KERNEL_INCLUDE) \
- -I$(srcdir)/../../xfs/include \
- -I$(srcdir)/../../arlad \
- @INC_roken@ \
- $(RXKADINC)
-
-DEFINES =
-REALCFLAGS = $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) \
- $(X_CFLAGS) @PLWP_INC_FLAGS@
-RXKAD_LIBS = @MILKO_RXKAD_LIBS@
-KERNEL_INCLUDE = @KERNEL_INCLUDE@
-LIB_tgetent = @LIB_tgetent@
-READLINE_lib = @LIB_readline@
-KAFS_LIBS = @AIX_EXTRA_KAFS@ @KAFS_LIBS@
-LIBS = -L../lib -larlalib \
- -L../../rxdef -lrxdefclient \
- -L../../rx -lrx \
- -L../../lwp -llwp @PLWP_LIB_FLAGS@ \
- -L../../lib/ko -lko -L../../util -lutil \
- -L../../lib/sl -lsl \
- $(READLINE_lib) \
- @LIB_roken@ \
- $(RXKAD_LIBS) \
- $(KAFS_LIBS) \
- $(RXKAD_LIBS) @LIBS@
-
-LIBDEPENDS = ../../rxdef/librxdefclient.a ../../rx/librx.a ../../lwp/liblwp.a \
- ../../util/libutil.a ../../lib/sl/libsl.a \
- ../../lib/ko/libko.a ../lib/libarlalib.a
-
-PROGS = udebug
-UDEBUG_SRCS = udebug.c
-SRCS = $(UDEBUG_SRCS)
-UDEBUG_OBJS = udebug.o
-HDRS =
-
-all: $(PROGS)
-
-.PHONY: all install uninstall depend tags clean
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(bindir)/$$f; \
- done ;\
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir) ; \
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$$e ; \
- $(INSTALL_DATA) $(srcdir)/$$x \
- $(DESTDIR)$(mandir)/man$$e/$$f.$$e; \
- done
-
-uninstall:
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
- done ; \
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- rm -rf $(DESTDIR)$(mandir)/$$f.$$e; \
- done
-
-udebug: $(UDEBUG_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(UDEBUG_OBJS) $(LIBS)
-
-Makefile: Makefile.in ../../config.status
- cd ../..; CONFIG_FILES=appl/udebug/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(CFILES)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(PROGS) $(OBJS) *~ *.o core
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/appl/udebug/udebug.1 b/usr.sbin/afs/src/appl/udebug/udebug.1
deleted file mode 100644
index 74d7c664f33..00000000000
--- a/usr.sbin/afs/src/appl/udebug/udebug.1
+++ /dev/null
@@ -1,92 +0,0 @@
-.\" Copyright (c) 2000 Kungliga Tekniska Högskolan
-.\" (Royal Institute of Technology, Stockholm, Sweden).
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" 3. Neither the name of the Institute nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $arla: udebug.1,v 1.6 2003/02/14 17:19:59 lha Exp $
-.\"
-.Dd August 06, 2000
-.Dt UDEBUG 1
-.Os "The Arla Project"
-.Sh NAME
-.Nm udebug
-.Nd
-a tool to diagnose synchronization problems with ubik-database
-servers.
-.Sh SYNOPSIS
-.Nm
-.Op Fl servers Ar servers ...
-.Op Fl port Ar port
-.Op Fl long
-.Sh DESCRIPTION
-Supported options:
-.Bl -tag -width Ds
-.It Fl servers Ar servers ...
-A list of server to probe.
-.It Fl port Ar port
-The port number of where the server resides.
-.It Fl long
-Verbose information.
-.El
-.Sh DIAGNOSTICS
-.Nm
-is used to diagnose synchronization problems with ubik-servers.
-.Pp
-Ubik is quorum-complete protocol. Servers vote on each other to elect
-a sync-site.
-The sync-site have the ability to synchronize a two-phase write with
-the other servers if at least half of them is available.
-.Sh EXAMPLES
-.Bd -literal
-datan# udebug -servers anden.e.kth.se -port 7003
-Host 130.237.48.7 time is Mon Aug 7 13:46:24 2000
-Localtime is Mon Aug 7 13:46:43 2000, differ 19 seconds
-Last yes vote for 130.237.48.7 secs was 8 ago (at Mon Aug 7 13:46:16 2000)
-Last vote started 8 secs ago (at Mon Aug 7 13:46:16 2000)
-Local db version is 965530500.199
-Syncsite db version is 965530500.199
-0 locked pages, 0 of them for write
-I'm the synchost for 49 seconds more (Mon Aug 7 13:47:13 2000)
-Recover state is 0x1f
-Last time a new db version was laballed was:
- 118284 secs ago (at Sun Aug 6 04:55:00 2000)
-
-Server 130.237.48.244: (db 965530500.199)
- last vote recived 8 secs ago (at Mon Aug 7 13:46:16 2000)
- last beacon sent 8 secs ago (at Mon Aug 7 13:46:16 2000)
- dbcurrent=1, up=1, beaconSince=1
-
-Server 130.237.48.8: (db 965530500.199)
- last vote recived 11 secs ago (at Mon Aug 7 13:46:13 2000)
- last beacon sent 8 secs ago (at Mon Aug 7 13:46:16 2000)
- dbcurrent=1, up=1, beaconSince=1
-
-.Ed
-.\".Sh SEE ALSO
-.\"XXX
diff --git a/usr.sbin/afs/src/appl/udebug/udebug.c b/usr.sbin/afs/src/appl/udebug/udebug.c
deleted file mode 100644
index feb1066b657..00000000000
--- a/usr.sbin/afs/src/appl/udebug/udebug.c
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-RCSID("$KTH: udebug.c,v 1.18 2000/10/10 17:30:04 lha Exp $");
-
-static int verbose = 0;
-
-static void
-usage(void)
-{
- fprintf(stderr,
- "udebug: Version $KTH: udebug.c,v 1.18 2000/10/10 17:30:04 lha Exp $\n"
- "usage: udebug -servers server ... -port port -noauth -long\n");
- exit(1);
-}
-
-
-static void
-newhost(u_int32_t **hosts, int *len, char *host)
-{
- struct addrinfo hints, *res;
- u_int32_t *ptr;
- int ret;
-
- if (host == NULL)
- return;
-
- memset (&hints, 0, sizeof(hints));
- hints.ai_family = PF_INET;
- hints.ai_socktype = SOCK_DGRAM;
-
- ret = getaddrinfo(host, NULL, &hints, &res);
- if (ret < 0) {
- warnx("cant find addr for '%s'.", host);
- return;
- }
- assert (res->ai_family == PF_INET);
-
- ptr = realloc(*hosts, sizeof(u_int32_t) * ++*len);
- if (ptr == NULL) {
- free(*hosts);
- hosts = NULL;
- err(1, "realloc");
- }
-
- *hosts = ptr;
-
- ptr[*len-1] = ((struct sockaddr_in *)res->ai_addr)->sin_addr.s_addr;
-
- freeaddrinfo(res);
-}
-
-static const char *
-myctime(time_t time, char *datestr, size_t sz)
-{
- struct tm tm;
- strftime (datestr, sz, "%Y-%m-%d %H:%M:%S",
- localtime_r(&time, &tm));
- return datestr;
-}
-
-static void
-ProbeHost(u_int32_t host, u_int16_t port, arlalib_authflags_t auth)
-{
- struct rx_connection *conn;
- ubik_debug db;
- int error;
- struct in_addr server;
-
- server.s_addr = host;
-
- conn = arlalib_getconnbyaddr(NULL,
- host,
- NULL,
- port,
- VOTE_SERVICE_ID,
- auth);
-
- if (conn == NULL) {
- warnx("Could not contact host %s", inet_ntoa(server));
- return;
- }
-
- error = Ubik_Debug(conn, &db);
- if (error) {
- fprintf(stderr, "ProbeHost: Ubik_Debug: %s (%d)\n",
- koerr_gettext(error), error);
-
- return;
- }
-
-#define ABS_COMP_DB(dbname,field) (abs(db.now - dbname##.##field))
-
- {
- struct timeval tv;
- char datestring[100];
-
- gettimeofday(&tv, NULL);
-
- printf("Host %s time is %s\n",
- inet_ntoa(server),
- myctime(db.now, datestring, sizeof(datestring)));
- printf("Localtime is %s, differ %d seconds\n",
- myctime(tv.tv_sec, datestring, sizeof(datestring)),
- abs(db.now - tv.tv_sec));
- server.s_addr = htonl(db.syncHost);
- printf("Last yes vote for %s secs was %d ago (at %s)\n",
- inet_ntoa(server),
- ABS_COMP_DB(db,lastYesTime),
- myctime(db.lastYesTime, datestring, sizeof(datestring)));
- printf("Last vote started %d secs ago (at %s)\n",
- ABS_COMP_DB(db,syncTime),
- myctime(db.lastYesTime, datestring, sizeof(datestring)));
- printf("Local db version is %u.%u\n",
- db.localVersion.epoch,
- db.localVersion.counter);
- printf("Syncsite db version is %u.%u\n",
- db.syncVersion.epoch,
- db.syncVersion.counter);
- printf("%d locked pages, %d of them for write\n",
- db.anyReadLocks + db.anyWriteLocks, db.anyWriteLocks);
-
- if (db.amSyncSite) {
-
- printf("I'm the synchost for %d seconds more (%s)\n",
- db.syncSiteUntil - db.now,
- myctime(db.syncSiteUntil, datestring, sizeof(datestring)));
- } else {
- server.s_addr = htonl(db.syncHost);
- printf("I'm not the synchost, but %s is.\n",
- inet_ntoa(server));
- }
-
- if (verbose || db.amSyncSite) {
- int i;
- ubik_sdebug sdb;
-
- if (!db.amSyncSite) {
- arlalib_destroyconn (conn);
- conn = arlalib_getconnbyaddr(NULL, server.s_addr,
- NULL, port,
- VOTE_SERVICE_ID, auth);
- if (conn == NULL) {
- warnx("Could not contact host %s", inet_ntoa(server));
- return;
- }
- error = Ubik_Debug(conn, &db);
- if (error) {
- fprintf(stderr, "ProbeHost: Ubik_Debug: %s (%d)\n",
- koerr_gettext(error), error);
-
- return;
- }
- }
-
- printf("Recover state is 0x%x\n", db.recoveryState);
- printf("Last time a new db version was laballed was:\n"
- "\t\t%d secs ago (at %s)\n\n",
- ABS_COMP_DB(db,epochTime),
- myctime(db.epochTime, datestring, sizeof(datestring)));
-
- for (i = 0; i < db.nServers - 1; i++) {
-
- error = Ubik_SDebug(conn, i, &sdb);
- if (error) {
- printf("Problem with host %d\n\n", i);
- continue;
- }
-
- server.s_addr = htonl(sdb.addr);
- printf("Server %s: (db %u.%u)\n",
- inet_ntoa(server),
- sdb.remoteVersion.epoch,
- sdb.remoteVersion.counter);
- printf("\tlast vote recived %d secs ago (at %s)\n",
- ABS_COMP_DB(sdb,lastVoteTime),
- myctime(sdb.lastVoteTime,
- datestring, sizeof(datestring)));
- printf("\tlast beacon sent %d secs ago (at %s)\n",
- ABS_COMP_DB(sdb,lastBeaconSent),
- myctime(sdb.lastBeaconSent,
- datestring, sizeof(datestring)));
- printf("\tdbcurrent=%d, up=%d, beaconSince=%u\n",
- sdb.currentDB,
- sdb.up,
- sdb.beaconSinceDown);
-
- printf("\n");
-
- }
- }
- }
-}
-
-
-int
-main(int argc, char **argv)
-{
- u_int32_t *hosts = NULL;
- int len = 0;
- u_int16_t port = 0;
- enum { START, NOWHERE, HOST, PORT } state = START;
-
- if (argc < 2)
- usage();
-
- argv++;
- argc--;
-
- while (argc) {
- if (*argv[0] == '-') {
- if (strncmp(*argv, "-server", 7) == 0)
- state = HOST;
- else if (strcmp(*argv, "-port") == 0)
- state = PORT;
- else if (strcmp(*argv, "-long") == 0)
- verbose = 1;
- else
- usage();
- } else {
- switch (state) {
- case START:
- if (argc != 2)
- usage();
- newhost(&hosts, &len, *argv);
- argv++;
- argc--;
- port = atoi(*argv);
- break;
- case HOST:
- newhost(&hosts, &len, *argv);
- break;
- case PORT:
- port = atoi(*argv);
- state = NOWHERE;
- break;
- case NOWHERE:
- usage();
- default:
- exit(-1);
- }
- }
- argc--;
- argv++;
- }
-
- if (hosts == NULL)
- errx(1, "No hosts found !");
-
- if (port == 0)
- errx(1, "No port given");
-
- while (len) {
- ProbeHost(*hosts, port, AUTHFLAGS_NOAUTH); /* XXX */
- hosts++;
- len--;
- }
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/udebug/udebug.in b/usr.sbin/afs/src/appl/udebug/udebug.in
deleted file mode 100644
index 80f1f5b33db..00000000000
--- a/usr.sbin/afs/src/appl/udebug/udebug.in
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2002 - 2003, Stockholms Universitet
-# (Stockholm University, Stockholm Sweden)
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# 3. Neither the name of the university nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-# $arla: udebug.in,v 1.1 2003/03/06 16:01:45 lha Exp $
-#
-
-bindir="@bindir@"
-PATH="$bindir:$PATH"
-export PATH
-
-port=
-noauth=
-verbose=
-
-while test $# != 0; do
- case "$1" in
- -version)
- exec afstool version
- ;;
- -verbose)
- verbose="--verbose"
- ;;
- -servers)
- shift
- while test $# != 0 && expr "$1" : '-' >/dev/null ; do
- servers="$servers $1"
- shift;
- done
- ;;
- -port)
- port="--port=$2"
- shift
- ;;
- -noauth)
- noauth="-noauth"
- ;;
- -*)
- echo "unknown argument $1"
- exit 1
- ;;
- *)
- servers="$servers $1"
- ;;
- esac
- shift
-done
-
-if [ X"$servers" = X ] ; then
- echo "no servers given"
-fi
-
-exec afstool ubik debug $verbose $port $servers $noauth
diff --git a/usr.sbin/afs/src/appl/vos/Makefile.in b/usr.sbin/afs/src/appl/vos/Makefile.in
deleted file mode 100644
index 3d91a9d4804..00000000000
--- a/usr.sbin/afs/src/appl/vos/Makefile.in
+++ /dev/null
@@ -1,146 +0,0 @@
-# $KTH: Makefile.in,v 1.12.2.3 2001/10/23 23:52:40 ahltorp Exp $
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-LN_S = @LN_S@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-mandir = @mandir@
-transform = @program_transform_name@
-EXECSUFFIX = @EXECSUFFIX@
-
-APPL_BIN = vos
-MANPAGES = vos.8
-
-DEFS = @DEFS@
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-X_CFLAGS = @X_CFLAGS@
-LDFLAGS = @LDFLAGS@
-
-ETAGS = etags
-MAKEDEPEND = makedepend
-RXKADINC = -I$(srcdir)/../../rxkad
-INCLUDES = -I$(srcdir)/../.. \
- -I$(srcdir)/../../include \
- -I$(srcdir)/../lib \
- -I../../include \
- -I../../rxdef \
- -I. \
- $(KERNEL_INCLUDE) \
- -I$(srcdir)/../../xfs/include \
- -I$(srcdir)/../../arlad \
- @INC_roken@ \
- $(RXKADINC)
-
-DEFINES =
-REALCFLAGS = $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) \
- $(X_CFLAGS) @PLWP_INC_FLAGS@
-RXKAD_LIBS = @MILKO_RXKAD_LIBS@
-KERNEL_INCLUDE = @KERNEL_INCLUDE@
-READLINE_lib = @LIB_readline@
-KAFS_LIBS = @AIX_EXTRA_KAFS@ @KAFS_LIBS@
-LIB_tgetent = @LIB_tgetent@
-LIBS = -L../lib -larlalib \
- -L../../rxdef -lrxdefclient \
- -L../../rx -lrx \
- -L../../lwp -llwp @PLWP_LIB_FLAGS@ \
- -L../../lib/ko -lko -L../../util -lutil \
- -L../../lib/sl -lsl \
- $(READLINE_lib) \
- @LIB_roken@ \
- $(RXKAD_LIBS) \
- $(KAFS_LIBS) \
- $(RXKAD_LIBS) @LIBS@
-
-LIBDEPENDS = ../../rxdef/librxdefclient.a ../../rx/librx.a ../../lwp/liblwp.a \
- ../../util/libutil.a ../../lib/sl/libsl.a \
- ../../lib/ko/libko.a ../lib/libarlalib.a
-
-PROGS = vos
-VOS_SRCS = vos.c vos_common.c vos_examine.c vos_listvol.c \
- vos_partinfo.c vos_status.c vos_createentry.c \
- vos_listpart.c vos_syncsite.c vos_listvldb.c vos_dump.c \
- vos_createvolume.c vos_endtrans.c vos_vldbexamine.c \
- vos_lock.c vos_unlock.c vos_backup.c
-SRCS = $(VOS_SRCS)
-VOS_OBJS = vos.o vos_common.o vos_examine.o vos_listvol.o \
- vos_partinfo.o vos_status.o vos_createentry.o \
- vos_listpart.o vos_syncsite.o vos_listvldb.o vos_dump.o \
- vos_createvolume.o vos_endtrans.o vos_vldbexamine.o \
- vos_lock.o vos_unlock.o vos_backup.o
-HDRS =
-
-all: $(PROGS)
-
-.PHONY: all install uninstall depend tags clean
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(bindir)/$$f; \
- done ;\
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir) ; \
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$$e ; \
- $(INSTALL_DATA) $(srcdir)/$$x \
- $(DESTDIR)$(mandir)/man$$e/$$f.$$e; \
- done
-
-uninstall:
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
- done ; \
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- rm -rf $(DESTDIR)$(mandir)/$$f.$$e; \
- done
-
-vos: $(VOS_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(VOS_OBJS) $(LIBS)
-
-Makefile: Makefile.in ../../config.status
- cd ../..; CONFIG_FILES=appl/vos/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(CFILES)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(PROGS) $(OBJS) *~ *.o core
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/appl/vos/vos.8 b/usr.sbin/afs/src/appl/vos/vos.8
deleted file mode 100644
index 26931dcfb3d..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos.8
+++ /dev/null
@@ -1,470 +0,0 @@
-.\" Copyright (c) 2000 - 2002 Kungliga Tekniska Högskolan
-.\" (Royal Institute of Technology, Stockholm, Sweden).
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" 3. Neither the name of the Institute nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $OpenBSD: vos.8,v 1.10 2003/09/04 22:14:43 jmc Exp $
-.\" $arla: vos.8,v 1.12 2003/06/06 12:53:51 hin Exp $
-.\"
-.Dd March 26, 2000
-.Dt VOS 8
-.Os "The Arla Project"
-.Sh NAME
-.Nm vos
-.Nd manage AFS volumes and the VLDB
-.Sh SYNOPSIS
-.Nm vos
-.Op Ar command
-.Op Ar args
-.Sh DESCRIPTION
-The
-.Nm
-utility is used to manage AFS volumes and the volume location database (VLDB).
-.Pp
-.Nm
-provides several commands:
-.Pp
-.Bl -tag -width createentry -compact
-.It Cm addsite
-not yet implemented
-.It Cm apropos
-apropos
-.It Cm backup
-make a backup copy of a volume
-.It Cm backupsys
-make backup copies of a number of volumes
-.It Cm changeaddr
-not yet implemented
-.It Cm create
-create a volume
-.It Cm createentry
-create a vldb entry
-.It Cm delentry
-not yet implemented
-.It Cm dump
-dump a volume
-.It Cm endtrans
-end a transaction
-.It Cm examine
-print information about a volume
-.It Cm volinfo
-print information about a volume
-.It Cm help
-print help
-.It Cm \&?
-print help
-.It Cm listaddrs
-list registered addresses in vldb
-.It Cm listpart
-list partitions on a server
-.It Cm listvldb
-list volumes in volume-location-database
-.It Cm listvol
-list volumes on a server
-.It Cm lock
-not yet implemented
-.It Cm move
-not yet implemented
-.It Cm partinfo
-print partition information on a server
-.It Cm release
-not yet implemented
-.It Cm remove
-not yet implemented
-.It Cm remsite
-not yet implemented
-.It Cm rename
-not yet implemented
-.It Cm restore
-not yet implemented
-.It Cm status
-show volume server transactions
-.It Cm syncserv
-not yet implemented
-.It Cm syncvldb
-not yet implemented
-.It Cm syncsite
-print the syncsite
-.It Cm unlock
-not yet implemented
-.It Cm unlockvldb
-not yet implemented
-.It Cm zap
-not yet implemented
-.It Cm quit
-exit interactive mode
-.El
-.Pp
-Most
-.Nm
-commands accept the following general arguments:
-.Pp
-.Bd -filled -offset indent -compact
-.Op Fl cell Ar cellname
-Specifies which AFS cell to use, if the default cell is not to be used.
-.Pp
-.Op Fl noauth
-Specifies that
-.Nm
-should not try to authenticate the connection to the server.
-This may be
-useful with shell scripts, or if there is a problem with the AFS cell.
-Note that the server will reject many commands if
-.Fl noauth
-is specified.
-.Pp
-.Op Fl localauth
-Create a ticket using the AFS server key, that is, you don't need a token.
-This will generally only work on AFS servers, and is very useful for
-performing automatic tasks.
-.Ed
-.Pp
-The syntax of the
-.Nm
-commands:
-.Pp
-.Ic vos addsite
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic vos apropos
-.Ar string
-.Bd -filled -offset indent -compact
-Search for a command matching
-.Ar string Ns .
-.Ed
-.Pp
-.Ic vos backup
-.Op Fl id
-.Ar volumeid
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl localauth
-.Op Fl verbose
-.Bd -filled -offset indent -compact
-Make a backup copy of a single volume. This command clones the volume given
-as argument into a backup volume with the postfix
-.Ar ".backup".
-.Ed
-.Pp
-.Ic vos backupsys
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl localauth
-.Op Fl verbose
-.Bd -filled -offset indent -compact
-Makes backup copies of all the volumes in a cell.
-The volumes are cloned into backup volumes with the postfix
-.Ar ".backup".
-.Ed
-.Pp
-.Ic vos changeaddr
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic vos create
-.Op Fl server
-.Ar servername
-.Op Fl part
-.Ar partition
-.Op Fl volume
-.Ar volumename
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl localauth
-.Op Fl verbose
-.Bd -filled -offset indent -compact
-Create a new volume named
-.Ar volumename
-on server
-.Ar servername
-partition
-.Ar partition .
-Note that
-.Ar volumename
-can be no longer than 22 characters.
-.Ed
-.Pp
-.Ic vos createentry
-.Op Fl id
-.Ar volumeid
-.Op Fl host
-.Ar host
-.Op Fl fsserver
-.Ar fileserver
-.Op Fl rw
-.Ar rwvolumeid
-.Op Fl ro
-.Ar rovolumeid
-.Op Fl bk
-.Ar bkvolumeid
-.Op Fl noauth
-.Op Fl localauth
-.Bd -filled -offset indent -compact
-Create a vldb entry manually.
-This command should
-.Em not
-be used unless you know
-.Em exactly
-what you are doing.
-.Ed
-.Pp
-.Ic vos delentry
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic vos dump
-.Op Fl id
-.Ar volume
-.Op Fl server Ar fileserver
-.Op Fl partition Ar partition
-.Op Fl cell Ar cellname
-.Op Fl file Ar filename
-.Op Fl noauth
-.Op Fl localauth
-.Op Fl verbose
-.Bd -filled -offset indent -compact
-Dump
-.Ar volume
-on
-.Ar fileserver
-to a
-.Ar filename Ns .
-.Ed
-.Pp
-.Ic vos endtrans
-.Op Fl server
-.Ar server
-.Op Fl trans
-.Ar transaction
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl verbose
-.Bd -filled -offset indent -compact
-End a transaction.
-.Ed
-.Pp
-.Ic vos examine
-.Op Fl id
-.Ar volume
-.Op Fl host
-.Ar server
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl localauth
-.Op Fl verbose
-.Op Fl extended
-.Bd -filled -offset indent -compact
-Print detailed information about
-.Ar volume
-on
-.Ar server Ns .
-.Ed
-.Pp
-.Ic vos volinfo
-.Bd -filled -offset indent -compact
-.Ic vos volinfo
-is an alias for the
-.Ic vos examine
-command.
-.Ed
-.Pp
-.Ic vos help
-.Bd -filled -offset indent -compact
-Print help.
-.Ed
-.Pp
-.Ic vos ?\&
-.Bd -filled -offset indent -compact
-.Ic vos ?\&
-Shorthand for
-.Nm help Ns .
-.Ed
-.Pp
-.Ic vos listaddrs
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl localauth
-.Op Fl noresolve
-.Op Fl printuuid
-.Bd -filled -offset indent -compact
-Lists all addresses registered in the vldb
-.Ed
-.Pp
-.Ic vos listpart
-.Op Fl server
-.Ar fileserver
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl localauth
-.Op Fl verbose
-.Bd -filled -offset indent -compact
-List partitions on a fileserver.
-.Ed
-.Pp
-.Ic vos listvldb
-.Op Fl fileserver Ar fileserver
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl localauth
-.Op Fl verbose
-.Bd -filled -offset indent -compact
-List volumes in the volume location database without reading them on the
-fileserver, optionally restricting the list to the volumes located on a
-specific
-.Ar fileserver Ns .
-.Ed
-.Pp
-.Ic vos listvol
-.Op Fl server
-.Ar fileserver
-.Op Fl partition
-.Ar partition
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl localauth
-.Op Fl verbose
-.Bd -filled -offset indent -compact
-List volumes on
-.Ar fileserver Ns ,
-without consulting the volume location database, optionally restricting
-the list to the volumes located on a specific
-.Ar fileserver Ns .
-.Ed
-.Pp
-.Ic vos lock
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic vos move
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic vos partinfo
-.Op Fl server
-.Ar fileserver
-.Op Fl partition
-.Ar partition
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl localauth
-.Op Fl verbose
-.Bd -filled -offset indent -compact
-List the total and remaining diskspace on
-.Ar fileserver Ns ,
-optionally restricting the list to a specific
-.Ar partition Ns .
-.Ed
-.Pp
-.Ic vos release
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic vos remove
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic vos remsite
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic vos rename
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic vos restore
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic vos status
-.Op Fl server
-.Ar fileserver
-.Op Fl cell Ar cellname
-.Op Fl noauth
-.Op Fl verbose
-.Bd -filled -offset indent -compact
-Show volume server transactions.
-.Ed
-.Pp
-.Ic vos syncserv
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic vos syncvldb
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic vos syncsite
-.Bd -filled -offset indent -compact
-Print the syncsite.
-.Ed
-.Pp
-.Ic vos unlock
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic vos unlockvldb
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic vos zap
-.Bd -filled -offset indent -compact
-Not yet implemented.
-.Ed
-.Pp
-.Ic vos quit
-.Bd -filled -offset indent -compact
-Exit interactive mode.
-.Ed
-.Sh SEE ALSO
-.Xr fs 1 ,
-.Xr pts 1 ,
-.Xr afsd 8 ,
-.Xr bos 8
-.Sh STANDARDS
-The Arla authors are trying to mimic the behaviour of the original AFS
-utilities.
-.Sh AUTHORS
-The Arla project <http://www.stacken.kth.se/project/arla/>.
-.Sh BUGS
-Quite a lot of commands are not implemented yet.
diff --git a/usr.sbin/afs/src/appl/vos/vos.c b/usr.sbin/afs/src/appl/vos/vos.c
deleted file mode 100644
index 9ef5bf0d714..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "vos_local.h"
-#include <vers.h>
-
-RCSID("$arla: vos.c,v 1.68 2003/06/04 11:53:00 hin Exp $");
-
-int vos_interactive = 0;
-
-static int empty_cmd(int argc, char **argv);
-static int quit_cmd(int argc, char **argv);
-static int help_cmd(int argc, char **argv);
-static int apropos_cmd(int argc, char **argv);
-
-
-/*
- * command table
- */
-
-static SL_cmd cmds[] = {
- {"addsite", empty_cmd, "not yet implemented"},
- {"apropos", apropos_cmd, "apropos"},
- {"backup", vos_backup, "Make a backup copy of a volume"},
- {"backupsys", vos_backupsys, "Make backup copies of multiple volumes"},
- {"changeaddr", empty_cmd, "not yet implemented"},
- {"create", vos_create, "create a volume"},
- {"createentry",vos_createentry, "create a vldb entry"},
- {"delentry", empty_cmd, "not yet implemented"},
- {"dump", vos_dump, "dump a volume"},
- {"endtrans", vos_endtrans, "end a transaction"},
- {"examine", vos_examine, "print information about a volume"},
- {"volinfo"},
- {"help", help_cmd, "print help"},
- {"?"},
- {"listpart", vos_listpart, "list partitions on a server"},
- {"listvldb", vos_listvldb, "list volumes in volume-location-database"},
- {"listvol", vos_listvol, "list volumes on a server"},
- {"listaddrs", vos_listaddrs, "list addresses listed in vldb"},
- {"lock", vos_lock, "lock VLDB entry"},
- {"move", empty_cmd, "not yet implemented"},
- {"partinfo", vos_partinfo, "print partition information on a server"},
- {"release", empty_cmd, "not yet implemented"},
- {"remove", empty_cmd, "not yet implemented"},
- {"remsite", empty_cmd, "not yet implemented"},
- {"rename", empty_cmd, "not yet implemented"},
- {"restore", empty_cmd, "not yet implemented"},
- {"status", vos_status, "Show volume server transactions"},
- {"syncserv", empty_cmd, "not yet implemented"},
- {"syncvldb", empty_cmd, "not yet implemented"},
- {"syncsite", vos_syncsite, "print the syncsite"},
- {"version", arlalib_version_cmd, "print version"},
- {"vldbexamine",vos_vldbexamine, "print only vldb info"},
- {"unlock", vos_unlock, "Unlock a VLDB entry"},
- {"unlockvldb", empty_cmd, "not yet implemented"},
- {"zap", vos_zap, "delete the volume, don't bother with VLDB"},
- {"quit", quit_cmd, "exit interactive mode"},
- {NULL}
-};
-
-/*
- * Dummy command
- */
-
-static int
-empty_cmd(int argc, char **argv)
-{
- printf("%s%s has not been implemented yet!\n", PROGNAME, argv[0]);
- return 0;
-}
-
-/*
- * quit
- */
-
-static int
-quit_cmd(int argc, char **argv)
-{
- printf("exiting\n");
- return 1;
-}
-
-/*
- * help
- */
-
-static int
-help_cmd(int argc, char **argv)
-{
- sl_help(cmds, argc, argv);
- return 0;
-}
-
-/*
- * apropos
- */
-
-static int
-apropos_cmd(int argc, char **argv)
-{
- if (argc < 2) {
- fprintf (stderr, "apropos: missing topic\n");
- return 0;
- }
-
- sl_apropos(cmds, argv[1]);
- return 0;
-}
-
-/*
- * Main program
- */
-
-int
-main(int argc, char **argv)
-{
- Log_method *method;
- int ret = 0;
-
- tzset();
-
- method = log_open (__progname, "/dev/stderr:notime");
- if (method == NULL)
- errx (1, "log_open failed");
- cell_init(0, method);
- ports_init();
-
- if (argc > 1)
- ret = sl_command(cmds, argc - 1, argv + 1);
- else {
- vos_interactive = 1;
- printf("vos - an arla tool for administrating AFS volumes.\n");
- printf("Type \"help\" to get a list of commands.\n");
- ret = sl_loop(cmds, __progname": ");
- }
- return ret;
-}
diff --git a/usr.sbin/afs/src/appl/vos/vos_backup.c b/usr.sbin/afs/src/appl/vos/vos_backup.c
deleted file mode 100644
index 39c526e7cc2..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_backup.c
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * Copyright (c) 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "vos_local.h"
-
-RCSID("$arla: vos_backup.c,v 1.5 2003/04/08 00:03:02 lha Exp $");
-
-static char *vol;
-static char *cell;
-static int noauth;
-static int localauth;
-static int verbose;
-static int helpflag;
-
-static void
-backup_volume (const char *volume,
- const char *cell, arlalib_authflags_t auth)
-{
- struct rx_connection *conn_vldb = NULL;
- struct rx_connection *conn_volser = NULL;
- char *newname = NULL;
- int32_t newVol;
- int32_t dbhost;
- int error;
- int ret,backexists=TRUE;
- nvldbentry the_vlentry;
- int32_t trans_id_rw, trans_id_bk;
-
- if (cell == NULL)
- cell = cell_getthiscell ();
-
- if(verbose)
- printf("Getting volume information for volume: %s... ", volume);
-
- error = get_vlentry (cell, NULL, volume, auth, &the_vlentry);
- if (error) {
- fprintf (stderr, "vos_backup: get_vlentry: %s\n",
- koerr_gettext(error));
- goto out;
- }
-
- if(verbose)
- printf("done.\n");
-
- conn_volser = arlalib_getconnbyaddr(cell,
- htonl(the_vlentry.serverNumber[0]),
- NULL,
- afsvolport,
- VOLSERVICE_ID,
- auth);
- if (conn_volser == NULL) {
- fprintf (stderr, "vos_backup: arlalib_getconnbyaddr: %s\n",
- koerr_gettext(error));
- goto out;
- }
-
- error = VOLSER_AFSVolTransCreate(conn_volser,
- the_vlentry.volumeId[BACKVOL],
- the_vlentry.serverPartition[0],
- ITReadOnly,
- &trans_id_bk);
- if (error) {
- backexists = FALSE;
- }
-
- if(trans_id_bk) {
- error = VOLSER_AFSVolEndTrans(conn_volser, trans_id_bk, &ret);
- if (error) {
- fprintf (stderr, "backup_volume: VolTransCreate failed: %s\n",
- koerr_gettext(error));
- goto out;
- }
- }
-
- newVol = the_vlentry.volumeId[BACKVOL];
-
- error = VOLSER_AFSVolTransCreate(conn_volser,
- the_vlentry.volumeId[0], /* XXX */
- the_vlentry.serverPartition[0],
- ITReadOnly,
- &trans_id_rw);
- if (error) {
- fprintf (stderr, "backup_volume: VolTransCreate failed: %s\n",
- koerr_gettext(error));
- goto out;
- }
-
- if (backexists) {
- if(verbose)
- printf("Recloning volume %d... ", newVol);
-
- error = VOLSER_AFSVolReClone(conn_volser, trans_id_rw, newVol);
- } else {
- asprintf(&newname, "%s.backup", the_vlentry.name);
- if (newname == NULL) {
- fprintf (stderr, "backup volume: asprintf failed: %s\n",
- strerror(errno));
- goto out;
- }
-
- if(verbose)
- printf("Cloning to volume %s... ", newname);
-
- error = VOLSER_AFSVolClone(conn_volser,
- trans_id_rw,
- 0,
- BACKVOL,
- newname,
- &newVol);
- }
-
- if (error) {
- fprintf (stderr, "backup volume: AFSVolClone failed: %s\n",
- koerr_gettext(error));
- goto trans_out;
- }
-
- if(verbose)
- printf("done.\n");
-
- error = arlalib_getsyncsite (cell, NULL, afsvldbport,
- &dbhost, auth);
- if (error) {
- fprintf (stderr, "vos_createvolume: arla_getsyncsite: %s\n",
- koerr_gettext(error));
- goto trans_out;
- }
-
- conn_vldb = arlalib_getconnbyaddr(cell, dbhost, NULL,
- afsvldbport,
- VLDB_SERVICE_ID,
- auth);
- if (conn_vldb == NULL) {
- fprintf (stderr,
- "vos_createvolume: arlalib_getconnbyaddr: vldb-host: 0x%x\n",
- dbhost);
- goto trans_out;
- }
-
- the_vlentry.volumeId[BACKVOL] = newVol;
- the_vlentry.flags |= VLF_BACKEXISTS;
-
- if(verbose)
- printf("Updating information in vldb... ");
-
- error = VL_ReplaceEntryN(conn_vldb,
- the_vlentry.volumeId[RWVOL],
- RWVOL,
- &the_vlentry,
- LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
- if (error) {
- fprintf (stderr, "vos_createvolume: VL_UpdateEntry: %s\n",
- koerr_gettext (error));
- } else if (verbose)
- printf("done.\n");
-
- error = VOLSER_AFSVolTransCreate(conn_volser,
- the_vlentry.volumeId[BACKVOL], /* XXX */
- the_vlentry.serverPartition[0],
- ITOffline,
- &trans_id_bk);
- if (error) {
- fprintf (stderr, "vos_createvolume: VOLSER_AFSVolTransCreate: %s\n",
- koerr_gettext(error));
- goto trans_out;
- }
-
- error = VOLSER_AFSVolSetFlags(conn_volser, trans_id_bk,0);
- if (error) {
- fprintf (stderr, "vos_createvolume: VOLSER_AFSVolSetFlags: %s\n",
- koerr_gettext(error));
- goto trans_out_bk;
- }
-
-
-trans_out_bk:
- ret = 0;
-
- error = VOLSER_AFSVolEndTrans(conn_volser, trans_id_bk, &ret);
- if (error)
- fprintf (stderr, "backup_Volume: VolEndTrans failed: %s\n",
- koerr_gettext(error));
-
-trans_out:
- ret = 0;
-
- error = VOLSER_AFSVolEndTrans(conn_volser, trans_id_rw, &ret);
- if (error)
- fprintf (stderr, "dump_volume: VolEndTrans failed: %s\n",
- koerr_gettext(error));
-
-out:
- if (conn_volser != NULL)
- arlalib_destroyconn (conn_volser);
-
- if (conn_vldb != NULL)
- arlalib_destroyconn (conn_vldb);
-
- if(newname != NULL)
- free(newname);
-
-}
-
-
-static struct agetargs backupargs[] = {
- {"id", 0, aarg_string, &vol, "id of volume", "volume",
- aarg_mandatory},
- {"cell", 0, aarg_string, &cell, "what cell to use", NULL},
- {"noauth", 0, aarg_flag, &noauth, "do not authenticate", NULL},
- {"localauth",0,aarg_flag, &localauth, "localauth", NULL},
- {"verbose", 0, aarg_flag, &verbose, "be verbose", NULL},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL, 0, aarg_end, NULL}
-};
-
-static void
-backupusage(void)
-{
- aarg_printusage(backupargs, "vos backup", "", AARG_AFSSTYLE);
-}
-
-
-int
-vos_backup(int argc, char **argv)
-{
- int optind = 0;
-
- noauth = localauth = verbose = 0;
- cell = vol = NULL;
-
- if (agetarg (backupargs, argc, argv, &optind, AARG_AFSSTYLE)) {
- backupusage ();
- return 0;
- }
-
- if (helpflag) {
- backupusage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- backup_volume (vol, cell,
- arlalib_getauthflag (noauth, localauth, 0, 0));
- return 0;
-}
-
-static int
-backup_volume_wrap (void *data, struct vldbentry *e)
-{
- if(e->volumeType == RWVOL)
- backup_volume (e->name, cell, localauth);
-
- return 0;
-
-}
-
-static struct agetargs backupsysargs[] = {
- {"cell", 0, aarg_string, &cell, "what cell to use", NULL},
- {"noauth", 0, aarg_flag, &noauth, "do not authenticate", NULL},
- {"localauth",0,aarg_flag, &localauth, "localauth", NULL},
- {"verbose", 0, aarg_flag, &verbose, "be verbose", NULL},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL, 0, aarg_end, NULL}
-};
-
-static void
-backupsysusage(void)
-{
- aarg_printusage(backupsysargs, "vos backupsys", "", AARG_AFSSTYLE);
-}
-
-int
-vos_backupsys(int argc, char **argv)
-{
- int optind = 0;
-
- noauth = localauth = verbose = 0;
- cell = vol = NULL;
-
- if (agetarg (backupsysargs, argc, argv, &optind, AARG_AFSSTYLE)) {
- backupsysusage ();
- return 0;
- }
-
- if (helpflag) {
- backupsysusage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- return vos_listvldb_iter (NULL, cell, NULL,
- NULL,NULL,
- arlalib_getauthflag (noauth, localauth, 0, 0),
- backup_volume_wrap, NULL);
-}
diff --git a/usr.sbin/afs/src/appl/vos/vos_common.c b/usr.sbin/afs/src/appl/vos/vos_common.c
deleted file mode 100644
index ef669f65166..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_common.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "vos_local.h"
-
-RCSID("$arla: vos_common.c,v 1.19 2002/07/16 20:36:42 lha Exp $");
-
-/*
- * Get the list of partitions from the server `host' in cell `cell'
- * and store them in `parts'. Use authentication as specifined in `auth'.
- */
-
-int
-getlistparts(const char *cell, const char *host,
- part_entries *parts, arlalib_authflags_t auth)
-{
- struct rx_connection *connvolser;
- int error;
-
- connvolser = arlalib_getconnbyname(cell,
- host,
- afsvolport,
- VOLSERVICE_ID,
- auth);
- if (connvolser == NULL)
- return -1 ;
-
- error = getlistparts_conn(connvolser, parts);
-
- arlalib_destroyconn(connvolser);
-
- if (error != 0) {
- printf("getlistparts: ListPartitions failed with: %s (%d)\n",
- koerr_gettext(error), error);
- return -1;
- }
-
- return error;
-}
-
-/*
- * Do the same a `getlistparts', but operate on connection to the
- * `volser', return the data in `parts'.
- */
-
-int
-getlistparts_conn(struct rx_connection *volser, part_entries *parts)
-{
- int error;
-
- error = VOLSER_AFSVolXListPartitions(volser, parts);
- if (error == RXGEN_OPCODE) {
- pIDs old_parts;
-
- error = VOLSER_AFSVolListPartitions(volser, &old_parts);
- if (error == 0) {
- int n, i;
-
- for (n = 0, i = 0; i < 26; ++i)
- if (old_parts.partIds[i] != -1)
- ++n;
- parts->len = n;
- parts->val = emalloc(n * sizeof(*parts->val));
-
- for (n = 0, i = 0; i < 26; ++i)
- if (old_parts.partIds[i] != -1)
- parts->val[n++] = old_parts.partIds[i];
- }
- }
-
- return error;
-}
-
-static void
-print_fast_vols (volEntries ve)
-{
- int i;
-
- for (i = 0; i < ve.len; ++i)
- printf ("%d\n", ve.val[i].volid);
-}
-
-static void
-print_slow_vols (volEntries ve, const char *part_name, int flags)
-{
- int i;
- int busy = 0, online = 0, offline = 0;
-
- if ((flags & LISTVOL_PART) == 0)
- part_name = "";
-
- for (i = 0; i < ve.len; i++) {
- volintInfo *vi = &ve.val[i];
-
- if (vi->status == VBUSY)
- busy++;
- else if (vi->inUse)
- online++;
- else
- offline++;
-
- if(vi->status == VOK) {
- printf("%-38s %10u %s %10u K %s %s\n",
- vi->name,
- vi->volid,
- volumetype_from_volsertype(vi->type),
- vi->size,
- vi->inUse ? "On-line" : "Off-line",
- part_name);
- } else { /* if not VOK, either is busy or "messed up" */
- printf("***** %-32s %10u ?? * K %s\n",
- vi->name, vi->volid,
- vi->status == VBUSY ? "Busy" : "Not attached");
- }
- }
-
- printf("\nTotal volumes onLine %d ; Total volumes offLine %d " \
- "; Total busy %d\n\n",
- online, offline, busy);
-}
-
-/*
- * print all the volumes of host `host' in cell `cell' and partition `part'.
- */
-
-/* const char *cell, const char *host, arlalib_authflags_t auth */
-
-
-int
-printlistvol(struct rx_connection *connvolser, const char *host,
- int part, int flags)
-{
- part_entries parts;
- int error;
- int i;
-
- if (part == -1) {
- if ((error = getlistparts_conn(connvolser, &parts)) != 0)
- return error;
- } else {
- parts.len = 1;
- parts.val = emalloc (sizeof(*parts.val));
- parts.val[0] = part;
- }
-
- for (i = 0; i < parts.len; ++i) {
- char part_name[17];
- volEntries volint;
-
- volint.val = NULL;
- if ((error = VOLSER_AFSVolListVolumes(connvolser,
- parts.val[i],
- 1, /* We want full info */
- &volint)) != 0) {
- free(parts.val);
- return error;
- }
- partition_num2name (parts.val[i], part_name, sizeof(part_name));
-
- printf("Total number of volumes on server %s partition %s: %d\n",
- host, part_name, volint.len);
-
- if (flags & LISTVOL_FAST)
- print_fast_vols (volint);
- else
- print_slow_vols (volint, part_name, flags);
- free(volint.val);
- }
-
- free(parts.val);
- return 0;
-}
-
-/*
- * Return the volume entry for `volname' in `cell' by asking the DB
- * server at `host', with the auth flags in `auth' and returning the
- * result in `nvldbentry'. Returns 0 or error.
- */
-
-int
-get_vlentry (const char *cell, const char *host, const char *volname,
- arlalib_authflags_t auth, nvldbentry *nvldbentry)
-{
- struct rx_connection *conn;
- struct db_server_context *conn_context = NULL;
- int error;
-
- if(host == NULL) {
- conn_context = malloc(sizeof(struct db_server_context));
- memset(conn_context, 0, sizeof(struct db_server_context));
- for (conn = arlalib_first_db(conn_context,
- cell, host, afsvldbport, VLDB_SERVICE_ID,
- auth);
- conn != NULL && arlalib_try_next_db(error);
- conn = arlalib_next_db(conn_context));
- } else {
- conn = arlalib_getconnbyname(cell, host, afsvldbport, VLDB_SERVICE_ID,
- auth);
- }
-
- if (conn == NULL)
- return -1;
-
- error = VL_GetEntryByNameN (conn, volname, nvldbentry);
-
- if (error == RXGEN_OPCODE) {
- vldbentry vlentry;
-
- error = VL_GetEntryByName (conn, volname, &vlentry);
- if (error == 0)
- vldb2vldbN (&vlentry, nvldbentry);
- }
-
- arlalib_destroyconn(conn);
-
- if(conn_context != NULL) {
- free_db_server_context(conn_context);
- free(conn_context);
- }
-
- return error;
-}
-
-
-/*
- * insert `nvldbentry' to the dbserver using `conn' or it `conn' ==
- * NULL use `cell' (and if specified `host') to get a new conn. If the
- * db-server is old, use old method.
- */
-
-int
-new_vlentry (struct rx_connection *conn, const char *cell, const char *host,
- nvldbentry *nvldbentry, arlalib_authflags_t auth)
-{
- int error;
- int freeconnp = 0;
-
- if (conn == NULL) {
- find_db_cell_and_host (&cell, &host);
-
- if (cell == NULL) {
- fprintf (stderr, "Unable to find cell of host '%s'\n", host);
- return -1;
- }
-
- if (host == NULL) {
- fprintf (stderr, "Unable to find DB server in cell '%s'\n", cell);
- return -1;
- }
-
- conn = arlalib_getconnbyname(cell, host, afsvldbport, VLDB_SERVICE_ID,
- auth);
- freeconnp = 1;
- if (conn == NULL)
- return -1;
- }
-
- error = VL_CreateEntryN (conn, nvldbentry);
-
- if (error == RXGEN_OPCODE) {
-#if 0
- vldbentry vlentry;
-
- vldbN2vldb (nvldbentry, &vlentry);
- error = VL_CreateEntry (conn, volname, &vlentry);
-#endif
- exit(-1);
- }
- if (freeconnp)
- arlalib_destroyconn(conn);
- return error;
-}
-
-/*
- * Try to set *cell and *host to reasonable values.
- */
-
-void
-find_db_cell_and_host (const char **cell, const char **host)
-{
- if (*cell == NULL && *host != NULL) {
- *cell = cell_getcellbyhost (*host);
- return;
- }
- if (*cell == NULL) {
- *cell = cell_getthiscell();
- }
- if (*host == NULL) {
- *host = cell_findnamedbbyname (*cell);
- }
-}
diff --git a/usr.sbin/afs/src/appl/vos/vos_createentry.c b/usr.sbin/afs/src/appl/vos/vos_createentry.c
deleted file mode 100644
index 36580cfa4f3..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_createentry.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "vos_local.h"
-
-RCSID("$arla: vos_createentry.c,v 1.11 2001/09/14 14:52:03 tol Exp $");
-
-static int helpflag;
-static char *vol;
-static char *host;
-static char *fsserver;
-static char *partition;
-static char *cell;
-static int noauth;
-static int localauth;
-static int rw_number;
-static int ro_number;
-static int bk_number;
-
-static struct agetargs args[] = {
- {"id", 0, aarg_string, &vol, "id of volume", NULL, aarg_mandatory},
- {"host", 0, aarg_string, &host, "what host to use", NULL, aarg_mandatory},
- {"fsserver",0, aarg_string, &fsserver, "fsserver where the volume resides", NULL, aarg_mandatory},
- {"partition",0, aarg_string, &partition, "partition where the volume resides", NULL, aarg_mandatory},
- {"rw", 0, aarg_integer, &rw_number, "volume RW number", NULL},
- {"ro", 0, aarg_integer, &ro_number, "volume RO number", NULL},
- {"bk", 0, aarg_integer, &bk_number, "volume BK number", NULL},
- {"cell", 0, aarg_string, &cell, "what cell to use", NULL},
- {"noauth", 0, aarg_flag, &noauth, "if to use authentication", NULL},
- {"localauth",0,aarg_flag, &localauth, "localauth", NULL},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL, 0, aarg_end, NULL}
-};
-
-static void
-usage(void)
-{
- aarg_printusage(args, "vos createentry", "", AARG_AFSSTYLE);
-}
-
-int
-vos_createentry(int argc, char **argv)
-{
- int optind = 0;
- struct rx_connection *connvldb = NULL;
- struct nvldbentry newentry;
- struct hostent *he;
- int error;
-
- helpflag = 0;
- vol = NULL;
- host = NULL;
- fsserver = NULL;
- partition = NULL;
- noauth = 0;
- localauth = 0;
- rw_number = 0;
- ro_number = 0;
- bk_number = 0;
- cell = NULL;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
-
- argc -= optind;
- argv += optind;
-
- if (argc) {
- printf("unknown option %s\n", *argv);
- return 0;
- }
-
- connvldb = arlalib_getconnbyname(cell,
- host,
- afsvldbport,
- VLDB_SERVICE_ID,
- arlalib_getauthflag (noauth, localauth,
- 0, 0));
- if (connvldb == NULL)
- return -1;
- memset (&newentry, 0, sizeof (newentry));
- strlcpy(newentry.name, vol, VLDB_MAXNAMELEN);
- newentry.nServers = 1;
- he = gethostbyname(fsserver);
- if (he == NULL) {
- fprintf(stderr, "unknown host: %s\n", fsserver);
- return -1;
- }
-
- memcpy (&newentry.serverNumber[0], he->h_addr_list[0], 4);
- newentry.serverNumber[0] = ntohl(newentry.serverNumber[0]);
- newentry.serverPartition[0] = partition_name2num(partition);
- if (newentry.serverPartition[0] == -1) {
- fprintf(stderr, "incorrect partition\n");
- usage();
- return 0;
- }
-
- newentry.flags = 0;
- newentry.flags |= rw_number ? VLF_RWEXISTS : 0;
- newentry.flags |= ro_number ? VLF_ROEXISTS : 0;
- newentry.flags |= bk_number ? VLF_BOEXISTS : 0;
-
- newentry.serverFlags[0] = 0;
- newentry.serverFlags[0] |= rw_number ? VLSF_RWVOL : 0;
- newentry.serverFlags[0] |= ro_number ? VLSF_ROVOL : 0;
- newentry.serverFlags[0] |= bk_number ? VLSF_BACKVOL : 0;
-
- newentry.volumeId[0] = rw_number;
- newentry.volumeId[1] = ro_number;
- newentry.volumeId[2] = bk_number;
- newentry.cloneId = 0;
- error = VL_CreateEntryN(connvldb, &newentry);
- if (error) {
- fprintf(stderr, "vos_createentry: error %s (%d)\n", koerr_gettext(error), error);
- return 1;
- }
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/vos/vos_createvolume.c b/usr.sbin/afs/src/appl/vos/vos_createvolume.c
deleted file mode 100644
index aa347a51eab..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_createvolume.c
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include "vos_local.h"
-
-RCSID("$arla: vos_createvolume.c,v 1.7 2002/04/10 15:35:51 joda Exp $");
-
-/*
- * create volume
- */
-
-
-static int
-vos_createvolume (char *host, int32_t part, char *cell,
- arlalib_authflags_t auth,
- char *name, int quota, int verbose)
-{
- struct rx_connection *connvldb = NULL;
- struct rx_connection *volser = NULL;
- nvldbentry entry;
- int32_t dbhost;
- int32_t fshost;
- int32_t volid;
- int32_t rcode;
- int32_t trans; /* transaction id */
- int error;
-
- if (host == NULL && name == NULL)
- return EINVAL;
-
- if (cell == NULL)
- cell = (char *)cell_getthiscell();
-
- error = arlalib_getsyncsite (cell, NULL, afsvldbport,
- &dbhost, auth);
- if (error) {
- fprintf (stderr, "vos_createvolume: arla_getsyncsite: %s\n",
- koerr_gettext(error));
- return -1;
- }
-
- connvldb = arlalib_getconnbyaddr(cell, dbhost, NULL,
- afsvldbport,
- VLDB_SERVICE_ID,
- auth);
- if (connvldb == NULL) {
- fprintf (stderr,
- "vos_createvolume: arlalib_getconnbyaddr: vldb-host: 0x%x\n",
- dbhost);
- return -1;
- }
-
- volser = arlalib_getconnbyname (cell, host,
- afsvolport,
- VOLSERVICE_ID,
- auth);
- if (volser == NULL) {
- fprintf (stderr,"vos_createvolume: arlalib_getconnbyname: volser: %s\n",
- host);
- arlalib_destroyconn (connvldb);
- return -1;
- }
-
- fshost = rx_HostOf(rx_PeerOf(volser));
- if (fshost == 0) {
- fprintf (stderr, "vos_createvolume: address of 0 is not permited\n");
- goto errout;
- }
-
- /*
- * Get three (3) new Id's from the vldb server's
- */
-
- error = VL_GetNewVolumeId (connvldb, 3, &volid);
- if (error) {
- fprintf (stderr, "vos_createvolume: VL_GetNewVolumeID: %s\n",
- koerr_gettext (error));
- goto errout;
- }
- if (verbose)
- printf ("vos_createvolume: got a VolumeID: %d\n", volid);
-
- /*
- * Create new volume on the server
- */
-
- error = VOLSER_AFSVolCreateVolume (volser, part, name,
- RWVOL,
- /* parent */ 0, &volid,
- &trans);
- if (error) {
- fprintf (stderr, "vos_createvolume: VOLSER_AFSVolCreateVolume: %s\n",
- koerr_gettext (error));
- goto errout;
- }
- if (verbose)
- printf ("vos_createvolume: created volume on %s, got trans %d\n",
- host, trans);
-
- /*
- * Set quota
- */
- if(quota != 0) {
- struct volintInfo volinfo;
- memset(&volinfo, 0, sizeof(volinfo));
- volinfo.dayUse = -1;
- volinfo.maxquota = quota;
- error = VOLSER_AFSVolSetInfo (volser, trans, &volinfo);
- if (error) {
- fprintf (stderr, "vos_createvolume: VOLSER_AFSVolSetInfo: %s (continuing)\n",
- koerr_gettext (error));
- }
- }
-
- /*
- * Bring the volume on-line
- */
-
- error = VOLSER_AFSVolSetFlags(volser, trans, 0);
- if (error) {
- fprintf (stderr, "vos_createvolume: VOLSER_AFSVolSetFlags: %s\n",
- koerr_gettext (error));
- goto errout;
- }
- if (verbose)
- printf ("vos_createvolume: updated flag for trans %d\n", trans);
-
- /*
- * Create vldb-entry for the volume, if that failes, remove the volume
- * from the server.
- */
-
- memset (&entry, 0, sizeof (entry));
- strlcpy (entry.name, name, sizeof(entry.name));
- entry.nServers = 1;
- entry.serverNumber[0] = ntohl(fshost);
- entry.serverPartition[0] = part;
- entry.serverFlags[0] = VLSF_RWVOL;
- entry.volumeId[RWVOL] = volid;
- entry.volumeId[ROVOL] = volid+1;
- entry.volumeId[BACKVOL] = volid+2;
- entry.cloneId = 0;
- entry.flags = VLF_RWEXISTS;
-
- error = new_vlentry (connvldb, NULL, NULL, &entry, auth);
- if (error) {
- fprintf (stderr, "vos_createvolume: new_vlentry: %s\n",
- koerr_gettext (error));
-
- fprintf (stderr, "vos_createvolume: removing new volume");
- error = VOLSER_AFSVolDeleteVolume (volser, trans);
- if (error)
- fprintf (stderr, "vos_createvolume: failed to remove volume: %s\n",
- koerr_gettext (error));
- else
- fprintf (stderr, "vos_createvolume: removed volume\n");
-
- } else if (verbose)
- printf ("vos_createvolume: added entry to vldb\n");
-
- /*
- * End transaction to volumeserver
- */
-
- errout:
- error = VOLSER_AFSVolEndTrans(volser, trans, &rcode);
- if (error) {
- fprintf (stderr,
- "vos_createvolume: VOLSER_AFSVolEndTrans: %s, rcode: %d\n",
- koerr_gettext (error),
- rcode);
- return -1;
- }
- if (verbose)
- printf ("vos_createvolume: ending transaction %d, rcode %d\n",
- trans, rcode);
-
- arlalib_destroyconn(volser);
- arlalib_destroyconn(connvldb);
- return error;
-}
-
-/*
- * list vldb
- */
-
-static char *server;
-static char *part;
-static char *volume;
-static int maxquota;
-static char *cell;
-static int noauth;
-static int localauth;
-static int helpflag;
-static int verbose;
-
-static struct agetargs args[] = {
- {"server", 0, aarg_string, &server,
- "server", NULL, aarg_mandatory},
- {"part", 0, aarg_string, &part,
- "part", NULL, aarg_mandatory},
- {"volume", 0, aarg_string, &volume,
- "volume", NULL, aarg_mandatory},
- {"maxquota",0, aarg_integer, &maxquota,
- "initial quota", NULL, aarg_optional_swless },
- {"cell", 0, aarg_string, &cell,
- "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth,
- "do not authenticate", NULL},
- {"localauth", 0, aarg_flag, &localauth,
- "use local authentication", NULL},
- {"verbose", 0, aarg_flag, &verbose,
- "verbose output", NULL},
- {"help", 0, aarg_flag, &helpflag,
- NULL, NULL},
- {NULL, 0, aarg_end, NULL}
-};
-
-/*
- * print usage
- */
-
-static void
-usage(void)
-{
- aarg_printusage (args, "vos create", "", AARG_AFSSTYLE);
-}
-
-/*
- * createvolume, to be called from libsl
- */
-
-int
-vos_create(int argc, char **argv)
-{
- int optind = 0;
- int npart = -1;
- int error;
-
- server = cell = NULL;
- noauth = localauth = helpflag = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage();
- return 0;
- }
-
- if(helpflag) {
- usage();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc > 0) {
- fprintf (stderr, "create volume: unparsed arguments\n");
- return 0;
- }
-
- npart = partition_name2num (part);
-
- error = vos_createvolume (server, npart, cell,
- arlalib_getauthflag (noauth, localauth, 0, 0),
- volume, maxquota, verbose);
- if (error) {
- fprintf (stderr, "vos_createvolume failed (%d)\n", error);
- return 0;
- }
-
- return 0;
-}
-
diff --git a/usr.sbin/afs/src/appl/vos/vos_dump.c b/usr.sbin/afs/src/appl/vos/vos_dump.c
deleted file mode 100644
index cd86f07438e..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_dump.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "vos_local.h"
-
-RCSID("$arla: vos_dump.c,v 1.9 2002/07/10 21:12:47 lha Exp $");
-
-static void
-dump_volume (const char *volume,
- const char *cell, const char *host, const char *part,
- const char *file, arlalib_authflags_t auth)
-{
- struct rx_connection *conn_volser = NULL;
- struct rx_call *call;
- int error;
- int fd;
- nvldbentry the_vlentry;
- int32_t trans_id;
- int ret;
- uint32_t size, nread;
- char buf[8192];
-
- if (file != NULL) {
- fd = open (file, O_WRONLY | O_CREAT, 0666);
- if (fd < 0) {
- warn ("open %s", file);
- return;
- }
- } else {
- fd = STDOUT_FILENO;
- }
-
- if (cell == NULL)
- cell = cell_getthiscell ();
-
- error = get_vlentry (cell, NULL, volume, auth, &the_vlentry);
- if (error)
- goto out;
-
- conn_volser = arlalib_getconnbyaddr(cell,
- htonl(the_vlentry.serverNumber[0]),
- NULL,
- afsvolport,
- VOLSERVICE_ID,
- auth);
- if (conn_volser == NULL) {
- fprintf (stderr, "dump_volume: getconnbyaddr failed\n");
- goto out;
- }
-
- error = VOLSER_AFSVolTransCreate(conn_volser,
- the_vlentry.volumeId[0], /* XXX */
- the_vlentry.serverPartition[0],
- ITReadOnly,
- &trans_id);
- if (error) {
- fprintf (stderr, "dump_volume: VolTransCreate failed: %s\n",
- koerr_gettext(error));
- goto out;
- }
-
- call = rx_NewCall (conn_volser);
- if (call == NULL) {
- fprintf (stderr, "dump_volume: rx_NewCall failed: %s\n",
- koerr_gettext(error));
- goto out;
- }
-
- error = StartVOLSER_AFSVolDump(call, trans_id, 0 /* XXX */);
- if (error) {
- rx_EndCall (call, 0);
- fprintf (stderr, "dump_volume: start AFSVolDump failed: %s\n",
- koerr_gettext(error));
- goto out;
- }
-
- ret = rx_Read (call, &size, sizeof(size));
-
- if (ret != sizeof(size)) {
- ret = conv_to_arla_errno(rx_GetCallError(call));
- rx_EndCall (call, 0);
- fprintf (stderr, "dump_volume: start AFSVolDump failed: %s\n",
- koerr_gettext(ret));
- goto out;
- }
- size = ntohl(size);
-
- while (size && (nread = rx_Read (call, buf, min(sizeof(buf), size))) > 0) {
- if (write (fd, buf, nread) != nread) {
- warn ("write");
- rx_EndCall(call, 0);
- goto trans_out;
- }
- size -= nread;
- }
-
- error = EndVOLSER_AFSVolDump (call);
- if (error) {
- rx_EndCall (call, 0);
- fprintf (stderr, "dump_volume: end AFSVolDump failed: %s\n",
- koerr_gettext(error));
- goto out;
- }
- rx_EndCall (call, 0);
-
-trans_out:
- ret = 0;
-
- error = VOLSER_AFSVolEndTrans(conn_volser, trans_id, &ret);
- if (error)
- fprintf (stderr, "dump_volume: VolEndTrans failed: %s\n",
- koerr_gettext(error));
-
-out:
- if (conn_volser != NULL)
- arlalib_destroyconn (conn_volser);
-
- if (file != NULL)
- close (fd);
-}
-
-static char *vol;
-static char *server;
-static char *part;
-static char *cell;
-static char *file;
-static int noauth;
-static int localauth;
-static int verbose;
-static int helpflag;
-
-static struct agetargs args[] = {
- {"id", 0, aarg_string, &vol, "id of volume", "volume",
- aarg_mandatory},
- {"server", 0, aarg_string, &server, "what server to use", NULL},
- {"partition",0, aarg_string, &part, "what partition to use", NULL},
- {"cell", 0, aarg_string, &cell, "what cell to use", NULL},
- {"file", 0, aarg_string, &file, "file to dump to", NULL},
- {"noauth", 0, aarg_flag, &noauth, "do not authenticate", NULL},
- {"localauth",0,aarg_flag, &localauth, "localauth", NULL},
- {"verbose", 0, aarg_flag, &verbose, "be verbose", NULL},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL, 0, aarg_end, NULL}
-};
-
-static void
-usage(void)
-{
- aarg_printusage(args, "vos dump", "", AARG_AFSSTYLE);
-}
-
-int
-vos_dump(int argc, char **argv)
-{
- int optind = 0;
-
- noauth = localauth = verbose = 0;
- file = cell = server = part = vol = NULL;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- dump_volume (vol, cell, server, part, file,
- arlalib_getauthflag (noauth, localauth, 0, 0));
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/vos/vos_endtrans.c b/usr.sbin/afs/src/appl/vos/vos_endtrans.c
deleted file mode 100644
index 00f58a636b9..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_endtrans.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include "vos_local.h"
-
-RCSID("$arla: vos_endtrans.c,v 1.5 2000/10/03 00:08:46 lha Exp $");
-
-/*
- * end a transaction on `host' with transaction id `trans'
- */
-
-int
-vos_endtransaction (const char *cell, const char *host, int32_t trans,
- arlalib_authflags_t auth, int verbose)
-{
- struct rx_connection *volser = NULL;
- int error;
- int32_t rcode;
-
- if (host == NULL)
- return EINVAL;
-
- if (cell == NULL)
- cell = (char *)cell_getthiscell();
-
- volser = arlalib_getconnbyname (cell, host,
- afsvolport,
- VOLSERVICE_ID,
- auth);
- if (volser == NULL) {
- fprintf (stderr,
- "vos_endtransaction: arlalib_getconnbyname: volser: %s\n",
- host);
- return -1;
- }
-
-
- error = VOLSER_AFSVolEndTrans(volser, trans, &rcode);
- if (error) {
- fprintf (stderr, "vos_createvolume: VOLSER_AFSVolEndTrans: %s\n",
- koerr_gettext (error));
- return -1;
- }
- if (verbose)
- printf ("vos_endtransaction: VOLSER_AFSVolEndTrans: rcode = %d",
- rcode);
-
- arlalib_destroyconn(volser);
- return error;
-}
-
-/*
- * list vldb
- */
-
-static char *server;
-static char *cell;
-static int transid;
-static int noauth;
-static int localauth;
-static int helpflag;
-static int verbose;
-
-static struct agetargs args[] = {
- {"server", 0, aarg_string, &server,
- "server", NULL, aarg_mandatory},
- {"trans", 0, aarg_integer, &transid,
- "trans", NULL, aarg_mandatory},
- {"cell", 0, aarg_string, &cell,
- "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth,
- "do not authenticate", NULL},
- {"localauth", 0, aarg_flag, &localauth,
- "use local authentication", NULL},
- {"verbose", 0, aarg_flag, &verbose,
- "verbose output", NULL},
- {"help", 0, aarg_flag, &helpflag,
- NULL, NULL},
- {NULL, 0, aarg_end, NULL}
-};
-
-/*
- * print usage
- */
-
-static void
-usage(void)
-{
- aarg_printusage (args, "vos endtransaction", "", AARG_AFSSTYLE);
-}
-
-/*
- * end a transaction, to be called from libsl
- */
-
-int
-vos_endtrans(int argc, char **argv)
-{
- int optind = 0;
- int error;
-
- server = cell = NULL;
- noauth = localauth = helpflag = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage();
- return 0;
- }
-
- if(helpflag) {
- usage();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc > 0) {
- fprintf (stderr, "vos_endtrans: unparsed arguments\n");
- return 0;
- }
-
- error = vos_endtransaction (cell, server, transid,
- arlalib_getauthflag (noauth, localauth, 0, 0),
- verbose);
- if (error) {
- fprintf (stderr, "vos_endtrans failed (%d)\n", error);
- return 0;
- }
-
- return 0;
-}
-
-
diff --git a/usr.sbin/afs/src/appl/vos/vos_examine.c b/usr.sbin/afs/src/appl/vos/vos_examine.c
deleted file mode 100644
index 645da945180..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_examine.c
+++ /dev/null
@@ -1,385 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "vos_local.h"
-
-RCSID("$arla: vos_examine.c,v 1.33 2003/03/08 02:03:12 lha Exp $");
-
-static void
-print_extended_stats (const xvolintInfo *v)
-{
- printf(" File count:\t%d\n\n", v->filecount);
-
- printf(" Raw Read/Write Stats\n"
- " |-------------------------------------------|\n"
- " | Same Network | Diff Network |\n"
- " |----------|----------|----------|----------|\n"
- " | Total | Auth | Total | Auth |\n"
- " |----------|----------|----------|----------|\n");
- printf("Reads |%9d |%9d |%9d |%9d |\n",
- v->stat_reads[0],
- v->stat_reads[1],
- v->stat_reads[2],
- v->stat_reads[3]);
- printf("Writes |%9d |%9d |%9d |%9d |\n",
- v->stat_writes[0],
- v->stat_writes[1],
- v->stat_writes[2],
- v->stat_writes[3]);
- printf(" |-------------------------------------------|\n");
- printf("\n");
- printf(" Writes Affecting Authorship\n"
- " |-------------------------------------------|\n"
- " | File Authorship | Directory Authorship|\n"
- " |----------|----------|----------|----------|\n"
- " | Same | Diff | Same | Diff |\n"
- " |----------|----------|----------|----------|\n");
- printf("0-60 sec |%9d |%9d |%9d |%9d |\n",
- v->stat_fileSameAuthor[0], v->stat_fileDiffAuthor[0],
- v->stat_dirSameAuthor[0], v->stat_dirDiffAuthor[0]);
- printf("1-10 min |%9d |%9d |%9d |%9d |\n",
- v->stat_fileSameAuthor[1], v->stat_fileDiffAuthor[1],
- v->stat_dirSameAuthor[1], v->stat_dirDiffAuthor[1]);
- printf("10min-1hr |%9d |%9d |%9d |%9d |\n",
- v->stat_fileSameAuthor[2], v->stat_fileDiffAuthor[2],
- v->stat_dirSameAuthor[2], v->stat_dirDiffAuthor[2]);
- printf("1hr-1day |%9d |%9d |%9d |%9d |\n",
- v->stat_fileSameAuthor[3], v->stat_fileDiffAuthor[3],
- v->stat_dirSameAuthor[3], v->stat_dirDiffAuthor[3]);
- printf("1day-1wk |%9d |%9d |%9d |%9d |\n",
- v->stat_fileSameAuthor[4], v->stat_fileDiffAuthor[4],
- v->stat_dirSameAuthor[4], v->stat_dirDiffAuthor[4]);
- printf("> 1wk |%9d |%9d |%9d |%9d |\n",
- v->stat_fileSameAuthor[5], v->stat_fileDiffAuthor[5],
- v->stat_dirSameAuthor[5], v->stat_dirDiffAuthor[5]);
- printf(" |-------------------------------------------|\n");
-}
-
-static void
-print_volume (const nvldbentry *nvlentry, const xvolintInfo *v,
- const char *server_name, int extended)
-{
- char part_name[17];
- char timestr[128];
-
- printf("%s\t\t\t%10u %s ",
- v->name,
- v->volid,
- volumetype_from_volsertype(v->type));
-
- if (v != NULL)
- printf("%8d K %s\n", v->size, v->status == VOK ? "On-line" : "Busy");
- else
- printf("unknown K\n");
-
- if (v != NULL && v->status == VOK) {
- struct tm tm;
-
- partition_num2name (nvlentry->serverPartition[0],
- part_name, sizeof(part_name));
-
- printf(" %s %s\n", server_name, part_name);
- printf(" ");
-
- if (nvlentry->flags & VLF_RWEXISTS)
- printf("RWrite %u\t", nvlentry->volumeId[RWVOL]);
-
- if (nvlentry->flags & VLF_ROEXISTS )
- printf("ROnly %u\t", nvlentry->volumeId[ROVOL]);
-
- if (nvlentry->flags & VLF_BACKEXISTS)
- printf("Backup %u\t", nvlentry->volumeId[BACKVOL]);
-
- printf("\n MaxQuota %10d K\n", v->maxquota);
-
- memset (&tm, 0, sizeof(tm));
- if (strftime (timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S %Z",
- localtime_r((time_t*) &v->creationDate, &tm)) > 0)
- printf(" Creation %s\n", timestr);
-
- memset (&tm, 0, sizeof(tm));
- if (strftime (timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S %Z",
- localtime_r((time_t*) &v->updateDate, &tm)) > 0)
- printf(" Last Update %s\n", timestr);
-
- printf(" %d accesses in the past day (i.e., vnode references)\n",
- v->dayUse);
- }
-
- if (extended && v != NULL)
- print_extended_stats (v);
-
- printf("\n");
-}
-
-static int
-printvolstat(const char *vol, const char *cell, const char *host,
- arlalib_authflags_t auth, int verbose, int extended)
-{
- struct rx_connection *connvolser;
- int error;
- int i;
- xvolEntries xvolint;
- nvldbentry nvlentry;
- char server_name[MAXHOSTNAMELEN];
- char part_name[17];
- int was_xvol = 1;
- char volname[VLDB_MAXNAMELEN];
- int type;
- uint32_t server;
- int part;
- int bit;
- int xvolintp = 0;
-
- find_db_cell_and_host (&cell, &host);
-
- if (cell == NULL) {
- fprintf (stderr, "Unable to find cell of host '%s'\n", host);
- return -1;
- }
-
- if (host == NULL) {
- fprintf (stderr, "Unable to find DB server in cell '%s'\n", cell);
- return -1;
- }
-
- strlcpy (volname, vol, sizeof(volname));
- type = volname_canonicalize (volname);
-
- if (verbose)
- fprintf (stderr,
- "Getting volume `%s' from the VLDB at `%s'...",
- volname, host);
-
- error = get_vlentry (cell, host, volname, auth, &nvlentry);
-
- if (error) {
- fprintf(stderr, "VL_GetEntryByName(%s) failed: %s\n",
- volname, koerr_gettext(error));
- return -1;
- }
-
- if (verbose)
- fprintf (stderr, "done\n");
-
- switch (type) {
- case RWVOL :
- bit = VLSF_RWVOL;
- break;
- case ROVOL :
- bit = VLSF_ROVOL;
- break;
- case BACKVOL :
- bit = (VLSF_BACKVOL|VLSF_RWVOL);
- break;
- default :
- abort ();
- }
-
- for (i = 0; i < nvlentry.nServers; ++i)
- if (nvlentry.serverFlags[i] & bit) {
- server = nvlentry.serverNumber[i];
- part = nvlentry.serverPartition[i];
- break;
- }
-
- if (i == nvlentry.nServers) {
- fprintf (stderr, "Volume %s does not have a %s clone\n",
- volname, volumetype_from_volsertype(type));
- return -1;
- }
-
- arlalib_host_to_name (htonl(server),
- server_name, sizeof(server_name));
-
- connvolser = arlalib_getconnbyaddr(cell,
- htonl(server),
- NULL,
- afsvolport,
- VOLSERVICE_ID,
- auth);
- if (connvolser == NULL)
- return -1;
-
- if (verbose) {
- fprintf (stderr, "getting information on `%s' from %s\n",
- vol, server_name);
- }
-
- xvolint.val = NULL;
- error = VOLSER_AFSVolXListOneVolume(connvolser,
- part,
- nvlentry.volumeId[type],
- &xvolint);
-
- if (error == RXGEN_OPCODE) {
- volEntries volint;
-
- was_xvol = 0;
- volint.val = NULL;
- error = VOLSER_AFSVolListOneVolume(connvolser,
- part,
- nvlentry.volumeId[type],
- &volint);
- if (error == 0) {
- xvolint.val = emalloc (sizeof (*xvolint.val));
- volintInfo2xvolintInfo (volint.val, xvolint.val);
- }
- }
-
- if (error != 0) {
- printf("ListOneVolume of %s from %s failed with: %s (%d)\n",
- vol, server_name,
- koerr_gettext(error), error);
- } else {
- xvolintp = 1;
- if (verbose)
- fprintf (stderr, "done\n");
- }
-
-
- if(xvolintp)
- print_volume (&nvlentry, xvolint.val, server_name, was_xvol && extended);
- else {
- printf("\nDump only information from VLDB\n\n");
- printf("%s\n", nvlentry.name);
-
- printf(" ");
-
- if(nvlentry.flags & VLF_RWEXISTS)
- printf("RWrite: %u\t", nvlentry.volumeId[RWVOL]);
- if(nvlentry.flags & VLF_ROEXISTS)
- printf("ROnly: %u\t", nvlentry.volumeId[ROVOL]);
- if(nvlentry.flags & VLF_BACKEXISTS)
- printf("Backup: %u\t", nvlentry.volumeId[BACKVOL]);
- }
-
- printf("\n number of sites -> %d\n", nvlentry.nServers );
-
- for (i = 0; i < nvlentry.nServers; i++) {
- printf(" ");
-
- arlalib_host_to_name (htonl(nvlentry.serverNumber[i]),
- server_name, sizeof(server_name));
-
- partition_num2name (nvlentry.serverPartition[i],
- part_name, sizeof(part_name));
- printf("server %s partition %s %s Site",
- server_name, part_name,
- volumetype_from_serverflag(nvlentry.serverFlags[i]));
-
- if (nvlentry.serverFlags[i] & VLSF_DONTUSE)
- printf(" -- not replicated yet");
-
- printf("\n");
- }
-
- if (nvlentry.flags & VLOP_ALLOPERS) {
- char msg[100];
-
- printf("Volume is currently LOCKED, reson: %s\n",
- vol_getopname(nvlentry.flags, msg, sizeof(msg)));
- }
-
- free(xvolint.val);
- arlalib_destroyconn(connvolser);
- return 0;
-}
-
-static int helpflag;
-static char *host;
-static char *cell;
-static char *vol;
-static int noauth;
-static int localauth;
-static int verbose;
-static int extended;
-
-static struct agetargs args[] = {
- {"id", 0, aarg_string, &vol, "id of volume", "volume",
- aarg_mandatory},
- {"host", 0, aarg_string, &host, "what host to use", NULL},
- {"cell", 0, aarg_string, &cell, "what cell to use", NULL},
- {"noauth", 0, aarg_flag, &noauth, "do not authenticate", NULL},
- {"localauth",0,aarg_flag, &localauth, "localauth", NULL},
- {"verbose", 0, aarg_flag, &verbose, "be verbose", NULL},
- {"extended",0, aarg_flag, &extended, "more output", NULL},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL, 0, aarg_end, NULL}
-};
-
-static void
-usage(void)
-{
- aarg_printusage(args, "vos examine", "", AARG_AFSSTYLE);
-}
-
-int
-vos_examine(int argc, char **argv)
-{
- int optind = 0;
-
- helpflag = noauth = localauth = verbose = extended = 0;
- host = cell = vol = NULL;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc) {
- printf("unknown option %s\n", *argv);
- return 0;
- }
-
- /* don't allow any bogus volname */
- if (vol == NULL || vol[0] == '\0') {
- usage ();
- return 0;
- }
-
- printvolstat(vol, cell, host,
- arlalib_getauthflag (noauth, localauth, 0, 0),
- verbose, extended);
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/vos/vos_listaddrs.c b/usr.sbin/afs/src/appl/vos/vos_listaddrs.c
deleted file mode 100644
index 32b6b698e83..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_listaddrs.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (c) 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include <afs_uuid.h>
-#include "vos_local.h"
-
-RCSID("$arla: vos_listaddrs.c,v 1.4 2002/10/31 06:59:27 lha Exp $");
-
-
-
-/*
- * list addresses
- */
-
-static const char *cell = NULL;
-static const char *hoststring = NULL;
-static const char *uuidstring = NULL;
-static int noauth=0;
-static int localauth=0;
-static int helpflag=0;
-static int noresolve=0;
-static int printuuid=0;
-
-static struct agetargs args[] = {
- {"uuid", 0, aarg_string, &uuidstring,
- "uuid of server", NULL},
- {"host", 0, aarg_string, &hoststring,
- "address of host", NULL},
- {"cell", 0, aarg_string, &cell,
- "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth,
- "do not authenticate", NULL},
- {"localauth", 0, aarg_flag, &localauth,
- "use local authentication", NULL},
- {"noresolve", 0, aarg_flag, &noresolve,
- "don't resolve addresses", NULL},
- {"printuuid", 0, aarg_flag, &printuuid,
- "print uuid of hosts", NULL},
- {"help", 0, aarg_flag, &helpflag,
- NULL, NULL},
- {NULL, 0, aarg_end, NULL}
-};
-
-static void
-usage(void)
-{
- aarg_printusage (args, "vos listaddrs", "", AARG_AFSSTYLE);
-}
-
-static void
-print_addrs(const bulkaddrs *blkaddrs, const afsUUID *uuid)
-{
- struct in_addr addr;
- char buf[1024];
- int i;
-
- if (printuuid) {
- afsUUID_to_string(uuid, buf, sizeof(buf));
- printf(" UUID: %s\n", buf);
- }
-
- for (i=0; i < blkaddrs->len; i++) {
- if (noresolve) {
- addr.s_addr = htonl(blkaddrs->val[i]);
- printf(" Address: %s\n", inet_ntoa(addr));
- } else {
- arlalib_host_to_name(htonl(blkaddrs->val[i]), buf, sizeof(buf));
- printf(" Hostname: %s\n", buf);
- }
- }
-}
-
-int
-vos_listaddrs(int argc, char **argv)
-{
- struct rx_connection *connvldb = NULL;
- int32_t uniquifier = 0, nentries = 0;
- struct ListAddrByAttributes attr;
- arlalib_authflags_t auth = 0;
- const char *db_host = NULL;
- afsUUID uuid, askuuid;
- struct in_addr addr;
- bulkaddrs blkaddrs;
- int optind = 0;
- int error = 0;
- int i=0;
-
- memset(&attr, 0, sizeof(struct ListAddrByAttributes));
- memset(&uuid, 0, sizeof(afsUUID));
- memset(&askuuid, 0, sizeof(afsUUID));
- memset(&addr, 0, sizeof(struct in_addr));
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage();
- return 0;
- }
-
- if(helpflag) {
- usage();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- find_db_cell_and_host (&cell, &db_host);
-
- if (cell == NULL) {
- fprintf (stderr, "Unable to find cell of host '%s'\n", db_host);
- return -1;
- }
-
- if (db_host == NULL) {
- fprintf (stderr, "Unable to find DB server in cell '%s'\n", cell);
- return -1;
- }
-
- connvldb = arlalib_getconnbyname(cell, db_host,
- afsvldbport,
- VLDB_SERVICE_ID,
- auth);
-
- attr.Mask = VLADDR_INDEX;
-
- if(uuidstring) {
- afsUUID_from_string(uuidstring, &askuuid);
- attr.Mask = VLADDR_UUID;
- attr.uuid = askuuid;
- }
-
- if(hoststring) {
- error = arlalib_name_to_host(hoststring, &addr.s_addr);
- if(error != 0) {
- warnx ("listaddrs: arlalib_name_to_host: %s", gai_strerror(error));
- arlalib_destroyconn(connvldb);
- return -1;
- }
- attr.Mask = VLADDR_IPADDR;
- attr.ipaddr = ntohl(addr.s_addr);
- }
-
- {
- VL_Callback unique;
- bulkaddrs blkaddrs;
-
- error = VL_GetAddrs(connvldb, 0, 0, &unique, &nentries, &blkaddrs);
- if (error) {
- warnx ("listaddrs: VL_GetAddr: %d", error);
- arlalib_destroyconn(connvldb);
- return -1;
- }
- /* XXX need to free blkaddrs */
- }
-
- for (i = 1; i < nentries + 1; i++) {
- int32_t ne;
- attr.index = i;
-
- error = VL_GetAddrsU(connvldb, &attr,
- &uuid, &uniquifier, &ne, &blkaddrs);
- if(error == VL_NOENT) {
- if (hoststring || uuidstring)
- break;
- nentries++;
- continue;
- }
- if (error == VL_INDEXERANGE)
- break;
-
- if (error) {
- warnx ("listaddrs: VL_GetAddrsU: %s", koerr_gettext(error));
- return -1;
- }
-
- printf("Host number %d:\n", i);
-
- print_addrs(&blkaddrs, &uuid);
-
- if(hoststring || uuidstring)
- break;
- /* XXX need to free blkaddrs */
-}
-arlalib_destroyconn(connvldb);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/vos/vos_listpart.c b/usr.sbin/afs/src/appl/vos/vos_listpart.c
deleted file mode 100644
index d1af53bd345..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_listpart.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "vos_local.h"
-
-RCSID("$arla: vos_listpart.c,v 1.6 2001/09/25 22:05:00 mattiasa Exp $");
-
-static int
-printlistparts(const char *cell, const char *server,
- arlalib_authflags_t auth, int verbose)
-{
- part_entries parts;
- int error;
- int i;
-
- if (cell == NULL)
- cell = cell_getcellbyhost (server);
-
- error = getlistparts(cell, server, &parts, auth);
-
- if (error != 0)
- return error;
-
- printf("The partitions on the server are:\n ");
- for (i = 0; i < parts.len; ++i) {
- char part_name[17];
-
- partition_num2name (parts.val[i], part_name, sizeof(part_name));
- printf(" %s%c", part_name, i % 6 == 5 ? '\n' : ' ');
- }
- printf("\nTotal: %d\n", parts.len);
- free (parts.val);
- return 0;
-}
-
-static int helpflag;
-static char *server;
-static char *cell;
-static int noauth;
-static int localauth;
-static int verbose;
-
-static struct agetargs listp_args[] = {
- {"server", 0, aarg_string, &server, "server", NULL, aarg_mandatory},
- {"cell", 0, aarg_string, &cell, "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth, "no authentication", NULL},
- {"localauth",0, aarg_flag, &localauth, "local authentication", NULL},
- {"verbose", 0, aarg_flag, &verbose, "be verbose", NULL},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL}
-};
-
-static void
-usage(void)
-{
- aarg_printusage(listp_args, "vos listpart", "", AARG_AFSSTYLE);
-}
-
-int
-vos_listpart(int argc, char **argv)
-{
- int optind = 0;
-
- helpflag = noauth = localauth = verbose = 0;
- server = cell = NULL;
-
- if (agetarg (listp_args,argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc) {
- printf("unknown option %s\n", *argv);
- return 0;
- }
-
- if (server == NULL || server[0] == '\0') {
- usage ();
- return 0;
- }
-
- printlistparts(cell, server,
- arlalib_getauthflag (noauth, localauth, 0, 0),
- verbose);
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/vos/vos_listvldb.c b/usr.sbin/afs/src/appl/vos/vos_listvldb.c
deleted file mode 100644
index 400c86ca1a7..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_listvldb.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "vos_local.h"
-
-RCSID("$arla: vos_listvldb.c,v 1.17 2003/06/04 11:54:13 hin Exp $");
-
-/*
- * listvldb iteration over all entries in the DB
- */
-
-int
-vos_listvldb_iter (const char *db_host, const char *cell, const char *volname,
- const char *fileserver, const char *part,
- arlalib_authflags_t auth,
- int (*proc)(void *data, struct vldbentry *), void *data)
-{
- struct rx_connection *connvldb = NULL;
- struct vldbentry *entry;
- struct vldbentry vol;
- int error;
- int32_t num;
- bulkentries bulkent;
- struct VldbListByAttributes attr;
- struct hostent *he;
-
- memset(&attr, '\0', sizeof(struct VldbListByAttributes));
-
- find_db_cell_and_host (&cell, &db_host);
-
- if (cell == NULL) {
- fprintf (stderr, "Unable to find cell of host '%s'\n", db_host);
- return -1;
- }
-
- if (db_host == NULL) {
- fprintf (stderr, "Unable to find DB server in cell '%s'\n", cell);
- return -1;
- }
-
- connvldb = arlalib_getconnbyname(cell, db_host,
- afsvldbport,
- VLDB_SERVICE_ID,
- auth);
-
- if(volname != NULL) {
-
- error = VL_GetEntryByName(connvldb, volname, &vol);
- if (error) {
- fprintf(stderr, "vos_listvldb: error %s (%d)\n",
- koerr_gettext(error), error);
- return -1;
- }
-
- attr.volumeid = vol.volumeId[vol.volumeType];
- attr.Mask |= VLLIST_VOLUMEID;
-
- }
-
- if(fileserver != NULL) {
- he = gethostbyname(fileserver);
- if (he == NULL) {
- warnx("listvldb: unknown host: %s", fileserver);
- return -1;
- }
- memcpy (&attr.server, he->h_addr_list[0], 4);
- attr.server = ntohl(attr.server);
- attr.Mask |= VLLIST_SERVER;
- }
-
- if(part != NULL) {
- attr.partition = partition_name2num(part);
- attr.Mask |= VLLIST_PARTITION;
- }
-
- bulkent.val = NULL;
- bulkent.len = 0;
- num = 0;
- error = VL_ListAttributes (connvldb,
- &attr,
- &num,
- &bulkent);
- if (error == 0) {
- int i;
-
- for(i=0; i<num ; i++) {
-
- entry = &bulkent.val[i];
- error = proc (data, entry);
- if (error)
- break;
-
- if (error) {
- warnx ("listvldb: VL_ListEntry: %s", koerr_gettext(error));
- return -1;
- }
- }
- free(bulkent.val);
- } else
- warnx ("listvldb: VL_ListAttributes: %s", koerr_gettext(error));
-
-
- arlalib_destroyconn(connvldb);
- return 0;
-}
-
-/*
- * Print vldbentry on listvldb style
- */
-
-static int
-listvldb_print (void *data, struct vldbentry *e)
-{
- int i;
- char *hostname;
- char part_name[30];
-
- assert (e);
-
- printf ("%s\n", e->name);
- if(e->flags & VLF_RWEXISTS)
- printf (" RWrite: %d", e->volumeId[RWVOL]);
- if(e->flags & VLF_ROEXISTS)
- printf (" ROnly: %d", e->volumeId[ROVOL]);
- if(e->flags & VLF_BACKEXISTS)
- printf (" Backup: %d", e->volumeId[BACKVOL]);
- printf("\n");
- printf (" Number of sites -> %d\n", e->nServers);
- for (i = 0 ; i < e->nServers ; i++) {
- if (e->serverNumber[i] == 0)
- continue;
- if (arlalib_getservername(htonl(e->serverNumber[i]), &hostname))
- continue;
- partition_num2name (e->serverPartition[i], part_name, sizeof(part_name));
- printf (" server %s partition %s %s Site\n",
- hostname,
- part_name,
- volumetype_from_serverflag (e->serverFlags[i]));
- free (hostname);
- }
-
- printf ("\n");
-
- return 0;
-}
-
-
-/*
- * list vldb
- */
-
-static char *volume;
-static char *fileserver;
-static char *partition;
-static char *cell;
-static char *dbserver;
-static int noauth;
-static int localauth;
-static int helpflag;
-
-static struct agetargs args[] = {
- {"name", 0, aarg_string, &volume,
- "Volume to list", NULL, aarg_optional_swless},
- {"fileserver", 0, aarg_string, &fileserver,
- "fileserver to list", NULL, aarg_optional_swless},
- {"partition", 0, aarg_string, &partition,
- "partition", NULL, aarg_optional_swless},
- {"cell", 0, aarg_string, &cell,
- "cell", NULL},
- {"dbserver", 0, aarg_string, &dbserver,
- "dbserver", NULL},
- {"noauth", 0, aarg_flag, &noauth,
- "do not authenticate", NULL},
- {"localauth", 0, aarg_flag, &localauth,
- "use local authentication", NULL},
- {"help", 0, aarg_flag, &helpflag,
- NULL, NULL},
- {NULL, 0, aarg_end, NULL}
-};
-
-static void
-usage(void)
-{
- aarg_printusage (args, "vos listvldb", "", AARG_AFSSTYLE);
-}
-
-int
-vos_listvldb(int argc, char **argv)
-{
- int optind = 0;
-
- volume = fileserver = dbserver = cell = NULL;
- noauth = localauth = helpflag = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage();
- return 0;
- }
-
- if(helpflag) {
- usage();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
-
- vos_listvldb_iter (dbserver, cell, volume,
- fileserver, partition,
- arlalib_getauthflag (noauth, localauth, 0, 0),
- listvldb_print, NULL);
-
- return 0;
-}
-
diff --git a/usr.sbin/afs/src/appl/vos/vos_listvol.c b/usr.sbin/afs/src/appl/vos/vos_listvol.c
deleted file mode 100644
index 24dc980a40d..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_listvol.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "vos_local.h"
-
-RCSID("$arla: vos_listvol.c,v 1.7 2001/09/17 21:40:26 mattiasa Exp $");
-
-/*
- * list volume on a afs-server
- */
-
-static char *server;
-static char *partition;
-static int listvol_machine;
-static char *cell;
-static int noauth;
-static int localauth;
-static int helpflag;
-static int fast;
-
-static struct agetargs args[] = {
- {"server", 0, aarg_string, &server,
- "server", NULL, aarg_mandatory},
- {"partition", 0, aarg_string, &partition,
- "partition", NULL, aarg_optional_swless},
- {"machine", 'm', aarg_flag, &listvol_machine,
- "machineparseableform", NULL},
- {"cell", 0, aarg_string, &cell,
- "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth,
- "do not authenticate", NULL},
- {"localauth", 0, aarg_flag, &localauth,
- "use local authentication", NULL},
- {"fast", 0, aarg_flag, &fast,
- "only list IDs", NULL},
- {"help", 0, aarg_flag, &helpflag,
- NULL, NULL},
- {NULL, 0, aarg_end, NULL}
-};
-
-static void
-usage(void)
-{
- aarg_printusage (args, "vos listvol", "", AARG_AFSSTYLE);
-}
-
-int
-vos_listvol(int argc, char **argv)
-{
- struct rx_connection *connvolser;
- int optind = 0;
- int flags = 0;
- int error;
- int part;
-
- server = partition = cell = NULL;
- listvol_machine = noauth = localauth = helpflag = fast = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage();
- return 0;
- }
-
- if(helpflag) {
- usage();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (server == NULL) {
- usage();
- return 0;
- }
-
- if (partition == NULL) {
- part = -1;
- } else {
- part = partition_name2num(partition);
- if (part == -1) {
- usage();
- return 0;
- }
- }
-
- if (listvol_machine)
- flags |= LISTVOL_PART;
- if (localauth)
- flags |= LISTVOL_LOCALAUTH;
- if (fast)
- flags |= LISTVOL_FAST;
-
-
- connvolser = arlalib_getconnbyname(cell, server, afsvolport,
- VOLSERVICE_ID,
- arlalib_getauthflag (noauth, 0, 0, 0));
-
- if (connvolser == NULL) {
- printf("vos listvolume: failed to contact volser on host %s",
- server);
- return -1 ;
- }
-
- error = printlistvol(connvolser, server, part, flags);
- if (error) {
- printf("vos listvolume: partinfo failed with: %s (%d)\n",
- koerr_gettext(error), error);
- return -1;
- }
-
- arlalib_destroyconn(connvolser);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/vos/vos_local.h b/usr.sbin/afs/src/appl/vos/vos_local.h
deleted file mode 100644
index abff78521b7..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_local.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * RCSID("$arla: vos_local.h,v 1.22 2002/05/30 00:51:35 mattiasa Exp $");
- */
-
-#define LISTVOL_PART 0x1
-#define LISTVOL_NOAUTH 0x2
-#define LISTVOL_LOCALAUTH 0x4
-#define LISTVOL_FAST 0x8
-
-/* this program needs __progname defined as a macro */
-#define __progname "vos"
-#define PROGNAME (vos_interactive ? "" : __progname" ")
-
-/* if this is set the program runs in interactive mode */
-extern int vos_interactive;
-
-int vos_examine (int, char **);
-int vos_vldbexamine (int, char **);
-int vos_listpart (int, char **);
-int vos_listvol (int, char **);
-int vos_lock (int, char **);
-int vos_unlock (int, char **);
-int vos_listvldb(int argc, char **argv);
-int vos_partinfo (int, char **);
-int vos_status (int, char **);
-int vos_createentry (int, char **);
-int vos_syncsite (int, char **);
-int vos_dump (int, char **);
-int vos_create(int argc, char **argv);
-int vos_endtrans(int argc, char **argv);
-int vos_backup(int argc, char **argv);
-int vos_backupsys(int argc, char **argv);
-int vos_zap(int argc, char **argv);
-int vos_listaddrs(int argc, char **argv);
-
-int vos_listvldb_iter (const char *host, const char *cell, const char *volname,
- const char *fileserver, const char *part,
- arlalib_authflags_t auth,
- int (*proc)(void *data, struct vldbentry *),
- void *data);
-
-int getlistparts(const char *cell, const char *host,
- part_entries *parts, arlalib_authflags_t auth);
-int getlistparts_conn(struct rx_connection *connvolser, part_entries *parts);
-int printlistvol(struct rx_connection *connvolser, const char *host,
- int part, int flags);
-int get_vlentry (const char *cell, const char *host, const char *volname,
- arlalib_authflags_t auth, nvldbentry *nvlentry);
-int new_vlentry (struct rx_connection *conn, const char *cell, const char *host,
- nvldbentry *nvldbentry, arlalib_authflags_t auth);
-
-int vos_endtransaction (const char *cell, const char *host,
- int32_t trans, arlalib_authflags_t auth, int verbose);
-
-void find_db_cell_and_host (const char **cell, const char **host);
diff --git a/usr.sbin/afs/src/appl/vos/vos_lock.c b/usr.sbin/afs/src/appl/vos/vos_lock.c
deleted file mode 100644
index b41018c4619..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_lock.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "vos_local.h"
-
-RCSID("$arla: vos_lock.c,v 1.5 2001/11/16 16:52:02 mattiasa Exp $");
-
-/*
- * lock a volume
- */
-
-static char *vol;
-static char *cell;
-static int noauth;
-static int localauth;
-static int helpflag;
-static int verbose;
-
-static struct agetargs args[] = {
- {"id", 0, aarg_string, &vol,
- "id or name of volume", NULL, aarg_mandatory},
- {"cell", 0, aarg_string, &cell,
- "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth,
- "do not authenticate", NULL},
- {"localauth", 0, aarg_flag, &localauth,
- "use local authentication", NULL},
- {"verbose", 0, aarg_flag, &verbose,
- "verbose output", NULL},
- {"help", 0, aarg_flag, &helpflag,
- NULL, NULL},
- {NULL, 0, aarg_end, NULL}
-};
-
-static int
-vos_lock_volume(char *volname)
-{
- struct rx_connection *connvldb;
- const char *host = NULL;
- arlalib_authflags_t auth;
- int error;
- int32_t dbhost;
- vldbentry vol;
-
- find_db_cell_and_host((const char **)&cell, &host);
- if(cell == NULL) {
- fprintf(stderr, "unable to find cell\n");
- return -1;
- }
- if(host == NULL) {
- fprintf(stderr, "unable to find a vldb host in cell %s", cell);
- return -1;
- }
-
- auth = arlalib_getauthflag(noauth, localauth, 0, 0);
-
- error = arlalib_getsyncsite(cell, NULL, afsvldbport,
- &dbhost, auth);
- if (error) {
- fprintf (stderr, "vos_createvolume: arla_getsyncsite: %s\n",
- koerr_gettext(error));
- return -1;
- }
-
- connvldb = arlalib_getconnbyaddr(cell, dbhost, NULL,
- afsvldbport,
- VLDB_SERVICE_ID,
- auth);
-
- if(connvldb == NULL) {
- fprintf(stderr, "can't connect to vldb server %s in cell %s\n",
- host, cell);
- return -1;
- }
-
- error = VL_GetEntryByName(connvldb, volname, &vol);
- if (error) {
- fprintf(stderr, "vos_lock: error %s (%d)\n",
- koerr_gettext(error), error);
- return 1;
- }
-
- /* XXX Are you really supposed to use RWVOL here? */
- error = VL_SetLock(connvldb, vol.volumeId[RWVOL], RWVOL, VLOP_DELETE);
-
- if(!error) {
- printf("Locked VLDB entry for volume %s\n", vol.name);
- } else {
- fprintf(stderr, "vos_lock: error %s (%d)\n",
- koerr_gettext(error), error);
- return 1;
- }
-
- arlalib_destroyconn(connvldb);
- return 0;
-}
-
-static void
-usage(void)
-{
- aarg_printusage(args, "vos dump", "", AARG_AFSSTYLE);
-}
-
-int
-vos_lock(int argc, char **argv)
-{
- int optind = 0;
-
- cell = vol = NULL;
- noauth = localauth = helpflag = verbose = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc) {
- printf("unknown option %s\n", *argv);
- return 0;
- }
-
- /* don't allow any bogus volname */
- if (vol == NULL || vol[0] == '\0') {
- usage ();
- return 0;
- }
-
- vos_lock_volume(vol);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/vos/vos_partinfo.c b/usr.sbin/afs/src/appl/vos/vos_partinfo.c
deleted file mode 100644
index cf375cb4711..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_partinfo.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "vos_local.h"
-
-RCSID("$arla: vos_partinfo.c,v 1.8 2001/01/09 01:59:08 lha Exp $");
-
-static int
-print_one_partition (struct rx_connection *conn, const char *part)
-{
- int error;
- struct diskPartition partinfo ;
-
- error = VOLSER_AFSVolPartitionInfo(conn, part, &partinfo);
- if (error != 0) {
- printf("printpartinfo: PartitionInfo failed with: %s (%d)\n",
- koerr_gettext(error), error);
- return -1;
- }
-
- printf("Free space on partition %s %d K blocks out of total %d\n",
- partinfo.name,
- partinfo.free,
- partinfo.minFree
-/* XXX - partinfo.totalUsable */
- );
- return 0;
-}
-
-static int
-printpartinfo(const char *cell, const char *host, const char *part,
- int verbose, arlalib_authflags_t auth)
-{
- struct rx_connection *connvolser;
- char part_name[30];
- int error;
-
- find_db_cell_and_host (&cell, &host);
-
- connvolser = arlalib_getconnbyname(cell,
- host,
- afsvolport,
- VOLSERVICE_ID,
- auth);
- if (connvolser == NULL)
- return -1;
-
- if (part == NULL) {
- int i;
- part_entries parts;
-
- error = getlistparts (cell, host, &parts, auth);
- if (error != 0)
- return error;
-
- for (i = 0; i < parts.len; ++i) {
- partition_num2name (parts.val[i], part_name, sizeof(part_name));
- error = print_one_partition (connvolser, part_name);
- if (error != 0)
- return error;
- }
- } else {
- if (strlen(part) <= 2) {
- snprintf(part_name, sizeof(part_name), "/vicep%s", part);
- part = part_name;
- }
- error = print_one_partition (connvolser, part);
- if (error != 0)
- return error;
- }
-
- arlalib_destroyconn(connvolser);
- return 0;
-}
-
-static int helpflag;
-static char *server;
-static char *cell;
-static char *part;
-static int noauth;
-static int localauth;
-static int verbose;
-
-static struct agetargs args[] = {
- {"server", 0, aarg_string, &server, "server", NULL, aarg_mandatory},
- {"cell", 0, aarg_string, &cell, "cell", NULL},
- {"partition",0, aarg_string, &part, "partition", NULL},
- {"noauth", 0, aarg_flag, &noauth, "no authentication", NULL},
- {"localauth",0,aarg_flag, &localauth, "localauth", NULL},
- {"verbose", 0, aarg_flag, &verbose, "be verbose", NULL},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL, 0, aarg_end, NULL}
-};
-
-static void
-usage(void)
-{
- aarg_printusage(args, "vos partinfo", "", AARG_AFSSTYLE);
-}
-
-int
-vos_partinfo(int argc, char **argv)
-{
- int optind = 0;
-
- helpflag = noauth = localauth = verbose = 0;
- server = cell = part = NULL;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc == 1 && part == NULL) {
- part = argv[0];
- --argc;
- ++argv;
- }
-
- if (argc != 0) {
- usage ();
- return 0;
- }
-
- if (server == NULL) {
- printf ("vos partinfo: you need to specify server\n");
- return 0;
- }
-
- printpartinfo(cell, server, part, verbose,
- arlalib_getauthflag (noauth, localauth, 0, 0));
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/vos/vos_status.c b/usr.sbin/afs/src/appl/vos/vos_status.c
deleted file mode 100644
index 7c82a6443f2..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_status.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "vos_local.h"
-
-RCSID("$arla: vos_status.c,v 1.11 2003/03/08 02:33:34 lha Exp $");
-
-static int
-printstatus (const char *cell, const char *host,
- int noauth, int verbose)
-{
- struct rx_connection *connvolser = NULL;
- struct transDebugInfo *entries;
- transDebugEntries info;
- unsigned int entries_len, i;
- int error;
-
- connvolser = arlalib_getconnbyname(cell,
- host,
- afsvolport,
- VOLSERVICE_ID,
- 0);
-
- if (connvolser == NULL)
- return -1;
-
- error = VOLSER_AFSVolMonitor(connvolser, &info);
- if (error) {
- printf("printstatus: GetStat failed with: %s (%d)\n",
- koerr_gettext(error), error);
- return -1;
- }
-
- entries_len = info.len;
- entries = info.val;
-
- if (entries_len == 0)
- printf ("No active transactions on %s\n", host);
- else {
- char *line = "--------------------------------------";
-
- printf("Total transactions: %d\n", i);
- for (i = 0; i < entries_len; i++) {
- char timestr[128];
- char part[100];
- struct tm tm;
- time_t t;
-
- printf("%s\n", line);
-
- memset (&tm, 0, sizeof(tm));
- t = entries->creationTime;
- if (strftime (timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S %Z",
- localtime_r(&t, &tm)) <= 0)
- strlcpy(timestr, "unknown-time", sizeof(timestr));
- printf("transaction: %d created: %s\n", entries->tid, timestr);
- printf("attachFlags: ");
-
- if ((entries->iflags & ITOffline) == ITOffline)
- printf(" offline");
- if ((entries->iflags & ITBusy) == ITBusy)
- printf(" busy");
- if ((entries->iflags & ITReadOnly) == ITReadOnly)
- printf("read-only");
- if ((entries->iflags & ITCreate) == ITCreate)
- printf("create");
- if ((entries->iflags & ITCreateVolID) == ITCreateVolID)
- printf("create-VolID");
-
- partition_num2name(entries->partition, part, sizeof(part));
- printf("\nvolume: %d partition: %s procedure: %s\n",
- entries->volid, part, entries->lastProcName);
- printf("packetRead: %d lastReceiveTime: %d "
- "packetSend: %d lastSendTime: %d\n",
- entries->readNext,
- entries->lastReceiveTime,
- entries->transmitNext,
- entries->lastSendTime);
- entries++;
- }
- printf("%s\n", line);
- }
-
- arlalib_destroyconn(connvolser);
- return 0;
-}
-
-static int helpflag;
-static const char *server;
-static const char *cell;
-static int noauth;
-static int verbose;
-
-static struct agetargs args[] = {
- {"server", 0, aarg_string, &server, "server", NULL,aarg_mandatory},
- {"cell", 0, aarg_string, &cell, "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth, "do not authenticate", NULL},
- {"verbose", 0, aarg_flag, &verbose, "be verbose", NULL},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL, 0, aarg_end, NULL, NULL, NULL}
-};
-
-static void
-usage (void)
-{
- aarg_printusage (args, "vos status", "", AARG_AFSSTYLE);
-}
-
-int
-vos_status(int argc, char **argv)
-{
- int optind = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (server == NULL) {
- printf ("vos status: missing -server\n");
- return 0;
- }
-
- if (cell == NULL)
- cell = cell_getcellbyhost (server);
-
- printstatus (cell, server, noauth, verbose);
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/vos/vos_syncsite.c b/usr.sbin/afs/src/appl/vos/vos_syncsite.c
deleted file mode 100644
index 24568b210b6..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_syncsite.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "vos_local.h"
-
-RCSID("$arla: vos_syncsite.c,v 1.14 2001/07/12 02:36:59 ahltorp Exp $");
-
-static int helpflag;
-static char *cell;
-static int resolvep = 1;
-
-static struct agetargs args[] = {
- {"cell", 'c', aarg_string, &cell, "cell", NULL},
- {"help", 'h', aarg_flag, &helpflag, NULL, NULL},
- {"resolve", 'n', aarg_negative_flag, &resolvep, NULL, NULL}
-};
-
-static void
-usage(void)
-{
- aarg_printusage(args, "vos syncsite", "", AARG_AFSSTYLE);
-}
-
-int
-vos_syncsite (int argc, char **argv)
-{
- struct in_addr saddr;
- int error;
- int optind = 0;
-
- helpflag = 0;
- cell = NULL;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- if (cell == NULL)
- cell = (char *)cell_getthiscell();
-
- error = arlalib_getsyncsite(cell, NULL, afsvldbport, &saddr.s_addr, 0);
- if (error) {
- fprintf(stderr, "syncsite: %s (%d)\n", koerr_gettext(error), error);
- return 0;
- }
-
- if (!resolvep)
- printf("%s's vldb syncsite is %s.\n", cell, inet_ntoa(saddr));
- else {
- char server_name[256];
-
- arlalib_host_to_name (saddr.s_addr, server_name, sizeof(server_name));
-
- printf("%s's vldb syncsite is %s (%s).\n", cell, server_name,
- inet_ntoa(saddr));
-
- }
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/vos/vos_unlock.c b/usr.sbin/afs/src/appl/vos/vos_unlock.c
deleted file mode 100644
index ce828f7fa83..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_unlock.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "vos_local.h"
-
-RCSID("$arla: vos_unlock.c,v 1.5 2001/11/16 16:52:47 mattiasa Exp $");
-
-/*
- * unlock a volume
- */
-
-static char *vol;
-static char *cell;
-static int noauth;
-static int localauth;
-static int helpflag;
-static int verbose;
-
-static struct agetargs args[] = {
- {"id", 0, aarg_string, &vol,
- "id or name of volume", NULL, aarg_mandatory},
- {"cell", 0, aarg_string, &cell,
- "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth,
- "do not authenticate", NULL},
- {"localauth", 0, aarg_flag, &localauth,
- "use local authentication", NULL},
- {"verbose", 0, aarg_flag, &verbose,
- "verbose output", NULL},
- {"help", 0, aarg_flag, &helpflag,
- NULL, NULL},
- {NULL, 0, aarg_end, NULL}
-};
-
-static int
-vos_unlock_volume(char *volname)
-{
- struct rx_connection *connvldb;
- const char *host = NULL;
- arlalib_authflags_t auth;
- int error;
- int32_t dbhost;
- vldbentry vol;
-
- find_db_cell_and_host((const char **)&cell, &host);
- if(cell == NULL) {
- fprintf(stderr, "unable to find cell\n");
- return -1;
- }
- if(host == NULL) {
- fprintf(stderr, "unable to find a vldb host in cell %s", cell);
- return -1;
- }
-
- auth = arlalib_getauthflag(noauth, localauth, 0, 0);
-
- error = arlalib_getsyncsite(cell, NULL, afsvldbport,
- &dbhost, auth);
- if (error) {
- fprintf (stderr, "vos_createvolume: arla_getsyncsite: %s\n",
- koerr_gettext(error));
- return -1;
- }
-
- connvldb = arlalib_getconnbyaddr(cell, dbhost, NULL,
- afsvldbport,
- VLDB_SERVICE_ID,
- auth);
- if(connvldb == NULL) {
- fprintf(stderr, "can't connect to vldb server %s in cell %s\n",
- host, cell);
- return -1;
- }
-
- error = VL_GetEntryByName(connvldb, volname, &vol);
-
- if(error) {
- fprintf(stderr, "vos_unlock: error %s (%d)\n",
- koerr_gettext(error), error);
- return 1;
- }
-
- /* XXX Are you really supposed to use RWVOL here? */
- error = VL_ReleaseLock(connvldb, vol.volumeId[RWVOL], RWVOL,
- LOCKREL_TIMESTAMP | LOCKREL_OPCODE | LOCKREL_AFSID);
-
- if(!error) {
- printf("Unlocked VLDB entry for volume %s\n", vol.name);
- } else {
- fprintf(stderr, "vos_unlock: error %s (%d)\n",
- koerr_gettext(error), error);
- return 1;
- }
-
- arlalib_destroyconn(connvldb);
- return 0;
-}
-
-static void
-usage(void)
-{
- aarg_printusage(args, "vos dump", "", AARG_AFSSTYLE);
-}
-
-int
-vos_unlock(int argc, char **argv)
-{
- int optind = 0;
-
- cell = vol = NULL;
- noauth = localauth = helpflag = verbose = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc) {
- printf("unknown option %s\n", *argv);
- return 0;
- }
-
- /* don't allow any bogus volname */
- if (vol == NULL || vol[0] == '\0') {
- usage ();
- return 0;
- }
-
- vos_unlock_volume(vol);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/vos/vos_vldbexamine.c b/usr.sbin/afs/src/appl/vos/vos_vldbexamine.c
deleted file mode 100644
index 66b948e4276..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_vldbexamine.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "vos_local.h"
-
-RCSID("$arla: vos_vldbexamine.c,v 1.16 2002/07/09 16:13:00 lha Exp $");
-
-static void
-print_volume (const nvldbentry *nvlentry, const char *server_name)
-{
- char part_name[17];
-
- printf("%s\t\t\t%10u %s\n",
- nvlentry->name,
- nvlentry->volumeId[0],
- volumetype_from_serverflag(nvlentry->serverFlags[0]));
-
- partition_num2name (nvlentry->serverPartition[0],
- part_name, sizeof(part_name));
-
- printf(" %s %s\n", server_name, part_name);
- printf(" ");
-
- if (nvlentry->flags & VLF_RWEXISTS)
- printf("RWrite %u\t", nvlentry->volumeId[RWVOL]);
-
- if (nvlentry->flags & VLF_ROEXISTS )
- printf("ROnly %u\t", nvlentry->volumeId[ROVOL]);
-
- if (nvlentry->flags & VLF_BACKEXISTS)
- printf("Backup %u\t", nvlentry->volumeId[BACKVOL]);
-
-}
-
-
-static int
-printvolstat(const char *volname, const char *cell, const char *host,
- arlalib_authflags_t auth, int verbose)
-{
- int error;
- int i;
- nvldbentry nvlentry;
- char server_name[MAXHOSTNAMELEN];
- char part_name[17];
-
- find_db_cell_and_host (&cell, &host);
-
- if (cell == NULL) {
- fprintf (stderr, "Unable to find cell of host '%s'\n", host);
- return -1;
- }
-
- if (host == NULL) {
- fprintf (stderr, "Unable to find DB server in cell '%s'\n", cell);
- return -1;
- }
-
- if (verbose)
- fprintf (stderr,
- "Getting volume `%s' from the VLDB at `%s'...",
- volname, host);
-
- error = get_vlentry (cell, host, volname, auth, &nvlentry);
-
- if (error) {
- fprintf(stderr, "VL_GetEntryByName(%s) failed: %s\n",
- volname, koerr_gettext(error));
- return -1;
- }
-
- if (verbose)
- fprintf (stderr, "done\n");
-
- arlalib_host_to_name (htonl(nvlentry.serverNumber[0]),
- server_name, sizeof(server_name));
- print_volume (&nvlentry, server_name);
-
- printf("\n number of sites -> %d\n", nvlentry.nServers );
-
- for (i = 0; i < nvlentry.nServers; i++) {
- printf(" ");
-
- arlalib_host_to_name (htonl(nvlentry.serverNumber[i]),
- server_name, sizeof(server_name));
-
- partition_num2name (nvlentry.serverPartition[i],
- part_name, sizeof(part_name));
- printf("server %s partition %s %s Site",
- server_name, part_name,
- volumetype_from_serverflag(nvlentry.serverFlags[i]));
-
-
- if (nvlentry.serverFlags[i] & VLSF_DONTUSE)
- printf(" -- not replicated yet");
-
- printf("\n");
-
- }
-
- return 0;
-}
-
-static int helpflag;
-static char *host;
-static char *cell;
-static char *vol;
-static int noauth;
-static int localauth;
-static int verbose;
-
-static struct agetargs args[] = {
- {"id", 0, aarg_string, &vol, "id of volume", "volume",
- aarg_mandatory},
- {"host", 0, aarg_string, &host, "what host to use", NULL},
- {"cell", 0, aarg_string, &cell, "what cell to use", NULL},
- {"noauth", 0, aarg_flag, &noauth, "do not authenticate", NULL},
- {"localauth",0,aarg_flag, &localauth, "localauth", NULL},
- {"verbose", 0, aarg_flag, &verbose, "be verbose", NULL},
- {"help", 0, aarg_flag, &helpflag, NULL, NULL},
- {NULL, 0, aarg_end, NULL}
-};
-
-static void
-usage(void)
-{
- aarg_printusage(args, "vos vldbexamine", "", AARG_AFSSTYLE);
-}
-
-int
-vos_vldbexamine(int argc, char **argv)
-{
- int optind = 0;
-
- helpflag = noauth = localauth = verbose = 0;
- host = cell = vol = NULL;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage ();
- return 0;
- }
-
- if (helpflag) {
- usage ();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc) {
- printf("unknown option %s\n", *argv);
- return 0;
- }
-
- /* don't allow any bogus volname */
- if (vol == NULL || vol[0] == '\0') {
- usage ();
- return 0;
- }
-
- printvolstat(vol, cell, host,
- arlalib_getauthflag (noauth, localauth, 0, 0),
- verbose);
- return 0;
-}
diff --git a/usr.sbin/afs/src/appl/vos/vos_zap.c b/usr.sbin/afs/src/appl/vos/vos_zap.c
deleted file mode 100644
index 0da0ac7da31..00000000000
--- a/usr.sbin/afs/src/appl/vos/vos_zap.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000, 2001 Kungliga
- * Tekniska Högskolan (Royal Institute of Technology, Stockholm,
- * Sweden). All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "appl_locl.h"
-#include <sl.h>
-#include "vos_local.h"
-
-RCSID("$arla: vos_zap.c,v 1.1 2001/09/28 15:02:19 ahltorp Exp $");
-
-/*
- * zap volume on a afs-server
- */
-
-static char *server;
-static char *partition;
-static int32_t id;
-static char *cell;
-static int noauth;
-static int localauth;
-static int helpflag;
-static int force;
-
-static struct agetargs args[] = {
- {"server", 0, aarg_string, &server,
- "server name", NULL, aarg_mandatory},
- {"partition", 0, aarg_string, &partition,
- "partition name", NULL, aarg_mandatory},
- {"id", 0, aarg_integer, &id,
- "volume ID", NULL, aarg_mandatory},
- {"force", 0, aarg_flag, &force,
- "force", NULL},
- {"cell", 0, aarg_string, &cell,
- "cell", NULL},
- {"noauth", 0, aarg_flag, &noauth,
- "do not authenticate", NULL},
- {"localauth", 0, aarg_flag, &localauth,
- "use local authentication", NULL},
- {"help", 0, aarg_flag, &helpflag,
- NULL, NULL},
- {NULL, 0, aarg_end, NULL}
-};
-
-static void
-usage(void)
-{
- aarg_printusage (args, "vos zap", "", AARG_AFSSTYLE);
-}
-
-/*
- * delete the volume at the volserver
- */
-
-static int
-zapvol(struct rx_connection *connvolser,
- int32_t volume,
- int32_t part)
-{
- int error;
- int delete_error;
- int32_t trans;
- int32_t rcode;
-
- error = VOLSER_AFSVolTransCreate(connvolser,
- volume, part, ITOffline,
- &trans);
- if (error)
- return error;
-
- delete_error = VOLSER_AFSVolDeleteVolume(connvolser, trans);
-
- error = VOLSER_AFSVolEndTrans(connvolser, trans, &rcode);
-
- if (delete_error)
- return delete_error;
-
- if (error)
- return error;
-
- if (rcode)
- return rcode;
-
- return 0;
-}
-
-
-int
-vos_zap(int argc, char **argv)
-{
- struct rx_connection *connvolser;
- int optind = 0;
- int error;
- int part;
-
- server = partition = cell = NULL;
- noauth = localauth = helpflag = force = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage();
- return 0;
- }
-
- if(helpflag) {
- usage();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (server == NULL) {
- usage();
- return 0;
- }
-
- if (partition == NULL) {
- usage();
- return 0;
- } else {
- part = partition_name2num(partition);
- if (part == -1) {
- usage();
- return 0;
- }
- }
-
- connvolser = arlalib_getconnbyname(cell, server, afsvolport,
- VOLSERVICE_ID,
- arlalib_getauthflag (noauth, 0, 0, 0));
-
- if (connvolser == NULL) {
- printf("vos zap: failed to contact volser on host %s",
- server);
- return -1 ;
- }
-
- error = zapvol(connvolser, id, part);
- if (error) {
- printf("vos zap: zapvol failed with: %s (%d)\n",
- koerr_gettext(error), error);
- return -1;
- }
-
- arlalib_destroyconn(connvolser);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/arlad/.gdbinit b/usr.sbin/afs/src/arlad/.gdbinit
deleted file mode 100644
index 4e2581123bd..00000000000
--- a/usr.sbin/afs/src/arlad/.gdbinit
+++ /dev/null
@@ -1,241 +0,0 @@
-#
-# $arla: .gdbinit,v 1.10 2002/04/10 08:56:33 lha Exp $
-#
-
-define memoryusage
-y
-printf "rx bytes: bytes: %d allocations: %d\n", rxi_Allocsize, rxi_Alloccnt
-printf "fcache: highvnode: %d usedvnode: %d\n", highvnodes, usedvnodes
-printf "conn: nconnections %d\n", nconnections
-printf "cred: ncredentials %d\n", ncredentials
-end
-
-
-define listfcachenodes
-set $foo = lrulist->head
-while $foo != 0
-print *(FCacheEntry *) $foo->data
-set $foo = $foo->next
-end
-print 4711
-end
-
-document listfcachenodes
-List all fcache nodes in the lru-list
-end
-
-
-define listfcachenodes_fid
-set $foo = lrulist->head
-while $foo != 0
-print ((FCacheEntry *) $foo->data)->fid
-set $foo = $foo->next
-end
-print 4711
-end
-
-document listfcachenodes_fid
-List all fcache nodes's fids in the lru-list
-end
-
-define fcache_lru_num_nodes
-set $bar = 0
-set $foo = lrulist->head
-while $foo != 0
-set $bar = $bar + 1
-set $foo = $foo->next
-end
-print $bar
-end
-
-document fcache_lru_num_nodes
-Count number of nodes in the fcache lrulist
-end
-
-define fcache_lru_num_used_nodes
-set $bar = 0
-set $foo = lrulist->head
-while $foo != 0
-if ((FCacheEntry *) $foo->data)->flags.usedp != 0
-set $bar = $bar + 1
-end
-set $foo = $foo->next
-end
-print $bar
-end
-
-document fcache_lru_num_used_nodes
-Count number of USED nodes in the fcache lrulist
-end
-
-define lwp_ps_internal
-set $lwp_ps_queue = $arg0
-set $bf = $arg1
-set $lwp_ps_counter = $lwp_ps_queue.count
-set $lwp_ps_foo = $lwp_ps_queue->head
-while $lwp_ps_counter != 0
- printf " name: %s index: %d", (char *) $lwp_ps_foo->name, $lwp_ps_foo->index
- if $lwp_ps_foo == lwp_cpptr
- printf " RUNNING THREAD"
- end
- printf "\n"
- if $bf == 0
- printf " eventlist:"
- set $lwp_ps_envcnt = 0
- while $lwp_ps_envcnt < $lwp_ps_foo->eventcnt
- printf " %x", $lwp_ps_foo->eventlist[$lwp_ps_envcnt]
- set $lwp_ps_envcnt = $lwp_ps_envcnt + 1
- end
- printf "\n"
- if $lwp_ps_foo == lwp_cpptr
- printf " fp: 0x%x\n", $fp
- printf " pc: 0x%x\n", $pc
- printf " pointers on topstack added for completeness\n"
- end
- printf " fp: 0x%x\n", ((int *)$lwp_ps_foo->context->topstack)[2]
- printf " pc: 0x%x\n", ((int *)$lwp_ps_foo->context->topstack)[3]
- else
- set $foo = ((int *)$lwp_ps_foo->context->topstack)[2]
- backfrom $foo $foo
- end
- set $lwp_ps_foo = $lwp_ps_foo->next
- set $lwp_ps_counter = $lwp_ps_counter - 1
-end
-end
-
-define lwp_ps_int
-set $bf = $arg0
-echo Runnable[0]\n
-lwp_ps_internal runnable[0] $bf
-echo Runnable[1]\n
-lwp_ps_internal runnable[1] $bf
-echo Runnable[2]\n
-lwp_ps_internal runnable[2] $bf
-echo Runnable[3]\n
-lwp_ps_internal runnable[3] $bf
-echo Runnable[4]\n
-lwp_ps_internal runnable[4] $bf
-echo Blocked\n
-lwp_ps_internal blocked $bf
-end
-
-define lwp_ps
-lwp_ps_int 0
-end
-
-document lwp_ps
-Print all processes, running or blocked
-end
-
-define lwp_backfrom_all
-lwp_ps_int 1
-end
-
-document lwp_backfrom_all
-Traces from all processes, running or blocked
-end
-
-
-
-define list_count
- set $count = 0
- set $current = ((List *)$arg0)->head
- while $current != 0
- set $count = $count + 1
- set $current = $current->next
- end
- printf "List contains %d entries\n", $count
-end
-
-document list_count
-Count number of elements on util LIST.
-end
-
-define volume_print
- set $current = 'volcache.c'::lrulist->head
- while $current != 0
- set $entry = (VolCacheEntry *)$current->data
- if $entry->refcount != 0
- printf "%p - %s ref: %d\n", $entry, $entry->entry->name, $entry->refcount
- end
- set $current = $current->next
- end
-end
-
-document volume_print
-Print the volume in the volcache
-end
-
-define volume_count
- set $cnt = 0
- set $vol_refs = 0
- set $total_cnt = 0
- set $current = 'volcache.c'::lrulist->head
- while $current != 0
- set $entry = (VolCacheEntry *)$current->data
- if $entry->refcount != 0
- set $cnt = $cnt + 1
- set $total_cnt = $total_cnt + $entry->refcount
- end
- set $vol_refs = $vol_refs + $entry->vol_refs
- set $current = $current->next
- end
- printf "Used volcache: counted: %d count: %d max: %d\n", $cnt, nactive_volcacheentries, nvolcacheentries
- printf "Refcount total: %d, used fcache nodes are: %d\n", $total_cnt, 'fcache.c'::usedvnodes
- printf "Volrefs total to %d\n", $vol_refs
-end
-
-document volume_count
-Print the number of active entries in volcache, by counting
-them and printing the accounting variables
-end
-
-define volume_check
- set $current = 'volcache.c'::lrulist->head
- while $current != 0
- set $entry = (VolCacheEntry *)$current->data
- printf "checking %s\n", $entry->entry->name
-
- if $entry->refcount != 0
- set $cnt = 0
- printf " checking fcache\n"
- set $fcur = 'fcache.c'::lrulist->head
- while $fcur != 0
- if ((FCacheEntry *)$fcur->data)->volume == $entry
- set $cnt = $cnt + 1
- end
- set $fcur = $fcur->next
- end
- if $cnt != $entry->refcount
- printf " failed %d fcache entries used, while entry was accounted for %d\n", $cnt, $entry->refcount
- else
- printf " ok\n"
- end
- end
-
- set $current = $current->next
- end
-end
-
-document volume_check
-Check volcache consistency WRT fcache usage, too slow to use !
-end
-
-
-define conn_print
-set $num = 0
-while $num < connhtab->sz
- set $current = connhtab->tab[$num]
- while $current != 0
- set $data = (ConnCacheEntry *)$current->ptr
- print *$data
- printf " Cuid: %lx/%lx\n", $data->connection.epoch, $data->connection.cid
- set $current = $current->next
- end
- set $num = $num + 1
-end
-end
-
-document conn_print
-Print all entries on volcache cache
-end
diff --git a/usr.sbin/afs/src/arlad/AliasDB.5 b/usr.sbin/afs/src/arlad/AliasDB.5
deleted file mode 100644
index 64ec36a3d56..00000000000
--- a/usr.sbin/afs/src/arlad/AliasDB.5
+++ /dev/null
@@ -1,80 +0,0 @@
-.\" Copyright (c) 2002, Kungliga Tekniska Högskolan
-.\" (Royal Institute of Technology, Stockholm, Sweden).
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" 3. Neither the name of the Institute nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $arla: AliasDB.5,v 1.3 2003/02/14 16:24:51 lha Exp $
-.\"
-.Dd April 30, 2001
-.Dt ALIASDB 5
-.Os "The Arla Project"
-.Sh NAME
-.Nm AliasDB
-.Nd add alias for an afs cell in dynroot
-.Sh DESCRIPTION
-The file
-.Nm
-add aliases for afs cellnames in dynroot, useful to add readwrite mountpoints
-in dynroot.
-.Pp
-Each line in the file contains at least two elements with an optional
-third element.
-The first element is the cell name to make the alias for. The second
-element is the alias.
-The optional third element is describing properties of the
-mountpoint.
-.Pp
-By default, an alias is a readonly mountpoint, which means that
-.Nm afsd
-will use readonly replicas of volumes, if they exist.
-If an alias set to readwrite,
-.Nm afsd
-will disregard the readonly replicas and use the readwrite volumes only.
-This will seriously limit performance, but maybe necessary to install
-software packages etc.
-.Pp
-Each line that starts with a
-.Sq #
-is a comment
-.Sh EXAMPLE
-.Bd -literal
-# This is a comment
-# cell alias [property]
-su.se .su.se readwrite
-e.kth.se .e.kth.se rw
-cs.cmu.edu cs readonly
-andrew.cmu.edu andrew #andrew is a readonly alias
-.Ed
-.\" su.se:www su-web
-.Sh FILES
-.Pa AliasDB
-.Sh SEE ALSO
-.Xr CellServDB 5 ,
-.Xr DynRootDB 5 ,
-.Xr afsd 8
diff --git a/usr.sbin/afs/src/arlad/CellServDB.5 b/usr.sbin/afs/src/arlad/CellServDB.5
deleted file mode 100644
index 4498977f83e..00000000000
--- a/usr.sbin/afs/src/arlad/CellServDB.5
+++ /dev/null
@@ -1,85 +0,0 @@
-.\" Copyright (c) 2000 - 2002 Kungliga Tekniska Högskolan
-.\" (Royal Institute of Technology, Stockholm, Sweden).
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" 3. Neither the name of the Institute nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $arla: CellServDB.5,v 1.10 2003/06/06 12:53:52 hin Exp $
-.\" $OpenBSD: CellServDB.5,v 1.9 2009/09/15 07:48:49 matthieu Exp $
-.\"
-.Dd April 19, 2000
-.Dt CELLSERVDB 5
-.Os "The Arla Project"
-.Sh NAME
-.Nm CellServDB
-.Nd AFS cells and database servers
-.Sh DESCRIPTION
-The file
-.Nm
-lists AFS cells known to the local AFS cache manager.
-Each entry describes the name of an AFS cell and specifies the
-servers for that cell.
-.Pp
-Here is an example of the format of an entry in the file:
-.Bd -literal
->cellname # Freetext comment describing the cell
-ip-address #first.server.for.cell
-ip-address #second.server.for.cell
-ip-address #third.server.for.cell
-.Ed
-.Pp
-.Nm
-is read when
-.Nm arlad
-is started, normally when the system boots.
-.Pp
-The text after the # is
-.Em not
-a comment, it's the hostname of the
-db-server, and it's used to lookup the address. The address is only
-used when the hostname is not found in DNS.
-.Pp
-Entries in the file are searched and expanded by many programs.
-.Pp
-In most cases it is better to distribute the information in
-.Nm
-with the AFSDB DNS resource records. This avoids having out of date
-information in
-.Nm Ns .
-.Pp
-When using AFSDB DNS resource records, entries entries should still
-be listed, but without any hosts. This is needed for dynroot to work.
-.Sh FILES
-.Pa /etc/afs/CellServDB
-.Sh SEE ALSO
-.Xr fs 1 ,
-.Xr AliasDB 5 ,
-.Xr DynRootDB 5 ,
-.Xr ThisCell 5 ,
-.Xr afsd.conf 5 ,
-.Xr afsd 8
diff --git a/usr.sbin/afs/src/arlad/DynRootDB.5 b/usr.sbin/afs/src/arlad/DynRootDB.5
deleted file mode 100644
index f1b7b22d7df..00000000000
--- a/usr.sbin/afs/src/arlad/DynRootDB.5
+++ /dev/null
@@ -1,76 +0,0 @@
-.\" Copyright (c) 2003 Kungliga Tekniska Högskolan
-.\" (Royal Institute of Technology, Stockholm, Sweden).
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" 3. Neither the name of the Institute nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $arla: DynRootDB.5,v 1.9 2003/06/06 12:53:53 hin Exp $
-.\"
-.Dd March 31, 2003
-.Dt DYNROOTDB 5
-.Os "The Arla Project"
-.Sh NAME
-.Nm DynRootDB
-.Nd AFS cells and database servers
-.Sh DESCRIPTION
-The file
-.Nm
-specifies what AFS cells that should appear in the AFS root
-.Pa ( /afs )
-when starting
-.Nm afsd .
-.Pp
-Each line in the file should contain one cell, for example:
-.Bd -literal
-stacken.kth.se
-e.kth.se
-nada.kth.se
-it.kth.se
-.Ed
-.Pp
-.Nm
-is read when
-.Nm afsd
-is started, normally when the system boots.
-.Pp
-If
-.Nm
-doesn't exist, then all cells listed in the CellServDB and the
-dynamically found nodes appear in the
-.Pa /afs
-directory.
-.Sh FILES
-.Pa /etc/afs/DynRootDB
-.Pa /etc/afs/CellServDB
-.Sh SEE ALSO
-.Xr AliasDB 5 ,
-.Xr CellServDB 5 ,
-.Xr SuidCells 5 ,
-.Xr ThisCell 5 ,
-.Xr afsd.conf 5 ,
-.Xr afsd 8
diff --git a/usr.sbin/afs/src/arlad/Makefile.in b/usr.sbin/afs/src/arlad/Makefile.in
deleted file mode 100644
index a89d823791e..00000000000
--- a/usr.sbin/afs/src/arlad/Makefile.in
+++ /dev/null
@@ -1,233 +0,0 @@
-# $KTH: Makefile.in,v 1.83.2.3 2001/05/28 23:22:46 mattiasa Exp $
-
-srcdir = @srcdir@
-top_builddir = ..
-VPATH = @srcdir@
-
-CC = @CC@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-sbindir = @sbindir@
-sysconfdir = @sysconfdir@
-mandir = @mandir@
-transform = @program_transform_name@
-ARLACACHEDIR = @ARLACACHEDIR@
-ARLACONFFILE = @ARLACONFFILE@
-
-ARLA_SBIN = arla-cli
-ARLA_LIBEXEC = arlad
-
-MANPAGES = CellServDB.5 DynRootDB.5 ThisCell.5 \
- SuidCells.5 arlad.8 arla-cli.8
-
-DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)\" \
- -DARLACACHEDIR=\"$(ARLACACHEDIR)\" \
- -DARLACONFFILE=\"$(ARLACONFFILE)\"
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-LDFLAGS = @LDFLAGS@
-
-ETAGS = etags
-MAKEDEPEND = makedepend
-AFSWSROOT = /usr/afsws
-RXKADINC = -I$(srcdir)/../rxkad
-INCLUDES = -I$(srcdir)/.. \
- @KERNEL_INCLUDE@ \
- -I../include \
- -I$(srcdir)/../include \
- -I$(srcdir)/../xfs/include \
- -I../rxdef \
- @INC_roken@ \
- $(RXKADINC)
-DEFINES = -DDEBUG
-REALCFLAGS = $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) \
- -DRXDEBUG @PLWP_INC_FLAGS@
-RXKADLIB = @RXKAD_LIBS@
-KAFS_LIBS = @AIX_EXTRA_KAFS@ @KAFS_LIBS@
-LIB_tgetent = @LIB_tgetent@
-LIBS_common = -L../lib/bufdir -lbufdir \
- -L../rxdef -lrxdefclient -L../rx -lrx -L../lwp \
- -llwp @PLWP_LIB_FLAGS@
-
-LIBS_common_post= -L../lib/ko -lko -L../util -lutil\
- @LIB_roken@ $(RXKADLIB) $(KAFS_LIBS) @LIBS@
-
-LIBS_arla-cli = $(LIBS_common) \
- -L../lib/sl -lsl @LIB_readline@ \
- $(LIBS_common_post)
-
-LIBS_arlad = $(LIBS_common) \
- $(LIBS_common_post)
-
-LIBS_afsdir_check= $(LIBS_common) \
- $(LIBS_common_post)
-
-LIBDEPENDS = ../rxdef/librxdefclient.a ../rx/librx.a ../lwp/liblwp.a \
- ../util/libutil.a ../lib/sl/libsl.a \
- ../lib/ko/libko.a ../lib/bufdir/libbufdir.a
-KERNEL_SRCS = @KERNEL_SRCS@
-PROGS = $(ARLA_SBIN) $(ARLA_LIBEXEC) afsdir_check
-
-SRCS = \
- adir.c \
- afsdir_check.c \
- arla.c \
- arlad.c \
- arla-cli.c \
- arladeb.c \
- arladebu.c \
- cmcb.c \
- conn.c \
- cred.c \
- darla.c \
- discon_log.c \
- dynroot.c \
- fcache.c \
- fprio.c \
- inter.c \
- kernel.c \
- messages.c \
- reconnect.c \
- subr.c \
- volcache.c \
- xfs.c \
- $(KERNEL_SRCS)
-
-HDRS = \
- adir.h \
- afs_dir.h \
- arla_local.h \
- arladeb.h \
- cmcb.h \
- conn.h \
- cred.h \
- darla.h \
- discon.h \
- discon_fix.h \
- discon_log.h \
- dynroot.h \
- fcache.h \
- fprio.h \
- inter.h \
- kernel.h \
- messages.h \
- service.h \
- subr.h \
- xfs.h \
- volcache.h
-
-common_OBJS = \
- adir.o \
- arla.o \
- arladeb.o \
- arladebu.o \
- cmcb.o \
- conn.o \
- cred.o \
- darla.o \
- discon_log.o \
- dynroot.o \
- fcache.o \
- fprio.o \
- inter.o \
- kernel.o \
- messages.o \
- reconnect.o \
- subr.o \
- volcache.o \
- xfs.o \
- $(KERNEL_SRCS:.c=.o)
-
-arlad_OBJS = $(common_OBJS) \
- arlad.o
-
-arla-cli_OBJS = $(common_OBJS) \
- arla-cli.o
-
-afsdir_check_OBJS = afsdir_check.o
-
-.PHONY: all install uninstall depend tags clean
-
-all: $(PROGS)
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(sbindir)
- PROG_SBIN='$(ARLA_SBIN)'; for x in $$PROG_SBIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(sbindir)/$$f; \
- done ; \
- $(MKINSTALLDIRS) $(DESTDIR)$(libexecdir) ; \
- PROG_LIBEXEC='$(ARLA_LIBEXEC)'; for x in $$PROG_LIBEXEC; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(libexecdir)/$$f; \
- done ; \
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir) ; \
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$$e ; \
- $(INSTALL_DATA) $(srcdir)/$$x \
- $(DESTDIR)$(mandir)/man$$e/$$f.$$e; \
- done
-
-uninstall:
- PROG_BIN='$(ARLA_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
- done ; \
- PROG_LIBEXEC='$(ARLA_LIBEXEC)'; for x in $$PROG_LIBEXEC; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(libexecdir)/$$f; \
- done ; \
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- rm -rf $(DESTDIR)$(mandir)/$$f.$$e; \
- done
-
-arlad: $(arlad_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(arlad_OBJS) $(LIBS_arlad)
-
-arla-cli: $(arla-cli_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(arla-cli_OBJS) $(LIBS_arla-cli)
-
-afsdir_check: $(afsdir_check_OBJS)
- $(CC) $(LDFLAGS) -o $@ $(afsdir_check_OBJS) $(LIBS_afsdir_check)
-
-Makefile: Makefile.in ../config.status
- cd ..; CONFIG_FILES=arlad/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(SRCS)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(PROGS) $(OBJS) *~ *.o core *.core
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile config.status
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/arlad/SuidCells.5 b/usr.sbin/afs/src/arlad/SuidCells.5
deleted file mode 100644
index c8fced2acd9..00000000000
--- a/usr.sbin/afs/src/arlad/SuidCells.5
+++ /dev/null
@@ -1,58 +0,0 @@
-.\" Copyright (c) 2000 - 2003 Kungliga Tekniska Högskolan
-.\" (Royal Institute of Technology, Stockholm, Sweden).
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" 3. Neither the name of the Institute nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $arla: SuidCells.5,v 1.9 2003/06/06 12:53:53 hin Exp $
-.\" $OpenBSD: SuidCells.5,v 1.6 2005/07/29 15:26:26 jmc Exp $
-.\"
-.Dd April 19, 2000
-.Dt SUIDCELLS 5
-.Os "The Arla Project"
-.Sh NAME
-.Nm SuidCells
-.Nd lists AFS cells for which
-.Nm afsd
-will honor the setuid bit
-.Sh DESCRIPTION
-The setuid bit on binaries executed from AFS are ignored
-for the cells that are not listed in
-.Nm Ns .
-.Pp
-The
-.Nm
-file contain a list of cells separated by newlines. The cells
-need to exist in CellServDB or in DNS (with AFSDB resource records).
-.Sh SEE ALSO
-.Xr AliasDB 5 ,
-.Xr CellServDB 5 ,
-.Xr DynRootDB 5 ,
-.Xr ThisCell 5 ,
-.Xr afsd.conf 5 ,
-.Xr afsd 8
diff --git a/usr.sbin/afs/src/arlad/ThisCell.5 b/usr.sbin/afs/src/arlad/ThisCell.5
deleted file mode 100644
index ad75ccdc2d6..00000000000
--- a/usr.sbin/afs/src/arlad/ThisCell.5
+++ /dev/null
@@ -1,66 +0,0 @@
-.\" Copyright (c) 2000 - 2003 Kungliga Tekniska Högskolan
-.\" (Royal Institute of Technology, Stockholm, Sweden).
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" 3. Neither the name of the Institute nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $OpenBSD: ThisCell.5,v 1.7 2005/07/29 15:26:26 jmc Exp $
-.\" $arla: ThisCell.5,v 1.10 2003/06/06 12:53:54 hin Exp $
-.\"
-.Dd March 31, 2003
-.Dt THISCELL 5
-.Os "The Arla Project"
-.Sh NAME
-.Nm ThisCell
-.Nd specify a host's home AFS cell
-.Sh DESCRIPTION
-The file
-.Nm
-specifies which cell the AFS client belongs to. This affects the
-default cell to use for commands such as
-.Xr pts 1 ,
-.Xr fs 1 ,
-.Xr vos 8 ,
-.Xr kauth 1 ,
-.Xr kinit 1 ,
-.Xr afslog 1 ,
-but other cells can still be used (mostly by giving a -cell argument).
-.Pp
-Unless dynroot is used, it also affects where
-.Nm afsd
-reads the root of afs, so
-having good connectivity to the default cell is very important.
-.Pp
-The cell specified must be listed in
-.Pa CellServDB Ns .
-.Pp
-.Sh SEE ALSO
-.Xr CellServDB 5 ,
-.Xr DynRootDB 5 ,
-.Xr SuidCells 5 ,
-.Xr afsd 8
diff --git a/usr.sbin/afs/src/arlad/adir.c b/usr.sbin/afs/src/arlad/adir.c
deleted file mode 100644
index 27f7c61aea3..00000000000
--- a/usr.sbin/afs/src/arlad/adir.c
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Routines for reading an AFS directory
- */
-
-#include "arla_local.h"
-
-RCSID("$arla: adir.c,v 1.73 2002/07/24 05:56:27 lha Exp $") ;
-
-/*
- *
- */
-
-static int
-get_fbuf_from_centry (CredCacheEntry **ce,
- int *fd, fbuf *fbuf,
- FCacheEntry **centry,
- int open_flags, int fbuf_flags)
-{
- int ret;
-
- ret = fcache_get_data (centry, ce, 0);
- if (ret)
- return ret;
-
- ret = fcache_get_fbuf (*centry, fd, fbuf, open_flags, fbuf_flags);
- if (ret) {
- return ret;
- }
- return 0;
-}
-
-/*
- * Lookup `name' in the AFS directory identified by `centry' and return
- * the Fid in `file'. All operations are done as `cred' and return
- * value is 0 or error code.
- *
- *
- * Locking:
- * In Out Fail
- * centry: Locked Locked Locked
- *
- */
-
-int
-adir_lookup (FCacheEntry *centry, const char *name, VenusFid *file)
-{
- int ret;
- int fd;
- fbuf the_fbuf;
-
- ret = fcache_get_fbuf (centry, &fd, &the_fbuf, O_RDONLY,
- FBUF_READ|FBUF_PRIVATE);
- if (ret)
- return ret;
-
- ret = fdir_lookup (&the_fbuf, &centry->fid, name, file);
- fbuf_end (&the_fbuf);
- close (fd);
- return ret;
-}
-
-/*
- * Lookup `name' in the AFS directory identified by `dir' and change the
- * fid to `fid'.
- */
-
-int
-adir_changefid (FCacheEntry **centry,
- const char *name,
- VenusFid *file,
- CredCacheEntry **ce)
-{
- int ret;
- int fd;
- fbuf the_fbuf;
-
- ret = get_fbuf_from_centry (ce, &fd, &the_fbuf, centry, O_RDWR,
- FBUF_READ|FBUF_WRITE|FBUF_SHARED);
- if (ret)
- return ret;
-
- ret = fdir_changefid (&the_fbuf, name, file);
- fbuf_end (&the_fbuf);
- close (fd);
- return ret;
-}
-
-/*
- * Return TRUE if dir is empty.
- */
-
-int
-adir_emptyp (FCacheEntry **centry,
- CredCacheEntry **ce)
-{
- int ret;
- int fd;
- fbuf the_fbuf;
-
- ret = get_fbuf_from_centry (ce, &fd, &the_fbuf, centry,
- O_RDONLY, FBUF_READ|FBUF_PRIVATE);
- if (ret)
- return ret;
-
- ret = fdir_emptyp (&the_fbuf);
- fbuf_end (&the_fbuf);
- close (fd);
- return ret;
-}
-
-/*
- * Read all entries in the AFS directory identified by `dir' and call
- * `func' on each entry with the fid, the name, and `arg'.
- */
-
-int
-adir_readdir (FCacheEntry **centry,
- fdir_readdir_func func,
- void *arg,
- CredCacheEntry **ce)
-{
- int fd;
- fbuf the_fbuf;
- int ret;
-
- ret = get_fbuf_from_centry (ce, &fd, &the_fbuf, centry,
- O_RDONLY, FBUF_READ|FBUF_PRIVATE);
- if (ret)
- return ret;
-
- ret = fdir_readdir (&the_fbuf, func, arg, (*centry)->fid, NULL);
- fbuf_end (&the_fbuf);
- close (fd);
- return ret;
-}
-
-/*
- * Create a new directory with only . and ..
- */
-
-int
-adir_mkdir (FCacheEntry *dir,
- AFSFid dot,
- AFSFid dot_dot)
-{
- int fd;
- fbuf the_fbuf;
- int ret;
-
- AssertExclLocked(&dir->lock);
-
- ret = fcache_get_fbuf (dir, &fd, &the_fbuf, O_RDWR,
- FBUF_READ|FBUF_WRITE|FBUF_SHARED);
- if (ret)
- return ret;
-
- ret = fdir_mkdir (&the_fbuf, dot, dot_dot);
- fcache_update_length (dir, fbuf_len(&the_fbuf), fbuf_len(&the_fbuf));
- fbuf_end (&the_fbuf);
- close (fd);
- return ret;
-}
-
-/*
- * Create a new entry with name `filename' and contents `fid' in `dir'.
- */
-
-int
-adir_creat (FCacheEntry *dir,
- const char *name,
- AFSFid fid)
-{
- int fd;
- fbuf the_fbuf;
- int ret;
-
- ret = fcache_get_fbuf (dir, &fd, &the_fbuf, O_RDWR,
- FBUF_READ|FBUF_WRITE|FBUF_SHARED);
- if (ret)
- return ret;
-
- ret = fdir_creat (&the_fbuf, name, fid);
- fcache_update_length (dir, fbuf_len(&the_fbuf), fbuf_len(&the_fbuf));
- fbuf_end (&the_fbuf);
- close (fd);
- return ret;
-}
-
-/*
- * Remove the entry named `name' in dir.
- */
-
-int
-adir_remove (FCacheEntry *dir,
- const char *name)
-{
- int fd;
- fbuf the_fbuf;
- int ret;
-
- ret = fcache_get_fbuf (dir, &fd, &the_fbuf, O_RDWR,
- FBUF_READ|FBUF_WRITE|FBUF_SHARED);
- if (ret)
- return ret;
-
- ret = fdir_remove(&the_fbuf, name, NULL);
- fcache_update_length (dir, fbuf_len(&the_fbuf), fbuf_len(&the_fbuf));
- fbuf_end (&the_fbuf);
- close (fd);
- return ret;
-}
diff --git a/usr.sbin/afs/src/arlad/adir.h b/usr.sbin/afs/src/arlad/adir.h
deleted file mode 100644
index 49432384688..00000000000
--- a/usr.sbin/afs/src/arlad/adir.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Interface to directory handling routines
- */
-
-/* $arla: adir.h,v 1.18 2002/07/24 05:57:01 lha Exp $ */
-
-#ifndef _ADIR_H_
-#define _ADIR_H_
-
-#include "cred.h"
-#include "fcache.h"
-#include "fdir.h"
-
-int
-adir_lookup (FCacheEntry *centry, const char *name, VenusFid *file);
-
-int
-adir_changefid (FCacheEntry **centry,
- const char *name,
- VenusFid *file,
- CredCacheEntry **ce);
-
-int
-adir_emptyp (FCacheEntry **centry,
- CredCacheEntry **ce);
-
-int adir_readdir (FCacheEntry **centry,
- fdir_readdir_func func,
- void *arg,
- CredCacheEntry **ce);
-
-int
-adir_creat (FCacheEntry *dir,
- const char *filename,
- AFSFid fid);
-
-int
-adir_remove (FCacheEntry *dir,
- const char *name);
-
-int
-adir_mkdir (FCacheEntry *dir,
- AFSFid dot,
- AFSFid dot_dot);
-
-#endif /* _ADIR_H_ */
diff --git a/usr.sbin/afs/src/arlad/afsdir_check.c b/usr.sbin/afs/src/arlad/afsdir_check.c
deleted file mode 100644
index 29904056da7..00000000000
--- a/usr.sbin/afs/src/arlad/afsdir_check.c
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Check a directory in afs format.
- */
-
-#include "arla_local.h"
-#include <getarg.h>
-
-RCSID("$arla: afsdir_check.c,v 1.25 2002/07/24 05:57:41 lha Exp $");
-
-static int help_flag;
-static int verbose = 0;
-
-/*
- * Hash the filename of one entry.
- */
-
-static unsigned
-hashentry (const char *entry)
-{
- int s = 0, h;
-
- while (*entry)
- s = s * 173 + *entry++;
- h = s & (ADIRHASHSIZE - 1);
- if (h == 0)
- return h;
- else if( s < 0 )
- h = ADIRHASHSIZE - h;
- return h;
-}
-
-/*
- * Return the entry in the directory given the number.
- * The directory must be contiounsly in memory after page0.
- */
-
-static const DirEntry *
-getentry (DirPage0 *page0,
- unsigned short num)
-{
- DirPage1 *page;
-
- page = (DirPage1 *)((char *)page0 +
- AFSDIR_PAGESIZE * (num / ENTRIESPERPAGE));
- if (page->header.pg_tag != htons(AFSDIRMAGIC)) {
- printf ("Bad magic (%d) != %d in directory\n",
- ntohs(page->header.pg_tag), AFSDIRMAGIC);
- exit (1);
- }
- return &page->entry[num % ENTRIESPERPAGE];
-}
-
-static int
-check_dir (const char *filename)
-{
- struct stat statbuf;
- int fd;
- fbuf the_fbuf;
- DirPage0 *page0;
- unsigned i, j;
- unsigned ind;
- unsigned len;
- int ret = 0;
- unsigned npages = 0;
- unsigned page_entry_count;
- unsigned hash_entry_count;
- unsigned noverfill;
- uint8_t **my_bitmaps = NULL;
-
- fd = open (filename, O_RDONLY | O_BINARY, 0);
- if (fd < 0)
- err (1, "open %s", filename);
-
- if (fstat (fd, &statbuf) < 0)
- err (1, "stat %s", filename);
-
- len = statbuf.st_size;
-
- if (len == 0)
- errx (1, "length == 0");
-
- if (len % AFSDIR_PAGESIZE != 0)
- errx (1, "length %% AFSDIR_PAGESIZE != 0");
-
- ret = fbuf_create (&the_fbuf, fd, len, FBUF_READ|FBUF_PRIVATE);
- if (ret)
- err (1, "fbuf_create");
-
- page0 = (DirPage0 *)(the_fbuf.buf);
-
- printf ("size = %u, pages = %u, pgcount = %u\n",
- len, len / AFSDIR_PAGESIZE,
- ntohs(page0->header.pg_pgcount));
-
- if (len / AFSDIR_PAGESIZE != ntohs(page0->header.pg_pgcount)) {
- ret = 1;
- goto out;
- }
-
- npages = len / AFSDIR_PAGESIZE;
-
- my_bitmaps = malloc (npages * sizeof(*my_bitmaps));
- if (my_bitmaps == NULL)
- err (1, "malloc %lu", (unsigned long)npages * sizeof(*my_bitmaps));
-
- printf ("map: ");
- for (i = 0; i < min(npages, MAXPAGES); ++i) {
- printf ("%u ", page0->dheader.map[i]);
- }
- printf ("\n");
-
- page_entry_count = 0;
-
- for (i = 0; i < npages; ++i) {
- PageHeader *ph = (PageHeader *)((char *)page0 + i * AFSDIR_PAGESIZE);
- int start;
- size_t sz = ENTRIESPERPAGE / 8 * sizeof(*my_bitmaps[i]);
-
- my_bitmaps[i] = malloc (sz);
- if (my_bitmaps[i] == NULL)
- err (1, "malloc %lu", (unsigned long)sz);
-
- memset (my_bitmaps[i], 0, sz);
-
- if (ph->pg_tag != htons(AFSDIRMAGIC)) {
- printf ("page %d: wrong tag: %u\n", i, htons(ph->pg_tag));
- ret = 1;
- goto out;
- }
- printf ("page %d: count = %u, tag = %u, freecount = %u\n",
- i, ntohs(ph->pg_pgcount), htons(ph->pg_tag), ph->pg_freecount);
- if (i == 0) {
- if (ph->pg_freecount != 51) {
- printf ("freecount should be 51!\n");
- ret = 1;
- goto out;
- }
- if (ntohs(ph->pg_pgcount) != npages) {
- printf ("pgcount should be %u!\n", npages);
- ret = 1;
- goto out;
- }
- } else {
- if (ph->pg_freecount != 63) {
- printf ("freecount should be 63!\n");
- ret = 1;
- goto out;
- }
- if (ntohs(ph->pg_pgcount) != 0) {
- printf ("pgcount should be 0!\n");
- ret = 1;
- goto out;
- }
- }
-
- if (i == 0)
- start = 13;
- else
- start = 1;
-
- for (j = start; j < ENTRIESPERPAGE; ++j) {
- if (ph->pg_bitmap[j / 8] & (1 << (j % 8)))
- ++page_entry_count;
- }
- }
-
- printf ("page entry count = %u\n", page_entry_count);
-
- hash_entry_count = 0;
- noverfill = 0;
-
- for (i = 0; i < ADIRHASHSIZE; ++i) {
- const DirEntry *entry;
-
- for(ind = ntohs(page0->dheader.hash[i]);
- ind;
- ind = ntohs(entry->next)) {
- DirPage1 *page_n;
- int len;
- unsigned off;
- unsigned pageno;
-
- entry = getentry (page0, ind - 1);
-
- if (verbose)
- printf ("%s - %ld.%ld\n",
- entry->name,
- (long)ntohl(entry->fid.Vnode),
- (long)ntohl(entry->fid.Unique));
-
- if (hashentry (entry->name) != i)
- printf ("wrong name here? hash = %u, name = *%s*\n",
- i, entry->name);
-
- pageno = (ind) / ENTRIESPERPAGE;
- off = (ind) % ENTRIESPERPAGE;
-
- page_n = (DirPage1 *)((char *)page0
- + AFSDIR_PAGESIZE * pageno);
-
- if (!(page_n->header.pg_bitmap[off / 8] & (1 << (off % 8)))) {
- printf ("page %d: off %u not set\n",
- (ind - 1) / ENTRIESPERPAGE, off);
- }
-
- my_bitmaps[pageno][off / 8] |= (1 << (off % 8));
-
- len = strlen(entry->name);
- while (len > 15) {
- len -= sizeof(DirEntry);
- ++noverfill;
- ++off;
- my_bitmaps[pageno][off / 8] |= (1 << (off % 8));
- }
-
- ++hash_entry_count;
- }
- }
-
- for (i = 0; i < npages; ++i) {
- DirPage1 *page_n;
- int j;
- unsigned unused;
-
- if (i == 0)
- unused = 13;
- else
- unused = 1;
-
- for (j = 0; j < unused; ++j)
- my_bitmaps[i][j / 8] |= (1 << (j % 8));
-
- page_n = (DirPage1 *)((char *)page0 + AFSDIR_PAGESIZE * i);
-
- if (memcmp (my_bitmaps[i],
- page_n->header.pg_bitmap, sizeof(my_bitmaps[i])) != 0) {
- printf ("page %i: bitmaps differ\n"
- "actual: ", i);
- for (j = 0; j < ENTRIESPERPAGE / 8; ++j)
- printf ("%02x ", page_n->header.pg_bitmap[j]);
- printf ("\n"
- "calculated: ");
- for (j = 0; j < ENTRIESPERPAGE / 8; ++j)
- printf ("%02x ", my_bitmaps[i][j]);
- printf ("\n");
- }
- }
-
-
- printf ("hash entry count = %u, noverfill = %u, sum = %u\n",
- hash_entry_count, noverfill, hash_entry_count + noverfill);
-
- if (hash_entry_count + noverfill != page_entry_count)
- ret = 1;
-
-out:
- fbuf_end (&the_fbuf);
- close (fd);
- if (my_bitmaps) {
- for (i = 0; i < npages; ++i)
- free (my_bitmaps[i]);
- free (my_bitmaps);
- }
- return ret;
-}
-
-static struct getargs args[] = {
- {"verbose", 'v', arg_flag, &verbose,
- "run in test mode", NULL},
- {"help", 0, arg_flag, &help_flag,
- NULL, NULL},
-};
-
-static void
-usage (int ret)
-{
- arg_printusage (args, sizeof(args)/sizeof(*args), NULL, "[file]");
- exit (ret);
-}
-
-int
-main(int argc, char **argv)
-{
- int optind = 0;
-
- if (getarg (args, sizeof(args)/sizeof(*args), argc, argv, &optind))
- usage (1);
-
- argc -= optind;
- argv += optind;
-
- if (help_flag)
- usage (0);
-
- if (argc != 1)
- usage (1);
-
- return check_dir (argv[0]);
-}
diff --git a/usr.sbin/afs/src/arlad/arla-cli.8 b/usr.sbin/afs/src/arlad/arla-cli.8
deleted file mode 100644
index c2743c06171..00000000000
--- a/usr.sbin/afs/src/arlad/arla-cli.8
+++ /dev/null
@@ -1,80 +0,0 @@
-.\" Copyright (c) 2000 - 2002 Kungliga Tekniska Högskolan
-.\" (Royal Institute of Technology, Stockholm, Sweden).
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" 3. Neither the name of the Institute nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $arla: arla-cli.8,v 1.7 2003/04/01 14:05:30 lha Exp $
-.\"
-.Dd September 23, 2000
-.Dt ARLA-CLI 1
-.Os "The Arla Project"
-.Sh NAME
-.Nm arla-cli
-.Nd commandline AFS cache manager
-.Sh SYNOPSIS
-Has the same options as
-.Xr arlad 8 .
-See that manual page for complete reference.
-.Sh DESCRIPTION
-.Nm
-is a cache manager that have a commadline interface to access AFS.
-It's primarily used for testing if arla works.
-.Pp
-It creates a cache directory named
-.Pa .arlacache
-in your home directory as the command tool is started in.
-.Pp
-Available commands are:
-.Bl -tag -width 15
-.It chdir
-.It ls
-.It cat
-.It cp
-.It wc
-.It checkservers
-.It conn-status
-.It vol-status
-.It cred-status
-.It rx-status
-.It flushfid
-.It sysname
-.It quit
-.It help
-.El
-.Sh SEE ALSO
-.Xr fs 1 ,
-.Xr pts 1 ,
-.Xr AliasDB 5 ,
-.Xr CellServDB 5 ,
-.Xr SuidCells 5 ,
-.Xr ThisCell 5 ,
-.Xr arla.conf 5 ,
-.Xr arlad 8 ,
-.Xr mount_nnpfs 8 ,
-.Xr vos 8
diff --git a/usr.sbin/afs/src/arlad/arla-cli.c b/usr.sbin/afs/src/arlad/arla-cli.c
deleted file mode 100644
index ed72f0a0e78..00000000000
--- a/usr.sbin/afs/src/arlad/arla-cli.c
+++ /dev/null
@@ -1,1082 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <arla_local.h>
-#include <sl.h>
-#include <getarg.h>
-#include <vers.h>
-
-RCSID("$arla: arla-cli.c,v 1.35 2003/06/10 04:23:16 lha Exp $");
-
-char *default_log_file = "/dev/stderr";
-char *default_arla_cachedir = ".arlacache";
-int client_port = 4712;
-
-
-/* creds used for all the interactive usage */
-
-static CredCacheEntry *ce;
-
-static VenusFid cwd;
-static VenusFid rootcwd;
-
-static int arla_chdir(int, char **);
-static int arla_ls(int, char **);
-static int arla_cat(int, char **);
-static int arla_cp(int, char **);
-static int arla_sleep(int, char **);
-static int arla_wc(int, char **);
-static int help(int, char **);
-static int arla_quit(int, char **);
-static int arla_checkserver(int, char **);
-static int arla_conn_status(int, char **);
-static int arla_vol_status(int, char **);
-static int arla_cred_status(int, char **);
-static int arla_fcache_status(int, char **);
-static int arla_cell_status (int, char **);
-static int arla_sysname(int, char**);
-static int arla_mkdir (int, char**);
-static int arla_rmdir (int, char**);
-static int arla_rm (int, char**);
-static int arla_put (int, char**);
-static int arla_get (int, char**);
-#ifdef RXDEBUG
-static int arla_rx_status(int argc, char **argv);
-#endif
-static int arla_flushfid(int argc, char **argv);
-
-static char *copy_dirname(const char *s);
-static char *copy_basename(const char *s);
-
-
-static SL_cmd cmds[] = {
- {"chdir", arla_chdir, "chdir directory"},
- {"cd"},
- {"ls", arla_ls, "ls"},
- {"cat", arla_cat, "cat file"},
- {"cp", arla_cp, "copy file"},
- {"sleep", arla_sleep, "sleep seconds"},
- {"wc", arla_wc, "wc file"},
- {"mkdir", arla_mkdir, "mkdir dir"},
- {"rmdir", arla_rmdir, "rmdir dir"},
- {"rm", arla_rm, "rm file"},
- {"put", arla_put, "put localfile [afsfile]"},
- {"get", arla_get, "get afsfile [localfile]"},
- {"help", help, "help"},
- {"?"},
- {"checkservers", arla_checkserver, "poll servers are down"},
- {"conn-status", arla_conn_status, "connection status"},
- {"vol-status", arla_vol_status, "volume cache status"},
- {"cred-status", arla_cred_status, "credentials status"},
- {"fcache-status", arla_fcache_status, "file cache status"},
- {"cell-status", arla_cell_status, "cell status"},
-#ifdef RXDEBUG
- {"rx-status", arla_rx_status, "rx connection status"},
-#endif
- {"flushfid", arla_flushfid, "flush a fid from the cache"},
- {"quit", arla_quit, "quit"},
- {"exit"},
- {"sysname", arla_sysname, "sysname"},
- { NULL }
-};
-
-/*
- * Return a malloced copy of the dirname of `s'
- */
-
-static char *
-copy_dirname (const char *s)
-{
- const char *p;
- char *res;
-
- p = strrchr (s, '/');
- if (p == NULL)
- return strdup(".");
- res = malloc (p - s + 1);
- if (res == NULL)
- return NULL;
- memmove (res, s, p - s);
- res[p - s] = '\0';
- return res;
-}
-
-/*
- * Return the basename of `s'.
- * The result is malloc'ed.
- */
-
-static char *
-copy_basename (const char *s)
-{
- const char *p, *q;
- char *res;
-
- p = strrchr (s, '/');
- if (p == NULL)
- p = s;
- else
- ++p;
- q = s + strlen (s);
- res = malloc (q - p + 1);
- if (res == NULL)
- return NULL;
- memmove (res, p, q - p);
- res[q - p] = '\0';
- return res;
-}
-
-/*
- *
- */
-
-static int
-arla_quit (int argc, char **argv)
-{
- printf("Thank you for using arla\n");
- return 1;
-}
-
-static int
-arla_flushfid(int argc, char **argv)
-{
- AFSCallBack broken_callback = {0, 0, CBDROPPED};
- VenusFid fid;
-
- if (argc != 2) {
- fprintf(stderr, "flushfid fid\n");
- return 0;
- }
-
- if ((sscanf(argv[1], "%d.%d.%d.%d", &fid.Cell, &fid.fid.Volume,
- &fid.fid.Vnode, &fid.fid.Unique)) == 4) {
- ;
- } else if ((sscanf(argv[1], "%d.%d.%d", &fid.fid.Volume,
- &fid.fid.Vnode, &fid.fid.Unique)) == 3) {
- fid.Cell = cwd.Cell;
- } else {
- fprintf(stderr, "flushfid fid\n");
- return 0;
- }
-
- fcache_stale_entry(fid, broken_callback);
-
- return 0;
-}
-
-
-static int
-arla_chdir (int argc, char **argv)
-{
- if (argc != 2) {
- printf ("usage: %s dir\n", argv[0]);
- return 0;
- }
-
- if(cm_walk (cwd, argv[1], &cwd))
- printf ("walk %s failed\n", argv[1]);
- return 0;
-}
-
-static int
-print_dir (VenusFid *fid, const char *name, void *v)
-{
- printf("(%d, %d, %d, %d): %s\n", fid->Cell,
- fid->fid.Volume,
- fid->fid.Vnode,
- fid->fid.Unique, name);
- return 0;
-}
-
-struct ls_context {
- VenusFid *dir_fid;
- CredCacheEntry *ce;
-};
-
-static int
-print_dir_long (VenusFid *fid, const char *name, void *v)
-{
- int ret;
- AccessEntry *ae;
- struct ls_context *context = (struct ls_context *)v;
- char type;
- CredCacheEntry *ce = context->ce;
- FCacheEntry *entry;
- VenusFid *dir_fid = context->dir_fid;
- char timestr[20];
- struct tm *t;
- time_t ti;
-
- if (VenusFid_cmp(fid, dir_fid) == 0)
- return 0;
-
- ret = followmountpoint (fid, dir_fid, NULL, &ce);
- if (ret) {
- printf ("follow %s: %d\n", name, ret);
- return 0;
- }
-
- /* Have we follow a mountpoint to ourself ? */
- if (VenusFid_cmp(fid, dir_fid) == 0)
- return 0;
-
- ret = fcache_get(&entry, *fid, context->ce);
- if (ret) {
- printf("%s: %d\n", name, ret);
- return 0;
- }
-
- ret = cm_getattr (entry, context->ce, &ae);
- if (ret) {
- fcache_release(entry);
- printf ("%s: %d\n", name, ret);
- return 0;
- }
-
- switch (entry->status.FileType) {
- case TYPE_FILE :
- type = '-';
- break;
- case TYPE_DIR :
- type = 'd';
- break;
- case TYPE_LINK :
- type = 'l';
- break;
- default :
- abort ();
- }
-
- printf("(%4d, %8d, %8d, %8d): ",
- fid->Cell,
- fid->fid.Volume,
- fid->fid.Vnode,
- fid->fid.Unique);
-
- ti = entry->status.ClientModTime;
- t = localtime (&ti);
- strftime (timestr, sizeof(timestr), "%Y-%m-%d", t);
- printf ("%c%c%c%c%c%c%c%c%c%c %2d %6d %6d %8d %s ",
- type,
- entry->status.UnixModeBits & 0x100 ? 'r' : '-',
- entry->status.UnixModeBits & 0x080 ? 'w' : '-',
- entry->status.UnixModeBits & 0x040 ? 'x' : '-',
- entry->status.UnixModeBits & 0x020 ? 'r' : '-',
- entry->status.UnixModeBits & 0x010 ? 'w' : '-',
- entry->status.UnixModeBits & 0x008 ? 'x' : '-',
- entry->status.UnixModeBits & 0x004 ? 'r' : '-',
- entry->status.UnixModeBits & 0x002 ? 'w' : '-',
- entry->status.UnixModeBits & 0x001 ? 'x' : '-',
- entry->status.LinkCount,
- entry->status.Owner,
- entry->status.Group,
- entry->status.Length,
- timestr);
-
- printf ("v %d ", entry->status.DataVersion);
-
- printf ("%s\n", name);
- fcache_release(entry);
- return 0;
-}
-
-static int
-arla_ls (int argc, char **argv)
-{
- struct getargs args[] = {
- {NULL, 'l', arg_flag, NULL},
- };
- int l_flag = 0;
- int error;
- int optind = 0;
- struct ls_context context;
- FCacheEntry *entry;
-
- args[0].value = &l_flag;
-
- if (getarg (args, sizeof(args)/sizeof(*args), argc, argv, &optind)) {
- arg_printusage (args, sizeof(args)/sizeof(*args), "ls", NULL);
- return 0;
- }
- context.dir_fid = &cwd;
- context.ce = ce;
- error = fcache_get(&entry, cwd, ce);
- if (error) {
- printf ("fcache_get failed: %s\n", koerr_gettext(error));
- return 0;
- }
-
- error = adir_readdir (&entry, l_flag ? print_dir_long : print_dir,
- &context, &ce);
- fcache_release(entry);
- if (error) {
- printf ("adir_readdir failed: %s\n", koerr_gettext(error));
- return 0;
- }
- cwd = entry->fid;
- return 0;
-}
-
-static int
-arla_sysname (int argc, char **argv)
-{
- switch (argc) {
- case 1:
- printf("sysname: %s\n", fcache_getdefsysname());
- break;
- case 2:
- fcache_setdefsysname(argv[1]);
- printf("setting sysname to: %s\n", fcache_getdefsysname());
- break;
- default:
- printf("syntax: sysname <sysname>\n");
- break;
- }
- return 0;
-}
-
-static int
-arla_mkdir (int argc, char **argv)
-{
- VenusFid fid;
- int ret;
- FCacheEntry *e;
- char *dirname;
- char *basename;
- AFSStoreStatus store_attr;
- VenusFid res;
- AFSFetchStatus fetch_attr;
-
- if (argc != 2) {
- printf ("usage: %s file\n", argv[0]);
- return 0;
- }
- dirname = strdup(argv[1]);
- if (dirname == NULL)
- err(1, "strdup");
- basename = strrchr(dirname, '/');
- if (basename == NULL) {
- printf ("%s: filename contains no /\n", argv[0]);
- free(dirname);
- return 0;
- }
- basename[0] = '\0';
- basename++;
-
- if(cm_walk (cwd, dirname, &fid) == 0) {
-
- ret = fcache_get(&e, fid, ce);
- if (ret) {
- printf ("fcache_get failed: %d\n", ret);
- free(dirname);
- return 0;
- }
-
- store_attr.Mask = 0;
- store_attr.ClientModTime = 0;
- store_attr.Owner = 0;
- store_attr.Group = 0;
- store_attr.UnixModeBits = 0;
- store_attr.SegSize = 0;
- ret = cm_mkdir(&e, basename, &store_attr, &res, &fetch_attr, &ce);
- if (ret) {
- arla_warn (ADEBWARN, ret,
- "%s: cannot create directory `%s'",
- argv[0], argv[1]);
- fcache_release(e);
- free(dirname);
- return 1;
- }
-
- fcache_release(e);
- }
- free(dirname);
- return 0;
-}
-
-static int
-arla_rmdir (int argc, char **argv)
-{
- VenusFid fid;
- int ret;
- FCacheEntry *e;
- char *dirname;
- char *basename;
-
- if (argc != 2) {
- printf ("usage: %s file\n", argv[0]);
- return 0;
- }
- dirname = strdup(argv[1]);
- if (dirname == NULL)
- err(1, "strdup");
- basename = strrchr(dirname, '/');
- if (basename == NULL) {
- printf ("%s: filename contains no /\n", argv[0]);
- free(dirname);
- return 0;
- }
- basename[0] = '\0';
- basename++;
-
- if(cm_walk (cwd, dirname, &fid) == 0) {
-
- ret = fcache_get(&e, fid, ce);
- if (ret) {
- printf ("fcache_get failed: %d\n", ret);
- free(dirname);
- return 0;
- }
-
- ret = cm_rmdir(&e, basename, &ce);
- if (ret) {
- arla_warn (ADEBWARN, ret,
- "%s: cannot remove directory `%s'",
- argv[0], argv[1]);
- fcache_release(e);
- free(dirname);
- return 1;
- }
-
- fcache_release(e);
- }
- free(dirname);
- return 0;
-}
-
-static int
-arla_rm (int argc, char **argv)
-{
- VenusFid fid;
- int ret;
- FCacheEntry *e;
- char *dirname;
- char *basename;
-
- if (argc != 2) {
- printf ("usage: %s file\n", argv[0]);
- return 0;
- }
- dirname = copy_dirname(argv[1]);
- if (dirname == NULL)
- err(1, "copy_dirname");
- basename = copy_basename(argv[1]);
- if (basename == NULL)
- err(1, "copy_basename");
-
- if(cm_walk (cwd, dirname, &fid) == 0) {
-
- ret = fcache_get(&e, fid, ce);
- if (ret) {
- printf ("fcache_get failed: %d\n", ret);
- free(dirname);
- free(basename);
- return 0;
- }
-
- ret = cm_remove(&e, basename, &ce);
- if (ret) {
- arla_warn (ADEBWARN, ret,
- "%s: cannot remove file `%s'",
- argv[0], argv[1]);
- fcache_release(e);
- free(dirname);
- free(basename);
- return 1;
- }
-
- fcache_release(e);
- }
- free(dirname);
- free(basename);
- return 0;
-}
-
-static int
-arla_put (int argc, char **argv)
-{
- VenusFid dirfid;
- VenusFid fid;
- int ret;
- FCacheEntry *e;
- char *localname;
- char *localbasename;
- char *afsname;
- char *afsbasename;
- char *afsdirname;
- AFSStoreStatus store_attr;
- AFSFetchStatus fetch_attr;
- int afs_fd;
- int local_fd;
- char buf[8192];
- int write_ret;
- CredCacheEntry *ce;
-
- if (argc != 2 && argc != 3) {
- printf ("usage: %s localfile [afsfile]\n", argv[0]);
- return 0;
- }
-
- localname = argv[1];
-
- localbasename = copy_basename(localname);
- if (localbasename == NULL)
- err(1, "copy_basename");
-
- if (argc == 3) {
- afsname = argv[2];
- } else {
- afsname = localbasename;
- }
-
- afsdirname = copy_dirname(afsname);
- if (afsdirname == NULL)
- err(1, "copy_dirname");
- afsbasename = copy_basename(afsname);
- if (afsbasename == NULL)
- err(1, "copy_basename");
-
-
- printf("localbasename: *%s* afsname: *%s* afsdirname: *%s* afsbasename: *%s*\n",
- localbasename, afsname, afsdirname, afsbasename);
-
- local_fd = open (localname, O_RDONLY, 0);
-
- if (local_fd < 0) {
- printf ("open %s: %s\n", localname, strerror(errno));
- ret = 0;
- goto out;
- }
-
- if(cm_walk (cwd, afsdirname, &dirfid))
- goto out;
-
- ce = cred_get (dirfid.Cell, getuid(), CRED_ANY);
-
- ret = fcache_get(&e, dirfid, ce);
- if (ret) {
- printf ("fcache_get failed: %d\n", ret);
- ret = 1;
- goto out;
- }
-
- memset(&store_attr, 0, sizeof(store_attr));
-
- ret = cm_create(&e, afsbasename, &store_attr, &fid, &fetch_attr, &ce);
- if (ret) {
- if (ret != EEXIST) {
- arla_warn (ADEBWARN, ret,
- "%s: cannot create file `%s'",
- argv[0], afsname);
- fcache_release(e);
- ret = 1;
- goto out;
- } else {
- ret = cm_lookup (&e, afsbasename, &fid, &ce, 1);
- if (ret) {
- arla_warn (ADEBWARN, ret,
- "%s: cannot open file `%s'",
- argv[0], afsname);
- fcache_release(e);
- ret = 1;
- goto out;
- }
- }
- }
-
- fcache_release(e);
-
- ret = fcache_get(&e, fid, ce);
- if (ret) {
- printf ("fcache_get failed: %d\n", ret);
- ret = 1;
- goto out;
- }
-
- ret = fcache_get_data (&e, &ce, 0);
- if (ret) {
- fcache_release(e);
- printf ("fcache_get_data failed: %d\n", ret);
- ret = 1;
- goto out;
- }
-
- afs_fd = fcache_open_file (e, O_WRONLY);
-
- if (afs_fd < 0) {
- fcache_release(e);
- printf ("fcache_open_file failed: %d\n", errno);
- ret = 0;
- goto out;
- }
-
- ret = ftruncate(afs_fd, 0);
- if (ret) {
- fcache_release(e);
- printf ("ftruncate failed: %d\n", errno);
- }
-
- while ((ret = read (local_fd, buf, sizeof(buf))) > 0) {
- write_ret = write (afs_fd, buf, ret);
- if (write_ret < 0) {
- printf("write failed: %d\n", errno);
- ret = 1;
- goto out;
- } else if (write_ret != ret) {
- printf("short write: %d should be %d\n", write_ret, ret);
- ret = 1;
- goto out;
- }
- }
-
- close(afs_fd);
- close(local_fd);
-
- memset(&store_attr, 0, sizeof(store_attr));
-
- ret = cm_close (e, NNPFS_WRITE, &store_attr, ce);
- if (ret) {
- arla_warn (ADEBWARN, ret,
- "%s: cannot close file `%s'",
- argv[0], afsname);
- fcache_release(e);
- ret = 1;
- goto out;
- }
-
- fcache_release(e);
-
- out:
- free(localbasename);
- free(afsdirname);
- free(afsbasename);
- return 0;
-}
-
-static int
-arla_get (int argc, char **argv)
-{
- return 0;
-}
-
-static int
-arla_cat_et_wc (int argc, char **argv, int do_cat, int out_fd)
-{
- VenusFid fid;
- int fd;
- char buf[8192];
- int ret;
- FCacheEntry *e;
- size_t size = 0;
-
- if (argc != 2) {
- printf ("usage: %s file\n", argv[0]);
- return 0;
- }
- if(cm_walk (cwd, argv[1], &fid) == 0) {
-
- ret = fcache_get(&e, fid, ce);
- if (ret) {
- printf ("fcache_get failed: %d\n", ret);
- return 0;
- }
-
- ret = fcache_get_data (&e, &ce, 0);
- if (ret) {
- fcache_release(e);
- printf ("fcache_get_data failed: %d\n", ret);
- return 0;
- }
-
- fd = fcache_open_file (e, O_RDONLY);
-
- if (fd < 0) {
- fcache_release(e);
- printf ("fcache_open_file failed: %d\n", errno);
- return 0;
- }
- while ((ret = read (fd, buf, sizeof(buf))) > 0) {
- if(do_cat)
- write (out_fd, buf, ret);
- else
- size += ret;
- }
- if(!do_cat)
- printf("%lu %s\n", (unsigned long)size, argv[1]);
- close (fd);
- fcache_release(e);
- }
- return 0;
-}
-
-static int
-arla_cat (int argc, char **argv)
-{
- return arla_cat_et_wc(argc, argv, 1, STDOUT_FILENO);
-}
-
-static int
-arla_cp (int argc, char **argv)
-{
- char *nargv[3];
- int fd, ret;
-
- if (argc != 3) {
- printf ("usage: %s from-file to-file\n", argv[0]);
- return 0;
- }
-
- fd = open (argv[2], O_CREAT|O_WRONLY|O_TRUNC, 0600);
- if (fd < 0) {
- warn ("open");
- return 0;
- }
-
- nargv[0] = argv[0];
- nargv[1] = argv[1];
- nargv[2] = NULL;
-
- ret = arla_cat_et_wc(argc-1, nargv, 1, fd);
- close (fd);
- return ret;
-
-}
-
-static int
-arla_sleep(int argc, char **argv)
-{
- struct timeval tv;
-
- if (argc != 2) {
- printf ("usage: %s <time>\n", argv[0]);
- return 0;
- }
-
- tv.tv_sec = atoi(argv[1]);
- tv.tv_usec = 0;
- IOMGR_Select(0, NULL, NULL, NULL, &tv);
-
- return 0;
-}
-
-static int
-arla_wc (int argc, char **argv)
-{
- return arla_cat_et_wc(argc, argv, 0, -1);
-}
-
-
-static int
-help (int argc, char **argv)
-{
- sl_help(cmds, argc, argv);
- return 0;
-}
-
-static int
-arla_checkserver (int argc, char **argv)
-{
- uint32_t hosts[12];
- int num = sizeof(hosts)/sizeof(hosts[0]);
-
- conn_downhosts(cwd.Cell, hosts, &num, 0);
- if (num < 0 || num > sizeof(hosts)/sizeof(hosts[0])) {
- fprintf (stderr, "conn_downhosts returned bogus num: %d\n", num);
- return 0;
- }
- if (num == 0) {
- printf ("no servers down in %s\n", cell_num2name(cwd.Cell));
- } else {
- while (num) {
- struct in_addr in;
- in.s_addr = hosts[num];
- printf ("down: %s\n", inet_ntoa(in));
- num--;
- }
- }
-
- return 0;
-}
-
-static int
-arla_conn_status (int argc, char **argv)
-{
- conn_status ();
- return 0;
-}
-
-static int
-arla_vol_status (int argc, char **argv)
-{
- volcache_status ();
- return 0;
-}
-
-static int
-arla_cred_status (int argc, char **argv)
-{
- cred_status ();
- return 0;
-}
-
-static int
-arla_fcache_status (int argc, char **argv)
-{
- fcache_status ();
- return 0;
-}
-
-static int
-arla_cell_status (int argc, char **argv)
-{
- cell_entry *c;
-
- if (argc != 2) {
- printf ("usage: %s <cell-name>\n", argv[0]);
- return 0;
- }
- c = cell_get_by_name(argv[1]);
- if (c == NULL)
- printf ("no such cell\n");
- else
- cell_print_cell (c, stdout);
- return 0;
-}
-
-#ifdef RXDEBUG
-static int
-arla_rx_status(int argc, char **argv)
-{
- rx_PrintStats(stderr);
- return 0;
-}
-#endif
-
-
-#ifdef HAVE_KRB4
-
-static int
-get_cred(const char *princ, const char *inst, const char *krealm,
- CREDENTIALS *c)
-{
- KTEXT_ST foo;
- int k_errno;
-
- k_errno = krb_get_cred((char*)princ, (char*)inst, (char*)krealm, c);
-
- if(k_errno != KSUCCESS) {
- k_errno = krb_mk_req(&foo, (char*)princ, (char*)inst, (char*)krealm, 0);
- if (k_errno == KSUCCESS)
- k_errno = krb_get_cred((char*)princ, (char*)inst, (char*)krealm, c);
- }
- return k_errno;
-}
-
-#endif /* HAVE_KRB4 */
-
-
-static void
-arla_start (char *device_file, const char *cache_dir, int argc, char **argv)
-{
- CredCacheEntry *ce;
- int error;
-
-#ifdef HAVE_KRB4
- {
- struct cred_rxkad cred;
- CREDENTIALS c;
- int ret;
- char *realm;
- const char *this_cell = cell_getthiscell ();
- const char *db_server = cell_findnamedbbyname (this_cell);
-
- if (db_server == NULL)
- arla_errx (1, ADEBERROR,
- "no db server for cell %s", this_cell);
- realm = krb_realmofhost (db_server);
-
- ret = get_cred("afs", this_cell, realm, &c);
- if (ret)
- ret = get_cred("afs", "", realm, &c);
-
- if (ret) {
- arla_warnx (ADEBWARN,
- "getting ticket for %s: %s",
- this_cell,
- krb_get_err_text (ret));
- return;
- }
-
- memset(&cred, 0, sizeof(cred));
-
- memcpy(&cred.ct.HandShakeKey, c.session, sizeof(cred.ct.AuthHandle));
- cred.ct.AuthHandle = c.kvno;
- cred.ct.ViceId = getuid();
- cred.ct.BeginTimestamp = c.issue_date + 1;
- cred.ct.EndTimestamp = krb_life_to_time(c.issue_date, c.lifetime);
-
- cred.ticket_len = c.ticket_st.length;
- if (cred.ticket_len > sizeof(cred.ticket))
- arla_errx (1, ADEBERROR, "ticket too large");
- memcpy(cred.ticket, c.ticket_st.dat, cred.ticket_len);
-
- cred_add (getuid(), CRED_KRB4, 2, cell_name2num(cell_getthiscell()),
- 2, &cred, sizeof(cred), getuid());
-
- }
-#endif /* HAVE_KRB4 */
-
- ce = cred_get (cell_name2num(cell_getthiscell()), getuid(), CRED_ANY);
-
- assert (ce != NULL);
-
- nnpfs_message_init ();
- kernel_opendevice ("null");
-
- arla_warnx (ADEBINIT, "Getting root...");
- error = getroot (&rootcwd, ce);
- if (error)
- arla_err (1, ADEBERROR, error, "getroot");
- cwd = rootcwd;
- arla_warnx(ADEBINIT, "arla loop started");
- error = 0;
- if (argc > 0) {
- error = sl_command(cmds, argc, argv);
- if (error == -1)
- errx(1, "%s: Unknown command", argv[0]);
- } else {
- sl_loop(cmds, "arla> ");
- }
- store_state();
- fcache_giveup_all_callbacks();
- if (error)
- exit(1);
-}
-
-char *
-get_default_cache_dir (void)
-{
- static char cache_path[MAXPATHLEN];
- char *home;
-
- home = getenv("HOME");
- if (home == NULL)
- home = "/var/tmp";
-
- snprintf (cache_path, sizeof(cache_path), "%s/.arla-cache",
- home);
- return cache_path;
-}
-
-static struct getargs args[] = {
- {"conffile", 'c', arg_string, &conf_file,
- "path to configuration file", "file"},
- {"check-consistency", 'C', arg_flag, &cm_consistency,
- "if we want extra paranoid consistency checks", NULL },
- {"log", 'l', arg_string, &log_file,
- "where to write log (stderr (default), syslog, or path to file)", NULL},
- {"debug", 0, arg_string, &debug_levels,
- "what to write in the log", NULL},
- {"connected-mode", 0, arg_string, &connected_mode_string,
- "initial connected mode [conncted|fetch-only|disconnected]", NULL},
- {"dynroot", 'D', arg_flag, &dynroot_enable,
- "if dynroot is enabled", NULL},
-#ifdef KERBEROS
- {"rxkad-level", 'r', arg_string, &rxkad_level_string,
- "the rxkad level to use (clear, auth or crypt)", NULL},
-#endif
- {"sysname", 's', arg_string, &argv_sysname,
- "set the sysname of this system", NULL},
- {"root-volume",0, arg_string, &root_volume},
- {"port", 0, arg_integer, &client_port,
- "port number to use", "number"},
- {"recover", 'z', arg_negative_flag, &recover,
- "don't recover state", NULL},
- {"cache-dir", 0, arg_string, &cache_dir,
- "cache directory", "directory"},
- {"workers", 0, arg_integer, &num_workers,
- "number of worker threads", NULL},
- {"fake-mp", 0, arg_flag, &fake_mp,
- "enable fake mountpoints", NULL},
- {"version", 0, arg_flag, &version_flag,
- NULL, NULL},
- {"help", 0, arg_flag, &help_flag,
- NULL, NULL}
-};
-
-static void
-usage (int ret)
-{
- arg_printusage (args, sizeof(args)/sizeof(*args), NULL, "[command]");
- exit (ret);
-}
-
-int
-main (int argc, char **argv)
-{
- int optind = 0;
- int ret;
-
- set_progname (argv[0]);
- tzset();
- srand(time(NULL));
-
- if (getarg (args, sizeof(args)/sizeof(*args), argc, argv, &optind))
- usage (1);
-
- argc -= optind;
- argv += optind;
-
- if (help_flag)
- usage (0);
-
- if (version_flag) {
- print_version (NULL);
- exit (0);
- }
-
- default_log_file = "/dev/stderr";
-
- ret = arla_init();
- if (ret)
- return ret;
-
- {
- struct timeval tv = { 0, 10000} ;
- IOMGR_Select(0, NULL, NULL, NULL, &tv);
- }
-
- arla_start (NULL, cache_dir, argc, argv);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/arlad/arla.c b/usr.sbin/afs/src/arlad/arla.c
deleted file mode 100644
index 24886e791ec..00000000000
--- a/usr.sbin/afs/src/arlad/arla.c
+++ /dev/null
@@ -1,474 +0,0 @@
-/*
- * Copyright (c) 1995 - 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Test to talk with FS
- */
-
-#include "arla_local.h"
-#include <parse_units.h>
-#include <getarg.h>
-
-RCSID("$arla: arla.c,v 1.163 2003/06/10 16:25:07 lha Exp $") ;
-
-enum connected_mode connected_mode = CONNECTED;
-
-static void
-initrx (int port)
-{
- int error;
-
- if (port == 0)
- port = afscallbackport;
-
- error = rx_Init (htons(port));
- if (error)
- arla_err (1, ADEBERROR, error, "rx_init");
-}
-
-
-void
-store_state (void)
-{
- arla_warnx (ADEBMISC, "storing state");
- fcache_store_state ();
- volcache_store_state ();
- cm_store_state ();
-}
-
-typedef enum { CONF_PARAM_INT,
- CONF_PARAM_STR,
- CONF_PARAM_BOOL,
- CONF_PARAM_INT64
-} conf_type;
-
-struct conf_param {
- const char *name;
- conf_type type;
- void *val;
-};
-
-/*
- * Reads in a configuration file, and sets some defaults.
- */
-
-static struct units size_units[] = {
- { "G", 1024 * 1024 * 1024 },
- { "M", 1024 * 1024 },
- { "k", 1024 },
- { NULL, 0 }
-};
-
-static void
-read_conffile(const char *fname,
- struct conf_param *params)
-{
- FILE *fp;
- char buf[256];
- int lineno;
- struct conf_param *p;
-
- arla_warnx (ADEBINIT, "read_conffile: %s", fname);
-
- fp = fopen(fname, "r");
- if (fp == NULL) {
- arla_warn (ADEBINIT, errno, "open %s", fname);
- return;
- }
-
- lineno = 0;
-
- while (fgets (buf, sizeof(buf), fp) != NULL) {
- struct conf_param *partial_param = NULL;
- int partial_match = 0;
- char *save = NULL;
- char *n;
- char *v;
- int64_t val;
- char *endptr;
-
- ++lineno;
- buf[strcspn(buf, "\n")] = '\0';
- if (buf[0] == '\0' || buf[0] == '#')
- continue;
-
- n = strtok_r (buf, " \t", &save);
- if (n == NULL) {
- fprintf (stderr, "%s:%d: no parameter?\n", fname, lineno);
- continue;
- }
-
- v = strtok_r (NULL, " \t", &save);
- if (v == NULL) {
- fprintf (stderr, "%s:%d: no value?\n", fname, lineno);
- continue;
- }
-
-
- for (p = params; p->name; ++p) {
- if (strcmp(n, p->name) == 0) {
- partial_match = 1;
- partial_param = p;
- break;
- } else if(strncmp(n, p->name, strlen(n)) == 0) {
- ++partial_match;
- partial_param = p;
- }
- }
- if (partial_match == 0) {
- fprintf (stderr, "%s:%d: unknown parameter `%s'\n",
- fname, lineno, n);
- continue;
- } else if (partial_match != 1) {
- fprintf (stderr, "%s:%d: ambiguous parameter `%s'\n",
- fname, lineno, n);
- continue;
- }
-
- p = partial_param;
-
- switch (p->type) {
- case CONF_PARAM_INT:
- case CONF_PARAM_INT64:
-
- val = parse_units(v, size_units, NULL);
- if(val == -1 || val < 0) {
-#ifdef HAVE_STRTOLL
- val = strtoll(v, &endptr, 0);
-#else
- val = strtol(v, &endptr, 0);
-#endif
- if (*endptr != '\0')
- fprintf (stderr, "%s:%d: bad value `%s'\n",
- fname, lineno, v);
- }
-
- if (p->type == CONF_PARAM_INT)
- *((unsigned *)partial_param->val) = val;
- else if (p->type == CONF_PARAM_INT64)
- *((int64_t *)partial_param->val) = val;
- else
- errx(-1, "Unknown conf_param p->type");
- break;
-
- case CONF_PARAM_STR:
-
- *((char **)partial_param->val) = strdup(v);
-
- break;
-
- case CONF_PARAM_BOOL:
-
- if (strcasecmp(v, "yes") == 0 || strcasecmp(v, "true") == 0)
- *((unsigned *)partial_param->val) = 1;
- else if (strcasecmp(v, "no") == 0 || strcasecmp(v, "false") == 0)
- *((unsigned *)partial_param->val) = 0;
- else
- fprintf (stderr, "%s:%d: bad boolean value `%s'\n",
- fname, lineno, v);
- break;
- default:
- errx(-1, "read_conffile: Unknown type");
- }
- }
- fclose(fp);
-}
-
-#ifdef HAVE_KRB4
-#ifndef HAVE_KRB_GET_ERR_TEXT
-
-#ifndef MAX_KRB_ERRORS
-#define MAX_KRB_ERRORS 256
-#endif
-
-static const char err_failure[] = "Unknown error code passed (krb_get_err_text)";
-
-const char *
-krb_get_err_text(int code)
-{
- if(code < 0 || code >= MAX_KRB_ERRORS)
- return err_failure;
- return krb_err_txt[code];
-}
-
-#endif
-#endif
-
-static unsigned low_vnodes = ARLA_LOW_VNODES;
-static unsigned high_vnodes = ARLA_HIGH_VNODES;
-static int64_t low_bytes = ARLA_LOW_BYTES;
-static int64_t high_bytes = ARLA_HIGH_BYTES;
-static unsigned numcreds = ARLA_NUMCREDS;
-static unsigned numconns = ARLA_NUMCONNS;
-static unsigned numvols = ARLA_NUMVOLS;
-static unsigned dynrootlevel = DYNROOT_DEFAULT;
-static char *conf_sysname = NULL; /* sysname from conf file */
-const char *argv_sysname = NULL; /* sysname from argv */
-#ifdef KERBEROS
-const char *rxkad_level_string = "crypt";
-#endif
-
-static struct conf_param conf_params[] = {
- {"dynroot", CONF_PARAM_BOOL, &dynrootlevel},
- {"fake_stat", CONF_PARAM_BOOL, &fake_stat},
- {"fetch_block", CONF_PARAM_INT, &fetch_block_size},
- {"low_vnodes", CONF_PARAM_INT, &low_vnodes},
- {"high_vnodes", CONF_PARAM_INT, &high_vnodes},
- {"low_bytes", CONF_PARAM_INT64, &low_bytes},
- {"high_bytes", CONF_PARAM_INT64, &high_bytes},
- {"numcreds", CONF_PARAM_INT, &numcreds},
- {"numconns", CONF_PARAM_INT, &numconns},
- {"numvols", CONF_PARAM_INT, &numvols},
- {"sysname", CONF_PARAM_STR, &conf_sysname},
-#ifdef KERBEROS
- {"rxkad-level", CONF_PARAM_STR, &rxkad_level_string},
-#endif
- { NULL }
-};
-
-const char *conf_file = ARLACONFFILE;
-char *log_file = NULL;
-char *debug_levels = NULL;
-char *connected_mode_string = NULL;
-char *root_volume;
-int cpu_usage;
-int version_flag;
-int help_flag;
-int recover = 0;
-int dynroot_enable = 0;
-int cm_consistency = 0;
-int fake_stat = 0;
-
-/*
- * These are exported to other modules
- */
-
-int num_workers = 16;
-char *cache_dir;
-struct passwd *pw;
-int fake_mp;
-int fork_flag = 1;
-
-/*
- * Global AFS variables, se arla_local.h for comment
- */
-
-int afs_BusyWaitPeriod = 15;
-
-/*
- *
- */
-
-static int
-parse_string_list (const char *s, const char **units)
-{
- const char **p;
- int partial_val = 0;
- int partial_match = 0;
-
- for (p = units; *p; ++p) {
- if (strcmp (s, *p) == 0)
- return p - units;
- if (strncmp (s, *p, strlen(s)) == 0) {
- partial_match++;
- partial_val = p - units;
- }
- }
- if (partial_match == 1)
- return partial_val;
- else
- return -1;
-}
-
-#ifdef KERBEROS
-static const char *rxkad_level_units[] = {
-"clear", /* 0 */
-"auth", /* 1 */
-"crypt", /* 2 */
-NULL
-};
-
-static int
-parse_rxkad_level (const char *s)
-{
- return parse_string_list (s, rxkad_level_units);
-}
-#endif
-
-static const char *connected_levels[] = {
-"connected", /* CONNECTED = 0 */
-"fetch-only", /* FETCH_ONLY = 1 */
-"disconnected", /* DISCONNCTED = 2 */
-NULL
-};
-
-static int
-set_connected_mode (const char *s)
-{
- return parse_string_list (s, connected_levels);
-}
-
-/*
- *
- */
-
-int
-arla_init (void)
-{
- log_flags log_flags;
- char fpriofile[MAXPATHLEN];
- const char *temp_sysname;
-
- if (log_file == NULL)
- log_file = default_log_file;
-
- if (strcmp(log_file, "syslog") == 0)
- log_file = "syslog:no-delay";
-
- log_flags = 0;
- if (cpu_usage)
- log_flags |= LOG_CPU_USAGE;
- arla_loginit(log_file, log_flags);
-
- if (debug_levels != NULL) {
- if (arla_log_set_level (debug_levels) < 0) {
- warnx ("bad debug levels: `%s'", debug_levels);
- arla_log_print_levels (stderr);
- exit (1);
- }
- }
-
- if (connected_mode_string != NULL) {
- int tmp = set_connected_mode (connected_mode_string);
-
- if (tmp < 0)
- errx (1, "bad connected mode: `%s'", connected_mode_string);
- connected_mode = tmp;
- }
-
- read_conffile(conf_file, conf_params);
-
-#ifdef KERBEROS
- conn_rxkad_level = parse_rxkad_level (rxkad_level_string);
- if (conn_rxkad_level < 0)
- errx (1, "bad rxkad level `%s'", rxkad_level_string);
-#endif
- pw = getpwnam("_afs");
- if (pw == NULL)
- errx (1, "Unable to find user '_afs'");
-
- if (cache_dir == NULL)
- cache_dir = get_default_cache_dir();
-
- if (mkdir (cache_dir, 0777) < 0 && errno != EEXIST)
- arla_err (1, ADEBERROR, errno, "mkdir %s", cache_dir);
- if (pw && chown(cache_dir, pw->pw_uid, pw->pw_gid) == -1)
- arla_err (1, ADEBERROR, errno, "chown %s", cache_dir);
- if (chdir (cache_dir) < 0)
- arla_err (1, ADEBERROR, errno, "chdir %s", cache_dir);
-
-
- if (argv_sysname)
- temp_sysname = argv_sysname;
- else if (conf_sysname)
- temp_sysname = conf_sysname;
- else
- temp_sysname = arla_getsysname ();
-
- if (temp_sysname != NULL)
- fcache_setdefsysname(temp_sysname);
-
- if (dynrootlevel || dynroot_enable)
- dynroot_setenable (TRUE);
-
- snprintf(fpriofile, sizeof(fpriofile), "%s/%s", cache_dir, "fprio");
-
- /*
- * Init
- */
-
- arla_warnx (ADEBINIT,"Arlad booting sequence:");
- arla_warnx (ADEBINIT, "connected mode: %s",
- connected_levels[connected_mode]);
- arla_warnx (ADEBINIT, "ports_init");
- ports_init ();
- arla_warnx (ADEBINIT, "uae_init");
- uae_init ();
- arla_warnx (ADEBINIT, "rx");
- initrx (client_port);
- arla_warnx (ADEBINIT, "conn_init numconns = %u", numconns);
- conn_init (numconns);
- arla_warnx (ADEBINIT, "cellcache");
- cell_init (0, arla_log_method);
- arla_warnx (ADEBINIT, "poller");
- poller_init();
- arla_warnx (ADEBINIT, "fprio");
- fprio_init(fpriofile);
- arla_warnx (ADEBINIT, "volcache numvols = %u", numvols);
- volcache_init (numvols, recover);
- if (root_volume != NULL)
- volcache_set_rootvolume (root_volume);
-#ifdef KERBEROS
- arla_warnx (ADEBINIT, "using rxkad level %s",
- rxkad_level_units[conn_rxkad_level]);
-#endif
-
- /*
- * Credential cache
- */
- arla_warnx (ADEBINIT, "credcache numcreds = %u", numcreds);
- cred_init (numcreds);
-
- arla_warnx (ADEBINIT,
- "fcache low_vnodes = %u, high_vnodes = %u"
- "low_bytes = %ld, high_bytes = %ld",
- low_vnodes, high_vnodes,
- (long)low_bytes, (long)high_bytes);
- fcache_init (low_vnodes, high_vnodes,
- low_bytes, high_bytes, recover);
-
- arla_warnx (ADEBINIT, "cmcb");
- cmcb_init ();
-
- arla_warnx(ADEBINIT, "cm");
- cm_init ();
-
- if (cm_consistency) {
- arla_warnx(ADEBINIT, "turning on consistency test");
- cm_turn_on_consistency_check();
- }
-
- arla_warnx(ADEBINIT, "arla init done.");
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/arlad/arla.conf.5 b/usr.sbin/afs/src/arlad/arla.conf.5
deleted file mode 100644
index 8aaf3cd61da..00000000000
--- a/usr.sbin/afs/src/arlad/arla.conf.5
+++ /dev/null
@@ -1,105 +0,0 @@
-.\" Copyright (c) 2000 - 2003 Kungliga Tekniska Högskolan
-.\" $arla: arla.conf.5,v 1.16 2003/06/06 12:53:55 hin Exp $
-.Dd September 09, 2000
-.Dt AFSD.CONF 5
-.Os "The Arla Project"
-.Sh NAME
-.Nm afsd.conf
-.Nd
-configuration file for the arla AFS implementation.
-.Sh SYNOPSIS
-The default configuration file works very well in most cases.
-.Sh DESCRIPTION
-Most flags can be overridden by command line arguments to
-.Nm afsd .
-.Pp
-Each option can be of the type integer, string or boolean.
-.Pp
-Integer values can be written with suffix
-.Sq K
-(kilo, 1000),
-.Sq M
-(mega, 10000000)
-and
-.Sq G
-(giga, 10000000000) .
-.Pp
-Strings are written without quotes or spaces in the strings.
-.Pp
-Boolean values can be either of
-.Ar yes ,
-.Ar true ,
-.Ar no ,
-or
-.Ar false .
-.Pp
-Supported options:
-.Bl -tag -width Ds
-.It dynroot
-Boolean value. Dynamic root, generates your
-.Pa /afs
-directory from
-.Pa CellServDB or
-.Pa DynRootDB .
-Useful when you don't want to use your cell's root.afs.
-.It fake_stat
-Boolean value.
-If set, do not fetch real stat information where it can be expensive
-(i e across mountpoints), but make up some reasonable values.
-.It fetch_block
-Integer value.
-Determines the fetch/pre-fetch block size.
-This option will later be replaced by code to automagically tune this
-setting.
-.It low_vnodes
-Integer value.
-The number of used vnodes we try to keep in the cache. Any higher
-number of used nodes will trigger the cleaner thread.
-.It high_bytes
-Integer value.
-The high watermark for files used by arlad.
-.It low_bytes
-Integer value.
-The number of bytes we try to keep in the cache.
-Any higher number of bytes will trigger the cleaner thread.
-.It numcreds
-Integer value.
-The maximum number of credentials kept in arla, both authenticated
-(like Kerberos V4 creds), and not.
-.It numconns
-Integer value.
-The maximum total number of connections arla will keep to servers
-(fileserver and vldb-server).
-.It numvols
-Integer value.
-The number of volumes stored in cache.
-.It sysname
-String value.
-The sysname is possible to specify in the configuration file. It's
-overridden by the command line argument
-.Ar --sysname=sysname
-to arlad.
-.It rxkad-level
-It can be one of:
-.Ar clear ,
-.Ar auth ,
-or
-.Ar crypt .
-It's the same as the command line argument.
-.It high_vnodes
-Integer value.
-The upper limit of arlad's vnodes (think files and directories).
-.El
-.Sh BUGS
-The parser that reads numbers doesn't support numbers larger than 2G
-for most platforms when used on the abbreviated form (3G, 3000M,
-etc).
-Write out the whole number (3000000000) and make sure you have a
-working
-.Fn strtoll .
-.Sh SEE ALSO
-.Xr AliasDB 5 ,
-.Xr CellServDB 5 ,
-.Xr DynRootDB 5 ,
-.Xr ThisCell 5 ,
-.Xr afsd 8
diff --git a/usr.sbin/afs/src/arlad/arla_local.h b/usr.sbin/afs/src/arlad/arla_local.h
deleted file mode 100644
index 65db9315022..00000000000
--- a/usr.sbin/afs/src/arlad/arla_local.h
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Copyright (c) 1995 - 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Include file for whole arlad
- * $arla: arla_local.h,v 1.88 2003/06/10 16:26:19 lha Exp $
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <ctype.h>
-#include <time.h>
-#include <limits.h>
-#include <errno.h>
-#include <sys/time.h>
-#if defined(HAVE_DIRENT_H)
-#include <dirent.h>
-#if DIRENT_AND_SYS_DIR_H
-#include <sys/dir.h>
-#endif
-#elif defined(HAVE_SYS_DIR_H)
-#include <sys/dir.h>
-#endif
-#include <unistd.h>
-#include <sys/types.h>
-#ifdef HAVE_LINUX_TYPES_H
-#include <linux/types.h>
-#endif
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-#ifdef HAVE_SYS_IOCCOM_H
-#include <sys/ioccom.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_SYS_MOUNT_H
-#include <sys/mount.h>
-#endif
-#ifdef HAVE_SYS_PRCTL_H
-#include <sys/prctl.h>
-#endif
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <fcntl.h>
-#include <pwd.h>
-#include <err.h>
-#include <parse_units.h>
-#include <roken.h>
-
-#include <lwp.h>
-#include <lock.h>
-
-#include <rx/rx.h>
-#include <rx/rx_null.h>
-
-#ifdef HAVE_KRB4
-#ifdef HAVE_OPENSSL
-#include <openssl/des.h>
-#else
-#include <des.h>
-#endif
-#include <krb.h>
-#endif
-#include <rxkad.h>
-
-#include <ifaddrs.h>
-
-#include <kafs.h>
-
-#include <uae.h>
-
-#include "log.h"
-
-#include "fs.h"
-#include "cmcb.h"
-#include "fs.cs.h"
-#include "list.h"
-#include "vldb.h"
-#include "vldb.cs.h"
-#include "volcache.h"
-#include "fbuf.h"
-#include "bool.h"
-#include "hash.h"
-#include "heap.h"
-#include "afs_dir.h"
-#include "ports.h"
-#include "conn.h"
-#include "poller.h"
-#include "fcache.h"
-#include "state.h"
-#include "inter.h"
-#include "cred.h"
-#include "adir.h"
-#include "service.h"
-#include "subr.h"
-#include "fprio.h"
-#include "disco.h"
-#include "stats.h"
-#include "kernel.h"
-#include "messages.h"
-#include "fs_errors.h"
-#include "arladeb.h"
-#include "ko.h"
-#include "nnpfs.h"
-#include "afs_uuid.h"
-
-enum connected_mode { CONNECTED = 0,
- FETCH_ONLY = 1,
- DISCONNECTED = 2,
- CONNECTEDLOG = 4};
-
-extern enum connected_mode connected_mode;
-
-#include "dynroot.h"
-
-#if 0
-#define assert_flag(e,f) assert((e)->flags.f)
-#define assert_not_flag(e,f) assert(!(e)->flags.f)
-#else
-#define assert_flag(e,f) do { } while(0)
-#define assert_not_flag(e,f) do { } while(0)
-#endif
-
-#define SYSNAMEMAXLEN 2048
-extern char **sysnamelist;
-extern int sysnamenum;
-
-
-#define ARLA_NUMCONNS 200
-#define ARLA_HIGH_VNODES 4000
-#define ARLA_LOW_VNODES 3000
-#define ARLA_HIGH_BYTES 40000000
-#define ARLA_LOW_BYTES 30000000
-#define ARLA_NUMCREDS 200
-#define ARLA_NUMVOLS 100
-
-/*
- * This should be a not used uid in the system,
- * NNPFS_ANONYMOUSID may be good
- */
-
-#define ARLA_NO_AUTH_CRED 4
-
-extern int fake_mp;
-extern char *default_log_file;
-extern char *default_arla_cachedir;
-
-extern int fork_flag; /* if the program should fork */
-extern int num_workers; /* number of workers program should use */
-extern int client_port; /* what port the client is using */
-extern int afs_BusyWaitPeriod; /* number of sec to wait on fs when VBUSY */
-
-void
-store_state (void);
-
-int
-arla_init (void);
-
-char *
-get_default_cache_dir (void);
-
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
-extern const char *conf_file;
-extern char *log_file;
-extern char *debug_levels;
-extern char *connected_mode_string;
-#ifdef KERBEROS
-extern const char *rxkad_level_string;
-#endif
-extern const char *argv_sysname;
-extern char *root_volume;
-extern int cpu_usage;
-extern int version_flag;
-extern int help_flag;
-extern int recover;
-extern int dynroot_enable;
-extern int cm_consistency;
-extern int fake_stat;
-extern int fetch_block_size;
-
-extern char *cache_dir;
-extern struct passwd *pw;
diff --git a/usr.sbin/afs/src/arlad/arlad.8 b/usr.sbin/afs/src/arlad/arlad.8
deleted file mode 100644
index 01d16ee4956..00000000000
--- a/usr.sbin/afs/src/arlad/arlad.8
+++ /dev/null
@@ -1,203 +0,0 @@
-.\" Copyright (c) 2000 - 2003 Kungliga Tekniska Högskolan
-.\" (Royal Institute of Technology, Stockholm, Sweden).
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" 3. Neither the name of the Institute nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $OpenBSD: arlad.8,v 1.12 2010/02/24 09:27:22 schwarze Exp $
-.\" $arla: arlad.8,v 1.18 2003/06/06 12:53:56 hin Exp $
-.\"
-.Dd September 5, 1998
-.Dt AFSD 8
-.Os "The Arla Project"
-.Sh NAME
-.Nm afsd
-.Nd AFS cache manager
-.Sh SYNOPSIS
-.Nm
-.Bk -words
-.Oo
-.Fl c Ar string \*(Ba Fl -conffile= Ns Ar string
-.Oc
-.Oo
-.Fl l Ar string \*(Ba Fl -log= Ns Ar string
-.Oc
-.Op Fl -debug= Ns Ar string
-.Oo
-.Fl d Ar string \*(Ba Fl -device= Ns Ar string
-.Oc
-.Op Fl -connected-mode= Ns Ar string
-.Op Fl n \*(Ba Fl -no-fork
-.Oo
-.Fl r Ar string \*(Ba Fl -rxkad-level= Ns Ar string
-.Oc
-.Oo
-.Fl s Ar string \*(Ba Fl -sysname= Ns Ar string
-.Oc
-.Op Fl -root-volume= Ns Ar string
-.Op Fl -port= Ns Ar number
-.Op Fl z \*(Ba Fl -recover
-.Op Fl -cache-dir= Ns Ar string
-.Op Fl D \*(Ba -dynroot
-.Op Fl -cpu-usage
-.Op Fl -version
-.Op Fl -help
-.Op Ar device
-.Ek
-.Sh DESCRIPTION
-.Nm
-runs on AFS client machines.
-It is used to manage the file cache, fetch files
-from AFS servers, handle callbacks and manage the authentication information
-for users.
-.Pp
-In normal cases
-.Nm
-will be started by enabling it in
-.Pa /etc/rc.conf Ns .
-.Pp
-The options are as follows:
-.Bl -tag -width Ds
-.It Xo
-.Fl c Ar string Ns ,
-.Fl -conffile= Ns Ar string
-.Xc
-Path to configuration file.
-.It Xo
-.Fl l Ar string Ns ,
-.Fl -log= Ns Ar string
-.Xc
-Where to write log [stderr|syslog|path] (default: stderr).
-.It Xo
-.Fl -debug= Ns Ar string
-.Xc
-What to write in the log (default: none).
-.It Xo
-.Fl d Ar string Ns ,
-.Fl -device= Ns Ar string
-.Xc
-The XFS device to use
-.Po default: Pa /dev/nnpfs0
-.Pc .
-.It Xo
-.Fl -connected-mode= Ns Ar string
-.Xc
-Initial connected mode [conncted|fetch-only|disconnected].
-.It Xo
-.Fl n Ns ,
-.Fl -no-fork
-.Xc
-Don't fork and daemonize.
-.It Xo
-.Fl r Ar string Ns ,
-.Fl -rxkad-level= Ns Ar string
-.Xc
-The rxkad level to use [clear|auth|crypt] (default: crypt).
-.It Xo
-.Fl s Ar string Ns ,
-.Fl -sysname= Ns Ar string
-.Xc
-Set the sysname of this system.
-.It Xo
-.Fl -root-volume= Ns Ar string
-.Xc
-Name of the root volume.
-.It Xo
-.Fl -port= Ns Ar number
-.Xc
-Port number to use.
-.It Xo
-.Fl z Ns ,
-.Fl -recover
-.Xc
-Don't recover state.
-.It Xo
-.Fl -cache-dir= Ns Ar string
-.Xc
-Cache directory
-.Po default: Pa /var/spool/afs
-.Pc .
-.It Xo
-.Fl D Ns ,
-.Fl -dynroot
-.Xc
-Use dynamic root.
-.It Xo
-.Fl -cpu-usage
-.Xc
-System and userland cpu-usage times is appended at the end line that
-is logged.
-.It Xo
-.Fl -version
-.Xc
-Print version information.
-.It Xo
-.Fl -help
-.Xc
-Print usage information.
-.El
-.Pp
-It is highly recommended that the cache filesystem size is increased
-to at least few hundred megabytes, and that it is made as a separate
-filesystem.
-The cache size is configured in
-.Xr afsd.conf 5 Ns .
-If enough memory is available the cache filesystem could be a
-.Xr mfs 8
-to improve performance.
-.Sh FILES
-.Bl -tag -width /etc/afs/CellServDB -compact
-.It Pa /etc/afs/afsd.conf
-default configuration for afsd
-.It Pa /etc/afs/CellServDB
-database with all known AFS servers
-.It Pa /etc/afs/ThisCell
-default cell (where we get the root directory)
-.It Pa /var/spool/afs
-default cache directory
-.El
-.Sh SEE ALSO
-.Xr fs 1 ,
-.Xr pts 1 ,
-.Xr afsd.conf 5 ,
-.Xr AliasDB 5 ,
-.Xr CellServDB 5 ,
-.Xr DynRootDB 5 ,
-.Xr SuidCells 5 ,
-.Xr ThisCell 5 ,
-.Xr mount_mfs 8 ,
-.Xr mount_nnpfs 8 ,
-.Xr rc.conf 8 ,
-.Xr vos 8
-.Sh BUGS
-If
-.Nm
-happens to crash, it's recommended to restart it with the
-.Fl z
-flag.
-Otherwise a corrupted cache can be reused.
diff --git a/usr.sbin/afs/src/arlad/arlad.c b/usr.sbin/afs/src/arlad/arlad.c
deleted file mode 100644
index 4c141297fc2..00000000000
--- a/usr.sbin/afs/src/arlad/arlad.c
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <arla_local.h>
-#include <getarg.h>
-#include <vers.h>
-RCSID("$arla: arlad.c,v 1.21 2003/01/17 03:00:11 lha Exp $");
-
-#define KERNEL_STACKSIZE (16*1024)
-
-char *default_log_file = "syslog";
-int client_port = 0;
-
-static char *pid_filename;
-
-#define _PATH_VAR_RUN "/var/run"
-#define _PATH_DEV_NNPFS0 "/dev/nnpfs0"
-#define _PATH_DEV_STDERR "/dev/stderr"
-
-/*
- *
- */
-
-
-static void
-write_pid_file (const char *progname)
-{
- FILE *fp;
-
- asprintf (&pid_filename, _PATH_VAR_RUN "/%s.pid", progname);
- if (pid_filename == NULL)
- return;
- fp = fopen (pid_filename, "w");
- if (fp == NULL)
- return;
- fprintf (fp, "%u", (unsigned)getpid());
- fclose (fp);
-}
-
-static void
-delete_pid_file (void)
-{
- if (pid_filename != NULL) {
- unlink (pid_filename);
- free (pid_filename);
- pid_filename = NULL;
- }
-}
-
-/*
- * signal handlers...
- */
-
-static void
-sigint (int foo)
-{
- arla_warnx (ADEBMISC, "fatal signal received");
- store_state ();
- delete_pid_file ();
- exit (0);
-}
-
-static void
-sighup (int foo)
-{
- store_state ();
- delete_pid_file ();
-}
-
-static void
-sigusr1 (int foo)
-{
- exit(0);
-}
-
-static void
-sigchild (int foo)
-{
- exit(1);
-}
-
-static void
-daemonify (void)
-{
- pid_t pid;
- int fd;
-
- pid = fork ();
- if (pid < 0)
- arla_err (1, ADEBERROR, errno, "fork");
- else if (pid > 0) {
- signal(SIGUSR1, sigusr1);
- signal(SIGCHLD, sigchild);
- while (1) pause();
- exit(0);
- }
- if (setsid() == -1)
- arla_err (1, ADEBERROR, errno, "setsid");
- fd = open(_PATH_DEVNULL, O_RDWR, 0);
- if (fd < 0)
- arla_err (1, ADEBERROR, errno, "open " _PATH_DEVNULL);
- dup2 (fd, STDIN_FILENO);
- dup2 (fd, STDOUT_FILENO);
- dup2 (fd, STDERR_FILENO);
- if (fd > 2)
- close (fd);
-}
-
-
-static void
-arla_start (char *device_file, const char *cache_dir)
-{
- struct kernel_args kernel_args;
- PROCESS kernelpid;
-
- signal (SIGINT, sigint);
- signal (SIGTERM, sigint);
- signal (SIGHUP, sighup);
- umask (S_IRWXG|S_IRWXO); /* 077 */
-
-#if defined(HAVE_SYS_PRCTL_H) && defined(PR_SET_DUMPABLE)
- prctl(PR_SET_DUMPABLE, 1);
-#endif
-
- nnpfs_message_init ();
- kernel_opendevice (device_file);
-
- kernel_args.num_workers = num_workers;
-
- if (LWP_CreateProcess (kernel_interface, KERNEL_STACKSIZE, 1,
- (char *)&kernel_args,
- "Kernel-interface", &kernelpid))
- arla_errx (1, ADEBERROR,
- "Cannot create kernel-interface process");
-
- write_pid_file ("arlad");
-
- if (chroot (cache_dir) < 0)
- arla_err (1, ADEBERROR, errno, "chroot %s", cache_dir);
-
- if (chdir("/") < 0)
- arla_err (1, ADEBERROR, errno, "chdir /");
-
- if (fork_flag)
- kill(getppid(), SIGUSR1);
-
- if (pw) {
- if (setgroups(1, &pw->pw_gid) == -1 ||
- setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) == -1 ||
- setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) == -1)
- arla_err (1, ADEBERROR, errno, "revoke");
- }
-
- LWP_WaitProcess ((char *)arla_start);
- abort ();
-}
-
-char *
-get_default_cache_dir (void)
-{
- return ARLACACHEDIR;
-}
-
-char *device_file = _PATH_DEV_NNPFS0;
-
-static struct getargs args[] = {
- {"cache-dir", 0, arg_string, &cache_dir,
- "cache directory", "directory"},
- {"check-consistency", 'C', arg_flag, &cm_consistency,
- "if we want extra paranoid consistency checks", NULL },
- {"cpu-usage", 0, arg_flag, &cpu_usage,
- NULL, NULL},
- {"conffile", 'c', arg_string, &conf_file,
- "path to configuration file", "file"},
- {"connected-mode", 0, arg_string, &connected_mode_string,
- "initial connected mode [conncted|fetch-only|disconnected]", NULL},
- {"debug", 0, arg_string, &debug_levels,
- "what to write in the log", NULL},
- {"device", 'd', arg_string, &device_file,
- "the NNPFS device to use [/dev/nnpfs0]", "path"},
- {"dynroot", 'D', arg_flag, &dynroot_enable,
- "if dynroot is enabled", NULL},
- {"log", 'l', arg_string, &log_file,
- "where to write log (stderr (default), syslog, or path to file)", NULL},
- {"fake-mp", 0, arg_flag, &fake_mp,
- "enable fake mountpoints", NULL},
- {"fake-stat", 0, arg_flag, &fake_stat,
- "build stat info from afs rights", NULL},
- {"fork", 'n', arg_negative_flag, &fork_flag,
- "don't fork and demonize", NULL},
- {"port", 0, arg_integer, &client_port,
- "port number to use", "number"},
- {"recover", 'z', arg_negative_flag, &recover,
- "don't recover state", NULL},
- {"root-volume",0, arg_string, &root_volume},
-#ifdef KERBEROS
- {"rxkad-level", 'r', arg_string, &rxkad_level_string,
- "the rxkad level to use (clear, auth or crypt)", NULL},
-#endif
- {"sysname", 's', arg_string, &argv_sysname,
- "set the sysname of this system", NULL},
- {"workers", 0, arg_integer, &num_workers,
- "number of worker threads", NULL},
- {"version", 0, arg_flag, &version_flag,
- NULL, NULL},
- {"help", 0, arg_flag, &help_flag,
- NULL, NULL}
-};
-
-static void
-usage (int ret)
-{
- arg_printusage (args, sizeof(args)/sizeof(*args), NULL, "[device]");
- exit (ret);
-}
-
-int
-main (int argc, char **argv)
-{
- int optind = 0;
- int ret;
-
- tzset();
- srand(time(NULL));
-
- if (getarg (args, sizeof(args)/sizeof(*args), argc, argv, &optind))
- usage (1);
-
- argc -= optind;
- argv += optind;
-
- if (help_flag)
- usage (0);
-
- if (version_flag) {
- print_version (NULL);
- exit (0);
- }
-
- if (argc > 0) {
- device_file = *argv;
- argc--;
- argv++;
- }
-
- if (argc != 0)
- usage (1);
-
- if (!fork_flag)
- default_log_file = _PATH_DEV_STDERR;
-
- if (fork_flag)
- daemonify ();
-
- ret = arla_init();
- if (ret)
- return ret;
-
- arla_start (device_file, cache_dir);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/arlad/arladeb.c b/usr.sbin/afs/src/arlad/arladeb.c
deleted file mode 100644
index c792053aa9e..00000000000
--- a/usr.sbin/afs/src/arlad/arladeb.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <arla_local.h>
-RCSID("$arla: arladeb.c,v 1.29 2002/12/06 04:57:31 lha Exp $");
-
-Log_method* arla_log_method = NULL;
-Log_unit* arla_log_unit = NULL;
-
-void
-arla_log(unsigned level, const char *fmt, ...)
-{
- va_list args;
-
- assert (arla_log_method);
-
- va_start(args, fmt);
- log_vlog(arla_log_unit, level, fmt, args);
- va_end(args);
-}
-
-
-void
-arla_loginit(char *logname, log_flags flags)
-{
- assert (logname);
-
- arla_log_method = log_open("arla", logname);
- if (arla_log_method == NULL)
- errx (1, "arla_loginit: log_opened failed with log `%s'", logname);
- arla_log_unit = log_unit_init (arla_log_method, "arla", arla_deb_units,
- ARLA_DEFAULT_LOG);
- if (arla_log_unit == NULL)
- errx (1, "arla_loginit: log_unit_init failed");
- log_setflags (arla_log_method, flags);
-}
-
-int
-arla_log_set_level (const char *s)
-{
- log_set_mask_str (arla_log_method, NULL, s);
- return 0;
-}
-
-void
-arla_log_set_level_num (unsigned level)
-{
- log_set_mask (arla_log_unit, level);
-}
-
-void
-arla_log_get_level (char *s, size_t len)
-{
- log_mask2str (arla_log_method, NULL, s, len);
-}
-
-unsigned
-arla_log_get_level_num (void)
-{
- return log_get_mask (arla_log_unit);
-}
-
-/*
- *
- */
-
-void
-arla_err (int eval, unsigned level, int error, const char *fmt, ...)
-{
- va_list args;
-
- va_start (args, fmt);
- arla_verr (eval, level, error, fmt, args);
- va_end (args);
-}
-
-void
-arla_verr (int eval, unsigned level, int error, const char *fmt, va_list args)
-{
- char *s;
-
- vasprintf (&s, fmt, args);
- if (s == NULL) {
- log_log (arla_log_unit, level,
- "Sorry, no memory to print `%s'...", fmt);
- exit (eval);
- }
- log_log (arla_log_unit, level, "%s: %s", s, koerr_gettext (error));
- free (s);
- exit (eval);
-}
-
-void
-arla_errx (int eval, unsigned level, const char *fmt, ...)
-{
- va_list args;
-
- va_start (args, fmt);
- arla_verrx (eval, level, fmt, args);
- va_end (args);
-}
-
-void
-arla_verrx (int eval, unsigned level, const char *fmt, va_list args)
-{
- log_vlog (arla_log_unit, level, fmt, args);
- exit (eval);
-}
-
-void
-arla_warn (unsigned level, int error, const char *fmt, ...)
-{
- va_list args;
-
- va_start (args, fmt);
- arla_vwarn (level, error, fmt, args);
- va_end (args);
-}
-
-void
-arla_vwarn (unsigned level, int error, const char *fmt, va_list args)
-{
- char *s;
-
- vasprintf (&s, fmt, args);
- if (s == NULL) {
- log_log (arla_log_unit, level,
- "Sorry, no memory to print `%s'...", fmt);
- return;
- }
- log_log (arla_log_unit, level, "%s: %s", s, koerr_gettext (error));
- free (s);
-}
-
-void
-arla_warnx (unsigned level, const char *fmt, ...)
-{
- va_list args;
-
- va_start (args, fmt);
- arla_vwarnx (level, fmt, args);
- va_end (args);
-}
-
-void
-arla_vwarnx (unsigned level, const char *fmt, va_list args)
-{
- log_vlog (arla_log_unit, level, fmt, args);
-}
-
-void
-arla_warnx_with_fid (unsigned level, const VenusFid *fid, const char *fmt, ...)
-{
- va_list args;
-
- va_start (args, fmt);
- arla_vwarnx_with_fid (level, fid, fmt, args);
- va_end(args);
-}
-
-void
-arla_vwarnx_with_fid (unsigned level, const VenusFid *fid, const char *fmt,
- va_list args)
-{
- char *s;
- const char *cellname;
- char volname[VLDB_MAXNAMELEN];
-
- cellname = cell_num2name (fid->Cell);
- if (cellname == NULL)
- cellname = "<unknown>";
- if (volcache_getname (fid->fid.Volume, fid->Cell,
- volname, sizeof(volname)) != 0)
- strlcpy(volname, "<unknown>", sizeof(volname));
-
- vasprintf (&s, fmt, args);
- if (s == NULL) {
- log_log (arla_log_unit, level,
- "Sorry, no memory to print `%s'...", fmt);
- return;
- }
- log_log (arla_log_unit, level,
- "volume %s (%ld) in cell %s (%ld): %s",
- volname, (unsigned long)fid->fid.Volume, cellname,
- (long)fid->Cell, s);
- free (s);
-}
diff --git a/usr.sbin/afs/src/arlad/arladeb.h b/usr.sbin/afs/src/arlad/arladeb.h
deleted file mode 100644
index 502471a2c44..00000000000
--- a/usr.sbin/afs/src/arlad/arladeb.h
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * $arla: arladeb.h,v 1.31 2002/12/06 04:58:00 lha Exp $
- */
-
-#ifndef _arladeb_h
-#define _arladeb_h
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <log.h>
-
-#include <roken.h>
-
-extern Log_method* arla_log_method;
-extern Log_unit* arla_log_unit;
-extern struct units arla_deb_units[];
-
-/* masks */
-#define ADEBANY 0xffffffff
-#define ADEBMISC 0x00000001 /* misc debugging */
-#define ADEBCONN 0x00000002 /* conncache */
-#define ADEBINIT 0x00000004 /* initialization debug */
-#define ADEBFCACHE 0x00000008 /* file cache */
-#define ADEBVOLCACHE 0x00000010 /* volume cache */
-#define ADEBCM 0x00000020 /* cache manager */
-#define ADEBCALLBACK 0x00000040 /* callbacks */
-#define ADEBCLEANER 0x00000080 /* cleaner */
-#define ADEBKERNEL 0x00000100 /* kernel interface */
-#define ADEBMSG 0x00000200 /* messages */
-#define ADEBFBUF 0x00000400 /* fbuf */
-#define ADEBDISCONN 0x00000800 /* disconn */
-#define ADEBWARN 0x08000000 /* don't ignore warning */
-#define ADEBERROR 0x10000000 /* don't ignore error */
-#define ADEBVLOG 0x20000000 /* venuslog output */
-#define ADEBINVALIDATOR 0x40000000 /* invalidator output */
-
-#define ARLA_DEFAULT_LOG (ADEBWARN | ADEBERROR)
-
-extern struct units arla_deb_units[];
-
-void arla_log(unsigned level, const char *fmt, ...);
-void arla_loginit(char *logname, log_flags flags);
-int arla_log_set_level (const char *s);
-void arla_log_set_level_num (unsigned level);
-void arla_log_get_level (char *s, size_t len);
-unsigned arla_log_get_level_num (void);
-void arla_log_print_levels (FILE *f);
-
-void
-arla_err (int eval, unsigned level, int error, const char *fmt, ...)
-__attribute__ ((noreturn))
-__attribute__ ((format (printf, 4, 5)))
-;
-
-void
-arla_verr (int eval, unsigned level, int error, const char *fmt, va_list args)
-__attribute__ ((noreturn))
-__attribute__ ((format (printf, 4, 0)))
-;
-
-void
-arla_errx (int eval, unsigned level, const char *fmt, ...)
-__attribute__ ((noreturn))
-__attribute__ ((format (printf, 3, 4)))
-;
-
-void
-arla_verrx (int eval, unsigned level, const char *fmt, va_list args)
-__attribute__ ((noreturn))
-__attribute__ ((format (printf, 3, 0)))
-;
-
-void
-arla_warn (unsigned level, int error, const char *fmt, ...)
-__attribute__ ((format (printf, 3, 4)))
-;
-
-void
-arla_vwarn (unsigned level, int error, const char *fmt, va_list args)
-__attribute__ ((format (printf, 3, 0)))
-;
-
-void
-arla_warnx (unsigned level, const char *fmt, ...)
-__attribute__ ((format (printf, 2, 3)))
-;
-
-void
-arla_vwarnx (unsigned level, const char *fmt, va_list args)
-__attribute__ ((format (printf, 2, 0)))
-;
-
-void
-arla_warnx_with_fid (unsigned level, const VenusFid *fid, const char *fmt, ...)
-__attribute__ ((format (printf, 3, 4)));
-
-void
-arla_vwarnx_with_fid (unsigned level, const VenusFid *fid, const char *fmt,
- va_list args)
-__attribute__ ((format (printf, 3, 0)));
-
-#endif /* _arladeb_h */
diff --git a/usr.sbin/afs/src/arlad/arladeb2.c b/usr.sbin/afs/src/arlad/arladeb2.c
deleted file mode 100644
index f0bb4c24437..00000000000
--- a/usr.sbin/afs/src/arlad/arladeb2.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the Kungliga Tekniska
- * Högskolan and its contributors.
- *
- * 4. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <assert.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <roken.h>
-#include "volcache.h"
-#include "ko.h"
-
-#include "arladeb.h"
-
-RCSID("$Id: arladeb2.c,v 1.1 2000/09/11 14:40:40 art Exp $");
-
-void
-arla_warnx_with_fid (unsigned level, const VenusFid *fid, const char *fmt, ...)
-{
- va_list args;
-
- va_start (args, fmt);
- arla_vwarnx_with_fid (level, fid, fmt, args);
- va_end(args);
-}
-
-void
-arla_vwarnx_with_fid (unsigned level, const VenusFid *fid, const char *fmt,
- va_list args)
-{
- char *s;
- const char *cellname;
- const char *volname;
-
- cellname = cell_num2name (fid->Cell);
- if (cellname == NULL)
- cellname = "<unknown>";
- volname = volcache_getname (fid->fid.Volume, fid->Cell);
- if (volname == NULL)
- volname = "<unknown>";
-
- vasprintf (&s, fmt, args);
- if (s == NULL) {
- log_log (arla_log_unit, level,
- "Sorry, no memory to print `%s'...", fmt);
- return;
- }
- log_log (arla_log_unit, level,
- "volume %s (%ld) in cell %s (%ld): %s",
- volname, (unsigned long)fid->fid.Volume, cellname,
- (long)fid->Cell, s);
- free (s);
-}
diff --git a/usr.sbin/afs/src/arlad/arladebu.c b/usr.sbin/afs/src/arlad/arladebu.c
deleted file mode 100644
index 3cab8a3a0b0..00000000000
--- a/usr.sbin/afs/src/arlad/arladebu.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000, 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <roken.h>
-#include <parse_units.h>
-#include <fs.h>
-#include "arladeb.h"
-
-RCSID("$arla: arladebu.c,v 1.5 2002/07/24 06:01:07 lha Exp $");
-
-#define all (ADEBERROR | ADEBWARN | ADEBDISCONN | ADEBFBUF | \
- ADEBMSG | ADEBKERNEL | ADEBCLEANER | ADEBCALLBACK | \
- ADEBCM | ADEBVOLCACHE | ADEBFCACHE | ADEBINIT | \
- ADEBCONN | ADEBMISC | ADEBVLOG)
-
-struct units arla_deb_units[] = {
- { "all", all},
- { "almost-all", all & ~ADEBCLEANER},
- { "venuslog", ADEBVLOG },
- { "errors", ADEBERROR },
- { "warnings", ADEBWARN },
- { "disconn", ADEBDISCONN },
- { "fbuf", ADEBFBUF },
- { "messages", ADEBMSG },
- { "kernel", ADEBKERNEL },
- { "cleaner", ADEBCLEANER },
- { "callbacks", ADEBCALLBACK },
- { "cache-manager", ADEBCM },
- { "volume-cache", ADEBVOLCACHE },
- { "file-cache", ADEBFCACHE },
- { "initialization", ADEBINIT },
- { "connection", ADEBCONN },
- { "miscellaneous", ADEBMISC },
- { "invalidator", ADEBINVALIDATOR },
- { "default", ARLA_DEFAULT_LOG },
- { "none", 0 },
- { NULL }
-};
-
-void
-arla_log_print_levels (FILE *f)
-{
- print_flags_table (arla_deb_units, f);
-}
diff --git a/usr.sbin/afs/src/arlad/bsd-subr.c b/usr.sbin/afs/src/arlad/bsd-subr.c
deleted file mode 100644
index c764dcef657..00000000000
--- a/usr.sbin/afs/src/arlad/bsd-subr.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* XXX need this to get dirent and DIRSIZ */
-#ifdef __osf__
-#define _OSF_SOURCE
-#define _BSD
-/* Might want to define _KERNEL for osf and use KDIRSIZ */
-#endif
-
-#include "arla_local.h"
-RCSID("$arla: bsd-subr.c,v 1.61 2003/02/15 02:24:08 lha Exp $");
-
-#ifdef __linux__
-#include <nnpfs/nnpfs_dirent.h>
-#else
-#define NNPFS_DIRENT_BLOCKSIZE 512
-#define nnpfs_dirent dirent
-#endif
-
-static long blocksize = NNPFS_DIRENT_BLOCKSIZE; /* XXX */
-
-/*
- * Write out all remaining data in `args'
- */
-
-static void
-flushbuf (void *vargs)
-{
- struct write_dirent_args *args = (struct write_dirent_args *)vargs;
- unsigned inc = blocksize - (args->ptr - args->buf);
- struct nnpfs_dirent *last = (struct nnpfs_dirent *)args->last;
-
- last->d_reclen += inc;
- if (write (args->fd, args->buf, blocksize) != blocksize)
- arla_warn (ADEBWARN, errno, "write");
- args->ptr = args->buf;
- args->last = NULL;
-}
-
-/*
- * Write a dirent to the args buf in `arg' containg `fid' and `name'.
- */
-
-static int
-write_dirent(VenusFid *fid, const char *name, void *arg)
-{
- struct nnpfs_dirent dirent, *real;
- struct write_dirent_args *args = (struct write_dirent_args *)arg;
-
- dirent.d_namlen = strlen (name);
-#ifdef _GENERIC_DIRSIZ
- dirent.d_reclen = _GENERIC_DIRSIZ(&dirent);
-#elif defined(DIRENT_SIZE)
- dirent.d_reclen = DIRENT_SIZE(&dirent);
-#else
- dirent.d_reclen = DIRSIZ(&dirent);
-#endif
-
- if (args->ptr + dirent.d_reclen > args->buf + blocksize)
- flushbuf (args);
- real = (struct nnpfs_dirent *)args->ptr;
-
- real->d_namlen = dirent.d_namlen;
- real->d_reclen = dirent.d_reclen;
-#if defined(HAVE_STRUCT_DIRENT_D_TYPE) && !defined(__linux__)
- real->d_type = DT_UNKNOWN;
-#endif
-
- real->d_fileno = dentry2ino (name, fid, args->e);
- strlcpy (real->d_name, name, sizeof(real->d_name));
- args->ptr += real->d_reclen;
- args->off += real->d_reclen;
- args->last = real;
- return 0;
-}
-
-int
-conv_dir (FCacheEntry *e, CredCacheEntry *ce, u_int tokens,
- fcache_cache_handle *cache_handle,
- char *cache_name, size_t cache_name_sz)
-{
- return conv_dir_sub (e, ce, tokens, cache_handle, cache_name,
- cache_name_sz, write_dirent, flushbuf, blocksize);
-}
-
-/*
- * remove `filename` from the converted directory for `e'
- */
-
-#ifndef DIRBLKSIZ
-#define DIRBLKSIZ 1024
-#endif
-
-int
-dir_remove_name (FCacheEntry *e, const char *filename,
- fcache_cache_handle *cache_handle,
- char *cache_name, size_t cache_name_sz)
-{
- int ret;
- int fd;
- fbuf fb;
- struct stat sb;
- char *buf;
- char *p;
- size_t len;
- struct nnpfs_dirent *dp;
- struct nnpfs_dirent *last_dp;
-
- fcache_extra_file_name (e, cache_name, cache_name_sz);
- fd = open (cache_name, O_RDWR, 0);
- if (fd < 0)
- return errno;
- fcache_fhget (cache_name, cache_handle);
- if (fstat (fd, &sb) < 0) {
- ret = errno;
- close (fd);
- return ret;
- }
- len = sb.st_size;
-
- ret = fbuf_create (&fb, fd, len, FBUF_READ|FBUF_WRITE|FBUF_SHARED);
- if (ret) {
- close (fd);
- return ret;
- }
- last_dp = NULL;
- ret = ENOENT;
- for (p = buf = fbuf_buf (&fb); p < buf + len; p += dp->d_reclen) {
-
- dp = (struct nnpfs_dirent *)p;
-
- assert (dp->d_reclen > 0);
-
- if (strcmp (filename, dp->d_name) == 0) {
- if (last_dp != NULL) {
- size_t off1, off2;
- unsigned len;
-
- /*
- * d_reclen can be as largest (in worst case)
- * DIRBLKSIZ, and may not cause the entry to cross a
- * DIRBLKSIZ boundery.
- */
- len = last_dp->d_reclen + dp->d_reclen;
-
- off1 = (char *)last_dp - buf;
- off2 = off1 + len;
- off1 /= DIRBLKSIZ;
- off2 /= DIRBLKSIZ;
-
- if (len < DIRBLKSIZ && off1 == off2)
- last_dp->d_reclen = len;
- }
- dp->d_fileno = 0;
- ret = 0;
- break;
- }
- last_dp = dp;
- }
- fbuf_end (&fb);
- close (fd);
- return ret;
-}
diff --git a/usr.sbin/afs/src/arlad/cmcb.c b/usr.sbin/afs/src/arlad/cmcb.c
deleted file mode 100644
index 19bcc06039c..00000000000
--- a/usr.sbin/afs/src/arlad/cmcb.c
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000, 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * The callback interface to the cache manager.
- */
-
-#include "arla_local.h"
-RCSID("$arla: cmcb.c,v 1.41 2003/03/06 00:38:47 lha Exp $") ;
-
-#include "cb.ss.h"
-
-/*
- * Create an instance of the callback service and start a server.
- */
-
-static afsUUID arla_client_uuid;
-
-void
-cmcb_reinit (void)
-{
- if (afsUUID_create(&arla_client_uuid))
- arla_errx(1, ADEBWARN, "Failed to create uuid for client");
-}
-
-void
-cmcb_init (void)
-{
- static struct rx_securityClass *nullSecObjP;
- static struct rx_securityClass *(securityObjects[1]);
-
- cmcb_reinit ();
-
- nullSecObjP = rxnull_NewClientSecurityObject ();
- if (nullSecObjP == NULL)
- arla_errx (1, ADEBWARN, "Cannot create null security object.");
-
- securityObjects[0] = nullSecObjP;
-
- if (rx_NewService (0, CM_SERVICE_ID, "cm", securityObjects,
- sizeof(securityObjects) / sizeof(*securityObjects),
- RXAFSCB_ExecuteRequest) == NULL)
- arla_errx (1, ADEBWARN, "Cannot install callback service");
- rx_StartServer (0);
-}
-
-/*
- * Just tell the host that we're still alive.
- */
-
-int
-SRXAFSCB_Probe (struct rx_call *a_rxCallP)
-{
- u_long host = rx_HostOf (rx_PeerOf (rx_ConnectionOf (a_rxCallP)));
- struct in_addr in_addr;
-
- in_addr.s_addr = host;
- arla_warnx (ADEBCALLBACK, "probe (%s)", inet_ntoa(in_addr));
- return 0;
-}
-
-/*
- * Handle the callbacks in `a_fidArrayP' and `a_callBackArrayP' (this
- * array can be shorter).
- * There are two types of callbacks:
- * - (volume-id, 0, 0) is a volume callback.
- * - (volume-id, x, y) is a callback on a file.
- */
-
-int
-SRXAFSCB_CallBack (struct rx_call *a_rxCallP,
- const AFSCBFids *a_fidArrayP,
- const AFSCBs *a_callBackArrayP)
-{
- int i;
- long cell;
- uint32_t host = rx_HostOf (rx_PeerOf (rx_ConnectionOf (a_rxCallP)));
- struct in_addr in_addr;
-
- in_addr.s_addr = host;
- arla_warnx (ADEBCALLBACK, "callback (%s)", inet_ntoa(in_addr));
- cell = poller_host2cell(host);
- if (cell == -1)
- arla_warnx (ADEBCALLBACK,
- "callback from unknown host: %s",
- inet_ntoa (in_addr));
- for (i = 0; i < a_fidArrayP->len; ++i) {
- VenusFid fid;
- AFSCallBack broken_callback = {0, 0, CBDROPPED};
-
- fid.fid = a_fidArrayP->val[i];
- fid.Cell = cell;
- arla_warnx (ADEBCALLBACK, "%d: (%u, %u, %u)", fid.Cell,
- fid.fid.Volume, fid.fid.Vnode, fid.fid.Unique);
-
- /*
- * Check if it's a volume callback.
- */
-
- if (fid.fid.Vnode == 0 && fid.fid.Unique == 0) {
- fcache_purge_volume (fid);
- volcache_invalidate (fid.fid.Volume, fid.Cell);
- } else if (i < a_callBackArrayP->len)
- fcache_stale_entry (fid, a_callBackArrayP->val[i]);
- else
- fcache_stale_entry (fid, broken_callback);
- }
- cm_check_consistency();
-
- return 0;
-}
-
-
-int
-SRXAFSCB_GetLock(struct rx_call *a_rxCallP,
- int32_t index,
- AFSDBLock *lock)
-{
- return 1;
-}
-
-int
-SRXAFSCB_GetCE(struct rx_call *a_rxCallP,
- int32_t index,
- AFSDBCacheEntry *dbentry)
-{
- return 1;
-}
-
-int
-SRXAFSCB_XStatsVersion(struct rx_call *a_rxCallP,
- int32_t *version)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_GetXStats(struct rx_call *a_rxCallP,
- int32_t client_version_num,
- int32_t collection_number,
- int32_t *server_version_number,
- int32_t *time,
- AFSCB_CollData *stats)
-{
- return RXGEN_OPCODE;
-}
-
-
-/*
- * Throw away all callbacks from the `host'
- */
-
-static void
-init_callback_state(uint32_t host)
-{
- struct in_addr in_addr;
-
- cm_check_consistency();
-
- in_addr.s_addr = host;
- arla_warnx (ADEBCALLBACK, "InitCallBackState (%s)", inet_ntoa(in_addr));
- fcache_purge_host (host);
-
- cm_check_consistency();
-}
-
-/*
- * Init the CallBack address in `addr'. Returns 0 or RXGEN_OPCODE.
- */
-
-static int
-init_address(interfaceAddr *addr)
-{
- struct ifaddrs *ifa, *ifa0;
- int num_addr;
-
- memset(addr, 0, sizeof(*addr));
-
- addr->uuid = arla_client_uuid;
-
- if (getifaddrs(&ifa0) != 0)
- return RXGEN_OPCODE;
-
- num_addr = 0;
-
- for (ifa = ifa0; ifa != NULL; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr == NULL)
- continue;
-
-#if IFF_LOOPBACK
- if (ifa->ifa_flags & IFF_LOOPBACK)
- continue;
-#endif
-
- switch (ifa->ifa_addr->sa_family) {
- case AF_INET: {
- struct sockaddr_in *sin = (struct sockaddr_in *)ifa->ifa_addr;
- struct sockaddr_in *netmask = (struct sockaddr_in *)ifa->ifa_netmask;
-
- if (sin->sin_addr.s_addr == htonl(0x7f000001))
- continue;
-
- addr->addr_in[num_addr] = sin->sin_addr.s_addr;
- if (netmask) {
- addr->subnetmask[num_addr] = netmask->sin_addr.s_addr;
- } else {
- /* dream up something */
- addr->subnetmask[num_addr] = htonl(0xffffff00);
- }
-
- addr->mtu[num_addr] = 1500; /* XXX */
-
- num_addr++;
- break;
- }
- }
-
- if (num_addr >= AFS_MAX_INTERFACE_ADDR)
- break;
- }
-
- freeifaddrs(ifa0);
-
-#if 0
- /* fail if there was no good ipv4 addresses */
- if (num_addr == 0)
- return RXGEN_OPCODE;
-#endif
-
- addr->numberOfInterfaces = num_addr;
-
- return 0;
-}
-
-int
-SRXAFSCB_InitCallBackState (struct rx_call *a_rxCallP)
-{
- u_long host = rx_HostOf (rx_PeerOf (rx_ConnectionOf (a_rxCallP)));
-
- init_callback_state(host);
-
- return 0;
-}
-
-int
-SRXAFSCB_InitCallBackState2 (struct rx_call *a_rxCallP, interfaceAddr *addr)
-{
- u_long host = rx_HostOf (rx_PeerOf (rx_ConnectionOf (a_rxCallP)));
-
- init_callback_state(host);
-
- return init_address(addr);
-}
-
-int
-SRXAFSCB_InitCallBackState3 (struct rx_call *a_rxCallP,
- const struct afsUUID *serverUuid)
-{
- u_long host = rx_HostOf (rx_PeerOf (rx_ConnectionOf (a_rxCallP)));
-
- init_callback_state(host);
-
- return 0;
-}
-
-int
-SRXAFSCB_WhoAreYou(struct rx_call *a_rxCallP,
- interfaceAddr *addr)
-{
- return init_address(addr);
-}
-
-int
-SRXAFSCB_ProbeUUID(struct rx_call *a_rxCallP,
- const struct afsUUID *uuid)
-{
- /* the the uuids are equal, we are the host belive we is */
-
- if (afsUUID_equal(uuid, &arla_client_uuid))
- return 0;
- return 1;
-}
-
-int
-SRXAFSCB_GetCellServDB(struct rx_call *a_rxCallP,
- const int32_t cellIndex,
- char *cellName,
- serverList *cellHosts)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_GetLocalCell(struct rx_call *a_rxCallP,
- char *cellName)
-{
- strlcpy(cellName, cell_getthiscell(), AFSNAMEMAX);
- return 0;
-}
-
-int
-SRXAFSCB_GetCacheConfig(struct rx_call *a_rxCallP,
- const uint32_t callerVersion,
- uint32_t *serverVersion,
- uint32_t *configCount,
- cacheConfig *config)
-{
- *serverVersion = 0;
- *configCount = 0;
- config->len = 0;
- config->val = NULL;
-
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_GetCellByNum(struct rx_call *call,
- const int32_t cellNumber,
- char *cellName,
- serverList *cellHosts)
-{
- return RXGEN_OPCODE;
-}
-
-int
-SRXAFSCB_TellMeAboutYourself(struct rx_call *call,
- struct interfaceAddr *addr,
- Capabilities *capabilities)
-{
- int ret;
-
- memset(addr, 0, sizeof(*addr));
-
- capabilities->len = 1;
- capabilities->val = malloc(sizeof(capabilities->val[0]));
- if (capabilities->val == NULL)
- return ENOMEM;
-
- capabilities->val[0] = 0x1; /* UAE */
-
- ret = init_address(addr);
- if (ret)
- return ret;
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/arlad/cmcb.h b/usr.sbin/afs/src/arlad/cmcb.h
deleted file mode 100644
index 5ff92bde5dd..00000000000
--- a/usr.sbin/afs/src/arlad/cmcb.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: cmcb.h,v 1.5 2002/07/24 06:02:02 lha Exp $ */
-
-#ifndef _CMCB_H_
-#define _CMCB_H_
-
-void cmcb_init (void);
-void cmcb_reinit (void);
-
-#endif /* _CMCB_H_ */
diff --git a/usr.sbin/afs/src/arlad/conn.c b/usr.sbin/afs/src/arlad/conn.c
deleted file mode 100644
index fbe4ddfb99c..00000000000
--- a/usr.sbin/afs/src/arlad/conn.c
+++ /dev/null
@@ -1,884 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Cache of connections
- */
-
-
-#include "arla_local.h"
-#ifdef RCSID
-RCSID("$arla: conn.c,v 1.75 2003/06/10 04:23:20 lha Exp $") ;
-#endif
-
-#define CONNCACHESIZE 101
-
-#define CONNFREELISTINC 17
-
-/* Hashtable of connections */
-static Hashtab *connhtab;
-
-/* A list with free connections */
-static List *connfreelist;
-
-/* # of connections */
-static unsigned nconnections;
-
-/* # of active connections */
-static unsigned nactive_connections;
-
-/* List of connections to probe */
-static List *connprobelist;
-
-#ifdef KERBEROS
-int conn_rxkad_level = rxkad_auth;
-#endif
-
-/*
- * Functions for handling entries into the connection cache.
- */
-
-static int
-conncmp (void *a, void *b)
-{
- ConnCacheEntry *c1 = (ConnCacheEntry*)a;
- ConnCacheEntry *c2 = (ConnCacheEntry*)b;
-
- return c1->cred != c2->cred
- || c1->host != c2->host
- || c1->service != c2->service
- || c1->port != c2->port
- || c1->securityindex != c2->securityindex;
-}
-
-static unsigned int
-connhash (void *a)
-{
- ConnCacheEntry *c = (ConnCacheEntry*)a;
-
- return c->cred + c->host + c->service + c->port + c->securityindex;
-}
-
-/* 2^MAX_RETRIES is the maximum number of seconds between probes */
-
-#define MAX_RETRIES 8
-
-/*
- * Add this entry again to the probe list but without restarting ntries.
- */
-
-static void
-re_probe (ConnCacheEntry *e)
-{
- Listitem *item;
- struct timeval tv;
-
- assert (e->probe != NULL);
-
- gettimeofday (&tv, NULL);
- if (e->probe_le) {
- listdel (connprobelist, e->probe_le);
- e->probe_next = min(tv.tv_sec + (1 << e->ntries), e->probe_next);
- } else
- e->probe_next = tv.tv_sec + (1 << e->ntries);
-
- if (e->ntries <= MAX_RETRIES)
- ++e->ntries;
-
- for (item = listhead (connprobelist);
- item;
- item = listnext (connprobelist, item)) {
- ConnCacheEntry *this = (ConnCacheEntry *)listdata (item);
-
- if (e->probe_next < this->probe_next) {
- e->probe_le = listaddbefore (connprobelist, item, e);
- LWP_NoYieldSignal (connprobelist);
- return;
- }
- }
- e->probe_le = listaddtail (connprobelist, e);
- LWP_NoYieldSignal (connprobelist);
-}
-
-/*
- * Initial add to probe list.
- */
-
-static void
-add_to_probe_list (ConnCacheEntry *e, int ntries)
-{
- e->ntries = ntries;
- re_probe (e);
-}
-
-/*
- *
- */
-
-#define PINGER_STACKSIZE (16*1024)
-
-
-static PROCESS pinger_pid;
-
-/*
- * Loop waiting for things servers to probe.
- */
-
-static void
-pinger (char *arg)
-{
- for (;;) {
- struct timeval tv;
- Listitem *item;
- ConnCacheEntry *e;
- struct in_addr addr;
- const char *port_str;
-
- arla_warnx(ADEBCONN, "running pinger");
-
- while (listemptyp (connprobelist))
- LWP_WaitProcess (connprobelist);
-
- item = listhead (connprobelist);
- e = (ConnCacheEntry *)listdata (item);
-
- assert (e->probe_le == item);
-
- gettimeofday (&tv, NULL);
- if (tv.tv_sec < e->probe_next) {
- unsigned long t = e->probe_next - tv.tv_sec;
-
- arla_warnx(ADEBCONN,
- "pinger: sleeping %lu second(s)", t);
- IOMGR_Sleep (t);
- continue;
- }
-
- listdel (connprobelist, item);
- e->probe_le = NULL;
-
- if (e->flags.alivep)
- continue;
-
- addr.s_addr = e->host;
- port_str = ports_num2name (e->port);
-
- if (port_str != NULL)
- arla_warnx (ADEBCONN, "pinger: probing %s/%s",
- inet_ntoa(addr), port_str);
- else
- arla_warnx (ADEBCONN, "pinger: probing %s/%d",
- inet_ntoa(addr), e->port);
- ++e->refcount;
- if (e->probe == NULL)
- arla_warnx(ADEBWARN, "pinger: probe function is NULL, "
- "host: %s cell: %d port: %d",
- inet_ntoa(addr), e->cell, e->port);
-
- if (connected_mode == DISCONNECTED) {
- arla_warnx(ADEBCONN, "pinger: ignoring host in disconnected mode");
- } else if (e->probe && ((*(e->probe))(e->connection) == 0)) {
- conn_alive (e);
- } else {
- re_probe (e);
- }
-
- conn_free (e);
- }
-}
-
-/*
- * Create `n' ConnCacheEntry's and add them to `connfreelist'
- */
-
-static void
-create_new_connections (unsigned n)
-{
- unsigned i;
- ConnCacheEntry *entries;
-
- entries = (ConnCacheEntry*)calloc (n, sizeof (ConnCacheEntry));
- if (entries == NULL)
- arla_errx (1, ADEBERROR, "conncache: calloc failed");
- for (i = 0; i < n; ++i) {
- entries[i].connection = NULL;
- entries[i].refcount = 0;
- entries[i].parent = NULL;
- entries[i].probe_le = NULL;
- listaddhead (connfreelist, &entries[i]);
- }
- nconnections += n;
-}
-
-/*
- * Initialize the connection cache.
- */
-
-void
-conn_init (unsigned nentries)
-{
- arla_warnx (ADEBCONN, "initconncache");
-
- connhtab = hashtabnew (CONNCACHESIZE, conncmp, connhash);
- if (connhtab == NULL)
- arla_errx (1, ADEBERROR, "conn_init: hashtabnew failed");
- connfreelist = listnew ();
- if (connfreelist == NULL)
- arla_errx (1, ADEBERROR, "conn_init: listnew failed");
- connprobelist = listnew ();
- if (connprobelist == NULL)
- arla_errx (1, ADEBERROR, "conn_init: listnew failed");
- nconnections = 0;
-
- if (LWP_CreateProcess (pinger, PINGER_STACKSIZE, 1,
- NULL, "pinger", &pinger_pid))
- arla_errx (1, ADEBERROR,
- "conn: cannot create pinger thread");
-
- create_new_connections (nentries);
-}
-
-/*
- * Re-cycle an entry:
- * remove it from the hashtab, clear it out and place it on the freelist.
- */
-
-static void
-recycle_conn (ConnCacheEntry *e)
-{
- assert (e->refcount == 0);
-
- if (e->parent != NULL) {
- conn_free (e->parent);
- e->parent = NULL;
- }
- if (e->probe_le != NULL) {
- listdel (connprobelist, e->probe_le);
- e->probe_le = NULL;
- }
- if (!e->flags.killme)
- hashtabdel (connhtab, e);
- rx_DestroyConnection (e->connection);
- memset (e, 0, sizeof(*e));
- listaddhead (connfreelist, e);
- --nactive_connections;
-}
-
-/*
- * Remove this connection from the hashtab and add it to the freelist
- * iff refcount == 0.
- */
-
-static Bool
-clear_conn (void *ptr, void *arg)
-{
- ConnCacheEntry *e = (ConnCacheEntry *)ptr;
-
- if (e->refcount == 0)
- recycle_conn (e);
- return FALSE;
-}
-
-/*
- * Get a free connection to use. Try to pick it from `connfreelist'.
- * If there are no there, it's time to go through `connhtab' and GC
- * unused connections. If that fails, allocate some more.
- * And if that fails, give up.
- */
-
-static ConnCacheEntry *
-get_free_connection (void)
-{
- ConnCacheEntry *e;
-
- e = (ConnCacheEntry *)listdelhead (connfreelist);
- if (e != NULL)
- return e;
-
- hashtabforeach (connhtab, clear_conn, NULL);
-
- e = (ConnCacheEntry *)listdelhead (connfreelist);
- if (e != NULL)
- return e;
-
- create_new_connections (CONNFREELISTINC);
-
- e = (ConnCacheEntry *)listdelhead (connfreelist);
- if (e != NULL)
- return e;
-
- arla_errx (1, ADEBERROR,
- "conncache: there was no way of getting a connection");
-}
-
-/*
- * Get a free connection, fill in all parameters and create a
- * rx_connection.
- */
-
-static ConnCacheEntry *
-new_connection (int32_t cell,
- uint32_t host,
- uint16_t port,
- uint16_t service,
- nnpfs_pag_t cred,
- int securityindex,
- int (*probe)(struct rx_connection *),
- struct rx_securityClass *securityobject)
-{
- ConnCacheEntry *e;
-
- assert (probe != NULL);
-
- e = get_free_connection ();
-
- e->cell = cell;
- e->host = host;
- e->port = port;
- e->service = service;
- e->flags.alivep = TRUE;
- e->flags.old = FALSE;
- e->refcount = 0;
- e->cred = cred;
- e->securityindex = securityindex;
- e->probe = probe;
-
- e->connection = rx_NewConnection (host,
- htons (port),
- service,
- securityobject,
- securityindex);
- if (e->connection == NULL)
- arla_errx (1, ADEBERROR, "rx_NewConnection failed");
- return e;
-}
-
-/*
- * Create a new connection and add it to `connhtab'.
- */
-
-static ConnCacheEntry *
-add_connection(int32_t cell,
- uint32_t host,
- uint16_t port,
- uint16_t service,
- int (*probe)(struct rx_connection *),
- CredCacheEntry *ce)
-{
- ConnCacheEntry *e;
- struct rx_securityClass *securityobj;
- int securityindex;
- nnpfs_pag_t cred;
-
- if (ce) {
- securityindex = ce->securityindex;
- cred = ce->cred;
-
- switch (ce->type) {
-#ifdef KERBEROS
- case CRED_KRB4 : {
- struct cred_rxkad *cred = (struct cred_rxkad *)ce->cred_data;
-
- securityobj = rxkad_NewClientSecurityObject(conn_rxkad_level,
- cred->ct.HandShakeKey,
- cred->ct.AuthHandle,
- cred->ticket_len,
- cred->ticket);
- break;
- }
-#endif
- case CRED_NONE :
- securityobj = rxnull_NewClientSecurityObject ();
- break;
- default :
- errx(1, "Unknown credentials type %d\n", ce->type);
- }
- } else {
- securityobj = rxnull_NewClientSecurityObject ();
- securityindex = 0;
- cred = 0;
- }
-
- e = new_connection (cell, host, port, service,
- cred, securityindex, probe, securityobj);
-
- hashtabadd (connhtab, (void *)e);
- ++nactive_connections;
-
- return e;
-}
-
-
-/*
- * Find a connection from the cache given:
- * (cell, host, port, service, cred).
- * If there's no connection at all, create one.
- */
-
-static ConnCacheEntry *
-internal_get (int32_t cell,
- uint32_t host,
- uint16_t port,
- uint16_t service,
- int (*probe)(struct rx_connection *),
- CredCacheEntry *ce)
-{
- ConnCacheEntry *e;
- ConnCacheEntry key;
-
-#if 0
- if (connected_mode == DISCONNECTED)
- return NULL;
-#endif
-
- key.host = host;
- key.port = port;
- key.service = service;
- key.cred = ce->cred;
- key.securityindex = ce->securityindex;
-
- e = (ConnCacheEntry *)hashtabsearch (connhtab, (void *)&key);
-
- if (e == NULL) {
- ConnCacheEntry *parent = NULL;
-
- if (ce->securityindex || ce->cred) {
- key.cred = 0;
- key.securityindex = 0;
- parent = (ConnCacheEntry *)hashtabsearch (connhtab, (void *)&key);
- if (parent == NULL) {
- parent = add_connection (cell, host, port, service,
- probe, NULL);
- }
- ++parent->refcount;
- }
-
- e = add_connection (cell, host, port, service, probe, ce);
- if (parent != NULL)
- e->parent = parent;
- }
-
- /*
- * Since we only probe the parent entry (ie noauth), we make sure
- * the status from the parent entry is pushed down to the
- * children.
- */
- if(e->parent != NULL) {
- e->flags.alivep = e->parent->flags.alivep;
- }
-
- return e;
-}
-
-/*
- * Return a connection to (cell, host, port, service, ce)
- */
-
-ConnCacheEntry *
-conn_get (int32_t cell,
- uint32_t host,
- uint16_t port,
- uint16_t service,
- int (*probe)(struct rx_connection *),
- CredCacheEntry *ce)
-{
- ConnCacheEntry *e = internal_get (cell, host, port, service, probe, ce);
-
- ++e->refcount;
- return e;
-}
-
-/*
- * Add a new reference to a connection
- */
-
-void
-conn_ref(ConnCacheEntry *e)
-{
- assert(e->refcount > 0);
- e->refcount++;
-}
-
-/*
- * Free a reference to a ConnCacheEntry.
- * If refcount drops to zero, it makes it eligible for re-use.
- */
-
-void
-conn_free (ConnCacheEntry *e)
-{
- if (e == NULL) /* When in disconnected mode conn sets to NULL */
- return;
-
- assert (e->refcount > 0);
-
- --e->refcount;
- if (e->refcount == 0 && e->flags.killme)
- recycle_conn (e);
-}
-
-/*
- * Given a host try to figure out what cell it's in.
- */
-
-int32_t
-conn_host2cell (uint32_t host, uint16_t port, uint16_t service)
-{
- ConnCacheEntry *e;
- ConnCacheEntry key;
-
- key.host = host;
- key.port = port;
- key.service = service;
- key.cred = 0;
- key.securityindex = 0;
-
- e = (ConnCacheEntry *)hashtabsearch(connhtab, (void *)&key);
- if (e == NULL)
- return -1;
- else
- return e->cell;
-}
-
-/*
- * Mark the server in `e' as being down.
- */
-
-void
-conn_dead (ConnCacheEntry *e)
-{
- struct in_addr a;
- char buf[10];
- const char *port;
-
- assert (e->probe != NULL);
-
- e->flags.alivep = FALSE;
- if (e->parent != NULL) {
- e = e->parent;
- e->flags.alivep = FALSE;
- }
- add_to_probe_list (e, 0);
- a.s_addr = e->host;
- port = ports_num2name (e->port);
- if (port == NULL) {
- snprintf(buf, sizeof(buf), "%d", e->port);
- port = buf;
- }
-
- arla_warnx (ADEBWARN, "Lost connection to %s/%s in cell %s",
- inet_ntoa(a), port, cell_num2name (e->cell));
-}
-
-/*
- * Mark the server in `e' as being up.
- */
-
-void
-conn_alive (ConnCacheEntry *e)
-{
- struct in_addr a;
- const char *s;
-
- a.s_addr = e->host;
- s = ports_num2name (e->port);
- if (s != NULL)
- arla_warnx (ADEBWARN, "Server %s/%s up again", inet_ntoa(a), s);
- else
- arla_warnx (ADEBWARN, "Server %s/%d up again", inet_ntoa(a), e->port);
- e->flags.alivep = TRUE;
- if (e->parent != NULL)
- e->parent->flags.alivep = TRUE;
-}
-
-/*
- * Is this server known to be up?
- */
-
-Bool
-conn_isalivep (ConnCacheEntry *e)
-{
- if (e->parent != NULL)
- e->flags.alivep = e->parent->flags.alivep;
-
- return e->flags.alivep;
-}
-
-/*
- * Probe the service in `e'
- */
-
-void
-conn_probe (ConnCacheEntry *e)
-{
- ++e->refcount;
- {
- struct in_addr a;
- a.s_addr = e->host;
-
- if (e->probe == NULL)
- arla_warnx(ADEBWARN, "conn_probe: probe function is NULL, "
- "host: %s cell: %d port: %d",
- inet_ntoa(a), e->cell, e->port);
- }
- if (e->probe && ((*(e->probe))(e->connection) == 0)) {
- if (!e->flags.alivep)
- conn_alive (e);
- } else {
- if (e->flags.alivep)
- conn_dead (e);
- }
- conn_free (e);
-}
-
-/*
- * Is the service at (cell, host, port, service) up?
- */
-
-Bool
-conn_serverupp (uint32_t host, uint16_t port, uint16_t service)
-{
- ConnCacheEntry *e;
- ConnCacheEntry key;
-
- key.host = host;
- key.port = port;
- key.service = service;
- key.cred = 0;
- key.securityindex = 0;
-
- e = (ConnCacheEntry *)hashtabsearch (connhtab, (void *)&key);
- if (e != NULL)
- return e->flags.alivep;
- else
- return TRUE;
-}
-
-/*
- * Print an entry.
- */
-
-static Bool
-print_conn (void *ptr, void *arg)
-{
- ConnCacheEntry *e = (ConnCacheEntry *)ptr;
- struct in_addr tmp;
-
- tmp.s_addr = e->host;
-
- arla_log(ADEBVLOG, "host = %s, port = %d, service = %d, "
- "cell = %d (%s), "
- "securityindex = %d, cred = %u, "
- "conn = %p, alive = %d, "
- "killme = %d, refcount = %d",
- inet_ntoa(tmp), e->port, e->service, e->cell,
- cell_num2name (e->cell),
- e->securityindex, e->cred, e->connection,
- e->flags.alivep, e->flags.killme, e->refcount);
-
- return FALSE;
-}
-
-/*
- * Print the status of the connection cache.
- */
-
-void
-conn_status (void)
-{
- arla_log(ADEBVLOG, "%u(%u) connections",
- nactive_connections, nconnections);
- hashtabforeach (connhtab, print_conn, NULL);
-}
-
-struct clear_state {
- clear_state_mask mask;
- int32_t cell;
- nnpfs_pag_t cred;
- int securityindex;
-};
-
-static Bool
-clear_cred (void *ptr, void *arg)
-{
- ConnCacheEntry *e = (ConnCacheEntry *)ptr;
- struct clear_state *s = (struct clear_state *)arg;
-
- if ((s->mask & CONN_CS_CRED) && s->cred != e->cred)
- return FALSE;
- if ((s->mask & CONN_CS_CELL) && s->cell != e->cell)
- return FALSE;
- if ((s->mask & CONN_CS_SECIDX) && s->securityindex != e->securityindex)
- return FALSE;
-
- if (e->refcount > 0) {
- e->flags.killme = 1;
- hashtabdel (connhtab, e);
- } else
- recycle_conn (e);
-
- return FALSE;
-}
-
-/*
- * Remove all connections matching mask + (cell, cred, securityindex).
- */
-
-void
-conn_clearcred(clear_state_mask mask,
- int32_t cell, nnpfs_pag_t cred, int securityindex)
-{
- struct clear_state s;
-
- s.mask = mask;
- s.cell = cell;
- s.cred = cred;
- s.securityindex = securityindex;
-
- hashtabforeach (connhtab, clear_cred, (void *)&s);
-}
-
-/*
- * check if servers are up for cell `cell'
- */
-
-struct down_state {
- int32_t cell;
- uint32_t *hosts;
- int len;
- int i;
- int flags;
-};
-
-static Bool
-host_down (void *ptr, void *arg)
-{
- ConnCacheEntry *e = (ConnCacheEntry *)ptr;
- struct down_state *s = (struct down_state *)arg;
- int i;
-
- if (s->cell == e->cell) {
-
- if (!(s->flags & CKSERV_DONTPING)) {
- conn_probe (e);
- }
-
- if (e->flags.alivep)
- return FALSE;
-
- if (s->flags & CKSERV_FSONLY && e->port != afsport)
- return FALSE;
-
- for (i = 0; i < s->i; ++i)
- if (s->hosts[i] == e->host)
- return FALSE;
-
- s->hosts[s->i] = e->host;
- ++s->i;
-
- if (s->i == s->len)
- return TRUE;
- }
- return FALSE;
-}
-
-/*
- * Check what hosts are down.
- *
- * Flags is VIOCCKFLAGS
- */
-
-void
-conn_downhosts(int32_t cell, uint32_t *hosts, int *num, int flags)
-{
- struct down_state s;
-
- if (*num == 0)
- return;
-
- s.cell = cell;
- s.hosts = hosts;
- s.len = *num;
- s.i = 0;
- s.flags = flags;
-
- hashtabforeach (connhtab, host_down, (void *)&s);
-
- *num = s.i;
-}
-
-/*
- * Compare two ConnCacheEntries rtt-wise. Typically used when sorting
- * entries.
- */
-
-int
-conn_rtt_cmp (const void *v1, const void *v2)
-{
- ConnCacheEntry **e1 = (ConnCacheEntry **)v1;
- ConnCacheEntry **e2 = (ConnCacheEntry **)v2;
-
- return (*e1)->rtt - (*e2)->rtt;
-}
-
-/*
- * Return true iff this error means we should mark the host as down
- * due to network errors
- */
-
-Bool
-host_downp (int error)
-{
- switch (error) {
- case ARLA_CALL_DEAD :
- case ARLA_INVALID_OPERATION :
- case ARLA_CALL_TIMEOUT :
- case ARLA_EOF :
- case ARLA_PROTOCOL_ERROR :
- case ARLA_USER_ABORT :
- case ARLA_ADDRINUSE :
- case ARLA_MSGSIZE :
- case RXGEN_CC_MARSHAL :
- case RXGEN_CC_UNMARSHAL :
- case RXGEN_SS_MARSHAL :
- case RXGEN_SS_UNMARSHAL :
- case RXGEN_DECODE :
- case RXGEN_OPCODE :
- case RXGEN_SS_XDRFREE :
- case RXGEN_CC_XDRFREE :
- return TRUE;
- default :
- return FALSE;
- }
-}
-
diff --git a/usr.sbin/afs/src/arlad/conn.h b/usr.sbin/afs/src/arlad/conn.h
deleted file mode 100644
index 92087df92b2..00000000000
--- a/usr.sbin/afs/src/arlad/conn.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Header for connection cache
- */
-
-/* $arla: conn.h,v 1.31 2002/09/07 10:42:57 lha Exp $ */
-
-#ifndef _CONN_H_
-#define _CONN_H_
-
-#include <stdio.h>
-#include <nnpfs/nnpfs_message.h>
-#include <cred.h>
-
-struct conncacheentry {
- uint32_t host; /* IP address of host */
- uint16_t port; /* port number at host */
- uint16_t service; /* RX service # */
- int32_t cell; /* cell of host */
- int securityindex;
- int (*probe)(struct rx_connection *);
- nnpfs_pag_t cred;
- struct rx_connection *connection;
- struct {
- unsigned alivep : 1;
- unsigned killme : 1;
- unsigned old : 1; /* Old server,vldb -> only VL_GetEntryByName */
- } flags;
- unsigned refcount;
- Listitem *probe_le;
- unsigned probe_next;
- unsigned ntries;
- struct conncacheentry *parent;
- int rtt;
-};
-
-typedef struct conncacheentry ConnCacheEntry;
-
-typedef enum { CONN_CS_NONE = 0,
- CONN_CS_CELL = 1,
- CONN_CS_CRED = 2,
- CONN_CS_SECIDX = 4,
- CONN_CS_ALL = 0xffff
-
-} clear_state_mask;
-
-extern int conn_rxkad_level;
-
-void
-conn_init (unsigned nentries);
-
-ConnCacheEntry *
-conn_get (int32_t cell, uint32_t host, uint16_t port, uint16_t service,
- int (*probe)(struct rx_connection *),
- CredCacheEntry *ce);
-
-void
-conn_dead (ConnCacheEntry *);
-
-void
-conn_alive (ConnCacheEntry *);
-
-void
-conn_probe (ConnCacheEntry *);
-
-void
-conn_ref (ConnCacheEntry *e);
-
-void
-conn_free (ConnCacheEntry *e);
-
-int32_t
-conn_host2cell (uint32_t host, uint16_t port, uint16_t service);
-
-Bool
-conn_serverupp (uint32_t host, uint16_t port, uint16_t service);
-
-void
-conn_status (void);
-
-void
-conn_clearcred (clear_state_mask mask,
- int32_t cell, nnpfs_pag_t cred, int securityindex);
-
-void
-conn_downhosts(int32_t cell, uint32_t *hosts, int *num, int flags);
-
-int
-conn_rtt_cmp (const void *v1, const void *v2);
-
-Bool
-host_downp (int error);
-
-Bool
-conn_isalivep (ConnCacheEntry *e);
-
-/*
- * Random factor to add to rtts when comparing them.
- * This is in microseconds/8
- */
-
-static const int RTT_FUZZ = 400000;
-
-#endif /* _CONN_H_ */
diff --git a/usr.sbin/afs/src/arlad/cred.c b/usr.sbin/afs/src/arlad/cred.c
deleted file mode 100644
index 2f1b4e22ca3..00000000000
--- a/usr.sbin/afs/src/arlad/cred.c
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Cache of credentials
- *
- * Each 'cred,type' pair is collected on a list where the head is in
- * the cell CRED_ROOT_CELL. This is to enable fast iterations over
- * all creds for a user (indexed on cred,type).
- */
-
-#include "arla_local.h"
-RCSID("$arla: cred.c,v 1.42 2003/06/10 04:23:23 lha Exp $");
-
-#define CRED_ROOT_CELL (-1)
-
-#define CREDCACHESIZE 101
-
-#define CREDFREEINC 10
-
-/* a hashtable of all credentials */
-static Hashtab *credhtab;
-
-/* list of all free entries */
-static List *freelist;
-
-/* # of credentials */
-static unsigned ncredentials;
-
-/* # of active credentials */
-static unsigned nactive_credentials;
-
-static void root_free(CredCacheEntry *);
-
-/*
- * Functions for handling entries into the credentials cache.
- */
-
-static int
-credcmp (void *a, void *b)
-{
- CredCacheEntry *c1 = (CredCacheEntry*)a;
- CredCacheEntry *c2 = (CredCacheEntry*)b;
-
- return c1->cred != c2->cred
- || c1->type != c2->type
- || c1->cell != c2->cell;
-}
-
-static unsigned
-credhash (void *a)
-{
- CredCacheEntry *c = (CredCacheEntry*)a;
-
- return c->cred + c->type + c->cell;
-}
-
-
-/*
- * Create `n' credentials and add them to `freelist'
- */
-
-static void
-create_new_credentials (unsigned n)
-{
- unsigned i;
- CredCacheEntry *entries;
-
- entries = (CredCacheEntry*)calloc (n, sizeof (CredCacheEntry));
- if (entries == NULL)
- arla_errx (1, ADEBERROR, "credcache: calloc failed");
- for (i = 0; i < n; ++i) {
- entries[i].cred_data = NULL;
- listaddhead (freelist, &entries[i]);
- }
- ncredentials += n;
-}
-
-/*
- * Initialize the cred cache.
- */
-
-void
-cred_init (unsigned nentries)
-{
- credhtab = hashtabnew (CREDCACHESIZE, credcmp, credhash);
- if (credhtab == NULL)
- arla_errx (1, ADEBERROR, "cred_init: hashtabnew failed");
- freelist = listnew ();
- if (freelist == NULL)
- arla_errx (1, ADEBERROR, "cred_init: listnew failed");
- ncredentials = 0;
- create_new_credentials (nentries);
-}
-
-static CredCacheEntry *
-internal_get (long cell, nnpfs_pag_t cred, int type)
-{
- CredCacheEntry *e;
- CredCacheEntry key;
-
- if (cell == CRED_ROOT_CELL)
- return NULL;
-
- key.cell = cell;
- key.type = type;
- key.cred = cred;
-
- e = (CredCacheEntry *)hashtabsearch (credhtab, (void *)&key);
-
- if (e == NULL && type == CRED_NONE) {
- e = cred_add (cred, type, 0, cell, 0, NULL, 0, 0);
- }
-
- if (e != NULL) {
- ++e->refcount;
- assert(e->cell != CRED_ROOT_CELL);
- }
-
- return e;
-}
-
-struct list_pag {
- int (*func)(CredCacheEntry *, void *);
- void *arg;
-};
-
-static Bool
-list_pag_func(List *l, Listitem *li, void *arg)
-{
- CredCacheEntry *e = listdata(li);
- struct list_pag *d = arg;
-
- return (d->func)(e, d->arg);
-}
-
-int
-cred_list_pag(nnpfs_pag_t cred, int type,
- int (*func)(CredCacheEntry *, void *),
- void *ptr)
-{
- CredCacheEntry key, *root_e;
- struct list_pag d;
-
- key.cell = CRED_ROOT_CELL;
- key.type = type;
- key.cred = cred;
-
- root_e = (CredCacheEntry *)hashtabsearch (credhtab, (void *)&key);
- if (root_e == NULL)
- return 0;
-
- d.func = func;
- d.arg = ptr;
-
- listiter(root_e->pag.list, list_pag_func, &d);
-
- return 0;
-}
-
-CredCacheEntry *
-cred_get (long cell, nnpfs_pag_t cred, int type)
-{
- if (type == CRED_ANY) {
- CredCacheEntry *e;
- int i;
-
- for (i = CRED_MAX; i > CRED_NONE; --i) {
- e = internal_get (cell, cred, i);
- if (e != NULL)
- return e;
- }
-
- return internal_get (cell, cred, CRED_NONE);
- } else
- return internal_get (cell, cred, type);
-}
-
-static void
-recycle_entry (CredCacheEntry *ce)
-{
- assert(ce->refcount == 0);
-
- if (ce->cell != CRED_ROOT_CELL)
- root_free(ce);
- if (!ce->flags.killme)
- hashtabdel (credhtab, ce);
- if (ce->cred_data != NULL)
- free (ce->cred_data);
- memset (ce, 0, sizeof(*ce));
- listaddhead (freelist, ce);
- --nactive_credentials;
-}
-
-void
-cred_free (CredCacheEntry *ce)
-{
- if (ce == NULL)
- return;
- assert (ce->cell != CRED_ROOT_CELL);
-
- --ce->refcount;
- if (ce->flags.killme && ce->refcount == 0)
- recycle_entry (ce);
-}
-
-static CredCacheEntry *
-get_free_cred (void)
-{
- CredCacheEntry *e;
-
- e = (CredCacheEntry *)listdelhead (freelist);
- if (e != NULL)
- return e;
-
- create_new_credentials (CREDFREEINC);
-
- e = (CredCacheEntry *)listdelhead (freelist);
- if (e != NULL)
- return e;
-
- arla_errx (1, ADEBERROR,
- "credcache: there was no way of getting a cred");
-}
-
-static void
-root_free(CredCacheEntry *e)
-{
- CredCacheEntry key, *root_e;
-
- assert(e->cell != CRED_ROOT_CELL);
-
- if (e->pag.li == NULL)
- return;
-
- key.cell = CRED_ROOT_CELL;
- key.type = e->type;
- key.cred = e->cred;
-
- root_e = (CredCacheEntry *)hashtabsearch (credhtab, (void *)&key);
- assert(root_e);
-
- listdel(root_e->pag.list, e->pag.li);
- e->pag.li = NULL;
-
- if (listemptyp(root_e->pag.list)) {
- listfree(root_e->pag.list);
- root_e->pag.list = NULL;
- recycle_entry(root_e);
- }
-}
-
-static void
-add_to_root_entry(CredCacheEntry *e)
-{
- CredCacheEntry key, *root_e;
-
- assert(e->cell != CRED_ROOT_CELL);
-
- key.cell = CRED_ROOT_CELL;
- key.type = e->type;
- key.cred = e->cred;
-
- root_e = (CredCacheEntry *)hashtabsearch (credhtab, (void *)&key);
- if (root_e == NULL) {
- root_e = get_free_cred ();
-
- root_e->cell = CRED_ROOT_CELL;
- root_e->type = e->type;
- root_e->cred = e->cred;
- root_e->securityindex = -1;
- root_e->expire = 0;
- root_e->cred_data = NULL;
- root_e->uid = e->uid;
- root_e->pag.list = listnew();
- if (root_e->pag.list == NULL)
- arla_errx (1, ADEBERROR, "add_to_root_entry: out of memory");
-
- hashtabadd(credhtab, root_e);
-
- ++nactive_credentials;
- }
- e->pag.li = listaddhead (root_e->pag.list, e);
-}
-
-CredCacheEntry *
-cred_add (nnpfs_pag_t cred, int type, int securityindex, long cell,
- time_t expire, void *cred_data, size_t cred_data_sz,
- uid_t uid)
-{
- void *data;
- CredCacheEntry *e;
- CredCacheEntry *old;
-
- if (cred_data != NULL) {
- data = malloc (cred_data_sz);
- if (data == NULL)
- return NULL;
- memcpy (data, cred_data, cred_data_sz);
- } else
- data = NULL;
-
- e = get_free_cred ();
-
- e->cred = cred;
- e->type = type;
- e->securityindex = securityindex;
- e->cell = cell;
- e->expire = expire;
- e->cred_data = data;
- e->uid = uid;
- e->pag.li = NULL;
-
- add_to_root_entry(e);
-
- old = (CredCacheEntry *)hashtabsearch (credhtab, (void *)e);
- if (old != NULL)
- cred_delete (old);
-
- hashtabadd (credhtab, e);
-
- ++nactive_credentials;
-
- return e;
-}
-
-/*
- *
- */
-
-void
-cred_delete (CredCacheEntry *ce)
-{
- assert(ce->cell != CRED_ROOT_CELL);
-
- if (ce->refcount > 0) {
- ce->flags.killme = 1;
- hashtabdel (credhtab, ce);
- root_free(ce);
- } else
- recycle_entry (ce);
-}
-
-/*
- *
- */
-
-void
-cred_expire (CredCacheEntry *ce)
-{
- const char *cell_name = cell_num2name (ce->cell);
-
- if (cell_name != NULL)
- arla_warnx (ADEBWARN,
- "Credentials for UID %u in cell %s have expired",
- (unsigned)ce->uid, cell_name);
- else
- arla_warnx (ADEBWARN,
- "Credentials for UID %u in cell unknown %ld have expired",
- (unsigned)ce->uid, ce->cell);
-
- cred_delete (ce);
-}
-
-static Bool
-remove_entry (void *ptr, void *arg)
-{
- CredCacheEntry *ce = (CredCacheEntry *)ptr;
- nnpfs_pag_t *cred = (nnpfs_pag_t *)arg;
-
- if (ce->cell == CRED_ROOT_CELL)
- return FALSE;
-
- if (ce->cred == *cred)
- cred_delete (ce);
- return FALSE;
-}
-
-void
-cred_remove (nnpfs_pag_t cred)
-{
- hashtabforeach (credhtab, remove_entry, &cred);
-}
-
-static Bool
-print_cred (void *ptr, void *arg)
-{
- CredCacheEntry *e = (CredCacheEntry *)ptr;
-
- arla_log(ADEBVLOG, "cred = %u, type = %d, securityindex = %d, "
- "cell = %ld, refcount = %u, killme = %d, uid = %lu",
- e->cred, e->type, e->securityindex, e->cell, e->refcount,
- e->flags.killme, (unsigned long)e->uid);
- return FALSE;
-}
-
-void
-cred_status (void)
-{
- arla_log(ADEBVLOG, "%u(%u) credentials",
- nactive_credentials, ncredentials);
- hashtabforeach (credhtab, print_cred, NULL);
-}
diff --git a/usr.sbin/afs/src/arlad/cred.h b/usr.sbin/afs/src/arlad/cred.h
deleted file mode 100644
index c0f9bcae09b..00000000000
--- a/usr.sbin/afs/src/arlad/cred.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 1995 - 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Header for credetial cache
- */
-
-/* $arla: cred.h,v 1.33 2003/06/10 16:21:11 lha Exp $ */
-
-#ifndef _CRED_H_
-#define _CRED_H_
-
-#include <sys/types.h>
-#include <time.h>
-#include <lock.h>
-#ifdef HAVE_KRB4
-#ifdef HAVE_OPENSSL
-#include <openssl/des.h>
-#else
-#include <des.h>
-#endif
-#include <krb.h>
-#endif /* HAVE_KRB4 */
-#include "bool.h"
-#include <nnpfs/nnpfs_message.h>
-
-/* The cred-types we support */
-#define CRED_NONE 0
-#define CRED_KRB4 1
-#define CRED_KRB5 2
-#define CRED_GK_K5 3
-#define CRED_MAX CRED_GK_K5
-#define CRED_ANY (-1)
-
-struct cred_rxkad {
- struct ClearToken ct;
- size_t ticket_len;
- unsigned char ticket[MAXKRB4TICKETLEN];
-};
-
-struct cred_rxgk {
- int type;
- union {
- struct {
- int32_t kvno;
- int32_t enctype;
- size_t sessionkey_len;
- void *sessionkey;
- size_t ticket_len;
- void *ticket;
- } k5;
- } t;
-};
-
-typedef struct {
- nnpfs_pag_t cred;
- uid_t uid;
- int type;
- int securityindex;
- long cell;
- time_t expire;
- void *cred_data;
- void (*cred_free_func)(void *);
- struct {
- unsigned killme : 1;
- } flags;
- unsigned refcount;
- union {
- List *list;
- Listitem *li;
- } pag;
-} CredCacheEntry;
-
-void cred_init (unsigned nentries);
-
-CredCacheEntry *
-cred_get (long cell, nnpfs_pag_t cred, int type);
-
-int
-cred_list_pag(nnpfs_pag_t, int,
- int (*func)(CredCacheEntry *, void *),
- void *);
-
-void
-cred_free (CredCacheEntry *ce);
-
-CredCacheEntry *
-cred_add (nnpfs_pag_t cred, int type, int securityindex, long cell,
- time_t expire, void *cred_data, size_t cred_data_sz,
- uid_t uid);
-
-void
-cred_delete (CredCacheEntry *ce);
-
-void
-cred_expire (CredCacheEntry *ce);
-
-void cred_status (void);
-
-void cred_remove (nnpfs_pag_t cred);
-
-#endif /* _CRED_H_ */
diff --git a/usr.sbin/afs/src/arlad/d-trans.c b/usr.sbin/afs/src/arlad/d-trans.c
deleted file mode 100644
index abe63ec64ee..00000000000
--- a/usr.sbin/afs/src/arlad/d-trans.c
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "arla_local.h"
-#ifdef RCSID
-RCSID("$arla: d-trans.c,v 1.2 2002/09/07 10:43:01 lha Exp $") ;
-#endif
-
-
-struct transform_fid {
- VenusFid dfid; /* disconnected fid */
- VenusFid cfid; /* connecteted fid */
-};
-
-/*
- *
- */
-
-static Hashtab *transform_htab;
-
-/*
- * Transaction fid related functions
- */
-
-/*
- * Find disconnected fid `dfid' in the transaction database.
- */
-
-static struct transform_fid *
-find_fid_transform(VenusFid *dfid)
-{
- struct transform_fid key;
- key.dfid = *dfid;
- return hashtabsearch(transform_htab, &key);
-}
-
-/*
- * Transform the `fid` to a connected fid, return the pointer to `fid'
- * so it can be used in a paramater to a function call.
- */
-
-static VenusFid *
-transform_fid(VenusFid *fid)
-{
- struct transform_fid *t = find_fid_transform(fid);
- if (t)
- *fid = t->cfid;
- return fid;
-}
-
-/*
- * Add a mapping between the disconnected fid `dfid' and the connected
- * fid `cfid' in the transaction database.
- */
-
-static void
-add_fid_transform(VenusFid *dfid, VenusFid *cfid, struct transform_fid *f)
-{
- f->cfid = *cfid;
- f->dfid = *dfid;
- hashtabadd(transform_htab, f);
-}
-
-/*
- * Help function for hashtable, compare `p1' and `p2'.
- */
-
-static int
-tfid_cmp(void *p1, void *p2)
-{
- struct transform_fid *t1 = (struct transform_fid *)p1;
- struct transform_fid *t2 = (struct transform_fid *)p2;
- return VenusFid_cmp(&t1->dfid, &t2->dfid);
-}
-
-/*
- * Help function for hashtable, calculate hash for `p'.
- */
-
-static unsigned
-tfid_hash(void *p)
-{
- struct transform_fid *t = (struct transform_fid *)p;
- return t->dfid.Cell + t->dfid.fid.Volume + t->dfid.fid.Vnode
- + t->dfid.fid.Unique;
-}
-
-static Bool
-tfid_free(void *p, void *arg)
-{
- struct transform_fid *t = (struct transform_fid *)p;
- memset(t, 0, sizeof(*t));
- free(t);
- return TRUE;
-}
-
-
-/*
- * Reintegrate the log
- */
-
-int
-disco_reintegrate(nnpfs_pag_t pag)
-{
- struct disco_play_context *c;
- char buf[DISCO_MAX_BUF_SZ];
- CredCacheEntry *ce;
- FCacheEntry *dir_entry, *child_entry;
-#if 0
- VenusFid dir_fid;
-#endif
- VenusFid child_fid;
- AFSStoreStatus store_status;
- AFSFetchStatus fetch_status;
- int ret, store_data;
- int old_conn_mode = connected_mode;
- struct transform_fid *add_fid_f;
-
- transform_htab = hashtabnewf(0, tfid_cmp, tfid_hash, HASHTAB_GROW);
- if (transform_htab == NULL)
- return ENOMEM;
-
-#if 0
- modified_log = 0; /* XXX */
-#endif
-
- disco_openlog();
-
- connected_mode = CONNECTED;
-
- disco_init_context(&c);
-
- while(disco_next_entry(c, buf, sizeof(buf)) == 0) {
- struct disco_header *h = (struct disco_header *)buf;
-
- if (h->opcode >= DISCO_OP_MAX_OPCODE) {
- arla_warnx(ADEBERROR, "opcode > DISCO_OP_MAX_OPCODE\n");
- goto next_entry;
- }
-
- dir_entry = NULL;
- child_entry = NULL;
- ce = NULL;
-
- if (h->flags & DISCO_HEADER_NOP)
- goto next_entry;
-
- switch(h->opcode) {
- case DISCO_OP_UNLINK:
- break;
- case DISCO_OP_REMOVE_DIR:
- break;
- case DISCO_OP_CREATE_FILE: {
- struct disco_create_file *f = (struct disco_create_file *)buf;
-
- store_data = 0;
-
- transform_fid(&f->parentfid);
-
- ce = cred_get(f->parentfid.Cell, pag, CRED_ANY);
- if (ce == NULL) {
- arla_warnx(ADEBERROR, "create failed: (NULL cred_get)"
- "parent fid %d.%d.%d.%d name %s",
- f->parentfid.Cell, f->parentfid.fid.Volume,
- f->parentfid.fid.Vnode, f->parentfid.fid.Unique,
- f->name);
- goto next_entry;
- }
- ret = fcache_find(&dir_entry, f->parentfid);
- if (ret != 0) {
- arla_warnx(ADEBERROR, "create failed: (parent)"
- "parent fid %d.%d.%d.%d name %s",
- f->parentfid.Cell, f->parentfid.fid.Volume,
- f->parentfid.fid.Vnode, f->parentfid.fid.Unique,
- f->name);
- goto next_entry;
- }
-
- transform_fid(&f->fid);
-
- ret = fcache_find(&child_entry, f->fid);
- if (ret != 0) {
- arla_warnx(ADEBERROR, "create failed (child): "
- "parent fid %d.%d.%d.%d name %s",
- f->parentfid.Cell, f->parentfid.fid.Volume,
- f->parentfid.fid.Vnode, f->parentfid.fid.Unique,
- f->name);
- goto next_entry;
-
- }
-
- /* check to make sure we aren't already in the transaction
- * database
- */
- if (find_fid_transform(&f->fid)) {
- arla_warnx(ADEBERROR, "create failed (dfid exists already): "
- "parent fid %d.%d.%d.%d name %s",
- f->parentfid.Cell, f->parentfid.fid.Volume,
- f->parentfid.fid.Vnode, f->parentfid.fid.Unique,
- f->name);
- goto next_entry;
- }
-
- /* allocate transform entry before create */
- add_fid_f = malloc(sizeof(*add_fid_f));
- if (add_fid_f == NULL) {
- arla_warnx(ADEBERROR, "create failed (malloc failed): "
- "parent fid %d.%d.%d.%d name %s",
- f->parentfid.Cell, f->parentfid.fid.Volume,
- f->parentfid.fid.Vnode, f->parentfid.fid.Unique,
- f->name);
- goto next_entry;
- }
-
- store_status = f->storestatus; /* XXX */
-
- ret = create_file(dir_entry, f->name, &store_status, &child_fid,
- &fetch_status, ce);
-
- if (ret == 0) {
- if (VenusFid_cmp(&f->fid, &child_fid) != 0) {
- add_fid_transform(&f->fid, &child_fid, add_fid_f);
- recon_hashtabdel(child_entry);
- child_entry->fid = child_fid;
- update_fid (f->fid, NULL, child_fid, child_entry);
- recon_hashtabadd(child_entry);
-
- adir_changefid(&dir_entry, f->name, &child_fid, &ce);
- }
-
- if (store_data)
- store_data = 1;
-
- } else {
- free(add_fid_f);
- /* XXX invalidate name cache */
- arla_warn(ADEBWARN, ret, "create failed (create_file): "
- "parent fid %d.%d.%d.%d name %s",
- f->parentfid.Cell, f->parentfid.fid.Volume,
- f->parentfid.fid.Vnode, f->parentfid.fid.Unique,
- f->name);
-
- }
- /* XXX invalidate the parent's name cache */
- break_callback(dir_entry);
-
- break;
- }
- case DISCO_OP_CREATE_SYMLINK:
- case DISCO_OP_CREATE_LINK:
- break;
- case DISCO_OP_STOREDATA:
- break;
- }
-
- next_entry:
-
- if (dir_entry)
- fcache_release(dir_entry);
- if (child_entry)
- fcache_release(child_entry);
- if (ce)
- cred_free(ce);
-
- arla_warnx(ADEBWARN, "next reintegrate entry");
- }
-
- disco_close_context(c);
-
- disco_closelog();
-
-
- hashtabcleantab(transform_htab, tfid_free, NULL);
- hashtabrelease(transform_htab);
- transform_htab = NULL;
-
- connected_mode = old_conn_mode;
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/arlad/darla.c b/usr.sbin/afs/src/arlad/darla.c
deleted file mode 100644
index 8e4b87adf6a..00000000000
--- a/usr.sbin/afs/src/arlad/darla.c
+++ /dev/null
@@ -1,104 +0,0 @@
-OBSOLETE /* COPYRIGHT (C) 1998
-OBSOLETE * THE REGENTS OF THE UNIVERSITY OF MICHIGAN
-OBSOLETE * ALL RIGHTS RESERVED
-OBSOLETE *
-OBSOLETE * PERMISSION IS GRANTED TO USE, COPY, CREATE DERIVATIVE WORKS
-OBSOLETE * AND REDISTRIBUTE THIS SOFTWARE AND SUCH DERIVATIVE WORKS
-OBSOLETE * FOR ANY PURPOSE, SO LONG AS THE NAME OF THE UNIVERSITY OF
-OBSOLETE * MICHIGAN IS NOT USED IN ANY ADVERTISING OR PUBLICITY
-OBSOLETE * PERTAINING TO THE USE OR DISTRIBUTION OF THIS SOFTWARE
-OBSOLETE * WITHOUT SPECIFIC, WRITTEN PRIOR AUTHORIZATION. IF THE
-OBSOLETE * ABOVE COPYRIGHT NOTICE OR ANY OTHER IDENTIFICATION OF THE
-OBSOLETE * UNIVERSITY OF MICHIGAN IS INCLUDED IN ANY COPY OF ANY
-OBSOLETE * PORTION OF THIS SOFTWARE, THEN THE DISCLAIMER BELOW MUST
-OBSOLETE * ALSO BE INCLUDED.
-OBSOLETE *
-OBSOLETE * THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION
-OBSOLETE * FROM THE UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY
-OBSOLETE * PURPOSE, AND WITHOUT WARRANTY BY THE UNIVERSITY OF
-OBSOLETE * MICHIGAN OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
-OBSOLETE * WITHOUT LIMITATION THE IMPLIED WARRANTIES OF
-OBSOLETE * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
-OBSOLETE * REGENTS OF THE UNIVERSITY OF MICHIGAN SHALL NOT BE LIABLE
-OBSOLETE * FOR ANY DAMAGES, INCLUDING SPECIAL, INDIRECT, INCIDENTAL, OR
-OBSOLETE * CONSEQUENTIAL DAMAGES, WITH RESPECT TO ANY CLAIM ARISING
-OBSOLETE * OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE, EVEN
-OBSOLETE * IF IT HAS BEEN OR IS HEREAFTER ADVISED OF THE POSSIBILITY OF
-OBSOLETE * SUCH DAMAGES.
-OBSOLETE */
-OBSOLETE
-OBSOLETE #include "arla_local.h"
-OBSOLETE
-OBSOLETE RCSID("$arla: darla.c,v 1.8 2002/07/23 15:22:51 lha Exp $");
-OBSOLETE
-OBSOLETE int DARLA_Open(DARLA_file *Dfp, char *fname, int oflag)
-OBSOLETE {
-OBSOLETE
-OBSOLETE int fd;
-OBSOLETE
-OBSOLETE fd = open(fname, oflag, 0600);
-OBSOLETE if (fd == -1)
-OBSOLETE arla_log(ADEBMISC, "DARLA_Open: errno=%d", errno);
-OBSOLETE if (fd > 0)
-OBSOLETE {
-OBSOLETE Dfp->fd = fd;
-OBSOLETE Dfp->offset=0;
-OBSOLETE Dfp->log_entries = 0;
-OBSOLETE }
-OBSOLETE
-OBSOLETE return fd;
-OBSOLETE }
-OBSOLETE
-OBSOLETE int DARLA_Close(DARLA_file *Dfp)
-OBSOLETE {
-OBSOLETE int ret;
-OBSOLETE
-OBSOLETE ret = close(Dfp->fd);
-OBSOLETE Dfp->fd = 0;
-OBSOLETE Dfp->offset =0;
-OBSOLETE arla_log(ADEBMISC, "DARLA_Close: ret=%d", ret);
-OBSOLETE return ret;
-OBSOLETE }
-OBSOLETE
-OBSOLETE int DARLA_Read(DARLA_file *Dfp, char *cp, int len)
-OBSOLETE {
-OBSOLETE ssize_t read_size;
-OBSOLETE
-OBSOLETE if (Dfp->fd)
-OBSOLETE {
-OBSOLETE read_size = read (Dfp->fd, cp, len);
-OBSOLETE }
-OBSOLETE else
-OBSOLETE read_size = 0;
-OBSOLETE
-OBSOLETE return read_size;
-OBSOLETE }
-OBSOLETE
-OBSOLETE int DARLA_Write(DARLA_file *Dfp, char *cp, int len)
-OBSOLETE {
-OBSOLETE ssize_t write_size;
-OBSOLETE
-OBSOLETE if (Dfp->fd)
-OBSOLETE {
-OBSOLETE write_size = write(Dfp->fd, cp, len);
-OBSOLETE }
-OBSOLETE else
-OBSOLETE write_size = 0;
-OBSOLETE
-OBSOLETE return write_size;
-OBSOLETE }
-OBSOLETE
-OBSOLETE int DARLA_Seek(DARLA_file *Dfp, int offset, int whence)
-OBSOLETE {
-OBSOLETE
-OBSOLETE off_t lseek_off;
-OBSOLETE
-OBSOLETE if (Dfp->fd)
-OBSOLETE {
-OBSOLETE lseek_off = lseek(Dfp->fd, offset, whence);
-OBSOLETE }
-OBSOLETE else
-OBSOLETE lseek_off = 0;
-OBSOLETE
-OBSOLETE return lseek_off;
-OBSOLETE }
diff --git a/usr.sbin/afs/src/arlad/darla.h b/usr.sbin/afs/src/arlad/darla.h
deleted file mode 100644
index a22243231ce..00000000000
--- a/usr.sbin/afs/src/arlad/darla.h
+++ /dev/null
@@ -1,50 +0,0 @@
-OBSOLETE /* COPYRIGHT (C) 1998
-OBSOLETE * THE REGENTS OF THE UNIVERSITY OF MICHIGAN
-OBSOLETE * ALL RIGHTS RESERVED
-OBSOLETE *
-OBSOLETE * PERMISSION IS GRANTED TO USE, COPY, CREATE DERIVATIVE WORKS
-OBSOLETE * AND REDISTRIBUTE THIS SOFTWARE AND SUCH DERIVATIVE WORKS
-OBSOLETE * FOR ANY PURPOSE, SO LONG AS THE NAME OF THE UNIVERSITY OF
-OBSOLETE * MICHIGAN IS NOT USED IN ANY ADVERTISING OR PUBLICITY
-OBSOLETE * PERTAINING TO THE USE OR DISTRIBUTION OF THIS SOFTWARE
-OBSOLETE * WITHOUT SPECIFIC, WRITTEN PRIOR AUTHORIZATION. IF THE
-OBSOLETE * ABOVE COPYRIGHT NOTICE OR ANY OTHER IDENTIFICATION OF THE
-OBSOLETE * UNIVERSITY OF MICHIGAN IS INCLUDED IN ANY COPY OF ANY
-OBSOLETE * PORTION OF THIS SOFTWARE, THEN THE DISCLAIMER BELOW MUST
-OBSOLETE * ALSO BE INCLUDED.
-OBSOLETE *
-OBSOLETE * THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION
-OBSOLETE * FROM THE UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY
-OBSOLETE * PURPOSE, AND WITHOUT WARRANTY BY THE UNIVERSITY OF
-OBSOLETE * MICHIGAN OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
-OBSOLETE * WITHOUT LIMITATION THE IMPLIED WARRANTIES OF
-OBSOLETE * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
-OBSOLETE * REGENTS OF THE UNIVERSITY OF MICHIGAN SHALL NOT BE LIABLE
-OBSOLETE * FOR ANY DAMAGES, INCLUDING SPECIAL, INDIRECT, INCIDENTAL, OR
-OBSOLETE * CONSEQUENTIAL DAMAGES, WITH RESPECT TO ANY CLAIM ARISING
-OBSOLETE * OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE, EVEN
-OBSOLETE * IF IT HAS BEEN OR IS HEREAFTER ADVISED OF THE POSSIBILITY OF
-OBSOLETE * SUCH DAMAGES.
-OBSOLETE */
-OBSOLETE
-OBSOLETE /* $arla: darla.h,v 1.4 2002/07/23 15:22:52 lha Exp $ */
-OBSOLETE
-OBSOLETE #ifndef _DARLA_H
-OBSOLETE #define _DARLA_H
-OBSOLETE
-OBSOLETE #include <lock.h>
-OBSOLETE
-OBSOLETE typedef struct _DARLA_file {
-OBSOLETE int fd; /*file descriptor of the current file */
-OBSOLETE long offset; /*current byte offset */
-OBSOLETE struct Lock bs_lock; /*lock to synchronize access */
-OBSOLETE long log_entries; /*number of entries */
-OBSOLETE } DARLA_file;
-OBSOLETE
-OBSOLETE int DARLA_Open(DARLA_file *Dfp, char *fname, int oflag);
-OBSOLETE int DARLA_Close(DARLA_file *Dfp);
-OBSOLETE int DARLA_Read(DARLA_file *Dfp, char *cp, int len);
-OBSOLETE int DARLA_Write(DARLA_file *Dfp, char *cp, int len);
-OBSOLETE int DARLA_Seek(DARLA_file *Dfp, int offset, int whence);
-OBSOLETE
-OBSOLETE #endif /* _DARLA_H */
diff --git a/usr.sbin/afs/src/arlad/disco.c b/usr.sbin/afs/src/arlad/disco.c
deleted file mode 100644
index eadee8a5f69..00000000000
--- a/usr.sbin/afs/src/arlad/disco.c
+++ /dev/null
@@ -1,503 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "arla_local.h"
-#ifdef RCSID
-RCSID("$arla: disco.c,v 1.3 2002/07/17 09:28:59 mattiasa Exp $") ;
-#endif
-
-const char *op_names[] = DISCO_OP_NAMES;
-
-static int log_fd = -1;
-static unsigned long modified_log = 0;
-
-/*
- * Transaction log entries
- */
-
-/*
- * Open the log on disk
- */
-
-int
-disco_openlog(void)
-{
- int save_errno;
-
- if (log_fd >= 0)
- return 0;
-
- log_fd = open(ARLA_LOG, O_RDWR | O_BINARY | O_CREAT, 0644);
- if (log_fd < 0) {
- save_errno = errno;
-#if 0
- arla_warn (ADEBWARN, save_errno, "can't open arla logfile %s",
- ARLA_LOG);
-#endif
- return save_errno;
- }
-
- /* if this is a new file, make sure there is a nop */
- if (lseek(log_fd, 0, SEEK_END) == 0)
- disco_nop_entry();
-
- return 0;
-}
-
-/*
- * Close the log
- */
-
-int
-disco_closelog(void)
-{
- int ret;
- if (log_fd < 0)
- return 0;
-
- ret = close(log_fd);
- log_fd = -1;
- if (ret < 0)
- return errno;
- return 0;
-}
-
-/*
- *
- */
-
-static uint32_t
-checksum_of_data(void *data, size_t sz)
-{
- /* XXX implement me */
- return 0;
-}
-
-/*
- *
- */
-
-static int
-validate_item(void *data, size_t size)
-{
- struct disco_header *h = data;
-
- if (checksum_of_data(((unsigned char *)data) + 4, size - 4) == h->checksum)
- return 1;
- return 0;
-}
-
-/*
- *
- */
-
-static uint32_t
-write_log_entry(uint16_t opcode, void *data, uint16_t size,
- int32_t flags, uint32_t prev_id, uint32_t offset)
-{
- struct disco_header *h = data;
- uint32_t disco_id;
- int sz, nr;
-
- assert(log_fd >= 0);
- assert(size >= sizeof(struct disco_header));
- assert(size <= DISCO_MAX_BUF_SZ);
-
- h->flags = flags;
- h->opcode = opcode;
- h->size = size;
- h->prev_id = prev_id;
-
- h->checksum = checksum_of_data(((unsigned char *)data) + 4, size - 4);
-
- if (offset == 0)
- disco_id = lseek(log_fd, 0, SEEK_END);
- else
- disco_id = lseek(log_fd, offset, SEEK_SET);
- sz = 0;
- while (sz != size && (nr = write(log_fd, data + sz, size - sz)) != -1
- && nr != 0)
- sz += nr;
-
- modified_log++;
-
- return disco_id;
-}
-
-/*
- *
- */
-
-static int
-read_entry(uint32_t log_item, void *data, size_t *sz)
-{
- struct disco_header *h;
- ssize_t ret, nr;
- char *cp = data;
- assert(log_fd >= 0);
-
-#if 0
- /* XXX You have got to be fucking kidding me */
- assert ((((unsigned long)data) & 3) == 0); /* XXX */
-#endif
-
- lseek(log_fd, log_item, SEEK_SET);
-
- nr = 0;
- while (nr != sizeof(struct disco_header)) {
- ret = read(log_fd, cp + nr, sizeof(struct disco_header) - nr);
- if (ret == 0)
- return -1;
- else if (ret == -1) {
- if (errno != EINTR)
- return(-1);
- } else
- nr += ret;
- }
-
- h = data;
- if (h->size > *sz)
- errx(-1, "read_entry: sz %d too small (need %d)\n", *sz, h->size);
- *sz = h->size;
-
- nr = 0;
- while (nr != (*sz - sizeof(struct disco_header))) {
- ret = read(log_fd, cp + sizeof(struct disco_header) + nr,
- *sz - sizeof(struct disco_header) - nr);
- if (ret == 0)
- return -1;
- else if (ret == -1) {
- if (errno != EINTR)
- return(-1);
- } else
- nr += ret;
- }
-
- if (!validate_item(data, *sz))
- return(-1);
-
- return 0;
-}
-
-/*
- *
- */
-
-static void
-nop_entry(uint32_t disco_id, uint16_t opcode, int32_t flags, void *buf, size_t sz)
-{
- write_log_entry(opcode, buf, sz, flags, 0, disco_id);
-}
-
-/*
- * Nop the operation chain for disco_id an up, return non-zero if the
- * entry was a disconncted node.
- */
-
-static int
-nop_chain(uint32_t disco_id, VenusFid *newparent,
- char *newname, size_t namesz)
-{
- char buf[DISCO_MAX_BUF_SZ];
- struct disco_header *h = (struct disco_header *)buf;
- uint32_t nop_id;
- int disco = 0, last_dir_found = 0;
- size_t sz;
-
- while (disco_id) {
- nop_id = disco_id;
- sz = sizeof(buf);
- if (read_entry(disco_id, buf, &sz) != 0)
- errx(-1, "nop_chain: read entry failed");
- disco_id = h->prev_id;
-
- if (disco_id == 0) {
- /* last of link in chain */
- switch (h->opcode) {
- case DISCO_OP_CREATE_DIR:
- case DISCO_OP_CREATE_FILE:
- case DISCO_OP_CREATE_SYMLINK:
- case DISCO_OP_CREATE_LINK:
- disco = 1;
- }
- }
-
- if (h->opcode == DISCO_OP_RENAME && !last_dir_found) {
- /* keep track of name changes, so we can remove it in old
- * directory when connecting */
- struct disco_rename *rn = (struct disco_rename *)buf;
-
- if (sz != sizeof(struct disco_rename)) {
- arla_warnx(ADEBMISC, "sz != sizeof(struct disco_rename)");
- exit(-1);
- }
-
- *newparent = rn->sourcepfid;
- strlcpy(newname, rn->sourcename, namesz);
- last_dir_found = 1;
- }
-
- assert (nop_id > h->prev_id);
- nop_entry(nop_id, h->opcode, h->flags | DISCO_HEADER_NOP, buf, sz);
- }
- return disco;
-}
-
-uint32_t
-disco_store_status(VenusFid *fid, AFSStoreStatus *ss, uint32_t prev_disco_id)
-{
- struct disco_store_status e;
-
- memset(&e, 0, sizeof(e));
-
- e.fid = *fid;
- e.storestatus = *ss;
-
- return write_log_entry(DISCO_OP_STORESTATUS,
- &e, sizeof(e),
- prev_disco_id, 0, 0);
-}
-
-
-uint32_t
-disco_store_data(VenusFid *fid, AFSStoreStatus *ss, uint32_t prev_disco_id)
-{
- struct disco_store_data e;
-
- memset(&e, 0, sizeof(e));
-
- e.fid = *fid;
- e.storestatus = *ss;
-
- return write_log_entry(DISCO_OP_STOREDATA,
- &e, sizeof(e),
- prev_disco_id, 0, 0);
-}
-
-
-uint32_t
-disco_create_file(VenusFid *parent, VenusFid *fid, char *name,
- AFSStoreStatus *ss)
-{
- struct disco_create_file e;
- memset(&e, 0, sizeof(e));
-
- e.parentfid = *parent;
- e.fid = *fid;
- strlcpy(e.name, name, sizeof(e.name));
- e.storestatus = *ss;
-
- return write_log_entry(DISCO_OP_CREATE_FILE, &e, sizeof(e), 0, 0, 0);
-}
-
-uint32_t
-disco_create_dir(VenusFid *parent, VenusFid *fid, char *name,
- AFSStoreStatus *ss)
-{
- struct disco_create_dir e;
- memset(&e, 0, sizeof(e));
-
- e.parentfid = *parent;
- e.fid = *fid;
- strlcpy(e.name, name, sizeof(e.name));
- e.storestatus = *ss;
-
- return write_log_entry(DISCO_OP_CREATE_DIR, &e, sizeof(e), 0, 0, 0);
-}
-
-uint32_t
-disco_unlink(VenusFid *parent, VenusFid *fid, const char *name, uint32_t prev_id)
-{
- VenusFid newparent = *parent;
- char newname[AFSNAMEMAX];
- int discon;
-
- strlcpy(newname, name, sizeof(newname));
-
- discon = nop_chain(prev_id, &newparent, newname, sizeof(newname));
-
- if (!discon) {
- struct disco_unlink e;
- memset(&e, 0, sizeof(e));
-
- e.parentfid = newparent;
- e.fid = *fid;
- strlcpy(e.name, newname, sizeof(e.name));
-
- return write_log_entry(DISCO_OP_UNLINK, &e, sizeof(e), 0, 0, 0);
- }
- return 0;
-}
-
-/*
- *
- */
-
-void
-disco_nop_entry(void)
-{
- char buf[sizeof(struct disco_nop)];
- memset(buf, 0, sizeof(buf));
- nop_entry(0, DISCO_OP_NOP, 0, buf, sizeof(struct disco_nop));
-}
-
-/*
- * Replay support
- */
-
-struct disco_play_context {
- uint32_t next_disco_id;
-};
-
-/*
- *
- */
-
-int
-disco_init_context(struct disco_play_context **c_ret)
-{
- struct disco_play_context *c;
-
- *c_ret = NULL;
- c = malloc(sizeof(*c));
- if (c == NULL)
- return ENOMEM;
- c->next_disco_id = 0;
- *c_ret = c;
- return 0;
-}
-
-/*
- *
- */
-
-int
-disco_next_entry(struct disco_play_context *c, void *ptr, size_t sz)
-{
- assert(c != NULL);
-
- if (read_entry(c->next_disco_id, ptr, &sz))
- return -1;
-
- c->next_disco_id += sz;
- return 0;
-}
-
-/*
- *
- */
-
-int
-disco_close_context(struct disco_play_context *c)
-{
- free(c);
- return 0;
-}
-
-/*
- *
- */
-
-void
-disco_print_entry(FILE *f, void *ptr, size_t sz)
-{
- struct disco_header *h = ptr;
- const char *nop_p = "", *ph;
- char buf[10];
-
- if (sz < sizeof(struct disco_header))
- return;
-
- if (h->opcode < sizeof(op_names)/sizeof(op_names[0]))
- ph = op_names[h->opcode];
- else {
- snprintf(buf, sizeof(buf), "%d", h->opcode);
- ph = buf;
- }
-
- if (h->flags & DISCO_HEADER_NOP)
- nop_p = "entry optimized away";
-
- fprintf(f, "entry opcode %s, sz %d %s\n",
- ph, h->size, nop_p);
-
- switch(h->opcode) {
- case DISCO_OP_CREATE_FILE: {
- struct disco_create_file *e = ptr;
-
- fprintf(f, " parent: %d.%d.%d.%d name: %s fid: %d.%d.%d.%d\n",
- e->parentfid.Cell,
- e->parentfid.fid.Volume,
- e->parentfid.fid.Vnode,
- e->parentfid.fid.Unique,
- e->name,
- e->fid.Cell,
- e->fid.fid.Volume,
- e->fid.fid.Vnode,
- e->fid.fid.Unique);
- break;
- }
- case DISCO_OP_UNLINK: {
- struct disco_unlink *e = ptr;
-
- fprintf(f, " parent: %d.%d.%d.%d name: %s fid: %d.%d.%d.%d\n",
- e->parentfid.Cell,
- e->parentfid.fid.Volume,
- e->parentfid.fid.Vnode,
- e->parentfid.fid.Unique,
- e->name,
- e->fid.Cell,
- e->fid.fid.Volume,
- e->fid.fid.Vnode,
- e->fid.fid.Unique);
- break;
- }
-
- default:
- break;
- }
-
-}
-
-
-int
-disco_need_integrate(void)
-{
-#if 1
- return modified_log;
-#else
- return 0;
-#endif
-}
-
-
diff --git a/usr.sbin/afs/src/arlad/disco.h b/usr.sbin/afs/src/arlad/disco.h
deleted file mode 100644
index c0e5ee1e05b..00000000000
--- a/usr.sbin/afs/src/arlad/disco.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/* $arla: disco.h,v 1.2 2002/09/07 10:43:04 lha Exp $ */
-
-#ifndef ARLA_DISCO_H
-#define ARLA_DISCO_H 1
-
-#define ARLA_LOG "arla-disco-log"
-
-enum {
- DISCO_OP_NOP = 0,
- DISCO_OP_STOREDATA,
- DISCO_OP_STORESTATUS,
- DISCO_OP_CREATE_FILE,
- DISCO_OP_CREATE_SYMLINK,
- DISCO_OP_CREATE_LINK,
- DISCO_OP_UNLINK,
- DISCO_OP_RENAME,
- DISCO_OP_CREATE_DIR,
- DISCO_OP_REMOVE_DIR,
- DISCO_OP_MAX_OPCODE
-};
-
-#define DISCO_OP_NAMES { \
- "nop", \
- "storedata", \
- "storestatus", \
- "create-file", \
- "create-symlink", \
- "create-link", \
- "unlink", \
- "rename", \
- "crete-dir", \
- "remove-dir" \
-}
-
-struct disco_header {
- uint32_t checksum;
- uint32_t flags;
-#define DISCO_HEADER_NOP 1
- uint32_t prev_id;
- uint16_t opcode;
- uint16_t size;
-};
-
-struct disco_nop {
- struct disco_header header;
-};
-
-struct disco_store_data {
- struct disco_header header;
- VenusFid fid;
- AFSStoreStatus storestatus;
-};
-
-struct disco_store_status {
- struct disco_header header;
- VenusFid fid;
- AFSStoreStatus storestatus;
-};
-
-struct disco_create_file {
- struct disco_header header;
- VenusFid parentfid;
- AFSStoreStatus storestatus;
- VenusFid fid;
- char name[AFSNAMEMAX];
-};
-
-struct disco_create_symlink {
- struct disco_header header;
- VenusFid parentfid;
- AFSStoreStatus storestatus;
- VenusFid fid;
- char name[AFSNAMEMAX];
- char targetname[AFSNAMEMAX];
-};
-
-struct disco_create_link {
- struct disco_header header;
- VenusFid parentfid;
- AFSStoreStatus storestatus;
- VenusFid fid;
- char name[AFSNAMEMAX];
- VenusFid targetfid;
-};
-
-struct disco_unlink {
- struct disco_header header;
- VenusFid parentfid;
- VenusFid fid;
- char name[AFSNAMEMAX];
-};
-
-struct disco_rename {
- struct disco_header header;
- VenusFid sourcepfid;
- VenusFid destpfid;
- char sourcename[AFSNAMEMAX];
- char destname[AFSNAMEMAX];
-};
-
-
-struct disco_create_dir {
- struct disco_header header;
- VenusFid parentfid;
- AFSStoreStatus storestatus;
- VenusFid fid;
- char name[AFSNAMEMAX];
-};
-
-struct disco_remove_dir {
- struct disco_header header;
- VenusFid parentfid;
- VenusFid fid;
- char name[AFSNAMEMAX];
-};
-
-/*
- *
- */
-
-int
-disco_openlog(void);
-
-int
-disco_closelog(void);
-
-int
-disco_reintegrate(nnpfs_pag_t pag);
-
-int
-disco_need_integrate(void);
-
-/* operations */
-
-void
-disco_nop_entry(void);
-
-uint32_t
-disco_store_status(VenusFid *fid, AFSStoreStatus *ss, uint32_t prev_disco_id);
-
-uint32_t
-disco_store_data(VenusFid *fid, AFSStoreStatus *ss, uint32_t prev_disco_id);
-
-uint32_t
-disco_create_file(VenusFid *parent, VenusFid *fid, char *name,
- AFSStoreStatus *ss);
-
-uint32_t
-disco_create_symlink(VenusFid *parent, VenusFid *fid, char *name,
- AFSStoreStatus *ss);
-
-uint32_t
-disco_create_link(VenusFid *parent, VenusFid *fid, char *name,
- AFSStoreStatus *ss);
-
-uint32_t
-disco_unlink(VenusFid *parent, VenusFid *fid, const char *name, uint32_t prev_id);
-
-uint32_t
-disco_create_dir(VenusFid *parent, VenusFid *fid, char *name,
- AFSStoreStatus *ss);
-
-uint32_t
-disco_remove_dir(VenusFid *parent, VenusFid *fid, char *name, uint32_t prev_id);
-
-struct disco_play_context;
-
-/* printing/iteration support */
-
-#define DISCO_MAX_BUF_SZ 400 /* XXX */
-
-int
-disco_init_context(struct disco_play_context **);
-
-int
-disco_next_entry(struct disco_play_context *, void *ptr, size_t sz);
-
-int
-disco_close_context(struct disco_play_context *);
-
-void
-disco_print_entry(FILE *f, void *ptr, size_t sz);
-
-#endif /* ARLA_DISCO_H */
diff --git a/usr.sbin/afs/src/arlad/dump_state.c b/usr.sbin/afs/src/arlad/dump_state.c
deleted file mode 100644
index 2af4d703725..00000000000
--- a/usr.sbin/afs/src/arlad/dump_state.c
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2001 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Dump arla disk storage
- */
-
-#include "arla_local.h"
-#include <getarg.h>
-#include <version.h>
-RCSID("$arla: dump_state.c,v 1.4 2003/01/17 03:01:00 lha Exp $");
-
-static char *prefix = ARLACACHEDIR;
-static char *fcache_file;
-static char *volcache_file;
-static int version_flag;
-static int verbose_flag;
-static int help_flag;
-
-static int
-print_fcache_entry(struct fcache_store *st, void *ptr)
-{
- printf("Fid: %s %d.%d.%d %02x/%02x\n", st->cell,
- st->fid.Volume, st->fid.Vnode, st->fid.Unique,
- (st->index >> 8) & 0xff, st->index & 0xff );
- if (verbose_flag)
- printf("Length: accounted: %d fetched: %d\n",
- st->length, st->fetched_length);
- return 0;
-}
-
-static void
-print_vol(nvldbentry *e, const char *str, int32_t flags, int type)
-{
- if (e->flags & flags)
- printf (" %s: %d", str, e->volumeId[type]);
-}
-
-static int
-print_volcache_entry(struct volcache_store *st, void *ptr)
-{
- printf("Volume: %s %s\n", st->cell, st->entry.name);
- printf("volume-id:");
- print_vol(&st->entry, "RW", VLF_RWEXISTS, RWVOL);
- print_vol(&st->entry, "RO", VLF_ROEXISTS, ROVOL);
- print_vol(&st->entry, "BU", VLF_BOEXISTS, BACKVOL);
- printf("\n");
- return 0;
-}
-
-static struct getargs args[] = {
- {"prefix", 'p', arg_string, &prefix,
- "prefix to arla cache dir", "dir"},
- {"verbose", 'v', arg_flag, &verbose_flag,
- NULL, NULL},
- {"version", 0, arg_flag, &version_flag,
- NULL, NULL},
- {"help", 0, arg_flag, &help_flag,
- NULL, NULL}
-};
-
-static void
-usage (int ret)
-{
- arg_printusage (args, sizeof(args)/sizeof(*args), NULL, "");
- exit (ret);
-}
-
-int
-main(int argc, char **argv)
-{
- int optind = 0;
- int ret;
-
- set_progname (argv[0]);
-
- if (getarg (args, sizeof(args)/sizeof(*args), argc, argv, &optind))
- usage (1);
-
- if (version_flag) {
- print_version(NULL);
- exit(0);
- }
-
- if (fcache_file == NULL)
- asprintf(&fcache_file, "%s/fcache", prefix);
-
- printf("fcache:\n");
- ret = state_recover_fcache(fcache_file, print_fcache_entry, NULL);
- if (ret)
- warn("failed with %d to dump fcache state (%s)", ret, fcache_file);
-
- if (volcache_file == NULL)
- asprintf(&volcache_file, "%s/volcache", prefix);
-
- printf("volcache\n");
- ret = state_recover_volcache(volcache_file, print_volcache_entry, NULL);
- if (ret)
- warn("failed with %d to dump volcache state (%s)", ret, volcache_file);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/arlad/dynroot.c b/usr.sbin/afs/src/arlad/dynroot.c
deleted file mode 100644
index b0d6e29683a..00000000000
--- a/usr.sbin/afs/src/arlad/dynroot.c
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
- * Copyright (c) 1999 - 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Keep our own root.afs
- *
- * uses cell DYNROOTCELL as cell number.
- */
-
-#include <arla_local.h>
-
-RCSID("$arla: dynroot.c,v 1.25 2003/01/20 14:21:02 lha Exp $");
-
-struct create_entry {
- fbuf *thedir; /* pointer to the fbuf that contains the dir */
- AFSFid fid; /* the current fid */
- int len; /* num of links in the dir */
- int type;
-};
-
-#define DYNROOT_ROOTVOLUME 1 /* make sure that these */
-#define DYNROOT_ROOTVOLUME_STR "1" /* two are the same */
-#define DYNROOT_ROOTDIR 1
-#define DYNROOT_UNIQUE 1
-
-static Bool dynroot_enabled = 0; /* is dynroot enabled ? */
-static unsigned long last_celldb_version = 0; /* last version of celldb */
-
-/*
- * Magic glue wrt afsvnode#
- */
-
-static int32_t
-cellnum2afs (int cellno, int rw)
-{
- if (rw)
- return (cellno << 2) + 0x2;
- else
- return (cellno << 2) + 0x1;
-}
-
-static int
-afs2cellnum (int32_t afsvnode, int *rw)
-{
- if (afsvnode & 0x2)
- *rw = 1;
- else
- *rw = 0;
- return afsvnode >> 2;
-}
-
-/*
- * helper functions for dynroot_create_root that for
- * each `cell' with 'cellid' a entry in the root directory.
- */
-
-static int
-create_entry_func (const char *name, uint32_t cellid, int type, void *arg)
-{
- struct create_entry *entry = (struct create_entry *) arg;
- int ret;
-
- entry->fid.Vnode = cellnum2afs (cellid, type & DYNROOT_ALIAS_READWRITE);
-
- ret = fdir_creat (entry->thedir, name, entry->fid);
- if (ret)
- return ret;
-
- entry->len++;
-
- return 0;
-}
-
-/*
- * Wrapper function for cell_foreach that takes a `cell' instead of a
- * string and a cellid.
- */
-
-static int
-create_cell_entry_func (const cell_entry *cell, void *arg)
-{
- if (!cell_dynroot(cell))
- return 0;
- return create_entry_func(cell->name, cell->id,
- DYNROOT_ALIAS_READONLY, arg);
-}
-
-/*
- *
- */
-
-static int
-create_alias_entry_func (const char *cellname, const char *alias,
- int type, void *arg)
-{
- cell_entry *cell;
-
- cell = cell_get_by_name (cellname);
- if (cell == NULL)
- return 0;
- return create_entry_func(alias, cell->id, type, arg);
-
-}
-
-
-/*
- * create the dynroot root directory in `fbuf', return number
- * of entries in `len'.
- */
-
-static int
-dynroot_create_root (fbuf *fbuf, size_t *len)
-{
- int ret;
- AFSFid dot = { DYNROOT_ROOTVOLUME,
- DYNROOT_ROOTDIR,
- DYNROOT_UNIQUE};
- struct create_entry entry;
-
- ret = fdir_mkdir (fbuf, dot, dot);
- if (ret)
- return ret;
-
- entry.thedir = fbuf;
-
- entry.fid.Volume = DYNROOT_ROOTVOLUME;
- entry.fid.Vnode = DYNROOT_ROOTDIR + 2;
- entry.fid.Unique = DYNROOT_UNIQUE;
- entry.len = 0;
-
- ret = cell_foreach (create_cell_entry_func, &entry);
- if (ret)
- return ret;
-
- ret = cell_alias_foreach(create_alias_entry_func, &entry);
- if (ret)
- return ret;
-
- *len = entry.len;
-
- return 0;
-}
-
-/*
- * for the `vnode' create apropriate symlink in `fbuf'
- */
-
-static int
-dynroot_create_symlink (fbuf *fbuf, int32_t vnode)
-{
- char name[MAXPATHLEN];
- cell_entry *cell;
- int len, ret, rw = 0;
-
- cell = cell_get_by_id (afs2cellnum (vnode, &rw));
- if (cell == NULL)
- return ENOENT;
-
- len = snprintf (name, sizeof(name), "%c%s:root.cell.",
- rw ? '%' : '#', cell->name);
- assert (len > 0 && len < sizeof (name));
-
- ret = fbuf_truncate (fbuf, len);
- if (ret)
- return ret;
-
- memmove (fbuf_buf(fbuf), name, len);
- return 0;
-}
-
-/*
- * Return TRUE if the combination `cell' and `volume' is
- * in the dynroot.
- */
-
-Bool
-dynroot_isvolumep (int cell, const char *volume)
-{
- assert (volume);
-
- if (cell == 0 &&
- (strcmp (volume, "root.afs") == 0
- || strcmp (volume, DYNROOT_ROOTVOLUME_STR) == 0))
- return TRUE;
-
- return FALSE;
-}
-
-/*
- * Create a dummy nvldbentry in `entry'
- */
-
-int
-dynroot_fetch_root_vldbN (nvldbentry *entry)
-{
- memset (entry, 0, sizeof(*entry));
-
- strlcpy(entry->name, "root.afs", sizeof(entry->name));
- entry->nServers = 0;
- entry->volumeId[ROVOL] = DYNROOT_ROOTVOLUME;
- entry->flags = VLF_ROEXISTS;
-
- return 0;
-}
-
-/*
- * Update `entry' to contain the correct information
- * Note: doesn't update status.Length and status.LinkCount
- */
-
-static void
-dynroot_update_entry (FCacheEntry *entry, int32_t filetype,
- nnpfs_pag_t cred)
-{
- struct timeval tv;
- AccessEntry *ae;
-
- assert (entry);
- entry->status.InterfaceVersion = 1;
- entry->status.FileType = filetype;
- entry->status.DataVersion = 1;
- entry->status.Author = 0;
- entry->status.Owner = 0;
- entry->status.CallerAccess = ALIST | AREAD;
- entry->status.AnonymousAccess = ALIST | AREAD;
- switch (filetype) {
- case TYPE_DIR:
- entry->status.UnixModeBits = 0755;
- break;
- case TYPE_LINK:
- entry->status.UnixModeBits = 0644;
- break;
- default:
- errx(-1, "dynroot_update_entry: unknowrn file type %d\n", filetype);
- /* NOTREACHED */
- }
- entry->status.ParentVnode = DYNROOT_ROOTDIR;
- entry->status.ParentUnique = DYNROOT_UNIQUE;
- entry->status.SegSize = 64*1024;
- entry->status.ClientModTime = 0;
- entry->status.ServerModTime = 0;
- entry->status.Group = 0;
- entry->status.SyncCount = 0;
- entry->status.DataVersionHigh= 0;
- entry->status.LockCount = 0;
- entry->status.LengthHigh = 0;
- entry->status.ErrorCode = 0;
-
- gettimeofday (&tv, NULL);
-
- memset (&entry->volsync, 0, sizeof (entry->volsync));
-
- entry->callback.CallBackVersion = 1;
- entry->callback.ExpirationTime = tv.tv_sec + 3600 * 24 * 7;
- entry->callback.CallBackType = CBSHARED;
-
- entry->anonaccess = entry->status.AnonymousAccess;
-
- findaccess(cred, entry->acccache, &ae);
- ae->cred = cred;
- ae->access = entry->status.CallerAccess;
-}
-
-/*
- * Fetch data and attr for `entry'
- */
-
-static int
-dynroot_get_node (FCacheEntry *entry, CredCacheEntry *ce)
-{
- int ret, fd, rootnode;
- size_t len;
- fbuf dir;
-
- rootnode = entry->fid.fid.Vnode == DYNROOT_ROOTDIR ? 1 : 0;
-
- if (entry->length != 0 &&
- (!rootnode || last_celldb_version == cell_get_version()))
- return 0;
-
- fd = fcache_open_file (entry, O_RDWR);
- if (fd < 0)
- return errno;
-
- ret = fbuf_create (&dir, fd, 0, FBUF_READ | FBUF_WRITE | FBUF_SHARED);
- if (ret) {
- close (fd);
- return ret;
- }
-
- if (rootnode) {
- ret = dynroot_create_root (&dir, &len);
- entry->status.LinkCount = len;
- } else {
- ret = dynroot_create_symlink (&dir, entry->fid.fid.Vnode);
- entry->status.LinkCount = 1;
- fcache_mark_as_mountpoint (entry);
- }
-
- if (ret) {
- fbuf_end (&dir);
- close(fd);
- return ret;
- }
-
- entry->flags.attrp = TRUE;
-
- dynroot_update_entry (entry, rootnode ? TYPE_DIR : TYPE_LINK,
- ce->cred);
-
- entry->status.Length = dir.len;
- fcache_update_length(entry, dir.len, dir.len);
-
- ret = fbuf_end (&dir);
- close(fd);
- if (ret)
- return ret;
-
- entry->tokens |= NNPFS_ATTR_R|NNPFS_DATA_R;
-
- return 0;
-}
-
-/*
- * Fetch attr for `entry'
- */
-
-int
-dynroot_get_attr (FCacheEntry *entry, CredCacheEntry *ce)
-{
- return dynroot_get_node (entry, ce);
-}
-
-
-/*
- * Fetch data for `entry'
- */
-
-int
-dynroot_get_data (FCacheEntry *entry, CredCacheEntry *ce)
-{
- return dynroot_get_node (entry, ce);
-}
-
-/*
- * returns TRUE if `entry' is a dynroot entry.
- */
-
-Bool
-dynroot_is_dynrootp (FCacheEntry *entry)
-{
- assert (entry);
-
- if (dynroot_enabled &&
- entry->fid.Cell == DYNROOT_CELLID &&
- entry->fid.fid.Volume == DYNROOT_ROOTVOLUME)
- return TRUE;
-
- return FALSE;
-}
-
-/*
- * Return what status the dynroot is in.
- */
-
-Bool
-dynroot_enablep (void)
-{
- return dynroot_enabled;
-}
-
-/*
- * Enable/Disable the dynroot depending on `enable', returns previous state.
- */
-
-Bool
-dynroot_setenable (Bool enable)
-{
- Bool was = dynroot_enabled;
- dynroot_enabled = enable;
- return was;
-}
-
-/*
- * Returns the dynroot_cellid.
- */
-
-int32_t dynroot_cellid (void)
-{
- return DYNROOT_CELLID;
-}
-
-/*
- * Return the dynroot volumeid.
- */
-
-int32_t dynroot_volumeid (void)
-{
- return DYNROOT_ROOTVOLUME;
-}
diff --git a/usr.sbin/afs/src/arlad/dynroot.h b/usr.sbin/afs/src/arlad/dynroot.h
deleted file mode 100644
index a8c5881af84..00000000000
--- a/usr.sbin/afs/src/arlad/dynroot.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1999 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * $arla: dynroot.h,v 1.5 2002/07/23 15:24:24 lha Exp $
- */
-
-#define DYNROOT_DEFAULT 0
-
-int dynroot_fetch_root_vldbN (nvldbentry *entry);
-
-Bool dynroot_isvolumep (int cell, const char *volume);
-
-int dynroot_get_attr (FCacheEntry *entry, CredCacheEntry *ce);
-
-int dynroot_get_data (FCacheEntry *entry, CredCacheEntry *ce);
-
-Bool dynroot_is_dynrootp (FCacheEntry *entry);
-
-Bool dynroot_enablep (void);
-
-Bool dynroot_setenable (Bool enable);
-
-int32_t dynroot_cellid (void);
-
-int32_t dynroot_volumeid (void);
diff --git a/usr.sbin/afs/src/arlad/fcache.c b/usr.sbin/afs/src/arlad/fcache.c
deleted file mode 100644
index c089d5f0b89..00000000000
--- a/usr.sbin/afs/src/arlad/fcache.c
+++ /dev/null
@@ -1,4987 +0,0 @@
-/*
- * Copyright (c) 1995 - 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * This is the cache for files.
- * The hash-table is keyed with (cell, volume, fid).
- */
-
-#include "arla_local.h"
-RCSID("$arla: fcache.c,v 1.417 2003/04/08 00:38:09 mattiasa Exp $") ;
-
-#ifdef __CYGWIN32__
-#include <windows.h>
-#endif
-
-/*
- * Prototypes
- */
-
-static int get_attr_bulk (FCacheEntry *parent_entry,
- FCacheEntry *prefered_entry,
- VenusFid *prefered_fid,
- const char *prefered_name,
- CredCacheEntry *ce);
-
-static int
-resolve_mp (FCacheEntry **e, VenusFid *ret_fid, CredCacheEntry **ce);
-
-/*
- * Local data for this module.
- */
-
-/*
- * Hash table for all the vnodes known by the cache manager keyed by
- * (cell, volume, vnode, unique).
- */
-
-static Hashtab *hashtab;
-
-/*
- * List of all hash table entries. This list is sorted in LRU-order.
- * The head is the MRU and the tail the LRU, which is from where we
- * take entries when we need to add new ones.
- */
-
-static List *lrulist;
-
-/*
- * Heap of entries to be invalidated.
- */
-
-static Heap *invalid_heap;
-
-/* low and high-water marks for vnodes and space */
-
-static u_long highvnodes, lowvnodes, current_vnodes;
-static int64_t highbytes, lowbytes;
-
-/* current values */
-
-static int64_t usedbytes, needbytes;
-static u_long usedvnodes;
-
-/* Map with recovered nodes */
-
-static u_long maxrecovered;
-
-static char *recovered_map;
-
-static void
-set_recovered(u_long index)
-{
- char *p;
- u_long oldmax;
-
- if (index >= maxrecovered) {
- oldmax = maxrecovered;
- maxrecovered = (index + 16) * 2;
- p = realloc(recovered_map, maxrecovered);
- if (p == NULL) {
- u_long m = maxrecovered;
- free(recovered_map);
- recovered_map = NULL;
- maxrecovered = 0;
- arla_errx(1, ADEBERROR, "fcache: realloc %lu recovered_map failed",
- m);
- }
- recovered_map = p;
- memset(recovered_map + oldmax, 0, maxrecovered - oldmax);
- }
- recovered_map[index] = 1;
-}
-
-#define IS_RECOVERED(index) (recovered_map[(index)])
-
-/*
- * This is how far the cleaner will go to clean out entries.
- * The higher this is, the higher is the risk that you will
- * lose any file that you feel is important to disconnected
- * operation.
- */
-
-Bool fprioritylevel = FPRIO_DEFAULT;
-
-static int node_count; /* XXX */
-
-/*
- * This is set to non-zero when we want to use bulkstatus(). 2 means
- * that the nodes should be installed into the kernel.
- */
-
-static int fcache_enable_bulkstatus = 1;
-static int fcache_bulkstatus_num = 14; /* XXX should use the [P]MTU */
-
-#define FCHASHSIZE 997
-
-/*
- * The cleaner
- */
-
-#define CLEANER_STACKSIZE (16*1024)
-#define CLEANER_SLEEP 10
-
-static PROCESS cleaner_pid;
-
-/*
- * The creator of nodes.
- */
-
-#define CREATE_NODES_STACKSIZE (16*1024)
-
-static PROCESS create_nodes_pid;
-
-/*
- * The invalidator
- */
-
-#define INVALIDATOR_STACKSIZE (16*1024)
-
-static PROCESS invalidator_pid;
-
-/*
- * Smalltalk emulation
- */
-
-int64_t
-fcache_highbytes(void)
-{
- return highbytes;
-}
-
-int64_t
-fcache_usedbytes(void)
-{
- return usedbytes;
-}
-
-int64_t
-fcache_lowbytes(void)
-{
- return lowbytes;
-}
-
-u_long
-fcache_highvnodes(void)
-{
- return highvnodes;
-}
-
-u_long
-fcache_usedvnodes(void)
-{
- return usedvnodes;
-}
-
-u_long
-fcache_lowvnodes(void)
-{
- return lowvnodes;
-}
-
-/*
- * Counters
- */
-
-static struct {
- unsigned long fetch_attr;
- unsigned long fetch_attr_cached;
- unsigned long fetch_attr_bulk;
- unsigned long fetch_data;
- unsigned long fetch_data_cached;
- unsigned long store_attr;
- unsigned long store_data;
-} fcache_counter;
-
-/*
- * Compare two entries. Return 0 if and only if the same.
- */
-
-static int
-fcachecmp (void *a, void *b)
-{
- FCacheEntry *f1 = (FCacheEntry*)a;
- FCacheEntry *f2 = (FCacheEntry*)b;
-
- return VenusFid_cmp(&f1->fid, &f2->fid);
-}
-
-/*
- * Hash the value of an entry.
- */
-
-static unsigned
-fcachehash (void *e)
-{
- FCacheEntry *f = (FCacheEntry*)e;
-
- return f->fid.Cell + f->fid.fid.Volume + f->fid.fid.Vnode
- + f->fid.fid.Unique;
-}
-
-/*
- * Compare expiration times.
- */
-
-static int
-expiration_time_cmp (const void *a, const void *b)
-{
- const FCacheEntry *f1 = (const FCacheEntry *)a;
- const FCacheEntry *f2 = (const FCacheEntry *)b;
-
- return f1->callback.ExpirationTime - f2->callback.ExpirationTime;
-}
-
-void
-recon_hashtabadd(FCacheEntry *entry)
-{
- hashtabadd(hashtab,entry);
-}
-
-void
-recon_hashtabdel(FCacheEntry *entry)
-{
- hashtabdel(hashtab,entry);
-}
-
-/*
- * Globalnames
- */
-
-char **sysnamelist = NULL;
-int sysnamenum = 0;
-
-/*
- *
- */
-
-static void
-fcache_poller_unref(FCacheEntry *e)
-{
- AssertExclLocked(&e->lock);
-
- if (e->poll) {
- poller_remove(e->poll);
- e->poll = NULL;
- }
-}
-
-static void
-fcache_poller_reref(FCacheEntry *e, ConnCacheEntry *conn)
-{
- PollerEntry *pe = e->poll;
- AssertExclLocked(&e->lock);
-
- e->poll = poller_add_conn(conn);
- if (pe)
- poller_remove(pe);
-}
-
-
-/*
- *
- */
-
-const char *
-fcache_getdefsysname (void)
-{
- if (sysnamenum == 0)
- return "fool-dont-remove-all-sysnames";
- return sysnamelist[0];
-}
-
-/*
- *
- */
-
-int
-fcache_setdefsysname (const char *sysname)
-{
- if (sysnamenum == 0)
- return fcache_addsysname (sysname);
- free (sysnamelist[0]);
- sysnamelist[0] = estrdup (sysname);
- return 0;
-}
-
-/*
- *
- */
-
-int
-fcache_addsysname (const char *sysname)
-{
- sysnamenum += 1;
- sysnamelist = erealloc (sysnamelist,
- sysnamenum * sizeof(char *));
- sysnamelist[sysnamenum - 1] = estrdup(sysname);
- return 0;
-}
-
-/*
- *
- */
-
-int
-fcache_removesysname (const char *sysname)
-{
- int i;
- for (i = 0; i < sysnamenum; i++)
- if (strcmp (sysnamelist[i], sysname) == 0)
- break;
- if (i == sysnamenum)
- return 1;
- free (sysnamelist[i]);
- for (;i < sysnamenum; i++)
- sysnamelist[i] = sysnamelist[i + 1];
- sysnamenum--;
- sysnamelist = erealloc (sysnamelist,
- sysnamenum * sizeof(char *));
- return 0;
-}
-
-/*
- * return the directory name of the cached file for `entry'
- */
-
-int
-fcache_dir_name (FCacheEntry *entry, char *s, size_t len)
-{
- return snprintf (s, len, "%02X", entry->index / 0x100);
-}
-
-/*
- * return the file name of the cached file for `entry'.
- */
-
-int
-fcache_file_name (FCacheEntry *entry, char *s, size_t len)
-{
- return snprintf (s, len, "%02X/%02X",
- entry->index / 0x100, entry->index % 0x100);
-}
-
-/*
- * return kernel version of path to the cache file for `entry'.
- */
-
-int
-fcache_conv_file_name (FCacheEntry *entry, char *s, size_t len)
-{
-#ifdef __CYGWIN32__
- char buf[1024];
- GetCurrentDirectory(1024, buf);
-
- return snprintf (s, len, "%s\\%02X\\%02X",
- buf, entry->index / 0x100, entry->index % 0x100);
-#else
- return snprintf (s, len, "%02X/%02X",
- entry->index / 0x100, entry->index % 0x100);
-#endif
-}
-
-/*
- * the filename for the extra (converted) directory
- */
-
-static int
-real_extra_file_name (FCacheEntry *entry, char *s, size_t len)
-{
- int ret;
-
- ret = fcache_file_name (entry, s, len - 1);
- if (ret < len - 1) {
- s[ret++] = '@';
- s[ret] = '\0';
- }
- return ret;
-}
-
-/*
- * return the file name of the converted directory for `entry'.
- */
-
-int
-fcache_extra_file_name (FCacheEntry *entry, char *s, size_t len)
-{
- assert (entry->flags.extradirp &&
- entry->status.FileType == TYPE_DIR);
-
- return real_extra_file_name (entry, s, len);
-}
-
-static int fhopen_working;
-
-/*
- * open file by handle
- */
-
-static int
-fcache_fhopen (fcache_cache_handle *handle, int flags)
-{
- if (!handle->valid) {
- errno = EINVAL;
- return -1;
- }
-
-#ifdef __CYGWIN32__
- return -1;
-#endif
-
-#if defined(HAVE_GETFH) && defined(HAVE_FHOPEN)
- {
- int ret;
- fhandle_t fh;
-
- memcpy (&fh, &handle->nnpfs_handle, sizeof(fh));
- ret = fhopen (&fh, flags);
- if (ret >= 0)
- return ret;
- }
-#endif
-
-#ifdef KERBEROS /* really KAFS */
- {
- struct ViceIoctl vice_ioctl;
-
- vice_ioctl.in = (caddr_t)&handle->nnpfs_handle;
- vice_ioctl.in_size = sizeof(handle->nnpfs_handle);
-
- vice_ioctl.out = NULL;
- vice_ioctl.out_size = 0;
-
- return k_pioctl (NULL, VIOC_FHOPEN, &vice_ioctl, flags);
- }
-#else
- errno = EINVAL;
- return -1;
-#endif
-}
-
-/*
- * get the handle of `filename'
- */
-
-int
-fcache_fhget (char *filename, fcache_cache_handle *handle)
-{
- handle->valid = 0;
-
-#ifdef __CYGWIN32__
- {
- int ret, a, b;
- char buf[1024]; /* XXX */
-
- ret = sscanf(filename, "%02X/%02X", &a, &b);
- if (ret != 2)
- return EINVAL;
-
- GetCurrentDirectory(1024, buf);
-
- ret = snprintf ((char *)handle, CACHEHANDLESIZE,
- "%s\\%02X\\%02X", buf, a, b);
-
- if (ret > 0 && ret < CACHEHANDLESIZE)
- handle->valid = 1;
-
- return ret;
- }
-#endif
-
-#if defined(HAVE_GETFH) && defined(HAVE_FHOPEN)
- {
- int ret;
- fhandle_t fh;
-
- ret = getfh (filename, &fh);
- if (ret == 0) {
- memcpy (&handle->nnpfs_handle, &fh, sizeof(fh));
- handle->valid = 1;
- }
-
- return ret;
- }
-#endif
-#ifdef KERBEROS
- {
- struct ViceIoctl vice_ioctl;
- int ret;
-
- if (!fhopen_working)
- return 0;
-
- vice_ioctl.in = NULL;
- vice_ioctl.in_size = 0;
-
- vice_ioctl.out = (caddr_t)&handle->nnpfs_handle;
- vice_ioctl.out_size = sizeof(handle->nnpfs_handle);
-
- ret = k_pioctl (filename, VIOC_FHGET, &vice_ioctl, 0);
- if (ret == 0)
- handle->valid = 1;
-
- return ret;
- }
-#else
- errno = EINVAL;
- return -1;
-#endif
-}
-
-/*
- * create a new cache vnode, assume the entry is locked or private
- */
-
-static int
-fcache_create_file (FCacheEntry *entry, int create)
-{
- char fname[MAXPATHLEN];
- char extra_fname[MAXPATHLEN];
- int fd;
- int ret;
- int flags;
-
- flags = O_RDWR | O_BINARY;
-
- if (create)
- flags |= O_CREAT | O_TRUNC;
-
- fcache_file_name (entry, fname, sizeof(fname));
- fd = open (fname, flags, 0666);
- if (fd < 0) {
- if (errno == ENOENT && create) {
- char dname[MAXPATHLEN];
-
- fcache_dir_name (entry, dname, sizeof(dname));
- ret = mkdir (dname, 0777);
- if (ret < 0)
- arla_err (1, ADEBERROR, errno, "mkdir %s", dname);
- fd = open (fname, flags, 0666);
- if (fd < 0)
- arla_err (1, ADEBERROR, errno, "open %s", fname);
- } else {
- arla_err (1, ADEBERROR, errno, "open %s", fname);
- }
- }
- if (close (fd) < 0)
- arla_err (1, ADEBERROR, errno, "close %s", fname);
- fcache_fhget (fname, &entry->handle);
- real_extra_file_name (entry, extra_fname, sizeof(extra_fname));
- unlink (extra_fname);
- return 0;
-}
-
-/*
- * return a fd to the cache file of `entry'
- */
-
-int
-fcache_open_file (FCacheEntry *entry, int flag)
-{
- int ret;
- char fname[MAXPATHLEN];
-
- if (fhopen_working) {
- ret = fcache_fhopen (&entry->handle, flag);
- if (ret < 0 && (errno == EINVAL || errno == EPERM))
- fhopen_working = 0;
- else
- return ret;
- }
- fcache_file_name (entry, fname, sizeof(fname));
- return open (fname, flag | O_BINARY);
-}
-
-/*
- * return a fd to the converted directory for `entry'
- */
-
-int
-fcache_open_extra_dir (FCacheEntry *entry, int flag, mode_t mode)
-{
- char fname[MAXPATHLEN];
-
- assert (entry->flags.extradirp &&
- entry->status.FileType == TYPE_DIR);
-
- fcache_extra_file_name (entry, fname, sizeof(fname));
- return open (fname, flag | O_BINARY, mode);
-}
-
-/*
- * Discard the data cached for `entry'.
- */
-
-static void
-throw_data (FCacheEntry *entry)
-{
- int fd;
- struct stat sb;
-
- assert (entry->flags.usedp);
- AssertExclLocked(&entry->lock);
-
- fd = fcache_open_file (entry, O_WRONLY);
- if (fd < 0) {
- arla_warn (ADEBFCACHE, errno, "fcache_open_file");
- goto out;
- }
- if (fstat (fd, &sb) < 0) {
- arla_warn (ADEBFCACHE, errno, "fstat");
- close (fd);
- goto out;
- }
- if (ftruncate (fd, 0) < 0) {
- arla_warn (ADEBFCACHE, errno, "ftruncate");
- close (fd);
- goto out;
- }
- close (fd);
- if (entry->flags.extradirp) {
- char fname[MAXPATHLEN];
-
- fcache_extra_file_name (entry, fname, sizeof(fname));
- unlink (fname);
- }
- if (usedbytes < entry->length) {
- arla_warnx(ADEBCONN, "usedbytes %d < entry->length %d", usedbytes,
- entry->length);
- exit(-1);
- }
- /* XXX - things are wrong - continue anyway */
- if (usedbytes < entry->length)
- usedbytes = entry->length;
- usedbytes -= entry->length;
- entry->length = 0;
- entry->wanted_length = 0;
- entry->fetched_length = 0;
- entry->flags.extradirp = FALSE;
-
- out:
- cm_check_consistency();
-}
-
-/*
- * A probe function for a file server.
- */
-
-int
-fs_probe (struct rx_connection *conn)
-{
- uint32_t sec, usec;
-
- return RXAFS_GetTime (conn, &sec, &usec);
-}
-
-/*
- *
- */
-
-static void
-throw_entry (FCacheEntry *entry)
-{
- CredCacheEntry *ce;
- ConnCacheEntry *conn;
- AFSCBFids fids;
- AFSCBs cbs;
- int ret;
-
- assert (entry->flags.usedp);
- assert (!entry->flags.kernelp);
-
- AssertExclLocked(&entry->lock);
- assert(LockWaiters(&entry->lock) == 0);
-
- hashtabdel (hashtab, entry);
-
- /*
- * Throw data when there is data, length is a good test since the
- * node most not be used (in kernel) when we get here.
- */
- if (entry->length)
- throw_data (entry);
-
- if (entry->invalid_ptr != -1) {
- heap_remove (invalid_heap, entry->invalid_ptr);
- entry->invalid_ptr = -1;
- }
-
- fcache_poller_unref(entry);
-
- if (entry->flags.attrp && entry->host) {
- ce = cred_get (entry->fid.Cell, 0, CRED_NONE);
- if (ce == NULL) {
- arla_warnx (ADEBMISC, "cred_get failed");
- exit(-1);
- }
-
- conn = conn_get (entry->fid.Cell, entry->host, afsport,
- FS_SERVICE_ID, fs_probe, ce);
- cred_free (ce);
-
- if (conn_isalivep(conn)) {
- fids.len = cbs.len = 1;
- fids.val = &entry->fid.fid;
- cbs.val = &entry->callback;
- if (conn_isalivep (conn))
- ret = RXAFS_GiveUpCallBacks(conn->connection, &fids, &cbs);
- else
- ret = ENETDOWN;
- conn_free (conn);
- if (ret)
- arla_warn (ADEBFCACHE, ret, "RXAFS_GiveUpCallBacks");
- }
- }
- if (entry->volume) {
- volcache_free (entry->volume);
- entry->volume = NULL;
- }
- assert_not_flag(entry,kernelp);
- entry->flags.attrp = FALSE;
- entry->flags.usedp = FALSE;
- --usedvnodes;
- LWP_NoYieldSignal (lrulist);
-}
-
-/*
- * Return the next cache node number.
- */
-
-static unsigned
-next_cache_index (void)
-{
- do {
- node_count++;
- } while ((node_count < maxrecovered)
- && IS_RECOVERED(node_count));
-
- return node_count;
-}
-
-/*
- * Pre-create cache nodes up to the limit highvnodes. If you want to
- * create more increase highnodes and signal create_nodes.
- */
-
-static void
-create_nodes (char *arg)
-{
- FCacheEntry *entries;
- unsigned count = 0;
- struct timeval tv;
-
- while (1) {
- unsigned int n, i, j;
-
- while (highvnodes <= current_vnodes)
- LWP_WaitProcess (create_nodes);
-
- n = highvnodes - current_vnodes;
-
- count = 0;
-
- arla_warnx (ADEBFCACHE,
- "pre-creating nodes");
-
- entries = calloc (n, sizeof(FCacheEntry));
- if (n != 0 && entries == NULL)
- arla_errx (1, ADEBERROR, "fcache: calloc failed");
-
- for (i = 0; i < n; ++i) {
- entries[i].invalid_ptr = -1;
- entries[i].volume = NULL;
- entries[i].refcount = 0;
- entries[i].anonaccess = 0;
- entries[i].cleanergen = 0;
- entries[i].poll = NULL;
- for (j = 0; j < NACCESS; j++) {
- entries[i].acccache[j].cred = ARLA_NO_AUTH_CRED;
- entries[i].acccache[j].access = 0;
- }
- entries[i].length = 0;
- Lock_Init(&entries[i].lock);
- entries[i].index = next_cache_index ();
- fcache_create_file (&entries[i], 1);
-
- current_vnodes++;
-
- ++count;
- tv.tv_sec = 0;
- tv.tv_usec = 1000;
-
- entries[i].lru_le = listaddhead (lrulist, &entries[i]);
- assert (entries[i].lru_le);
-
- LWP_NoYieldSignal (lrulist);
- IOMGR_Select(0, NULL, NULL, NULL, &tv);
- }
-
- arla_warnx (ADEBFCACHE,
- "pre-created %u nodes", count);
- }
-}
-
-/*
- * This is the almighty cleaner loop
- */
-
-static Bool cleaner_working = FALSE;
-
-static void
-cleaner (char *arg)
-{
- enum { CL_OPPORTUNISTIC, CL_FORCE, CL_COLLECT } state;
- int cnt = 0, numnodes;
- VenusFid *fids;
- int cleanerrun = 0;
-
- numnodes = NNPFS_GC_NODES_MAX_HANDLE;
-
- fids = malloc (sizeof(*fids) * numnodes);
- if (fids == NULL)
- arla_err (1, ADEBERROR, errno, "cleaner: malloc");
-
- for (;;) {
- Listitem *item, *prev;
- FCacheEntry *entry;
-
- arla_warnx (ADEBCLEANER,
- "running cleaner: "
- "%lu (%lu-(%lu)-%lu) files, "
- "%lu (%lu-%lu) bytes "
- "%lu needed bytes",
- usedvnodes, lowvnodes, current_vnodes, highvnodes,
- (long)usedbytes, (long)lowbytes, (long)highbytes,
- (long)needbytes);
-
- cleaner_working = TRUE;
-
- state = CL_OPPORTUNISTIC;
- cleanerrun++;
-
- while (usedvnodes > lowvnodes
- || usedbytes > lowbytes
- || needbytes > highbytes - usedbytes)
- {
-
- for (item = listtail (lrulist);
- item &&
- (usedvnodes > lowvnodes
- || usedbytes > lowbytes
- || needbytes > highbytes - usedbytes);
- item = prev) {
- prev = listprev (lrulist, item);
- entry = (FCacheEntry *)listdata (item);
-
- if (fprioritylevel && entry->priority)
- continue;
-
- if (entry->cleanergen == cleanerrun)
- continue;
- entry->cleanergen = cleanerrun;
-
- if (entry->flags.usedp
- && (usedvnodes > lowvnodes
- || usedbytes > lowbytes
- || needbytes > highbytes - usedbytes)
- && entry->refcount == 0
- && CheckLock(&entry->lock) == 0)
- {
- if (!entry->flags.datausedp
- && !entry->flags.kernelp
- /* && this_is_a_good_node_to_gc(entry,state) */) {
-
- ObtainWriteLock (&entry->lock);
- listdel (lrulist, item);
- throw_entry (entry);
- entry->lru_le = listaddtail (lrulist, entry);
- if(!entry->lru_le)
- exit(-1);
- ReleaseWriteLock (&entry->lock);
- break;
- }
-
- if (state == CL_FORCE && entry->flags.kernelp) {
-
- fids[cnt++] = entry->fid;
-
- if (cnt >= numnodes) {
- nnpfs_send_message_gc_nodes (kernel_fd, cnt, fids);
- IOMGR_Poll();
- cnt = 0;
- }
- break;
- }
- }
- assert (entry->lru_le == item);
- }
- if (item == NULL) {
- switch (state) {
- case CL_OPPORTUNISTIC:
- state = CL_FORCE;
- LWP_DispatchProcess(); /* Yield */
- break;
- case CL_FORCE:
- state = CL_COLLECT;
- if (cnt > 0) {
- nnpfs_send_message_gc_nodes (kernel_fd, cnt, fids);
- IOMGR_Poll();
- cnt = 0;
- }
- break;
- case CL_COLLECT:
- goto out;
- break;
- default:
- errx(-1, "fcache.c: uknown state %d\n", state);
- /* NOTREACHED */
- }
- cleanerrun++;
- }
- }
- out:
-
- arla_warnx(ADEBCLEANER,
- "cleaner done: "
- "%lu (%lu-(%lu)-%lu) files, "
- "%ld (%ld-%ld) bytes "
- "%ld needed bytes",
- usedvnodes, lowvnodes, current_vnodes, highvnodes,
- (long)usedbytes, (long)lowbytes, (long)highbytes,
- (long)needbytes);
-
- cm_check_consistency();
- if (needbytes)
- LWP_NoYieldSignal (fcache_need_bytes);
- cleaner_working = FALSE;
- IOMGR_Sleep (CLEANER_SLEEP);
- }
-}
-
-static void
-fcache_wakeup_cleaner (void *wait)
-{
- if (cleaner_working == FALSE)
- IOMGR_Cancel (cleaner_pid);
- LWP_WaitProcess (wait);
-}
-
-int
-fcache_need_bytes (u_long needed)
-{
- if (needed + needbytes > highbytes) {
- arla_warnx (ADEBWARN,
- "Out of space since there is outstanding requests "
- "(%ld needed, %ld outstanding, %ld highbytes)",
- (long)needed, (long)needbytes, (long)highbytes);
- return ENOSPC;
- }
-
- needbytes += needed;
- fcache_wakeup_cleaner(fcache_need_bytes);
- needbytes -= needed;
- if (needed > highbytes - usedbytes) {
- arla_warnx (ADEBWARN,
- "Out of space, couldn't get needed bytes after cleaner "
- "(%lu bytes missing, %lu used, %lu highbytes)",
- (long)(needed - (highbytes - usedbytes)),
- (long)usedbytes, (long)highbytes);
- return ENOSPC;
- }
- return 0;
-}
-
-Bool
-fcache_need_nodes (void)
-{
- fcache_wakeup_cleaner (lrulist);
- if (current_vnodes == usedvnodes)
- return FALSE;
- return TRUE;
-}
-
-
-/*
- * Run through the heap of objects to be invalidated and throw them away
- * when they time arrive.
- */
-
-static void
-invalidator (char *arg)
-{
- for (;;) {
- const void *head;
- struct timeval tv;
-
- arla_warnx(ADEBINVALIDATOR,
- "running invalidator");
-
- while ((head = heap_head (invalid_heap)) == NULL)
- LWP_WaitProcess (invalid_heap);
-
- gettimeofday (&tv, NULL);
-
- while ((head = heap_head (invalid_heap)) != NULL) {
- FCacheEntry *entry = (FCacheEntry *)head;
-
- if (tv.tv_sec < entry->callback.ExpirationTime) {
- unsigned long t = entry->callback.ExpirationTime - tv.tv_sec;
-
- arla_warnx (ADEBINVALIDATOR,
- "invalidator: sleeping for %lu second(s)", t);
- IOMGR_Sleep (t);
- break;
- }
-
- ObtainWriteLock (&entry->lock);
- if (head == heap_head (invalid_heap)) {
- heap_remove_head (invalid_heap);
- entry->invalid_ptr = -1;
- if (entry->flags.kernelp)
- break_callback (entry);
- fcache_poller_unref(entry);
- }
- ReleaseWriteLock (&entry->lock);
- }
- }
-}
-
-/*
- * Add `entry' to the list of to invalidate when its time is up.
- */
-
-static void
-add_to_invalidate (FCacheEntry *e)
-{
- if (e->invalid_ptr != -1)
- heap_remove (invalid_heap, e->invalid_ptr);
- heap_insert (invalid_heap, (const void *)e, &e->invalid_ptr);
- LWP_NoYieldSignal (invalid_heap);
- IOMGR_Cancel(invalidator_pid);
-}
-
-/*
- * Remove the entry least-recently used and return it locked. Sleep until
- * there's an entry.
- */
-
-static FCacheEntry *
-unlink_lru_entry (void)
-{
- FCacheEntry *entry = NULL;
- Listitem *item;
-
- if (current_vnodes == usedvnodes)
- fcache_need_nodes();
-
- for (;;) {
-
- assert (!listemptyp (lrulist));
- for (item = listtail (lrulist);
- item;
- item = listprev (lrulist, item)) {
-
- entry = (FCacheEntry *)listdata (item);
- if (!entry->flags.usedp
- && CheckLock(&entry->lock) == 0) {
- assert_not_flag(entry,kernelp);
- ObtainWriteLock (&entry->lock);
- listdel (lrulist, entry->lru_le);
- entry->lru_le = NULL;
- return entry;
- }
- }
-
- assert (!listemptyp (lrulist));
- for (item = listtail (lrulist);
- item;
- item = listprev (lrulist, item)) {
-
- entry = (FCacheEntry *)listdata (item);
- if (entry->flags.usedp
- && !entry->flags.attrusedp
- && !entry->flags.kernelp
- && entry->refcount == 0
- && CheckLock(&entry->lock) == 0) {
- assert_not_flag(entry,kernelp);
- ObtainWriteLock (&entry->lock);
- listdel (lrulist, entry->lru_le);
- entry->lru_le = NULL;
- throw_entry (entry);
- return entry;
- }
- }
-
- arla_warnx (ADEBFCACHE, "unlink_lru_entry: sleeping");
- fcache_need_nodes();
- }
-}
-
-/*
- * Return a usable locked entry.
- */
-
-static FCacheEntry *
-find_free_entry (void)
-{
- FCacheEntry *entry;
-
- entry = unlink_lru_entry ();
- if (entry == NULL)
- arla_warnx (ADEBWARN, "All vnode entries in use");
- else {
- AssertExclLocked(&entry->lock);
- ++usedvnodes;
- }
- return entry;
-}
-
-/*
- *
- */
-
-struct fstore_context {
- Listitem *item;
- unsigned n;
-};
-
-static int
-fcache_store_entry (struct fcache_store *st, void *ptr)
-{
- struct fstore_context *c;
- FCacheEntry *entry;
-
- c = (struct fstore_context *)ptr;
- if (c->item == NULL) /* check if done ? */
- return STORE_DONE;
-
- entry = (FCacheEntry *)listdata (c->item);
- c->item = listprev (lrulist, c->item);
-
- if (!entry->flags.usedp)
- return STORE_SKIP;
-
- strlcpy(st->cell, cell_num2name(entry->fid.Cell), sizeof(st->cell));
- st->fid = entry->fid.fid;
- st->refcount = entry->refcount;
- st->length = entry->length;
- st->fetched_length = entry->fetched_length;
- st->volsync = entry->volsync;
- st->status = entry->status;
- st->anonaccess = entry->anonaccess;
- st->index = entry->index;
- st->flags.attrp = entry->flags.attrp;
- st->flags.datap = entry->length ? TRUE : FALSE;
- st->flags.extradirp = entry->flags.extradirp;
- st->flags.mountp = entry->flags.mountp;
- st->flags.fake_mp = entry->flags.fake_mp;
- st->flags.vol_root = entry->flags.vol_root;
- strlcpy(st->parentcell, cell_num2name(entry->parent.Cell),
- sizeof(st->parentcell));
- st->parent = entry->parent.fid;
- st->priority = entry->priority;
-
- c->n++;
- return STORE_NEXT;
-}
-
-/*
- *
- */
-
-int
-fcache_store_state (void)
-{
- struct fstore_context c;
- int ret;
-
- if (lrulist == NULL) {
- arla_warnx (ADEBFCACHE, "store_state: lrulist is NULL\n");
- return 0;
- }
-
- c.item = listtail(lrulist);
- c.n = 0;
-
- ret = state_store_fcache("fcache", fcache_store_entry, &c);
- if (ret)
- arla_warn(ADEBWARN, ret, "failed to write fcache state");
- else
- arla_warnx (ADEBFCACHE, "wrote %u entries to fcache", c.n);
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-fcache_recover_entry (struct fcache_store *st, void *ptr)
-{
- AFSCallBack broken_callback = {0, 0, CBDROPPED};
- unsigned *n = (unsigned *)ptr;
-
- CredCacheEntry *ce;
- FCacheEntry *e;
- int i;
- VolCacheEntry *vol;
- int res;
- int32_t cellid;
-
- cellid = cell_name2num(st->cell);
- assert (cellid != -1);
-
- ce = cred_get (cellid, 0, 0);
- if (ce == NULL) {
- arla_warnx (ADEBMISC, "cred_get failed");
- exit(-1);
- }
-
- res = volcache_getbyid (st->fid.Volume, cellid, ce, &vol, NULL);
- cred_free (ce);
- if (res)
- return 0;
- if (!vol)
- exit(-1);
-
- e = calloc(1, sizeof(FCacheEntry));
- e->invalid_ptr = -1;
- Lock_Init(&e->lock);
- ObtainWriteLock(&e->lock);
-
-
- e->fid.Cell = cellid;
- e->fid.fid = st->fid;
- e->host = 0;
- e->status = st->status;
- e->length = st->length;
- e->fetched_length = st->fetched_length;
- e->callback = broken_callback;
- e->volsync = st->volsync;
- e->refcount = st->refcount;
-
- /* Better not restore the rights. pags don't have to be the same */
- for (i = 0; i < NACCESS; ++i) {
- e->acccache[i].cred = ARLA_NO_AUTH_CRED;
- e->acccache[i].access = ANONE;
- }
-
- e->anonaccess = st->anonaccess;
- e->index = st->index;
- fcache_create_file(e, 0);
- set_recovered(e->index);
- e->flags.usedp = TRUE;
- e->flags.attrp = st->flags.attrp;
- /* st->flags.datap */
- e->flags.attrusedp = FALSE;
- e->flags.datausedp = FALSE;
- e->flags.kernelp = FALSE;
- e->flags.extradirp = st->flags.extradirp;
- e->flags.mountp = st->flags.mountp;
- e->flags.fake_mp = st->flags.fake_mp;
- e->flags.vol_root = st->flags.vol_root;
- e->flags.sentenced = FALSE;
- e->flags.silly = FALSE;
- e->tokens = 0;
- e->parent.Cell = cell_name2num(st->parentcell);
- if (e->parent.Cell == -1)
- exit(-1);
- e->parent.fid = st->parent;
- e->priority = st->priority;
- e->hits = 0;
- e->cleanergen = 0;
- e->lru_le = listaddhead (lrulist, e);
- if (!e->lru_le)
- exit(-1);
- e->volume = vol;
- hashtabadd (hashtab, e);
- if (e->length)
- usedbytes += e->length;
- ReleaseWriteLock (&e->lock);
-
- (*n)++;
-
- return 0;
-}
-
-/*
- *
- */
-
-static void
-fcache_recover_state (void)
-{
- unsigned n;
-
- n = 0;
- state_recover_fcache("fcache", fcache_recover_entry, &n);
-
- arla_warnx (ADEBFCACHE, "recovered %u entries to fcache", n);
- current_vnodes = n;
-}
-
-/*
- * Search for `cred' in `ae' and return a pointer in `pos'. If it
- * already exists return TRUE, else return FALSE and set pos to a
- * random slot.
- */
-
-Bool
-findaccess (nnpfs_pag_t cred, AccessEntry *ae, AccessEntry **pos)
-{
- int i;
-
- for(i = 0; i < NACCESS ; ++i)
- if(ae[i].cred == cred) {
- *pos = &ae[i];
- return TRUE;
- }
-
- i = rand() % NACCESS;
- *pos = &ae[i];
- return FALSE;
-}
-
-/*
- *
- */
-
-
-static int
-fs_rtt_cmp (const void *v1, const void *v2)
-{
- struct fs_server_entry *e1 = (struct fs_server_entry *)v1;
- struct fs_server_entry *e2 = (struct fs_server_entry *)v2;
-
- return conn_rtt_cmp(&e1->conn, &e2->conn);
-}
-
-/*
- * Initialize a `fs_server_context'.
- */
-
-static void
-init_fs_server_context (fs_server_context *context)
-{
- context->num_conns = 0;
-}
-
-static long
-find_partition (fs_server_context *context)
-{
- int i = context->conns[context->i - 1].ve_ent;
-
- if (i < 0 || i >= context->ve->entry.nServers)
- return 0;
- return context->ve->entry.serverPartition[i];
-}
-
-/*
- * Find the next fileserver for the request in `context'.
- * Returns a ConnCacheEntry or NULL.
- */
-
-ConnCacheEntry *
-find_next_fs (fs_server_context *context,
- ConnCacheEntry *prev_conn,
- int error)
-{
- if (error) {
- if (host_downp(error))
- conn_dead (prev_conn);
- if (volume_downp(error))
- volcache_mark_down (context->ve,
- context->conns[context->i - 1].ve_ent,
- error);
- } else if (prev_conn) {
- if(prev_conn != context->conns[context->i - 1].conn)
- exit(-1);
- volcache_reliable_el(context->ve, context->conns[context->i - 1].ve_ent);
- }
-
- if (context->i < context->num_conns)
- return context->conns[context->i++].conn;
- else
- return NULL;
-}
-
-/*
- * Clean up a `fs_server_context'
- */
-
-void
-free_fs_server_context (fs_server_context *context)
-{
- int i;
-
- for (i = 0; i < context->num_conns; ++i)
- conn_free (context->conns[i].conn);
-
- if (context->ve)
- volcache_process_marks(context->ve);
-}
-
-/*
- * Find the the file servers housing the volume for `e' and store it
- * in the `context'.
- */
-
-int
-init_fs_context (FCacheEntry *e,
- CredCacheEntry *ce,
- fs_server_context *context)
-{
- VolCacheEntry *ve = e->volume;
- int i;
- int bit;
- int num_clones;
- int cell = e->fid.Cell;
- int ret;
-
- memset(context, 0, sizeof(*context));
-
- if (ve == NULL) {
- ret = volcache_getbyid (e->fid.fid.Volume, e->fid.Cell,
- ce, &e->volume, NULL);
- if (ret)
- return ret;
- ve = e->volume;
- }
-
- ret = volume_make_uptodate (ve, ce);
- if (ret)
- return ret;
-
- bit = volcache_volid2bit (ve, e->fid.fid.Volume);
-
- if (bit == -1) {
- /* the volume entry is inconsistent. */
- volcache_invalidate_ve (ve);
- return ENOENT;
- }
-
- num_clones = 0;
- for (i = 0; i < min(NMAXNSERVERS,ve->entry.nServers); ++i) {
- u_long addr = htonl(ve->entry.serverNumber[i]);
-
- if (ve->entry.serverFlags[i] & bit
- && addr != 0
- && (ve->entry.serverFlags[i] & VLSF_DONTUSE) == 0) {
- ConnCacheEntry *conn;
-
- conn = conn_get (cell, addr, afsport,
- FS_SERVICE_ID, fs_probe, ce);
- if (!conn_isalivep (conn))
- conn->rtt = INT_MAX/2 ;
- else if (!volcache_reliablep_el(ve, i))
- conn->rtt = INT_MAX/4;
- else
- conn->rtt = rx_PeerOf(conn->connection)->srtt
- + rand() % RTT_FUZZ - RTT_FUZZ / 2;
- context->conns[num_clones].conn = conn;
- context->conns[num_clones].ve_ent = i;
- ++num_clones;
- }
- }
-
- if (num_clones == 0)
- return ENOENT;
-
- context->ve = ve;
-
- qsort (context->conns, num_clones, sizeof(*context->conns),
- fs_rtt_cmp);
-
- context->num_conns = num_clones;
- context->i = 0;
-
- return 0;
-}
-
-/*
- * Find the first file server housing the volume for `e'.
- */
-
-ConnCacheEntry *
-find_first_fs (fs_server_context *context)
-{
- return find_next_fs (context, NULL, 0);
-}
-
-/*
- * Initialize the file cache in `cachedir', with these values for high
- * and low-water marks.
- */
-
-void
-fcache_init (u_long alowvnodes,
- u_long ahighvnodes,
- int64_t alowbytes,
- int64_t ahighbytes,
- Bool recover)
-{
- /*
- * Initialize all variables.
- */
-
-#ifdef KERBEROS
- fhopen_working = k_hasafs ();
-#else
- fhopen_working = 0;
-#endif
-
- collectstats_init ();
-
- node_count = 0;
- lowvnodes = alowvnodes;
- highvnodes = ahighvnodes;
- lowbytes = alowbytes;
- highbytes = ahighbytes;
-
- hashtab = hashtabnew (FCHASHSIZE, fcachecmp, fcachehash);
- if (hashtab == NULL)
- arla_errx (1, ADEBERROR, "fcache: hashtabnew failed");
-
- lrulist = listnew ();
- if (lrulist == NULL)
- arla_errx (1, ADEBERROR, "fcache: listnew failed");
-
- invalid_heap = heap_new (ahighvnodes, expiration_time_cmp);
- if (invalid_heap == NULL)
- arla_errx (1, ADEBERROR, "fcache: heap_new failed");
-
- if (recover)
- fcache_recover_state ();
-
- if (LWP_CreateProcess (create_nodes, CREATE_NODES_STACKSIZE, 1,
- NULL, "fcache-create-nodes",
- &create_nodes_pid))
- arla_errx (1, ADEBERROR,
- "fcache: cannot create create-nodes thread");
-
- if (LWP_CreateProcess (cleaner, CLEANER_STACKSIZE, 1,
- NULL, "fcache-cleaner", &cleaner_pid))
- arla_errx (1, ADEBERROR,
- "fcache: cannot create cleaner thread");
-
- if (LWP_CreateProcess (invalidator, CLEANER_STACKSIZE, 1,
- NULL, "fcache-invalidator", &invalidator_pid))
- arla_errx (1, ADEBERROR,
- "fcache: cannot create invalidator thread");
-}
-
-/*
- * set new values for those of lowvnodes, highvnodes, lowbytes, highbytes
- * that are not zero.
- * return 0 or an error code
- */
-
-int
-fcache_reinit(u_long alowvnodes,
- u_long ahighvnodes,
- int64_t alowbytes,
- int64_t ahighbytes)
-{
- arla_warnx (ADEBFCACHE, "fcache_reinit");
-
- if (ahighvnodes != 0) {
- if (ahighvnodes > highvnodes) {
- highvnodes = ahighvnodes;
- LWP_NoYieldSignal (create_nodes);
- } else
- highvnodes = ahighvnodes;
- }
-
- if (alowvnodes != 0)
- lowvnodes = alowvnodes;
-
- if (alowbytes != 0)
- lowbytes = alowbytes;
-
- if (ahighbytes != 0)
- highbytes = ahighbytes;
-
- return 0;
-}
-
-/*
- * Find the entry for `fid' in the hash table.
- * If it's found, move it to the front of `lrulist' as well.
- */
-
-static FCacheEntry *
-find_entry_nolock (VenusFid fid)
-{
- FCacheEntry key;
- FCacheEntry *e;
-
- if (hashtab == NULL)
- return NULL;
-
- key.fid = fid;
- e = (FCacheEntry *)hashtabsearch (hashtab, (void *)&key);
- if (e != NULL) {
- listdel (lrulist, e->lru_le);
- e->lru_le = listaddhead (lrulist, e);
- if(!e->lru_le)
- return NULL;
- }
- return e;
-}
-
-/*
- * Find the entry and return it locked.
- */
-
-static FCacheEntry *
-find_entry (VenusFid fid)
-{
- FCacheEntry *e;
-
- e = find_entry_nolock (fid);
-
- if (e != NULL)
- ObtainWriteLock (&e->lock);
- return e;
-}
-
-/*
- * Mark `e' as having `callback' and notify the kernel.
- * This might be overly hash to opened files.
- */
-
-static void
-stale (FCacheEntry *e, AFSCallBack callback)
-{
- if (callback.CallBackType == CBDROPPED &&
- e->callback.CallBackType == CBDROPPED)
- return;
-
- if (CheckLock (&e->lock) != 0)
- e->flags.sentenced = TRUE;
- else {
- ObtainWriteLock (&e->lock);
- fcache_poller_unref(e);
- e->callback = callback;
-
- if (e->flags.kernelp)
- break_callback (e);
- else
- e->tokens = 0;
- if (e->status.FileType == TYPE_DIR && e->length)
- throw_data(e);
- ReleaseWriteLock (&e->lock);
- }
-}
-
-struct stale_arg {
- VenusFid fid;
- AFSCallBack callback;
-};
-
-/*
- * Iterate over all entries till we find an entry that matches in only
- * fid (without cell) and stale it.
- */
-
-static Bool
-stale_unknown_cell (void *ptr, void *arg)
-{
- FCacheEntry *e = (FCacheEntry *)ptr;
- struct stale_arg *sa = (struct stale_arg *)arg;
-
- if (e->fid.fid.Volume == sa->fid.fid.Volume
- && e->fid.fid.Vnode == sa->fid.fid.Vnode
- && e->fid.fid.Unique == sa->fid.fid.Unique)
- stale (e, sa->callback);
-
- return FALSE;
-}
-
-/*
- * Call stale on the entry corresponding to `fid', if any.
- */
-
-void
-fcache_stale_entry (VenusFid fid, AFSCallBack callback)
-{
- FCacheEntry *e;
-
- if (fid.Cell == -1) {
- struct stale_arg arg;
-
- arg.fid = fid;
- arg.callback = callback;
-
- hashtabforeach (hashtab, stale_unknown_cell, &arg);
- return;
- }
-
- e = find_entry_nolock (fid);
- if (e == NULL) {
- arla_warnx (ADEBFCACHE,
- "callback for non-existing file (%d, %u, %u, %u)",
- fid.Cell, fid.fid.Volume, fid.fid.Vnode, fid.fid.Unique);
- return;
- }
- stale (e, callback);
-}
-
-typedef struct {
- nnpfs_pag_t pag;
- int32_t cell;
-} fc_purgecred;
-
-/*
- * If ptr has cred arg, set it invalid
- */
-
-static Bool
-purge_cred (void *ptr, void *arg)
-{
- FCacheEntry *e = (FCacheEntry *)ptr;
- fc_purgecred *cred = (fc_purgecred *) arg;
- AccessEntry *ae = e->acccache;
- int i;
-
- if (e->fid.Cell == cred->cell || cred->cell == -1) {
-
- for(i = 0; i < NACCESS ; ++i)
- if(ae[i].cred == cred->pag) {
- ae[i].cred = ARLA_NO_AUTH_CRED;
- ae[i].access = ANONE;
- if (e->flags.kernelp)
- install_attr (e, FCACHE2NNPFSNODE_NO_LENGTH);
- break;
- }
- }
- return FALSE;
-}
-
-
-/*
- * Mark as cred as stale in kernel and all fcache-entries,
- * When cell == -1, flush all creds in this pag.
- */
-
-void
-fcache_purge_cred (nnpfs_pag_t pag, int32_t cell)
-{
- fc_purgecred cred;
-
- cred.pag = pag;
- cred.cell = cell;
-
- hashtabforeach(hashtab, purge_cred, &cred);
-}
-
-/*
- * If ptr was retrieved from cell - volume , try to mark stale
- */
-
-static Bool
-purge_volume (void *ptr, void *arg)
-{
- FCacheEntry *e = (FCacheEntry *)ptr;
- VenusFid *fid = (VenusFid *) arg;
- AFSCallBack broken_callback = {0, 0, CBDROPPED};
-
- if ((e->fid.Cell == fid->Cell || fid->Cell == -1)
- && e->fid.fid.Volume == fid->fid.Volume) {
- stale (e, broken_callback);
- }
- return FALSE;
-}
-
-/*
- * Mark as stale all entries from cell.volume
- */
-
-void
-fcache_purge_volume (VenusFid fid)
-{
- hashtabforeach(hashtab, purge_volume, &fid);
-}
-
-/*
- * If `ptr' was retrieved from `host', mark it as stale.
- */
-
-static Bool
-purge_host (void *ptr, void *arg)
-{
- FCacheEntry *e = (FCacheEntry *)ptr;
- u_long *host = (u_long *)arg;
- AFSCallBack broken_callback = {0, 0, CBDROPPED};
-
- assert (*host);
- if (e->host == *host)
- stale (e, broken_callback);
- return FALSE;
-}
-
-/*
- * Mark as stale all entries from the host `host'.
- */
-
-void
-fcache_purge_host (u_long host)
-{
- hashtabforeach (hashtab, purge_host, &host);
-}
-
-
-/*
- * If `ptr' is a mountpoint, mark it as stale.
- */
-
-static Bool
-invalidate_mp (void *ptr, void *arg)
-{
- FCacheEntry *e = (FCacheEntry *)ptr;
- AFSCallBack broken_callback = {0, 0, CBDROPPED};
-
- if (e->flags.mountp)
- stale (e, broken_callback);
- return FALSE;
-
-
-}
-
-/*
- * Invalidate all mountpoints to force the to be reread.
- */
-
-void
-fcache_invalidate_mp (void)
-{
- hashtabforeach (hashtab, invalidate_mp, NULL);
-}
-
-/*
- * Mark `entry' as not being used.
- */
-
-void
-fcache_unused (FCacheEntry *entry)
-{
- entry->flags.datausedp = entry->flags.attrusedp = FALSE;
- listdel (lrulist, entry->lru_le);
- entry->lru_le = listaddtail (lrulist, entry);
- assert (entry->lru_le);
- /*
- * we don't signal lrulist here since we never
- * free the node (usedvnode--);
- */
-}
-
-/*
- * make up some status that might be valid for a mount-point
- */
-
-static void
-fake_mp_status (FCacheEntry *e)
-{
- AFSFetchStatus *status = &e->status;
-
- status->FileType = TYPE_DIR;
- status->LinkCount = 100;
- status->UnixModeBits = 0777;
- status->ClientModTime = 0;
- status->ServerModTime = 0;
- status->Owner = 0;
- status->Group = 0;
-}
-
-/*
- * Return true if `entry' is a mountpoint
- */
-
-static Bool
-mountpointp (FCacheEntry *entry)
-{
- if (entry->status.FileType == TYPE_LINK
- && entry->status.Length != 0
- && entry->status.UnixModeBits == 0644)
- return TRUE;
- return FALSE;
-}
-
-/*
- * Mark `entry' as mountpoint or a fake mountpoint depending on
- * fake_mp is used or not.
- */
-
-void
-fcache_mark_as_mountpoint (FCacheEntry *entry)
-{
- if (fake_mp) {
- entry->flags.fake_mp = TRUE;
- fake_mp_status (entry);
- } else {
- entry->flags.mountp = TRUE;
- }
-}
-
-/*
- * Update all the relevant parts of `entry' after having received new
- * data from the file server.
- */
-
-static void
-update_entry (FCacheEntry *entry,
- AFSFetchStatus *status,
- AFSCallBack *callback,
- AFSVolSync *volsync,
- ConnCacheEntry *conn,
- nnpfs_pag_t cred)
-{
- struct timeval tv;
- AccessEntry *ae;
- unsigned long bitmask = 0141777; /* REG, DIR, STICKY, USR, GRP, OTH */
-
- if (entry->volume && cell_issuid_by_num (entry->volume->cell))
- bitmask |= 0006000; /* SUID, SGID */
-
- gettimeofday (&tv, NULL);
-
- entry->status = *status;
- entry->status.UnixModeBits &= bitmask;
- if (callback) {
- entry->callback = *callback;
- entry->callback.ExpirationTime += tv.tv_sec;
- add_to_invalidate (entry);
- }
- if (volsync) {
- entry->volsync = *volsync;
- if (entry->volume)
- volcache_update_volsync (entry->volume, *volsync);
- }
-
- if (conn) {
- fcache_poller_reref(entry, conn);
- entry->host = rx_HostOf(rx_PeerOf(conn->connection));
- } else {
- fcache_poller_unref(entry);
- entry->host = 0;
- }
-
- entry->anonaccess = status->AnonymousAccess;
- findaccess (cred, entry->acccache, &ae);
- ae->cred = cred;
- ae->access = status->CallerAccess;
- if (!entry->flags.mountp && mountpointp (entry))
- fcache_mark_as_mountpoint (entry);
-}
-
-/*
- * Update entry, common code for do_read_attr and get_attr_bulk
- */
-
-static void
-update_attr_entry (FCacheEntry *entry,
- AFSFetchStatus *status,
- AFSCallBack *callback,
- AFSVolSync *volsync,
- ConnCacheEntry *conn,
- nnpfs_pag_t cred)
-{
- if (entry->fetched_length
- && entry->status.DataVersion != status->DataVersion
- && !entry->flags.datausedp)
- {
- throw_data (entry);
- entry->tokens &= ~(NNPFS_DATA_R|NNPFS_DATA_W);
- }
-
- update_entry (entry, status, callback, volsync,
- conn, cred);
-
- entry->tokens |= NNPFS_ATTR_R;
- entry->flags.attrp = TRUE;
-}
-
-
-/*
- * Give up all callbacks.
- */
-
-static int
-giveup_all_callbacks (uint32_t cell, uint32_t host, void *arg)
-{
- CredCacheEntry *ce;
- ConnCacheEntry *conn;
- Listitem *item;
- int ret;
-
- ce = cred_get (cell, 0, CRED_ANY);
- assert (ce != NULL);
-
- conn = conn_get (cell, host, afsport, FS_SERVICE_ID, fs_probe, ce);
- cred_free (ce);
-
- if (!conn_isalivep (conn))
- goto out;
-
- ret = RXAFS_GiveUpAllCallBacks(conn->connection);
- if (ret == 0) {
- for (item = listtail(lrulist);
- item != NULL;
- item = listprev(lrulist, item)) {
- FCacheEntry *entry = (FCacheEntry *)listdata(item);
-
- if (entry->host == host)
- entry->flags.attrp = FALSE;
- }
- } else if (ret != RXGEN_OPCODE) {
- struct in_addr in_addr;
-
- in_addr.s_addr = rx_HostOf(rx_PeerOf(conn->connection));
- arla_warn (ADEBWARN, ret, "GiveUpAllCallBacks %s",
- inet_ntoa (in_addr));
- }
-
- out:
- conn_free (conn);
-
- return 0;
-}
-
-int
-fcache_giveup_all_callbacks (void)
-{
- Listitem *item;
-
- poller_foreach(giveup_all_callbacks, NULL);
-
- for (item = listtail(lrulist);
- item != NULL;
- item = listprev(lrulist, item)) {
- FCacheEntry *entry = (FCacheEntry *)listdata(item);
-
- if (entry->flags.attrp &&
- entry->flags.silly == FALSE &&
- entry->host != 0) {
-
- CredCacheEntry *ce;
- ConnCacheEntry *conn;
- AFSCBFids fids;
- AFSCBs cbs;
- int ret;
-
- ce = cred_get (entry->fid.Cell, 0, CRED_ANY);
- assert (ce != NULL);
-
- conn = conn_get (entry->fid.Cell, entry->host, afsport,
- FS_SERVICE_ID, fs_probe, ce);
- cred_free (ce);
-
- if (conn != NULL) {
- fids.len = cbs.len = 1;
- fids.val = &entry->fid.fid;
- cbs.val = &entry->callback;
-
- ret = RXAFS_GiveUpCallBacks (conn->connection, &fids, &cbs);
- conn_free (conn);
- if (ret) {
- struct in_addr in_addr;
-
- in_addr.s_addr = rx_HostOf(rx_PeerOf(conn->connection));
- arla_warn (ADEBFCACHE, ret, "RXAFS_GiveUpCallBacks %s",
- inet_ntoa (in_addr));
- } else
- entry->flags.attrp = FALSE;
- }
- }
- }
- return 0; /* XXX */
-}
-
-/*
- * Obtain new callbacks for all entries in the cache.
- */
-
-int
-fcache_reobtain_callbacks (struct nnpfs_cred *cred)
-{
- Listitem *item;
- int ret;
-
- for (item = listtail(lrulist);
- item != NULL;
- item = listprev(lrulist, item)) {
- FCacheEntry *entry = (FCacheEntry *)listdata(item);
-
- ObtainWriteLock (&entry->lock);
- if (entry->flags.usedp &&
- entry->flags.silly == FALSE &&
- entry->host != 0) {
-
- CredCacheEntry *ce;
- ConnCacheEntry *conn;
- AFSFetchStatus status;
- AFSCallBack callback;
- AFSVolSync volsync;
- VolCacheEntry *vol;
-
- ce = cred_get (entry->fid.Cell, cred->pag, CRED_ANY);
- assert (ce != NULL);
-
- conn = conn_get (entry->fid.Cell, entry->host, afsport,
- FS_SERVICE_ID, fs_probe, ce);
- if (!conn_isalivep(conn))
- goto out;
- /*
- * does this belong here?
- */
-
- ret = volcache_getbyid (entry->fid.fid.Volume,
- entry->fid.Cell, ce, &vol, NULL);
- if (ret == 0)
- entry->volume = vol;
-
- ret = RXAFS_FetchStatus (conn->connection,
- &entry->fid.fid,
- &status,
- &callback,
- &volsync);
- if (ret)
- arla_warn (ADEBFCACHE, ret, "RXAFS_FetchStatus");
- else {
- update_attr_entry (entry, &status, &callback, &volsync,
- conn, ce->cred);
- if (entry->flags.kernelp)
- break_callback (entry);
- }
- fcache_counter.fetch_attr++;
- out:
- if (conn)
- conn_free (conn);
- cred_free (ce);
- }
- ReleaseWriteLock (&entry->lock);
- }
- return 0; /* XXX */
-}
-
-/*
- * Return true iff there's any point in trying the next fs.
- */
-
-static Bool
-try_next_fs (int error, const VenusFid *fid)
-{
- switch (error) {
-#ifdef KERBEROS
- case RXKADUNKNOWNKEY:
-#endif
- case ARLA_CALL_DEAD :
- case ARLA_INVALID_OPERATION :
- case ARLA_CALL_TIMEOUT :
- case ARLA_EOF :
- case ARLA_PROTOCOL_ERROR :
- case ARLA_USER_ABORT :
- case ARLA_ADDRINUSE :
- case ARLA_MSGSIZE :
- case ARLA_VSALVAGE :
- case ARLA_VNOSERVICE :
- case ARLA_VOFFLINE :
- case ARLA_VBUSY :
- case ARLA_VIO :
- return TRUE;
- case ARLA_VNOVOL :
- case ARLA_VMOVED :
- if (fid && !volcache_reliablep (fid->fid.Volume, fid->Cell))
- volcache_invalidate (fid->fid.Volume, fid->Cell);
- return TRUE;
- case 0 :
- return FALSE;
- default :
- return FALSE;
- }
-}
-
-/*
- * If the whole file is fetched as we last saw it, lets write down
- * the whole file to the fileserver. If the file is shrinking,
- * make sure we don't cache non-existing bytes.
- */
-
-static size_t
-new_fetched_length(FCacheEntry *entry, size_t cache_file_size)
-{
- size_t have_len;
-
- AssertExclLocked(&entry->lock);
-
- if (entry->fetched_length == entry->status.Length)
- have_len = cache_file_size;
- else {
- have_len = entry->fetched_length;
- /* have file shrinked ? */
- if (have_len > cache_file_size)
- have_len = cache_file_size;
- }
-
- return have_len;
-}
-
-/*
- * Fetch the attributes for the file in `entry' from the file_server,
- * using the credentials in `ce' and returning the connection in
- * `ret_conn'
- *
- * `entry' must be write-locked.
- *
- * If an error code is returned `fs_server_context' is already freed.
- * If everything is ok, `fs_server_context' must be freed by the caller.
- */
-
-static int
-do_read_attr (FCacheEntry *entry,
- CredCacheEntry *ce,
- ConnCacheEntry **ret_conn,
- fs_server_context *ret_context)
-{
- ConnCacheEntry *conn;
- AFSFetchStatus status;
- AFSCallBack callback;
- AFSVolSync volsync;
- struct collect_stat collectstat;
- int ret;
-
- AssertExclLocked(&entry->lock);
-
- *ret_conn = NULL;
-
- ret = init_fs_context(entry, ce, ret_context);
- if (ret)
- return ret;
-
- for (conn = find_first_fs (ret_context);
- conn != NULL;
- conn = find_next_fs (ret_context, conn, ret)) {
-
- collectstats_start(&collectstat);
- ret = RXAFS_FetchStatus (conn->connection,
- &entry->fid.fid,
- &status,
- &callback,
- &volsync);
- collectstats_stop(&collectstat, entry, conn,
- find_partition(ret_context),
- STATISTICS_REQTYPE_FETCHSTATUS, 1);
- arla_warnx (ADEBFCACHE, "trying to fetch status: %d", ret);
- if (!try_next_fs (ret, &entry->fid))
- break;
- }
- if (ret) {
- arla_warn (ADEBFCACHE, ret, "fetch-status");
- if (host_downp(ret))
- ret = ENETDOWN;
- free_fs_server_context (ret_context);
- return ret;
- }
-
- fcache_counter.fetch_attr++;
-
- update_attr_entry (entry, &status, &callback, &volsync,
- conn, ce->cred);
-
- AssertExclLocked(&entry->lock);
-
- *ret_conn = conn;
- return 0;
-}
-
-
-/*
- * Read the attributes of `entry' from the file server and store them.
- * `e' must be write-locked.
- */
-
-int
-read_attr (FCacheEntry *entry, CredCacheEntry *ce)
-{
- int ret;
- ConnCacheEntry *conn;
- fs_server_context context;
-
- AssertExclLocked(&entry->lock);
-
- init_fs_server_context (&context);
- ret = do_read_attr (entry, ce, &conn, &context);
- if (ret)
- return ret;
- free_fs_server_context (&context);
- return 0;
-}
-
-/*
- * Read the contents of `entry' from the file server and store it.
- */
-
-static int
-read_data (FCacheEntry *entry, ConnCacheEntry *conn, CredCacheEntry *ce,
- long partition)
-{
- struct rx_call *call;
- int ret = 0;
- uint32_t wanted_length, sizefs, nbytes = 0;
- int32_t sizediff;
- int fd;
- AFSFetchStatus status;
- AFSCallBack callback;
- AFSVolSync volsync;
- struct collect_stat collectstat;
-
- arla_warnx (ADEBMISC, "read_data");
-
- AssertExclLocked(&entry->lock);
-
- if (connected_mode == DISCONNECTED) {
- ret = ENETDOWN;
- goto out;
- }
-
- /* are we already done ? */
- if (entry->wanted_length <= entry->fetched_length) {
- ret = 0;
- goto out;
- }
-
- /* figure out how much more then we need we want to fetch */
- wanted_length = stats_fetch_round(conn, partition, entry->wanted_length);
- if (wanted_length > entry->status.Length)
- wanted_length = entry->status.Length;
-
- /* we need more space ? */
- if (wanted_length > entry->length)
- nbytes = wanted_length - entry->length;
-
- if (usedbytes + nbytes > highbytes) {
- ret = fcache_need_bytes (nbytes);
- if (ret)
- goto out;
- }
-
- if (usedbytes + nbytes > highbytes) {
- arla_warnx (ADEBWARN, "Out of space, not enough cache "
- "(file-length: %d need bytes: %ld usedbytes: %ld)",
- entry->status.Length, (long)nbytes, (long)usedbytes);
- ret = ENOSPC;
- goto out;
- }
-
- /* now go talk to the world */
- call = rx_NewCall (conn->connection);
- if (call == NULL) {
- arla_warnx (ADEBMISC, "rx_NewCall failed");
- ret = ENOMEM;
- goto out;
- }
-
- collectstats_start(&collectstat);
- ret = StartRXAFS_FetchData (call, &entry->fid.fid, entry->fetched_length,
- wanted_length - entry->fetched_length);
- if(ret) {
- arla_warn (ADEBFCACHE, ret, "fetch-data");
- rx_EndCall(call,ret);
- goto out;
- }
-
- ret = rx_Read (call, &sizefs, sizeof(sizefs));
- if (ret != sizeof(sizefs)) {
- ret = conv_to_arla_errno(rx_GetCallError(call));
- arla_warn (ADEBFCACHE, ret, "Error reading length");
- rx_EndCall(call, 0);
- goto out;
- }
- sizefs = ntohl (sizefs);
-
- fd = fcache_open_file (entry, O_RDWR);
- if (fd < 0) {
- ret = errno;
- arla_warn (ADEBFCACHE, ret, "open cache file %u",
- (unsigned)entry->index);
- rx_EndCall(call, 0);
- goto out;
- }
-
- if (ftruncate(fd, entry->status.Length) < 0) {
- close(fd);
- ret = errno;
- rx_EndCall(call, 0);
- goto out;
- }
-
- ret = copyrx2fd (call, fd, entry->fetched_length, sizefs);
- close (fd);
- if (ret) {
- arla_warn (ADEBFCACHE, ret, "copyrx2fd");
- rx_EndCall(call, ret);
- goto out;
- }
-
- ret = rx_EndCall (call, EndRXAFS_FetchData (call,
- &status,
- &callback,
- &volsync));
- if(ret) {
- arla_warn (ADEBFCACHE, ret, "rx_EndCall");
- goto out;
- }
- collectstats_stop(&collectstat, entry, conn,
- partition, STATISTICS_REQTYPE_FETCHDATA, sizefs);
-
- entry->fetched_length += sizefs;
- sizediff = entry->fetched_length - entry->length;
- entry->length = entry->fetched_length;
- usedbytes += sizediff;
-
- fcache_counter.fetch_data++;
-
- update_entry (entry, &status, &callback, &volsync,
- conn, ce->cred);
-
- entry->tokens |= NNPFS_DATA_R | NNPFS_DATA_W | NNPFS_OPEN_NR | NNPFS_OPEN_NW;
-
- out:
- AssertExclLocked(&entry->lock);
-
- return ret;
-}
-
-/*
- * Write the contents of the cache file back to the file server.
- */
-
-int
-write_data (FCacheEntry *entry, AFSStoreStatus *storestatus,
- CredCacheEntry *ce)
-{
- ConnCacheEntry *conn;
- struct rx_call *call;
- int ret;
- uint32_t sizefs;
- size_t have_len;
- int fd;
- struct stat statinfo;
- AFSFetchStatus status;
- AFSVolSync volsync;
- fs_server_context context;
- struct collect_stat collectstat;
-
- AssertExclLocked(&entry->lock);
-
- /* Don't write data to deleted files */
- if (entry->flags.silly)
- return 0;
-
- fd = fcache_open_file (entry, O_RDWR);
- if (fd < 0) {
- ret = errno;
- arla_warn (ADEBFCACHE, ret, "open cache file %u",
- (unsigned)entry->index);
- return ret;
- }
-
- if (fstat (fd, &statinfo) < 0) {
- ret = errno;
- close (fd);
- arla_warn (ADEBFCACHE, ret, "stat cache file %u",
- (unsigned)entry->index);
- return ret;
- }
- sizefs = statinfo.st_size;
-
- have_len = new_fetched_length(entry, sizefs);
- if (entry->status.Length < have_len)
- entry->status.Length = have_len;
-
- /*
- *
- */
-
- fcache_update_length (entry, have_len, have_len);
- if (connected_mode != CONNECTED) {
- close (fd);
- return 0;
- }
-
- ret = init_fs_context(entry, ce, &context);
- if (ret)
- return ret;
-
- for (conn = find_first_fs (&context);
- conn != NULL;
- conn = find_next_fs (&context, conn, ret)) {
-
- call = rx_NewCall (conn->connection);
- if (call == NULL) {
- arla_warnx (ADEBMISC, "rx_NewCall failed");
- ret = ENOMEM;
- break;
- }
-
- collectstats_start(&collectstat);
- ret = StartRXAFS_StoreData (call, &entry->fid.fid,
- storestatus,
- 0,
- have_len,
- entry->status.Length);
- if (host_downp(ret)) {
- rx_EndCall(call, ret);
- continue;
- } else if (ret) {
- arla_warn (ADEBFCACHE, ret, "store-data");
- rx_EndCall(call, 0);
- break;
- }
-
- ret = copyfd2rx (fd, call, 0, have_len);
- if (ret) {
- rx_EndCall(call, ret);
- arla_warn (ADEBFCACHE, ret, "copyfd2rx");
- break;
- }
-
- ret = EndRXAFS_StoreData (call,
- &status,
- &volsync);
- if (ret) {
- rx_EndCall (call, ret);
- arla_warnx (ADEBFCACHE, "EndRXAFS_StoreData");
- break;
- }
-
- ret = rx_EndCall (call, 0);
- if (ret) {
- arla_warn (ADEBFCACHE, ret, "rx_EndCall");
- }
- collectstats_stop(&collectstat, entry, conn,
- find_partition(&context),
- STATISTICS_REQTYPE_STOREDATA, sizefs);
- break;
- }
-
- if (conn != NULL) {
- if (ret == 0) {
- fcache_counter.store_data++;
- update_entry (entry, &status, NULL, &volsync,
- conn, ce->cred);
- } else {
- ftruncate (fd, 0);
- usedbytes -= entry->length;
- entry->length = 0;
- entry->wanted_length = 0;
- entry->fetched_length = 0;
- }
- }
- if (host_downp(ret))
- ret = ENETDOWN;
- free_fs_server_context (&context);
- AssertExclLocked(&entry->lock);
- close (fd);
- return ret;
-}
-
-/*
- * Truncate the file in `entry' to `size' bytes.
- */
-
-int
-truncate_file (FCacheEntry *entry, off_t size,
- AFSStoreStatus *storestatus, CredCacheEntry *ce)
-{
- fs_server_context context;
- ConnCacheEntry *conn;
- struct rx_call *call;
- AFSFetchStatus status;
- AFSVolSync volsync;
- size_t have_len;
- int ret;
-
- AssertExclLocked(&entry->lock);
-
- if (connected_mode != CONNECTED)
- return 0;
-
- have_len = new_fetched_length(entry, size);
-
- ret = init_fs_context(entry, ce, &context);
- if (ret)
- return ret;
-
- for (conn = find_first_fs (&context);
- conn != NULL;
- conn = find_next_fs (&context, conn, ret)) {
-
- call = rx_NewCall (conn->connection);
- if (call == NULL) {
- arla_warnx (ADEBMISC, "rx_NewCall failed");
- ret = ENOMEM;
- break;
- }
-
- ret = StartRXAFS_StoreData (call,
- &entry->fid.fid,
- storestatus,
- size,
- 0,
- size);
- if (host_downp(ret)) {
- rx_EndCall(call, ret);
- continue;
- } else if(ret) {
- arla_warn (ADEBFCACHE, ret, "store-data");
- rx_EndCall(call, 0);
- break;
- }
-
- ret = EndRXAFS_StoreData (call,
- &status,
- &volsync);
- if (ret) {
- rx_EndCall (call, ret);
- arla_warnx (ADEBFCACHE, "EndRXAFS_StoreData");
- break;
- }
-
- ret = rx_EndCall (call, 0);
- if (ret)
- arla_warn (ADEBFCACHE, ret, "rx_EndCall");
-
- break;
- }
-
- if (ret == 0) {
- int fd;
-
- fd = fcache_open_file (entry, O_RDWR);
- if (fd < 0) {
- ret = errno;
- arla_warn (ADEBFCACHE, ret, "open fache file %u",
- (unsigned)entry->index);
- return ret;
- }
-
- if(ftruncate (fd, size) < 0) {
- ret = errno;
- arla_warn (ADEBFCACHE, ret, "ftruncate %ld", (long)size);
- close (fd);
- return ret;
- }
-
- close (fd);
-
- fcache_update_length (entry, size, have_len);
-
- fcache_counter.store_data++;
- update_entry (entry, &status, NULL, &volsync,
- conn, ce->cred);
- }
-
- free_fs_server_context (&context);
-
- if (host_downp(ret))
- ret = ENETDOWN;
-
- AssertExclLocked(&entry->lock);
- return ret;
-}
-
-/*
- * Set the attributes of the file in `entry' to `status'.
- */
-
-int
-write_attr (FCacheEntry *entry,
- const AFSStoreStatus *store_status,
- CredCacheEntry *ce)
-{
- ConnCacheEntry *conn = NULL;
- int ret;
- AFSFetchStatus status;
- AFSVolSync volsync;
-
- AssertExclLocked(&entry->lock);
-
- /* Don't write attributes to deleted files */
- if (entry->flags.silly)
- return 0;
-
- if (connected_mode == CONNECTED) {
- fs_server_context context;
- struct collect_stat collectstat;
-
- ret = init_fs_context(entry, ce, &context);
- if (ret)
- return ret;
-
- for (conn = find_first_fs (&context);
- conn != NULL;
- conn = find_next_fs (&context, conn, ret)) {
-
- collectstats_start(&collectstat);
- ret = RXAFS_StoreStatus (conn->connection,
- &entry->fid.fid,
- store_status,
- &status,
- &volsync);
- if (host_downp(ret)) {
- continue;
- } else if (ret) {
- arla_warn (ADEBFCACHE, ret, "store-status");
- free_fs_server_context (&context);
- conn = NULL;
- goto out;
- }
- conn_ref(conn);
- break;
- }
-
- if (ret == 0)
- collectstats_stop(&collectstat, entry, conn,
- find_partition(&context),
- STATISTICS_REQTYPE_STORESTATUS, 1);
-
-
- free_fs_server_context (&context);
-
- if (host_downp(ret)) {
- ret = ENETDOWN;
- goto out;
- }
- update_entry (entry, &status, NULL, &volsync, conn, ce->cred);
-
- } else {
- assert (conn == NULL);
-
- fcache_counter.store_attr++;
- if (store_status->Mask & SS_MODTIME) {
- entry->status.ClientModTime = store_status->ClientModTime;
- entry->status.ServerModTime = store_status->ClientModTime;
- }
- if (store_status->Mask & SS_OWNER)
- entry->status.Owner = store_status->Owner;
- if (store_status->Mask & SS_GROUP)
- entry->status.Group = store_status->Group;
- if (store_status->Mask & SS_MODEBITS)
- entry->status.UnixModeBits = store_status->UnixModeBits;
- if (store_status->Mask & SS_SEGSIZE)
- entry->status.SegSize = store_status->SegSize;
- ret = 0;
- }
-
- out:
- if (conn)
- conn_free(conn);
- AssertExclLocked(&entry->lock);
-
- return ret;
-}
-
-/*
- * Create a file.
- */
-
-int
-create_file (FCacheEntry *dir_entry,
- const char *name, AFSStoreStatus *store_attr,
- VenusFid *child_fid, AFSFetchStatus *fetch_attr,
- CredCacheEntry *ce)
-{
- ConnCacheEntry *conn = NULL;
- int ret;
- AFSFid OutFid;
- FCacheEntry *child_entry;
- AFSFetchStatus status;
- AFSCallBack callback;
- AFSVolSync volsync;
- int fd;
-
- AssertExclLocked(&dir_entry->lock);
-
- if (connected_mode == CONNECTED) {
- fs_server_context context;
-
- ret = init_fs_context(dir_entry, ce, &context);
- if (ret)
- return ret;
-
- for (conn = find_first_fs (&context);
- conn != NULL;
- conn = find_next_fs (&context, conn, ret)) {
-
- ret = RXAFS_CreateFile (conn->connection,
- &dir_entry->fid.fid,
- name,
- store_attr,
- &OutFid,
- fetch_attr,
- &status,
- &callback,
- &volsync);
- if (host_downp(ret)) {
- continue;
- } else if (ret) {
- free_fs_server_context (&context);
- arla_warn (ADEBFCACHE, ret, "CreateFile");
- conn = NULL;
- goto out;
- }
- conn_ref(conn);
- break;
- }
-
- free_fs_server_context (&context);
-
- if (host_downp(ret)) {
- ret = ENETDOWN;
- goto out;
- }
-
- update_entry (dir_entry, &status, &callback, &volsync,
- conn, ce->cred);
-
- } else {
- static int fakefid = 1001;
-
- if (conn != NULL)
- exit(-1);
-
- ret = 0;
-
- OutFid.Volume = dir_entry->fid.fid.Volume;
- OutFid.Vnode = fakefid;
- OutFid.Unique = fakefid;
- fakefid += 2;
-
- fetch_attr->InterfaceVersion = 1;
- fetch_attr->FileType = TYPE_FILE;
- fetch_attr->LinkCount = 1;
- fetch_attr->Length = 0;
- fetch_attr->DataVersion = 1;
- fetch_attr->Author = store_attr->Owner;
- fetch_attr->Owner = store_attr->Owner;
- fetch_attr->CallerAccess = dir_entry->status.CallerAccess;
- fetch_attr->AnonymousAccess = dir_entry->status.AnonymousAccess;
- fetch_attr->UnixModeBits = store_attr->UnixModeBits;
- fetch_attr->ParentVnode = dir_entry->fid.fid.Vnode;
- fetch_attr->ParentUnique = dir_entry->fid.fid.Unique;
- fetch_attr->SegSize = store_attr->SegSize;
- fetch_attr->ClientModTime = store_attr->ClientModTime;
- fetch_attr->ServerModTime = store_attr->ClientModTime;
- fetch_attr->Group = store_attr->Group;
- fetch_attr->SyncCount = 0;
- fetch_attr->DataVersionHigh = 0;
- fetch_attr->LockCount = 0;
- fetch_attr->LengthHigh = 0;
- fetch_attr->ErrorCode = 0;
- }
-
- child_fid->Cell = dir_entry->fid.Cell;
- child_fid->fid = OutFid;
-
- ret = fcache_get (&child_entry, *child_fid, ce);
- if (ret) {
- arla_warn (ADEBFCACHE, ret, "fcache_get");
- goto out;
- }
-
- update_entry (child_entry, fetch_attr, NULL, NULL,
- conn, ce->cred);
-
- child_entry->flags.attrp = TRUE;
- child_entry->flags.kernelp = TRUE;
-
- fd = fcache_open_file (child_entry, O_WRONLY);
- if (fd < 0) {
- ret = errno;
- arla_warn (ADEBFCACHE, ret, "open cache file %u",
- (unsigned)child_entry->index);
- fcache_release(child_entry);
- goto out;
- }
- if (ftruncate (fd, 0) < 0) {
- ret = errno;
- arla_warn (ADEBFCACHE, ret, "ftruncate cache file %u",
- (unsigned)child_entry->index);
- close (fd);
- fcache_release(child_entry);
- goto out;
- }
- close (fd);
- child_entry->length = 0;
-
- child_entry->tokens |= NNPFS_ATTR_R | NNPFS_DATA_R | NNPFS_DATA_W;
-
- fcache_release(child_entry);
-
- out:
- if (conn)
- conn_free(conn);
-
- AssertExclLocked(&dir_entry->lock);
-
- return ret;
-}
-
-/*
- * Create a directory.
- */
-
-int
-create_directory (FCacheEntry *dir_entry,
- const char *name, AFSStoreStatus *store_attr,
- VenusFid *child_fid, AFSFetchStatus *fetch_attr,
- CredCacheEntry *ce)
-{
- ConnCacheEntry *conn = NULL;
- int ret;
- AFSFid OutFid;
- FCacheEntry *child_entry;
- AFSFetchStatus status;
- AFSCallBack callback;
- AFSVolSync volsync;
-
-
- AssertExclLocked(&dir_entry->lock);
-
- if (connected_mode == CONNECTED) {
- fs_server_context context;
-
- ret = init_fs_context(dir_entry, ce, &context);
- if (ret)
- return ret;
-
- for (conn = find_first_fs (&context);
- conn != NULL;
- conn = find_next_fs (&context, conn, ret)) {
-
- ret = RXAFS_MakeDir (conn->connection,
- &dir_entry->fid.fid,
- name,
- store_attr,
- &OutFid,
- fetch_attr,
- &status,
- &callback,
- &volsync);
-
- if (host_downp(ret)) {
- continue;
- } else if (ret) {
- free_fs_server_context (&context);
- arla_warn (ADEBFCACHE, ret, "MakeDir");
- conn = NULL;
- goto out;
- }
- conn_ref(conn);
- break;
- }
- free_fs_server_context (&context);
-
- if (host_downp(ret)) {
- ret = ENETDOWN;
- goto out;
- }
-
- update_entry (dir_entry, &status, &callback, &volsync,
- conn, ce->cred);
- } else {
- static int fakedir = 1000;
-
- ret = 0;
-
- if (conn != NULL)
- exit(-1);
-
- OutFid.Volume = dir_entry->fid.fid.Volume;
- OutFid.Vnode = fakedir;
- OutFid.Unique = fakedir;
- fakedir += 2;
-
- fetch_attr->InterfaceVersion = 1;
- fetch_attr->FileType = TYPE_DIR;
- fetch_attr->LinkCount = 2;
- fetch_attr->Length = AFSDIR_PAGESIZE;
- fetch_attr->DataVersion = 1;
- fetch_attr->Author = store_attr->Owner;
- fetch_attr->Owner = store_attr->Owner;
- fetch_attr->CallerAccess = dir_entry->status.CallerAccess;
- fetch_attr->AnonymousAccess = dir_entry->status.AnonymousAccess;
- fetch_attr->UnixModeBits = store_attr->UnixModeBits;
- fetch_attr->ParentVnode = dir_entry->fid.fid.Vnode;
- fetch_attr->ParentUnique = dir_entry->fid.fid.Unique;
- fetch_attr->SegSize = store_attr->SegSize;
- fetch_attr->ClientModTime = store_attr->ClientModTime;
- fetch_attr->ServerModTime = store_attr->ClientModTime;
- fetch_attr->Group = store_attr->Group;
- fetch_attr->SyncCount = 0;
- fetch_attr->DataVersionHigh = 0;
- fetch_attr->LockCount = 0;
- fetch_attr->LengthHigh = 0;
- fetch_attr->ErrorCode = 0;
- }
-
- child_fid->Cell = dir_entry->fid.Cell;
- child_fid->fid = OutFid;
-
- ret = fcache_get (&child_entry, *child_fid, ce);
- if (ret) {
- arla_warn (ADEBFCACHE, ret, "fcache_get");
- goto out;
- }
-
- assert(child_entry->length == 0);
-
- update_entry (child_entry, fetch_attr, NULL, NULL,
- conn, ce->cred);
-
- child_entry->flags.attrp = TRUE;
- child_entry->flags.kernelp = TRUE;
-
- ret = adir_mkdir (child_entry, child_fid->fid, dir_entry->fid.fid);
- if (ret) {
- arla_warn (ADEBFCACHE, ret, "adir_mkdir");
- fcache_release(child_entry);
- goto out;
- }
-
- child_entry->tokens |= NNPFS_ATTR_R | NNPFS_DATA_R | NNPFS_DATA_W;
-
- fcache_release(child_entry);
-
- out:
- if (conn)
- conn_free(conn);
- AssertExclLocked(&dir_entry->lock);
- return ret;
-}
-
-/*
- * Create a symbolic link.
- *
- * Note: create_symlink->flags.kernelp is not set on success
- * and that must be done by the caller.
- */
-
-int
-create_symlink (FCacheEntry *dir_entry,
- const char *name, AFSStoreStatus *store_attr,
- VenusFid *child_fid, AFSFetchStatus *fetch_attr,
- const char *contents,
- CredCacheEntry *ce)
-{
- int ret;
- ConnCacheEntry *conn;
- AFSFid OutFid;
- FCacheEntry *child_entry;
- AFSVolSync volsync;
- AFSFetchStatus new_status;
- fs_server_context context;
-
- AssertExclLocked(&dir_entry->lock);
-
- if (connected_mode != CONNECTED)
- return EINVAL;
-
- ret = init_fs_context(dir_entry, ce, &context);
- if (ret)
- return ret;
-
- for (conn = find_first_fs (&context);
- conn != NULL;
- conn = find_next_fs (&context, conn, ret)) {
-
- ret = RXAFS_Symlink (conn->connection,
- &dir_entry->fid.fid,
- name,
- contents,
- store_attr,
- &OutFid,
- fetch_attr,
- &new_status,
- &volsync);
- if (host_downp(ret)) {
- continue;
- } else if (ret) {
- arla_warn (ADEBFCACHE, ret, "Symlink");
- free_fs_server_context (&context);
- conn = NULL;
- goto out;
- }
- conn_ref(conn);
- break;
- }
- free_fs_server_context (&context);
-
- if (host_downp(ret)) {
- ret = ENETDOWN;
- goto out;
- }
-
- update_entry (dir_entry, &new_status, NULL, &volsync,
- conn, ce->cred);
-
- child_fid->Cell = dir_entry->fid.Cell;
- child_fid->fid = OutFid;
-
- ret = fcache_get (&child_entry, *child_fid, ce);
- if (ret) {
- arla_warn (ADEBFCACHE, ret, "fcache_get");
- goto out;
- }
-
- update_entry (child_entry, fetch_attr, NULL, NULL,
- conn, ce->cred);
-
- /*
- * flags.kernelp is set in cm_symlink since the symlink
- * might be a mountpoint and this entry is never install
- * into the kernel.
- */
-
- child_entry->flags.attrp = TRUE;
- child_entry->tokens |= NNPFS_ATTR_R;
-
- fcache_release(child_entry);
-
- out:
- if (conn)
- conn_free(conn);
- AssertExclLocked(&dir_entry->lock);
- return ret;
-}
-
-/*
- * Create a hard link.
- */
-
-int
-create_link (FCacheEntry *dir_entry,
- const char *name,
- FCacheEntry *existing_entry,
- CredCacheEntry *ce)
-{
- ConnCacheEntry *conn = NULL;
- int ret;
- AFSFetchStatus new_status;
- AFSFetchStatus status;
- AFSVolSync volsync;
- fs_server_context context;
-
- AssertExclLocked(&dir_entry->lock);
-
- if (connected_mode != CONNECTED)
- return EINVAL;
-
- ret = init_fs_context(dir_entry, ce, &context);
- if (ret)
- return ret;
-
- for (conn = find_first_fs (&context);
- conn != NULL;
- conn = find_next_fs (&context, conn, ret)) {
-
- ret = RXAFS_Link (conn->connection,
- &dir_entry->fid.fid,
- name,
- &existing_entry->fid.fid,
- &new_status,
- &status,
- &volsync);
- if (host_downp(ret)) {
- continue;
- } else if (ret) {
- free_fs_server_context (&context);
- arla_warn (ADEBFCACHE, ret, "Link");
- conn = NULL;
- goto out;
- }
- conn_ref(conn);
- break;
- }
- free_fs_server_context (&context);
-
- if (host_downp(ret)) {
- ret = ENETDOWN;
- goto out;
- }
-
- update_entry (dir_entry, &status, NULL, &volsync,
- conn, ce->cred);
-
- update_entry (existing_entry, &new_status, NULL, NULL,
- conn, ce->cred);
-
- out:
- if (conn)
- conn_free(conn);
- AssertExclLocked(&dir_entry->lock);
- return ret;
-}
-
-/*
- * Remove a file from a directory.
- */
-
-int
-remove_file (FCacheEntry *dir_entry, const char *name, CredCacheEntry *ce)
-{
- int ret;
- ConnCacheEntry *conn;
- AFSFetchStatus status;
- AFSVolSync volsync;
- fs_server_context context;
-
- AssertExclLocked(&dir_entry->lock);
-
- if (connected_mode == CONNECTED) {
-
- ret = init_fs_context(dir_entry, ce, &context);
- if (ret)
- return ret;
-
- for (conn = find_first_fs (&context);
- conn != NULL;
- conn = find_next_fs (&context, conn, ret)) {
-
- ret = RXAFS_RemoveFile (conn->connection,
- &dir_entry->fid.fid,
- name,
- &status,
- &volsync);
- if (host_downp(ret)) {
- continue;
- } else if (ret) {
- free_fs_server_context (&context);
- arla_warn (ADEBFCACHE, ret, "RemoveFile");
- conn = NULL;
- goto out;
- }
- conn_ref(conn);
- break;
- }
- free_fs_server_context (&context);
-
- if (host_downp(ret))
- ret = ENETDOWN;
-
- } else {
- fbuf the_fbuf;
- VenusFid child_fid;
- int fd;
-
- status = dir_entry->status;
-
- conn = NULL;
-
- ret = fcache_get_fbuf (dir_entry, &fd, &the_fbuf,
- O_RDONLY, FBUF_READ|FBUF_SHARED);
- if (ret)
- goto out;
-
- ret = fdir_lookup(&the_fbuf, &dir_entry->fid, name, &child_fid);
- if (ret == 0) {
- FCacheEntry *child_entry = NULL;
- uint32_t disco_id = 0;
-
- ret = fcache_find(&child_entry, child_fid);
- if (ret == 0)
- disco_id = child_entry->disco_id;
-
- disco_id = disco_unlink(&dir_entry->fid, &child_fid,
- name, disco_id);
-
- if (child_entry) {
- child_entry->disco_id = disco_id;
- fcache_release(child_entry);
- }
- ret = 0;
- }
-
- fbuf_end (&the_fbuf);
- close (fd);
- }
-
- if (ret == 0)
- update_entry (dir_entry, &status, NULL, &volsync,
- conn, ce->cred);
-
- out:
- if (conn)
- conn_free(conn);
- AssertExclLocked(&dir_entry->lock);
- return ret;
-}
-
-/*
- * Remove a directory from a directory.
- */
-
-int
-remove_directory (FCacheEntry *dir_entry,
- const char *name,
- CredCacheEntry *ce)
-{
- int ret;
- ConnCacheEntry *conn;
- AFSFetchStatus status;
- AFSVolSync volsync;
- fs_server_context context;
-
- AssertExclLocked(&dir_entry->lock);
-
- if (connected_mode != CONNECTED)
- return EINVAL;
-
- ret = init_fs_context(dir_entry, ce, &context);
- if (ret)
- return ret;
-
- for (conn = find_first_fs (&context);
- conn != NULL;
- conn = find_next_fs (&context, conn, ret)) {
-
- ret = RXAFS_RemoveDir (conn->connection,
- &dir_entry->fid.fid,
- name,
- &status,
- &volsync);
- if (host_downp(ret)) {
- continue;
- } else if (ret) {
- free_fs_server_context (&context);
- arla_warn (ADEBFCACHE, ret, "RemoveDir");
- conn = NULL;
- goto out;
- }
- conn_ref(conn);
- break;
- }
- free_fs_server_context (&context);
-
- if (host_downp(ret)) {
- ret = ENETDOWN;
- goto out;
- }
-
- update_entry (dir_entry, &status, NULL, &volsync,
- conn, ce->cred);
-
- out:
- if (conn)
- conn_free(conn);
- AssertExclLocked(&dir_entry->lock);
- return ret;
-}
-
-/*
- * Rename a file
- */
-
-int
-rename_file (FCacheEntry *old_dir,
- const char *old_name,
- FCacheEntry *new_dir,
- const char *new_name,
- CredCacheEntry *ce)
-{
- int ret = ARLA_CALL_DEAD;
- ConnCacheEntry *conn;
- AFSFetchStatus orig_status, new_status;
- AFSVolSync volsync;
- fs_server_context context;
-
- AssertExclLocked(&old_dir->lock);
- AssertExclLocked(&new_dir->lock);
-
- if (connected_mode != CONNECTED)
- return EINVAL;
-
- ret = init_fs_context(old_dir, ce, &context);
- if (ret)
- return ret;
-
- for (conn = find_first_fs (&context);
- conn != NULL;
- conn = find_next_fs (&context, conn, ret)) {
-
- ret = RXAFS_Rename (conn->connection,
- &old_dir->fid.fid,
- old_name,
- &new_dir->fid.fid,
- new_name,
- &orig_status,
- &new_status,
- &volsync);
- if (host_downp(ret)) {
- continue;
- } else if (ret) {
- free_fs_server_context (&context);
- arla_warn (ADEBFCACHE, ret, "Rename");
- conn = NULL;
- goto out;
- }
- conn_ref(conn);
- break;
- }
- free_fs_server_context (&context);
-
- if (host_downp(ret)) {
- ret = ENETDOWN;
- goto out;
- }
-
- update_entry (old_dir, &orig_status, NULL, &volsync,
- conn, ce->cred);
-
- update_entry (new_dir, &new_status, NULL, &volsync,
- conn, ce->cred);
-
- out:
- if (conn)
- conn_free(conn);
- AssertExclLocked(&old_dir->lock);
- AssertExclLocked(&new_dir->lock);
- return ret;
-}
-
-/*
- * Return the fid to the root.
- */
-
-int
-getroot (VenusFid *res, CredCacheEntry *ce)
-{
- VolCacheEntry *ve;
- VenusFid fid;
- const char *root_volume = volcache_get_rootvolume ();
- int ret;
- const char *this_cell = cell_getthiscell ();
- int32_t this_cell_id;
-
- if (dynroot_enablep()) {
- this_cell = "dynroot";
- this_cell_id = dynroot_cellid();
- } else {
- this_cell_id = cell_name2num (this_cell);
- if (this_cell_id == -1)
- arla_errx (1, ADEBERROR, "cell %s does not exist", this_cell);
- }
-
- ret = volcache_getbyname (root_volume, this_cell_id, ce, &ve, NULL);
- if (ret) {
- arla_warn (ADEBWARN, ret,
- "Cannot find the root volume (%s) in cell %s",
- root_volume, this_cell);
- return ret;
- }
-
- fid.Cell = this_cell_id;
- if (ve->entry.flags & VLF_ROEXISTS) {
- fid.fid.Volume = ve->entry.volumeId[ROVOL];
- } else if (ve->entry.flags & VLF_RWEXISTS) {
- arla_warnx(ADEBERROR,
- "getroot: %s in cell %s is missing a RO clone, not good",
- root_volume, this_cell);
- fid.fid.Volume = ve->entry.volumeId[RWVOL];
- } else {
- arla_errx(1, ADEBERROR,
- "getroot: %s in cell %s has no RW or RO clone?",
- root_volume, this_cell);
- }
- fid.fid.Vnode = fid.fid.Unique = 1;
-
- volcache_free (ve);
-
- *res = fid;
- return 0;
-}
-
-/*
- * Return the type for this volume.
- */
-
-static long
-gettype (int32_t volid, const VolCacheEntry *ve)
-{
- int i;
-
- for (i = RWVOL; i <= BACKVOL; ++i)
- if (ve->entry.volumeId[i] == volid)
- return i;
- assert (FALSE);
- return -1; /* NOT REACHED */
-}
-
-/*
- * Return the entry for `fid' or NULL.
- */
-
-int
-fcache_find (FCacheEntry **res, VenusFid fid)
-{
- *res = find_entry (fid);
- if (*res != NULL)
- return 0;
- else
- return -1;
-}
-
-/*
- * Return the entry for `fid'. If it's not cached, add it.
- */
-
-int
-fcache_get (FCacheEntry **res, VenusFid fid, CredCacheEntry *ce)
-{
- FCacheEntry *old;
- FCacheEntry *e;
- VolCacheEntry *vol;
- int i, error;
-
- *res = NULL;
-
- old = find_entry (fid);
- if (old) {
- assert (old->flags.usedp);
- *res = old;
- return 0;
- }
-
- error = volcache_getbyid (fid.fid.Volume, fid.Cell, ce, &vol, NULL);
- if (error) {
- if (connected_mode == DISCONNECTED && error == ENOENT)
- return ENETDOWN;
- return error;
- }
-
- e = find_free_entry ();
- if (e == NULL) {
- arla_warnx(ADEBMISC, "find_free_entry failed");
- return(-1);
- }
-
- old = find_entry (fid);
- if (old) {
- AssertExclLocked(&e->lock);
- ReleaseWriteLock (&e->lock);
-
- e->lru_le = listaddtail (lrulist, e);
- if (e->lru_le == NULL)
- exit(-1);
-
- if (!old->flags.usedp)
- exit(-1);
- *res = old;
- return 0;
- }
-
- e->fid = fid;
- e->refcount = 0;
- e->host = 0;
- e->length = 0;
- e->wanted_length = 0;
- e->fetched_length = 0;
- memset (&e->status, 0, sizeof(e->status));
- memset (&e->callback, 0, sizeof(e->callback));
- memset (&e->volsync, 0, sizeof(e->volsync));
- for (i = 0; i < NACCESS; i++) {
- e->acccache[i].cred = ARLA_NO_AUTH_CRED;
- e->acccache[i].access = 0;
- }
- e->anonaccess = 0;
- e->flags.usedp = TRUE;
- e->flags.attrp = FALSE;
- e->flags.attrusedp = FALSE;
- e->flags.datausedp = FALSE;
- e->flags.extradirp = FALSE;
- e->flags.mountp = FALSE;
- e->flags.fake_mp = FALSE;
- e->flags.vol_root = FALSE;
- e->flags.kernelp = FALSE;
- e->flags.sentenced = FALSE;
- e->flags.silly = FALSE;
- e->tokens = 0;
- memset (&e->parent, 0, sizeof(e->parent));
- e->lru_le = listaddhead (lrulist, e);
- if(!e->lru_le)
- exit(-1);
- e->invalid_ptr = -1;
- e->volume = vol;
- e->priority = fprio_get(fid);
- e->hits = 0;
- e->cleanergen = 0;
-
- hashtabadd (hashtab, e);
-
- *res = e;
- return 0;
-}
-
-/*
- * Release the lock on `e' and mark it as stale if it has been sentenced.
- */
-
-void
-fcache_release (FCacheEntry *e)
-{
- AssertExclLocked(&e->lock);
-
- ReleaseWriteLock (&e->lock);
-
- if (e->flags.sentenced) {
- AFSCallBack broken_callback = {0, 0, CBDROPPED};
-
- stale (e, broken_callback);
- e->flags.sentenced = FALSE;
- }
-}
-
-/*
- *
- */
-
-static Bool
-uptodatep (FCacheEntry *e)
-{
- struct timeval tv;
- assert (e->flags.usedp);
-
- if (connected_mode != CONNECTED &&
- connected_mode != FETCH_ONLY)
- return TRUE;
-
- gettimeofday(&tv, NULL);
-
- if (tv.tv_sec < e->callback.ExpirationTime &&
- e->callback.CallBackType != CBDROPPED &&
- (e->callback.CallBackType != 0
- || e->volume->volsync.spare1 != e->volsync.spare1))
- return TRUE;
-
- return FALSE;
-}
-
-/*
- * The idea is that we start to stat everything after the prefered
- * entry, everything before that is probably not useful to get, the
- * user is probably trying to stat() everything _after_ that node.
- * This might be somewhat bogus, but we dont care (for now).
- */
-
-struct bulkstat {
- int len; /* used entries in fids and names */
- AFSFid fids[AFSCBMAX]; /* fids to fetch */
- char *names[AFSCBMAX]; /* names it install */
- AFSFid *used; /* do we have a prefered node */
- CredCacheEntry *ce; /* cred to use */
-};
-
-typedef union {
- struct nnpfs_message_installnode node;
- struct nnpfs_message_installattr attr;
-} nnpfs_message_install_node_attr;
-
-static int
-bulkstat_help_func (VenusFid *fid, const char *name, void *ptr)
-{
- struct bulkstat *bs = (struct bulkstat *) ptr;
- AccessEntry *ae;
- FCacheEntry key;
- FCacheEntry *e;
-
- /* Is bs full ? */
- if (bs->len > fcache_bulkstatus_num)
- return 0;
-
- /* Ignore . and .. */
- if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0)
- return 0;
-
- /*
- * Do we have a prefered node, and is this the one. If we don't know
- * the name of the node (ie bs.names[0] == NULL), fill it in.
- * Set bs->used to NULL it indicate that we should start stat stuff
- * from here, remeber that bs->len == 1 if bs->used is set.
- */
- if (bs->used) {
- if (memcmp(bs->used, &fid->fid, sizeof(fid->fid)) == 0) {
- if (bs->names[0] == NULL)
- bs->names[0] = strdup (name);
- bs->used = NULL; /* stat everything after this */
- }
- return 0;
- }
-
- /*
- * Already cached for this pag ?
- */
- key.fid = *fid;
- e = (FCacheEntry *)hashtabsearch (hashtab, (void *)&key);
- if (e
- && e->flags.usedp
- && e->flags.attrp
- && uptodatep (e)
- && findaccess (bs->ce->cred, e->acccache, &ae) == TRUE) {
- arla_warnx (ADEBFCACHE,
- "bulkstat_help_func: already cached "
- "(%d.%d.%d.%d) name: %s",
- fid->Cell, fid->fid.Volume, fid->fid.Vnode,
- fid->fid.Unique, name);
- return 0;
- }
-
- if (fcache_enable_bulkstatus == 2) {
- /* cache the name for the installnode */
- bs->names[bs->len] = strdup (name);
- if (bs->names[bs->len] == NULL)
- return 0;
- } else {
- bs->names[bs->len] = NULL;
- }
-
-
- bs->fids[bs->len] = fid->fid;
- bs->len++;
-
- return 0;
-}
-
-/*
- * Do bulkstat for ``parent_entry''. Make sure that ``prefered_entry''
- * is in the list of fids it not NULL, and it ``prefered_name'' is NULL
- * try to find it in the list files in the directory.
- *
- * Entry Success Failure
- * parent_entry locked locked locked
- * prefered_entry locked locked locked
- * or if NULL if set to NULL must not be locked
- * prefered_fid related fcache-entry must not be locked
- * ce not NULL
- */
-
-static int
-get_attr_bulk (FCacheEntry *parent_entry,
- FCacheEntry *prefered_entry,
- VenusFid *prefered_fid,
- const char *prefered_name,
- CredCacheEntry *ce)
-{
- fs_server_context context;
- ConnCacheEntry *conn = NULL;
- struct bulkstat bs;
- AFSBulkStats stats;
- AFSVolSync sync;
- AFSCBFids fids;
- fbuf the_fbuf;
- int ret, fd;
- AFSCBs cbs;
- int i;
- int len;
- struct collect_stat collectstat;
-
- arla_warnx (ADEBFCACHE, "get_attr_bulk");
-
- if (fcache_enable_bulkstatus == 0)
- return -1;
-
- if (parent_entry->length == 0) {
- arla_warnx (ADEBFCACHE, "get_attr_bulk: parent doesn't have data");
- return -1;
- }
-
- fids.val = bs.fids;
-
- memset (bs.names, 0, sizeof(bs.names));
- memset (bs.fids, 0, sizeof(bs.fids));
- bs.len = 0;
- bs.ce = ce;
- bs.used = NULL;
-
- /*
- * If we have a prefered_entry, and that to the first entry in the
- * array. This is used later. If we find the prefered_entry in the
- * directory-structure its ignored.
- */
-
- if (prefered_fid) {
- arla_warnx (ADEBFCACHE, "get_attr_bulk: using prefered_entry");
- bs.used = &prefered_fid->fid;
- fids.val[bs.len] = prefered_fid->fid;
- if (prefered_name != NULL) {
- bs.names[bs.len] = strdup(prefered_name);
- if (bs.names[bs.len] == NULL)
- return ENOMEM;
- } else {
- bs.names[bs.len] = NULL;
- }
- bs.len++;
- }
-
- ret = fcache_get_fbuf (parent_entry, &fd, &the_fbuf,
- O_RDONLY, FBUF_READ|FBUF_SHARED);
- if (ret)
- return ret;
-
- ret = fdir_readdir (&the_fbuf,
- bulkstat_help_func,
- &bs,
- parent_entry->fid,
- NULL);
- fbuf_end (&the_fbuf);
- close (fd);
- if (ret)
- goto out_names;
-
- fids.len = bs.len;
-
- /*
- * Don't do BulkStatus when fids.len == 0 since we should never do it.
- * There should at least be the node that we want in the BulkStatus.
- */
-
- if (fids.len == 0) {
- if (prefered_fid)
- arla_warnx (ADEBERROR,
- "get_attr_bulk: "
- "prefered_fid not found in dir");
- /* XXX MAGIC send it back so we don't do it again soon */
- parent_entry->hits -= 64;
- ret = EINVAL;
- goto out_names;
- }
-
- /*
- * XXX if there is a prefered fid, and and we didn't find the name for it
- * return an error.
- */
-
- if (prefered_fid && bs.names[0] == NULL) {
- arla_warnx (ADEBFCACHE,
- "get_attr_bulk: didn't find prefered_fid's name");
- ret = EINVAL;
- goto out_names;
- }
-
- ret = ARLA_CALL_DEAD;
-
- ret = init_fs_context(parent_entry, ce, &context);
- if (ret)
- return ret;
-
- for (conn = find_first_fs (&context);
- conn != NULL;
- conn = find_next_fs (&context, conn, ret)) {
-
- stats.val = NULL;
- cbs.val = NULL;
- stats.len = cbs.len = 0;
-
- collectstats_start(&collectstat);
- ret = RXAFS_BulkStatus (conn->connection, &fids, &stats, &cbs, &sync);
- collectstats_stop(&collectstat, parent_entry, conn,
- find_partition(&context),
- STATISTICS_REQTYPE_BULKSTATUS, fids.len);
- if (ret) {
- free (stats.val);
- free (cbs.val);
- }
-
- if (host_downp(ret)) {
- continue;
- } else if (ret) {
- free_fs_server_context(&context);
- arla_warn(ADEBFCACHE, ret, "BulkStatus");
- conn = NULL;
- goto out_names;
- }
- conn_ref(conn);
- break;
- }
-
- free_fs_server_context (&context);
-
- if (ret) {
- ret = ENETDOWN;
- goto out_names;
- }
-
- arla_warnx (ADEBFCACHE,"get_attr_bulk: BulkStatus returned %d",ret);
-
- len = min(fids.len, min(stats.len, cbs.len));
-
- /*
- * Save results of bulkstatus
- */
-
- if (ret == 0) {
- FCacheEntry *e;
- VenusFid fid;
-
- fcache_counter.fetch_attr_bulk += len;
-
- fid.Cell = parent_entry->fid.Cell;
- for (i = 0; i < len && ret == 0; i++) {
-
- fid.fid = fids.val[i];
-
- if (VenusFid_cmp(prefered_fid, &fid) == 0) {
- e = prefered_entry;
- } else {
- e = find_entry_nolock (fid);
- if (e != NULL && CheckLock(&e->lock) != 0)
- continue;
-
- ret = fcache_get (&e, fid, ce);
- if (ret)
- break;
- }
- update_attr_entry (e,
- &stats.val[i],
- &cbs.val[i],
- &sync,
- conn,
- ce->cred);
- e->parent = parent_entry->fid;
- if (prefered_entry != e) {
- fcache_release(e);
- }
- }
- }
-
- /*
- * Insert result into kernel
- */
-
- if (fcache_enable_bulkstatus == 2 && ret == 0) {
- nnpfs_message_install_node_attr msg[AFSCBMAX];
- struct nnpfs_msg_node *node;
- nnpfs_handle *parent;
- FCacheEntry *e;
- VenusFid fid;
- int j;
-
- fid.Cell = parent_entry->fid.Cell;
- for (i = 0 , j = 0; i < len && ret == 0; i++) {
- u_int tokens;
-
- fid.fid = fids.val[i];
-
- if (VenusFid_cmp(prefered_fid, &fid) == 0) {
- e = prefered_entry;
- } else {
- e = find_entry_nolock (fid);
- if (e != NULL && CheckLock(&e->lock) != 0)
- continue;
-
- ret = fcache_get (&e, fid, ce);
- if (ret)
- break;
- }
-
-
- arla_warnx (ADEBFCACHE, "installing %d.%d.%d\n",
- e->fid.fid.Volume,
- e->fid.fid.Vnode,
- e->fid.fid.Unique);
- assert_flag(e,kernelp);
- e->flags.attrusedp = TRUE;
-
- /*
- * Its its already installed, just update with installattr
- */
-
- e->tokens |= NNPFS_ATTR_R;
- tokens = e->tokens;
- if (!e->flags.kernelp || !e->flags.datausedp)
- tokens &= ~NNPFS_DATA_MASK;
-
- if (e->flags.kernelp) {
- msg[j].attr.header.opcode = NNPFS_MSG_INSTALLATTR;
- node = &msg[j].attr.node;
- parent = NULL;
- } else {
- msg[j].node.header.opcode = NNPFS_MSG_INSTALLNODE;
- node = &msg[j].node.node;
- parent = &msg[j].node.parent_handle;
- e->flags.kernelp = TRUE;
- strlcpy (msg[j].node.name, bs.names[i],
- sizeof(msg[j].node.name));
- }
- node->tokens = tokens;
-
- /*
- * Don't install symlink since they might be
- * mount-points.
- */
-
- if (e->status.FileType != TYPE_LINK) {
- fcacheentry2nnpfsnode (&e->fid,
- &e->fid,
- &stats.val[i],
- node,
- parent_entry->acccache,
- FCACHE2NNPFSNODE_ALL);
-
- if (parent)
- *parent = *(struct nnpfs_handle*) &parent_entry->fid;
- j++;
- }
- if (prefered_entry != e)
- fcache_release(e);
- }
-
- /*
- * Install if there is no error and we have something to install
- */
-
- if (ret == 0 && j != 0)
- ret = nnpfs_send_message_multiple_list (kernel_fd,
- (struct nnpfs_message_header *) msg,
- sizeof (msg[0]),
- j);
- /* We have what we wanted, ignore errors */
- if (ret && i > 0 && prefered_entry)
- ret = 0;
- }
-
- free (stats.val);
- free (cbs.val);
-
- out_names:
- for (i = 0 ; i < bs.len && ret == 0; i++)
- free (bs.names[i]);
-
- if (conn)
- conn_free(conn);
-
- arla_warnx (ADEBFCACHE, "get_attr_bulk: returned %d", ret);
-
- return ret;
-}
-
-
-/*
- * fetch attributes for the note `entry' with the rights `ce'. If
- * `parent_entry' is no NULL, its used for doing bulkstatus when guess
- * necessary. If there is a named associated with `entry' it should be
- * filled into `prefered_name' as that will be used for guessing that
- * nodes should be bulkstat:ed.
- *
- * If there is no bulkstatus done, a plain FetchStatus is done.
- */
-
-int
-fcache_verify_attr (FCacheEntry *entry, FCacheEntry *parent,
- const char *prefered_name, CredCacheEntry* ce)
-{
- AccessEntry *ae;
-
- if (dynroot_is_dynrootp (entry))
- return dynroot_get_attr (entry, ce);
-
- if (entry->flags.usedp
- && entry->flags.attrp
- && uptodatep(entry)
- && findaccess (ce->cred, entry->acccache, &ae) == TRUE)
- {
- arla_warnx (ADEBFCACHE, "fcache_get_attr: have attr");
- fcache_counter.fetch_attr_cached++;
- return 0;
- }
-
- /*
- * XXX is this right ?
- * Dont ask fileserver if this file is deleted
- */
- if (entry->flags.silly) {
- entry->tokens |= NNPFS_ATTR_R;
- entry->flags.attrp = TRUE;
- return 0;
- }
-
- if (connected_mode == DISCONNECTED) {
- if (entry->flags.attrp) {
- AccessEntry *ae;
- findaccess(ce->cred, entry->acccache, &ae);
- ae->cred = ce->cred;
- ae->access = 0x7f; /* XXXDISCO */
- return 0;
- }
- else
- return ENETDOWN;
- }
-
- /*
- * If there is no parent, `entry' is a root-node, or the parent is
- * un-initialized, don't bother bulkstatus.
- */
- if (parent != NULL
- && entry->fid.fid.Vnode != 1
- && entry->fid.fid.Unique != 1
- && !entry->flags.mountp
- && !entry->flags.fake_mp
- && entry->parent.Cell != 0
- && entry->parent.fid.Volume != 0
- && entry->parent.fid.Vnode != 0
- && entry->parent.fid.Unique != 0)
- {
- /*
- * Check if the entry is used, that means that
- * there is greater chance that we we'll succeed
- * when doing bulkstatus.
- */
-
- if (parent->hits++ > fcache_bulkstatus_num &&
- parent->flags.datausedp) {
- int error;
-
- arla_warnx (ADEBFCACHE, "fcache_get_attr: doing bulk get_attr");
-
- error = get_attr_bulk (parent,
- entry, &entry->fid,
- prefered_name, ce);
- /* magic calculation when we are going to do next bulkstat */
- parent->hits = 0;
-
- if (error == 0)
- return 0;
- }
- }
-
- /*
- * We got here because the bulkstatus failed, didn't want to do a
- * bulkstatus or we didn't get a parent for the entry
- */
-
- arla_warnx (ADEBFCACHE, "fcache_get_attr: doing read_attr");
-
- return read_attr (entry, ce);
-}
-
-
-
-/*
- * Make sure that `e' has attributes and that they are up-to-date.
- * `e' must be write-locked.
- */
-
-
-static int
-do_read_data (FCacheEntry *e, CredCacheEntry *ce)
-{
- int ret = ARLA_CALL_DEAD;
- fs_server_context context;
- ConnCacheEntry *conn;
-
- if (connected_mode != CONNECTED)
- return ENETDOWN;
-
- ret = init_fs_context(e, ce, &context);
- if (ret)
- return ret;
-
- for (conn = find_first_fs (&context);
- conn != NULL;
- conn = find_next_fs (&context, conn, ret)) {
- ret = read_data (e, conn, ce, find_partition(&context));
- if (!try_next_fs (ret, &e->fid))
- break;
- }
- free_fs_server_context (&context);
-
- if (host_downp(ret))
- ret = ENETDOWN;
- return ret;
-}
-
-/*
- * Make sure that `e' has file data and is up-to-date.
- */
-
-int
-fcache_verify_data (FCacheEntry *e, CredCacheEntry *ce)
-{
- ConnCacheEntry *conn = NULL;
- int ret;
- fs_server_context context;
-
- assert (e->flags.usedp);
- AssertExclLocked(&e->lock);
-
- if (dynroot_is_dynrootp (e))
- return dynroot_get_data (e, ce);
-
- /* Don't get data for deleted files */
- if (e->flags.silly)
- return 0;
-
- if (e->flags.attrp && uptodatep(e)) {
- if (e->wanted_length <= e->fetched_length) {
- fcache_counter.fetch_data_cached++;
- return 0;
- } else
- return do_read_data (e, ce);
- } else {
- ret = do_read_attr (e, ce, &conn, &context);
- if (ret)
- return ret;
- if (e->wanted_length <= e->fetched_length) {
- fcache_counter.fetch_data_cached++;
- free_fs_server_context (&context);
- return 0;
- }
- }
- ret = read_data (e, conn, ce, find_partition(&context));
- free_fs_server_context (&context);
- return ret;
-}
-
-/*
- * Fetch `fid' with data, returning the cache entry in `res'.
- * note that `fid' might change.
- */
-
-int
-fcache_get_data (FCacheEntry **e, CredCacheEntry **ce,
- size_t wanted_length)
-{
- int ret;
-
- if ((*e)->flags.fake_mp) {
- VenusFid new_fid;
- FCacheEntry *new_root;
-
- ret = resolve_mp (e, &new_fid, ce);
- if (ret) {
- return ret;
- }
- ret = fcache_get (&new_root, new_fid, *ce);
- if (ret) {
- return ret;
- }
- ret = fcache_verify_attr (new_root, NULL, NULL, *ce);
- if (ret) {
- fcache_release (new_root);
- return ret;
- }
- (*e)->flags.fake_mp = FALSE;
- (*e)->flags.mountp = TRUE;
- (*e)->status.FileType = TYPE_LINK;
- update_fid ((*e)->fid, *e, new_fid, new_root);
- fcache_release (*e);
- *e = new_root;
- install_attr (*e, FCACHE2NNPFSNODE_ALL);
- }
-
- if (wanted_length) {
- (*e)->wanted_length = wanted_length;
- } else {
- /*
- * XXX remove this case, attr should either be known already
- * here, or we should just fetch `whole file'/next block.
- */
-
- ret = fcache_verify_attr (*e, NULL, NULL, *ce);
- if (ret) {
- return ret;
- }
- if ((*e)->length == 0 || !uptodatep(*e)) {
- (*e)->wanted_length = (*e)->status.Length;
- }
- }
-
- ret = fcache_verify_data (*e, *ce);
- return ret;
-}
-
-/*
- * Helper function for followmountpoint.
- * Given the contents of a mount-point, figure out the cell and volume name.
- *
- * ``mp'' must be writeable and should not be used afterwards.
- * ``*volname'' is a pointer to somewhere in the mp string.
- * ``cell'' should be set before function is called to default cell.
- */
-
-static int
-parse_mountpoint (char *mp, size_t len, int32_t *cell, char **volname)
-{
- char *colon;
-
- mp[len - 1] = '\0';
- colon = strchr (mp, ':');
- if (colon != NULL) {
- *colon++ = '\0';
- *cell = cell_name2num (mp + 1);
- if (*cell == -1)
- return ENOENT;
- *volname = colon;
- } else {
- *volname = mp + 1;
- }
- return 0;
-}
-
-/*
- * Used by followmountpoint to figure out what clone of a volume
- * should be used.
- *
- * Given a `volname', `cell', it uses the given `ce', `mount_symbol'
- * and `parent_type' to return a volume id in `volume'.
- *
- * The rules are:
- *
- * "readonly" -> RO
- * BK + "backup" -> fail
- * "backup" -> BK
- * BK + "" + # -> RO
- * RO + "" + # -> RO
- * * -> RW
- *
- * this_type = "" | "readonly" | "backup"
- * parent_type = RW | RO | BK
- * mount_symbol = "#" | "%"
- */
-
-static int
-find_volume (const char *volname, int32_t cell,
- CredCacheEntry *ce, char mount_symbol, int parent_type,
- uint32_t *volid, VolCacheEntry **ve)
-{
- int result_type;
- int this_type;
- int res;
-
- res = volcache_getbyname (volname, cell, ce, ve, &this_type);
- if (res)
- return res;
-
- assert (this_type == RWVOL ||
- this_type == ROVOL ||
- this_type == BACKVOL);
-
- if (this_type == ROVOL) {
- if (!((*ve)->entry.flags & VLF_ROEXISTS)) {
- volcache_free (*ve);
- return ENOENT;
- }
- result_type = ROVOL;
- } else if (this_type == BACKVOL && parent_type == BACKVOL) {
- volcache_free (*ve);
- return ENOENT;
- } else if (this_type == BACKVOL) {
- if (!((*ve)->entry.flags & VLF_BOEXISTS)) {
- volcache_free (*ve);
- return ENOENT;
- }
- result_type = BACKVOL;
- } else if (this_type == RWVOL &&
- parent_type != RWVOL &&
- mount_symbol == '#') {
- if ((*ve)->entry.flags & VLF_ROEXISTS)
- result_type = ROVOL;
- else if ((*ve)->entry.flags & VLF_RWEXISTS)
- result_type = RWVOL;
- else {
- volcache_free (*ve);
- return ENOENT;
- }
- } else {
- if ((*ve)->entry.flags & VLF_RWEXISTS)
- result_type = RWVOL;
- else if ((*ve)->entry.flags & VLF_ROEXISTS)
- result_type = ROVOL;
- else {
- volcache_free (*ve);
- return ENOENT;
- }
- }
- *volid = (*ve)->entry.volumeId[result_type];
- return 0;
-}
-
-/*
- * Set `fid' to point to the root of the volume pointed to by the
- * mount-point in (buf, len).
- *
- * If succesful, `fid' will be update to the root of the volume, and
- * `ce' will point to a cred in the new cell.
- */
-
-static int
-get_root_of_volume (VenusFid *fid, const VenusFid *parent,
- VolCacheEntry *volume,
- CredCacheEntry **ce,
- char *buf, size_t len)
-{
- VenusFid oldfid = *fid;
- char *volname;
- int32_t cell;
- uint32_t volid;
- int res;
- long parent_type;
- char mount_symbol;
- VolCacheEntry *ve;
- FCacheEntry *e;
-
- cell = fid->Cell;
-
- res = parse_mountpoint (buf, len, &cell, &volname);
- if (res)
- return res;
-
- /*
- * If this is a cross-cell mountpoint we need new credentials.
- */
-
- if ((*ce)->cell != cell) {
- CredCacheEntry *new_ce;
-
- new_ce = cred_get(cell, (*ce)->cred, CRED_ANY);
- if (new_ce == NULL)
- return ENOMEM;
- cred_free (*ce);
- *ce = new_ce;
- }
-
- parent_type = gettype (fid->fid.Volume, volume);
- mount_symbol = *buf;
-
- res = find_volume (volname, cell, *ce, mount_symbol,
- parent_type, &volid, &ve);
- if (res)
- return res;
-
- /*
- * Create the new fid. The root of a volume always has
- * (Vnode, Unique) = (1,1)
- */
-
- fid->Cell = cell;
- fid->fid.Volume = volid;
- fid->fid.Vnode = fid->fid.Unique = 1;
-
- /*
- * Check if we are looking up ourself, if we are, just return.
- */
-
- if (VenusFid_cmp(fid, parent) == 0) {
- volcache_free (ve);
- return 0;
- }
-
- res = fcache_get (&e, *fid, *ce);
- if (res) {
- volcache_free (ve);
- return res;
- }
-
- /*
- * Root nodes are a little bit special. We keep track of
- * their parent in `parent' so that `..' can be handled
- * properly.
- */
-
- e->flags.vol_root = TRUE;
- e->parent = *parent;
- if (ve->parent == NULL) {
- ve->parent_fid = *parent;
- ve->mp_fid = oldfid;
- }
- volcache_volref (ve, volume);
- fcache_release (e);
- volcache_free (ve);
- return 0;
-}
-
-/*
- * If this entry is a mount point, set the fid data to
- * the root directory of the volume it's pointing at,
- * otherwise just leave it.
- *
- * Mount points are symbol links with the following contents:
- *
- * '#' | '%' [ cell ':' ] volume-name [ '.' ]
- *
- * This function tries to the minimal amount of work. It always has
- * to fetch the attributes of `fid' and if it's a symbolic link, the
- * contents as well.
- */
-
-int
-followmountpoint (VenusFid *fid, const VenusFid *parent, FCacheEntry *parent_e,
- CredCacheEntry **ce)
-{
- FCacheEntry *e;
- int ret;
-
- /*
- * Get the node for `fid' and verify that it's a symbolic link
- * with the correct bits. Otherwise, just return the old
- * `fid' without any change.
- */
-
- ret = fcache_get (&e, *fid, *ce);
- if (ret)
- return ret;
-
- e->parent = *parent;
- ret = fcache_verify_attr (e, parent_e, NULL, *ce);
- if (ret) {
- fcache_release(e);
- return ret;
- }
-
- if (e->flags.mountp)
- ret = resolve_mp (&e, fid, ce);
-
- fcache_release(e);
- return ret;
-}
-
-/*
- * actually resolve a mount-point
- */
-
-static int
-resolve_mp (FCacheEntry **e, VenusFid *ret_fid, CredCacheEntry **ce)
-{
- VenusFid fid = (*e)->fid;
- int ret;
- fbuf the_fbuf;
- char *buf;
- int fd;
- uint32_t length;
-
- assert ((*e)->flags.fake_mp || (*e)->flags.mountp);
- AssertExclLocked(&(*e)->lock);
-
- (*e)->wanted_length = (*e)->status.Length;
-
- ret = fcache_verify_data (*e, *ce);
- if (ret)
- return ret;
-
- length = (*e)->status.Length;
-
- fd = fcache_open_file (*e, O_RDONLY);
- if (fd < 0)
- return errno;
-
- ret = fbuf_create (&the_fbuf, fd, length,
- FBUF_READ|FBUF_WRITE|FBUF_PRIVATE);
- if (ret) {
- close (fd);
- return ret;
- }
- buf = fbuf_buf (&the_fbuf);
-
- ret = get_root_of_volume (&fid, &(*e)->parent, (*e)->volume,
- ce, buf, length);
-
- fbuf_end (&the_fbuf);
- close (fd);
- if (ret)
- return ret;
- *ret_fid = fid;
- return 0;
-}
-
-/*
- *
- */
-
-static Bool
-print_entry (void *ptr, void *arg)
-{
- FCacheEntry *e = (FCacheEntry *)ptr;
-
- arla_log(ADEBVLOG, "(%d, %u, %u, %u)%s%s%s%s%s%s%s%s%s%s%s length: %ld",
- e->fid.Cell,
- e->fid.fid.Volume, e->fid.fid.Vnode, e->fid.fid.Unique,
- e->flags.usedp?" used":"",
- e->flags.attrp?" attr":"",
- e->length != 0 ?" data":"",
- e->flags.attrusedp?" attrused":"",
- e->flags.datausedp?" dataused":"",
- e->flags.extradirp?" extradir":"",
- e->flags.mountp?" mount":"",
- e->flags.kernelp?" kernel":"",
- e->flags.sentenced?" sentenced":"",
- e->flags.silly?" silly":"",
- e->flags.fake_mp ? " fake mp" : "",
- e->flags.vol_root ? " vol root" : "",
- e->status.Length);
- return FALSE;
-}
-
-
-/*
- *
- */
-
-void
-fcache_status (void)
-{
- arla_log(ADEBVLOG, "%lu (%lu-/%lu)-%lu) files"
- "%lu (%lu-%lu) bytes\n",
- usedvnodes, lowvnodes, current_vnodes, highvnodes,
- (long)usedbytes, (long)lowbytes, (long)highbytes);
- hashtabforeach (hashtab, print_entry, NULL);
-}
-
-/*
- *
- */
-
-void
-fcache_update_length (FCacheEntry *e, size_t len, size_t have_len)
-{
- AssertExclLocked(&e->lock);
-
- assert (len >= e->length || e->length - len <= usedbytes);
- assert (have_len <= len);
-
- usedbytes = usedbytes - e->length + len;
- e->length = len;
- e->wanted_length = min(have_len,len);
- e->fetched_length = have_len;
-}
-
-/*
- * Request an ACL and put it in opaque
- */
-
-int
-getacl(VenusFid fid,
- CredCacheEntry *ce,
- AFSOpaque *opaque)
-{
- FCacheEntry *dire;
- ConnCacheEntry *conn;
- AFSFetchStatus status;
- AFSVolSync volsync;
- int ret;
- fs_server_context context;
-
- opaque->val = NULL;
- opaque->len = 0;
-
- if (connected_mode != CONNECTED)
- return EINVAL;
-
- ret = fcache_get (&dire, fid, ce);
- if (ret) {
- arla_warn (ADEBFCACHE, ret, "fcache_get");
- return ret;
- }
-
- ret = init_fs_context(dire, ce, &context);
- if (ret)
- return ret;
-
- for (conn = find_first_fs (&context);
- conn != NULL;
- conn = find_next_fs (&context, conn, ret)) {
-
- ret = RXAFS_FetchACL (conn->connection, &fid.fid,
- opaque, &status, &volsync);
- if (ret) {
- free(opaque->val);
- opaque->val = NULL;
- opaque->len = 0;
- }
-
- if (!try_next_fs (ret, &fid))
- break;
- }
- if (ret)
- arla_warn (ADEBFCACHE, ret, "FetchACL");
-
- if (ret == 0)
- update_entry (dire, &status, NULL, &volsync,
- conn, ce->cred);
- else if (host_downp(ret))
- ret = ENETDOWN;
-
- free_fs_server_context (&context);
- fcache_release (dire);
- return ret;
-}
-
-/*
- * Store the ACL read from opaque
- *
- * If the function return 0, ret_e is set to the dir-entry and must
- * be fcache_released().
- */
-
-int
-setacl(VenusFid fid,
- CredCacheEntry *ce,
- AFSOpaque *opaque,
- FCacheEntry **ret_e)
-{
- FCacheEntry *dire;
- ConnCacheEntry *conn;
- AFSFetchStatus status;
- AFSVolSync volsync;
- int ret;
- fs_server_context context;
-
- if (connected_mode != CONNECTED)
- return EINVAL;
-
- ret = fcache_get (&dire, fid, ce);
- if (ret) {
- arla_warn (ADEBFCACHE, ret, "fcache_get");
- return EINVAL;
- }
-
- ret = init_fs_context(dire, ce, &context);
- if (ret)
- return ret;
-
- for (conn = find_first_fs (&context);
- conn != NULL;
- conn = find_next_fs (&context, conn, ret)) {
- ret = RXAFS_StoreACL (conn->connection, &fid.fid,
- opaque, &status, &volsync);
- if (!try_next_fs (ret, &fid))
- break;
- }
- if (ret)
- arla_warn (ADEBFCACHE, ret, "StoreACL");
-
- if (ret == 0)
- update_entry (dire, &status, NULL, &volsync,
- conn, ce->cred);
- else if (host_downp(ret))
- ret = ENETDOWN;
-
- free_fs_server_context (&context);
-
- if (ret == 0) {
- *ret_e = dire;
- } else {
- *ret_e = NULL;
- fcache_release (dire);
- }
- return ret;
-}
-
-/*
- * Request volume status
- */
-
-int
-getvolstat(VenusFid fid, CredCacheEntry *ce,
- AFSFetchVolumeStatus *volstat,
- char *volumename, size_t volumenamesz,
- char *offlinemsg,
- char *motd)
-{
- FCacheEntry *dire;
- ConnCacheEntry *conn;
- int ret;
- fs_server_context context;
-
- if (connected_mode != CONNECTED)
- return EINVAL;
-
- ret = fcache_get (&dire, fid, ce);
- if (ret) {
- arla_warn (ADEBFCACHE, ret, "fcache_get");
- return EINVAL;
- }
-
- ret = init_fs_context(dire, ce, &context);
- if (ret)
- return ret;
-
- for (conn = find_first_fs (&context);
- conn != NULL;
- conn = find_next_fs (&context, conn, ret)) {
- ret = RXAFS_GetVolumeStatus (conn->connection, fid.fid.Volume,
- volstat, volumename, offlinemsg,
- motd);
- if (!try_next_fs (ret, &fid))
- break;
- }
- if (ret)
- arla_warn (ADEBFCACHE, ret, "GetVolumeStatus");
- free_fs_server_context (&context);
- if (host_downp(ret))
- ret = ENETDOWN;
- if (ret == 0 && volumename[0] == '\0') {
- if (volcache_getname (fid.fid.Volume, fid.Cell,
- volumename, volumenamesz) == -1)
- strlcpy(volumename, "<unknown>", volumenamesz);
- }
-
- fcache_release (dire);
- return ret;
-}
-
-/*
- * Store volume status
- */
-
-int
-setvolstat(VenusFid fid, CredCacheEntry *ce,
- AFSStoreVolumeStatus *volstat,
- char *volumename,
- char *offlinemsg,
- char *motd)
-{
- FCacheEntry *dire;
- ConnCacheEntry *conn;
- int ret;
- fs_server_context context;
-
- if (connected_mode != CONNECTED)
- return EINVAL;
-
- ret = fcache_get (&dire, fid, ce);
- if (ret) {
- arla_warn (ADEBFCACHE, ret, "fcache_get");
- return EINVAL;
- }
-
- ret = init_fs_context(dire, ce, &context);
- if (ret)
- return ret;
-
- for (conn = find_first_fs (&context);
- conn != NULL;
- conn = find_next_fs (&context, conn, ret)) {
- ret = RXAFS_SetVolumeStatus (conn->connection, fid.fid.Volume,
- volstat, volumename, offlinemsg,
- motd);
- if (!try_next_fs (ret, &fid))
- break;
- }
- if (ret) {
- if (host_downp(ret))
- ret = ENETDOWN;
- arla_warn (ADEBFCACHE, ret, "SetVolumeStatus");
- }
- free_fs_server_context (&context);
-
- fcache_release (dire);
- return ret;
-}
-
-/*
- * Get `fbuf' from `centry' that is opened with openflags
- * `open_flags' and fbuf flags with `fbuf_flags'
- *
- * Assume that data is valid and `centry' is exclusive locked.
- */
-
-int
-fcache_get_fbuf (FCacheEntry *centry, int *fd, fbuf *fbuf,
- int open_flags, int fbuf_flags)
-{
- int ret;
- unsigned len;
- struct stat sb;
-
- AssertExclLocked(&centry->lock);
-
- *fd = fcache_open_file (centry, open_flags);
- if (*fd < 0)
- return errno;
-
- if (fstat (*fd, &sb)) {
- ret = errno;
- close (*fd);
- return ret;
- }
-
- len = sb.st_size;
-
- ret = fbuf_create (fbuf, *fd, len, fbuf_flags);
- if (ret) {
- close (*fd);
- return ret;
- }
- return 0;
-}
-
-/*
- *
- */
-
-static Bool
-sum_node (List *list, Listitem *li, void *arg)
-{
- int64_t *a = arg;
- FCacheEntry *e = listdata (li);
-
- *a += e->length;
-
- return FALSE;
-}
-
-
-int64_t
-fcache_calculate_usage (void)
-{
- int64_t size = 0;
-
- listiter (lrulist, sum_node, &size);
-
- return size;
-}
-
-/*
- *
- */
-
-const VenusFid *
-fcache_realfid (const FCacheEntry *entry)
-{
- if (entry->flags.vol_root
- || (entry->fid.fid.Vnode == 1 && entry->fid.fid.Unique == 1))
- return &entry->volume->mp_fid;
- else
- return &entry->fid;
-}
diff --git a/usr.sbin/afs/src/arlad/fcache.h b/usr.sbin/afs/src/arlad/fcache.h
deleted file mode 100644
index 35b5a2939e2..00000000000
--- a/usr.sbin/afs/src/arlad/fcache.h
+++ /dev/null
@@ -1,384 +0,0 @@
-/*
- * Copyright (c) 1995-2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * The interface for the file-cache.
- */
-
-/* $arla: fcache.h,v 1.97 2003/01/10 03:20:42 lha Exp $ */
-
-#ifndef _FCACHE_H_
-#define _FCACHE_H_
-
-#include <nnpfs/nnpfs_message.h>
-#include <fcntl.h>
-#include <cred.h>
-#include <heap.h>
-
-/*
- * For each entry in the filecache we save the rights of NACCESS users.
- * The value should be the same as MAXRIGHTS from nnpfs_message.h
- * If it isn't you can get some very strange behavior from nnpfs, so don't
- * even try. XXX
- */
-
-#define NACCESS MAXRIGHTS
-
-typedef struct {
- nnpfs_pag_t cred;
- u_long access;
-} AccessEntry;
-
-enum Access { ANONE = 0x0,
- AREAD = 0x01,
- AWRITE = 0x02,
- AINSERT = 0x04,
- ALIST = 0x08,
- ADELETE = 0x10,
- ALOCK = 0x20,
- AADMIN = 0x40 };
-
-typedef struct {
- Bool valid;
- nnpfs_cache_handle nnpfs_handle;
-} fcache_cache_handle;
-
-typedef struct {
- struct Lock lock; /* locking information for this entry */
- VenusFid fid; /* The fid of the file for this entry */
- unsigned refcount; /* reference count */
- uint32_t host; /* the source of this entry */
- size_t length; /* the cache usage size */
- size_t wanted_length; /* this much data should be fetched */
- size_t fetched_length; /* this much data has been fetched */
- AFSFetchStatus status; /* Removed unused stuff later */
- AFSCallBack callback; /* Callback to the AFS-server */
- AFSVolSync volsync; /* Sync info for ro-volumes */
- AccessEntry acccache[NACCESS]; /* cache for the access rights */
- uint32_t anonaccess; /* the access mask for system:anyuser */
- unsigned index; /* this is V%u */
- fcache_cache_handle handle; /* handle */
- struct {
- unsigned usedp : 1; /* Is this entry used? */
- unsigned attrp : 1; /* Are the attributes in status valid? */
- unsigned attrusedp : 1; /* Attr is used in the kernel */
- unsigned datausedp : 1; /* Data is used in the kernel */
- unsigned extradirp : 1; /* Has this directory been "converted"? */
- unsigned mountp : 1; /* Is this an AFS mount point? */
- unsigned kernelp : 1; /* Does this entry exist in the kernel? */
- unsigned sentenced : 1; /* This entry should die */
- unsigned silly : 1; /* Instead of silly-rename */
- unsigned fake_mp : 1; /* a `fake' mount point */
- unsigned vol_root : 1; /* root of a volume */
- } flags;
- u_int tokens; /* read/write tokens for the kernel */
- VenusFid parent;
- Listitem *lru_le; /* lru */
- heap_ptr invalid_ptr; /* pointer into the heap */
- VolCacheEntry *volume; /* pointer to the volume entry */
- Bool priority; /* is the file worth keeping */
- int hits; /* number of lookups */
- int cleanergen; /* generation cleaner */
- PollerEntry *poll; /* poller entry */
- uint32_t disco_id; /* id in disconncted log */
-} FCacheEntry;
-
-/*
- * The fileservers to ask for a particular volume.
- */
-
-struct fs_server_context {
- int i; /* current number being probed */
- int num_conns; /* number in `conns' */
- VolCacheEntry *ve; /* */
- struct fs_server_entry {
- ConnCacheEntry *conn; /* rx connection to server */
- int ve_ent; /* entry in `ve' */
- } conns[NMAXNSERVERS];
-};
-
-typedef struct fs_server_context fs_server_context;
-
-/*
- * How far the cleaner will go went cleaning things up.
- */
-
-extern Bool fprioritylevel;
-
-void
-fcache_init (u_long alowvnodes,
- u_long ahighvnodes,
- int64_t alowbytes,
- int64_t ahighbytes,
- Bool recover);
-
-int
-fcache_reinit(u_long alowvnodes,
- u_long ahighvnodes,
- int64_t alowbytes,
- int64_t ahighbytes);
-
-void
-fcache_purge_volume (VenusFid fid);
-
-void
-fcache_purge_host (u_long host);
-
-void
-fcache_purge_cred (nnpfs_pag_t cred, int32_t cell);
-
-void
-fcache_stale_entry (VenusFid fid, AFSCallBack callback);
-
-void
-fcache_invalidate_mp (void);
-
-int
-fcache_file_name (FCacheEntry *entry, char *s, size_t len);
-
-int
-fcache_conv_file_name (FCacheEntry *entry, char *s, size_t len);
-
-int
-fcache_dir_name (FCacheEntry *entry, char *s, size_t len);
-
-int
-fcache_extra_file_name (FCacheEntry *entry, char *s, size_t len);
-
-int
-fcache_open_file (FCacheEntry *entry, int flag);
-
-int
-fcache_open_extra_dir (FCacheEntry *entry, int flag, mode_t mode);
-
-int
-fcache_fhget (char *filename, fcache_cache_handle *handle);
-
-int
-write_data (FCacheEntry *entry, AFSStoreStatus *status, CredCacheEntry *ce);
-
-int
-truncate_file (FCacheEntry *entry, off_t size,
- AFSStoreStatus *status, CredCacheEntry *ce);
-
-int
-write_attr (FCacheEntry *entry, const AFSStoreStatus *status,
- CredCacheEntry *ce);
-
-int
-create_file (FCacheEntry *dir_entry,
- const char *name, AFSStoreStatus *store_attr,
- VenusFid *child_fid, AFSFetchStatus *fetch_attr,
- CredCacheEntry *ce);
-
-int
-create_directory (FCacheEntry *dir_entry,
- const char *name, AFSStoreStatus *store_attr,
- VenusFid *child_fid, AFSFetchStatus *fetch_attr,
- CredCacheEntry *ce);
-
-int
-create_symlink (FCacheEntry *dir_entry,
- const char *name, AFSStoreStatus *store_attr,
- VenusFid *child_fid, AFSFetchStatus *fetch_attr,
- const char *contents,
- CredCacheEntry *ce);
-
-int
-create_link (FCacheEntry *dir_entry,
- const char *name,
- FCacheEntry *existing_entry,
- CredCacheEntry *ce);
-
-int
-remove_file (FCacheEntry *dire, const char *name, CredCacheEntry *ce);
-
-int
-remove_directory (FCacheEntry *dire, const char *name, CredCacheEntry *ce);
-
-int
-rename_file (FCacheEntry *old_dir,
- const char *old_name,
- FCacheEntry *new_dir,
- const char *new_name,
- CredCacheEntry *ce);
-
-int
-getroot (VenusFid *res, CredCacheEntry *ce);
-
-int
-fcache_get (FCacheEntry **res, VenusFid fid, CredCacheEntry *ce);
-
-void
-fcache_release (FCacheEntry *e);
-
-int
-fcache_find (FCacheEntry **res, VenusFid fid);
-
-int
-fcache_get_data (FCacheEntry **e, CredCacheEntry **ce,
- size_t wanted_length);
-
-int
-fcache_verify_attr (FCacheEntry *entry, FCacheEntry *parent_entry,
- const char *prefered_name, CredCacheEntry* ce);
-
-int
-fcache_verify_data (FCacheEntry *e, CredCacheEntry *ce);
-
-int
-followmountpoint (VenusFid *fid, const VenusFid *parent, FCacheEntry *parent_e,
- CredCacheEntry **ce);
-
-void
-fcache_status (void);
-
-int
-fcache_store_state (void);
-
-int
-getacl(VenusFid fid, CredCacheEntry *ce,
- AFSOpaque *opaque);
-
-int
-setacl(VenusFid fid, CredCacheEntry *ce,
- AFSOpaque *opaque, FCacheEntry **ret);
-
-int
-getvolstat(VenusFid fid, CredCacheEntry *ce,
- AFSFetchVolumeStatus *volstat,
- char *volumename, size_t volumenamesz,
- char *offlinemsg,
- char *motd);
-
-int
-setvolstat(VenusFid fid, CredCacheEntry *ce,
- AFSStoreVolumeStatus *volstat,
- char *volumename,
- char *offlinemsg,
- char *motd);
-
-int64_t
-fcache_highbytes(void);
-
-int64_t
-fcache_usedbytes(void);
-
-int64_t
-fcache_lowbytes(void);
-
-u_long
-fcache_highvnodes(void);
-
-u_long
-fcache_usedvnodes(void);
-
-u_long
-fcache_lowvnodes(void);
-
-int
-fcache_need_bytes(u_long needed);
-
-Bool
-fcache_need_nodes (void);
-
-int
-fcache_giveup_all_callbacks (void);
-
-int
-fcache_reobtain_callbacks (struct nnpfs_cred *cred);
-
-/* XXX - this shouldn't be public, but getrights in inter.c needs it */
-int
-read_attr (FCacheEntry *, CredCacheEntry *);
-
-Bool
-findaccess (nnpfs_pag_t cred, AccessEntry *ae, AccessEntry **pos);
-
-void
-fcache_unused(FCacheEntry *entry);
-
-void
-fcache_update_length (FCacheEntry *entry, size_t len, size_t have_len);
-
-int
-init_fs_context (FCacheEntry *e,
- CredCacheEntry *ce,
- fs_server_context *context);
-
-ConnCacheEntry *
-find_first_fs (fs_server_context *context);
-
-ConnCacheEntry *
-find_next_fs (fs_server_context *context,
- ConnCacheEntry *prev_conn,
- int mark_as_dead);
-
-void
-free_fs_server_context (fs_server_context *context);
-
-void
-recon_hashtabadd(FCacheEntry *entry);
-
-void
-recon_hashtabdel(FCacheEntry *entry);
-
-int
-fcache_get_fbuf (FCacheEntry *centry, int *fd, fbuf *fbuf,
- int open_flags, int fbuf_flags);
-
-int64_t
-fcache_calculate_usage (void);
-
-const VenusFid *
-fcache_realfid (const FCacheEntry *entry);
-
-void
-fcache_mark_as_mountpoint (FCacheEntry *entry);
-
-const char *
-fcache_getdefsysname (void);
-
-int
-fcache_addsysname (const char *sysname);
-
-int
-fcache_removesysname (const char *sysname);
-
-int
-fcache_setdefsysname (const char *sysname);
-
-int
-fs_probe (struct rx_connection *conn);
-
-#endif /* _FCACHE_H_ */
diff --git a/usr.sbin/afs/src/arlad/fprio.c b/usr.sbin/afs/src/arlad/fprio.c
deleted file mode 100644
index 6531ff383ee..00000000000
--- a/usr.sbin/afs/src/arlad/fprio.c
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Manage the priority of the files
- */
-
-#include "arla_local.h"
-#include <kafs.h>
-RCSID("$arla: fprio.c,v 1.12 2002/10/02 00:54:21 lha Exp $");
-
-/* Hashtable of entries by name */
-static Hashtab *fpriohashtab;
-
-/*
- * fprio - hash help functions
- */
-
-static int
-fpriocmp (void *a, void *b)
-{
- struct fpriorityentry *n1 = (struct fpriorityentry *)a;
- struct fpriorityentry *n2 = (struct fpriorityentry *)b;
-
- return n1->fid.Cell != n2->fid.Cell ||
- n1->fid.fid.Volume != n2->fid.fid.Volume ||
- n1->fid.fid.Vnode != n2->fid.fid.Vnode ||
- n1->fid.fid.Unique != n2->fid.fid.Unique;
-}
-
-static unsigned
-fpriohash (void *a)
-{
- struct fpriorityentry *n = (struct fpriorityentry *)a;
-
- return n->fid.Cell ^ n->fid.fid.Volume ^
- n->fid.fid.Vnode ^ n->fid.fid.Unique;
-}
-
-/*
- * fprio_init
- *
- * Just create the hashtab. Leave the smartness to the user.
- */
-
-void
-fprio_init (char *file)
-{
- fpriohashtab = hashtabnew (FPRIOCACHE_SIZE, fpriocmp, fpriohash);
- if (fpriohashtab == NULL)
- arla_errx (1, ADEBERROR, "fprio_init: hashtabnew failed");
-
- if (file)
- fprio_readin(file);
-}
-
-/*
- * Cleanout unwanted enteries
- */
-
-static Bool
-cleanupfpriohash(void *ptr, void *arg)
-{
- struct fpriorityentry *n = (struct fpriorityentry *)ptr;
- struct fpriorityentry *a = (struct fpriorityentry *)arg;
-
- /* Clean out if
- *
- * NULL cleanout argument
- * cleanout argument is in the same Cell and
- * Volume == Vnode == 0 (ie, when whole cell), or
- * Volume == the victim entry's Volume
- * && Vnode == 0 (ie, whole volume), or
- * the Vnode and Unique also match (ie the file/direntry)
- *
- * This means that memset(&myarg, 0, sizeof(stuct fprioentry))
- * is probably not what you want. (Cleaning out the localcell's
- * all entries)
- */
-
- if (a == NULL ||
- (a->fid.Cell == n->fid.Cell &&
- ((a->fid.fid.Volume == 0 && a->fid.fid.Vnode ==0) ||
- (a->fid.fid.Volume == n->fid.fid.Volume &&
- (a->fid.fid.Vnode == 0 ||
- (a->fid.fid.Vnode == n->fid.fid.Vnode &&
- a->fid.fid.Unique == n->fid.fid.Unique)))))) {
-
- AFSCallBack broken_callback = {0, 0, CBDROPPED};
-
- fcache_stale_entry (n->fid, broken_callback);
- free(n);
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-int
-fprio_clear(void)
-{
- hashtabcleantab(fpriohashtab, cleanupfpriohash, NULL);
- return 0;
-}
-
-/*
- * zapp the `fid'
- */
-
-void
-fprio_remove(VenusFid fid)
-{
- struct fpriorityentry key;
-
- key.fid = fid;
- hashtabfree(fpriohashtab, &key);
- return;
-}
-
-/*
- * set a `fid' with `prio' to the hashtab
- */
-
-void
-fprio_set(VenusFid fid, Bool prio)
-{
- struct fpriorityentry *e;
- struct fpriorityentry key;
-
- key.fid = fid;
-
- e = hashtabsearch(fpriohashtab, &key);
- if (e) {
- e->priority = prio;
- return;
- }
-
- e = calloc(1, sizeof(*e));
- if (e == NULL) {
- arla_warn(ADEBFCACHE, 1, "fprio_set: Out of memory");
- return;
- }
- e->fid = fid;
- e->priority = prio;
-
- hashtabadd(fpriohashtab, e);
-}
-
-/*
- * Read in new data from the file
- */
-
-#define MAXFPRIOLINE 1024
-
-int
-fprio_readin(char *file)
-{
- FILE *f;
- char line[MAXFPRIOLINE];
- unsigned prio;
- char cell[MAXFPRIOLINE];
- int32_t cellnum;
- VenusFid fid;
- int lineno = 0 ;
-
- f = fopen(file, "r");
- if (f == NULL)
- return -1;
-
- while(fgets(line, sizeof(line), f) != NULL) {
- lineno++;
-
- line[strcspn(line, "\n")] = '\0';
-
- if (line[0] == '#')
- continue;
-
- if (sscanf(line, "%d:%s:%u:%u:%u", &prio,
- cell,
- &fid.fid.Volume,
- &fid.fid.Vnode,
- &fid.fid.Unique) != 5) {
- arla_warn(ADEBFCACHE, 1,
- "fprio_readin: %s:%d contain error(s)",
- file, lineno);
- continue;
- }
-
- cellnum = cell_name2num(cell);
- if (cellnum == -1) {
- arla_warn(ADEBFCACHE, 1,
- "fprio_readin: the cell %s does not exist", cell);
- continue;
- }
-
- fid.Cell = cellnum;
- fprio_set(fid, prio ? TRUE : FALSE);
- }
- fclose(f);
- return 0;
-}
-
-/*
- * Find the priority of a fid
- */
-
-Bool
-fprio_get(VenusFid fid)
-{
- struct fpriorityentry a;
- struct fpriorityentry *b;
-
- a.fid = fid;
-
- b = hashtabsearch(fpriohashtab, &a);
- if (b)
- return b->priority;
- return FALSE;
-}
-
-/*
- * Print the entry `ptr' to the FILE `arg'
- */
-
-static Bool
-fprio_print_entry (void *ptr, void *arg)
-{
- struct fpriorityentry *n = (struct fpriorityentry *)ptr;
- const char *cell = cell_num2name(n->fid.Cell);
- const char *comment;
-
- if (cell == NULL) /* If we cant find the cell comment it out */
- comment = "#";
- else
- comment = "";
-
- arla_log(ADEBVLOG, "%s%d:%s:%d:%d:%d",
- comment, n->priority == TRUE ? 1 : 0, cell?cell:"unknowncell",
- n->fid.fid.Volume, n->fid.fid.Vnode, n->fid.fid.Unique);
- return FALSE;
-}
-
-/*
- * Print the status of the fprio module in some strange format...
- */
-
-void
-fprio_status (void)
-{
- time_t the_time = time(NULL);
-
- arla_log(ADEBVLOG, "#fprio entries\n#\n# Date: %s\n#"
- "#Syntax: (# means comment)\n"
- "#priority:cell:volume:vnode:unique\n",
- ctime(&the_time));
- hashtabforeach (fpriohashtab, fprio_print_entry, NULL);
-}
-
-
-
diff --git a/usr.sbin/afs/src/arlad/fprio.h b/usr.sbin/afs/src/arlad/fprio.h
deleted file mode 100644
index 1be5dde884e..00000000000
--- a/usr.sbin/afs/src/arlad/fprio.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1998 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Our cache of volume information.
- */
-
-/* $arla: fprio.h,v 1.6 2000/10/02 22:31:48 lha Exp $ */
-
-#ifndef _FPRIO_
-#define _FPRIO_
-
-
-struct fpriorityentry {
- VenusFid fid; /* The VenusFid, not stored */
- unsigned priority; /* The assigned priority */
-} ;
-
-#define FPRIOCACHE_SIZE 2048
-#define MAXFPRIOLINE 1024
-
-void fprio_init (char *file);
-int fprio_clear(void);
-void fprio_remove(VenusFid fid);
-void fprio_set(VenusFid fid, Bool prio);
-int fprio_readin(char *file);
-Bool fprio_get(VenusFid fid);
-void fprio_status (void);
-
-#endif /* _FPRIO_ */
-
-
-
-
diff --git a/usr.sbin/afs/src/arlad/fs_errors.h b/usr.sbin/afs/src/arlad/fs_errors.h
deleted file mode 100644
index b7c07c3f9cb..00000000000
--- a/usr.sbin/afs/src/arlad/fs_errors.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: fs_errors.h,v 1.12 2003/03/06 00:39:29 lha Exp $ */
-
-#ifndef _FS_ERRORS_H_
-#define _FS_ERRORS_H_ 1
-
-#include <rx/rx.h>
-#include <uae.h>
-
-#if !defined(__GNUC__) && !defined(__attribute__)
-#define __attribute__(x)
-#endif
-
-#define VICE_SPECIAL_ERRORS 101
-
-#define VICE_SPECIAL_ERRORS_MIN 101
-#define VICE_SPECIAL_ERRORS_MAX 112
-
-#define VSALVAGE 101
-#define VNOVNODE 102
-#define VNOVOL 103
-#define VVOLEXISTS 104
-#define VNOSERVICE 105
-#define VOFFLINE 106
-#define VONLINE 107
-#define VDISKFULL 108
-#define VOVERQUOTA 109
-#define VBUSY 110
-#define VMOVED 111
-#define VIO 112
-
-#define VRESTARTING -100
-
-#define ARLA_SPECIAL_ERROR_ADD 4000
-#define ARLA_SPECIAL2_ERROR_ADD 4600
-#define ARLA_SPECIAL_RX_ERROR_ADD 4800 /* ->4899 */
-
-#define ARLA_VSALVAGE (ARLA_SPECIAL_ERROR_ADD+VSALVAGE)
-#define ARLA_VNOVNODE (ARLA_SPECIAL_ERROR_ADD+VNOVNODE)
-#define ARLA_VNOVOL (ARLA_SPECIAL_ERROR_ADD+VNOVOL)
-#define ARLA_VVOLEXISTS (ARLA_SPECIAL_ERROR_ADD+VVOLEXISTS)
-#define ARLA_VNOSERVICE (ARLA_SPECIAL_ERROR_ADD+VNOSERVICE)
-#define ARLA_VOFFLINE (ARLA_SPECIAL_ERROR_ADD+VOFFLINE)
-#define ARLA_VONLINE (ARLA_SPECIAL_ERROR_ADD+VONLINE)
-#define ARLA_VDISKFULL (ARLA_SPECIAL_ERROR_ADD+VDISKFULL)
-#define ARLA_VOVERQUOTA (ARLA_SPECIAL_ERROR_ADD+VOVERQUOTA)
-#define ARLA_VBUSY (ARLA_SPECIAL_ERROR_ADD+VBUSY)
-#define ARLA_VMOVED (ARLA_SPECIAL_ERROR_ADD+VMOVED)
-#define ARLA_VIO (ARLA_SPECIAL_ERROR_ADD+VIO)
-
-#define ARLA_VRESTARTING (ARLA_SPECIAL2_ERROR_ADD+VRESTARTING)
-
-#define ARLA_CALL_DEAD (ARLA_SPECIAL_RX_ERROR_ADD-RX_CALL_DEAD)
-#define ARLA_INVALID_OPERATION (ARLA_SPECIAL_RX_ERROR_ADD-RX_INVALID_OPERATION)
-#define ARLA_CALL_TIMEOUT (ARLA_SPECIAL_RX_ERROR_ADD-RX_CALL_TIMEOUT)
-#define ARLA_EOF (ARLA_SPECIAL_RX_ERROR_ADD-RX_EOF)
-#define ARLA_PROTOCOL_ERROR (ARLA_SPECIAL_RX_ERROR_ADD-RX_PROTOCOL_ERROR)
-#define ARLA_USER_ABORT (ARLA_SPECIAL_RX_ERROR_ADD-RX_USER_ABORT)
-#define ARLA_ADDRINUSE (ARLA_SPECIAL_RX_ERROR_ADD-RX_ADDRINUSE)
-#define ARLA_MSGSIZE (ARLA_SPECIAL_RX_ERROR_ADD-RX_MSGSIZE)
-
-static inline int __attribute__ ((unused))
-conv_to_arla_errno(int error)
-{
- if (error >= VICE_SPECIAL_ERRORS_MIN &&
- error <= VICE_SPECIAL_ERRORS_MAX)
- return error + ARLA_SPECIAL_ERROR_ADD;
- else if (error == VRESTARTING)
- return ARLA_VRESTARTING;
- else if (error <= RX_MIN_ERROR && error >= RX_MAX_ERROR)
- return ARLA_SPECIAL_RX_ERROR_ADD - error; /* RX code are negative */
- else
- return uae_error_to_errno(error);
-}
-
-#endif /* _FS_ERRORS_H_ */
diff --git a/usr.sbin/afs/src/arlad/hpux-subr.c b/usr.sbin/afs/src/arlad/hpux-subr.c
deleted file mode 100644
index 48747db4b3d..00000000000
--- a/usr.sbin/afs/src/arlad/hpux-subr.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* If this isn't defined, we get a constant for DIRSIZ */
-
-#define DIRSIZ_MACRO
-#define _INCLUDE_HPUX_SOURCE
-
-#include "arla_local.h"
-RCSID("$arla: hpux-subr.c,v 1.28 2002/03/06 21:56:59 tol Exp $");
-
-static long blocksize = 1024; /* XXX */
-
-static void
-flushbuf (void *vargs)
-{
- struct write_dirent_args *args = (struct write_dirent_args *)vargs;
- struct dirent *last = (struct dirent *)args->last;
- unsigned inc = blocksize - (args->ptr - args->buf);
-
- last->d_reclen += inc;
-#if 0
- last->d_off += inc;
-#endif
- if (write (args->fd, args->buf, blocksize) != blocksize)
- arla_warn (ADEBWARN, errno, "write");
- args->ptr = args->buf;
- args->last = NULL;
-}
-
-#if 0 /* this seems wrong? */
-#define DIRSIZ(dp) \
- (((sizeof(struct dirent)+ (strlen((dp)->d_name)+1)) +3) & ~3)
-#endif
-
-static int
-write_dirent(VenusFid *fid, const char *name, void *arg)
-{
- struct dirent dirent, *real;
- struct write_dirent_args *args = (struct write_dirent_args *)arg;
-
-/* dirent.d_namlen = strlen (name);*/
- dirent.d_reclen = DIRSIZ(&dirent);
-
- if (args->ptr + dirent.d_reclen > args->buf + blocksize)
- flushbuf (args);
- real = (struct dirent *)args->ptr;
-
-/* real->d_namlen = dirent.d_namlen;*/
- real->d_reclen = dirent.d_reclen;
- real->d_ino = dentry2ino (name, fid, args->e);
- strlcpy (real->d_name, name, sizeof(real->d_name));
- args->ptr += real->d_reclen;
- args->off += real->d_reclen;
-#if 0
- real->d_off = args->off;
-#endif
- args->last = real;
- return 0;
-}
-
-int
-conv_dir (FCacheEntry *e, CredCacheEntry *ce, u_int tokens,
- fcache_cache_handle *cache_handle,
- char *cache_name, size_t cache_name_sz)
-{
- return conv_dir_sub (e, ce, tokens, cache_handle, cache_name,
- cache_name_sz, write_dirent, flushbuf, blocksize);
-}
-/*
- * remove `filename` from the converted directory for `e'
- */
-
-int
-dir_remove_name (FCacheEntry *e, const char *filename,
- fcache_cache_handle *cache_handle,
- char *cache_name, size_t cache_name_sz)
-{
- int ret;
- int fd;
- fbuf fb;
- struct stat sb;
- char *buf;
- char *p;
- size_t len;
- struct dirent *dp;
- struct dirent *last_dp;
-
- fcache_extra_file_name (e, cache_name, cache_name_sz);
- fd = open (cache_name, O_RDWR, 0);
- if (fd < 0)
- return errno;
- fcache_fhget (cache_name, cache_handle);
- if (fstat (fd, &sb) < 0) {
- ret = errno;
- close (fd);
- return ret;
- }
- len = sb.st_size;
-
- ret = fbuf_create (&fb, fd, len, FBUF_READ|FBUF_WRITE|FBUF_SHARED);
- if (ret) {
- close (fd);
- return ret;
- }
- last_dp = NULL;
- ret = ENOENT;
- for (p = buf = fbuf_buf (&fb); p < buf + len; p += dp->d_reclen) {
- dp = (struct dirent *)p;
-
- if (strcmp (filename, dp->d_name) == 0) {
- if (last_dp != NULL) {
- struct dirent new_last;
-
- new_last.d_reclen = last_dp->d_reclen + dp->d_reclen;
- if (new_last.d_reclen >= last_dp->d_reclen)
- last_dp->d_reclen = new_last.d_reclen;
- }
- dp->d_ino = 0;
- ret = 0;
- break;
- }
- last_dp = dp;
- }
- fbuf_end (&fb);
- close (fd);
- return ret;
-}
diff --git a/usr.sbin/afs/src/arlad/inter.c b/usr.sbin/afs/src/arlad/inter.c
deleted file mode 100644
index 983ad545a43..00000000000
--- a/usr.sbin/afs/src/arlad/inter.c
+++ /dev/null
@@ -1,1103 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Interface to the cache manager.
- */
-
-#include "arla_local.h"
-RCSID("$arla: inter.c,v 1.138 2003/01/10 03:05:44 lha Exp $") ;
-
-#include <nnpfs/nnpfs_message.h>
-
-Bool cm_consistencyp = FALSE;
-
-/*
- * Return the rights for user cred and entry e.
- * If the rights are not existant fill in the entry.
- * The locking of e is up to the caller.
- */
-
-static u_long
-getrights (FCacheEntry *e, CredCacheEntry *ce)
-{
- AccessEntry *ae;
- int error;
-
- while (findaccess (ce->cred, e->acccache, &ae) == FALSE) {
- if ((error = read_attr(e, ce)) != 0)
- return 0; /* XXXX we want to return errno */
- }
- return ae->access;
-}
-
-/*
- * Check to see if the operation(s) mask are allowed to user cred on
- * file e
- */
-
-static Bool
-checkright (FCacheEntry *e, u_long mask, CredCacheEntry *ce)
-{
- u_long rights;
-
- if (e->status.FileType == TYPE_LINK &&
- e->anonaccess & ALIST)
- return TRUE;
- if ((e->anonaccess & mask) == mask)
- return TRUE;
- rights = getrights (e, ce);
- if (e->status.FileType == TYPE_LINK &&
- rights & ALIST)
- return TRUE;
- if ((rights & mask) == mask)
- return TRUE;
- return FALSE;
-}
-
-static int log_fd;
-static FILE *log_fp;
-
-/*
- *
- */
-
-void
-cm_init (void)
-{
- log_fd = open ("log", O_WRONLY | O_APPEND | O_CREAT | O_BINARY, 0666);
- if (log_fd < 0)
- arla_err (1, ADEBERROR, errno, "open log");
- log_fp = fdopen (log_fd, "a");
- if (log_fp == NULL)
- arla_err (1, ADEBERROR, errno, "fdopen");
-}
-
-/*
- *
- */
-
-void
-cm_store_state (void)
-{
- fclose (log_fp);
-}
-
-/*
- *
- */
-
-static void
-log_operation (const char *fmt, ...)
-{
- va_list args;
- struct timeval now;
-
- if(connected_mode == CONNECTED && cm_consistencyp == FALSE)
- return;
-
- va_start (args, fmt);
- gettimeofday (&now, NULL);
- fprintf (log_fp, "%lu.%lu ",
- (unsigned long)now.tv_sec,
- (unsigned long)now.tv_usec);
- vfprintf (log_fp, fmt, args);
- va_end (args);
-}
-
-/*
- *
- *
- */
-
-void
-cm_turn_on_consistency_check(void)
-{
- cm_consistencyp = TRUE;
-}
-
-/*
- * Check consistency of the fcache.
- * Will break the log-file.
- */
-
-void
-cm_check_consistency (void)
-{
- static unsigned int log_times = 0;
- static unsigned int file_times = 0;
- int64_t calc_size, real_size;
- char newname[MAXPATHLEN];
-
- if (cm_consistencyp == FALSE)
- return;
-
- calc_size = fcache_calculate_usage();
- real_size = fcache_usedbytes ();
-
- if (calc_size != real_size) {
- log_operation ("consistency check not guaranteed "
- "(calc: %d, real: %d, diff %d), exiting\n",
- (int) calc_size, (int) real_size,
- (int)(calc_size - real_size));
- cm_store_state ();
- exit(-1);
- }
- if (log_times % 100000 == 0) {
- log_operation ("consistency check ok, rotating logs\n");
- cm_store_state ();
- snprintf (newname, sizeof(newname), "log.%d", file_times++);
- rename ("log", newname);
- cm_init ();
- log_operation ("brave new world\n");
- }
- log_times++;
-}
-
-/*
- * These functions often take a FID as an argument to be general, but
- * they are intended to be called from a vnode-type of layer.
- */
-
-/*
- * The interface to the open-routine.
- */
-
-int
-cm_open (FCacheEntry *entry, CredCacheEntry *ce, u_int tokens)
-{
- u_long mask;
- int error = 0;
-
- switch(tokens) {
- case NNPFS_DATA_R:
-#if 0
- case NNPFS_OPEN_NR:
- case NNPFS_OPEN_SR:
-#endif
- mask = AREAD;
- break;
- case NNPFS_DATA_W:
- mask = AWRITE;
- break;
- case NNPFS_OPEN_NW:
- mask = AREAD | AWRITE;
- tokens |= NNPFS_DATA_R | NNPFS_DATA_W;
- break;
- default:
- arla_warnx (ADEBCM, "cm_open(): unknown token: %d, assuming AREAD",
- tokens);
- mask = AREAD;
- tokens |= NNPFS_DATA_R;
- }
-
- if (checkright (entry, mask, ce)) {
- assert(entry->flags.attrusedp);
- entry->flags.datausedp = TRUE;
- entry->tokens |= tokens;
-
- log_operation ("open (%ld,%lu,%lu,%lu) %u\n",
- entry->fid.Cell,
- entry->fid.fid.Volume,
- entry->fid.fid.Vnode,
- entry->fid.fid.Unique,
- mask);
- } else
- error = EACCES;
-
- cm_check_consistency();
-
- return error;
-}
-
-/*
- * close. Set flags and if we opened the file for writing, write it
- * back to the server.
- */
-
-int
-cm_close (FCacheEntry *entry, int flag,
- AFSStoreStatus *status, CredCacheEntry* ce)
-{
- int error = 0;
-
- if (flag & NNPFS_WRITE) {
- if (flag & NNPFS_FSYNC)
- status->Mask |= SS_FSYNC;
-
- error = write_data (entry, status, ce);
-
- if (error) {
- arla_warn (ADEBCM, error, "writing back file");
- return error;
- }
- }
-
- log_operation ("close (%ld,%lu,%lu,%lu) %d\n",
- entry->fid.Cell,
- entry->fid.fid.Volume,
- entry->fid.fid.Vnode,
- entry->fid.fid.Unique,
- flag);
-
- cm_check_consistency();
-
- return error;
-}
-
-/*
- * getattr - read the attributes from this file.
- */
-
-int
-cm_getattr (FCacheEntry *entry,
- CredCacheEntry *ce,
- AccessEntry **ae)
-{
- int error = 0;
-
- arla_warnx (ADEBCM, "cm_getattr");
-
- assert (ae);
-
- AssertExclLocked(&entry->lock);
-
- error = fcache_verify_attr (entry, NULL, NULL, ce);
- if (error)
- return error;
-
- arla_warnx (ADEBCM, "cm_getattr: done get attr");
-
- if (checkright (entry,
- entry->status.FileType == TYPE_FILE ? AREAD : 0,
- ce)) {
- entry->flags.attrusedp = TRUE;
- entry->flags.kernelp = TRUE;
- *ae = entry->acccache;
-
- log_operation ("getattr (%ld,%lu,%lu,%lu)\n",
- entry->fid.Cell,
- entry->fid.fid.Volume,
- entry->fid.fid.Vnode,
- entry->fid.fid.Unique);
-
- } else {
- *ae = NULL;
- error = EACCES;
- }
- if (!entry->flags.datausedp)
- entry->tokens &= ~(NNPFS_DATA_MASK | NNPFS_OPEN_MASK);
-
- arla_warnx (ADEBCM, "cm_getattr: return: %d", error);
- cm_check_consistency();
-
- return error;
-}
-
-/*
- * setattr - set the attributes of this file. These are immediately
- * sent to the FS.
- */
-
-int
-cm_setattr (FCacheEntry *entry, AFSStoreStatus *attr, CredCacheEntry* ce)
-{
- int error = 0;
-
- error = fcache_verify_attr (entry, NULL, NULL, ce);
- if (error)
- return error;
-
- if (checkright (entry, AWRITE, ce)) {
- arla_warnx (ADEBCM, "cm_setattr: Writing status");
- error = write_attr (entry, attr, ce);
-
- log_operation ("setattr (%ld,%lu,%lu,%lu)\n",
- entry->fid.Cell,
- entry->fid.fid.Volume,
- entry->fid.fid.Vnode,
- entry->fid.fid.Unique);
- } else
- error = EACCES;
-
- cm_check_consistency();
- return error;
-}
-
-/*
- * ftruncate - make the specified file have a specified size
- */
-
-int
-cm_ftruncate (FCacheEntry *entry, off_t size,
- AFSStoreStatus *storestatus, CredCacheEntry* ce)
-{
- int error = 0;
-
- error = fcache_verify_attr (entry, NULL, NULL, ce);
- if (error)
- return error;
-
- if (size) {
- error = fcache_verify_data (entry, ce);
- if (error)
- return error;
- }
-
- if (checkright (entry, AWRITE, ce)) {
- error = truncate_file (entry, size, storestatus, ce);
-
- log_operation ("ftruncate (%ld,%lu,%lu,%lu) %lu\n",
- entry->fid.Cell,
- entry->fid.fid.Volume,
- entry->fid.fid.Vnode,
- entry->fid.fid.Unique,
- (unsigned long)size);
- } else
- error = EACCES;
-
- cm_check_consistency();
- return error;
-}
-
-/*
- * access - check if user is allowed to perform operation.
- */
-
-int
-cm_access (FCacheEntry *entry, int mode, CredCacheEntry* ce)
-{
- int error = 0;
-
- error = fcache_verify_attr (entry, NULL, NULL, ce);
- if (error)
- return error;
-
- if (checkright (entry, AWRITE, ce))
- error = 0;
- else
- error = EACCES;
-
- log_operation ("access (%ld,%lu,%lu,%lu)\n",
- entry->fid.Cell,
- entry->fid.fid.Volume,
- entry->fid.fid.Vnode,
- entry->fid.fid.Unique);
-
- cm_check_consistency();
- return error;
-}
-
-/*
- * Expand `src' into `dest' (of size `dst_sz'), expanding `str' to
- * `replacement'. Return number of characters written to `dest'
- * (excluding terminating zero) or `dst_sz' if there's not enough
- * room.
- */
-
-static int
-expand_sys (char *dest, size_t dst_sz, const char *src,
- const char *str, const char *rep)
-{
- char *destp = dest;
- const char *srcp = src;
- char *s;
- int n = 0;
- int len;
- size_t str_len = strlen(str);
- size_t rep_len = strlen(rep);
- size_t src_len = strlen(src);
-
- while ((s = strstr (srcp, str)) != NULL) {
- len = s - srcp;
-
- if (dst_sz <= n + len + rep_len)
- return dst_sz;
-
- memcpy (destp, srcp, len);
- memcpy (destp + len, rep, rep_len);
- n += len + rep_len;
- destp += len + rep_len;
- srcp = s + str_len;
- }
- len = src_len - (srcp - src);
- if (dst_sz <= n + len)
- return dst_sz;
- memcpy (destp, srcp, len);
- n += len;
- destp[len] = '\0';
- return n;
-}
-
-/*
- * Find this entry in the directory. If the entry happens to point to
- * a mount point, then we follow that and return the root directory of
- * the volume. Hopefully this is the only place where we need to think
- * about mount points (which are followed iff follow_mount_point).
- */
-
-int
-cm_lookup (FCacheEntry **entry,
- const char *name,
- VenusFid *res,
- CredCacheEntry** ce,
- int follow_mount_point)
-{
- char tmp_name[MAXPATHLEN];
- int error = 0;
-
- error = fcache_get_data(entry, ce, 0);
- if (error)
- return error;
-
- if (strstr (name, "@sys") != NULL) {
- int i;
-
- for (i = 0; i < sysnamenum; i++) {
- int size = expand_sys (tmp_name, sizeof(tmp_name), name,
- "@sys", sysnamelist[i]);
- if (size >= sizeof(tmp_name))
- continue;
- error = adir_lookup (*entry, tmp_name, res);
- if (error == 0)
- break;
- }
- if (i == sysnamenum)
- error = ENOENT;
-
- } else
- error = adir_lookup (*entry, name, res);
-
- if (error)
- return error;
-
- /*
- * The ".." at the top of a volume just points to the volume root,
- * so get the real ".." from the volume cache instead.
- *
- * Or if we are looking up "." we don't want to follow the
- * mountpoint
- */
-
- if (strcmp(".", name) == 0) {
-
- error = fcache_verify_attr (*entry, NULL, NULL, *ce);
- if (error)
- goto out;
-
- *res = (*entry)->fid;
- } else if (strcmp("..", name) == 0
- && VenusFid_cmp(&(*entry)->fid, res) == 0) {
-
- error = fcache_verify_attr (*entry, NULL, NULL, *ce);
- if (error)
- goto out;
-
- *res = (*entry)->volume->parent_fid; /* entry->parent */
- } else if (follow_mount_point) {
- error = followmountpoint (res, &(*entry)->fid, *entry, ce);
- if (error)
- goto out;
- }
-out:
- log_operation ("lookup (%ld,%lu,%lu,%lu) %s\n",
- (*entry)->fid.Cell,
- (*entry)->fid.fid.Volume,
- (*entry)->fid.fid.Vnode,
- (*entry)->fid.fid.Unique,
- name);
-
- cm_check_consistency();
- return error;
-}
-
-/*
- * Create this file and more.
- */
-
-int
-cm_create (FCacheEntry **dir, const char *name, AFSStoreStatus *store_attr,
- VenusFid *res, AFSFetchStatus *fetch_attr,
- CredCacheEntry **ce)
-{
- int error = 0;
-
- error = fcache_get_data (dir, ce, 0);
- if (error)
- return error;
-
- if (checkright (*dir, AINSERT, *ce)) {
- error = create_file (*dir, name, store_attr,
- res, fetch_attr, *ce);
- if (error == 0)
- error = adir_creat (*dir, name, res->fid);
- } else
- error = EACCES;
-
- log_operation ("create (%ld,%lu,%lu,%lu) %s\n",
- (*dir)->fid.Cell,
- (*dir)->fid.fid.Volume,
- (*dir)->fid.fid.Vnode,
- (*dir)->fid.fid.Unique,
- name);
-
- cm_check_consistency();
- return error;
-}
-
-/*
- * Create a new directory
- */
-
-int
-cm_mkdir (FCacheEntry **dir, const char *name,
- AFSStoreStatus *store_attr,
- VenusFid *res, AFSFetchStatus *fetch_attr,
- CredCacheEntry **ce)
-{
- int error = 0;
-
- error = fcache_get_data (dir, ce, 0);
- if (error)
- return error;
-
- if (checkright (*dir, AINSERT, *ce)) {
- error = create_directory (*dir, name, store_attr,
- res, fetch_attr, *ce);
- if (error == 0)
- error = adir_creat (*dir, name, res->fid);
-
- } else
- error = EACCES;
-
- log_operation ("mkdir (%ld,%lu,%lu,%lu) %s\n",
- (*dir)->fid.Cell,
- (*dir)->fid.fid.Volume,
- (*dir)->fid.fid.Vnode,
- (*dir)->fid.fid.Unique,
- name);
-
- cm_check_consistency();
- return error;
-}
-
-/*
- * Create a symlink
- */
-
-int
-cm_symlink (FCacheEntry **dir,
- const char *name, AFSStoreStatus *store_attr,
- VenusFid *res, VenusFid *realfid,
- AFSFetchStatus *fetch_attr,
- const char *contents,
- CredCacheEntry **ce)
-{
- FCacheEntry *symlink_entry;
- int error = 0;
-
- error = fcache_get_data (dir, ce, 0);
- if (error)
- return error;
-
- if (!checkright (*dir, AINSERT, *ce)) {
- error = EACCES;
- goto out;
- }
-
- /* It seems Transarc insists on mount points having mode bits 0644 */
-
- if (contents[0] == '%' || contents[0] == '#') {
- store_attr->UnixModeBits = 0644;
- store_attr->Mask |= SS_MODEBITS;
- } else if (store_attr->Mask & SS_MODEBITS
- && store_attr->UnixModeBits == 0644)
- store_attr->UnixModeBits = 0755;
-
- error = create_symlink (*dir, name, store_attr,
- res, fetch_attr,
- contents, *ce);
- if (error)
- goto out;
-
- error = adir_creat (*dir, name, res->fid);
- if (error)
- goto out;
-
- error = followmountpoint(res, &(*dir)->fid, NULL, ce);
- if (error)
- goto out;
-
- /*
- * If the new symlink is a mountpoint and it points
- * to dir_fid we will deadlock if we look it up.
- */
-
- if (VenusFid_cmp (res, &(*dir)->fid) != 0) {
-
- error = fcache_get (&symlink_entry, *res, *ce);
- if (error)
- goto out;
-
- error = fcache_verify_attr (symlink_entry, *dir, name, *ce);
- if (error) {
- fcache_release (symlink_entry);
- goto out;
- }
-
- symlink_entry->flags.kernelp = TRUE;
-
- *fetch_attr = symlink_entry->status;
- *realfid = *fcache_realfid (symlink_entry);
-
- fcache_release (symlink_entry);
- } else {
- *fetch_attr = (*dir)->status;
- *realfid = *fcache_realfid (*dir);
- }
-
- log_operation ("symlink (%ld,%lu,%lu,%lu) %s %s\n",
- (*dir)->fid.Cell,
- (*dir)->fid.fid.Volume,
- (*dir)->fid.fid.Vnode,
- (*dir)->fid.fid.Unique,
- name,
- contents);
-
- out:
- cm_check_consistency();
- return error;
-}
-
-/*
- * Create a hard link.
- */
-
-int
-cm_link (FCacheEntry **dir,
- const char *name,
- VenusFid existing_fid,
- AFSFetchStatus *existing_status,
- CredCacheEntry **ce)
-{
- FCacheEntry *file;
- int error = 0;
-
- error = fcache_get_data (dir, ce, 0);
- if (error)
- return error;
-
- error = fcache_get (&file, existing_fid, *ce);
- if (error)
- return error;
-
- error = fcache_verify_attr (file, *dir, NULL, *ce);
- if (error)
- goto out;
-
- if (checkright (*dir, AINSERT, *ce)) {
- error = create_link (*dir, name, file, *ce);
- if (error == 0) {
- error = adir_creat (*dir, name, existing_fid.fid);
- if (error == 0)
- *existing_status = file->status;
- }
- } else
- error = EACCES;
-
- log_operation ("link (%ld,%lu,%lu,%lu) (%ld,%lu,%lu,%lu) %s\n",
- (*dir)->fid.Cell,
- (*dir)->fid.fid.Volume,
- (*dir)->fid.fid.Vnode,
- (*dir)->fid.fid.Unique,
- existing_fid.Cell,
- existing_fid.fid.Volume,
- existing_fid.fid.Vnode,
- existing_fid.fid.Unique,
- name);
-
-out:
- fcache_release(file);
- cm_check_consistency();
- return error;
-}
-
-/*
- * generic function for both remove and rmdir
- */
-
-static int
-sub_remove (FCacheEntry **dir, const char *name, CredCacheEntry **ce,
- const char *operation,
- int (*func)(FCacheEntry *fe,
- const char *name,
- CredCacheEntry *ce))
-{
- int error = 0;
-
- error = fcache_get_data (dir, ce, 0);
- if (error)
- return error;
-
- if (checkright (*dir, ADELETE, *ce)) {
- error = (*func) (*dir, name, *ce);
- if (error == 0)
- error = adir_remove (*dir, name);
- } else
- error = EACCES;
-
- log_operation ("%s (%ld,%lu,%lu,%lu) %s\n",
- operation,
- (*dir)->fid.Cell,
- (*dir)->fid.fid.Volume,
- (*dir)->fid.fid.Vnode,
- (*dir)->fid.fid.Unique,
- name);
-
- cm_check_consistency();
- return error;
-}
-
-/*
- * Remove the file named `name' in the directory `dir'.
- */
-
-int
-cm_remove(FCacheEntry **dir,
- const char *name, CredCacheEntry **ce)
-{
- return sub_remove (dir, name, ce, "remove", remove_file);
-}
-
-/*
- * Remove the directory named `name' in the directory `dir'.
- */
-
-int
-cm_rmdir(FCacheEntry **dir,
- const char *name, CredCacheEntry **ce)
-{
- return sub_remove (dir, name, ce, "rmdir", remove_directory);
-}
-
-/*
- * Called when the object is being moved to a new directory, to be
- * able to update .. when required.
- */
-
-static int
-potential_update_dir(FCacheEntry *child_entry,
- const VenusFid *new_parent_fid,
- FCacheEntry *parent_entry,
- int *update_child,
- CredCacheEntry **ce)
-{
- int error;
-
- error = fcache_verify_attr (child_entry, parent_entry, NULL, *ce);
- if (error)
- return error;
-
- /*
- * if we're moving a directory.
- */
-
- if (child_entry->status.FileType == TYPE_DIR) {
- int fd;
- fbuf the_fbuf;
-
- error = fcache_get_data(&child_entry, ce, 0); /* XXX - check fake_mp */
- if (error)
- return error;
-
- error = fcache_get_fbuf (child_entry, &fd, &the_fbuf, O_RDWR,
- FBUF_READ|FBUF_WRITE|FBUF_SHARED);
- if (error)
- return error;
-
- error = fdir_changefid (&the_fbuf, "..", new_parent_fid);
- fbuf_end (&the_fbuf);
- close (fd);
- if (error)
- return error;
-
- *update_child = 1;
- }
- return 0;
-}
-
-/*
- * Rename (old_parent_fid, old_name) -> (new_parent_fid, new_name)
- * update the `child' in the new directory if update_child.
- * set child_fid to the fid of the moved object.
- */
-
-int
-cm_rename(FCacheEntry **old_dir, const char *old_name,
- FCacheEntry **new_dir, const char *new_name,
- VenusFid *child_fid,
- int *update_child,
- CredCacheEntry **ce)
-{
- int error = 0;
- VenusFid new_fid, old_fid;
-
- *update_child = 0;
-
- /* old parent dir */
-
- error = fcache_get_data (old_dir, ce, 0);
- if (error)
- return error;
-
- /* new parent dir */
-
- error = fcache_get_data (new_dir, ce, 0);
- if (error)
- return error;
-
- if (!checkright (*old_dir, ADELETE, *ce)
- || !checkright (*new_dir, AINSERT, *ce)) {
- error = EACCES;
- goto out;
- }
-
- error = rename_file (*old_dir, old_name, *new_dir, new_name, *ce);
- if (error)
- goto out;
-
- /*
- * Lookup the old name (to get the fid of the new name)
- */
-
- error = adir_lookup (*old_dir, old_name, &new_fid);
-
- if (error)
- goto out;
-
- *child_fid = new_fid;
-
- if (VenusFid_cmp (&(*old_dir)->fid, &(*new_dir)->fid)) {
- FCacheEntry *child_entry;
-
- error = fcache_get (&child_entry, *child_fid, *ce);
- if (error)
- goto out;
-
- child_entry->parent = (*new_dir)->fid;
-
- error = potential_update_dir (child_entry, &(*new_dir)->fid,
- *new_dir, update_child, ce);
- fcache_release (child_entry);
- if (error)
- goto out;
- }
-
- /*
- * Lookup the new name, if it exists we need to silly
- * rename it was just killed on the fileserver.
- * XXXDISCO remember mark this node as dead
- */
-
- error = adir_lookup (*new_dir, new_name, &old_fid);
- if (error == 0) {
- FCacheEntry *old_entry;
-
- error = fcache_find (&old_entry, old_fid);
- if (error == 0) {
- old_entry->flags.silly = TRUE;
- fcache_release (old_entry);
- }
- adir_remove (*new_dir, new_name);
- }
-
- /*
- * Now do the rename, ie create the new name and remove
- * the old name.
- */
-
- error = adir_creat (*new_dir, new_name, new_fid.fid)
- || adir_remove (*old_dir, old_name);
-
- log_operation ("rename (%ld,%lu,%lu,%lu) (%ld,%lu,%lu,%lu) %s %s\n",
- (*old_dir)->fid.Cell,
- (*old_dir)->fid.fid.Volume,
- (*old_dir)->fid.fid.Vnode,
- (*old_dir)->fid.fid.Unique,
- (*new_dir)->fid.Cell,
- (*new_dir)->fid.fid.Volume,
- (*new_dir)->fid.fid.Vnode,
- (*new_dir)->fid.fid.Unique,
- old_name, new_name);
-
- out:
- cm_check_consistency();
- return error;
-}
-
-/*
- * An emulation of kernel lookup, convert (fid, name) into
- * (res). Strips away leading /afs, removes double slashes,
- * and resolves symlinks.
- * Return 0 for success, otherwise -1.
- */
-
-int
-cm_walk (VenusFid fid,
- const char *name,
- VenusFid *res)
-{
- VenusFid cwd = fid;
- char *base;
- VenusFid file;
- FCacheEntry *entry;
- FCacheEntry *dentry;
- int error;
- char symlink[MAXPATHLEN];
- char store_name[MAXPATHLEN];
- char *fname;
- CredCacheEntry *ce;
-
- ce = cred_get (fid.Cell, getuid(), CRED_ANY);
-
- strlcpy(store_name, name, sizeof(store_name));
- fname = store_name;
-
- do {
- /* set things up so that fname points to the remainder of the path,
- * whereas base points to the whatever precedes the first /
- */
- base = fname;
- fname = strchr(fname, '/');
- if (fname) {
- /* deal with repeated adjacent / chars by eliminating the
- * duplicates.
- */
- while (*fname == '/') {
- *fname = '\0';
- fname++;
- }
- }
-
- /* deal with absolute pathnames first. */
- if (*base == '\0') {
- error = getroot(&cwd, ce);
- if (error) {
- arla_warn(ADEBWARN, error, "getroot");
- cred_free(ce);
- return -1;
- }
-
- if (fname) {
- if (strncmp("afs",fname,3) == 0) {
- fname += 3;
- }
- continue;
- } else {
- break;
- }
- }
- error = fcache_get(&dentry, cwd, ce);
- if (error) {
- arla_warn (ADEBWARN, error, "fcache_get");
- cred_free(ce);
- return -1;
- }
- error = cm_lookup (&dentry, base, &file, &ce, TRUE);
- if (error) {
- fcache_release(dentry);
- arla_warn (ADEBWARN, error, "lookup(%s)", base);
- cred_free(ce);
- return -1;
- }
- fcache_release(dentry);
- error = fcache_get(&entry, file, ce);
- if (error) {
- arla_warn (ADEBWARN, error, "fcache_get");
- cred_free(ce);
- return -1;
- }
-
- error = fcache_get_data (&entry, &ce, 0);
- if (error) {
- fcache_release(entry);
- arla_warn (ADEBWARN, error, "fcache_get_data");
- cred_free(ce);
- return -1;
- }
-
- /* handle symlinks here */
- if (entry->status.FileType == TYPE_LINK) {
- int len;
- int fd;
-
- fd = fcache_open_file (entry, O_RDONLY);
- /* read the symlink and null-terminate it */
- if (fd < 0) {
- fcache_release(entry);
- arla_warn (ADEBWARN, errno, "fcache_open_file");
- cred_free(ce);
- return -1;
- }
- len = read (fd, symlink, sizeof(symlink));
- close (fd);
- if (len <= 0) {
- fcache_release(entry);
- arla_warnx (ADEBWARN, "cannot read symlink");
- cred_free(ce);
- return -1;
- }
- symlink[len] = '\0';
- /* if we're not at the end (i.e. fname is not null), take
- * the expansion of the symlink and append fname to it.
- */
- if (fname != NULL) {
-
- strlcat (symlink, "/", sizeof(symlink));
- strlcat (symlink, fname, sizeof(symlink));
- }
- strlcpy(store_name, symlink, sizeof(store_name));
- fname = store_name;
- } else {
- /* if not a symlink, just update cwd */
- cwd = entry->fid;
- }
- fcache_release(entry);
-
- /* the *fname condition below deals with a trailing / in a
- * path-name */
- } while (fname != NULL && *fname);
- *res = cwd;
- cred_free(ce);
- return 0;
-}
diff --git a/usr.sbin/afs/src/arlad/inter.h b/usr.sbin/afs/src/arlad/inter.h
deleted file mode 100644
index e5ba3e60aa8..00000000000
--- a/usr.sbin/afs/src/arlad/inter.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * The interface to the cache manager.
- */
-
-/* $arla: inter.h,v 1.36 2003/01/09 16:40:10 lha Exp $ */
-
-#ifndef _INTER_H_
-#define _INTER_H_
-
-#include <cred.h>
-
-void
-cm_init (void);
-
-void
-cm_store_state (void);
-
-int
-cm_open (FCacheEntry *entry, CredCacheEntry *ce, u_int tokens);
-
-int
-cm_close (FCacheEntry *entry, int flag, AFSStoreStatus *status,
- CredCacheEntry* ce);
-
-int
-cm_getattr (FCacheEntry *entry,
- CredCacheEntry *ce,
- AccessEntry **ae);
-
-int
-cm_setattr (FCacheEntry *entry, AFSStoreStatus *attr, CredCacheEntry *ce);
-
-int
-cm_ftruncate (FCacheEntry *entry, off_t size,
- AFSStoreStatus *storeattr, CredCacheEntry *ce);
-
-int
-cm_access (FCacheEntry *entry, int mode, CredCacheEntry *ce);
-
-int
-cm_lookup (FCacheEntry **entry, const char *name, VenusFid *res,
- CredCacheEntry **ce, int follow_mount_point);
-int
-cm_create (FCacheEntry **dir, const char *name, AFSStoreStatus *store_attr,
- VenusFid *res, AFSFetchStatus *fetch_attr,
- CredCacheEntry **ce);
-int
-cm_mkdir (FCacheEntry **dir, const char *name, AFSStoreStatus *store_attr,
- VenusFid *res, AFSFetchStatus *fetch_attr,
- CredCacheEntry **ce);
-
-int
-cm_remove (FCacheEntry **dir, const char *name, CredCacheEntry **ce);
-
-int
-cm_rmdir (FCacheEntry **dir, const char *name, CredCacheEntry **ce);
-
-int
-cm_link (FCacheEntry **dir, const char *name,
- VenusFid existing_fid,
- AFSFetchStatus *existing_status,
- CredCacheEntry **ce);
-
-int
-cm_symlink (FCacheEntry **dir, const char *name,
- AFSStoreStatus *store_attr,
- VenusFid *res, VenusFid *real_fid,
- AFSFetchStatus *fetch_attr,
- const char *contents,
- CredCacheEntry **ce);
-
-int
-cm_rename(FCacheEntry **old_dir, const char *old_name,
- FCacheEntry **new_dir, const char *new_name,
- VenusFid *child_fid,
- int *update_child,
- CredCacheEntry **ce);
-
-int
-cm_walk (VenusFid fid,
- const char *name,
- VenusFid *res);
-
-void
-cm_check_consistency (void);
-
-void
-cm_turn_on_consistency_check(void);
-
-#endif /* _INTER_H_ */
diff --git a/usr.sbin/afs/src/arlad/irix-subr.c b/usr.sbin/afs/src/arlad/irix-subr.c
deleted file mode 100644
index b967eeae48f..00000000000
--- a/usr.sbin/afs/src/arlad/irix-subr.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#define _KERNEL
-#include "arla_local.h"
-RCSID("$arla: irix-subr.c,v 1.27 2002/03/06 21:57:00 tol Exp $");
-
-static long blocksize = 1024; /* XXX */
-
-static void
-flushbuf (void *vargs)
-{
- struct write_dirent_args *args = (struct write_dirent_args *)vargs;
- struct dirent *last = (struct dirent *)args->last;
- unsigned inc = blocksize - (args->ptr - args->buf);
-
- last->d_reclen += inc;
- last->d_off += inc;
- if (write (args->fd, args->buf, blocksize) != blocksize)
- arla_warn (ADEBWARN, errno, "write");
- args->ptr = args->buf;
- args->last = NULL;
-}
-
-static int
-write_dirent(VenusFid *fid, const char *name, void *arg)
-{
- struct dirent64 dirent, *real;
- struct write_dirent_args *args = (struct write_dirent_args *)arg;
- size_t namelen = strlen (name);
-
- dirent.d_reclen = DIRENT64SIZE(namelen);
-
- if (args->ptr + dirent.d_reclen > args->buf + blocksize)
- flushbuf (args);
- real = (struct dirent64 *)args->ptr;
-
- real->d_reclen = dirent.d_reclen;
- real->d_ino = dentry2ino (name, fid, args->e);
- strlcpy (real->d_name, name, sizeof(real->d_name));
- args->ptr += real->d_reclen;
- args->off += real->d_reclen;
- real->d_off = args->off;
- args->last = real;
- return 0;
-}
-
-int
-conv_dir (FCacheEntry *e, CredCacheEntry *ce, u_int tokens,
- fcache_cache_handle *cache_handle,
- char *cache_name, size_t cache_name_sz)
-{
- return conv_dir_sub (e, ce, tokens, cache_handle, cache_name,
- cache_name_sz, write_dirent, flushbuf, blocksize);
-}
-
-/*
- * remove `filename` from the converted directory for `e'
- */
-
-int
-dir_remove_name (FCacheEntry *e, const char *filename,
- fcache_cache_handle *cache_handle,
- char *cache_name, size_t cache_name_sz)
-{
- int ret;
- int fd;
- fbuf fb;
- struct stat sb;
- char *buf;
- char *p;
- size_t len;
- struct dirent64 *dp;
- struct dirent64 *last_dp;
-
- fcache_extra_file_name (e, cache_name, cache_name_sz);
- fd = open (cache_name, O_RDWR, 0);
- if (fd < 0)
- return errno;
- fcache_fhget (cache_name, cache_handle);
- if (fstat (fd, &sb) < 0) {
- ret = errno;
- close (fd);
- return ret;
- }
- len = sb.st_size;
-
- ret = fbuf_create (&fb, fd, len, FBUF_READ|FBUF_WRITE|FBUF_SHARED);
- if (ret) {
- close (fd);
- return ret;
- }
- last_dp = NULL;
- ret = ENOENT;
- for (p = buf = fbuf_buf (&fb); p < buf + len; p += dp->d_reclen) {
- dp = (struct dirent64 *)p;
-
- if (strcmp (filename, dp->d_name) == 0) {
- if (last_dp != NULL) {
- struct dirent new_last;
-
- new_last.d_reclen = last_dp->d_reclen + dp->d_reclen;
- if (new_last.d_reclen >= last_dp->d_reclen)
- last_dp->d_reclen = new_last.d_reclen;
- }
- dp->d_ino = 0;
- ret = 0;
- break;
- }
- last_dp = dp;
- }
- fbuf_end (&fb);
- close (fd);
- return ret;
-}
diff --git a/usr.sbin/afs/src/arlad/kernel.c b/usr.sbin/afs/src/arlad/kernel.c
deleted file mode 100644
index 14c94757302..00000000000
--- a/usr.sbin/afs/src/arlad/kernel.c
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "arla_local.h"
-RCSID("$arla: kernel.c,v 1.35 2003/01/10 17:33:44 tol Exp $");
-
-/*
- * The fd we use to talk with the kernel on.
- */
-
-int kernel_fd = -1;
-
-/* count of the number of messages in a read */
-
-static unsigned recv_count[20];
-
-/* for more than above... */
-
-static unsigned recv_count_overflow;
-
-/*
- * Number of workers used and high
- */
-
-static unsigned long workers_high, workers_used;
-
-
-unsigned long
-kernel_highworkers(void)
-{
- return workers_high;
-}
-
-unsigned long
-kernel_usedworkers(void)
-{
- return workers_used;
-}
-
-/*
- *
- */
-
-static int
-process_message (int msg_length, char *msg)
-{
- struct nnpfs_message_header *header;
- char *p;
- int cnt;
-
- cnt = 0;
- for (p = msg;
- msg_length > 0;
- p += header->size, msg_length -= header->size) {
- header = (struct nnpfs_message_header *)p;
- nnpfs_message_receive (kernel_fd, header, header->size);
- ++cnt;
- }
- if (cnt < sizeof(recv_count)/sizeof(recv_count[0]))
- ++recv_count[cnt];
- else
- ++recv_count_overflow;
-
- return 0;
-}
-
-/* no threads available to handle messages */
-
-static int overload = FALSE;
-
-/*
- * The work threads.
- */
-
-struct worker {
- char name[10];
- char pad[6]; /* make sure we're aligned for the data */
- char data[MAX_XMSG_SIZE];
- PROCESS pid;
- int msg_length;
- int busyp;
- int number;
-} *workers;
-
-static void
-sub_thread (void *v_myself)
-{
- struct worker *self = (struct worker *)v_myself;
-
- for (;;) {
- arla_warnx (ADEBKERNEL, "worker %d waiting", self->number);
- LWP_WaitProcess (self);
- self->busyp = 1;
- ++workers_used;
- arla_warnx (ADEBKERNEL, "worker %d: processing", self->number);
- process_message (self->msg_length, self->data);
- arla_warnx (ADEBKERNEL, "worker %d: done", self->number);
- --workers_used;
- self->busyp = 0;
- overload = FALSE;
- LWP_NoYieldSignal(&overload);
- }
-}
-
-PROCESS version_pid;
-
-static void
-version_thread (void *foo)
-{
- nnpfs_probe_version (kernel_fd, NNPFS_VERSION);
-}
-
-/*
- * The tcp communication unit
- */
-
-static int
-tcp_open (const char *filename)
-{
- int s, ret, port;
- struct sockaddr_in addr;
-
- if (strlen (filename) == 0)
- arla_errx (1, ADEBERROR, "tcp_open doesn't contain tcp-port");
-
- port = atoi (filename);
- if (port == 0)
- arla_errx (1, ADEBERROR, "tcp_open couldn't parse %s as a port#",
- filename);
-
- s = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
- if (s < 0) {
- arla_warn (ADEBWARN, errno, "tcp_open: socket failed");
- return s;
- }
-
- addr.sin_family = AF_INET;
- addr.sin_addr.s_addr = htonl(0x7f000001); /* 127.0.0.1 */
- addr.sin_port = htons(port);
- ret = connect (s, (struct sockaddr *)&addr, sizeof(addr));
- if (ret < 0) {
- arla_warn (ADEBWARN, errno, "tcp_open: connect failed");
- return s;
- }
- return s;
-}
-
-static int
-tcp_opendef (const char *filename)
-{
- if (strlen (filename) != 0)
- arla_warnx (ADEBWARN, "tcp_opendef ignoring extra data");
-
- return tcp_open ("5000"); /* XXX */
-}
-
-static ssize_t
-tcp_read (int fd, void *data, size_t len)
-{
- int32_t slen;
- char in_len[4];
- if (recv (fd, in_len, sizeof(in_len), 0) != sizeof(in_len)) {
- arla_warn (ADEBWARN, errno, "tcp_read: failed to read length");
- return -1;
- }
- memcpy(&slen, in_len, sizeof(slen));
- slen = ntohl(slen);
- if (len < slen) {
- arla_warnx (ADEBWARN,
- "tcp_read: recv a too large message %d",
- slen);
- return -1;
- }
- return recv (fd, data, slen, 0) == slen ? slen : -1;
-}
-
-static ssize_t
-tcp_write (int fd, const void *data, size_t len)
-{
- int ret;
- int32_t slen = htonl(len);
- char out_len[4];
-
- memcpy (out_len, &slen, sizeof(slen));
- if (send (fd, out_len, sizeof(slen), 0) != sizeof(out_len)) {
- arla_warn (ADEBWARN, errno, "tcp_write: failed to write length");
- return -1;
- }
- ret = send (fd, data, len, 0);
- if (ret != len) {
- arla_warn (ADEBWARN, errno, "tcp_write: failed to write msg (%d)",
- ret);
- return -1;
- }
-
- return ret;
-}
-
-/*
- * The cdev communication unit
- */
-
-static int
-dev_open (const char *filename)
-{
- char fn[MAXPATHLEN];
- snprintf (fn, MAXPATHLEN, "/%s", filename);
- return open (fn, O_RDWR);
-}
-
-static int
-dev_fileopen (const char *filename)
-{
- return dev_open (filename);
-}
-
-static ssize_t
-dev_read (int fd, void *msg, size_t len)
-{
- return read (fd, msg, len);
-}
-
-static ssize_t
-dev_write (int fd, const void *msg, size_t len)
-{
- return write (fd, msg, len);
-}
-
-/*
- * The null communication unit
- */
-
-static int
-null_open (const char *filename)
-{
- return 0;
-}
-
-static ssize_t
-null_read (int fd, void *msg, size_t len)
-{
- return 0;
-}
-
-static ssize_t
-null_write (int fd, const void *msg, size_t len)
-{
- return len;
-}
-
-/*
- * Way to communticate with the kernel
- */
-
-struct kern_interface {
- const char *prefix;
- int (*open) (const char *filename);
- ssize_t (*read) (int fd, void *msg, size_t len);
- ssize_t (*write) (int fd, const void *msg, size_t len);
-} kern_comm[] = {
- { "/", dev_open, dev_read, dev_write},
- { "file:/", dev_fileopen, dev_read, dev_write},
- { "tcpport:", tcp_open, tcp_read, tcp_write},
- { "tcp", tcp_opendef, tcp_read, tcp_write},
- { "null", null_open, null_read, null_write},
- { NULL }
-} ;
-
-struct kern_interface *kern_cur = NULL;
-
-static int
-kern_open (const char *filename)
-{
- struct kern_interface *ki = &kern_comm[0];
- int len;
-
- while (ki->prefix) {
- len = strlen (ki->prefix);
- if (strncasecmp (ki->prefix, filename, len) == 0) {
- break;
- }
- ki++;
- }
- if (ki->prefix == NULL)
- return -1;
- kern_cur = ki;
- return (ki->open) (filename+len);
-}
-
-ssize_t
-kern_read (int fd, void *data, size_t len)
-{
- assert (kern_cur != NULL);
- return (kern_cur->read) (fd, data, len);
-}
-
-ssize_t
-kern_write (int fd, const void *data, size_t len)
-{
- assert (kern_cur != NULL);
- return (kern_cur->write) (fd, data, len);
-}
-
-/*
- *
- */
-
-void
-kernel_opendevice (const char *dev)
-{
- int fd;
-
- fd = kern_open (dev);
- if (fd < 0)
- arla_err (1, ADEBERROR, errno, "kern_open %s", dev);
- kernel_fd = fd;
- if (kernel_fd >= FD_SETSIZE)
- arla_errx (1, ADEBERROR, "kernel fd too large");
-}
-
-
-/*
- *
- */
-
-#define WORKER_STACKSIZE (16*1024)
-
-void
-kernel_interface (struct kernel_args *args)
-{
- int i;
-
- assert (kernel_fd >= 0);
-
- workers = malloc (sizeof(*workers) * args->num_workers);
- if (workers == NULL)
- arla_err (1, ADEBERROR, errno, "malloc %lu failed",
- (unsigned long)sizeof(*workers) * args->num_workers);
-
- workers_high = args->num_workers;
- workers_used = 0;
-
- for (i = 0; i < args->num_workers; ++i) {
- workers[i].busyp = 0;
- workers[i].number = i;
- snprintf(workers[i].name, sizeof(workers[i].name), "worker %d", i);
-
- if (LWP_CreateProcess (sub_thread, WORKER_STACKSIZE, 1,
- (char *)&workers[i],
- workers[i].name, &workers[i].pid))
- arla_errx (1, ADEBERROR, "CreateProcess of worker failed");
- }
-
- if (LWP_CreateProcess (version_thread, WORKER_STACKSIZE, 1,
- NULL,
- "version", &version_pid))
- arla_errx (1, ADEBERROR, "CreateProcess of version thread failed");
-
- arla_warnx(ADEBKERNEL, "Arla: selecting on fd: %d", kernel_fd);
-
- for (;;) {
- fd_set readset;
- int ret;
-
- FD_ZERO(&readset);
- FD_SET(kernel_fd, &readset);
-
- ret = IOMGR_Select (kernel_fd + 1, &readset, NULL, NULL, NULL);
-
- if (ret < 0)
- arla_warn (ADEBKERNEL, errno, "select");
- else if (ret == 0)
- arla_warnx (ADEBKERNEL,
- "Arla: select returned with 0. strange.");
- else if (FD_ISSET(kernel_fd, &readset)) {
- for (i = 0; i < args->num_workers; ++i) {
- if (workers[i].busyp == 0) {
- ret = kern_read (kernel_fd, workers[i].data,
- sizeof(workers[i].data));
- if (ret <= 0) {
- arla_warn (ADEBWARN, errno, "read");
- } else {
- workers[i].msg_length = ret;
- LWP_SignalProcess (&workers[i]);
- }
- break;
- }
- }
- if (i == args->num_workers) {
- arla_warnx (ADEBWARN, "kernel: all %u workers busy",
- args->num_workers);
- overload = TRUE;
- LWP_WaitProcess(&overload);
- }
- }
- }
-}
diff --git a/usr.sbin/afs/src/arlad/kernel.h b/usr.sbin/afs/src/arlad/kernel.h
deleted file mode 100644
index 7d24d14638f..00000000000
--- a/usr.sbin/afs/src/arlad/kernel.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: kernel.h,v 1.9 2002/07/24 06:04:29 lha Exp $ */
-
-#ifndef _KERNEL_H_
-#define _KERNEL_H_
-
-struct kernel_args {
- unsigned num_workers;
-};
-
-void kernel_interface (struct kernel_args *args);
-
-void
-kernel_opendevice (const char *dev);
-
-extern int kernel_fd;
-
-unsigned long
-kernel_highworkers(void);
-
-unsigned long
-kernel_usedworkers(void);
-
-ssize_t
-kern_read (int fd, void *data, size_t len);
-
-ssize_t
-kern_write (int fd, const void *data, size_t len);
-
-#endif /* _KERNEL_H_ */
diff --git a/usr.sbin/afs/src/arlad/messages.c b/usr.sbin/afs/src/arlad/messages.c
deleted file mode 100644
index 068d7aa7cdb..00000000000
--- a/usr.sbin/afs/src/arlad/messages.c
+++ /dev/null
@@ -1,4348 +0,0 @@
-/*
- * Copyright (c) 1995-2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "arla_local.h"
-RCSID("$arla: messages.c,v 1.318 2003/06/10 04:23:31 lha Exp $");
-
-#include <nnpfs/nnpfs_message.h>
-
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-#include <kafs.h>
-
-#include "messages.h"
-
-static int
-nnpfs_message_getroot (int, struct nnpfs_message_getroot*, u_int);
-
-static int
-nnpfs_message_getnode (int, struct nnpfs_message_getnode*, u_int);
-
-static int
-nnpfs_message_getattr (int, struct nnpfs_message_getattr*, u_int);
-
-static int
-nnpfs_message_open (int, struct nnpfs_message_open*, u_int);
-
-static int
-nnpfs_message_getdata (int, struct nnpfs_message_getdata*, u_int);
-
-static int
-nnpfs_message_inactivenode (int,struct nnpfs_message_inactivenode*,u_int);
-
-static int
-nnpfs_message_putdata (int fd, struct nnpfs_message_putdata *h, u_int size);
-
-static int
-nnpfs_message_putattr (int fd, struct nnpfs_message_putattr *h, u_int size);
-
-static int
-nnpfs_message_create (int fd, struct nnpfs_message_create *h, u_int size);
-
-static int
-nnpfs_message_mkdir (int fd, struct nnpfs_message_mkdir *h, u_int size);
-
-static int
-nnpfs_message_link (int fd, struct nnpfs_message_link *h, u_int size);
-
-static int
-nnpfs_message_symlink (int fd, struct nnpfs_message_symlink *h, u_int size);
-
-static int
-nnpfs_message_remove (int fd, struct nnpfs_message_remove *h, u_int size);
-
-static int
-nnpfs_message_rmdir (int fd, struct nnpfs_message_rmdir *h, u_int size);
-
-static int
-nnpfs_message_rename (int fd, struct nnpfs_message_rename *h, u_int size);
-
-static int
-nnpfs_message_pioctl (int fd, struct nnpfs_message_pioctl *h, u_int size) ;
-
-static u_char
-afsrights2nnpfsrights(u_long, uint32_t, uint32_t);
-
-static int
-possibly_have_network(void);
-
-/*
- *
- */
-
-nnpfs_message_function rcvfuncs[] = {
- NULL, /* version */
- (nnpfs_message_function)nnpfs_message_wakeup, /* wakeup */
- (nnpfs_message_function)nnpfs_message_getroot, /* getroot */
- NULL, /* installroot */
- (nnpfs_message_function)nnpfs_message_getnode, /* getnode */
- NULL, /* installnode */
- (nnpfs_message_function)nnpfs_message_getattr, /* getattr */
- NULL, /* installattr */
- (nnpfs_message_function)nnpfs_message_getdata, /* getdata */
- NULL, /* installdata */
- (nnpfs_message_function)nnpfs_message_inactivenode, /* inactivenode */
- NULL, /* invalidnode */
- (nnpfs_message_function)nnpfs_message_open, /* open */
- (nnpfs_message_function)nnpfs_message_putdata, /* put_data */
- (nnpfs_message_function)nnpfs_message_putattr, /* put attr */
- (nnpfs_message_function)nnpfs_message_create, /* create */
- (nnpfs_message_function)nnpfs_message_mkdir, /* mkdir */
- (nnpfs_message_function)nnpfs_message_link, /* link */
- (nnpfs_message_function)nnpfs_message_symlink, /* symlink */
- (nnpfs_message_function)nnpfs_message_remove, /* remove */
- (nnpfs_message_function)nnpfs_message_rmdir, /* rmdir */
- (nnpfs_message_function)nnpfs_message_rename, /* rename */
- (nnpfs_message_function)nnpfs_message_pioctl, /* pioctl */
- NULL, /* wakeup_data */
- NULL, /* updatefid */
- NULL, /* advlock */
- NULL /* gc nodes */
-};
-
-
-/*
- *
- */
-
-long
-afsfid2inode (const VenusFid *fid)
-{
- return ((fid->fid.Volume & 0x7FFF) << 16 | (fid->fid.Vnode & 0xFFFFFFFF));
-}
-
-/*
- * AFSFetchStatus -> nnpfs_attr
- * Setting everything except for length and mode.
- */
-
-static void
-afsstatus2nnpfs_attr (AFSFetchStatus *status,
- const VenusFid *fid,
- struct nnpfs_attr *attr,
- int flags)
-{
- int mode;
-
- attr->valid = XA_V_NONE;
- switch (status->FileType) {
- case TYPE_FILE :
- mode = S_IFREG;
- XA_SET_TYPE(attr, NNPFS_FILE_REG);
- break;
- case TYPE_DIR :
- mode = S_IFDIR;
- XA_SET_TYPE(attr, NNPFS_FILE_DIR);
- break;
- case TYPE_LINK :
- mode = S_IFLNK;
- XA_SET_TYPE(attr, NNPFS_FILE_LNK);
- break;
- default :
- arla_warnx (ADEBMSG, "afsstatus2nnpfs_attr: default");
- abort ();
- }
- XA_SET_NLINK(attr, status->LinkCount);
- if (flags & FCACHE2NNPFSNODE_LENGTH)
- XA_SET_SIZE(attr, status->Length);
- XA_SET_UID(attr,status->Owner);
- XA_SET_GID(attr, status->Group);
- XA_SET_ATIME(attr, status->ClientModTime);
- XA_SET_MTIME(attr, status->ClientModTime);
- XA_SET_CTIME(attr, status->ClientModTime);
- XA_SET_FILEID(attr, afsfid2inode(fid));
-
- /* XXX this is wrong, need to keep track of `our` ae for this req */
- if (fake_stat) {
- u_char rights;
-
- rights = afsrights2nnpfsrights(status->CallerAccess,
- status->FileType,
- status->UnixModeBits);
-
- if (rights & NNPFS_RIGHT_R)
- mode |= 0444;
- if (rights & NNPFS_RIGHT_W)
- mode |= 0222;
- if (rights & NNPFS_RIGHT_X)
- mode |= 0111;
- } else
- mode |= status->UnixModeBits;
-
- XA_SET_MODE(attr, mode);
-}
-
-/*
- * Transform `access', `FileType' and `UnixModeBits' into rights.
- *
- * There are different transformations for directories and files to be
- * compatible with the Transarc client.
- */
-
-static u_char
-afsrights2nnpfsrights(u_long ar, uint32_t FileType, uint32_t UnixModeBits)
-{
- u_char ret = 0;
-
- if (FileType == TYPE_DIR) {
- if (ar & ALIST)
- ret |= NNPFS_RIGHT_R | NNPFS_RIGHT_X;
- if (ar & (AINSERT | ADELETE))
- ret |= NNPFS_RIGHT_W;
- } else {
- if (FileType == TYPE_LINK && (ar & ALIST))
- ret |= NNPFS_RIGHT_R;
- if ((ar & AREAD) && (UnixModeBits & S_IRUSR))
- ret |= NNPFS_RIGHT_R;
- if ((ar & AWRITE) && (UnixModeBits & S_IWUSR))
- ret |= NNPFS_RIGHT_W;
- if ((ar & AREAD) && (UnixModeBits & S_IXUSR))
- ret |= NNPFS_RIGHT_X;
- }
-
- return ret;
-}
-
-void
-fcacheentry2nnpfsnode (const VenusFid *fid,
- const VenusFid *statfid,
- AFSFetchStatus *status,
- struct nnpfs_msg_node *node,
- AccessEntry *ae,
- int flags)
-{
- int i;
-
- memcpy (&node->handle, fid, sizeof(*fid));
-
- afsstatus2nnpfs_attr (status, statfid, &node->attr, flags);
-
- node->anonrights = afsrights2nnpfsrights(status->AnonymousAccess,
- status->FileType,
- status->UnixModeBits);
- for (i = 0; i < NACCESS; i++) {
- node->id[i] = ae[i].cred;
- node->rights[i] = afsrights2nnpfsrights(ae[i].access,
- status->FileType,
- status->UnixModeBits);
- }
-}
-
-/*
- * convert `xa' into `storestatus'
- */
-
-int
-nnpfs_attr2afsstorestatus(struct nnpfs_attr *xa,
- AFSStoreStatus *storestatus)
-{
- int mask = 0;
-
- if (XA_VALID_MODE(xa)) {
- storestatus->UnixModeBits = xa->xa_mode;
- mask |= SS_MODEBITS;
- }
- if (XA_VALID_UID(xa)) {
- storestatus->Owner = xa->xa_uid;
- mask |= SS_OWNER;
- }
- if (XA_VALID_GID(xa)) {
- storestatus->Group = xa->xa_gid;
- mask |= SS_GROUP;
- }
- if (XA_VALID_MTIME(xa)) {
- storestatus->ClientModTime = xa->xa_mtime;
- mask |= SS_MODTIME;
- }
- storestatus->Mask = mask;
-
- /* SS_SegSize */
- storestatus->SegSize = 0;
- return 0;
-}
-
-/*
- * Return true iff we should retry the operation.
- * Also replace `ce' with anonymous creds in case it has expired.
- *
- * There must not be passed in any NULL pointers.
- */
-
-static int
-try_again (int *ret, CredCacheEntry **ce, nnpfs_cred *cred, const VenusFid *fid)
-{
- switch (*ret) {
-#ifdef KERBEROS
- case RXKADEXPIRED :
- case RXKADBADTICKET:
- case RXKADBADKEY:
- case RXKADUNKNOWNKEY: {
- int32_t cell = (*ce)->cell;
-
- conn_clearcred (CONN_CS_CRED|CONN_CS_SECIDX, 0, cred->pag, 2);
- cred_expire (*ce);
- cred_free (*ce);
- *ce = cred_get (cell, cred->pag, CRED_ANY);
- if (ce == NULL) {
- arla_warnx (ADEBMISC, "cred_get failed");
- return FALSE;
- }
- return TRUE;
- }
- case RXKADSEALEDINCON :
- arla_warnx_with_fid (ADEBWARN, fid,
- "seal error");
- *ret = EINVAL;
- return FALSE;
-#endif
- case ARLA_VSALVAGE :
- *ret = EIO;
- return FALSE;
- case ARLA_VNOVNODE :
- *ret = ENOENT;
- return FALSE;
- case ARLA_VMOVED :
- case ARLA_VNOVOL :
- if (fid && !volcache_reliablep (fid->fid.Volume, fid->Cell)) {
- return TRUE;
- } else {
- *ret = ENOENT;
- return FALSE;
- }
- case ARLA_VOFFLINE :
- *ret = ENETDOWN;
- return FALSE;
- case ARLA_VDISKFULL :
- *ret = ENOSPC;
- return FALSE;
- case ARLA_VOVERQUOTA:
-#ifdef EDQUOT
- *ret = EDQUOT;
-#else
- *ret = ENOSPC;
-#endif
- return FALSE;
- case ARLA_VBUSY :
- arla_warnx_with_fid (ADEBWARN, fid,
- "Waiting for busy volume...");
- IOMGR_Sleep (afs_BusyWaitPeriod);
- return TRUE;
- case ARLA_VRESTARTING:
- arla_warnx_with_fid (ADEBWARN, fid,
- "Waiting for fileserver to restart...");
- IOMGR_Sleep (afs_BusyWaitPeriod);
- return TRUE;
- case ARLA_VIO :
- *ret = EIO;
- return FALSE;
- default :
- return FALSE;
- }
-}
-
-/*
- * Fetch data and retry if failing
- */
-
-static int
-message_get_data (FCacheEntry **entry,
- struct nnpfs_cred *cred,
- CredCacheEntry **ce,
- size_t wanted_length)
-{
- int ret;
- do {
- ret = fcache_get_data (entry, ce, wanted_length);
- } while (try_again (&ret, ce, cred, &(*entry)->fid));
- return ret;
-}
-
-/*
- *
- */
-
-static int
-nnpfs_message_getroot (int fd, struct nnpfs_message_getroot *h, u_int size)
-{
- struct nnpfs_message_installroot msg;
- int ret = 0;
- VenusFid root_fid;
- CredCacheEntry *ce;
- AccessEntry *ae;
- FCacheEntry *entry = NULL;
- struct nnpfs_message_header *h0 = NULL;
- size_t h0_len = 0;
- int32_t cell_id = cell_name2num(cell_getthiscell());
-
- ce = cred_get (cell_id, h->cred.pag, CRED_ANY);
- if (ce == NULL) {
- arla_warnx (ADEBMISC, "cred_get failed");
- ret = -1;
- goto out;
- }
- do {
- ret = getroot (&root_fid, ce);
- } while (try_again (&ret, &ce, &h->cred, &root_fid));
-
- if (ret)
- goto out;
-
- ret = fcache_get(&entry, root_fid, ce);
- if (ret)
- goto out;
-
- do {
- ret = cm_getattr(entry, ce, &ae);
- } while (try_again (&ret, &ce, &h->cred, &root_fid));
-
- if (ret == 0) {
- fcacheentry2nnpfsnode (&root_fid, fcache_realfid(entry),
- &entry->status, &msg.node, ae,
- FCACHE2NNPFSNODE_ALL);
-
- entry->tokens |= NNPFS_ATTR_R;
- msg.node.tokens = entry->tokens & ~NNPFS_DATA_MASK;
- msg.header.opcode = NNPFS_MSG_INSTALLROOT;
- h0 = (struct nnpfs_message_header *)&msg;
- h0_len = sizeof(msg);
- }
-
- out:
- nnpfs_send_message_wakeup_multiple (fd,
- h->header.sequence_num,
- ret,
- h0, h0_len,
- NULL, 0);
- if (entry)
- fcache_release(entry);
- cred_free (ce);
-
- return 0;
-}
-
-static int
-nnpfs_message_getnode (int fd, struct nnpfs_message_getnode *h, u_int size)
-{
- struct nnpfs_message_installnode msg;
- VenusFid *dirfid = (VenusFid *)&h->parent_handle;
- VenusFid fid;
- VenusFid real_fid;
- AFSFetchStatus status;
- CredCacheEntry *ce;
- AccessEntry *ae;
- FCacheEntry *entry = NULL;
- FCacheEntry *dentry = NULL;
- struct nnpfs_message_header *h0 = NULL;
- size_t h0_len = 0;
- int ret;
-
- arla_warnx (ADEBMSG, "getnode (%ld.%lu.%lu.%lu) \"%s\"",
- (long)dirfid->Cell, (unsigned long)dirfid->fid.Volume,
- (unsigned long)dirfid->fid.Vnode,
- (unsigned long)dirfid->fid.Unique, h->name);
-
- ce = cred_get (dirfid->Cell, h->cred.pag, CRED_ANY);
- if (ce == NULL) {
- arla_warnx (ADEBMISC, "cred_get failed");
- ret = -1;
- goto out;
- }
- ret = fcache_get(&dentry, *dirfid, ce);
- if (ret)
- goto out;
-
- assert_flag(dentry,kernelp);
-
- do {
- ret = cm_lookup (&dentry, h->name, &fid, &ce, TRUE);
- *dirfid = dentry->fid;
- } while (try_again (&ret, &ce, &h->cred, dirfid));
-
- if (ret)
- goto out;
-
- fcache_release(dentry);
- dentry = NULL;
-
- ret = fcache_get(&entry, fid, ce);
- if (ret)
- goto out;
-
- do {
- ret = cm_getattr (entry, ce, &ae);
- status = entry->status;
- real_fid = *fcache_realfid(entry);
- } while (try_again (&ret, &ce, &h->cred, &fid));
-
- if (ret == 0) {
- fcacheentry2nnpfsnode (&fid, &real_fid, &status, &msg.node, ae,
- FCACHE2NNPFSNODE_ALL);
-
- entry->tokens |= NNPFS_ATTR_R;
- msg.node.tokens = entry->tokens & ~NNPFS_DATA_MASK;
- msg.parent_handle = h->parent_handle;
- strlcpy (msg.name, h->name, sizeof(msg.name));
-
- msg.header.opcode = NNPFS_MSG_INSTALLNODE;
- h0 = (struct nnpfs_message_header *)&msg;
- h0_len = sizeof(msg);
- }
- out:
- nnpfs_send_message_wakeup_multiple (fd,
- h->header.sequence_num,
- ret,
- h0, h0_len,
- NULL, 0);
- if (entry)
- fcache_release(entry);
- if (dentry)
- fcache_release(dentry);
- cred_free (ce);
-
- return 0;
-}
-
-static int
-nnpfs_message_getattr (int fd, struct nnpfs_message_getattr *h, u_int size)
-{
- struct nnpfs_message_installattr msg;
- VenusFid fid;
- CredCacheEntry *ce;
- AccessEntry *ae;
- FCacheEntry *entry = NULL;
- struct nnpfs_message_header *h0 = NULL;
- size_t h0_len = 0;
- int ret;
-
- fid = *(VenusFid *)&h->handle;
- arla_warnx (ADEBMSG, "getattr (%ld.%lu.%lu.%lu)",
- (long)fid.Cell, (unsigned long)fid.fid.Volume,
- (unsigned long)fid.fid.Vnode,
- (unsigned long)fid.fid.Unique);
- ce = cred_get (fid.Cell, h->cred.pag, CRED_ANY);
- if (ce == NULL) {
- arla_warnx (ADEBMISC, "cred_get failed");
- ret = -1;
- goto out;
- }
-
- ret = fcache_get(&entry, fid, ce);
- if (ret)
- goto out;
-
- assert_flag(entry,kernelp);
-
- do {
- ret = cm_getattr (entry, ce, &ae);
- } while (try_again (&ret, &ce, &h->cred, &fid));
-
- if (ret)
- goto out;
-
- fcacheentry2nnpfsnode (&fid, fcache_realfid(entry),
- &entry->status, &msg.node, ae,
- FCACHE2NNPFSNODE_ALL);
-
- entry->tokens |= NNPFS_ATTR_R;
- msg.node.tokens = entry->tokens;
- msg.header.opcode = NNPFS_MSG_INSTALLATTR;
- h0 = (struct nnpfs_message_header *)&msg;
- h0_len = sizeof(msg);
-
- out:
- nnpfs_send_message_wakeup_multiple (fd,
- h->header.sequence_num,
- ret,
- h0, h0_len,
- NULL, 0);
- if (entry)
- fcache_release(entry);
- cred_free (ce);
-
- return 0;
-}
-
-static int
-nnpfs_message_putattr (int fd, struct nnpfs_message_putattr *h, u_int size)
-{
- struct nnpfs_message_installattr msg;
- VenusFid fid;
- AFSStoreStatus status;
- CredCacheEntry *ce;
- AccessEntry *ae;
- struct nnpfs_message_header *h0 = NULL;
- size_t h0_len = 0;
- int ret;
-
- FCacheEntry *entry = NULL;
-
- fid = *(VenusFid *)&h->handle;
- arla_warnx (ADEBMSG, "putattr (%ld.%lu.%lu.%lu)",
- (long)fid.Cell, (unsigned long)fid.fid.Volume,
- (unsigned long)fid.fid.Vnode,
- (unsigned long)fid.fid.Unique);
- nnpfs_attr2afsstorestatus(&h->attr, &status);
- ce = cred_get (fid.Cell, h->cred.pag, CRED_ANY);
- if (ce == NULL) {
- arla_warnx (ADEBMISC, "cred_get failed");
- ret = -1;
- goto out;
- }
-
- if (connected_mode != CONNECTED) {
- ret = fcache_find (&entry, fid);
- if (ret) {
- ret = ENETDOWN;
- goto out;
- }
- } else {
- ret = fcache_get(&entry, fid, ce);
- if (ret)
- goto out;
- }
-
- assert_flag(entry,kernelp);
-
- /*
- * We can't bits update at the same time as same time as we store
- * data since then fileserver will hate us with we are part of
- * system:administrators. This was fixed in openafs-1.2.7
- */
-
- if (XA_VALID_SIZE(&h->attr)) {
- AFSStoreStatus null_status;
- memset(&null_status, 0, sizeof(null_status));
- do {
- ret = cm_ftruncate (entry, h->attr.xa_size, &status, ce);
- } while (try_again (&ret, &ce, &h->cred, &fid));
- }
-
- if (ret)
- goto out;
-
- if (status.Mask) {
- do {
- ret = cm_setattr(entry, &status, ce);
- } while (try_again (&ret, &ce, &h->cred, &fid));
- }
-
- if (ret)
- goto out;
-
- do {
- ret = cm_getattr (entry, ce, &ae);
- } while (try_again (&ret, &ce, &h->cred, &fid));
-
-
- if (ret)
- goto out;
-
- fcacheentry2nnpfsnode (&fid, fcache_realfid(entry),
- &entry->status, &msg.node, ae,
- FCACHE2NNPFSNODE_ALL);
-
- entry->tokens |= NNPFS_ATTR_R;
- msg.node.tokens = entry->tokens;
- msg.header.opcode = NNPFS_MSG_INSTALLATTR;
- h0 = (struct nnpfs_message_header *)&msg;
- h0_len = sizeof(msg);
-
- if (ret)
- goto out;
-
- if (connected_mode != CONNECTED)
- entry->disco_id = disco_store_status(&fid, &status, entry->disco_id);
-
- out:
- nnpfs_send_message_wakeup_multiple (fd,
- h->header.sequence_num,
- ret,
- h0, h0_len,
- NULL, 0);
- if (entry)
- fcache_release(entry);
- cred_free (ce);
-
- return 0;
-}
-
-static int
-nnpfs_message_create (int fd, struct nnpfs_message_create *h, u_int size)
-{
- VenusFid parent_fid, child_fid;
- AFSStoreStatus store_status;
- AFSFetchStatus fetch_status;
- CredCacheEntry *ce;
- int ret;
- struct nnpfs_message_installdata msg1;
- struct nnpfs_message_installnode msg2;
- struct nnpfs_message_installdata msg3;
- struct nnpfs_message_header *h0 = NULL;
- size_t h0_len = 0;
- struct nnpfs_message_header *h1 = NULL;
- size_t h1_len = 0;
- struct nnpfs_message_header *h2 = NULL;
- size_t h2_len = 0;
- FCacheEntry *dir_entry = NULL;
- FCacheEntry *child_entry = NULL;
- fcache_cache_handle cache_handle;
-
- parent_fid = *(VenusFid *)&h->parent_handle;
- arla_warnx (ADEBMSG, "create (%ld.%lu.%lu.%lu) \"%s\"",
- (long)parent_fid.Cell,
- (unsigned long)parent_fid.fid.Volume,
- (unsigned long)parent_fid.fid.Vnode,
- (unsigned long)parent_fid.fid.Unique, h->name);
-
- nnpfs_attr2afsstorestatus(&h->attr, &store_status);
- if (connected_mode != CONNECTED) {
- if (!(store_status.Mask & SS_OWNER)) {
- store_status.Owner = h->cred.uid;
- store_status.Mask |= SS_OWNER;
- }
- if (!(store_status.Mask & SS_GROUP)) {
- store_status.Group = 0;
- store_status.Mask |= SS_GROUP;
- }
- if (!(store_status.Mask & SS_MODTIME)) {
- struct timeval now;
-
- gettimeofday (&now, NULL);
-
- store_status.ClientModTime = now.tv_sec;
- store_status.Mask |= SS_MODTIME;
- }
- }
- ce = cred_get (parent_fid.Cell, h->cred.pag, CRED_ANY);
- if (ce == NULL) {
- arla_warnx (ADEBMISC, "cred_get failed");
- ret = -1;
- goto out;
- }
-
- ret = fcache_get(&dir_entry, parent_fid, ce);
- if (ret)
- goto out;
-
- assert_flag(dir_entry,kernelp);
-
- do {
- ret = cm_create(&dir_entry, h->name, &store_status,
- &child_fid, &fetch_status, &ce);
- } while (try_again (&ret, &ce, &h->cred, &dir_entry->fid));
-
- if (ret)
- goto out;
-
- ret = message_get_data (&dir_entry, &h->cred, &ce, 0);
- if (ret)
- goto out;
-
- ret = conv_dir (dir_entry, ce, 0,
- &cache_handle,
- msg1.cache_name,
- sizeof(msg1.cache_name));
- if (ret)
- goto out;
-
- msg1.cache_handle = cache_handle.nnpfs_handle;
- msg1.flag = 0;
- if (cache_handle.valid)
- msg1.flag |= NNPFS_ID_HANDLE_VALID;
-
- dir_entry->tokens |= NNPFS_ATTR_R;
- msg1.node.tokens = dir_entry->tokens;
-
- fcacheentry2nnpfsnode (&dir_entry->fid,
- fcache_realfid(dir_entry),
- &dir_entry->status,
- &msg1.node,
- dir_entry->acccache,
- FCACHE2NNPFSNODE_ALL);
-
- ret = fcache_get(&child_entry, child_fid, ce);
- if (ret)
- goto out;
- /* XXX remove this, we don't want to fetch data from the fileserver */
- ret = message_get_data (&child_entry, &h->cred, &ce, 0);
- if (ret) {
- fcache_release(child_entry);
- goto out;
- }
- child_fid = child_entry->fid;
-
- msg3.cache_handle = child_entry->handle.nnpfs_handle;
- fcache_conv_file_name (child_entry,
- msg3.cache_name, sizeof(msg3.cache_name));
- msg3.flag = 0;
- if (cache_handle.valid)
- msg3.flag |= NNPFS_ID_HANDLE_VALID;
-
- child_entry->flags.kernelp = TRUE;
- child_entry->flags.attrusedp = TRUE;
- child_entry->flags.datausedp = TRUE;
- assert_flag(dir_entry,kernelp);
- assert_flag(dir_entry,attrusedp);
- dir_entry->flags.datausedp = TRUE;
-
- msg1.offset = child_entry->fetched_length;
- msg1.header.opcode = NNPFS_MSG_INSTALLDATA;
- h0 = (struct nnpfs_message_header *)&msg1;
- h0_len = sizeof(msg1);
-
- fcacheentry2nnpfsnode (&child_fid, &child_fid,
- &fetch_status, &msg2.node, dir_entry->acccache,
- FCACHE2NNPFSNODE_ALL);
-
- child_entry->tokens |= NNPFS_ATTR_R | NNPFS_DATA_R | NNPFS_DATA_W;
- msg2.node.tokens = child_entry->tokens & ~(NNPFS_DATA_MASK);
- msg2.parent_handle = h->parent_handle;
- strlcpy (msg2.name, h->name, sizeof(msg2.name));
-
- msg2.header.opcode = NNPFS_MSG_INSTALLNODE;
- h1 = (struct nnpfs_message_header *)&msg2;
- h1_len = sizeof(msg2);
-
- msg3.node = msg2.node;
- msg3.node.tokens = child_entry->tokens;
- msg3.offset = child_entry->fetched_length;
- msg3.header.opcode = NNPFS_MSG_INSTALLDATA;
-
- h2 = (struct nnpfs_message_header *)&msg3;
- h2_len = sizeof(msg3);
-
- if (connected_mode != CONNECTED)
- child_entry->disco_id = disco_create_file(&parent_fid, &child_fid,
- h->name, &store_status);
-
- out:
- nnpfs_send_message_wakeup_multiple (fd,
- h->header.sequence_num,
- ret,
- h0, h0_len,
- h1, h1_len,
- h2, h2_len,
- NULL, 0);
- if (dir_entry)
- fcache_release(dir_entry);
- if (child_entry)
- fcache_release(child_entry);
- cred_free (ce);
-
- return ret;
-}
-
-static int
-nnpfs_message_mkdir (int fd, struct nnpfs_message_mkdir *h, u_int size)
-{
- VenusFid parent_fid, child_fid;
- AFSStoreStatus store_status;
- AFSFetchStatus fetch_status;
- CredCacheEntry *ce;
- int ret;
- struct nnpfs_message_installdata msg1;
- struct nnpfs_message_installnode msg2;
- struct nnpfs_message_installdata msg3;
- FCacheEntry *dir_entry = NULL;
- FCacheEntry *child_entry = NULL;
-
- struct nnpfs_message_header *h0 = NULL;
- size_t h0_len = 0;
- struct nnpfs_message_header *h1 = NULL;
- size_t h1_len = 0;
- struct nnpfs_message_header *h2 = NULL;
- size_t h2_len = 0;
- fcache_cache_handle cache_handle;
-
-#if 0
- parent_fid = *fid_translate((VenusFid *)&h->parent_handle);
-#else
- parent_fid = *(VenusFid *)&h->parent_handle;
-#endif
- arla_warnx (ADEBMSG, "mkdir (%ld.%lu.%lu.%lu) \"%s\"",
- (long)parent_fid.Cell, (unsigned long)parent_fid.fid.Volume,
- (unsigned long)parent_fid.fid.Vnode,
- (unsigned long)parent_fid.fid.Unique, h->name);
-
- ce = cred_get (parent_fid.Cell, h->cred.pag, CRED_ANY);
- if (ce == NULL) {
- arla_warnx (ADEBMISC, "cred_get failed");
- ret = -1;
- goto out;
- }
-
- nnpfs_attr2afsstorestatus(&h->attr, &store_status);
- if (connected_mode != CONNECTED) {
- if (!(store_status.Mask & SS_OWNER)) {
- store_status.Owner = h->cred.uid;
- store_status.Mask |= SS_OWNER;
- }
- if (!(store_status.Mask & SS_MODTIME)) {
- struct timeval now;
-
- gettimeofday (&now, NULL);
-
- store_status.ClientModTime = now.tv_sec;
- store_status.Mask |= SS_MODTIME;
- }
- }
-
- ret = fcache_get(&dir_entry, parent_fid, ce);
- if (ret)
- goto out;
-
- assert_flag(dir_entry,kernelp);
-
- do {
- ret = cm_mkdir(&dir_entry, h->name, &store_status,
- &child_fid, &fetch_status, &ce);
- } while(try_again (&ret, &ce, &h->cred, &dir_entry->fid));
-
- if (ret)
- goto out;
-
- ret = message_get_data (&dir_entry, &h->cred, &ce, 0);
- if (ret)
- goto out;
-
- ret = conv_dir (dir_entry, ce, 0,
- &cache_handle,
- msg1.cache_name,
- sizeof(msg1.cache_name));
- if (ret)
- goto out;
-
- msg1.cache_handle = cache_handle.nnpfs_handle;
- msg1.flag = 0;
- if (cache_handle.valid)
- msg1.flag |= NNPFS_ID_HANDLE_VALID;
- dir_entry->tokens |= NNPFS_ATTR_R;
- msg1.node.tokens = dir_entry->tokens;
-
- fcacheentry2nnpfsnode (&dir_entry->fid,
- fcache_realfid(dir_entry),
- &dir_entry->status, &msg1.node,
- dir_entry->acccache,
- FCACHE2NNPFSNODE_ALL);
-
- msg1.offset = dir_entry->fetched_length;
- msg1.header.opcode = NNPFS_MSG_INSTALLDATA;
- h0 = (struct nnpfs_message_header *)&msg1;
- h0_len = sizeof(msg1);
-
- ret = fcache_get(&child_entry, child_fid, ce);
- if (ret)
- goto out;
- ret = message_get_data (&child_entry, &h->cred, &ce, 0);
- if (ret)
- goto out;
-
- child_fid = child_entry->fid;
-
- ret = conv_dir (child_entry, ce, 0,
- &cache_handle,
- msg3.cache_name,
- sizeof(msg3.cache_name));
- if (ret)
- goto out;
-
- msg3.cache_handle = cache_handle.nnpfs_handle;
- msg3.flag = 0;
- if (cache_handle.valid)
- msg3.flag |= NNPFS_ID_HANDLE_VALID;
-
- assert_flag(child_entry,kernelp);
- child_entry->flags.attrusedp = TRUE;
- child_entry->flags.datausedp = TRUE;
- assert_flag(dir_entry,kernelp);
- assert_flag(dir_entry,attrusedp);
- dir_entry->flags.datausedp = TRUE;
-
- child_entry->tokens |= NNPFS_ATTR_R;
- msg2.node.tokens = child_entry->tokens & ~(NNPFS_DATA_MASK);
-
- fcacheentry2nnpfsnode (&child_fid, &child_fid,
- &child_entry->status, &msg2.node,
- dir_entry->acccache,
- FCACHE2NNPFSNODE_ALL);
-
- msg2.parent_handle = h->parent_handle;
- strlcpy (msg2.name, h->name, sizeof(msg2.name));
-
- msg2.header.opcode = NNPFS_MSG_INSTALLNODE;
- h1 = (struct nnpfs_message_header *)&msg2;
- h1_len = sizeof(msg2);
-
- msg3.header.opcode = NNPFS_MSG_INSTALLDATA;
- msg3.offset = child_entry->fetched_length;
- msg3.node = msg2.node;
- msg3.node.tokens = child_entry->tokens;
- h2 = (struct nnpfs_message_header *)&msg3;
- h2_len = sizeof(msg3);
-
- if (connected_mode != CONNECTED)
- child_entry->disco_id = disco_create_dir(&parent_fid, &child_fid,
- h->name, &store_status);
-
- out:
- nnpfs_send_message_wakeup_multiple (fd,
- h->header.sequence_num,
- ret,
- h0, h0_len,
- h1, h1_len,
- h2, h2_len,
- NULL, 0);
- if (child_entry)
- fcache_release(child_entry);
- if (dir_entry)
- fcache_release(dir_entry);
- cred_free (ce);
-
- return ret;
-}
-
-static int
-nnpfs_message_link (int fd, struct nnpfs_message_link *h, u_int size)
-{
- VenusFid parent_fid, existing_fid;
- AFSFetchStatus fetch_status;
- CredCacheEntry *ce;
- int ret;
- struct nnpfs_message_installdata msg1;
- struct nnpfs_message_installnode msg2;
- struct nnpfs_message_header *h0 = NULL;
- size_t h0_len = 0;
- struct nnpfs_message_header *h1 = NULL;
- size_t h1_len = 0;
- fcache_cache_handle cache_handle;
- FCacheEntry *dir_entry = NULL;
-
- parent_fid = *(VenusFid *)&h->parent_handle;
- existing_fid = *(VenusFid *)&h->from_handle;
- arla_warnx (ADEBMSG, "link (%ld.%lu.%lu.%lu) (%ld.%lu.%lu.%lu) \"%s\"",
- (long)parent_fid.Cell, (unsigned long)parent_fid.fid.Volume,
- (unsigned long)parent_fid.fid.Vnode,
- (unsigned long)parent_fid.fid.Unique,
- (long)existing_fid.Cell,
- (unsigned long)existing_fid.fid.Volume,
- (unsigned long)existing_fid.fid.Vnode,
- (unsigned long)existing_fid.fid.Unique,
- h->name);
-
- ce = cred_get (parent_fid.Cell, h->cred.pag, CRED_ANY);
- if (ce == NULL) {
- arla_warnx (ADEBMISC, "cred_get failed");
- ret = -1;
- goto out;
- }
-
- ret = fcache_get(&dir_entry, parent_fid, ce);
- if (ret)
- goto out;
-
- assert_flag(dir_entry,kernelp);
-
- do {
- ret = cm_link (&dir_entry, h->name, existing_fid,
- &fetch_status, &ce);
- } while (try_again (&ret, &ce, &h->cred, &dir_entry->fid));
-
- if (ret)
- goto out;
-
- ret = message_get_data (&dir_entry, &h->cred, &ce, 0);
- if (ret)
- goto out;
-
- ret = conv_dir (dir_entry, ce, 0,
- &cache_handle,
- msg1.cache_name,
- sizeof(msg1.cache_name));
- if (ret == -1)
- goto out;
-
- msg1.cache_handle = cache_handle.nnpfs_handle;
- msg1.flag = 0;
- if (cache_handle.valid)
- msg1.flag |= NNPFS_ID_HANDLE_VALID;
- dir_entry->tokens |= NNPFS_ATTR_R;
- msg1.node.tokens = dir_entry->tokens;
- assert_flag(dir_entry,kernelp);
- assert_flag(dir_entry,attrusedp);
- dir_entry->flags.datausedp = TRUE;
-
- fcacheentry2nnpfsnode (&dir_entry->fid,
- fcache_realfid(dir_entry),
- &dir_entry->status, &msg1.node,
- dir_entry->acccache,
- FCACHE2NNPFSNODE_ALL);
-
- msg1.offset = dir_entry->fetched_length;
- msg1.header.opcode = NNPFS_MSG_INSTALLDATA;
- h0 = (struct nnpfs_message_header *)&msg1;
- h0_len = sizeof(msg1);
-
- fcacheentry2nnpfsnode (&existing_fid, &existing_fid,
- &fetch_status, &msg2.node,
- dir_entry->acccache,
- FCACHE2NNPFSNODE_ALL);
-
- msg2.node.tokens = NNPFS_ATTR_R; /* XXX */
- msg2.parent_handle = h->parent_handle;
- strlcpy (msg2.name, h->name, sizeof(msg2.name));
-
- msg2.header.opcode = NNPFS_MSG_INSTALLNODE;
- h1 = (struct nnpfs_message_header *)&msg2;
- h1_len = sizeof(msg2);
-
- out:
- nnpfs_send_message_wakeup_multiple (fd,
- h->header.sequence_num,
- ret,
- h0, h0_len,
- h1, h1_len,
- NULL, 0);
- if (dir_entry)
- fcache_release(dir_entry);
- cred_free (ce);
-
- return ret;
-}
-
-static int
-nnpfs_message_symlink (int fd, struct nnpfs_message_symlink *h, u_int size)
-{
- VenusFid parent_fid, child_fid, real_fid;
- AFSStoreStatus store_status;
- AFSFetchStatus fetch_status;
- CredCacheEntry *ce;
- int ret;
- struct nnpfs_message_installdata msg1;
- struct nnpfs_message_installnode msg2;
- struct nnpfs_message_header *h0 = NULL;
- size_t h0_len = 0;
- struct nnpfs_message_header *h1 = NULL;
- size_t h1_len = 0;
- fcache_cache_handle cache_handle;
- FCacheEntry *dir_entry = NULL;
-
- parent_fid = *(VenusFid *)&h->parent_handle;
- arla_warnx (ADEBMSG, "symlink (%ld.%lu.%lu.%lu) \"%s\"",
- (long)parent_fid.Cell, (unsigned long)parent_fid.fid.Volume,
- (unsigned long)parent_fid.fid.Vnode,
- (unsigned long)parent_fid.fid.Unique, h->name);
-
- ce = cred_get (parent_fid.Cell, h->cred.pag, CRED_ANY);
- if (ce == NULL) {
- arla_warnx (ADEBMISC, "cred_get failed");
- ret = -1;
- goto out;
- }
-
- nnpfs_attr2afsstorestatus(&h->attr, &store_status);
-
- ret = fcache_get(&dir_entry, parent_fid, ce);
- if (ret)
- goto out;
-
- assert_flag(dir_entry,kernelp);
-
- do {
- ret = cm_symlink(&dir_entry, h->name, &store_status,
- &child_fid, &real_fid,
- &fetch_status,
- h->contents, &ce);
- } while (try_again (&ret, &ce, &h->cred, &dir_entry->fid));
-
- cred_free (ce);
- ce = cred_get (dir_entry->fid.Cell, h->cred.pag, CRED_ANY);
- if (ce == NULL) {
- arla_warnx (ADEBMISC, "cred_get failed");
- ret = -1;
- goto out;
- }
-
- if (ret)
- goto out;
-
- ret = message_get_data (&dir_entry, &h->cred, &ce, 0);
- if (ret)
- goto out;
-
- ret = conv_dir (dir_entry, ce, 0,
- &cache_handle,
- msg1.cache_name,
- sizeof(msg1.cache_name));
- if (ret)
- goto out;
-
- msg1.cache_handle = cache_handle.nnpfs_handle;
- msg1.flag = 0;
- if (cache_handle.valid)
- msg1.flag |= NNPFS_ID_HANDLE_VALID;
- dir_entry->tokens |= NNPFS_ATTR_R;
- msg1.node.tokens = dir_entry->tokens;
- assert_flag(dir_entry,kernelp);
- assert_flag(dir_entry,attrusedp);
- dir_entry->flags.datausedp = TRUE;
-
- fcacheentry2nnpfsnode (&dir_entry->fid,
- fcache_realfid(dir_entry),
- &dir_entry->status, &msg1.node,
- dir_entry->acccache,
- FCACHE2NNPFSNODE_ALL);
-
- msg1.offset = dir_entry->fetched_length;
- msg1.header.opcode = NNPFS_MSG_INSTALLDATA;
- h0 = (struct nnpfs_message_header *)&msg1;
- h0_len = sizeof(msg1);
-
- fcacheentry2nnpfsnode (&child_fid, &real_fid,
- &fetch_status, &msg2.node,
- dir_entry->acccache,
- FCACHE2NNPFSNODE_ALL);
-
- msg2.node.tokens = NNPFS_ATTR_R; /* XXX */
- msg2.parent_handle = h->parent_handle;
- strlcpy (msg2.name, h->name, sizeof(msg2.name));
-
- msg2.header.opcode = NNPFS_MSG_INSTALLNODE;
- h1 = (struct nnpfs_message_header *)&msg2;
- h1_len = sizeof(msg2);
-
- out:
- nnpfs_send_message_wakeup_multiple (fd,
- h->header.sequence_num,
- ret,
- h0, h0_len,
- h1, h1_len,
- NULL, 0);
- if (dir_entry)
- fcache_release(dir_entry);
- cred_free (ce);
-
- return ret;
-}
-
-/*
- * Handle the NNPFS remove message in `h', that is, remove name
- * `h->name' in directory `h->parent' with the creds from `h->cred'.
- */
-
-static int
-nnpfs_message_remove (int fd, struct nnpfs_message_remove *h, u_int size)
-{
- VenusFid parent_fid;
- VenusFid fid;
- CredCacheEntry *ce;
- int ret;
- struct nnpfs_message_installdata msg1;
- struct nnpfs_message_installattr msg2;
- struct nnpfs_message_header *h0 = NULL;
- size_t h0_len = 0;
- struct nnpfs_message_header *h1 = NULL;
- size_t h1_len = 0;
- FCacheEntry *limbo_entry = NULL;
- unsigned link_count;
- FCacheEntry *dir_entry = NULL;
- AFSFetchStatus limbo_status;
- fcache_cache_handle cache_handle;
-
- parent_fid = *(VenusFid *)&h->parent_handle;
- arla_warnx (ADEBMSG, "remove (%ld.%lu.%lu.%lu) \"%s\"",
- (long)parent_fid.Cell, (unsigned long)parent_fid.fid.Volume,
- (unsigned long)parent_fid.fid.Vnode,
- (unsigned long)parent_fid.fid.Unique, h->name);
-
- ce = cred_get (parent_fid.Cell, h->cred.pag, CRED_ANY);
- if (ce == NULL) {
- arla_warnx (ADEBMISC, "cred_get failed");
- ret = -1;
- goto out;
- }
-
- ret = fcache_get(&dir_entry, parent_fid, ce);
- if (ret)
- goto out;
-
- assert_flag(dir_entry,kernelp);
-
- do {
- ret = cm_lookup (&dir_entry, h->name, &fid, &ce, FALSE);
- } while (try_again (&ret, &ce, &h->cred, &dir_entry->fid));
-
- if (ret)
- goto out;
-
- /*
- * Fetch the linkcount of the to be removed node
- */
-
- ret = fcache_get (&limbo_entry, fid, ce);
- if (ret)
- goto out;
-
- ret = fcache_verify_attr (limbo_entry, dir_entry, h->name, ce);
- if (ret)
- goto out;
- limbo_status = limbo_entry->status;
- link_count = limbo_status.LinkCount;
-
- fcache_release (limbo_entry);
- limbo_entry = NULL;
-
- /*
- * Do the actual work
- */
-
- do {
- ret = cm_remove(&dir_entry, h->name, &ce);
- } while (try_again (&ret, &ce, &h->cred, &dir_entry->fid));
-
- if (ret)
- goto out;
-
- ret = message_get_data (&dir_entry, &h->cred, &ce, 0);
- if (ret)
- goto out;
-
- if (!dir_entry->flags.extradirp
- || dir_remove_name (dir_entry, h->name,
- &cache_handle,
- msg1.cache_name,
- sizeof(msg1.cache_name))) {
- ret = conv_dir (dir_entry, ce, 0,
- &cache_handle,
- msg1.cache_name,
- sizeof(msg1.cache_name));
- if (ret)
- goto out;
- }
- msg1.cache_handle = cache_handle.nnpfs_handle;
- msg1.flag = NNPFS_ID_INVALID_DNLC;
- if (cache_handle.valid)
- msg1.flag |= NNPFS_ID_HANDLE_VALID;
- dir_entry->tokens |= NNPFS_ATTR_R;
- msg1.node.tokens = dir_entry->tokens | NNPFS_DATA_R;
-
- fcacheentry2nnpfsnode (&dir_entry->fid,
- fcache_realfid(dir_entry),
- &dir_entry->status, &msg1.node,
- dir_entry->acccache,
- FCACHE2NNPFSNODE_ALL);
-
- msg1.offset = dir_entry->fetched_length;
- msg1.header.opcode = NNPFS_MSG_INSTALLDATA;
- h0 = (struct nnpfs_message_header *)&msg1;
- h0_len = sizeof(msg1);
-
- /*
- * Set datausedp since we push data to kernel in out:
- */
-
- dir_entry->flags.datausedp = TRUE;
-
- /*
- * Make sure that if the removed node is in the kernel it has the
- * right linkcount since some might hold a reference to it.
- */
-
- ret = fcache_get (&limbo_entry, fid, ce);
- if (ret)
- goto out;
-
- if (limbo_entry->flags.kernelp) {
- /*
- * Now insert the limbo entry to get right linkcount
- */
-
- ret = fcache_verify_attr (limbo_entry, dir_entry, NULL, ce);
- if (ret == 0)
- limbo_status = limbo_entry->status;
- ret = 0;
-
- /* Only a silly rename when this is the last file */
- if (link_count == 1)
- limbo_entry->flags.silly = TRUE;
-
- msg2.header.opcode = NNPFS_MSG_INSTALLATTR;
- limbo_entry->tokens |= NNPFS_ATTR_R;
- msg2.node.tokens = limbo_entry->tokens;
- if (!limbo_entry->flags.datausedp)
- msg2.node.tokens &= ~NNPFS_DATA_MASK;
-
- if (link_count == 1 && limbo_status.LinkCount == 1)
- --limbo_status.LinkCount;
- fcacheentry2nnpfsnode (&fid,
- fcache_realfid(limbo_entry),
- &limbo_status,
- &msg2.node,
- limbo_entry->acccache,
- FCACHE2NNPFSNODE_ALL);
-
- h1 = (struct nnpfs_message_header *)&msg2;
- h1_len = sizeof(msg2);
- }
-
- out:
- nnpfs_send_message_wakeup_multiple (fd,
- h->header.sequence_num,
- ret,
- h0, h0_len,
- h1, h1_len,
- NULL, 0);
- if (dir_entry)
- fcache_release(dir_entry);
- if (limbo_entry)
- fcache_release (limbo_entry);
- cred_free (ce);
-
- return ret;
-}
-
-static int
-nnpfs_message_rmdir (int fd, struct nnpfs_message_rmdir *h, u_int size)
-{
- VenusFid parent_fid, fid;
- CredCacheEntry *ce;
- int ret;
- struct nnpfs_message_installdata msg0;
- struct nnpfs_message_header *h0 = NULL;
- size_t h0_len = 0;
- struct nnpfs_message_installattr msg1;
- struct nnpfs_message_header *h1 = NULL;
- size_t h1_len = 0;
- FCacheEntry *limbo_entry = NULL;
- FCacheEntry *dir_entry = NULL;
- unsigned link_count = 0;
- fcache_cache_handle cache_handle;
-
- parent_fid = *(VenusFid *)&h->parent_handle;
- arla_warnx (ADEBMSG, "rmdir (%ld.%lu.%lu.%lu) \"%s\"",
- (long)parent_fid.Cell, (unsigned long)parent_fid.fid.Volume,
- (unsigned long)parent_fid.fid.Vnode,
- (unsigned long)parent_fid.fid.Unique, h->name);
-
- ce = cred_get (parent_fid.Cell, h->cred.pag, CRED_ANY);
- if (ce == NULL) {
- arla_warnx (ADEBMISC, "cred_get failed");
- ret = -1;
- goto out;
- }
-
- /*
- * Fetch the child-entry fid.
- */
-
- ret = fcache_get(&dir_entry, parent_fid, ce);
- if (ret)
- goto out;
-
- assert_flag(dir_entry,kernelp);
-
- do {
- ret = cm_lookup (&dir_entry, h->name, &fid, &ce, FALSE);
- } while (try_again (&ret, &ce, &h->cred, &dir_entry->fid));
-
- if (ret)
- goto out;
-
- if (VenusFid_cmp(&dir_entry->fid, &fid) == 0) {
- ret = EINVAL;
- goto out;
- }
-
- /*
- * Need to get linkcount for silly rename.
- */
-
- ret = fcache_get (&limbo_entry, fid, ce);
- if (ret)
- goto out;
-
- ret = fcache_verify_attr (limbo_entry, dir_entry, h->name, ce);
- if (ret)
- goto out;
- link_count = limbo_entry->status.LinkCount;
-
- fcache_release (limbo_entry);
- limbo_entry = NULL;
-
- /*
- * Do the actual work
- */
-
- do {
- ret = cm_rmdir(&dir_entry, h->name, &ce);
- } while (try_again (&ret, &ce, &h->cred, &dir_entry->fid));
-
- if (ret)
- goto out;
-
- ret = message_get_data (&dir_entry, &h->cred, &ce, 0);
- if (ret)
- goto out;
-
- if (!dir_entry->flags.extradirp
- || dir_remove_name (dir_entry, h->name,
- &cache_handle,
- msg0.cache_name,
- sizeof(msg0.cache_name))) {
- ret = conv_dir (dir_entry, ce, 0,
- &cache_handle,
- msg0.cache_name,
- sizeof(msg0.cache_name));
- if (ret)
- goto out;
- }
- msg0.cache_handle = cache_handle.nnpfs_handle;
- msg0.flag = NNPFS_ID_INVALID_DNLC;
- if (cache_handle.valid)
- msg0.flag |= NNPFS_ID_HANDLE_VALID;
-
- dir_entry->tokens |= NNPFS_ATTR_R;
- msg0.node.tokens = dir_entry->tokens;
-
- fcacheentry2nnpfsnode (&dir_entry->fid,
- fcache_realfid(dir_entry),
- &dir_entry->status, &msg0.node,
- dir_entry->acccache,
- FCACHE2NNPFSNODE_ALL);
-
- msg0.offset = dir_entry->fetched_length;
- msg0.header.opcode = NNPFS_MSG_INSTALLDATA;
- h0 = (struct nnpfs_message_header *)&msg0;
- h0_len = sizeof(msg0);
-
- ret = fcache_get (&limbo_entry, fid, ce);
- if (ret)
- goto out;
-
- /* Only silly rename when this is the last reference. */
-
- if (link_count == 2)
- limbo_entry->flags.silly = TRUE;
-
- if (limbo_entry->flags.kernelp) {
-
- ret = fcache_verify_attr (limbo_entry, dir_entry, NULL, ce);
- if (ret)
- goto out;
-
- msg1.header.opcode = NNPFS_MSG_INSTALLATTR;
- limbo_entry->tokens |= NNPFS_ATTR_R;
- msg1.node.tokens = limbo_entry->tokens;
- if (!limbo_entry->flags.datausedp)
- msg1.node.tokens &= ~NNPFS_DATA_MASK;
-
- if (link_count == 2 && limbo_entry->status.LinkCount == 2)
- limbo_entry->status.LinkCount = 0;
- fcacheentry2nnpfsnode (&fid,
- fcache_realfid(limbo_entry),
- &limbo_entry->status,
- &msg1.node,
- limbo_entry->acccache,
- FCACHE2NNPFSNODE_ALL);
-
- h1 = (struct nnpfs_message_header *)&msg1;
- h1_len = sizeof(msg1);
- }
- assert_flag(dir_entry,kernelp);
- assert_flag(dir_entry,attrusedp);
- dir_entry->flags.datausedp = TRUE;
-
- out:
- nnpfs_send_message_wakeup_multiple (fd,
- h->header.sequence_num,
- ret,
- h0, h0_len,
- h1, h1_len,
- NULL, 0);
- if (dir_entry)
- fcache_release(dir_entry);
- if (limbo_entry)
- fcache_release (limbo_entry);
-
- cred_free (ce);
-
- return ret;
-}
-
-static int
-nnpfs_message_rename (int fd, struct nnpfs_message_rename *h, u_int size)
-{
- VenusFid old_parent_fid;
- VenusFid new_parent_fid;
- VenusFid child_fid;
- CredCacheEntry *ce;
- int ret;
- struct nnpfs_message_installdata msg1;
- struct nnpfs_message_installdata msg2;
- struct nnpfs_message_installdata msg3;
- struct nnpfs_message_header *h0 = NULL;
- size_t h0_len = 0;
- struct nnpfs_message_header *h1 = NULL;
- size_t h1_len = 0;
- struct nnpfs_message_header *h2 = NULL;
- size_t h2_len = 0;
- FCacheEntry *old_entry = NULL;
- FCacheEntry *new_entry = NULL;
- FCacheEntry *child_entry = NULL;
- int update_child = 0;
- fcache_cache_handle cache_handle;
- int diff_dir = 0;
-
- old_parent_fid = *(VenusFid *)&h->old_parent_handle;
- new_parent_fid = *(VenusFid *)&h->new_parent_handle;
- arla_warnx (ADEBMSG,
- "rename (%ld.%lu.%lu.%lu) (%ld.%lu.%lu.%lu) \"%s\" \"%s\"",
- (long)old_parent_fid.Cell,
- (unsigned long)old_parent_fid.fid.Volume,
- (unsigned long)old_parent_fid.fid.Vnode,
- (unsigned long)old_parent_fid.fid.Unique,
- (long)new_parent_fid.Cell,
- (unsigned long)new_parent_fid.fid.Volume,
- (unsigned long)new_parent_fid.fid.Vnode,
- (unsigned long)new_parent_fid.fid.Unique,
- h->old_name,
- h->new_name);
-
- ce = cred_get (old_parent_fid.Cell, h->cred.pag, CRED_ANY);
- assert (ce != NULL);
-
- diff_dir = VenusFid_cmp (&old_parent_fid, &new_parent_fid);
-
- ret = fcache_get(&old_entry, old_parent_fid, ce);
- if (ret)
- goto out;
-
- assert_flag(old_entry,kernelp);
-
- if (diff_dir) {
- ret = fcache_get(&new_entry, new_parent_fid, ce);
- if (ret)
- goto out;
- } else {
- new_entry = old_entry;
- }
-
- assert_flag(new_entry,kernelp);
-
- do {
- ret = cm_rename(&old_entry, h->old_name,
- &new_entry, h->new_name,
- &child_fid, &update_child, &ce);
- } while (try_again (&ret, &ce, &h->cred, &old_entry->fid));
-
- if (ret)
- goto out;
-
- ret = message_get_data (&old_entry, &h->cred, &ce, 0);
- if (ret)
- goto out;
-
- if (!old_entry->flags.extradirp
- || dir_remove_name (old_entry, h->old_name,
- &cache_handle,
- msg1.cache_name,
- sizeof(msg1.cache_name))) {
- ret = conv_dir (old_entry, ce, 0,
- &cache_handle,
- msg1.cache_name,
- sizeof(msg1.cache_name));
- if (ret)
- goto out;
- }
- msg1.cache_handle = cache_handle.nnpfs_handle;
- msg1.flag = NNPFS_ID_INVALID_DNLC;
- if (cache_handle.valid)
- msg1.flag |= NNPFS_ID_HANDLE_VALID;
-
- old_entry->tokens |= NNPFS_ATTR_R;
- msg1.node.tokens = old_entry->tokens;
-
- fcacheentry2nnpfsnode (&old_entry->fid,
- fcache_realfid(old_entry),
- &old_entry->status, &msg1.node,
- old_entry->acccache,
- FCACHE2NNPFSNODE_ALL);
-
- msg1.offset = old_entry->fetched_length;
- msg1.header.opcode = NNPFS_MSG_INSTALLDATA;
- h0 = (struct nnpfs_message_header *)&msg1;
- h0_len = sizeof(msg1);
-
- ret = fcache_get_data (&new_entry, &ce, 0); /* XXX - fake_mp? */
- if (ret)
- goto out;
-
- ret = conv_dir (new_entry, ce, 0,
- &cache_handle,
- msg2.cache_name,
- sizeof(msg2.cache_name));
- if (ret)
- goto out;
-
- msg2.cache_handle = cache_handle.nnpfs_handle;
- msg2.flag = NNPFS_ID_INVALID_DNLC;
- if (cache_handle.valid)
- msg2.flag |= NNPFS_ID_HANDLE_VALID;
-
- new_entry->tokens |= NNPFS_ATTR_R;
- msg2.node.tokens = new_entry->tokens;
-
- fcacheentry2nnpfsnode (&new_entry->fid,
- fcache_realfid(new_entry),
- &new_entry->status, &msg2.node,
- new_entry->acccache,
- FCACHE2NNPFSNODE_ALL);
-
- msg2.offset = new_entry->fetched_length;
- msg2.header.opcode = NNPFS_MSG_INSTALLDATA;
- h1 = (struct nnpfs_message_header *)&msg2;
- h1_len = sizeof(msg2);
-
- if (old_entry) {
- assert_flag(old_entry,kernelp);
- assert_flag(old_entry,attrusedp);
- old_entry->flags.datausedp = TRUE;
- }
- assert_flag(new_entry,kernelp);
- assert_flag(new_entry,attrusedp);
- new_entry->flags.datausedp = TRUE;
-
- if (update_child) {
- ret = fcache_get(&child_entry, child_fid, ce);
- if (ret)
- goto out;
- ret = message_get_data (&child_entry, &h->cred, &ce, 0);
- if (ret) {
- fcache_release(child_entry);
- goto out;
- }
- child_fid = child_entry->fid;
-
- ret = conv_dir (child_entry, ce, 0,
- &cache_handle,
- msg3.cache_name,
- sizeof(msg3.cache_name));
- if (ret)
- goto out;
-
- msg3.cache_handle = cache_handle.nnpfs_handle;
- msg3.flag = NNPFS_ID_INVALID_DNLC;
- if (cache_handle.valid)
- msg3.flag |= NNPFS_ID_HANDLE_VALID;
-
- child_entry->tokens |= NNPFS_ATTR_R;
- msg3.node.tokens = child_entry->tokens;
-
- fcacheentry2nnpfsnode (&child_fid,
- fcache_realfid(child_entry),
- &child_entry->status, &msg3.node,
- child_entry->acccache,
- FCACHE2NNPFSNODE_ALL);
-
- msg3.offset = child_entry->fetched_length;
- msg3.header.opcode = NNPFS_MSG_INSTALLDATA;
- h2 = (struct nnpfs_message_header *)&msg3;
- h2_len = sizeof(msg3);
- }
-
- out:
- nnpfs_send_message_wakeup_multiple (fd,
- h->header.sequence_num,
- ret,
- h0, h0_len,
- h1, h1_len,
- NULL, 0);
- if (old_entry) fcache_release(old_entry);
- if (new_entry && diff_dir) fcache_release(new_entry);
- if (child_entry) fcache_release(child_entry);
-
- cred_free (ce);
-
- return ret;
-}
-
-static int
-nnpfs_message_putdata (int fd, struct nnpfs_message_putdata *h, u_int size)
-{
- VenusFid fid;
- CredCacheEntry *ce;
- int ret;
- AFSStoreStatus status;
- FCacheEntry *entry = NULL;
-
- fid = *(VenusFid *)&h->handle;
- arla_warnx (ADEBMSG, "putdata (%ld.%lu.%lu.%lu)",
- (long)fid.Cell, (unsigned long)fid.fid.Volume,
- (unsigned long)fid.fid.Vnode,
- (unsigned long)fid.fid.Unique);
-
- nnpfs_attr2afsstorestatus(&h->attr, &status);
-
- ce = cred_get (fid.Cell, h->cred.pag, CRED_ANY);
- assert (ce != NULL);
-
- if (connected_mode != CONNECTED) {
- ret = fcache_find (&entry, fid);
- if (ret) {
- ret = ENETDOWN;
- goto out;
- }
- } else {
- ret = fcache_get (&entry, fid, ce);
- if (ret)
- goto out;
- }
-
- assert_flag(entry,kernelp);
-
- do {
- ret = cm_close(entry, h->flag, &status, ce);
- } while (try_again (&ret, &ce, &h->cred, &fid));
-
- if (ret) {
- arla_warn (ADEBMSG, ret, "nnpfs_message_putdata: cm_close");
- goto out;
- }
-
- if (connected_mode != CONNECTED)
- entry->disco_id = disco_store_data(&fid, &status, entry->disco_id);
-
- out:
- if (entry)
- fcache_release(entry);
- cred_free (ce);
- nnpfs_send_message_wakeup (fd, h->header.sequence_num, ret);
- return 0;
-}
-
-static void
-prefetch_data(FCacheEntry **e, CredCacheEntry **ce)
-{
- FCacheEntry *entry = *e;
- int ret = 0;
-
- if (entry->status.FileType != TYPE_FILE)
- return;
-
- if (entry->status.Length > entry->fetched_length) {
- size_t offset;
-
- offset = entry->fetched_length + stats_prefetch(NULL, -1);
- if (offset > entry->status.Length)
- offset = entry->status.Length;
- arla_warnx (ADEBMSG, " prefetching to %lu", (unsigned long)offset);
- ret = fcache_get_data (e, ce, offset);
- arla_warnx (ADEBMSG, " prefetched returned %d", ret);
- }
-
- return;
-}
-
-static int
-nnpfs_message_open (int fd, struct nnpfs_message_open *h, u_int size)
-{
- struct nnpfs_message_installdata msg;
- FCacheEntry *entry = NULL;
- CredCacheEntry *ce;
- AccessEntry *ae;
- VenusFid fid;
- int ret;
-
- fid = *(VenusFid *)&h->handle;
- arla_warnx (ADEBMSG, "open (%ld.%lu.%lu.%lu)",
- (long)fid.Cell, (unsigned long)fid.fid.Volume,
- (unsigned long)fid.fid.Vnode,
- (unsigned long)fid.fid.Unique);
-
- ce = cred_get (fid.Cell, h->cred.pag, CRED_ANY);
- if (ce == NULL) {
- arla_warnx (ADEBMISC, "cred_get failed");
- ret = -1;
- goto out;
- }
-
- ret = fcache_get(&entry, fid, ce);
- if (ret)
- goto out;
-
- assert_flag(entry,kernelp);
-
- tryagain:
-
- ret = cm_getattr (entry, ce, &ae);
-
- if (try_again (&ret, &ce, &h->cred, &fid))
- goto tryagain;
- if (ret)
- goto out;
-
- msg.flag = 0;
-
- if (entry->status.FileType == TYPE_DIR) {
- fcache_cache_handle cache_handle;
-
- if (h->tokens & NNPFS_DATA_W) {
- ret = EACCES;
- goto out;
- }
-
- ret = fcache_get_data (&entry, &ce, entry->status.Length);
- if (try_again (&ret, &ce, &h->cred, &fid))
- goto tryagain;
- if (ret)
- goto out;
- fid = entry->fid;
-
- fcacheentry2nnpfsnode (&fid, fcache_realfid(entry),
- &entry->status, &msg.node, ae,
- FCACHE2NNPFSNODE_ALL);
-
- ret = conv_dir (entry, ce, h->tokens,
- &cache_handle,
- msg.cache_name,
- sizeof(msg.cache_name));
-
- if (ret)
- goto out;
-
- entry->tokens |= h->tokens;
- entry->tokens |= NNPFS_ATTR_R;
- msg.node.tokens = entry->tokens;
- msg.flag = NNPFS_ID_INVALID_DNLC;
- msg.cache_handle = cache_handle.nnpfs_handle;
- if (cache_handle.valid)
- msg.flag |= NNPFS_ID_HANDLE_VALID;
- msg.offset = entry->fetched_length;
-
- assert_flag(entry,kernelp);
- entry->flags.attrusedp = TRUE;
- entry->flags.datausedp = TRUE;
-
- } else {
- ret = cm_open (entry, ce, h->tokens);
- if (try_again (&ret, &ce, &h->cred, &fid))
- goto tryagain;
- if (ret)
- goto out;
-
- fcache_conv_file_name (entry, msg.cache_name, sizeof(msg.cache_name));
-
- msg.cache_handle = entry->handle.nnpfs_handle;
- entry->tokens |= NNPFS_ATTR_R | NNPFS_DATA_R;
- msg.node.tokens = entry->tokens;
- msg.offset = entry->fetched_length;
- fcacheentry2nnpfsnode (&fid, fcache_realfid(entry),
- &entry->status, &msg.node, ae,
- FCACHE2NNPFSNODE_ALL);
- if (entry->handle.valid)
- msg.flag |= NNPFS_ID_HANDLE_VALID;
- }
-
- msg.header.opcode = NNPFS_MSG_INSTALLDATA;
-
- nnpfs_send_message_wakeup_multiple (fd,
- h->header.sequence_num,
- ret,
- &msg, sizeof(msg),
- NULL, 0);
-
- prefetch_data(&entry, &ce);
-
- fcache_release(entry);
- cred_free (ce);
- return ret;
-
- out:
-
- if (entry)
- fcache_release(entry);
- cred_free (ce);
- nnpfs_send_message_wakeup_multiple (fd,
- h->header.sequence_num,
- ret,
- NULL, 0);
- return ret;
-}
-
-static int
-nnpfs_message_getdata (int fd, struct nnpfs_message_getdata *h, u_int size)
-{
- struct nnpfs_message_installdata msg;
- VenusFid fid;
- CredCacheEntry *ce;
- int ret;
- AccessEntry *ae;
- size_t offset;
- FCacheEntry *entry = NULL;
-
- fid = *(VenusFid *)&h->handle;
- arla_warnx (ADEBMSG, "getdata (%ld.%lu.%lu.%lu)",
- (long)fid.Cell, (unsigned long)fid.fid.Volume,
- (unsigned long)fid.fid.Vnode,
- (unsigned long)fid.fid.Unique);
-
- ce = cred_get (fid.Cell, h->cred.pag, CRED_ANY);
- assert (ce != NULL);
-
- ret = fcache_get(&entry, fid, ce);
- if (ret)
- goto out;
-
- assert_flag(entry,kernelp);
-
- tryagain:
-
- ret = cm_getattr (entry, ce, &ae);
-
- if (try_again (&ret, &ce, &h->cred, &fid))
- goto tryagain;
- if (ret)
- goto out;
-
- if (entry->status.FileType == TYPE_DIR) {
- offset = entry->status.Length;
- } else {
- offset = h->offset;
- if (offset > entry->status.Length)
- offset = entry->status.Length;
- }
-
- arla_warnx (ADEBMSG, " requested to byte %lu fetching to byte %lu",
- (unsigned long)h->offset, (unsigned long)offset);
-
- ret = fcache_get_data (&entry, &ce, offset);
- if (try_again (&ret, &ce, &h->cred, &fid))
- goto tryagain;
- if (ret)
- goto out;
-
- if (entry->status.FileType == TYPE_DIR) {
- fcache_cache_handle cache_handle;
-
- ret = conv_dir (entry, ce, h->tokens,
- &cache_handle,
- msg.cache_name,
- sizeof(msg.cache_name));
- if (ret)
- goto out;
- msg.cache_handle = cache_handle.nnpfs_handle;
- msg.flag = NNPFS_ID_INVALID_DNLC;
- if (cache_handle.valid)
- msg.flag |= NNPFS_ID_HANDLE_VALID;
- } else {
- fcache_conv_file_name(entry, msg.cache_name, sizeof(msg.cache_name));
- msg.cache_handle = entry->handle.nnpfs_handle;
- msg.flag = 0;
- if (entry->handle.valid)
- msg.flag |= NNPFS_ID_HANDLE_VALID;
- }
-
- entry->flags.datausedp = TRUE;
- entry->tokens |= NNPFS_ATTR_R | NNPFS_DATA_R;
- if (h->tokens & NNPFS_DATA_W)
- entry->tokens |= NNPFS_DATA_W;
- msg.node.tokens = entry->tokens;
- arla_warnx (ADEBMSG, " got %lu",
- (unsigned long)entry->fetched_length);
- msg.offset = entry->fetched_length;
- fcacheentry2nnpfsnode (&entry->fid, fcache_realfid(entry),
- &entry->status, &msg.node, ae,
- FCACHE2NNPFSNODE_ALL);
-
- msg.header.opcode = NNPFS_MSG_INSTALLDATA;
-
- nnpfs_send_message_wakeup_multiple (fd,
- h->header.sequence_num,
- ret,
- &msg, sizeof(msg),
- NULL, 0);
-
- prefetch_data(&entry, &ce);
-
- fcache_release(entry);
- cred_free (ce);
- return ret;
-
- out:
- if (entry)
- fcache_release(entry);
- cred_free (ce);
- nnpfs_send_message_wakeup_multiple (fd,
- h->header.sequence_num,
- ret,
- NULL, 0);
-
- return ret;
-}
-
-/*
- * Send a invalid node to the kernel to invalidate `entry'
- * and record that it's not being used in the kernel.
- */
-
-void
-break_callback (FCacheEntry *entry)
-{
- struct nnpfs_message_invalidnode msg;
- enum { CALLBACK_BREAK_WARN = 100 };
- static int failed_callbacks_break = 0;
- int ret;
-
- assert_flag(entry,kernelp);
-
- /*
- * Throw away tokens for all directories and unused entries.
- * needs to be same as NNPFS_MSG_INVALIDNODE processing in
- * nnpfs
- */
- if (entry->status.FileType == TYPE_DIR || !entry->flags.datausedp)
- entry->tokens = 0;
-
- msg.header.opcode = NNPFS_MSG_INVALIDNODE;
- memcpy (&msg.handle, &entry->fid, sizeof(entry->fid));
- ret = nnpfs_message_send (kernel_fd, (struct nnpfs_message_header *)&msg,
- sizeof(msg));
- if (ret) {
- arla_warnx (ADEBMSG, "break_callback: (%ld.%lu.%lu.%lu) failed",
- (long)entry->fid.Cell,
- (unsigned long)entry->fid.fid.Volume,
- (unsigned long)entry->fid.fid.Vnode,
- (unsigned long)entry->fid.fid.Unique);
- ++failed_callbacks_break;
- if (failed_callbacks_break > CALLBACK_BREAK_WARN) {
- arla_warnx (ADEBWARN, "break_callback: have failed %d times",
- failed_callbacks_break);
- failed_callbacks_break = 0;
- }
- }
-}
-
-/*
- * Send an unsolicited install-attr for the node in `e'
- */
-
-void
-install_attr (FCacheEntry *e, int flags)
-{
- struct nnpfs_message_installattr msg;
-
- memset (&msg, 0, sizeof(msg));
- msg.header.opcode = NNPFS_MSG_INSTALLATTR;
- fcacheentry2nnpfsnode (&e->fid, fcache_realfid(e), &e->status, &msg.node,
- e->acccache, flags);
- e->tokens |= NNPFS_ATTR_R;
- msg.node.tokens = e->tokens;
- if (!e->flags.datausedp)
- msg.node.tokens &= ~NNPFS_DATA_MASK;
-
- nnpfs_message_send (kernel_fd, (struct nnpfs_message_header *)&msg,
- sizeof(msg));
-}
-
-void
-update_fid(VenusFid oldfid, FCacheEntry *old_entry,
- VenusFid newfid, FCacheEntry *new_entry)
-{
- struct nnpfs_message_updatefid msg;
-
- msg.header.opcode = NNPFS_MSG_UPDATEFID;
- memcpy (&msg.old_handle, &oldfid, sizeof(oldfid));
- memcpy (&msg.new_handle, &newfid, sizeof(newfid));
- nnpfs_message_send (kernel_fd, (struct nnpfs_message_header *)&msg,
- sizeof(msg));
- if (new_entry != NULL) {
- assert_flag(new_entry,kernelp);
- new_entry->flags.kernelp = TRUE;
- new_entry->flags.attrusedp = TRUE;
- }
- if (old_entry != NULL) {
- old_entry->flags.kernelp = FALSE;
- old_entry->flags.attrusedp = FALSE;
- old_entry->flags.datausedp = FALSE;
- }
-}
-
-static int
-nnpfs_message_inactivenode (int fd, struct nnpfs_message_inactivenode *h,
- u_int size)
-{
- FCacheEntry *entry;
- VenusFid *fid;
- int ret;
- CredCacheEntry *ce;
-
- fid = (VenusFid *)&h->handle;
- arla_warnx (ADEBMSG, "inactivenode (%ld.%lu.%lu.%lu)",
- (long)fid->Cell, (unsigned long)fid->fid.Volume,
- (unsigned long)fid->fid.Vnode,
- (unsigned long)fid->fid.Unique);
-
- ce = cred_get (fid->Cell, 0, CRED_NONE);
- assert (ce != NULL);
-
- ret = fcache_get (&entry, *fid, ce);
- cred_free (ce);
-
- if (ret) {
- arla_warnx (ADEBMSG, "nnpfs_message_inactivenode: node not found");
- return 0;
- }
-
- assert_flag(entry,kernelp);
-
- if (h->flag & NNPFS_NOREFS)
- fcache_unused (entry);
- if (h->flag & NNPFS_DELETE) {
- entry->flags.kernelp = FALSE;
- entry->flags.datausedp = FALSE;
- entry->flags.attrusedp = FALSE;
- }
- fcache_release(entry);
- return 0;
-}
-
-/*
- * Do we have powers for changing stuff?
- */
-
-static Bool
-all_powerful_p (const nnpfs_cred *cred)
-{
- return cred->uid == 0;
-}
-
-/*
- * Flush the contents of a volume
- */
-
-static int
-viocflushvolume (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- VenusFid fid ;
-
- if (!h->handle.a && !h->handle.b && !h->handle.c && !h->handle.d)
- return EINVAL;
-
- fid.Cell = h->handle.a;
- fid.fid.Volume = h->handle.b;
- fid.fid.Vnode = 0;
- fid.fid.Unique = 0;
-
- arla_warnx(ADEBMSG,
- "flushing volume (%d, %u)",
- fid.Cell, fid.fid.Volume);
-
- fcache_purge_volume(fid);
- volcache_invalidate (fid.fid.Volume, fid.Cell);
- return 0 ;
-}
-
-/*
- * Get an ACL for a directory
- */
-
-static int
-viocgetacl(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- VenusFid fid;
- AFSOpaque opaque;
- CredCacheEntry *ce;
- int error;
-
- if (!h->handle.a && !h->handle.b && !h->handle.c && !h->handle.d)
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, EINVAL);
-
- fid.Cell = h->handle.a;
- fid.fid.Volume = h->handle.b;
- fid.fid.Vnode = h->handle.c;
- fid.fid.Unique = h->handle.d;
-
- ce = cred_get (fid.Cell, h->cred.pag, CRED_ANY);
- assert (ce != NULL);
-
- do {
- error = getacl (fid, ce, &opaque);
- } while (try_again (&error, &ce, &h->cred, &fid));
-
- if (error != 0 && error != EACCES)
- error = EINVAL;
-
- cred_free (ce);
-
- nnpfs_send_message_wakeup_data (fd, h->header.sequence_num, error,
- opaque.val, opaque.len);
- if (error == 0)
- free (opaque.val);
- return 0;
-}
-
-/*
- * Set an ACL for a directory
- */
-
-static int
-viocsetacl(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- VenusFid fid;
- AFSOpaque opaque;
- CredCacheEntry *ce;
- FCacheEntry *e;
- int error;
-
- if (!h->handle.a && !h->handle.b && !h->handle.c && !h->handle.d)
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, EINVAL);
-
- if (h->insize > AFSOPAQUEMAX || h->insize == 0)
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, EINVAL);
-
- opaque.val = malloc(h->insize);
- if(opaque.val == NULL)
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, ENOMEM);
-
- fid.Cell = h->handle.a;
- fid.fid.Volume = h->handle.b;
- fid.fid.Vnode = h->handle.c;
- fid.fid.Unique = h->handle.d;
-
- ce = cred_get (fid.Cell, h->cred.pag, CRED_ANY);
- assert (ce != NULL);
-
- opaque.len = h->insize;
- memcpy(opaque.val, h->msg, h->insize);
-
- do {
- error = setacl (fid, ce, &opaque, &e);
- } while (try_again (&error, &ce, &h->cred, &fid));
-
- if (error == 0) {
- install_attr (e, FCACHE2NNPFSNODE_ALL);
- fcache_release (e);
- } else if (error != EACCES)
- error = EINVAL;
-
- cred_free (ce);
- free (opaque.val);
-
- nnpfs_send_message_wakeup_data (fd, h->header.sequence_num, error, NULL, 0);
- return 0;
-}
-
-/*
- * Get volume status
- */
-
-static int
-viocgetvolstat(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- VenusFid fid;
- CredCacheEntry *ce;
- AFSFetchVolumeStatus volstat;
- char volumename[AFSNAMEMAX];
- char offlinemsg[AFSOPAQUEMAX];
- char motd[AFSOPAQUEMAX];
- char out[NNPFS_MSG_MAX_DATASIZE];
- char * outstr;
- int32_t outsize = 0;
- int32_t os = 0;
- int32_t osmax = 0;
- int error;
-
- if (!h->handle.a && !h->handle.b && !h->handle.c && !h->handle.d)
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, EINVAL);
-
- fid.Cell = h->handle.a;
- fid.fid.Volume = h->handle.b;
- fid.fid.Vnode = 0;
- fid.fid.Unique = 0;
-
- ce = cred_get (fid.Cell, h->cred.pag, CRED_ANY);
- assert (ce != NULL);
-
- memset (volumename, 0, AFSNAMEMAX);
- memset (offlinemsg, 0, AFSOPAQUEMAX);
- memset (motd, 0, AFSOPAQUEMAX);
-
- memset (out, 0, sizeof(out));
-
- do {
- error = getvolstat (fid, ce, &volstat,
- volumename, sizeof(volumename),
- offlinemsg,
- motd);
- } while (try_again (&error, &ce, &h->cred, &fid));
-
- cred_free (ce);
-
- if (error != 0 && error != EACCES)
- error = EINVAL;
-
- memcpy (out, (char *) &volstat, sizeof (AFSFetchVolumeStatus));
- outsize = sizeof (AFSFetchVolumeStatus);
- outstr = out + outsize;
- os = 0;
- osmax = sizeof(out) - outsize;
-
- if (os < osmax && (volumename[0]))
- os = strlcat(outstr, volumename, osmax);
- else {
- *outstr++ = '\0';
- outsize++;
- osmax--;
- }
- if (os < osmax && (offlinemsg[0]))
- os = strlcat(outstr, offlinemsg, osmax);
- else {
- *outstr++ = '\0';
- outsize++;
- osmax--;
- }
- if (os < osmax && (motd[0]))
- os = strlcat(outstr, motd, osmax);
- else {
- *outstr++ = '\0';
- outsize++;
- osmax--;
- }
- /* this can potentially truncate the motd.. who cares */
- if (os + outsize >= sizeof(out)) {
- /* XXX warn about trucated motd */
- arla_warnx(ADEBMSG,
- "truncated motd by %d bytes", os + outsize - sizeof(out));
- outsize = sizeof(out);
- } else
- outsize += os;
-
- nnpfs_send_message_wakeup_data (fd, h->header.sequence_num, error,
- out, outsize);
- return 0;
-}
-
-/*
- * Set volume status
- */
-
-static int
-viocsetvolstat(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- VenusFid fid;
- CredCacheEntry *ce;
- AFSFetchVolumeStatus *involstat;
- AFSStoreVolumeStatus outvolstat;
- char volumename[AFSNAMEMAX];
- char offlinemsg[AFSOPAQUEMAX];
- char motd[AFSOPAQUEMAX];
- int error;
- char *ptr;
-
- if (!h->handle.a && !h->handle.b && !h->handle.c && !h->handle.d)
- return EINVAL;
-
- fid.Cell = h->handle.a;
- fid.fid.Volume = h->handle.b;
- fid.fid.Vnode = 0;
- fid.fid.Unique = 0;
-
- ce = cred_get (fid.Cell, h->cred.pag, CRED_ANY);
- assert (ce != NULL);
-
- involstat = (AFSFetchVolumeStatus *) h->msg;
- outvolstat.Mask = 0x3; /* Store both the next fields */
- outvolstat.MinQuota = involstat->MinQuota;
- outvolstat.MaxQuota = involstat->MaxQuota;
-
- ptr = h->msg + sizeof (AFSFetchVolumeStatus);
-
-#if 0
- if (*ptr) {
- strncpy (volumename, ptr, AFSNAMEMAX);
- ptr += strlen (ptr);
- }
- else {
- memset (volumename, 0, AFSNAMEMAX);
- ptr++; /* skip 0 character */
- }
-
- if (*ptr) {
- strncpy (offlinemsg, ptr, AFSOPAQUEMAX);
- ptr += strlen (ptr);
- }
- else {
- memset (offlinemsg, 0, AFSOPAQUEMAX);
- ptr++;
- }
-
- strncpy (motd, ptr, AFSOPAQUEMAX);
-#else
- volumename[0] = '\0';
- offlinemsg[0] = '\0';
- motd[0] = '\0';
-#endif
-
- do {
- error = setvolstat (fid, ce, &outvolstat, volumename,
- offlinemsg, motd);
- } while (try_again (&error, &ce, &h->cred, &fid));
-
- if (error != 0 && error != EACCES)
- error = EINVAL;
-
- cred_free (ce);
-
- nnpfs_send_message_wakeup_data (fd, h->header.sequence_num, error,
- NULL, 0);
- return 0;
-}
-
-/*
- * Get the mount point at (`fid', `filename') using the cred in `ce'
- * and returning the fcache entry in `ret_mp_entry'
- * Return 0 or an error.
- */
-
-static int
-get_mount_point (VenusFid fid,
- const char *filename,
- CredCacheEntry **ce,
- FCacheEntry **ret_mp_entry)
-{
- FCacheEntry *mp_entry;
- FCacheEntry *dentry;
- VenusFid mp_fid;
- int error;
-
- if (fid.fid.Volume == 0 && fid.fid.Vnode == 0 && fid.fid.Unique == 0)
- return EINVAL;
-
- error = fcache_get(&dentry, fid, *ce);
- if (error)
- return error;
-
- error = fcache_get_data(&dentry, ce, 0);
- if (error) {
- fcache_release(dentry);
- return error;
- }
-
- error = adir_lookup(dentry, filename, &mp_fid);
- fcache_release(dentry);
- if (error)
- return error;
-
- error = fcache_get(&mp_entry, mp_fid, *ce);
- if (error)
- return error;
-
- error = fcache_verify_attr (mp_entry, dentry, filename, *ce);
- if (error) {
- fcache_release(mp_entry);
- return error;
- }
-
- if ((mp_entry->status.FileType != TYPE_LINK
- && !mp_entry->flags.fake_mp)
- || mp_entry->status.Length == 0) { /* Is not a mount point */
- fcache_release(mp_entry);
- return EINVAL;
- }
- *ret_mp_entry = mp_entry;
- return 0;
-}
-
-/*
- * Read the contents of the mount point in `e' and return a fbuf in
- * `the_fbuf' mapped READ|WRITE|PRIVATE.
- * Return 0 or an error
- */
-
-static int
-read_mount_point (FCacheEntry **mp_entry, CredCacheEntry **ce,
- int *fd, fbuf *the_fbuf)
-{
- int error;
- char *buf;
-
- error = fcache_get_data (mp_entry, ce, 0);
- if (error)
- return error;
-
- *fd = fcache_open_file (*mp_entry, O_RDONLY);
- if (*fd < 0)
- return errno;
-
- error = fbuf_create (the_fbuf, *fd, (*mp_entry)->status.Length,
- FBUF_READ|FBUF_WRITE|FBUF_PRIVATE);
- if (error) {
- close (*fd);
- return error;
- }
-
- buf = (char *)(the_fbuf->buf);
- if (buf[0] != '#' && buf[0] != '%') { /* Is not a mount point */
- fbuf_end (the_fbuf);
- close (*fd);
- return EINVAL;
- }
-
- return 0;
-}
-
-/*
- * Get info for a mount point.
- */
-
-static int
-vioc_afs_stat_mt_pt(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- VenusFid fid;
- int error;
- int mp_fd;
- fbuf the_fbuf;
- CredCacheEntry *ce;
- FCacheEntry *e;
- unsigned char *buf;
-
- fid.Cell = h->handle.a;
- fid.fid.Volume = h->handle.b;
- fid.fid.Vnode = h->handle.c;
- fid.fid.Unique = h->handle.d;
-
- h->msg[min(h->insize, sizeof(h->msg)-1)] = '\0';
-
- ce = cred_get (fid.Cell, h->cred.pag, CRED_ANY);
- assert (ce != NULL);
-
- error = get_mount_point (fid, h->msg, &ce, &e);
- if (error) {
- cred_free(ce);
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, error);
- }
-
- error = read_mount_point (&e, &ce, &mp_fd, &the_fbuf);
- if (error) {
- fcache_release (e);
- cred_free(ce);
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, error);
- }
-
- /*
- * To confuse us, the volume is passed up w/o the ending
- * dot. It's not even mentioned in the ``VIOC_AFS_STAT_MT_PT''
- * documentation.
- */
-
- buf = (unsigned char *)the_fbuf.buf;
- buf[the_fbuf.len-1] = '\0';
-
- nnpfs_send_message_wakeup_data (fd, h->header.sequence_num, error,
- buf, the_fbuf.len);
- fbuf_end (&the_fbuf);
- close (mp_fd);
- fcache_release (e);
- cred_free (ce);
-
- return 0;
-}
-
-/*
- * Handle the VIOC_AFS_DELETE_MT_PT message in `h' by deleting the
- * mountpoint.
- */
-
-static int
-vioc_afs_delete_mt_pt(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- VenusFid fid;
- int error = 0;
- CredCacheEntry *ce;
- struct nnpfs_message_remove remove_msg;
- FCacheEntry *entry;
-
- h->msg[min(h->insize, sizeof(h->msg)-1)] = '\0';
-
- fid.Cell = h->handle.a;
- fid.fid.Volume = h->handle.b;
- fid.fid.Vnode = h->handle.c;
- fid.fid.Unique = h->handle.d;
-
- ce = cred_get (fid.Cell, h->cred.pag, CRED_ANY);
- assert (ce != NULL);
-
- error = get_mount_point (fid, h->msg, &ce, &entry);
- cred_free (ce);
- if (error)
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, error);
- fcache_release(entry);
-
- remove_msg.header = h->header;
- remove_msg.header.size = sizeof(remove_msg);
- remove_msg.parent_handle = h->handle;
- strlcpy(remove_msg.name, h->msg, sizeof(remove_msg.name));
- remove_msg.cred = h->cred;
-
- return nnpfs_message_remove (fd, &remove_msg, sizeof(remove_msg));
-}
-
-static int
-viocwhereis(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- VenusFid fid;
- CredCacheEntry *ce;
- FCacheEntry *e;
- int error;
- int i, j;
- int32_t addresses[8];
- int bit;
-
- if (!h->handle.a && !h->handle.b && !h->handle.c && !h->handle.d)
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, EINVAL);
-
- fid.Cell = h->handle.a;
- fid.fid.Volume = h->handle.b;
- fid.fid.Vnode = h->handle.c;
- fid.fid.Unique = h->handle.d;
-
- ce = cred_get (fid.Cell, h->cred.pag, CRED_ANY);
- assert (ce != NULL);
-
- error = fcache_get(&e, fid, ce);
- if (error) {
- cred_free(ce);
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, error);
- }
- error = fcache_verify_attr (e, NULL, NULL, ce);
- if (error) {
- fcache_release(e);
- cred_free(ce);
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, error);
- }
-
- bit = volcache_volid2bit (e->volume, fid.fid.Volume);
-
- if (bit == -1) {
- fcache_release(e);
- cred_free(ce);
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, EINVAL);
- }
-
- memset(addresses, 0, sizeof(addresses));
- for (i = 0, j = 0; i < min(e->volume->entry.nServers, MAXNSERVERS); i++) {
- u_long addr = htonl(e->volume->entry.serverNumber[i]);
-
- if ((e->volume->entry.serverFlags[i] & bit) && addr != 0)
- addresses[j++] = addr;
- }
- nnpfs_send_message_wakeup_data (fd, h->header.sequence_num, error,
- addresses, sizeof(long) * j);
-
- fcache_release(e);
- cred_free (ce);
-
- return 0;
-}
-
-/*
- * Return all db servers for a particular cell.
- */
-
-static int
-vioc_get_cell(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- int i;
- int32_t index;
- const char *cellname;
- int cellname_len;
- int outsize;
- char out[8 * sizeof(int32_t) + MAXPATHLEN]; /* XXX */
- const cell_db_entry *dbservers;
- int num_dbservers;
-
- index = *((int32_t *) h->msg);
- cellname = cell_num2name(index);
- if (cellname == NULL)
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, EDOM);
-
- dbservers = cell_dbservers_by_id (index, &num_dbservers);
-
- if (dbservers == NULL)
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, EDOM);
-
- memset(out, 0, sizeof(out));
- cellname_len = min(strlen(cellname), MAXPATHLEN - 1);
- memcpy(out + 8 * sizeof(int32_t), cellname, cellname_len);
- out[8 * sizeof(int32_t) + cellname_len] = '\0';
- outsize = 8 * sizeof(int32_t) + cellname_len + 1;
- for (i = 0; i < min(num_dbservers, 8); ++i) {
- uint32_t addr = dbservers[i].addr.s_addr;
- memcpy (&out[i * sizeof(int32_t)], &addr, sizeof(int32_t));
- }
-
- nnpfs_send_message_wakeup_data (fd, h->header.sequence_num, 0,
- out, outsize);
-
- return 0;
-}
-
-/*
- * Return status information about a cell.
- */
-
-static int
-vioc_get_cellstatus(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- char *cellname;
- int32_t cellid;
- uint32_t out = 0;
-
- cellname = h->msg;
- cellname[h->insize-1] = '\0';
-
- cellid = cell_name2num (cellname);
- if (cellid == -1)
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, ENOENT);
-
- if (cellid == 0)
- out |= CELLSTATUS_PRIMARY;
- if (cell_issuid_by_num (cellid))
- out |= CELLSTATUS_SETUID;
-
- nnpfs_send_message_wakeup_data (fd, h->header.sequence_num, 0,
- &out, sizeof(out));
-
- return 0;
-}
-
-/*
- * Set status information about a cell.
- */
-
-static int
-vioc_set_cellstatus(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- int32_t cellid;
- char *cellname;
- uint32_t in = 0;
- int ret;
-
- if (!all_powerful_p (&h->cred))
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, EACCES);
-
- if (h->insize < sizeof (in) + 2) /* terminating NUL and one char */
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, EINVAL);
-
- cellname = h->msg + sizeof (in);
- cellname[h->insize-1-sizeof(in)] = '\0';
-
- cellid = cell_name2num (cellname);
- if (cellid == -1)
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, ENOENT);
-
- if (in & CELLSTATUS_SETUID) {
- ret = cell_setsuid_by_num (cellid);
- if (ret)
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num,EINVAL);
- }
-
- nnpfs_send_message_wakeup (fd, h->header.sequence_num, 0);
-
- return 0;
-}
-
-/*
- * Set information about a cell or add a new one.
- */
-
-static int
-vioc_new_cell(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- const char *cellname;
- cell_entry *ce;
- int count, i;
- uint32_t *hp;
- cell_db_entry *dbs;
-
- if (!all_powerful_p (&h->cred))
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, EPERM);
-
- if (h->insize < 9)
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, EINVAL);
-
- hp = (uint32_t *)h->msg;
- for (count = 0; *hp != 0; ++hp)
- ++count;
-
- dbs = calloc (count, sizeof(*dbs));
- if (dbs == NULL)
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, ENOMEM);
-
- hp = (uint32_t *)h->msg;
- for (i = 0; i < count; ++i) {
- dbs[i].name = NULL;
- dbs[i].addr.s_addr = hp[i];
- dbs[i].timeout = 0;
- }
-
- cellname = h->msg + 8 * sizeof(uint32_t);
- ce = cell_get_by_name (cellname);
- if (ce == NULL) {
- ce = cell_new_dynamic (cellname);
-
- if (ce == NULL) {
- free (dbs);
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num,
- ENOMEM);
- }
- } else {
- free (ce->dbservers);
- }
-
- ce->ndbservers = count;
- ce->dbservers = dbs;
-
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, 0);
-}
-
-#ifdef KERBEROS
-
-/*
- * Return the token for the cell in `ce'
- */
-
-static int
-token_for_cell (int fd, struct nnpfs_message_pioctl *h, u_int size,
- CredCacheEntry *ce)
-{
- char buf[NNPFS_MSG_MAX_DATASIZE];
- size_t len, cell_len;
- char *p = buf;
- uint32_t tmp;
- struct cred_rxkad *cred = (struct cred_rxkad *)ce->cred_data;
- const char *cell = cell_num2name (ce->cell);
-
- cell_len = strlen(cell);
-
- len = 4 + cred->ticket_len + 4 + sizeof(cred->ct) + 4 + cell_len;
- if (len > sizeof(buf))
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, EINVAL);
-
- tmp = cred->ticket_len;
- memcpy (p, &tmp, sizeof(tmp));
- p += sizeof(tmp);
- memcpy (p, cred->ticket, tmp);
- p += tmp;
- tmp = sizeof(cred->ct);
- memcpy (p, &tmp, sizeof(tmp));
- p += sizeof(tmp);
- memcpy (p, &cred->ct, sizeof(cred->ct));
- p += sizeof(cred->ct);
- tmp = 0;
- memcpy (p, &tmp, sizeof(tmp));
- p += sizeof(tmp);
- strlcpy (p, cell, buf + sizeof buf - cell);
- p += strlen(cell) + 1;
-
- len = p - buf;
-
- cred_free (ce);
-
- nnpfs_send_message_wakeup_data (fd, h->header.sequence_num, 0,
- buf, len);
- return 0;
-}
-
-struct get_tok {
- int32_t counter;
- int32_t cell;
-};
-
-static int
-gettok_func(CredCacheEntry *ce, void *ptr)
-{
- struct get_tok *gt = ptr;
-
- if (gt->counter == 0) {
- gt->cell = ce->cell;
- return 1;
- }
-
- gt->counter--;
- return 0;
-}
-
-
-/*
- * Handle the GETTOK message in `h'
- */
-
-static int
-viocgettok (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- CredCacheEntry *ce;
- int32_t cell_id;
-
- if (h->insize == 0) {
- cell_id = cell_name2num(cell_getthiscell());
- } else if (h->insize == sizeof(uint32_t)) {
- struct get_tok gt;
- int32_t n;
-
- memcpy (&n, h->msg, sizeof(n));
-
- if (n < 0) {
- nnpfs_send_message_wakeup (fd, h->header.sequence_num, EINVAL);
- return 0;
- }
-
- gt.counter = n;
- gt.cell = -1;
-
- cred_list_pag(h->cred.pag, CRED_KRB4, gettok_func, &gt);
-
- if (gt.cell == -1) {
- nnpfs_send_message_wakeup (fd, h->header.sequence_num, EDOM);
- return 0;
- }
-
- cell_id = gt.cell;
- } else {
- nnpfs_send_message_wakeup (fd, h->header.sequence_num, EINVAL);
- return 0;
- }
-
- ce = cred_get (cell_id, h->cred.pag, CRED_KRB4);
- if (ce == NULL) {
- nnpfs_send_message_wakeup (fd, h->header.sequence_num, ENOTCONN);
- return 0;
- }
-
- return token_for_cell (fd, h, size, ce);
-}
-
-/*
- * Handle the SETTOK message in `h'
- */
-
-static int
-viocsettok (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- struct cred_rxkad cred;
- long cell;
- char realm[256];
- int32_t sizeof_x;
- char *t = h->msg;
-
- /* someone probed us */
- if (h->insize == 0)
- return EINVAL;
- if (h->insize < 4)
- return EINVAL;
-
- /* Get ticket_st */
- memcpy(&sizeof_x, t, sizeof(sizeof_x)) ;
- cred.ticket_len = sizeof_x;
- arla_warnx (ADEBMSG, "ticket_st has size %d", sizeof_x);
- t += sizeof(sizeof_x) ;
-
- /* data used + datalen + cleartoken's length field */
- if ((t - (char *)h->msg) + sizeof_x + 4 > h->insize)
- return EINVAL;
- if (sizeof_x > sizeof(cred.ticket))
- return EINVAL;
-
- memcpy(cred.ticket, t, sizeof_x) ;
- t += sizeof_x ;
-
- /* Get ClearToken */
- memcpy(&sizeof_x, t, sizeof(sizeof_x)) ;
- t += sizeof(sizeof_x) ;
-
- /* data used + datalen + cell's length field */
- if ((t - (char *)h->msg) + sizeof_x + 4 > h->insize)
- return EINVAL;
-
- memcpy(&cred.ct, t, sizeof_x) ;
- t += sizeof_x ;
-
- /* Get primary cell ? */
- memcpy(&sizeof_x, t, sizeof(sizeof_x)) ;
- t += sizeof(sizeof_x) ;
-
- /* Get Cellname */
- strlcpy(realm, t, min(h->insize - (t - (char *)h->msg), sizeof(realm)));
- strlwr(realm);
-
- cell = cell_name2num(realm);
-
- if (cell == -1)
- return ENOENT;
-
- conn_clearcred (CONN_CS_ALL, cell, h->cred.pag, 2);
- fcache_purge_cred(h->cred.pag, cell);
- cred_add (h->cred.pag, CRED_KRB4, 2, cell, cred.ct.EndTimestamp,
- &cred, sizeof(cred), cred.ct.ViceId);
- return 0;
-}
-
-static int
-viocunlog (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- nnpfs_pag_t cred = h->cred.pag;
-
- cred_remove(cred);
- fcache_purge_cred(cred, -1);
- return 0;
-}
-
-#if defined(HAVE_KRB5) && defined(WITH_RXGK)
-
-/*
- * handle rxgk kerberos 5 authenticator
- *
- * format:
- * int32_t ticket_len
- * char krb5_ticket[];
- * int32_t kvno;
- * int32_t krb5_enctype;
- * int32_t viceid;
- * int32_t sessionkey_len;
- * char sessionkey[];
- * int64_t start_time;
- * int64_t expiration_time;
- * char cell[]
- */
-
-size_t k5ticket_limit_size = 40 * 1024;
-
-static int
-k5settok (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- struct cred_rxgk c;
- char cellname[256];
- uint32_t sizeof_x;
- uint64_t endtime;
- int32_t viceid;
- long cell;
- char *t = h->msg;
- int insize = h->insize;
-
- if (insize < 4)
- return EINVAL;
-
- memcpy(&sizeof_x, t, sizeof(sizeof_x)) ;
- arla_warnx (ADEBMSG, "ticket has size %d", sizeof_x);
- t += sizeof(sizeof_x) ;
-
- if (sizeof_x < k5ticket_limit_size || sizeof_x > insize)
- return EINVAL;
-
- c.type = CRED_GK_K5;
-
- c.t.k5.ticket = malloc(sizeof_x);
- if (c.t.k5.ticket == NULL)
- return ENOMEM;
-
- memcpy(c.t.k5.ticket, t, sizeof_x);
- insize -= sizeof_x;
- t += sizeof_x;
-
- if (h->insize < 4 + 4 + 4 + 4) {
- free(c.t.k5.ticket);
- return EINVAL;
- }
-
- memcpy(&sizeof_x, t, sizeof(sizeof_x));
- t += sizeof(sizeof_x); insize -= sizeof(sizeof_x);
- c.t.k5.enctype = sizeof_x;
-
- memcpy(&sizeof_x, t, sizeof(sizeof_x));
- t += sizeof(sizeof_x); insize -= sizeof(sizeof_x);
- c.t.k5.kvno = sizeof_x;
-
- memcpy(&sizeof_x, t, sizeof(sizeof_x));
- t += sizeof(sizeof_x); insize -= sizeof(sizeof_x);
- viceid = sizeof_x;
-
- memcpy(&sizeof_x, t, sizeof(sizeof_x));
- t += sizeof(sizeof_x); insize -= sizeof(sizeof_x);
- c.t.k5.sessionkey_len = sizeof_x;
-
- if (sizeof_x < k5ticket_limit_size || sizeof_x > insize) {
- free(c.t.k5.ticket);
- return EINVAL;
- }
-
- c.t.k5.sessionkey = malloc(c.t.k5.sessionkey_len);
- if (c.t.k5.sessionkey == NULL) {
- free(c.t.k5.ticket);
- return EINVAL;
- }
-
- memcpy(c.t.k5.sessionkey, t, c.t.k5.sessionkey_len);
- t += c.t.k5.sessionkey_len;
- insize -= c.t.k5.sessionkey_len;
-
-
- if (insize < 8 + 8 + 1) {
- free(c.t.k5.sessionkey);
- free(c.t.k5.ticket);
- return EINVAL;
- }
-
- t += 8;
- insize -= 8;
-
- memcpy(&endtime, t, sizeof(endtime));
- t += 8;
- insize -= 8;
-
- if (insize > sizeof(cellname) || t[insize - 1] != '\0') {
- free(c.t.k5.sessionkey);
- free(c.t.k5.ticket);
- return EINVAL;
- }
-
- strlcpy(cellname, t, sizeof(cellname));
-
- cell = cell_name2num(strlwr(cellname));
-
- if (cell == -1) {
- free(c.t.k5.sessionkey);
- free(c.t.k5.ticket);
- return ENOENT;
- }
-
- conn_clearcred (CONN_CS_ALL, cell, h->cred.pag, 2);
- fcache_purge_cred(h->cred.pag, cell);
- cred_add (h->cred.pag, CRED_GK_K5, 2, cell, (time_t)endtime,
- &c, sizeof(c), viceid);
- return 0;
-}
-
-#endif /* HAVE_KRB5 && WITH_RXGK */
-
-#endif /* KERBEROS */
-
-/*
- * Flush the fid in `h->handle' from the cache.
- */
-
-static int
-viocflush (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- VenusFid fid ;
- AFSCallBack broken_callback = {0, 0, CBDROPPED};
-
- if (!h->handle.a && !h->handle.b && !h->handle.c && !h->handle.d)
- return EINVAL;
-
- fid.Cell = h->handle.a;
- fid.fid.Volume = h->handle.b;
- fid.fid.Vnode = h->handle.c;
- fid.fid.Unique = h->handle.d;
-
- arla_warnx(ADEBMSG,
- "flushing (%d, %u, %u, %u)",
- fid.Cell, fid.fid.Volume, fid.fid.Vnode, fid.fid.Unique);
-
- fcache_stale_entry(fid, broken_callback);
- return 0 ;
-}
-
-static int
-viocconnect(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- char *p = h->msg;
- int32_t tmp;
- int32_t ret;
- int error = 0;
-
- if (h->insize != sizeof(int32_t) ||
- h->outsize != sizeof(int32_t)) {
-
- ret = -EINVAL;
- } else {
-
- memcpy(&tmp, h->msg, sizeof(tmp));
- p += sizeof(tmp);
-
- ret = tmp;
-
- /* check permission */
- switch (tmp) {
- case CONNMODE_PROBE:
- break;
- default:
- if (!all_powerful_p(&h->cred))
- return EPERM;
- break;
- }
-
- switch(tmp) {
- case CONNMODE_PROBE:
- switch(connected_mode) {
- case CONNECTED: ret = CONNMODE_CONN; break;
- case FETCH_ONLY: ret = CONNMODE_FETCH; break;
- case DISCONNECTED: ret = CONNMODE_DISCONN; break;
- default:
- error = EINVAL;
- ret = 0;
- break;
- }
- break;
- case CONNMODE_CONN:
- case CONNMODE_CONN_WITHCALLBACKS:
- disco_closelog();
-
- cmcb_reinit();
-
- if (disco_need_integrate())
- disco_reintegrate(h->cred.pag);
-
- if (tmp == CONNMODE_CONN_WITHCALLBACKS)
- fcache_reobtain_callbacks (&h->cred);
-
- connected_mode = CONNECTED ;
- break;
- case CONNMODE_FETCH:
- disco_openlog();
- connected_mode = FETCH_ONLY ;
- break;
- case CONNMODE_DISCONN:
- disco_openlog();
- if (possibly_have_network())
- fcache_giveup_all_callbacks();
- connected_mode = DISCONNECTED;
- break;
- default:
- error = EINVAL;
- break;
- }
- }
-
- nnpfs_send_message_wakeup_data (fd, h->header.sequence_num, error,
- &ret, sizeof(ret));
- return 0;
-}
-
-static int
-getrxkcrypt(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- if (h->outsize == sizeof(uint32_t)) {
- uint32_t n;
-
-#ifdef KERBEROS
- if (conn_rxkad_level == rxkad_crypt)
- n = 1;
- else
-#endif
- n = 0;
-
- return nnpfs_send_message_wakeup_data (fd,
- h->header.sequence_num,
- 0,
- &n,
- sizeof(n));
- } else
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, EINVAL);
-}
-
-static int
-setrxkcrypt(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
-#ifdef KERBEROS
- int error = 0;
-
- if (!all_powerful_p(&h->cred))
- return EPERM;
-
- if (h->insize == sizeof(uint32_t)) {
- uint32_t n;
-
- memcpy (&n, h->msg, sizeof(n));
-
- if (n == 0)
- conn_rxkad_level = rxkad_auth;
- else if(n == 1)
- conn_rxkad_level = rxkad_crypt;
- else
- error = EINVAL;
- if (error == 0)
- conn_clearcred (CONN_CS_SECIDX, 0, -1, 2);
- } else
- error = EINVAL;
- return error;
-#else
- return EOPNOTSUPP;
-#endif
-}
-
-/*
- * XXX - this function sometimes does a wakeup_data and then an ordinary wakeup is sent in nnpfs_message_pioctl
- */
-
-static int
-vioc_fpriostatus (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- struct vioc_fprio *fprio;
- int error = 0;
- VenusFid fid;
-
- if (h->insize != sizeof(struct vioc_fprio))
- return EINVAL;
-
- fprio = (struct vioc_fprio *) h->msg;
-
- fid.Cell = fprio->Cell ;
- fid.fid.Volume = fprio->Volume ;
- fid.fid.Vnode = fprio->Vnode ;
- fid.fid.Unique = fprio->Unique ;
-
- if (!all_powerful_p(&h->cred))
- return EPERM;
-
-#if 0
- switch(fprio->cmd) {
- case FPRIO_GET: {
- unsigned prio;
-
- if (h->outsize != sizeof(unsigned)) {
- error = EINVAL;
- break;
- }
-
- prio = fprio_get(fid);
- nnpfs_send_message_wakeup_data (fd,
- h->header.sequence_num,
- 0,
- &prio,
- sizeof(prio));
-
- break;
- }
- case FPRIO_SET:
- if (fprio->prio == 0) {
- fprio_remove(fid);
- error = 0;
- } else if (fprio->prio < FPRIO_MIN ||
- fprio->prio > FPRIO_MAX)
- error = EINVAL;
- else {
- fprio_set(fid, fprio->prio);
- error = 0;
- }
- break;
- case FPRIO_GETMAX:
- if (h->outsize != sizeof(unsigned)) {
- error = EINVAL;
- break;
- }
-
- nnpfs_send_message_wakeup_data (fd,
- h->header.sequence_num,
- 0,
- &fprioritylevel,
- sizeof(fprioritylevel));
- error = 0;
- break;
- case FPRIO_SETMAX:
- if (fprio->prio < FPRIO_MIN ||
- fprio->prio > FPRIO_MAX)
- error = EINVAL;
- else {
- fprioritylevel = fprio->prio;
- error = 0;
- }
- break;
- default:
- error = EINVAL;
- break;
- }
-#endif
- return error;
-}
-
-static int
-viocgetfid (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- return nnpfs_send_message_wakeup_data(fd, h->header.sequence_num, 0,
- &h->handle, sizeof(VenusFid));
-}
-
-static int
-viocvenuslog (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- if (!all_powerful_p(&h->cred))
- return EPERM;
-
- conn_status ();
- volcache_status ();
- cred_status ();
- fcache_status ();
- cell_status (stderr);
-#if 0
- fprio_status ();
-#endif
-#ifdef RXDEBUG
- rx_PrintStats(stderr);
-#endif
- return 0;
-}
-
-/*
- * Set or get the sysname
- */
-
-static int
-vioc_afs_sysname (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- char *t = h->msg;
- int32_t parm = *((int32_t *)t);
-
- if (parm) {
- char t_sysname[SYSNAMEMAXLEN];
- int size;
-
- if (!all_powerful_p (&h->cred))
- return nnpfs_send_message_wakeup (fd,
- h->header.sequence_num,
- EPERM);
- t += sizeof(int32_t);
- arla_warnx (ADEBMSG, "VIOC_AFS_SYSNAME: setting sysname: %s", t);
-
- size = min(h->insize, SYSNAMEMAXLEN);
-
- memcpy(t_sysname, t, size);
- t_sysname[size - 1] = '\0';
-
- fcache_setdefsysname (t_sysname);
-
- return nnpfs_send_message_wakeup(fd, h->header.sequence_num, 0);
- } else {
- char *buf;
- const char *sysname = fcache_getdefsysname ();
- size_t sysname_len = strlen (sysname);
- int ret;
-
- buf = malloc (sysname_len + 4 + 1);
- if (buf == NULL)
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num,
- ENOMEM);
- /* Return always 1 as we do not support sysname lists. */
- /* Historically the value of this uint32 has been success/failure. */
- /* OpenAFS' utilities treat this value as the number of elements */
- /* in a list of returned sysnames. It was never meant to be buflen.*/
- *((uint32_t *)buf) = 1;
- memcpy (buf + 4, sysname, sysname_len);
- buf[sysname_len + 4] = '\0';
-
- ret = nnpfs_send_message_wakeup_data (fd, h->header.sequence_num, 0,
- buf, sysname_len + 5);
- free (buf);
- return ret;
- }
-}
-
-static int
-viocfilecellname (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- char *cellname;
-
- cellname = (char *) cell_num2name(h->handle.a);
-
- if (cellname)
- return nnpfs_send_message_wakeup_data(fd, h->header.sequence_num, 0,
- cellname, strlen(cellname)+1);
- else
- return nnpfs_send_message_wakeup_data(fd, h->header.sequence_num, EINVAL,
- NULL, 0);
-}
-
-static int
-viocgetwscell (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- char *cellname;
-
- cellname = (char*) cell_getthiscell();
- return nnpfs_send_message_wakeup_data(fd, h->header.sequence_num, 0,
- cellname, strlen(cellname)+1);
-}
-
-static int
-viocsetcachesize (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- uint32_t *s = (uint32_t *)h->msg;
-
- if (!all_powerful_p (&h->cred))
- return EPERM;
-
- if (h->insize >= sizeof(int32_t) * 4)
- return fcache_reinit(s[0], s[1], s[2], s[3]);
- else
- return fcache_reinit(*s/2, *s, *s*500, *s*1000);
-}
-
-/*
- * VIOCCKSERV
- *
- * in: flags - bitmask (1 - dont ping, use cached data, 2 - check fsservers only)
- * cell - string (optional)
- * out: hosts - uint32_t number of hosts, followed by list of hosts being down.
- */
-
-static int
-viocckserv (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- int32_t cell = cell_name2num (cell_getthiscell());
- int flags = 0;
- int num_entries;
- uint32_t hosts[CKSERV_MAXSERVERS + 1];
- int msg_size;
-
- if (h->insize < sizeof(int32_t))
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, EINVAL);
-
- memset (hosts, 0, sizeof(hosts));
-
- flags = *(uint32_t *)h->msg;
- flags &= CKSERV_DONTPING|CKSERV_FSONLY;
-
- if (h->insize > sizeof(int32_t)) {
- h->msg[min(h->insize, sizeof(h->msg)-1)] = '\0';
-
- cell = cell_name2num (((char *)h->msg) + sizeof(int32_t));
- if (cell == -1)
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, ENOENT);
- }
-
- num_entries = CKSERV_MAXSERVERS;
-
- conn_downhosts(cell, hosts + 1, &num_entries, flags);
-
- hosts[0] = num_entries;
- msg_size = sizeof(hosts[0]) * (num_entries + 1);
- return nnpfs_send_message_wakeup_data (fd, h->header.sequence_num, 0,
- hosts, msg_size);
-}
-
-
-/*
- * Return the number of used KBs and reserved KBs
- */
-
-static int
-viocgetcacheparms (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- uint32_t parms[16];
-
- memset(parms, 0, sizeof(parms));
- parms[0] = fcache_highbytes() / 1024;
- parms[1] = fcache_usedbytes() / 1024;
- parms[2] = fcache_highvnodes();
- parms[3] = fcache_usedvnodes();
- parms[4] = fcache_highbytes();
- parms[5] = fcache_usedbytes();
- parms[6] = fcache_lowbytes();
- parms[7] = fcache_lowvnodes();
-
- h->outsize = sizeof(parms);
- return nnpfs_send_message_wakeup_data(fd, h->header.sequence_num, 0,
- parms, sizeof(parms));
-}
-
-/*
- * debugging interface to give out statistics of the cache
- */
-
-static int
-viocaviator (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- uint32_t parms[16];
-
- memset(parms, 0, sizeof(parms));
- parms[0] = kernel_highworkers();
- parms[1] = kernel_usedworkers();
-
- h->outsize = sizeof(parms);
- return nnpfs_send_message_wakeup_data(fd, h->header.sequence_num, 0,
- parms, sizeof(parms));
-}
-
-/*
- * Get/set arla debug level
- */
-
-static int
-vioc_arladebug (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- if (h->insize != 0) {
- if (h->insize < sizeof(int32_t))
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num,
- EINVAL);
- if (!all_powerful_p (&h->cred))
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num,
- EPERM);
- arla_log_set_level_num (*((int32_t *)h->msg));
- }
- if (h->outsize != 0) {
- int32_t debug_level;
-
- if (h->outsize < sizeof(int32_t))
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num,
- EINVAL);
-
- debug_level = arla_log_get_level_num ();
- return nnpfs_send_message_wakeup_data (fd, h->header.sequence_num,
- 0, &debug_level,
- sizeof(debug_level));
- }
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num, 0);
-}
-
-/*
- * GC pags --- there shouldn't be any need to do anything here.
- */
-
-static int
-vioc_gcpags (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- return 0;
-}
-
-/*
- * Break the callback of the specified fid
- */
-
-static int
-vioc_calculate_cache (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- uint32_t parms[16];
-
- memset(parms, 0, sizeof(parms));
-
- if (!all_powerful_p(&h->cred))
- return EPERM;
-
- h->outsize = sizeof(parms);
-
- parms[0] = fcache_calculate_usage();
- parms[1] = fcache_usedbytes();
-
- arla_warnx (ADEBMISC,
- "diskusage = %d, usedbytes = %d",
- parms[0], parms[1]);
-
- return nnpfs_send_message_wakeup_data (fd, h->header.sequence_num, 0,
- &parms, sizeof(parms));
-}
-
-/*
- *
- */
-
-static int
-vioc_breakcallback(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- int error;
- VenusFid fid;
- FCacheEntry *e;
- CredCacheEntry *ce;
-
- if (!all_powerful_p(&h->cred))
- return EPERM;
-
- if (!h->handle.a && !h->handle.b && !h->handle.c && !h->handle.d)
- return EINVAL;
-
- fid.Cell = h->handle.a;
- fid.fid.Volume = h->handle.b;
- fid.fid.Vnode = h->handle.c;
- fid.fid.Unique = h->handle.d;
-
- ce = cred_get (fid.Cell, h->cred.pag, CRED_ANY);
- assert (ce != NULL);
-
- error = fcache_get(&e, fid, ce);
- if (error)
- return error;
-
- if (!e->flags.kernelp) {
- cred_free (ce);
- return -ENOENT;
- }
-
- break_callback (e);
-
- fcache_release (e);
- cred_free (ce);
-
- return 0;
-}
-
-/*
- * check volume mappings
- */
-
-static int
-vioc_ckback(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- volcache_invalidate_all ();
- fcache_invalidate_mp ();
- return 0;
-}
-
-static int
-statistics_hostpart(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- uint32_t host[100];
- uint32_t part[100];
- uint32_t outparms[512];
- int n;
- int outsize;
- int maxslots;
- int i;
-
- if (h->outsize < sizeof(uint32_t))
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num,
- EINVAL);
-
- n = 100;
- collectstats_hostpart(host, part, &n);
- maxslots = (h->outsize / sizeof(uint32_t) - 1) / 2;
- if (n > maxslots)
- n = maxslots;
-
- outsize = (n * 2 + 1) * sizeof(uint32_t);
-
- outparms[0] = n;
- for (i = 0; i < n; i++) {
- outparms[i*2 + 1] = host[i];
- outparms[i*2 + 2] = part[i];
- }
-
- return nnpfs_send_message_wakeup_data (fd, h->header.sequence_num, 0,
- (char *) &outparms, outsize);
-}
-
-static int
-statistics_entry(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- uint32_t *request = (uint32_t *) h->msg;
- uint32_t host;
- uint32_t part;
- uint32_t type;
- uint32_t items_slot;
- uint32_t count[32];
- int64_t items_total[32];
- int64_t total_time[32];
- uint32_t outparms[160];
- int i;
- int j;
-
- if (h->insize < sizeof(uint32_t) * 5) {
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num,
- EINVAL);
- }
-
- if (h->outsize < sizeof(uint32_t) * 160) {
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num,
- EINVAL);
- }
-
- host = request[1];
- part = request[2];
- type = request[3];
- items_slot = request[4];
-
- collectstats_getentry(host, part, type, items_slot,
- count, items_total, total_time);
-
- j = 0;
- for (i = 0; i < 32; i++) {
- outparms[j++] = count[i];
- }
- for (i = 0; i < 32; i++) {
- memcpy(&outparms[j], &items_total[i], 8);
- j+=2;
- }
- for (i = 0; i < 32; i++) {
- memcpy(&outparms[j], &total_time[i], 8);
- j+=2;
- }
- return nnpfs_send_message_wakeup_data (fd, h->header.sequence_num, 0,
- (char *) &outparms, sizeof(outparms));
-}
-
-static int
-aioc_statistics(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- uint32_t opcode;
-
- if (!all_powerful_p (&h->cred))
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num,
- EPERM);
-
- if (h->insize < sizeof(opcode))
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num,
- EPERM);
-
- memcpy(&opcode, &h->msg, sizeof(opcode));
-
- switch (opcode) {
- case STATISTICS_OPCODE_LIST:
- return statistics_hostpart(fd, h, size);
- case STATISTICS_OPCODE_GETENTRY:
- return statistics_entry(fd, h, size);
- default:
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num,
- EINVAL);
- }
-}
-
-
-static int
-aioc_getcacheparam(int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- int32_t opcode;
- int64_t val;
- int error = 0;
-
- if (h->insize < sizeof(opcode) || h->outsize < sizeof(int64_t))
- return nnpfs_send_message_wakeup (fd, h->header.sequence_num,
- EINVAL);
-
- memcpy(&opcode, &h->msg, sizeof(opcode));
-
- switch(opcode) {
- case GETCACHEPARAMS_OPCODE_HIGHBYTES:
- val = fcache_highbytes();
- break;
- case GETCACHEPARAMS_OPCODE_USEDBYTES:
- val = fcache_usedbytes();
- break;
- case GETCACHEPARAMS_OPCODE_LOWBYTES:
- val = fcache_lowbytes();
- break;
- case GETCACHEPARAMS_OPCODE_HIGHVNODES:
- val = fcache_highvnodes();
- break;
- case GETCACHEPARAMS_OPCODE_USEDVNODES:
- val = fcache_usedvnodes();
- break;
- case GETCACHEPARAMS_OPCODE_LOWVNODES:
- val = fcache_lowvnodes();
- break;
- default:
- error = EINVAL;
- break;
- }
-
- return nnpfs_send_message_wakeup_data (fd, h->header.sequence_num, 0,
- (char *) &val, sizeof(val));
-}
-
-
-/*
- * Handle a pioctl message in `h'
- */
-
-static int
-nnpfs_message_pioctl (int fd, struct nnpfs_message_pioctl *h, u_int size)
-{
- int error;
-
- switch(h->opcode) {
-#ifdef KERBEROS
-#ifdef VIOCSETTOK_32
- case VIOCSETTOK_32:
- case VIOCSETTOK_64:
-#else
- case VIOCSETTOK:
-#endif
- error = viocsettok (fd, h, size);
- break;
-
-#if defined(HAVE_KRB5) && defined(WITH_RXGK)
-#ifdef AFSCOMMONIOC_GKK5SETTOK_32
- case AFSCOMMONIOC_GKK5SETTOK_32:
- case AFSCOMMONIOC_GKK5SETTOK_64:
-#else
- case AFSCOMMONIOC_GKK5SETTOK:
-#endif
- error = k5settok(fd, h, size);
- break;
-#endif /* HAVE_KRB5 && WITH_RXGK */
-
-#ifdef VIOCGETTOK_32
- case VIOCGETTOK_32:
- case VIOCGETTOK_64:
-#else
- case VIOCGETTOK :
-#endif
- return viocgettok (fd, h, size);
-#ifdef VIOCUNPAG_32
- case VIOCUNPAG_32:
- case VIOCUNPAG_64:
-#else
- case VIOCUNPAG:
-#endif
-#ifdef VIOCUNLOG_32
- case VIOCUNLOG_32:
- case VIOCUNLOG_64:
-#else
- case VIOCUNLOG:
-#endif
- error = viocunlog (fd, h, size);
- break;
-#endif /* KERBEROS */
-#ifdef VIOCCONNECTMODE_32
- case VIOCCONNECTMODE_32:
- case VIOCCONNECTMODE_64:
-#else
- case VIOCCONNECTMODE:
-#endif
- return viocconnect(fd, h, size);
-#ifdef VIOCFLUSH_32
- case VIOCFLUSH_32:
- case VIOCFLUSH_64:
-#else
- case VIOCFLUSH:
-#endif
- error = viocflush(fd, h, size);
- break;
-#ifdef VIOC_FLUSHVOLUME_32
- case VIOC_FLUSHVOLUME_32:
- case VIOC_FLUSHVOLUME_64:
-#else
- case VIOC_FLUSHVOLUME:
-#endif
- error = viocflushvolume(fd, h, size);
- break;
-#ifdef VIOCGETFID_32
- case VIOCGETFID_32:
- case VIOCGETFID_64:
-#else
- case VIOCGETFID:
-#endif
- return viocgetfid (fd, h, size);
-#ifdef VIOCGETAL_32
- case VIOCGETAL_32:
- case VIOCGETAL_64:
-#else
- case VIOCGETAL:
-#endif
- return viocgetacl(fd, h, size);
-#ifdef VIOCSETAL_32
- case VIOCSETAL_32:
- case VIOCSETAL_64:
-#else
- case VIOCSETAL:
-#endif
- return viocsetacl(fd, h, size);
-#ifdef VIOCGETVOLSTAT_32
- case VIOCGETVOLSTAT_32:
- case VIOCGETVOLSTAT_64:
-#else
- case VIOCGETVOLSTAT:
-#endif
- return viocgetvolstat(fd, h, size);
-#ifdef VIOCSETVOLSTAT_32
- case VIOCSETVOLSTAT_32:
- case VIOCSETVOLSTAT_64:
-#else
- case VIOCSETVOLSTAT:
-#endif
- error = viocsetvolstat(fd, h, size);
- break;
-#ifdef VIOC_AFS_STAT_MT_PT_32
- case VIOC_AFS_STAT_MT_PT_32:
- case VIOC_AFS_STAT_MT_PT_64:
-#else
- case VIOC_AFS_STAT_MT_PT:
-#endif
- return vioc_afs_stat_mt_pt(fd, h, size);
-#ifdef VIOC_AFS_DELETE_MT_PT_32
- case VIOC_AFS_DELETE_MT_PT_32:
- case VIOC_AFS_DELETE_MT_PT_64:
-#else
- case VIOC_AFS_DELETE_MT_PT:
-#endif
- return vioc_afs_delete_mt_pt(fd, h, size);
-#ifdef VIOCWHEREIS_32
- case VIOCWHEREIS_32:
- case VIOCWHEREIS_64:
-#else
- case VIOCWHEREIS:
-#endif
- return viocwhereis(fd, h, size);
-#ifdef VIOCNOP_32
- case VIOCNOP_32:
- case VIOCNOP_64:
-#else
- case VIOCNOP:
-#endif
- error = EINVAL;
- break;
-#ifdef VIOCGETCELL_32
- case VIOCGETCELL_32:
- case VIOCGETCELL_64:
-#else
- case VIOCGETCELL:
-#endif
- return vioc_get_cell(fd, h, size);
-#ifdef VIOC_GETCELLSTATUS_32
- case VIOC_GETCELLSTATUS_32:
- case VIOC_GETCELLSTATUS_64:
-#else
- case VIOC_GETCELLSTATUS:
-#endif
- return vioc_get_cellstatus(fd, h, size);
-#ifdef VIOC_SETCELLSTATUS_32
- case VIOC_SETCELLSTATUS_32:
- case VIOC_SETCELLSTATUS_64:
-#else
- case VIOC_SETCELLSTATUS:
-#endif
- return vioc_set_cellstatus(fd, h, size);
-#ifdef VIOCNEWCELL_32
- case VIOCNEWCELL_32:
- case VIOCNEWCELL_64:
-#else
- case VIOCNEWCELL:
-#endif
- return vioc_new_cell(fd, h, size);
-#ifdef VIOC_VENUSLOG_32
- case VIOC_VENUSLOG_32:
- case VIOC_VENUSLOG_64:
-#else
- case VIOC_VENUSLOG:
-#endif
- error = viocvenuslog (fd, h, size);
- break;
-#ifdef VIOC_AFS_SYSNAME_32
- case VIOC_AFS_SYSNAME_32:
- case VIOC_AFS_SYSNAME_64:
-#else
- case VIOC_AFS_SYSNAME:
-#endif
- return vioc_afs_sysname (fd, h, size);
-#ifdef VIOC_FILE_CELL_NAME_32
- case VIOC_FILE_CELL_NAME_32:
- case VIOC_FILE_CELL_NAME_64:
-#else
- case VIOC_FILE_CELL_NAME:
-#endif
- return viocfilecellname (fd, h, size);
-#ifdef VIOC_GET_WS_CELL_32
- case VIOC_GET_WS_CELL_32:
- case VIOC_GET_WS_CELL_64:
-#else
- case VIOC_GET_WS_CELL:
-#endif
- return viocgetwscell (fd, h, size);
-#ifdef VIOCSETCACHESIZE_32
- case VIOCSETCACHESIZE_32:
- case VIOCSETCACHESIZE_64:
-#else
- case VIOCSETCACHESIZE:
-#endif
- error = viocsetcachesize (fd, h, size);
- break;
-#ifdef VIOCCKSERV_32
- case VIOCCKSERV_32:
- case VIOCCKSERV_64:
-#else
- case VIOCCKSERV:
-#endif
- return viocckserv (fd, h, size);
-#ifdef VIOCGETCACHEPARAMS_32
- case VIOCGETCACHEPARAMS_32:
- case VIOCGETCACHEPARAMS_64:
-#else
- case VIOCGETCACHEPARAMS:
-#endif
- return viocgetcacheparms (fd, h, size);
-#ifdef VIOC_GETRXKCRYPT_32
- case VIOC_GETRXKCRYPT_32:
- case VIOC_GETRXKCRYPT_64:
-#else
- case VIOC_GETRXKCRYPT:
-#endif
- return getrxkcrypt(fd, h, size);
-#ifdef VIOC_SETRXKCRYPT_32
- case VIOC_SETRXKCRYPT_32:
- case VIOC_SETRXKCRYPT_64:
-#else
- case VIOC_SETRXKCRYPT:
-#endif
- error = setrxkcrypt(fd, h, size);
- break;
-#ifdef VIOC_FPRIOSTATUS_32
- case VIOC_FPRIOSTATUS_32:
- case VIOC_FPRIOSTATUS_64:
-#else
- case VIOC_FPRIOSTATUS:
-#endif
- error = vioc_fpriostatus(fd, h, size);
- break;
-#ifdef VIOC_AVIATOR_32
- case VIOC_AVIATOR_32:
- case VIOC_AVIATOR_64:
-#else
- case VIOC_AVIATOR:
-#endif
- return viocaviator (fd, h, size);
-#ifdef VIOC_ARLADEBUG_32
- case VIOC_ARLADEBUG_32:
- case VIOC_ARLADEBUG_64:
-#else
- case VIOC_ARLADEBUG:
-#endif
- return vioc_arladebug (fd, h, size);
-#ifdef VIOC_GCPAGS_32
- case VIOC_GCPAGS_32:
- case VIOC_GCPAGS_64:
-#else
- case VIOC_GCPAGS:
-#endif
- error = vioc_gcpags (fd, h, size);
- break;
-#ifdef VIOC_CALCULATE_CACHE_32
- case VIOC_CALCULATE_CACHE_32:
- case VIOC_CALCULATE_CACHE_64:
-#else
- case VIOC_CALCULATE_CACHE:
-#endif
- return vioc_calculate_cache (fd, h, size);
-#ifdef VIOC_BREAKCALLBACK_32
- case VIOC_BREAKCALLBACK_32:
- case VIOC_BREAKCALLBACK_64:
-#else
- case VIOC_BREAKCALLBACK:
-#endif
- error = vioc_breakcallback (fd, h, size);
- break;
-#ifdef VIOCCKBACK_32
- case VIOCCKBACK_32 :
- case VIOCCKBACK_64 :
-#else
- case VIOCCKBACK :
-#endif
- error = vioc_ckback (fd, h, size);
- break;
-
-#ifdef AIOC_STATISTICS_32
- case AIOC_STATISTICS_32:
- case AIOC_STATISTICS_64:
-#else
- case AIOC_STATISTICS:
-#endif
- return aioc_statistics (fd, h, size);
-
-#ifdef AIOC_GETCACHEPARAMS_32
- case AIOC_GETCACHEPARAMS_32:
- case AIOC_GETCACHEPARAMS_64:
-#else
- case AIOC_GETCACHEPARAMS:
-#endif
- return aioc_getcacheparam(fd, h, size);
-
- default:
- arla_warnx (ADEBMSG, "unknown pioctl call %d", h->opcode);
- error = EINVAL ;
- }
-
- nnpfs_send_message_wakeup (fd, h->header.sequence_num, error);
-
- return 0;
-}
-
-
-/*
- * Return non-zero if there is a possibility that we have a network
- * connectivity. Can't tell the existence of network, just the lack of.
- *
- * Ignore lookback interfaces and known loopback addresses.
- */
-
-static int
-possibly_have_network(void)
-{
- struct ifaddrs *ifa, *ifa0;
- int found_addr = 0;
-
- if (getifaddrs(&ifa0) != 0)
- return 1; /* well we don't really have a clue, do we ? */
-
- for (ifa = ifa0; ifa != NULL && !found_addr; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr == NULL)
- continue;
-
-#if IFF_LOOPBACK
- if (ifa->ifa_flags & IFF_LOOPBACK)
- continue;
-#endif
-
- switch (ifa->ifa_addr->sa_family) {
- case AF_INET: {
- struct sockaddr_in *sin = (struct sockaddr_in *)ifa->ifa_addr;
- if (sin->sin_addr.s_addr == htonl(0x7f000001))
- continue;
- if (sin->sin_addr.s_addr == htonl(0))
- continue;
- found_addr = 1;
- break;
- }
-#ifdef RX_SUPPORT_INET6
- case AF_INET6:
- /*
- * XXX avoid link local and local loopback addresses since
- * those are not allowed in VLDB
- */
- found_addr = 1;
- break;
-#endif
- default:
- break;
- }
- }
- freeifaddrs(ifa0);
-
- /* if we found an acceptable address, good for us */
- if (found_addr)
- return 1;
- return 0;
-}
diff --git a/usr.sbin/afs/src/arlad/messages.h b/usr.sbin/afs/src/arlad/messages.h
deleted file mode 100644
index c20fd712ec1..00000000000
--- a/usr.sbin/afs/src/arlad/messages.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- *
- */
-
-/* $arla: messages.h,v 1.24 2002/09/07 10:43:22 lha Exp $ */
-
-#ifndef _MESSAGES_H_
-#define _MESSAGES_H_
-
-void nnpfs_message_init (void);
-int nnpfs_message_receive (int fd, struct nnpfs_message_header *h, u_int size);
-void break_callback (FCacheEntry *e);
-void install_attr (FCacheEntry *e, int flags);
-
-long afsfid2inode(const VenusFid *fid);
-
-int
-nnpfs_attr2afsstorestatus(struct nnpfs_attr *xa,
- AFSStoreStatus *storestatus);
-
-void
-update_fid(VenusFid oldfid, FCacheEntry *old_entry,
- VenusFid newfid, FCacheEntry *new_entry);
-
-enum { FCACHE2NNPFSNODE_LENGTH = 1 } ; /* allow update of filedata */
-
-#define FCACHE2NNPFSNODE_NO_LENGTH 0
-#define FCACHE2NNPFSNODE_ALL (FCACHE2NNPFSNODE_LENGTH)
-
-void
-fcacheentry2nnpfsnode (const VenusFid *fid,
- const VenusFid *statfid,
- AFSFetchStatus *status,
- struct nnpfs_msg_node *node,
- AccessEntry *ae,
- int flags);
-
-int
-VenusFid_cmp (const VenusFid *fid1, const VenusFid *fid2);
-
-#endif /* _MESSAGES_H_ */
diff --git a/usr.sbin/afs/src/arlad/nnpfs.c b/usr.sbin/afs/src/arlad/nnpfs.c
deleted file mode 100644
index fd05971faa2..00000000000
--- a/usr.sbin/afs/src/arlad/nnpfs.c
+++ /dev/null
@@ -1,540 +0,0 @@
-/*
- * Copyright (c) 1999 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "arla_local.h"
-
-RCSID("$arla: nnpfs.c,v 1.20 2002/10/28 11:16:39 haba Exp $");
-
-/*
- * Begining of breakout of nnpfs releated junk
- */
-
-static u_int *seqnums;
-
-static List *sleepers;
-
-/* number of times each type of message has been sent/recv */
-
-static struct {
- unsigned long sent;
- unsigned long recv;
-} nnpfs_stats[NNPFS_MSG_COUNT];
-
-static const char *rcvfuncs_name[] =
-{
- "version",
- "wakeup",
- "getroot",
- "installroot",
- "getnode",
- "installnode",
- "getattr",
- "installattr",
- "getdata",
- "installdata",
- "inactivenode",
- "invalidnode",
- "open",
- "put_data",
- "put_attr",
- "create",
- "mkdir",
- "link",
- "symlink",
- "remove",
- "rmdir",
- "rename",
- "pioctl",
- "wakeup_data",
- "updatefid",
- "advlock",
- "gc nodes"
-};
-
-/*
- * A interface for the userland to talk the kernel and recv
- * back a integer. For larger messages implement a simularfunction
- * that uses the `wakeup_data' message.
- */
-
-int
-nnpfs_message_rpc (int fd, struct nnpfs_message_header *h, u_int size)
-{
- int ret;
-
- ret = nnpfs_message_send (fd, h, size);
- if (ret)
- return ret;
- return nnpfs_message_sleep (h->sequence_num);
-}
-
-/*
- * Try to probe the version on `fd', returning the version.
- */
-
-static int
-nnpfs_send_message_version (int fd)
-{
- struct nnpfs_message_version msg;
- int ret;
-
- msg.header.opcode = NNPFS_MSG_VERSION;
- arla_warnx (ADEBMSG, "sending version");
- ret = nnpfs_message_rpc (fd, (struct nnpfs_message_header *)&msg,
- sizeof(msg));
- return ret;
-}
-
-/*
- * Probe for version on `fd'. Fail if != version
- */
-
-void
-nnpfs_probe_version (int fd, int version)
-{
- int ret = nnpfs_send_message_version (fd);
-
- if (ret != version)
- arla_errx (1, ADEBERROR,
- "Version mismatch. Nnpfs is version %d and arlad is version %d. Please {up,down}grade.",
- ret, version);
-}
-
-/*
- * Send `num' `fids' to nnpfs on `fd' as proposed gc-able fids
- * If `num' is 0 nnpfs should gc everything gc:able.
- */
-
-/* XXX VenusFid is wrong here */
-
-void
-nnpfs_send_message_gc_nodes (int fd, int num, VenusFid *fids)
-{
- struct nnpfs_message_gc_nodes msg;
- int i;
-
- arla_warnx (ADEBMSG,
- "nnpfs_send_message_gc_nodes sending gc: num = %d", num);
-
- if (num > NNPFS_GC_NODES_MAX_HANDLE)
- num = NNPFS_GC_NODES_MAX_HANDLE;
-
- msg.header.opcode = NNPFS_MSG_GC_NODES;
- msg.len = num;
-
- for (i = 0; i < num; i++)
- memcpy (&msg.handle[i], &fids[i], sizeof(*fids));
-
- nnpfs_message_send (fd, (struct nnpfs_message_header *)&msg,
- sizeof(msg));
-}
-
-/*
- * Init the nnpfs message passing things.
- */
-
-void
-nnpfs_message_init (void)
-{
- unsigned i;
-
- seqnums = (u_int *)malloc (sizeof (*seqnums) * getdtablesize ());
- if (seqnums == NULL)
- arla_err (1, ADEBERROR, errno, "nnpfs_message_init: malloc");
- for (i = 0; i < getdtablesize (); ++i)
- seqnums[i] = 0;
- sleepers = listnew ();
- if (sleepers == NULL)
- arla_err (1, ADEBERROR, errno, "nnpfs_message_init: listnew");
-
- assert (sizeof(rcvfuncs_name) / sizeof(*rcvfuncs_name) == NNPFS_MSG_COUNT);
-}
-
-/*
- * Go to entry in jump-table depending on entry.
- */
-
-int
-nnpfs_message_receive (int fd, struct nnpfs_message_header *h, u_int size)
-{
- unsigned opcode = h->opcode;
-
- if (opcode >= NNPFS_MSG_COUNT || rcvfuncs[opcode] == NULL ) {
- arla_warnx (ADEBMSG, "Bad message opcode = %u", opcode);
- return -1;
- }
-
- ++nnpfs_stats[opcode].recv;
-
- arla_warnx (ADEBMSG, "Rec message: opcode = %u (%s), size = %u",
- opcode, rcvfuncs_name[opcode], h->size);
-
- return (*rcvfuncs[opcode])(fd, h, size);
-}
-
-/*
- * Send a message to the kernel module.
- */
-
-int
-nnpfs_message_send (int fd, struct nnpfs_message_header *h, u_int size)
-{
- unsigned opcode = h->opcode;
- int ret;
-
- h->size = size;
- h->sequence_num = seqnums[fd]++;
-
- if (opcode >= NNPFS_MSG_COUNT) {
- arla_warnx (ADEBMSG, "Bad message opcode = %u", opcode);
- return -1;
- }
-
- ++nnpfs_stats[opcode].sent;
-
- arla_warnx (ADEBMSG, "Send message: opcode = %u (%s), size = %u",
- opcode, rcvfuncs_name[opcode], h->size);
-
- ret = kern_write (fd, h, size);
- if (ret != size) {
- arla_warn (ADEBMSG, errno, "nnpfs_message_send: write");
- return errno;
- } else
- return 0;
-}
-
-/*
- * This code can only wake up message of type `nnpfs_message_wakeup'
- */
-
-int
-nnpfs_message_wakeup (int fd, struct nnpfs_message_wakeup *h, u_int size)
-{
- Listitem *i, *next;
- struct nnpfs_message_wakeup *w;
-
- assert (sizeof(*w) >= size);
-
- for (i = listhead (sleepers); i; i = next) {
- next = listnext (sleepers, i);
- w = (struct nnpfs_message_wakeup *)listdata(i);
- if (w->header.sequence_num == h->sleepers_sequence_num) {
- listdel (sleepers, i);
- memcpy (w, h, size);
- LWP_SignalProcess ((char *)w);
- break;
- }
- }
- if (i == NULL)
- arla_warnx (ADEBWARN, "nnpfs_message_wakeup: no message to wakeup!");
- return 0;
-}
-
-/*
- * The middle and last part of the nnpfs_message_rpc.
- */
-
-int
-nnpfs_message_sleep (u_int seqnum)
-{
- struct nnpfs_message_wakeup h;
-
- h.header.sequence_num = seqnum;
-
- listaddtail (sleepers, &h);
- LWP_WaitProcess ((char *)&h);
- return h.error;
-}
-
-/*
- * Wake up a sleeping kernel-thread that sleeps on `seqnum'
- * and pass on `error' as an error the thread.
- */
-
-int
-nnpfs_send_message_wakeup (int fd, u_int seqnum, int error)
-{
- struct nnpfs_message_wakeup msg;
-
- msg.header.opcode = NNPFS_MSG_WAKEUP;
- msg.sleepers_sequence_num = seqnum;
- msg.error = error;
- arla_warnx (ADEBMSG, "sending wakeup: seq = %u, error = %d",
- seqnum, error);
- return nnpfs_message_send (fd, (struct nnpfs_message_header *)&msg,
- sizeof(msg));
-}
-
-
-/*
- * Wake-up a kernel-thread with `seqnum', and pass on `error'
- * ad return value. Add also a data blob for gerneric use.
- */
-
-int
-nnpfs_send_message_wakeup_data (int fd, u_int seqnum, int error,
- void *data, int size)
-{
- struct nnpfs_message_wakeup_data msg;
-
- msg.header.opcode = NNPFS_MSG_WAKEUP_DATA;
- msg.sleepers_sequence_num = seqnum;
- msg.error = error;
- arla_warnx (ADEBMSG,
- "sending wakeup: seq = %u, error = %d", seqnum, error);
-
- if (sizeof(msg.msg) < size || size < 0) {
- errno = EINVAL;
- arla_warnx (ADEBMSG,
- "nnpfs_send_message_wakeup_data: invalid message size %d",
- size);
- return errno;
- } else
- memcpy(msg.msg, data, size);
- msg.len = size;
- return nnpfs_message_send (fd, (struct nnpfs_message_header *)&msg,
- sizeof(msg));
-}
-
-/*
- *
- */
-
-struct write_buf {
- unsigned char buf[MAX_XMSG_SIZE];
- size_t len;
-};
-
-/*
- * Return 1 it buf is full, 0 if it's not.
- */
-
-static int
-add_new_msg (int fd,
- struct nnpfs_message_header *h, size_t size,
- struct write_buf *buf)
-{
- /* align on 8 byte boundery */
-
- if (size > sizeof (buf->buf) - buf->len)
- return 1;
-
- h->sequence_num = seqnums[fd]++;
- h->size = (size + 8) & ~ 7;
-
- assert (h->opcode >= 0 && h->opcode < NNPFS_MSG_COUNT);
- ++nnpfs_stats[h->opcode].sent;
-
- arla_warnx (ADEBMSG, "Multi-send: opcode = %u (%s), size = %u",
- h->opcode, rcvfuncs_name[h->opcode], h->size);
-
- memcpy (buf->buf + buf->len, h, size);
- memset (buf->buf + buf->len + size, 0, h->size - size);
- buf->len += h->size;
- return 0;
-}
-
-/*
- * Blast of a `buf' to `fd'.
- */
-
-static int
-send_msg (int fd, struct write_buf *buf)
-{
- int ret;
-
- if (buf->len == 0)
- return 0;
-
- ret = kern_write (fd, buf->buf, buf->len);
- if (ret != buf->len) {
- arla_warn (ADEBMSG, errno,
- "send_msg: write");
- buf->len = 0;
- return errno;
- }
- buf->len = 0;
- return 0;
-}
-
-/*
- *
- */
-
-int
-nnpfs_send_message_vmultiple (int fd,
- va_list args)
-{
- struct nnpfs_message_header *h;
- struct write_buf *buf;
- size_t size;
- int ret;
-
- buf = malloc (sizeof (*buf));
- if (buf == NULL)
- return ENOMEM;
-
- h = va_arg (args, struct nnpfs_message_header *);
- size = va_arg (args, size_t);
- buf->len = 0;
- while (h != NULL) {
- if (add_new_msg (fd, h, size, buf)) {
- ret = send_msg (fd, buf);
- if (ret) {
- free (buf);
- return ret;
- }
- if (add_new_msg (fd, h, size, buf))
- arla_warnx (ADEBERROR,
- "nnpfs_send_message_vmultiple: "
- "add_new_msg failed");
- }
-
- h = va_arg (args, struct nnpfs_message_header *);
- size = va_arg (args, size_t);
- }
- ret = send_msg (fd, buf);
- free (buf);
- return ret;
-}
-
-/*
- * Same as above but different.
- */
-
-int
-nnpfs_send_message_multiple (int fd,
- ...)
-{
- va_list args;
- int ret;
-
- va_start (args, fd);
- ret = nnpfs_send_message_vmultiple (fd, args);
- va_end (args);
- return ret;
-}
-
-/*
- * Almost same as above but different.
- */
-
-int
-nnpfs_send_message_multiple_list (int fd,
- struct nnpfs_message_header *h,
- size_t size,
- u_int num)
-{
- struct write_buf *buf;
- int ret = 0;
-
- buf = malloc (sizeof (*buf));
- if (buf == NULL)
- return ENOMEM;
- buf->len = 0;
- while (num && ret == 0) {
- if (add_new_msg (fd, h, size, buf)) {
- ret = send_msg (fd, buf);
- if (add_new_msg (fd, h, size, buf))
- arla_warnx (ADEBERROR,
- "nnpfs_send_message_multiple_list: "
- "add_new_msg failed");
- }
- h = (struct nnpfs_message_header *) (((unsigned char *)h) + size);
- num--;
- }
- if (ret) {
- free (buf);
- return ret;
- }
- ret = send_msg (fd, buf);
- free (buf);
- return ret;
-}
-
-/*
- * Send multiple message to the kernel (for performace/simple resons)
- */
-
-int
-nnpfs_send_message_wakeup_vmultiple (int fd,
- u_int seqnum,
- int error,
- va_list args)
-{
- struct nnpfs_message_wakeup msg;
- int ret;
-
- ret = nnpfs_send_message_vmultiple (fd, args);
- if (ret)
- arla_warnx (ADEBERROR, "nnpfs_send_message_wakeup_vmultiple: "
- "failed sending messages with error %d", ret);
-
- msg.header.opcode = NNPFS_MSG_WAKEUP;
- msg.header.size = sizeof(msg);
- msg.header.sequence_num = seqnums[fd]++;
- msg.sleepers_sequence_num = seqnum;
- msg.error = error;
-
- ++nnpfs_stats[NNPFS_MSG_WAKEUP].sent;
-
- arla_warnx (ADEBMSG, "multi-sending wakeup: seq = %u, error = %d",
- seqnum, error);
-
- ret = kern_write (fd, &msg, sizeof(msg));
- if (ret != sizeof(msg)) {
- arla_warn (ADEBMSG, errno,
- "nnpfs_send_message_wakeup_vmultiple: writev");
- return -1;
- }
- return 0;
-}
-
-/*
- * Same as above but different.
- */
-
-int
-nnpfs_send_message_wakeup_multiple (int fd,
- u_int seqnum,
- int error,
- ...)
-{
- va_list args;
- int ret;
-
- va_start (args, error);
- ret = nnpfs_send_message_wakeup_vmultiple (fd, seqnum, error, args);
- va_end (args);
- return ret;
-}
diff --git a/usr.sbin/afs/src/arlad/nnpfs.h b/usr.sbin/afs/src/arlad/nnpfs.h
deleted file mode 100644
index eb04ebd63e3..00000000000
--- a/usr.sbin/afs/src/arlad/nnpfs.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 1999 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * $arla: nnpfs.h,v 1.11 2002/09/07 10:43:26 lha Exp $
- */
-
-#ifndef __NNPFS_H_V
-#define __NNPFS_H_V 1
-
-void nnpfs_probe_version (int fd, int version);
-
-void nnpfs_message_init (void);
-int nnpfs_message_receive (int fd, struct nnpfs_message_header *h, u_int size);
-void nnpfs_send_message_gc_nodes (int fd, int num, VenusFid *fids);
-int nnpfs_message_wakeup (int fd, struct nnpfs_message_wakeup *h, u_int size);
-int nnpfs_message_sleep (u_int seqnum);
-int nnpfs_send_message_wakeup (int fd, u_int seqnum, int error);
-int nnpfs_send_message_wakeup_vmultiple (int fd, u_int seqnum,
- int error, va_list args);
-int nnpfs_send_message_wakeup_multiple (int fd, u_int seqnum,
- int error, ...);
-int nnpfs_send_message_wakeup_data (int fd, u_int seqnum, int error,
- void *data, int size);
-int nnpfs_send_message_multiple_list (int fd, struct nnpfs_message_header *h,
- size_t size, u_int num);
-int nnpfs_send_message_multiple (int fd, ...);
-int nnpfs_send_message_vmultiple (int fd, va_list args);
-
-int nnpfs_message_send (int fd, struct nnpfs_message_header *h, u_int size);
-int nnpfs_message_rpc (int fd, struct nnpfs_message_header *h, u_int size);
-
-typedef int
-(*nnpfs_message_function) (int, struct nnpfs_message_header*, u_int);
-
-extern nnpfs_message_function rcvfuncs[NNPFS_MSG_COUNT];
-
-#endif /* __NNPFS_H_V */
diff --git a/usr.sbin/afs/src/arlad/play_disco.c b/usr.sbin/afs/src/arlad/play_disco.c
deleted file mode 100644
index 7e7b7e8e84b..00000000000
--- a/usr.sbin/afs/src/arlad/play_disco.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "arla_local.h"
-#ifdef RCSID
-RCSID("$arla: play_disco.c,v 1.1 2002/05/26 14:57:49 lha Exp $") ;
-#endif
-
-int
-main(int argc, char **argv)
-{
- struct disco_play_context *c;
- char buf[DISCO_MAX_BUF_SZ];
-
- disco_openlog();
-
- disco_init_context(&c);
-
- while(disco_next_entry(c, buf, sizeof(buf)) == 0)
- disco_print_entry(stdout, buf, sizeof(buf));
-
- disco_close_context(c);
-
- disco_closelog();
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/arlad/poller.c b/usr.sbin/afs/src/arlad/poller.c
deleted file mode 100644
index 0d0b44a1cbd..00000000000
--- a/usr.sbin/afs/src/arlad/poller.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Poller of fileserver
- *
- * Its part of the afs protocol that you need to talk the server now
- * and then to make sure you don't have any droped callbacks.
- *
- * It is in its own module since mixing it with connection makes the
- * connection code ever harder to read and understand the it is today,
- * and there is enough of strange dependencies between clear conns and
- * auth/crypto conns today and when they are allowed to be gc-ed, etc.
- */
-
-
-#include "arla_local.h"
-#ifdef RCSID
-RCSID("$arla: poller.c,v 1.9 2003/03/04 22:31:37 lha Exp $") ;
-#endif
-
-#define POLLERCACHESIZE 101
-
-#define POLLERHEAPSIZE 101
-
-/* Hashtable of connections */
-static Hashtab *pollerhtab;
-
-/* Heap for poller */
-Heap *pollerheap;
-
-
-int poller_timeout = 300; /* 5 min */
-int poller_downhost_timeout = 60; /* 1 min */
-
-static PROCESS poller_pid;
-
-enum { POLLER_RUNNING, POLLER_SLEEPING, POLLER_WAITING } poller_status;
-
-/*
- * Functions for handling entries into the poller cache.
- */
-
-static int
-pollercmp (void *a, void *b)
-{
- PollerEntry *c1 = (PollerEntry*)a;
- PollerEntry *c2 = (PollerEntry*)b;
-
- return c1->server != c2->server;
-}
-
-static unsigned int
-pollerhash (void *a)
-{
- PollerEntry *c = (PollerEntry*)a;
-
- return c->server;
-}
-
-static int
-poller_time_cmp (const void *a, const void *b)
-{
- PollerEntry *c1 = (PollerEntry*)a;
- PollerEntry *c2 = (PollerEntry*)b;
-
- return c1->server - c2->server;
-}
-
-
-/*
- * Add it to heap, use the minium of cell's timeout value and
- * poller_{,downhost_}timeout.
- */
-
-static void
-poller_add(PollerEntry *e, int host_dead, cell_entry *c)
-{
- time_t timeout = 0;
-
- if (c)
- timeout = cell_get_poller_time(c);
-
- if (timeout == 0)
- timeout = max(poller_timeout, poller_downhost_timeout);
-
- if (host_dead == 0)
- timeout = min(poller_timeout, timeout);
- else
- timeout = min(poller_downhost_timeout, timeout);
-
- e->timeout = timeout + time(NULL);
-
- heap_insert(pollerheap, e, &e->heapptr);
-
- switch(poller_status) {
- case POLLER_SLEEPING:
- /* we can only insert before first entry if its the short
- * timeout, that is host_dead -> poller_downhost_timeout */
- if (host_dead)
- IOMGR_Cancel(poller_pid);
- break;
- case POLLER_WAITING:
- LWP_NoYieldSignal(poller_add);
- break;
- case POLLER_RUNNING:
- break;
- default:
- errx(-1, "poller_add: unknown poller_status %d\n", poller_status);
- /* NOTREACHED */
- }
-}
-
-
-/*
- * Add a poller event for this conn, there is really a fcache entry
- * that will need to be refreshed.
- */
-
-PollerEntry *
-poller_add_conn(ConnCacheEntry *conn)
-{
- PollerEntry *e, key;
- cell_entry *cell;
-
- key.server = rx_HostOf(rx_PeerOf(conn->connection));
-
- cell = cell_get_by_id(conn->cell);
-
- e = hashtabsearch(pollerhtab, &key);
- if (e == NULL) {
- e = malloc(sizeof(*e));
- if (e == NULL)
- return NULL;
-
- e->server = rx_HostOf(rx_PeerOf(conn->connection));
- e->cell = conn->cell;
- e->refcount = 0;
- hashtabadd(pollerhtab, e);
- } else
- heap_remove(pollerheap, e->heapptr);
-
- e->refcount++;
- poller_add(e, 0, cell);
-
- return e;
-}
-
-void
-poller_remove(PollerEntry *e)
-{
- assert(e->refcount > 0);
-
- e->refcount--;
- if (e->refcount == 0) {
- hashtabdel(pollerhtab, e);
- heap_remove(pollerheap, e->heapptr);
- free(e);
- }
-}
-
-struct poller_intr_arg {
- poller_iter_func func;
- void *arg;
-};
-
-static Bool
-poller_foreach_func(void *ptr, void *arg)
-{
- PollerEntry *e = ptr;
- struct poller_intr_arg *a = arg;
- e->refcount++;
- (*a->func)(e->cell, e->server, a->arg);
- poller_remove(e);
- return FALSE;
-}
-
-int
-poller_foreach(poller_iter_func iter_func, void *arg)
-{
- struct poller_intr_arg a;
-
- a.arg = arg;
- a.func = iter_func;
- hashtabforeach(pollerhtab, poller_foreach_func, &a);
-
- return 0;
-}
-
-/*
- *
- */
-
-#define POLLER_STACKSIZE (16*1024)
-
-/*
- * Loop waiting for things servers to probe.
- */
-
-static void
-poller (char *arg)
-{
- cell_entry *cell;
- PollerEntry *e;
- time_t now;
- int host_dead_p;
-
- for (;;) {
- poller_status = POLLER_RUNNING;
-
- arla_warnx(ADEBCONN, "poller waiting");
-
- now = time(NULL);
-
- e = (PollerEntry *)heap_head(pollerheap);
- if (e == NULL) {
- poller_status = POLLER_WAITING;
- LWP_WaitProcess(poller_add);
- continue;
- } else if (e->timeout > now) {
- poller_status = POLLER_SLEEPING;
- IOMGR_Sleep (e->timeout - now);
- continue;
- }
-
- arla_warnx(ADEBCONN, "running poller");
-
- e->refcount++;
-
- /* XXX should a dead host break callbacks ? */
-
- host_dead_p = 0;
-
- if (connected_mode != DISCONNECTED) {
- ConnCacheEntry *conn;
- CredCacheEntry *ce;
-
- ce = cred_get (e->cell, 0, CRED_NONE);
- if (ce == NULL) {
- arla_warnx(ADEBCONN, "cred_get failed - poller exiting");
- exit(-1);
- }
-
- conn = conn_get (e->cell, e->server, afsport,
- FS_SERVICE_ID, fs_probe, ce);
- cred_free (ce);
-
- if (conn) {
- if (!conn_isalivep (conn))
- host_dead_p = 1;
- else if (fs_probe(conn->connection) != 0)
- host_dead_p = 1;
- conn_free(conn);
- } else
- host_dead_p = 1;
- }
-
- cell = cell_get_by_id(e->cell);
-
- e->refcount--;
-
- heap_remove(pollerheap, e->heapptr);
- poller_add(e, host_dead_p, cell);
-
- arla_warnx(ADEBCONN, "poller done");
- }
-}
-
-/*
- * Find and return the cell for given `server', if the cell can't be
- * found, return -1.
- */
-
-int32_t
-poller_host2cell(uint32_t server)
-{
- PollerEntry *e, key;
-
- key.server = server;
-
- e = hashtabsearch(pollerhtab, &key);
- if (e == NULL)
- return -1;
- return e->cell;
-}
-
-/*
- * Initialize the poller.
- */
-
-void
-poller_init (void)
-{
- arla_warnx (ADEBCONN, "initpoller");
-
- pollerhtab = hashtabnew (POLLERCACHESIZE, pollercmp, pollerhash);
- if (pollerhtab == NULL)
- arla_errx (1, ADEBERROR, "poller_init: hashtabnew failed");
-
- pollerheap = heap_new(POLLERHEAPSIZE, poller_time_cmp);
- if (pollerheap == NULL)
- arla_errx (1, ADEBERROR, "poller_init: heap_new failed");
-
- poller_status = POLLER_RUNNING;
-
- if (LWP_CreateProcess (poller, POLLER_STACKSIZE, 1,
- NULL, "poller", &poller_pid))
- arla_errx (1, ADEBERROR,
- "conn: cannot create poller thread");
-}
diff --git a/usr.sbin/afs/src/arlad/poller.h b/usr.sbin/afs/src/arlad/poller.h
deleted file mode 100644
index 04b7070ed22..00000000000
--- a/usr.sbin/afs/src/arlad/poller.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _ARLA_POLLER_H
-#define _ARLA_POLLER_H 1
-
-typedef struct {
- uint32_t server; /* XXX replace with server ref entry */
- int32_t cell;
- int refcount;
- time_t timeout;
- heap_ptr heapptr;
-} PollerEntry;
-
-void
-poller_init (void);
-
-PollerEntry *
-poller_add_conn(ConnCacheEntry *conn);
-
-int32_t
-poller_host2cell(uint32_t server);
-
-typedef int (*poller_iter_func)(uint32_t cell, uint32_t conn, void *arg);
-
-int
-poller_foreach(poller_iter_func iter_func, void *arg);
-
-#if 0
-int32_t
-poller_get_cell_by_uuid(afsUUID *server);
-#endif
-
-void
-poller_remove(PollerEntry *e);
-
-#endif /* _ARLA_POLLER_H */
diff --git a/usr.sbin/afs/src/arlad/ptest.c b/usr.sbin/afs/src/arlad/ptest.c
deleted file mode 100644
index 3e6d4969962..00000000000
--- a/usr.sbin/afs/src/arlad/ptest.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <arla_local.h>
-
-enum connected_mode connected_mode = CONNECTED;
-
-static CredCacheEntry dummy_cred;
-
-CredCacheEntry *
-cred_get (long cell, nnpfs_pag_t cred, int type)
-{
- return &dummy_cred;
-}
-
-void
-cred_free (CredCacheEntry *ce)
-{
- assert(&dummy_cred == ce);
-}
-
-int
-fs_probe (struct rx_connection *conn)
-{
- return 0;
-}
-
-static ConnCacheEntry dummy_cce;
-
-ConnCacheEntry *
-conn_get (int32_t cell, uint32_t host, uint16_t port, uint16_t service,
- int (*probe)(struct rx_connection *),
- CredCacheEntry *ce)
-{
- return &dummy_cce;
-}
-
-void
-conn_free (ConnCacheEntry *e)
-{
- assert(&dummy_cce == e);
-}
-
-Bool
-conn_isalivep (ConnCacheEntry *e)
-{
- return TRUE;
-}
-
-int
-volcache_getname (uint32_t id, int32_t cell,
- char *name, size_t name_sz)
-{
- snprintf(name, name_sz, "dummy");
- return 0;
-}
-
-int
-main(int argc, char **argv)
-{
- ConnCacheEntry cce;
- struct rx_connection conn;
- struct rx_peer peer;
- unsigned long number;
- void *pe, *pe2;
- PROCESS p;
-
- LWP_InitializeProcessSupport(4, &p);
- arla_loginit("/dev/stdout", 0);
- cell_init(0, arla_log_method);
- poller_init();
-
- memset(&cce, 0, sizeof(cce));
- memset(&conn, 0, sizeof(conn));
- memset(&peer, 0, sizeof(peer));
-
- conn.peer = &peer;
- cce.connection = &conn;
-
- printf("add\n");
- number = 1000000;
- while(number--) {
- pe = poller_add_conn(&cce);
- }
- poller_remove(pe);
-
- printf("add-remove\n");
- number = 1000000;
- while(number--) {
- pe = poller_add_conn(&cce);
- poller_remove(pe);
- }
-
- printf("add-add-remove-remove-remove\n");
- pe = NULL;
- number = 1000000;
- while(number--) {
- pe = poller_add_conn(&cce);
- pe2 = poller_add_conn(&cce);
- if (pe != pe2)
- exit(-1);
- poller_remove(pe);
- poller_remove(pe2);
- }
- return 0;
-}
diff --git a/usr.sbin/afs/src/arlad/reconnect.h b/usr.sbin/afs/src/arlad/reconnect.h
deleted file mode 100644
index a1509a94d99..00000000000
--- a/usr.sbin/afs/src/arlad/reconnect.h
+++ /dev/null
@@ -1,41 +0,0 @@
-OBSOLETE /* COPYRIGHT (C) 1998
-OBSOLETE * THE REGENTS OF THE UNIVERSITY OF MICHIGAN
-OBSOLETE * ALL RIGHTS RESERVED
-OBSOLETE *
-OBSOLETE * PERMISSION IS GRANTED TO USE, COPY, CREATE DERIVATIVE WORKS
-OBSOLETE * AND REDISTRIBUTE THIS SOFTWARE AND SUCH DERIVATIVE WORKS
-OBSOLETE * FOR ANY PURPOSE, SO LONG AS THE NAME OF THE UNIVERSITY OF
-OBSOLETE * MICHIGAN IS NOT USED IN ANY ADVERTISING OR PUBLICITY
-OBSOLETE * PERTAINING TO THE USE OR DISTRIBUTION OF THIS SOFTWARE
-OBSOLETE * WITHOUT SPECIFIC, WRITTEN PRIOR AUTHORIZATION. IF THE
-OBSOLETE * ABOVE COPYRIGHT NOTICE OR ANY OTHER IDENTIFICATION OF THE
-OBSOLETE * UNIVERSITY OF MICHIGAN IS INCLUDED IN ANY COPY OF ANY
-OBSOLETE * PORTION OF THIS SOFTWARE, THEN THE DISCLAIMER BELOW MUST
-OBSOLETE * ALSO BE INCLUDED.
-OBSOLETE *
-OBSOLETE * THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION
-OBSOLETE * FROM THE UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY
-OBSOLETE * PURPOSE, AND WITHOUT WARRANTY BY THE UNIVERSITY OF
-OBSOLETE * MICHIGAN OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
-OBSOLETE * WITHOUT LIMITATION THE IMPLIED WARRANTIES OF
-OBSOLETE * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
-OBSOLETE * REGENTS OF THE UNIVERSITY OF MICHIGAN SHALL NOT BE LIABLE
-OBSOLETE * FOR ANY DAMAGES, INCLUDING SPECIAL, INDIRECT, INCIDENTAL, OR
-OBSOLETE * CONSEQUENTIAL DAMAGES, WITH RESPECT TO ANY CLAIM ARISING
-OBSOLETE * OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE, EVEN
-OBSOLETE * IF IT HAS BEEN OR IS HEREAFTER ADVISED OF THE POSSIBILITY OF
-OBSOLETE * SUCH DAMAGES.
-OBSOLETE */
-OBSOLETE
-OBSOLETE /* $arla: reconnect.h,v 1.5 2002/07/23 15:22:57 lha Exp $ */
-OBSOLETE
-OBSOLETE #ifndef _RECONNECT_H
-OBSOLETE #define _RECONNECT_H
-OBSOLETE
-OBSOLETE void
-OBSOLETE do_replay(char *log_file, int log_entries, VenusFid *changed_fid);
-OBSOLETE
-OBSOLETE VenusFid *
-OBSOLETE fid_translate(VenusFid *fid_in);
-OBSOLETE
-OBSOLETE #endif /* _RECONNECT_H */
diff --git a/usr.sbin/afs/src/arlad/service.h b/usr.sbin/afs/src/arlad/service.h
deleted file mode 100644
index dbc5ee47f8a..00000000000
--- a/usr.sbin/afs/src/arlad/service.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: service.h,v 1.12 2002/07/24 06:05:22 lha Exp $ */
-
-/*
- * Service IDs
- */
-
-#define VLDB_SERVICE_ID 52
-#define VOLSER_SERVICE_ID 4
-#define PR_SERVICE_ID 73
-#define FS_SERVICE_ID 1
-#define CM_SERVICE_ID 1
-#define BOS_SERVICE_ID 1
-#define VOTE_SERVICE_ID 50 /* ubik */
-#define DISK_SERVICE_ID 51 /* ubik */
-#define KA_AUTHENTICATION_SERVICE 731
-#define KA_TICKET_GRANTING_SERVICE 732
-#define KA_MAINTENANCE_SERVICE_ID 733 /* ka service */
-
diff --git a/usr.sbin/afs/src/arlad/state.c b/usr.sbin/afs/src/arlad/state.c
deleted file mode 100644
index 4760759b2ef..00000000000
--- a/usr.sbin/afs/src/arlad/state.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Copyright (c) 2001 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * The interface for the on disk storage of data when arla is down
- */
-
-#include "arla_local.h"
-RCSID("$arla: state.c,v 1.5 2002/09/30 19:13:39 lha Exp $");
-
-/*
- * Save the fcache inforation in `fn', call `func' until `func' return
- * a none zero value. A negative value is an errno, and a positive is
- * a signal to terminate the loop (success). `ptr' is passed to
- * `func'.
- */
-
-int
-state_store_fcache(const char *fn, store_fcache_fn func, void *ptr)
-{
- int ret, fd, save_errno;
- struct fcache_store st;
- uint32_t u1, u2;
- char file[MAXPATHLEN];
-
- snprintf(file, sizeof(file), "%s.new", fn);
-
- fd = open (file, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
- if (fd < 0)
- return errno;
- u1 = FCACHE_MAGIC_COOKIE;
- u2 = FCACHE_VERSION;
-
- if (write (fd, &u1, sizeof(u1)) != sizeof(u1)
- || write (fd, &u2, sizeof(u2)) != sizeof(u2)) {
- save_errno = errno;
-
- close (fd);
- return save_errno;
- }
-
- while (1) {
-
- memset(&st, 0, sizeof(st));
-
- ret = (*func)(&st, ptr);
- if (ret < 0) { /* errors */
- close(fd);
- return -ret;
- } else if (ret == STORE_SKIP) {
- continue;
- } else if (ret == STORE_NEXT) {
- if (write(fd, &st, sizeof(st)) != sizeof(st)) {
- save_errno = errno;
- close(fd);
- return save_errno;
- }
- } else if (ret == STORE_DONE) {
- break;
- } else
- errx(-1, "state_store_fcache: unknown return %d\n", ret);
- }
-
- if(close (fd))
- return errno;
- if (rename (file, fn))
- return errno;
-
- return 0;
-}
-
-int
-state_recover_fcache(const char *file, store_fcache_fn func, void *ptr)
-{
- int fd;
- struct fcache_store st;
- uint32_t u1, u2;
-
- fd = open (file, O_RDONLY | O_BINARY, 0);
- if (fd < 0)
- return errno;
- if (read (fd, &u1, sizeof(u1)) != sizeof(u1)
- || read (fd, &u2, sizeof(u2)) != sizeof(u2)) {
- close (fd);
- return EINVAL;
- }
- if (u1 != FCACHE_MAGIC_COOKIE) {
-#if 0
- arla_warnx (ADEBFCACHE, "dump file not recognized, ignoring");
-#endif
- close (fd);
- return EINVAL;
- }
- if (u2 != FCACHE_VERSION) {
-#if 0
- arla_warnx (ADEBFCACHE, "unknown dump file version number %u", u2);
-#endif
- close (fd);
- return EINVAL;
- }
-
- while (read (fd, &st, sizeof(st)) == sizeof(st)) {
-
- st.cell[sizeof(st.cell)-1] = '\0';
- st.parentcell[sizeof(st.parentcell)-1] = '\0';
-
- if ((*func)(&st, ptr)) {
- close(fd);
- return 1;
- }
- }
- close (fd);
-
- return 0;
-}
-
-/*
- * Save the volcache inforation in `fn', call `func' until `func' return
- * a none zero value. A negative value is an errno, and a positive is
- * a signal to terminate the loop (success). `ptr' is passed to
- * `func'.
- */
-
-int
-state_store_volcache(const char *fn, store_volcache_fn func, void *ptr)
-{
- int ret, fd, save_errno;
- struct volcache_store st;
- uint32_t u1, u2;
- char file[MAXPATHLEN];
-
- snprintf(file, sizeof(file), "%s.new", fn);
-
- fd = open (file, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
- if (fd < 0)
- return errno;
- u1 = VOLCACHE_MAGIC_COOKIE;
- u2 = VOLCACHE_VERSION;
-
- if (write (fd, &u1, sizeof(u1)) != sizeof(u1)
- || write (fd, &u2, sizeof(u2)) != sizeof(u2)) {
- save_errno = errno;
-
- close (fd);
- return save_errno;
- }
-
- while (1) {
-
- memset(&st, 0, sizeof(st));
-
- ret = (*func)(&st, ptr);
- if (ret < 0) { /* errors */
- close(fd);
- return -ret;
- } else if (ret == STORE_SKIP) {
- continue;
- } else if (ret == STORE_NEXT) {
- if (write(fd, &st, sizeof(st)) != sizeof(st)) {
- save_errno = errno;
- close(fd);
- return save_errno;
- }
- } else if (ret == STORE_DONE) {
- break;
- } else
- errx(-1, "state_store_volcache: unknown return %d\n", ret);
- }
-
- if(close (fd))
- return errno;
- if (rename (file, fn))
- return errno;
-
- return 0;
-}
-
-int
-state_recover_volcache(const char *file, store_volcache_fn func, void *ptr)
-{
- int fd;
- struct volcache_store st;
- uint32_t u1, u2;
-
- fd = open (file, O_RDONLY | O_BINARY, 0);
- if (fd < 0)
- return errno;
- if (read (fd, &u1, sizeof(u1)) != sizeof(u1)
- || read (fd, &u2, sizeof(u2)) != sizeof(u2)) {
- close (fd);
- return EINVAL;
- }
- if (u1 != VOLCACHE_MAGIC_COOKIE) {
-#if 0
- arla_warnx (ADEBVOLCACHE, "dump file not recognized, ignoring");
-#endif
- close (fd);
- return EINVAL;
- }
- if (u2 != VOLCACHE_VERSION) {
-#if 0
- arla_warnx (ADEBVOLCACHE, "unknown dump file version number %u", u2);
-#endif
- close (fd);
- return EINVAL;
- }
-
- while (read (fd, &st, sizeof(st)) == sizeof(st)) {
-
- st.cell[sizeof(st.cell)-1] = '\0';
-
- if ((*func)(&st, ptr)) {
- close(fd);
- return 1;
- }
- }
- close (fd);
-
- return 0;
-}
-
diff --git a/usr.sbin/afs/src/arlad/state.h b/usr.sbin/afs/src/arlad/state.h
deleted file mode 100644
index 1e41c7d6e41..00000000000
--- a/usr.sbin/afs/src/arlad/state.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 2001 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * The interface for the on disk storage of data when arla is down
- */
-
-/* $arla: state.h,v 1.3 2002/07/24 06:06:13 lha Exp $ */
-
-#ifndef _STORE_H_
-#define _STORE_H_
-
-/*
- *
- */
-#define STORE_CELLNAMELENGTH 256
-
-/*
- * This is magic cookie for the dump of the fcache.
- * It's supposed not to be able to be confused with an old-style
- * dump (with no header)
- */
-#define FCACHE_MAGIC_COOKIE 0xff1201ff
-
-/*
- * current version number of the dump file
- */
-#define FCACHE_VERSION 0x5
-
-struct fcache_store {
- char cell[STORE_CELLNAMELENGTH];
- AFSFid fid;
- unsigned refcount;
- size_t length;
- size_t fetched_length;
- AFSVolSync volsync;
- AFSFetchStatus status;
- uint32_t anonaccess;
- unsigned index;
- struct {
- unsigned attrp : 1;
- unsigned datap : 1;
- unsigned extradirp : 1;
- unsigned mountp : 1;
- unsigned fake_mp : 1;
- unsigned vol_root : 1;
- } flags;
- u_int tokens;
- char parentcell[STORE_CELLNAMELENGTH];
- AFSFid parent;
- Bool priority;
-};
-
-/*
- * This is magic cookie for the dump of the volcache.
- * It's supposed not to be able to be confused with an old-style
- * dump (with no header)
- */
-
-#define VOLCACHE_MAGIC_COOKIE 0x00120100
-
-/*
- * current version number of the dump file
- */
-
-#define VOLCACHE_VERSION 0x4
-
-struct volcache_store {
- char cell[STORE_CELLNAMELENGTH];
- nvldbentry entry;
- AFSVolSync volsync;
- unsigned refcount;
-};
-
-enum { STORE_NEXT = 0, STORE_DONE = 1, STORE_SKIP = 2 };
-
-typedef int (*store_fcache_fn)(struct fcache_store *, void *);
-typedef int (*store_volcache_fn)(struct volcache_store *, void *);
-
-int
-state_recover_volcache(const char *file, store_volcache_fn func, void *ptr);
-
-int
-state_store_volcache(const char *fn, store_volcache_fn func, void *ptr);
-
-int
-state_recover_fcache(const char *file, store_fcache_fn func, void *ptr);
-
-int
-state_store_fcache(const char *fn, store_fcache_fn func, void *ptr);
-
-#endif /* _STORE_H */
diff --git a/usr.sbin/afs/src/arlad/stats.c b/usr.sbin/afs/src/arlad/stats.c
deleted file mode 100644
index caa9535edec..00000000000
--- a/usr.sbin/afs/src/arlad/stats.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Copyright (c) 2001 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "arla_local.h"
-RCSID("$arla: stats.c,v 1.10 2002/09/07 01:30:02 lha Exp $");
-
-#define MIN_FETCH_BLOCKSIZE 65536
-
-int fetch_block_size = MIN_FETCH_BLOCKSIZE;
-
-#define HISTOGRAM_SLOTS 32
-#define STATHASHSIZE 997
-
-struct time_statistics {
- uint32_t measure_type;
- uint32_t host;
- uint32_t partition;
- uint32_t measure_items; /* normed by get_histgram_slots */
- uint32_t count[HISTOGRAM_SLOTS];
- int64_t measure_items_total[HISTOGRAM_SLOTS];
- int64_t elapsed_time[HISTOGRAM_SLOTS];
-};
-
-static unsigned
-statistics_hash (void *p)
-{
- struct time_statistics *stats = (struct time_statistics*)p;
-
- return stats->measure_type + stats->host +
- stats->partition * 32 * 32 + stats->measure_items * 32;
-}
-
-/*
- * Compare two entries. Return 0 if and only if the same.
- */
-
-static int
-statistics_cmp (void *a, void *b)
-{
- struct time_statistics *f1 = (struct time_statistics*)a;
- struct time_statistics *f2 = (struct time_statistics*)b;
-
- return f1->measure_type != f2->measure_type
- || f1->host != f2->host
- || f1->partition != f2->partition
- || f1->measure_items != f2->measure_items;
-}
-
-static Hashtab *statistics;
-
-static int
-get_histogram_slot(uint32_t value)
-{
- int i;
-
- for (i = HISTOGRAM_SLOTS - 1; i > 0; i--) {
- if (value >> i)
- return i;
- }
- return 0;
-}
-
-static void
-add_time_statistics(uint32_t measure_type, uint32_t host,
- uint32_t partition, uint32_t measure_items,
- int64_t elapsed_time)
-{
- uint32_t time_slot;
- struct time_statistics *ts;
- struct time_statistics *ts2;
-
- ts = malloc(sizeof(*ts));
-
- time_slot = get_histogram_slot(elapsed_time);
- ts->measure_type = measure_type;
- ts->measure_items = get_histogram_slot(measure_items);
- ts->host = host;
- ts->partition = partition;
- ts2 = hashtabsearch (statistics, (void*)(ts));
- if (ts2) {
- ts2->count[time_slot]++;
- ts2->elapsed_time[time_slot] += elapsed_time;
- ts2->measure_items_total[time_slot] += measure_items;
- free(ts);
- } else {
- memset(ts->count, 0, sizeof(ts->count));
- memset(ts->measure_items_total, 0, sizeof(ts->measure_items_total));
- memset(ts->elapsed_time, 0, sizeof(ts->elapsed_time));
- ts->count[time_slot]++;
- ts->elapsed_time[time_slot] += elapsed_time;
- ts->measure_items_total[time_slot] += measure_items;
- hashtabadd(statistics, ts);
- }
-}
-
-void
-collectstats_init (void)
-{
- statistics = hashtabnewf(STATHASHSIZE,
- statistics_cmp, statistics_hash, HASHTAB_GROW);
-
- if (statistics == NULL)
- arla_err(1, ADEBINIT, errno, "collectstats_init: cannot malloc");
-}
-
-void
-collectstats_start (struct collect_stat *p)
-{
- struct timeval starttime;
-
- gettimeofday(&starttime, NULL);
- p->starttime = starttime.tv_sec * 1000000LL + starttime.tv_usec;
-}
-
-void
-collectstats_stop (struct collect_stat *p,
- FCacheEntry *entry,
- ConnCacheEntry *conn,
- long partition,
- int measure_type, int measure_items)
-{
- struct timeval stoptime;
- int64_t elapsed_time;
-
- if (partition == -1)
- return;
-
- gettimeofday(&stoptime, NULL);
-
- elapsed_time = stoptime.tv_sec * 1000000LL + stoptime.tv_usec;
- elapsed_time -= p->starttime;
- add_time_statistics(measure_type, conn->host, partition,
- measure_items, elapsed_time);
-}
-
-struct hostpart {
- uint32_t host;
- uint32_t part;
-};
-
-static unsigned
-hostpart_hash (void *p)
-{
- struct hostpart *h = (struct hostpart*)p;
-
- return h->host * 256 + h->part;
-}
-
-static int
-hostpart_cmp (void *a, void *b)
-{
- struct hostpart *h1 = (struct hostpart*)a;
- struct hostpart *h2 = (struct hostpart*)b;
-
- return h1->host != h2->host ||
- h1->part != h2->part;
-}
-
-static Bool
-hostpart_addhash (void *ptr, void *arg)
-{
- Hashtab *hostparthash = (Hashtab *) arg;
- struct time_statistics *s = (struct time_statistics *) ptr;
- struct hostpart *h;
-
- h = malloc(sizeof(*h));
- h->host = s->host;
- h->part = s->partition;
-
- hashtabaddreplace(hostparthash, h);
- return FALSE;
-}
-
-struct hostpart_collect_args {
- uint32_t *host;
- uint32_t *part;
- int i;
- int max;
-};
-
-static Bool
-hostpart_collect (void *ptr, void *arg)
-{
- struct hostpart_collect_args *collect_args =
- (struct hostpart_collect_args *) arg;
- struct hostpart *h = (struct hostpart *) ptr;
-
- if (collect_args->i >= collect_args->max)
- return TRUE;
-
- collect_args->host[collect_args->i] = h->host;
- collect_args->part[collect_args->i] = h->part;
- ++collect_args->i;
-
- return FALSE;
-}
-
-int
-collectstats_hostpart(uint32_t *host, uint32_t *part, int *n)
-{
- Hashtab *hostparthash;
- struct hostpart_collect_args collect_args;
-
- hostparthash = hashtabnewf(101, hostpart_cmp, hostpart_hash, HASHTAB_GROW);
-
- hashtabforeach(statistics, hostpart_addhash, hostparthash);
-
- collect_args.host = host;
- collect_args.part = part;
- collect_args.i = 0;
- collect_args.max = *n;
- hashtabforeach(hostparthash, hostpart_collect, &collect_args);
- *n = collect_args.i;
-
- hashtabrelease(hostparthash);
-
- return 0;
-}
-
-int
-collectstats_getentry(uint32_t host, uint32_t part, uint32_t type,
- uint32_t items_slot, uint32_t *count,
- int64_t *items_total, int64_t *total_time)
-{
- struct time_statistics ts;
- struct time_statistics *ts2;
-
- ts.measure_type = type;
- ts.measure_items = items_slot;
- ts.host = host;
- ts.partition = part;
- ts2 = hashtabsearch (statistics, (void*)(&ts));
- if (ts2 == NULL) {
- memset(count, 0, 4 * HISTOGRAM_SLOTS);
- memset(items_total, 0, 8 * HISTOGRAM_SLOTS);
- memset(total_time, 0, 8 * HISTOGRAM_SLOTS);
- } else {
- memcpy(count, ts2->count, 4 * HISTOGRAM_SLOTS);
- memcpy(items_total, ts2->measure_items_total, 8 * HISTOGRAM_SLOTS);
- memcpy(total_time, ts2->elapsed_time, 8 * HISTOGRAM_SLOTS);
- }
-
- return 0;
-}
-
-void
-stats_set_prefetch(size_t sz)
-{
- if (sz < MIN_FETCH_BLOCKSIZE)
- sz = MIN_FETCH_BLOCKSIZE;
-}
-
-size_t
-stats_prefetch(ConnCacheEntry *conn, uint32_t part)
-{
- return fetch_block_size;
-}
-
-size_t
-stats_fetch_round(ConnCacheEntry *conn, uint32_t part, size_t size)
-{
- return fetch_block_size - (size % fetch_block_size) + size;
-}
diff --git a/usr.sbin/afs/src/arlad/stats.h b/usr.sbin/afs/src/arlad/stats.h
deleted file mode 100644
index 807087ee5a0..00000000000
--- a/usr.sbin/afs/src/arlad/stats.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2001 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef ARLA_STATS_H
-#define ARLA_STATS_H 1
-
-
-/* Struct with collected statistics */
-struct collect_stat{
- int64_t starttime;
-};
-
-void
-collectstats_init (void);
-
-void
-collectstats_start (struct collect_stat *p);
-
-void
-collectstats_stop (struct collect_stat *p,
- FCacheEntry *entry,
- ConnCacheEntry *conn,
- long partition,
- int measure_type, int measure_items);
-
-int
-collectstats_hostpart(uint32_t *host, uint32_t *part, int *n);
-
-int
-collectstats_getentry(uint32_t host, uint32_t part, uint32_t type,
- uint32_t items_slot, uint32_t *count,
- int64_t *items_total, int64_t *total_time);
-
-void
-stats_set_prefetch(size_t sz);
-
-size_t
-stats_prefetch(ConnCacheEntry *conn, uint32_t part);
-
-size_t
-stats_fetch_round(ConnCacheEntry *conn, uint32_t part, size_t size);
-
-#endif /* ARLA_STATS_H */
diff --git a/usr.sbin/afs/src/arlad/subr.c b/usr.sbin/afs/src/arlad/subr.c
deleted file mode 100644
index b7486fa87dd..00000000000
--- a/usr.sbin/afs/src/arlad/subr.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "arla_local.h"
-RCSID("$arla: subr.c,v 1.12 2002/09/07 10:43:30 lha Exp $");
-
-/*
- * come up with a good inode number for `name', `fid' in `parent'
- */
-
-ino_t
-dentry2ino (const char *name, const VenusFid *fid, const FCacheEntry *parent)
-{
- if (strcmp (name, ".") == 0
- && (parent->flags.vol_root
- || (fid->fid.Vnode == 1 && fid->fid.Unique == 1))
- && parent->volume != NULL)
- return afsfid2inode (&parent->volume->mp_fid);
- else if (strcmp (name, "..") == 0
- && (parent->flags.vol_root
- || (parent->fid.fid.Vnode == 1
- && parent->fid.fid.Unique == 1))
- && parent->volume != NULL)
- return afsfid2inode (&parent->volume->parent_fid);
- else if (strcmp (name, "..") == 0
- && fid->fid.Vnode == 1 && fid->fid.Unique == 1
- && parent->volume != NULL)
- return afsfid2inode (&parent->volume->mp_fid);
- else
- return afsfid2inode (fid);
-}
-
-/*
- * Assume `e' has valid data.
- */
-
-int
-conv_dir_sub (FCacheEntry *e, CredCacheEntry *ce, u_int tokens,
- fcache_cache_handle *cache_handle,
- char *cache_name, size_t cache_name_sz,
- fdir_readdir_func func,
- void (*flush_func)(void *),
- size_t blocksize)
-{
- struct write_dirent_args args;
- int ret;
- int fd;
- fbuf the_fbuf;
-
- e->flags.extradirp = TRUE;
- fcache_extra_file_name (e, cache_name, cache_name_sz);
- e->tokens |= NNPFS_DATA_R | NNPFS_OPEN_NR;
-
- args.fd = open (cache_name, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
- if (args.fd == -1) {
- ret = errno;
- arla_warn (ADEBWARN, ret, "open %s", cache_name);
- return ret;
- }
- ret = fcache_fhget (cache_name, cache_handle);
-
- args.off = 0;
- args.buf = (char *)malloc (blocksize);
- if (args.buf == NULL) {
- ret = errno;
- arla_warn (ADEBWARN, ret, "malloc %u", (unsigned)blocksize);
- close (args.fd);
- return ret;
- }
-
- ret = fcache_get_fbuf (e, &fd, &the_fbuf,
- O_RDONLY, FBUF_READ|FBUF_PRIVATE);
- if (ret) {
- close (args.fd);
- free (args.buf);
- return ret;
- }
-
- args.ptr = args.buf;
- args.last = NULL;
- args.e = e;
- args.ce = ce;
-
- /* translate to local dir format, write in args.fd */
- fdir_readdir (&the_fbuf, func, (void *)&args, e->fid, NULL);
-
- fbuf_end (&the_fbuf);
- close (fd);
-
- if (args.last)
- (*flush_func) (&args);
- free (args.buf);
- ret = close (args.fd);
- if (ret)
- ret = errno;
- return ret;
-}
diff --git a/usr.sbin/afs/src/arlad/subr.h b/usr.sbin/afs/src/arlad/subr.h
deleted file mode 100644
index 3b780d1d1f7..00000000000
--- a/usr.sbin/afs/src/arlad/subr.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Header with prototypes for OS-specific functions.
- */
-
-/* $arla: subr.h,v 1.13 2002/07/24 06:07:04 lha Exp $ */
-
-#ifndef _SUBR_H_
-#define _SUBR_H_
-
-#include <fdir.h>
-
-struct write_dirent_args {
- int fd;
-#ifdef HAVE_OFF64_T
- off64_t off;
-#else
- off_t off;
-#endif
- char *buf;
- char *ptr;
- void *last;
- FCacheEntry *e;
- CredCacheEntry *ce;
-};
-
-ino_t
-dentry2ino (const char *name, const VenusFid *fid, const FCacheEntry *parent);
-
-int
-conv_dir (FCacheEntry *e, CredCacheEntry *ce, u_int tokens,
- fcache_cache_handle *, char *, size_t);
-
-int
-conv_dir_sub (FCacheEntry *e, CredCacheEntry *ce, u_int tokens,
- fcache_cache_handle *cache_handle,
- char *cache_name, size_t cache_name_sz,
- fdir_readdir_func func,
- void (*flush_func)(void *),
- size_t blocksize);
-
-int
-dir_remove_name (FCacheEntry *e, const char *filename,
- fcache_cache_handle *cache_handle,
- char *cache_name, size_t cache_name_sz);
-
-#endif /* _SUBR_H_ */
-
diff --git a/usr.sbin/afs/src/arlad/unknown-subr.c b/usr.sbin/afs/src/arlad/unknown-subr.c
deleted file mode 100644
index a373c9f181c..00000000000
--- a/usr.sbin/afs/src/arlad/unknown-subr.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 1995 - 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 4. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "arla_local.h"
-
-#ifdef __CYGWIN32__
-#include <windows.h>
-#endif
-
-RCSID("$arla: unknown-subr.c,v 1.13 2003/01/10 03:05:49 lha Exp $");
-
-int
-dir_remove_name (FCacheEntry *e, const char *filename,
- fcache_cache_handle *cache_handle,
- char *cache_name, size_t cache_name_sz)
-{
- return 0;
-}
-
-int
-conv_dir (FCacheEntry *e, CredCacheEntry *ce, u_int tokens,
- fcache_cache_handle *cache_handle,
- char *cache_name, size_t cache_name_sz)
-{
-
- assert (e->status.FileType == TYPE_DIR);
-
- fcache_conv_file_name(e, cache_name, cache_name_sz);
-
- e->tokens |= NNPFS_DATA_R | NNPFS_OPEN_NR;
- return 0;
-}
diff --git a/usr.sbin/afs/src/arlad/volcache.c b/usr.sbin/afs/src/arlad/volcache.c
deleted file mode 100644
index 1fb027dad74..00000000000
--- a/usr.sbin/afs/src/arlad/volcache.c
+++ /dev/null
@@ -1,1314 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Manage our cache of volume information.
- */
-
-#include "arla_local.h"
-RCSID("$arla: volcache.c,v 1.116 2003/04/10 15:49:13 lha Exp $") ;
-
-static int volcache_timeout = VOLCACHE_TIMEOUT;
-
-static const char *root_volume_name = "root.afs";
-
-/*
- * Return the root volume name.
- */
-
-const char *
-volcache_get_rootvolume (void)
-{
- return root_volume_name;
-}
-
-/*
- * Set the current root volume name.
- */
-
-void
-volcache_set_rootvolume (const char *volname)
-{
- assert (volname != NULL);
-
- root_volume_name = volname;
-}
-
-#define VOLCACHE_SIZE 2053
-#define VOLCACHE_INC 300
-
-/* Hashtable of entries by name */
-static Hashtab *volnamehashtab;
-
-/* Hashtable of entries by number */
-static Hashtab *volidhashtab;
-
-/* A list with all entries */
-static List *lrulist;
-
-/* # of entries */
-static unsigned nvolcacheentries = 0;
-
-/* # of active entries */
-static unsigned nactive_volcacheentries = 0;
-
-/*
- * VolCacheEntries are indexed by (name, cell) in volnamehashtab
- */
-
-static int
-volnamecmp (void *a, void *b)
-{
- struct name_ptr *n1 = (struct name_ptr *)a;
- struct name_ptr *n2 = (struct name_ptr *)b;
-
- return strcmp (n1->name, n2->name)
- || n1->cell != n2->cell;
-}
-
-static unsigned
-volnamehash (void *a)
-{
- struct name_ptr *n = (struct name_ptr *)a;
-
- return hashadd (n->name) + n->cell;
-}
-
-/*
- * and by (volid, cell) in volidhashtab
- */
-
-static int
-volidcmp (void *a, void *b)
-{
- struct num_ptr *n1 = (struct num_ptr *)a;
- struct num_ptr *n2 = (struct num_ptr *)b;
-
- return n1->cell != n2->cell || n1->vol != n2->vol;
-}
-
-static unsigned
-volidhash (void *a)
-{
- struct num_ptr *n = (struct num_ptr *)a;
-
- return n->cell + n->vol;
-}
-
-/*
- * Compare two `nvldbentry' and return 0 if they are equal.
- */
-
-static int
-cmp_nvldbentry (const nvldbentry *n1, const nvldbentry *n2)
-{
- int i;
-
- if (strcmp (n1->name, n2->name) != 0)
- return 1;
- if (n1->nServers != n2->nServers)
- return 1;
- for (i = 0; i < n1->nServers; ++i)
- if (n1->serverNumber[i] != n2->serverNumber[i]
- || n1->serverPartition[i] != n2->serverPartition[i]
- || n1->serverFlags[i] != n2->serverFlags[i])
- return 1;
- if (n1->flags != n2->flags)
- return 1;
- if (n1->flags & VLF_RWEXISTS
- && n1->volumeId[RWVOL] != n2->volumeId[RWVOL])
- return 1;
- if (n1->flags & VLF_ROEXISTS
- && n1->volumeId[ROVOL] != n2->volumeId[ROVOL])
- return 1;
- if (n1->flags & VLF_BOEXISTS
- && n1->volumeId[BACKVOL] != n2->volumeId[BACKVOL])
- return 1;
- if (n1->cloneId != n2->cloneId)
- return 1;
- return 0;
-}
-
-/*
- * Do consistency checks and simple clean-ups.
- */
-
-static void
-sanitize_nvldbentry (nvldbentry *n)
-{
- if (n->nServers > NMAXNSERVERS) {
- arla_warnx (ADEBVOLCACHE, "too many servers %d > %d",
- n->nServers, NMAXNSERVERS);
- n->nServers = NMAXNSERVERS;
- }
-}
-
-/*
- * Create `n' entries and add at the end of `lrulist'
- */
-
-static void
-create_new_entries (unsigned n)
-{
- VolCacheEntry *entries;
- int i;
-
- entries = calloc (n, sizeof(VolCacheEntry));
- if (entries == NULL)
- arla_errx (1, ADEBERROR, "volcache: calloc failed");
-
- for (i = 0; i < n; ++i) {
- entries[i].cell = -1;
- entries[i].li = listaddtail (lrulist, &entries[i]);
- }
-
- nvolcacheentries += n;
-}
-
-/*
- * mark as not being in use
- */
-
-static void
-mark_unused (VolCacheEntry *e)
-{
- if (e->refcount == 0 && e->vol_refs == 0) {
- listdel (lrulist, e->li);
- e->li = listaddtail (lrulist, e);
- assert (nactive_volcacheentries > 0);
- assert (nactive_volcacheentries <= nvolcacheentries);
- --nactive_volcacheentries;
- }
-}
-
-/*
- * Re-cycle an entry:
- * remove it from the hashtab, clear it out.
- */
-
-static void
-recycle_entry (VolCacheEntry *e)
-{
- int i;
-
- assert (e->refcount == 0 && e->vol_refs == 0);
-
- for (i = 0; i < MAXTYPES; ++i)
- if (e->num_ptr[i].ptr != NULL)
- hashtabdel (volidhashtab, &e->num_ptr[i]);
- if (e->name_ptr.ptr != NULL)
- hashtabdel (volnamehashtab, &e->name_ptr);
- if (e->parent) {
- volcache_volfree (e->parent);
- e->parent = NULL;
- }
-
- memset (&e->entry, 0, sizeof(e->entry));
- memset (&e->volsync, 0, sizeof(e->volsync));
- e->flags.validp = FALSE;
- e->flags.stablep = FALSE;
- memset (&e->status, 0, sizeof(e->status));
- memset (&e->name_ptr, 0, sizeof(e->name_ptr));
- memset (&e->num_ptr, 0, sizeof(e->num_ptr));
-}
-
-/*
- * Get and return a free entry.
- * Place it at the head of the lrulist.
- */
-
-static VolCacheEntry *
-get_free_entry (void)
-{
- Listitem *item;
- VolCacheEntry *e;
-
- assert (!listemptyp(lrulist));
-
- for(item = listtail (lrulist);
- item;
- item = listprev (lrulist, item)) {
- e = (VolCacheEntry *)listdata(item);
- if (e->refcount == 0 && e->vol_refs == 0) {
- listdel (lrulist, item);
- recycle_entry (e);
- e->li = listaddhead (lrulist, e);
- return e;
- }
- }
-
- create_new_entries (VOLCACHE_INC);
-
- e = (VolCacheEntry *)listdeltail (lrulist);
- assert (e != NULL && e->refcount == 0);
- e->li = listaddhead (lrulist, e);
- return e;
-}
-
-/*
- *
- */
-
-static Bool
-clones_exists (VolCacheEntry *e)
-{
- int i;
-
- for (i = 0; i < MAXTYPES; ++i)
- if (e->num_ptr[i].ptr != NULL)
- return TRUE;
- return FALSE;
-}
-
-/*
- *
- */
-
-void
-volcache_process_marks (VolCacheEntry *ve)
-{
- int i, status, inval;
-
- inval = 0;
-
- for (i = 0; i < ve->entry.nServers; i++) {
- status = ve->status[i];
- if (status & (VOLCACHE_NOVOL|VOLCACHE_UNAVAILABLE)) {
- /* already checked ? */
- if (status & VOLCACHE_CHECKED)
- continue;
- ve->status[i] |= VOLCACHE_CHECKED;
- if (ve->flags.stablep)
- inval = 1;
- }
- }
- if (inval)
- volcache_invalidate_ve(ve);
-}
-
-/*
- *
- */
-
-static void
-volcache_remove_marks (VolCacheEntry *ve)
-{
- int i;
-
- for (i = 0; i < NMAXNSERVERS; i++)
- ve->status[i] = 0;
-}
-
-/*
- *
- */
-
-static Bool
-volume_uptodatep (VolCacheEntry *e)
-{
- if (connected_mode != CONNECTED)
- return e->flags.validp ? TRUE : FALSE;
-
- if (time(NULL) > e->timeout)
- return FALSE;
-
- return e->flags.validp && clones_exists(e) == TRUE;
-}
-
-/*
- * return it if it's in the hash table.
- */
-
-static VolCacheEntry *
-getbyid (uint32_t volid, int32_t cell, int *type)
-{
- struct num_ptr *n;
- struct num_ptr key;
-
- key.cell = cell;
- key.vol = volid;
-
- n = (struct num_ptr *)hashtabsearch (volidhashtab, (void *)&key);
- if (n == NULL)
- return NULL;
- if (type != NULL)
- *type = n->type;
- return n->ptr;
-}
-
-/*
- * return it if it's in the hash table.
- */
-
-static VolCacheEntry *
-getbyname (const char *volname, int32_t cell)
-{
- struct name_ptr *n;
- struct name_ptr key;
-
- key.cell = cell;
- strlcpy (key.name, volname, sizeof(key.name));
-
- n = (struct name_ptr *)hashtabsearch (volnamehashtab, (void *)&key);
- if (n == NULL)
- return NULL;
- return n->ptr;
-}
-
-/*
- * Add a clone to `e' of type `type' with suffix `slot_type' in slot
- * slot_type
- */
-
-static void
-add_clone (VolCacheEntry *e, int type)
-{
- struct num_ptr *num_ptr = &e->num_ptr[type];
-
- num_ptr->cell = e->cell;
- num_ptr->vol = e->entry.volumeId[type];
- num_ptr->ptr = e;
- num_ptr->type = type;
- hashtabadd (volidhashtab, (void *) num_ptr);
-}
-
-/*
- * Add all types of the volume entry `e' to volid hashtable. If there
- * isn't a RW volume, use the RO as the RW.
- */
-
-static void
-add_clones_to_hashtab (VolCacheEntry *e)
-{
- if (e->entry.flags & VLF_RWEXISTS)
- add_clone (e, RWVOL);
- if (e->entry.flags & VLF_ROEXISTS)
- add_clone (e, ROVOL);
- if (e->entry.flags & VLF_BOEXISTS)
- add_clone (e, BACKVOL);
-}
-
-/*
- *
- */
-
-static void
-remove_clone (VolCacheEntry *e, int type)
-{
- struct num_ptr *num_ptr = &e->num_ptr[type];
-
- if (num_ptr->ptr) {
- hashtabdel (volidhashtab, (void *) num_ptr);
- num_ptr->ptr = NULL;
- }
-}
-
-static void
-remove_clones_from_hashtab (VolCacheEntry *e)
-{
- int i;
- for (i = 0; i < MAXTYPES; ++i)
- remove_clone(e, i);
-}
-
-/*
- *
- */
-
-static void
-add_name_to_hashtab (VolCacheEntry *e)
-{
- e->name_ptr.cell = e->cell;
- strlcpy (e->name_ptr.name, e->entry.name, sizeof(e->name_ptr.name));
- e->name_ptr.ptr = e;
- hashtabadd (volnamehashtab, (void *)&e->name_ptr);
-}
-
-/*
- *
- */
-
-
-static void
-update_entry(VolCacheEntry *e, nvldbentry *entry)
-{
- e->flags.stablep = cmp_nvldbentry (entry, &e->entry) == 0;
- e->flags.validp = TRUE;
- e->entry = *entry;
-
- if (e->flags.stablep == FALSE) {
- volcache_remove_marks (e);
- remove_clones_from_hashtab (e);
- add_clones_to_hashtab (e);
- }
-}
-
-/*
- *
- */
-
-struct vstore_context {
- Listitem *item;
- unsigned n;
-};
-
-/*
- *
- */
-
-static int
-volcache_recover_entry (struct volcache_store *st, void *ptr)
-{
- VolCacheEntry *e = get_free_entry ();
- struct vstore_context *c = (struct vstore_context *)ptr;
-
- e->cell = cell_name2num (st->cell);
- if (e->cell == -1) {
- arla_warnx(ADEBWARN, "can't resolve cell name");
- return(-1);
- }
- e->entry = st->entry;
- e->volsync = st->volsync;
- e->refcount = st->refcount;
-
- add_name_to_hashtab (e);
- add_clones_to_hashtab (e);
-
- c->n++;
-
- return 0;
-}
-
-/*
- *
- */
-
-static void
-volcache_recover_state (void)
-{
- struct vstore_context c;
- Listitem *item;
-
- c.n = 0;
- c.item = NULL;
-
- state_recover_volcache ("volcache", volcache_recover_entry, &c);
-
- for(item = listhead (lrulist);
- item;
- item = listnext (lrulist, item)) {
- VolCacheEntry *e = (VolCacheEntry *)listdata(item);
- VolCacheEntry *parent;
-
- if (e->cell == -1)
- continue;
-
- parent = getbyid (e->parent_fid.fid.Volume,
- e->parent_fid.Cell,
- NULL);
- if (parent != NULL)
- volcache_volref (e, parent);
- }
- arla_warnx (ADEBVOLCACHE, "recovered %u entries to volcache", c.n);
-}
-
-/*
- *
- */
-
-static int
-volcache_store_entry (struct volcache_store *st, void *ptr)
-{
- struct vstore_context *c;
- VolCacheEntry *e;
-
- c = (struct vstore_context *)ptr;
- if (c->item == NULL) /* check if done ? */
- return STORE_DONE;
-
- e = (VolCacheEntry *)listdata (c->item);
- c->item = listprev (lrulist, c->item);
-
- if (e->cell == -1)
- return STORE_SKIP;
-
- strlcpy(st->cell, cell_num2name(e->cell), sizeof(st->cell));
- st->entry = e->entry;
- st->volsync = e->volsync;
- st->refcount = e->refcount;
-
- c->n++;
- return STORE_NEXT;
-}
-
-/*
- *
- */
-
-int
-volcache_store_state (void)
-{
- struct vstore_context c;
- int ret;
-
- c.item = listtail (lrulist);
- c.n = 0;
-
- ret = state_store_volcache("volcache", volcache_store_entry, &c);
- if (ret)
- arla_warn(ADEBWARN, ret, "failed to store volcache state");
- else
- arla_warnx (ADEBVOLCACHE, "wrote %u entries to volcache", c.n);
-
- return 0;
-}
-
-/*
- * Initialize the volume cache with `nentries' in the free list.
- * Try to recover state iff `recover'
- */
-
-void
-volcache_init (unsigned nentries, Bool recover)
-{
- volnamehashtab = hashtabnew (VOLCACHE_SIZE, volnamecmp, volnamehash);
- if (volnamehashtab == NULL)
- arla_errx (1, ADEBERROR, "volcache_init: hashtabnew failed");
-
- volidhashtab = hashtabnew (VOLCACHE_SIZE, volidcmp, volidhash);
- if (volidhashtab == NULL)
- arla_errx (1, ADEBERROR, "volcache_init: hashtabnew failed");
-
- lrulist = listnew ();
- if (lrulist == NULL)
- arla_errx (1, ADEBERROR, "volcache_init: listnew failed");
- nvolcacheentries = 0;
- create_new_entries (nentries);
- if (recover)
- volcache_recover_state ();
-}
-
-/*
- *
- */
-
-static int
-get_info_common (VolCacheEntry *e, nvldbentry *entry)
-{
- if (entry->flags & VLF_DFSFILESET)
- arla_warnx (ADEBWARN,
- "get_info: %s is really a DFS volume. "
- "This might not work",
- entry->name);
-
- if ((entry->volumeId[RWVOL] == entry->volumeId[ROVOL] &&
- entry->flags & VLF_RWEXISTS && entry->flags & VLF_ROEXISTS) ||
- (entry->volumeId[ROVOL] == entry->volumeId[BACKVOL] &&
- entry->flags & VLF_ROEXISTS && entry->flags & VLF_BOEXISTS) ||
- (entry->volumeId[RWVOL] == entry->volumeId[BACKVOL] &&
- entry->flags & VLF_RWEXISTS && entry->flags & VLF_BOEXISTS)) {
-
- arla_warnx (ADEBERROR, "get_info: same id on different volumes: %s",
- entry->name);
- return ENOENT;
- }
-
- e->flags.validp = TRUE;
- e->timeout = volcache_timeout + time(NULL);
- return 0;
-}
-
-/*
- * A function for checking if a service is up. Return 0 if succesful.
- */
-
-static int
-vl_probe (struct rx_connection *conn)
-{
- return VL_Probe (conn);
-}
-
-/*
- * Get all the db servers for `e->cell', sort them in order by rtt
- * (with some fuzz) and try to retrieve the entry for `name'.
- * Fill in the vldb entry in `entry'.
- *
- * Return 0 if succesful, else error.
- */
-
-static int
-get_info_loop (VolCacheEntry *e, nvldbentry *entry,
- const char *name, int32_t cell,
- CredCacheEntry *ce)
-{
- const cell_db_entry *db_servers;
- int num_db_servers;
- int num_working_db_servers;
- int error = 0;
- ConnCacheEntry **conns;
- int i, j;
- Bool try_again;
-
- if (dynroot_isvolumep (cell, name)) {
- dynroot_fetch_root_vldbN (entry);
- return 0;
- }
-
- if (connected_mode == DISCONNECTED)
- return ENETDOWN;
-
- db_servers = cell_dbservers_by_id (cell, &num_db_servers);
- if (db_servers == NULL || num_db_servers == 0) {
- arla_warnx (ADEBWARN,
- "Cannot find any db servers in cell %d(%s) while "
- "getting data for volume `%s'",
- cell, cell_num2name(cell), name);
- return ENOENT;
- }
-
- conns = malloc (num_db_servers * sizeof(*conns));
- if (conns == NULL)
- return ENOMEM;
-
- for (i = 0, j = 0; i < num_db_servers; ++i) {
- ConnCacheEntry *conn;
-
- conn = conn_get (cell, db_servers[i].addr.s_addr, afsvldbport,
- VLDB_SERVICE_ID, vl_probe, ce);
- if (conn_isalivep (conn))
- conn->rtt = rx_PeerOf(conn->connection)->srtt
- + rand() % RTT_FUZZ - RTT_FUZZ / 2;
- else
- conn->rtt = INT_MAX / 2;
- conns[j++] = conn;
- }
- num_working_db_servers = j;
-
- qsort (conns, num_working_db_servers, sizeof(*conns),
- conn_rtt_cmp);
-
- try_again = TRUE;
-
- for (i = 0; i < num_working_db_servers; ++i) {
- if (conns[i] != NULL) {
- retry:
- if (try_again) {
- if (conns[i]->flags.old) {
- vldbentry oldentry;
- error = VL_GetEntryByName (conns[i]->connection,
- name, &oldentry);
- if (error == 0)
- vldb2vldbN(&oldentry, entry);
- } else
- error = VL_GetEntryByNameN (conns[i]->connection,
- name, entry);
- switch (error) {
- case 0 :
- sanitize_nvldbentry (entry);
- try_again = FALSE;
- break;
- case VL_NOENT :
- error = ENOENT;
- try_again = FALSE;
- break;
-#ifdef KERBEROS
- case RXKADEXPIRED :
- try_again = FALSE;
- break;
- case RXKADSEALEDINCON:
- case RXKADUNKNOWNKEY:
- case RXKADBADTICKET:
- case RXKADBADKEY:
- try_again = FALSE;
- break;
-#endif
- case RXGEN_OPCODE:
- if (conns[i]->flags.old == FALSE) {
- conns[i]->flags.old = TRUE;
- goto retry;
- }
- break;
- default :
- if (host_downp(error))
- conn_dead (conns[i]);
- arla_warn (ADEBVOLCACHE, error,
- "VL_GetEntryByName%s(%s)",
- conns[i]->flags.old ? "" : "N",
- name);
- break;
- }
- }
- conn_free (conns[i]);
- }
- }
-
- free (conns);
-
- if (try_again) {
- arla_warnx (ADEBWARN,
- "Failed to contact any db servers in cell %d(%s)",
- cell, cell_num2name(cell));
- error = ETIMEDOUT;
- }
-
- return error;
-}
-
-/*
- * Retrieve the information for the volume `id' into `e' using `ce' as
- * the creds.
- * Return 0 or error.
- */
-
-static int
-get_info_byid (VolCacheEntry *e, nvldbentry *entry,
- uint32_t id, int32_t cell,
- CredCacheEntry *ce)
-{
- int error;
- char s[11];
-
- snprintf (s, sizeof(s), "%u", id);
- error = get_info_loop (e, entry, s, cell, ce);
- if (error)
- return error;
- return get_info_common (e, entry);
-}
-
-
-/*
- * Retrieve the information for `volname' into `e' using `ce' as the creds.
- * Return 0 or error.
- */
-
-static int
-get_info_byname (VolCacheEntry *e, nvldbentry *entry,
- const char *volname, int32_t cell,
- CredCacheEntry *ce)
-{
- int error;
-
- error = get_info_loop (e, entry, volname, cell, ce);
- if (error)
- return error;
-
- /*
- * If the name we looked up is different from the one we got back,
- * replace that one with the canonical looked up name. Otherwise,
- * we're not going to be able to find the volume in question.
- */
-
- if (strcmp(volname, entry->name) != 0) {
- arla_warnx (ADEBWARN,
- "get_info: different volnames: %s - %s",
- volname, entry->name);
-
- if (strlcpy (entry->name, volname,
- sizeof(entry->name)) >= sizeof(entry->name)) {
- arla_warnx (ADEBWARN,
- "get_info: too long volume (%.*s)",
- (int)strlen(volname), volname);
- return ENAMETOOLONG;
- }
- }
-
- return get_info_common (e, entry);
-}
-
-/*
- * Add an entry for (volname, cell) to the hash table.
- */
-
-static int
-add_entry_byname (VolCacheEntry **ret, const char *volname,
- int32_t cell, CredCacheEntry *ce)
-{
- VolCacheEntry *e;
- int error;
-
- e = get_free_entry ();
-
- e->cell = cell;
- e->refcount = 0;
- e->vol_refs = 0;
- e->flags.lookupp = 1;
- strlcpy(e->entry.name, volname, sizeof(e->entry.name));
-
- add_name_to_hashtab (e);
-
- error = get_info_byname (e, &e->entry, volname, cell, ce);
- if (error == 0) {
- *ret = e;
- add_clones_to_hashtab (e);
- }
-
- e->flags.lookupp = 0;
- if (e->flags.waiting)
- LWP_NoYieldSignal (e);
-
- return error;
-}
-
-/*
- * Retrieve the entry for (volname, cell). If it's not in the cache,
- * add it.
- */
-
-int
-volcache_getbyname (const char *volname, int32_t cell, CredCacheEntry *ce,
- VolCacheEntry **e, int *ret_type)
-{
- int type, error;
- char real_volname[VLDB_MAXNAMELEN];
-
- strlcpy (real_volname, volname, sizeof(real_volname));
- type = volname_canonicalize (real_volname);
- if (ret_type)
- *ret_type = type;
-
- for(;;) {
- *e = getbyname (real_volname, cell);
- if (*e == NULL) {
- error = add_entry_byname (e, real_volname, cell, ce);
- if (error)
- return error;
- continue;
- }
-
- if ((*e)->flags.lookupp) {
- (*e)->flags.waiting = 1;
- volcache_ref (*e);
- LWP_WaitProcess (*e);
- if (!(*e)->flags.validp) {
- volcache_free (*e);
- return ENOENT;
- }
- } else
- volcache_ref (*e);
-
- if (volume_uptodatep (*e)) {
- error = 0;
- break;
- } else {
- nvldbentry tmp_e;
-
- error = get_info_byname (*e, &tmp_e, real_volname, cell, ce);
- if (error)
- break;
- update_entry(*e, &tmp_e);
- break;
- }
- }
-
- if (error)
- (*e)->flags.validp = 0;
- if ((*e)->flags.waiting)
- LWP_NoYieldSignal (*e);
- (*e)->flags.lookupp = 0;
- (*e)->flags.waiting = 0;
- if (error) {
- volcache_free (*e);
- *e = NULL;
- }
- return error;
-}
-
-/*
- * Retrieve the entry for (volume-id, cell). If it's not in the cache,
- * there is no good way of adding it, and thus fail.
- */
-
-int
-volcache_getbyid (uint32_t volid, int32_t cell, CredCacheEntry *ce,
- VolCacheEntry **e, int *type)
-{
- int error = 0;
- for(;;) {
- *e = getbyid (volid, cell, type);
- if (*e == NULL)
- return ENOENT;
-
- if ((*e)->flags.lookupp) {
- (*e)->flags.waiting = 1;
- volcache_ref (*e);
- LWP_WaitProcess (*e);
- if (!(*e)->flags.validp) {
- volcache_free (*e);
- return ENOENT;
- }
- } else
- volcache_ref (*e);
-
- if (volume_uptodatep (*e)) {
- error = 0;
- break;
- } else {
- nvldbentry tmp_e;
-
- error = get_info_byid (*e, &tmp_e, volid, cell, ce);
- if (error)
- break;
- update_entry(*e, &tmp_e);
- break;
- }
- }
-
- if (error)
- (*e)->flags.validp = 0;
- if ((*e)->flags.waiting)
- LWP_NoYieldSignal (*e);
- (*e)->flags.lookupp = 0;
- (*e)->flags.waiting = 0;
- if (error) {
- volcache_free (*e);
- *e = NULL;
- }
- return error;
-}
-
-/*
- * Invalidate the volume entry `ve'
- */
-
-void
-volcache_invalidate_ve (VolCacheEntry *ve)
-{
- ve->flags.validp = FALSE;
- ve->flags.stablep = FALSE;
-}
-
-static Bool
-inval (void *ptr, void *arg)
-{
- struct num_ptr *n = (struct num_ptr *)ptr;
- VolCacheEntry *e = n->ptr;
-
- volcache_invalidate_ve (e);
- return FALSE;
-}
-
-/*
- * Invalidate all volume entries
- */
-
-void
-volcache_invalidate_all (void)
-{
- hashtabforeach (volidhashtab, inval, NULL);
-}
-
-/*
- * invalidate this volume if id == data->id
- */
-
-static Bool
-invalidate_vol (void *ptr, void *arg)
-{
- uint32_t id = *((uint32_t *)arg);
- struct num_ptr *n = (struct num_ptr *)ptr;
- VolCacheEntry *e = n->ptr;
-
- if (n->vol == id)
- volcache_invalidate_ve (e);
-
- return FALSE;
-}
-
-
-/*
- * Invalidate the volume entry for `id'
- */
-
-void
-volcache_invalidate (uint32_t id, int32_t cell)
-{
- if (cell == -1) {
- hashtabforeach (volidhashtab, invalidate_vol, &id);
- } else {
- VolCacheEntry *e = getbyid (id, cell, NULL);
- if (e != NULL)
- volcache_invalidate_ve (e);
- }
-}
-
-/*
- *
- */
-
-Bool
-volume_downp (int error)
-{
- switch (error) {
- case ARLA_VNOVOL:
- case ARLA_VMOVED:
- return TRUE;
- default:
- return FALSE;
- }
-}
-
-/*
- *
- */
-
-void
-volcache_mark_down (VolCacheEntry *ve, int i, int error)
-{
- int type;
-
- assert(i < NMAXNSERVERS && i < ve->entry.nServers);
-
- switch (error) {
- case ARLA_VNOVOL:
- case ARLA_VMOVED:
- type = VOLCACHE_NOVOL;
- break;
- default:
- type = VOLCACHE_UNAVAILABLE;
- break;
- }
-
- ve->status[i] |= type;
-}
-
-
-/*
- *
- */
-
-Bool
-volcache_reliablep_el (VolCacheEntry *ve, int i)
-{
- assert(i < NMAXNSERVERS && i < ve->entry.nServers);
-
- if (ve->status[i] == 0)
- return TRUE;
- return FALSE;
-}
-
-void
-volcache_reliable_el (VolCacheEntry *ve, int i)
-{
- assert(i < NMAXNSERVERS && i < ve->entry.nServers);
- ve->status[i] = 0;
-}
-
-/*
- * Return TRUE if this should be considered reliable (if it's validp,
- * stablep and fresh).
- */
-
-Bool
-volcache_reliablep (uint32_t id, int32_t cell)
-{
- VolCacheEntry *e = getbyid (id, cell, NULL);
-
- return e != NULL
- && e->flags.validp
- && e->flags.stablep
- && time(NULL) < e->timeout;
-}
-
-/*
- * Save `volsync'
- */
-
-void
-volcache_update_volsync (VolCacheEntry *e, AFSVolSync volsync)
-{
- e->volsync = volsync;
-}
-
-/*
- * Increment the references to `e'
- */
-
-void
-volcache_ref (VolCacheEntry *e)
-{
- if (e->refcount == 0 && e->vol_refs == 0)
- ++nactive_volcacheentries;
- ++e->refcount;
-}
-
-/*
- * Decrement the references and possibly remove this entry.
- */
-
-void
-volcache_free (VolCacheEntry *e)
-{
- --e->refcount;
- mark_unused (e);
-}
-
-/*
- * A parent directory of `e' is `parent'.
- * Record it and bump the vol ref count in `parent' iff e does not
- * already have a parent.
- */
-
-void
-volcache_volref (VolCacheEntry *e, VolCacheEntry *parent)
-{
- if (e->parent == NULL) {
- if (parent->refcount == 0 && parent->vol_refs == 0)
- ++nactive_volcacheentries;
- ++parent->vol_refs;
- e->parent = parent;
- }
-}
-
-/*
- * remove one `volume' reference
- */
-
-void
-volcache_volfree (VolCacheEntry *e)
-{
- --e->vol_refs;
- mark_unused (e);
-}
-
-/*
- * Print the entry `ptr' to the FILE `arg'
- */
-
-static Bool
-print_entry (void *ptr, void *arg)
-{
- struct num_ptr *n = (struct num_ptr *)ptr;
- VolCacheEntry *e = n->ptr;
- int i;
- struct in_addr tmp;
-
- if (n->vol != e->entry.volumeId[RWVOL])
- return FALSE;
-
- arla_log(ADEBVLOG, "cell = %d (%s)"
- "name = \"%s\", nServers = %d",
- e->cell, cell_num2name (e->cell),
- e->entry.name,
- e->entry.nServers);
- for (i = 0; i < e->entry.nServers; ++i) {
- tmp.s_addr = htonl(e->entry.serverNumber[i]);
- arla_log(ADEBVLOG, "%d: server = %s, part = %d(%c), flags = %d",
- i, inet_ntoa(tmp), e->entry.serverPartition[i],
- 'a' + e->entry.serverPartition[i],
- e->entry.serverFlags[i]);
- }
- if (e->entry.flags & VLF_RWEXISTS)
- arla_log(ADEBVLOG, "rw clone: %d", e->entry.volumeId[RWVOL]);
- if (e->entry.flags & VLF_ROEXISTS)
- arla_log(ADEBVLOG, "ro clone: %d", e->entry.volumeId[ROVOL]);
- if (e->entry.flags & VLF_BACKEXISTS)
- arla_log(ADEBVLOG, "rw clone: %d", e->entry.volumeId[BACKVOL]);
- arla_log(ADEBVLOG, "refcount = %u", e->refcount);
- arla_log(ADEBVLOG, "vol_refs = %u", e->vol_refs);
- return FALSE;
-}
-
-/*
- *
- */
-
-int
-volume_make_uptodate (VolCacheEntry *e, CredCacheEntry *ce)
-{
- nvldbentry tmp_e;
- int ret;
-
- if (connected_mode != CONNECTED ||
- volume_uptodatep (e))
- return 0;
-
- ret = get_info_byname (e, &tmp_e, e->entry.name, e->cell, ce);
- if (ret == 0)
- update_entry(e, &tmp_e);
- return ret;
-}
-
-/*
- * Get a name for a volume in (name, name_sz).
- * Return 0 if succesful
- */
-
-int
-volcache_getname (uint32_t id, int32_t cell,
- char *name, size_t name_sz)
-{
- int type;
- VolCacheEntry *e = getbyid (id, cell, &type);
-
- if (e == NULL)
- return -1;
- volname_specific (e->name_ptr.name, type, name, name_sz);
- return 0;
-}
-
-/*
- * Find out what incarnation of a particular volume we're using
- * return one of (VLSF_RWVOL, VLSF_ROVOL, VLSF_BACKVOL or -1 on error)
- */
-
-int
-volcache_volid2bit (const VolCacheEntry *ve, uint32_t volid)
-{
- int bit = -1;
-
- if (ve->entry.flags & VLF_RWEXISTS
- && ve->entry.volumeId[RWVOL] == volid)
- bit = VLSF_RWVOL;
-
- if (ve->entry.flags & VLF_ROEXISTS
- && ve->entry.volumeId[ROVOL] == volid)
- bit = VLSF_ROVOL;
-
- if (ve->entry.flags & VLF_BACKEXISTS
- && ve->entry.volumeId[BACKVOL] == volid)
- bit = VLSF_RWVOL;
-
- return bit;
-}
-
-/*
- * Print some status on the volume cache on `f'.
- */
-
-void
-volcache_status (void)
-{
- arla_log(ADEBVLOG, "%u(%u) volume entries",
- nactive_volcacheentries, nvolcacheentries);
- hashtabforeach (volidhashtab, print_entry, NULL);
-}
diff --git a/usr.sbin/afs/src/arlad/volcache.h b/usr.sbin/afs/src/arlad/volcache.h
deleted file mode 100644
index 4032bf9df0c..00000000000
--- a/usr.sbin/afs/src/arlad/volcache.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Our cache of volume information.
- */
-
-/* $arla: volcache.h,v 1.36 2002/05/15 22:31:16 lha Exp $ */
-
-#ifndef _VOLCACHE_
-#define _VOLCACHE_
-
-#include <stdio.h>
-#include <cred.h>
-#include <list.h>
-#include "vldb.h"
-
-/*
- * index for number into a VolCacheEntry
- */
-
-struct num_ptr {
- int32_t cell;
- uint32_t vol;
- struct volcacheentry *ptr;
- int32_t type;
-};
-
-/*
- * index for name into a VolCacheEntry
- */
-
-struct name_ptr {
- int32_t cell;
- char name[VLDB_MAXNAMELEN];
- struct volcacheentry *ptr;
-};
-
-struct volcacheentry {
- nvldbentry entry;
- AFSVolSync volsync;
- int32_t cell;
- unsigned refcount; /* number of files refererring this */
- unsigned vol_refs; /* number of volumes refing this */
- Listitem *li;
- VenusFid mp_fid; /* pointing to this volume */
- VenusFid parent_fid; /* .. of this volume */
- struct volcacheentry *parent; /* parent volume */
- struct {
- unsigned validp : 1;
- unsigned stablep : 1;
- unsigned lookupp : 1;
- unsigned waiting : 1;
- } flags;
- struct name_ptr name_ptr;
- struct num_ptr num_ptr[MAXTYPES];
- time_t timeout;
- int status[NMAXNSERVERS];
-};
-
-enum { VOLCACHE_NOVOL = 1, /* server claim there is no volume */
- VOLCACHE_UNAVAILABLE = 2, /* server failed to respond */
- VOLCACHE_CHECKED = 4 /* error-condition already processed */
-};
-
-typedef struct volcacheentry VolCacheEntry;
-
-const char *volcache_get_rootvolume (void);
-
-void volcache_set_rootvolume (const char *volname);
-
-void volcache_init (unsigned nentries, Bool recover);
-
-int volcache_getbyname (const char *volname,
- int32_t cell,
- CredCacheEntry *ce,
- VolCacheEntry **e,
- int *type);
-
-int volcache_getbyid (uint32_t id,
- int32_t cell,
- CredCacheEntry *ce,
- VolCacheEntry **e,
- int *type);
-
-void volcache_update_volsync (VolCacheEntry *e, AFSVolSync volsync);
-
-void volcache_free (VolCacheEntry *e);
-
-void volcache_ref (VolCacheEntry *e);
-
-void volcache_volref (VolCacheEntry *e, VolCacheEntry *parent);
-
-void volcache_volfree (VolCacheEntry *e);
-
-void volcache_invalidate (uint32_t id, int32_t cell);
-
-void volcache_invalidate_ve (VolCacheEntry *ve);
-
-void volcache_invalidate_all (void);
-
-int volume_make_uptodate (VolCacheEntry *e, CredCacheEntry *ce);
-
-Bool volume_downp (int error);
-
-void volcache_mark_down (VolCacheEntry *ve, int i, int error);
-
-void volcache_process_marks (VolCacheEntry *e);
-
-Bool volcache_reliablep_el (VolCacheEntry *ve, int i);
-Bool volcache_reliablep (uint32_t id, int32_t cell);
-
-int volcache_getname (uint32_t id, int32_t cell, char *, size_t);
-
-void volcache_reliable_el (VolCacheEntry *ve, int i);
-
-void volcache_status (void);
-
-int
-volcache_store_state (void);
-
-int
-volcache_volid2bit (const VolCacheEntry *ve, uint32_t volid);
-
-enum { VOLCACHE_OLD = 120 };
-
-enum { VOLCACHE_TIMEOUT = 600 };
-
-#endif /* _VOLCACHE_ */
diff --git a/usr.sbin/afs/src/arlad/xfs.c b/usr.sbin/afs/src/arlad/xfs.c
deleted file mode 100644
index 3168df9fb55..00000000000
--- a/usr.sbin/afs/src/arlad/xfs.c
+++ /dev/null
@@ -1,538 +0,0 @@
-/*
- * Copyright (c) 1999 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "arla_local.h"
-
-RCSID("$KTH: xfs.c,v 1.13 2000/10/02 22:33:25 lha Exp $");
-
-/*
- * Begining of breakout of xfs releated junk
- */
-
-static u_int *seqnums;
-
-static List *sleepers;
-
-/* number of times each type of message has been sent */
-
-static unsigned sent_stat[XFS_MSG_COUNT];
-
-/* number of times each type of message has been received */
-
-static unsigned recv_stat[XFS_MSG_COUNT];
-
-static char *rcvfuncs_name[] =
-{
- "version",
- "wakeup",
- "getroot",
- "installroot",
- "getnode",
- "installnode",
- "getattr",
- "installattr",
- "getdata",
- "installdata",
- "inactivenode",
- "invalidnode",
- "open",
- "put_data",
- "put_attr",
- "create",
- "mkdir",
- "link",
- "symlink",
- "remove",
- "rmdir",
- "rename",
- "pioctl",
- "wakeup_data",
- "updatefid",
- "advlock",
- "gc nodes"
-};
-
-/*
- * A interface for the userland to talk the kernel and recv
- * back a integer. For larger messages implement a simularfunction
- * that uses the `wakeup_data' message.
- */
-
-int
-xfs_message_rpc (int fd, struct xfs_message_header *h, u_int size)
-{
- int ret;
-
- ret = xfs_message_send (fd, h, size);
- if (ret)
- return ret;
- return xfs_message_sleep (h->sequence_num);
-}
-
-/*
- * Try to probe the version on `fd', returning the version.
- */
-
-static int
-xfs_send_message_version (int fd)
-{
- struct xfs_message_version msg;
- int ret;
-
- msg.header.opcode = XFS_MSG_VERSION;
- arla_warnx (ADEBMSG, "sending version");
- ret = xfs_message_rpc (fd, (struct xfs_message_header *)&msg,
- sizeof(msg));
- return ret;
-}
-
-/*
- * Probe for version on `fd'. Fail if != version
- */
-
-void
-xfs_probe_version (int fd, int version)
-{
- int ret = xfs_send_message_version (fd);
-
- if (ret != version)
- arla_errx (1, ADEBERROR,
- "Wrong version of xfs. Please {up,down}grade to %d",
- version);
-}
-
-/*
- * Send `num' `fids' to xfs on `fd' as proposed gc-able fids
- * If `num' is 0 xfs should gc everything gc:able.
- */
-
-/* XXX VenusFid is wrong here */
-
-void
-xfs_send_message_gc_nodes (int fd, int num, VenusFid *fids)
-{
- struct xfs_message_gc_nodes msg;
- int i;
-
- arla_warnx (ADEBMSG,
- "xfs_send_message_gc_nodes sending gc: num = %d", num);
-
- if (num > XFS_GC_NODES_MAX_HANDLE)
- num = XFS_GC_NODES_MAX_HANDLE;
-
- msg.header.opcode = XFS_MSG_GC_NODES;
- msg.len = num;
-
- for (i = 0; i < num; i++)
- memcpy (&msg.handle[i], &fids[i], sizeof(*fids));
-
- xfs_message_send (fd, (struct xfs_message_header *)&msg,
- sizeof(msg));
-}
-
-/*
- * Init the xfs message passing things.
- */
-
-void
-xfs_message_init (void)
-{
- unsigned i;
-
- seqnums = (u_int *)malloc (sizeof (*seqnums) * getdtablesize ());
- if (seqnums == NULL)
- arla_err (1, ADEBERROR, errno, "xfs_message_init: malloc");
- for (i = 0; i < getdtablesize (); ++i)
- seqnums[i] = 0;
- sleepers = listnew ();
- if (sleepers == NULL)
- arla_err (1, ADEBERROR, errno, "xfs_message_init: listnew");
-
- assert (sizeof(rcvfuncs_name) / sizeof(*rcvfuncs_name) == XFS_MSG_COUNT);
-}
-
-/*
- * Go to entry in jump-table depending on entry.
- */
-
-int
-xfs_message_receive (int fd, struct xfs_message_header *h, u_int size)
-{
- unsigned opcode = h->opcode;
-
- if (opcode >= XFS_MSG_COUNT || rcvfuncs[opcode] == NULL ) {
- arla_warnx (ADEBMSG, "Bad message opcode = %u", opcode);
- return -1;
- }
-
- ++recv_stat[opcode];
-
- arla_warnx (ADEBMSG, "Rec message: opcode = %u (%s), size = %u",
- opcode, rcvfuncs_name[opcode], h->size);
-
- return (*rcvfuncs[opcode])(fd, h, size);
-}
-
-/*
- * Send a message to the kernel module.
- */
-
-int
-xfs_message_send (int fd, struct xfs_message_header *h, u_int size)
-{
- unsigned opcode = h->opcode;
- int ret;
-
- h->size = size;
- h->sequence_num = seqnums[fd]++;
-
- if (opcode >= XFS_MSG_COUNT) {
- arla_warnx (ADEBMSG, "Bad message opcode = %u", opcode);
- return -1;
- }
-
- ++sent_stat[opcode];
-
- arla_warnx (ADEBMSG, "Send message: opcode = %u (%s), size = %u",
- opcode, rcvfuncs_name[opcode], h->size);
-
- ret = kern_write (fd, h, size);
- if (ret != size) {
- arla_warn (ADEBMSG, errno, "xfs_message_send: write");
- return errno;
- } else
- return 0;
-}
-
-/*
- * This code can only wake up message of type `xfs_message_wakeup'
- */
-
-int
-xfs_message_wakeup (int fd, struct xfs_message_wakeup *h, u_int size)
-{
- Listitem *i, *next;
- struct xfs_message_wakeup *w;
-
- assert (sizeof(*w) >= size);
-
- for (i = listhead (sleepers); i; i = next) {
- next = listnext (sleepers, i);
- w = (struct xfs_message_wakeup *)listdata(i);
- if (w->header.sequence_num == h->sleepers_sequence_num) {
- listdel (sleepers, i);
- memcpy (w, h, size);
- LWP_SignalProcess ((char *)w);
- break;
- }
- }
- if (i == NULL)
- arla_warnx (ADEBWARN, "xfs_message_wakeup: no message to wakeup!");
- return 0;
-}
-
-/*
- * The middle and last part of the xfs_message_rpc.
- */
-
-int
-xfs_message_sleep (u_int seqnum)
-{
- struct xfs_message_wakeup h;
-
- h.header.sequence_num = seqnum;
-
- listaddtail (sleepers, &h);
- LWP_WaitProcess ((char *)&h);
- return h.error;
-}
-
-/*
- * Wake up a sleeping kernel-thread that sleeps on `seqnum'
- * and pass on `error' as an error the thread.
- */
-
-int
-xfs_send_message_wakeup (int fd, u_int seqnum, int error)
-{
- struct xfs_message_wakeup msg;
-
- msg.header.opcode = XFS_MSG_WAKEUP;
- msg.sleepers_sequence_num = seqnum;
- msg.error = error;
- arla_warnx (ADEBMSG, "sending wakeup: seq = %u, error = %d",
- seqnum, error);
- return xfs_message_send (fd, (struct xfs_message_header *)&msg,
- sizeof(msg));
-}
-
-
-/*
- * Wake-up a kernel-thread with `seqnum', and pass on `error'
- * ad return value. Add also a data blob for gerneric use.
- */
-
-int
-xfs_send_message_wakeup_data (int fd, u_int seqnum, int error,
- void *data, int size)
-{
- struct xfs_message_wakeup_data msg;
-
- msg.header.opcode = XFS_MSG_WAKEUP_DATA;
- msg.sleepers_sequence_num = seqnum;
- msg.error = error;
- arla_warnx (ADEBMSG,
- "sending wakeup: seq = %u, error = %d", seqnum, error);
-
- if (sizeof(msg) >= size && size != 0) {
- memcpy(msg.msg, data, size);
- }
-
- msg.len = size;
-
- return xfs_message_send (fd, (struct xfs_message_header *)&msg,
- sizeof(msg));
-}
-
-/*
- *
- */
-
-struct write_buf {
- unsigned char buf[MAX_XMSG_SIZE];
- size_t len;
-};
-
-/*
- * Return 1 it buf is full, 0 if it's not.
- */
-
-static int
-add_new_msg (int fd,
- struct xfs_message_header *h, size_t size,
- struct write_buf *buf)
-{
- /* align on 8 byte boundery */
-
- if (size > sizeof (buf->buf) - buf->len)
- return 1;
-
- h->sequence_num = seqnums[fd]++;
- h->size = (size + 8) & ~ 7;
-
- assert (h->opcode >= 0 && h->opcode < XFS_MSG_COUNT);
- ++sent_stat[h->opcode];
-
- arla_warnx (ADEBMSG, "Multi-send: opcode = %u (%s), size = %u",
- h->opcode, rcvfuncs_name[h->opcode], h->size);
-
- memcpy (buf->buf + buf->len, h, size);
- memset (buf->buf + buf->len + size, 0, h->size - size);
- buf->len += h->size;
- return 0;
-}
-
-/*
- * Blast of a `buf' to `fd'.
- */
-
-static int
-send_msg (int fd, struct write_buf *buf)
-{
- int ret;
-
- if (buf->len == 0)
- return 0;
-
- ret = kern_write (fd, buf->buf, buf->len);
- if (ret != buf->len) {
- arla_warn (ADEBMSG, errno,
- "send_msg: write");
- buf->len = 0;
- return errno;
- }
- buf->len = 0;
- return 0;
-}
-
-/*
- *
- */
-
-int
-xfs_send_message_vmultiple (int fd,
- va_list args)
-{
- struct xfs_message_header *h;
- struct write_buf *buf;
- size_t size;
- int ret;
-
- buf = malloc (sizeof (*buf));
- if (buf == NULL)
- return ENOMEM;
-
- h = va_arg (args, struct xfs_message_header *);
- size = va_arg (args, size_t);
- buf->len = 0;
- while (h != NULL) {
- if (add_new_msg (fd, h, size, buf)) {
- ret = send_msg (fd, buf);
- if (ret) {
- free (buf);
- return ret;
- }
- if (add_new_msg (fd, h, size, buf))
- arla_warnx (ADEBERROR,
- "xfs_send_message_vmultiple: "
- "add_new_msg failed");
- }
-
- h = va_arg (args, struct xfs_message_header *);
- size = va_arg (args, size_t);
- }
- ret = send_msg (fd, buf);
- free (buf);
- return ret;
-}
-
-/*
- * Same as above but diffrent.
- */
-
-int
-xfs_send_message_multiple (int fd,
- ...)
-{
- va_list args;
- int ret;
-
- va_start (args, fd);
- ret = xfs_send_message_vmultiple (fd, args);
- va_end (args);
- return ret;
-}
-
-/*
- * Almost same as above but diffrent.
- */
-
-int
-xfs_send_message_multiple_list (int fd,
- struct xfs_message_header *h,
- size_t size,
- u_int num)
-{
- struct write_buf *buf;
- int ret = 0;
-
- buf = malloc (sizeof (*buf));
- if (buf == NULL)
- return ENOMEM;
- buf->len = 0;
- while (num && ret == 0) {
- if (add_new_msg (fd, h, size, buf)) {
- ret = send_msg (fd, buf);
- if (add_new_msg (fd, h, size, buf))
- arla_warnx (ADEBERROR,
- "xfs_send_message_multiple_list: "
- "add_new_msg failed");
- }
- h = (struct xfs_message_header *) (((unsigned char *)h) + size);
- num--;
- }
- if (ret) {
- free (buf);
- return ret;
- }
- ret = send_msg (fd, buf);
- free (buf);
- return ret;
-}
-
-/*
- * Send multiple message to the kernel (for performace/simple resons)
- */
-
-int
-xfs_send_message_wakeup_vmultiple (int fd,
- u_int seqnum,
- int error,
- va_list args)
-{
- struct xfs_message_wakeup msg;
- int ret;
-
- ret = xfs_send_message_vmultiple (fd, args);
- if (ret)
- arla_warnx (ADEBERROR, "xfs_send_message_wakeup_vmultiple: "
- "failed sending messages with error %d", ret);
-
- msg.header.opcode = XFS_MSG_WAKEUP;
- msg.header.size = sizeof(msg);
- msg.header.sequence_num = seqnums[fd]++;
- msg.sleepers_sequence_num = seqnum;
- msg.error = error;
-
- ++sent_stat[XFS_MSG_WAKEUP];
-
- arla_warnx (ADEBMSG, "multi-sending wakeup: seq = %u, error = %d",
- seqnum, error);
-
- ret = kern_write (fd, &msg, sizeof(msg));
- if (ret != sizeof(msg)) {
- arla_warn (ADEBMSG, errno,
- "xfs_send_message_wakeup_vmultiple: writev");
- return -1;
- }
- return 0;
-}
-
-/*
- * Same as above but diffrent.
- */
-
-int
-xfs_send_message_wakeup_multiple (int fd,
- u_int seqnum,
- int error,
- ...)
-{
- va_list args;
- int ret;
-
- va_start (args, error);
- ret = xfs_send_message_wakeup_vmultiple (fd, seqnum, error, args);
- va_end (args);
- return ret;
-}
diff --git a/usr.sbin/afs/src/arlad/xfs.h b/usr.sbin/afs/src/arlad/xfs.h
deleted file mode 100644
index 1c21d2a0f38..00000000000
--- a/usr.sbin/afs/src/arlad/xfs.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 1999 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * $KTH: nnpfs.h,v 1.8 2000/10/02 22:33:30 lha Exp $
- */
-
-#ifndef __NNPFS_H_V
-#define __NNPFS_H_V 1
-
-void nnpfs_probe_version (int fd, int version);
-
-void nnpfs_message_init (void);
-int nnpfs_message_receive (int fd, struct nnpfs_message_header *h, u_int size);
-int nnpfs_message_receive (int fd, struct nnpfs_message_header *h, u_int size);
-void nnpfs_send_message_gc_nodes (int fd, int num, VenusFid *fids);
-int nnpfs_message_wakeup (int fd, struct nnpfs_message_wakeup *h, u_int size);
-int nnpfs_message_sleep (u_int seqnum);
-int nnpfs_send_message_wakeup (int fd, u_int seqnum, int error);
-int nnpfs_send_message_wakeup_vmultiple (int fd, u_int seqnum,
- int error, va_list args);
-int nnpfs_send_message_wakeup_multiple (int fd, u_int seqnum,
- int error, ...);
-int nnpfs_send_message_wakeup_data (int fd, u_int seqnum, int error,
- void *data, int size);
-int nnpfs_send_message_multiple_list (int fd, struct nnpfs_message_header *h,
- size_t size, u_int num);
-int nnpfs_send_message_multiple (int fd, ...);
-int nnpfs_send_message_vmultiple (int fd, va_list args);
-
-int nnpfs_message_send (int fd, struct nnpfs_message_header *h, u_int size);
-int nnpfs_message_rpc (int fd, struct nnpfs_message_header *h, u_int size);
-
-typedef int
-(*nnpfs_message_function) (int, struct nnpfs_message_header*, u_int);
-
-extern nnpfs_message_function rcvfuncs[NNPFS_MSG_COUNT];
-
-#endif /* __NNPFS_H_V */
diff --git a/usr.sbin/afs/src/cf/auth-modules.m4 b/usr.sbin/afs/src/cf/auth-modules.m4
deleted file mode 100644
index efbd6de893f..00000000000
--- a/usr.sbin/afs/src/cf/auth-modules.m4
+++ /dev/null
@@ -1,27 +0,0 @@
-dnl $KTH: auth-modules.m4,v 1.1 1999/05/15 22:45:18 assar Exp $
-dnl
-dnl Figure what authentication modules should be built
-
-AC_DEFUN(AC_AUTH_MODULES,[
-AC_MSG_CHECKING(which authentication modules should be built)
-
-LIB_AUTH_SUBDIRS=
-
-if test "$ac_cv_header_siad_h" = yes; then
- LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS sia"
-fi
-
-if test "$ac_cv_header_security_pam_modules_h" = yes -a "$enable_shared" = yes; then
- LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS pam"
-fi
-
-case "${host}" in
-changequote(,)dnl
-*-*-irix[56]*) LIB_AUTH_SUBDIRS="$LIB_AUTH_SUBDIRS afskauthlib" ;;
-changequote([,])dnl
-esac
-
-AC_MSG_RESULT($LIB_AUTH_SUBDIRS)
-
-AC_SUBST(LIB_AUTH_SUBDIRS)dnl
-])
diff --git a/usr.sbin/afs/src/cf/broken-glob.m4 b/usr.sbin/afs/src/cf/broken-glob.m4
deleted file mode 100644
index 57ad1856df7..00000000000
--- a/usr.sbin/afs/src/cf/broken-glob.m4
+++ /dev/null
@@ -1,22 +0,0 @@
-dnl $KTH: broken-glob.m4,v 1.1 1999/05/15 22:45:18 assar Exp $
-dnl
-dnl check for glob(3)
-dnl
-AC_DEFUN(AC_BROKEN_GLOB,[
-AC_CACHE_CHECK(for working glob, ac_cv_func_glob_working,
-ac_cv_func_glob_working=yes
-AC_TRY_LINK([
-#include <stdio.h>
-#include <glob.h>],[
-glob(NULL, GLOB_BRACE|GLOB_NOCHECK|GLOB_QUOTE|GLOB_TILDE, NULL, NULL);
-],:,ac_cv_func_glob_working=no,:))
-
-if test "$ac_cv_func_glob_working" = yes; then
- AC_DEFINE(HAVE_GLOB, 1, [define if you have a glob() that groks
- GLOB_BRACE, GLOB_NOCHECK, GLOB_QUOTE, and GLOB_TILDE])
-fi
-if test "$ac_cv_func_glob_working" = yes; then
-AC_NEED_PROTO([#include <stdio.h>
-#include <glob.h>],glob)
-fi
-])
diff --git a/usr.sbin/afs/src/cf/broken-snprintf.m4 b/usr.sbin/afs/src/cf/broken-snprintf.m4
deleted file mode 100644
index e73c0dc6cae..00000000000
--- a/usr.sbin/afs/src/cf/broken-snprintf.m4
+++ /dev/null
@@ -1,58 +0,0 @@
-dnl $KTH: broken-snprintf.m4,v 1.1 1999/05/15 22:45:18 assar Exp $
-dnl
-AC_DEFUN(AC_BROKEN_SNPRINTF, [
-AC_CACHE_CHECK(for working snprintf,ac_cv_func_snprintf_working,
-ac_cv_func_snprintf_working=yes
-AC_TRY_RUN([
-#include <stdio.h>
-#include <string.h>
-int main()
-{
-changequote(`,')dnl
- char foo[3];
-changequote([,])dnl
- snprintf(foo, 2, "12");
- return strcmp(foo, "1");
-}],:,ac_cv_func_snprintf_working=no,:))
-
-if test "$ac_cv_func_snprintf_working" = yes; then
- AC_DEFINE(HAVE_SNPRINTF, 1, [define if you have a working snprintf])
-fi
-if test "$ac_cv_func_snprintf_working" = yes; then
- AC_NEED_PROTO([#include <stdio.h>],snprintf)
-fi
-])
-
-AC_DEFUN(AC_BROKEN_VSNPRINTF,[
-AC_CACHE_CHECK(for working vsnprintf,ac_cv_func_vsnprintf_working,
-ac_cv_func_vsnprintf_working=yes
-AC_TRY_RUN([
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-
-int foo(int num, ...)
-{
-changequote(`,')dnl
- char bar[3];
-changequote([,])dnl
- va_list arg;
- va_start(arg, num);
- vsnprintf(bar, 2, "%s", arg);
- va_end(arg);
- return strcmp(bar, "1");
-}
-
-
-int main()
-{
- return foo(0, "12");
-}],:,ac_cv_func_vsnprintf_working=no,:))
-
-if test "$ac_cv_func_vsnprintf_working" = yes; then
- AC_DEFINE(HAVE_VSNPRINTF, 1, [define if you have a working vsnprintf])
-fi
-if test "$ac_cv_func_vsnprintf_working" = yes; then
- AC_NEED_PROTO([#include <stdio.h>],vsnprintf)
-fi
-])
diff --git a/usr.sbin/afs/src/cf/broken.m4 b/usr.sbin/afs/src/cf/broken.m4
deleted file mode 100644
index b6d0936f871..00000000000
--- a/usr.sbin/afs/src/cf/broken.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-dnl $KTH: broken.m4,v 1.1 1999/05/15 22:45:18 assar Exp $
-dnl
-dnl
-dnl Same as AC _REPLACE_FUNCS, just define HAVE_func if found in normal
-dnl libraries
-
-AC_DEFUN(AC_BROKEN,
-[for ac_func in $1
-do
-AC_CHECK_FUNC($ac_func, [
-ac_tr_func=HAVE_[]upcase($ac_func)
-AC_DEFINE_UNQUOTED($ac_tr_func)],[LIBOBJS[]="$LIBOBJS ${ac_func}.o"])
-dnl autoheader tricks *sigh*
-: << END
-@@@funcs="$funcs $1"@@@
-END
-done
-AC_SUBST(LIBOBJS)dnl
-])
diff --git a/usr.sbin/afs/src/cf/bsd-func-lockmgr.m4 b/usr.sbin/afs/src/cf/bsd-func-lockmgr.m4
deleted file mode 100644
index ce13fcbf7bd..00000000000
--- a/usr.sbin/afs/src/cf/bsd-func-lockmgr.m4
+++ /dev/null
@@ -1,24 +0,0 @@
-dnl
-dnl $KTH: bsd-func-lockmgr.m4,v 1.3 2000/03/24 03:36:23 assar Exp $
-dnl
-
-AC_DEFUN(AC_BSD_FUNC_LOCKMGR, [
-AC_CACHE_CHECK(if lockmgr takes four arguments,
-ac_cv_func_lockmgr_four_args,
-AC_TRY_COMPILE_KERNEL([
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/proc.h>
-#include <sys/lock.h>
-], [lockmgr(NULL, 0, NULL, NULL)],
-ac_cv_func_lockmgr_four_args=yes,
-ac_cv_func_lockmgr_four_args=no))
-if test "$ac_cv_func_lockmgr_four_args" = yes; then
- AC_DEFINE(HAVE_FOUR_ARGUMENT_LOCKMGR, 1,
- [define if lockmgr takes four arguments])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/bsd-func-lockstatus.m4 b/usr.sbin/afs/src/cf/bsd-func-lockstatus.m4
deleted file mode 100644
index d7a709d977c..00000000000
--- a/usr.sbin/afs/src/cf/bsd-func-lockstatus.m4
+++ /dev/null
@@ -1,49 +0,0 @@
-dnl
-dnl $KTH: bsd-func-lockstatus.m4,v 1.6 2000/03/24 03:39:42 assar Exp $
-dnl
-
-AC_DEFUN(AC_BSD_FUNC_LOCKSTATUS, [
-AC_CHECK_KERNEL_FUNCS(lockstatus)
-if test "$ac_cv_kernel_func_lockstatus" = "yes"; then
-AC_CACHE_CHECK(if lockstatus takes two arguments,
-ac_cv_func_lockstatus_two_args,
-AC_TRY_COMPILE_KERNEL([
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/proc.h>
-#include <sys/lock.h>
-], [lockstatus(NULL, NULL)],
-ac_cv_func_lockstatus_two_args=yes,
-ac_cv_func_lockstatus_two_args=no))
-if test "$ac_cv_func_lockstatus_two_args" = yes; then
- AC_DEFINE(HAVE_TWO_ARGUMENT_LOCKSTATUS, 1,
- [define if lockstatus takes two arguments])
-fi
-
-AC_CACHE_CHECK(if lockstatus takes one argument,
-ac_cv_func_lockstatus_one_args,
-AC_TRY_COMPILE_KERNEL([
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/proc.h>
-#include <sys/lock.h>
-], [lockstatus(NULL)],
-ac_cv_func_lockstatus_one_args=yes,
-ac_cv_func_lockstatus_one_args=no))
-if test "$ac_cv_func_lockstatus_one_args" = yes; then
- AC_DEFINE(HAVE_ONE_ARGUMENT_LOCKSTATUS, 1,
- [define if lockstatus takes one argument])
-fi
-
-if test "$ac_cv_func_lockstatus_two_args" = "no" -a "$ac_cv_func_lockstatus_one_args" = "no"; then
- AC_MSG_ERROR([unable to figure out how many args lockstatus takes])
-fi
-fi
-])
diff --git a/usr.sbin/afs/src/cf/bsd-func-selrecord.m4 b/usr.sbin/afs/src/cf/bsd-func-selrecord.m4
deleted file mode 100644
index c4d10e96f9f..00000000000
--- a/usr.sbin/afs/src/cf/bsd-func-selrecord.m4
+++ /dev/null
@@ -1,25 +0,0 @@
-dnl
-dnl $KTH: bsd-func-selrecord.m4,v 1.1.2.2 2001/09/03 23:13:59 ahltorp Exp $
-dnl
-
-AC_DEFUN(AC_BSD_FUNC_SELRECORD, [
-AC_CACHE_CHECK(if selrecord takes three arguments,
-ac_cv_func_selrecord_three_args,
-AC_TRY_COMPILE_KERNEL([
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/proc.h>
-#include <sys/systm.h>
-#include <sys/select.h>
-], [selrecord(NULL, NULL, NULL)],
-ac_cv_func_selrecord_three_args=yes,
-ac_cv_func_selrecord_three_args=no))
-if test "$ac_cv_func_selrecord_three_args" = yes; then
- AC_DEFINE(HAVE_THREE_ARGUMENT_SELRECORD, 1,
- [define if selrecord takes three arguments])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/bsd-func-suser.m4 b/usr.sbin/afs/src/cf/bsd-func-suser.m4
deleted file mode 100644
index 72883773b61..00000000000
--- a/usr.sbin/afs/src/cf/bsd-func-suser.m4
+++ /dev/null
@@ -1,24 +0,0 @@
-dnl
-dnl $KTH: bsd-func-suser.m4,v 1.4 2000/11/01 02:09:16 assar Exp $
-dnl
-
-AC_DEFUN(AC_BSD_FUNC_SUSER, [
-AC_CACHE_CHECK(if suser takes two arguments,
-ac_cv_func_suser_two_args,
-AC_TRY_COMPILE_KERNEL([
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/proc.h>
-#include <sys/systm.h>
-], [suser(NULL, NULL)],
-ac_cv_func_suser_two_args=yes,
-ac_cv_func_suser_two_args=no))
-if test "$ac_cv_func_suser_two_args" = yes; then
- AC_DEFINE(HAVE_TWO_ARGUMENT_SUSER, 1,
- [define if suser takes two arguments])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/bsd-func-vfs-getnewfsid.m4 b/usr.sbin/afs/src/cf/bsd-func-vfs-getnewfsid.m4
deleted file mode 100644
index b0fa3470b9c..00000000000
--- a/usr.sbin/afs/src/cf/bsd-func-vfs-getnewfsid.m4
+++ /dev/null
@@ -1,27 +0,0 @@
-dnl
-dnl $KTH: bsd-func-vfs-getnewfsid.m4,v 1.2 2000/05/23 14:30:43 assar Exp $
-dnl
-
-AC_DEFUN(AC_BSD_FUNC_VFS_GETNEWFSID, [
-AC_CHECK_KERNEL_FUNCS(vfs_getnewfsid)
-if test "$ac_cv_kernel_func_vfs_getnewfsid" = "yes"; then
-AC_CACHE_CHECK(if vfs_getnewfsid takes two arguments,
-ac_cv_func_vfs_getnewfsid_two_args,
-AC_TRY_COMPILE_KERNEL([
-#include <sys/types.h>
-#include <sys/param.h>
-#ifdef HAVE_SYS_MODULE_H
-#include <sys/module.h>
-#endif
-#include <sys/mount.h>
-#include <sys/vnode.h>
-],
-[vfs_getnewfsid(NULL, 0);],
-ac_cv_func_vfs_getnewfsid_two_args=yes,
-ac_cv_func_vfs_getnewfsid_two_args=no))
-if test "$ac_cv_func_vfs_getnewfsid_two_args" = yes; then
- AC_DEFINE(HAVE_TWO_ARGUMENT_VFS_GETNEWFSID, 1,
- [define if vfs_getnewfsid takes two arguments])
-fi
-fi
-])
diff --git a/usr.sbin/afs/src/cf/bsd-header-vnode-if-h.m4 b/usr.sbin/afs/src/cf/bsd-header-vnode-if-h.m4
deleted file mode 100644
index d5cfe2820f3..00000000000
--- a/usr.sbin/afs/src/cf/bsd-header-vnode-if-h.m4
+++ /dev/null
@@ -1,41 +0,0 @@
-dnl
-dnl $KTH: bsd-header-vnode-if-h.m4,v 1.2 2000/03/16 10:34:32 assar Exp $
-dnl
-
-AC_DEFUN(AC_BSD_HEADER_VNODE_IF_H, [
-AC_MSG_CHECKING(if vnode_if.h needs to be built)
-changequote(, )dnl
-rm -f vnode_if.[ch]
-changequote([,])dnl
-AC_TRY_CPP_KERNEL([
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/vnode.h>
-], ac_cv_header_vnode_if_h=no,
-ac_cv_header_vnode_if_h=yes)
-dnl
-if test "$ac_cv_header_vnode_if_h" = "yes"; then
-test -d ../sys || mkdir ../sys
-if test -f $SYS/kern/vnode_if.pl; then
- perl $SYS/kern/vnode_if.pl -h $SYS/kern/vnode_if.src
-elif test -f $SYS/kern/vnode_if.sh; then
- /bin/sh $SYS/kern/vnode_if.sh $SYS/kern/vnode_if.src
-else
- AC_MSG_ERROR(unable to find any vnode_if script)
-fi
-if test -f vnode_if.h; then
- :
-else
- AC_MSG_ERROR(failed to create vnode_if.h)
-fi
-AC_TRY_CPP_KERNEL([
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/vnode.h>
-], ac_cv_header_vnode_if_h=yes; VNODE_IF_H=vnode_if.h,
-AC_MSG_ERROR(tried creating vnode_if.h but still could not include vnode.h))
-fi
-AC_MSG_RESULT($ac_cv_header_vnode_if_h)
-AC_SUBST(VNODE_IF_H)])
diff --git a/usr.sbin/afs/src/cf/bsd-uvm-only.m4 b/usr.sbin/afs/src/cf/bsd-uvm-only.m4
deleted file mode 100644
index 8f535daab18..00000000000
--- a/usr.sbin/afs/src/cf/bsd-uvm-only.m4
+++ /dev/null
@@ -1,34 +0,0 @@
-dnl
-dnl $KTH: bsd-uvm-only.m4,v 1.2 2000/10/04 00:01:06 lha Exp $
-dnl
-
-AC_DEFUN(AC_CHECK_BSD_UVM_ONLY,[
-AC_CACHE_CHECK(if we can only include uvm headers,
-ac_cv_kernel_uvm_only,
-AC_TRY_COMPILE_KERNEL([
-#include <sys/types.h>
-#include <sys/param.h>
-#ifdef HAVE_VM_VM_H
-#include <vm/vm.h>
-#endif
-#ifdef HAVE_VM_VM_EXTERN_H
-#include <vm/vm_extern.h>
-#endif
-#ifdef HAVE_VM_VM_ZONE_H
-#include <vm/vm_zone.h>
-#endif
-#ifdef HAVE_VM_VM_OBJECT_H
-#include <vm/vm_object.h>
-#endif
-#ifdef HAVE_UVM_UVM_EXTERN_H
-#include <uvm/uvm_extern.h>
-#endif
-], [int suvmtiuk = 1;
-],
-ac_cv_kernel_uvm_only=yes,
-ac_cv_kernel_uvm_only=no))]
-if test "$ac_cv_kernel_uvm_only" = no; then
-AC_DEFINE(HAVE_KERNEL_UVM_ONLY, 1,
-[define if we only can include uvm headers])
-fi
-)
diff --git a/usr.sbin/afs/src/cf/bsd-vfs-busy.m4 b/usr.sbin/afs/src/cf/bsd-vfs-busy.m4
deleted file mode 100644
index f73f34abd6d..00000000000
--- a/usr.sbin/afs/src/cf/bsd-vfs-busy.m4
+++ /dev/null
@@ -1,66 +0,0 @@
-dnl
-dnl $KTH: bsd-vfs-busy.m4,v 1.3 2000/02/20 03:06:43 assar Exp $
-dnl
-
-dnl
-dnl try to find out if vfs_busy takes two/three/four arguments
-dnl
-
-AC_DEFUN(AC_BSD_FUNC_VFS_BUSY,[
-AC_CACHE_CHECK(if vfs_busy takes two arguments, ac_cv_func_vfs_busy_two_args,
-AC_TRY_COMPILE_KERNEL([
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/ucred.h>
-#ifdef HAVE_SYS_MODULE_H
-#include <sys/module.h>
-#endif
-#include <sys/mount.h>],[vfs_busy(0, 0)],
-ac_cv_func_vfs_busy_two_args=yes,
-ac_cv_func_vfs_busy_two_args=no))
-if test "$ac_cv_func_vfs_busy_two_args" = yes; then
- AC_DEFINE(HAVE_TWO_ARGUMENT_VFS_BUSY, 1,
- [define if vfs_busy takes two arguments])
-fi
-
-AC_CACHE_CHECK(if vfs_busy takes three arguments, ac_cv_func_vfs_busy_three_args,
-AC_TRY_COMPILE_KERNEL([
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/ucred.h>
-#ifdef HAVE_SYS_MODULE_H
-#include <sys/module.h>
-#endif
-#include <sys/mount.h>],[vfs_busy(0, 0, 0)],
-ac_cv_func_vfs_busy_three_args=yes,
-ac_cv_func_vfs_busy_three_args=no))
-if test "$ac_cv_func_vfs_busy_three_args" = yes; then
- AC_DEFINE(HAVE_THREE_ARGUMENT_VFS_BUSY, 1,
- [define if vfs_busy takes three arguments])
-fi
-
-AC_CACHE_CHECK(if vfs_busy takes four arguments, ac_cv_func_vfs_busy_four_args,
-AC_TRY_COMPILE_KERNEL([
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/ucred.h>
-#ifdef HAVE_SYS_MODULE_H
-#include <sys/module.h>
-#endif
-#include <sys/mount.h>],[vfs_busy(0, 0, 0, 0)],
-ac_cv_func_vfs_busy_four_args=yes,
-ac_cv_func_vfs_busy_four_args=no))
-if test "$ac_cv_func_vfs_busy_four_args" = yes; then
- AC_DEFINE(HAVE_FOUR_ARGUMENT_VFS_BUSY, 1,
- [define if vfs_busy takes four arguments])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/bsd-vfs-object-create.m4 b/usr.sbin/afs/src/cf/bsd-vfs-object-create.m4
deleted file mode 100644
index f7bd455bf8d..00000000000
--- a/usr.sbin/afs/src/cf/bsd-vfs-object-create.m4
+++ /dev/null
@@ -1,28 +0,0 @@
-dnl
-dnl $KTH: bsd-vfs-object-create.m4,v 1.1 1999/05/15 22:45:19 assar Exp $
-dnl
-
-dnl
-dnl check for number of arguments to vfs_object_create
-dnl
-
-AC_DEFUN(AC_BSD_FUNC_VFS_OBJECT_CREATE, [
-AC_CHECK_KERNEL_FUNCS(vfs_object_create)
-if test "$ac_cv_kernel_func_vfs_object_create" = "yes"; then
-AC_CACHE_CHECK(if vfs_object_create takes four arguments,
-ac_cv_func_vfs_object_create_four_args,
-AC_TRY_COMPILE_KERNEL([
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/vnode.h>
-],
-[vfs_object_create(0, 0, 0, 0);],
-ac_cv_func_vfs_object_create_four_args=yes,
-ac_cv_func_vfs_object_create_four_args=no))
-if test "$ac_cv_func_vfs_object_create_four_args" = "yes"; then
- ac_foo=
- AC_DEFINE(HAVE_FOUR_ARGUMENT_VFS_OBJECT_CREATE, 1,
- [if vfs_object_create takes four arguments])
-fi
-fi
-])
diff --git a/usr.sbin/afs/src/cf/bsd-vget.m4 b/usr.sbin/afs/src/cf/bsd-vget.m4
deleted file mode 100644
index 7131830dfd7..00000000000
--- a/usr.sbin/afs/src/cf/bsd-vget.m4
+++ /dev/null
@@ -1,66 +0,0 @@
-dnl
-dnl $KTH: bsd-vget.m4,v 1.4 2000/06/12 06:13:52 assar Exp $
-dnl
-
-AC_DEFUN(AC_BSD_FUNC_VGET, [
-AC_CACHE_CHECK(if vget takes one argument, ac_cv_func_vget_one_args,
-AC_TRY_COMPILE_KERNEL([
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#if defined(__osf__) && defined(__GNUC__)
-#define asm __foo_asm
-#endif
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/uio.h>
-#include <sys/vnode.h>
-],[vget(0)],
-ac_cv_func_vget_one_args=yes,
-ac_cv_func_vget_one_args=no))
-if test "$ac_cv_func_vget_one_args" = yes; then
- AC_DEFINE_UNQUOTED(HAVE_ONE_ARGUMENT_VGET, 1,
- [define if vget takes one argument])
-fi
-
-AC_CACHE_CHECK(if vget takes two arguments, ac_cv_func_vget_two_args,
-AC_TRY_COMPILE_KERNEL([
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/uio.h>
-#include <sys/vnode.h>
-],[vget(0, 0)],
-ac_cv_func_vget_two_args=yes,
-ac_cv_func_vget_two_args=no))
-if test "$ac_cv_func_vget_two_args" = yes; then
- AC_DEFINE_UNQUOTED(HAVE_TWO_ARGUMENT_VGET, 1,
- [define if vget takes two arguments])
-fi
-
-AC_CACHE_CHECK(if vget takes three arguments, ac_cv_func_vget_three_args,
-AC_TRY_COMPILE_KERNEL([
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/uio.h>
-#include <sys/vnode.h>
-],[vget(0, 0, 0)],
-ac_cv_func_vget_three_args=yes,
-ac_cv_func_vget_three_args=no))
-if test "$ac_cv_func_vget_three_args" = yes; then
- AC_DEFINE(HAVE_THREE_ARGUMENT_VGET, 1,
- [define if vget takes three arguments])
-fi
-
-if test "$ac_cv_func_vget_one_args" = "no" -a "$ac_cv_func_vget_two_args" = "no" -a "$ac_cv_func_vget_three_args" = "no"; then
- AC_MSG_ERROR([test for number of arguments of vget failed])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/bsd-vop-lock.m4 b/usr.sbin/afs/src/cf/bsd-vop-lock.m4
deleted file mode 100644
index 14fa85dea2b..00000000000
--- a/usr.sbin/afs/src/cf/bsd-vop-lock.m4
+++ /dev/null
@@ -1,63 +0,0 @@
-dnl
-dnl $KTH: bsd-vop-lock.m4,v 1.3 2000/01/30 23:56:45 assar Exp $
-dnl
-
-dnl
-dnl Find out if VOP_LOCK takes one, two, or three arguments
-dnl
-
-AC_DEFUN(AC_BSD_FUNC_VOP_LOCK, [
-AC_CACHE_CHECK(if VOP_LOCK takes one argument, ac_cv_func_vop_lock_one_arg,
-AC_TRY_COMPILE_KERNEL([
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/uio.h>
-#include <sys/vnode.h>
-],[VOP_LOCK(0)],
-ac_cv_func_vop_lock_one_arg=yes,
-ac_cv_func_vop_lock_one_arg=no))
-if test "$ac_cv_func_vop_lock_one_arg" = yes; then
- AC_DEFINE_UNQUOTED(HAVE_ONE_ARGUMENT_VOP_LOCK, 1,
- [define if VOP_LOCK takes one argument])
-fi
-
-AC_CACHE_CHECK(if VOP_LOCK takes two arguments, ac_cv_func_vop_lock_two_args,
-AC_TRY_COMPILE_KERNEL([
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/uio.h>
-#include <sys/vnode.h>
-],[VOP_LOCK(0, 0)],
-ac_cv_func_vop_lock_two_args=yes,
-ac_cv_func_vop_lock_two_args=no))
-if test "$ac_cv_func_vop_lock_two_args" = yes; then
- AC_DEFINE(HAVE_TWO_ARGUMENT_VOP_LOCK, 1,
- [define if VOP_LOCK takes two arguments])
-fi
-
-AC_CACHE_CHECK(if VOP_LOCK takes three arguments, ac_cv_func_vop_lock_three_args,
-AC_TRY_COMPILE_KERNEL([
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/uio.h>
-#include <sys/vnode.h>
-],[VOP_LOCK(0, 0, 0)],
-ac_cv_func_vop_lock_three_args=yes,
-ac_cv_func_vop_lock_three_args=no))
-if test "$ac_cv_func_vop_lock_three_args" = yes; then
- AC_DEFINE(HAVE_THREE_ARGUMENT_VOP_LOCK, 1,
- [define if VOP_LOCK takes three arguments])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/c-attribute.m4 b/usr.sbin/afs/src/cf/c-attribute.m4
deleted file mode 100644
index d7fe01df296..00000000000
--- a/usr.sbin/afs/src/cf/c-attribute.m4
+++ /dev/null
@@ -1,40 +0,0 @@
-dnl
-dnl $KTH: c-attribute.m4,v 1.4 2000/10/10 22:11:31 lha Exp $
-dnl
-
-dnl
-dnl Test for __attribute__
-dnl
-
-AC_DEFUN(AC_C___ATTRIBUTE__, [
-AC_MSG_CHECKING(for __attribute__)
-AC_CACHE_VAL(ac_cv___attribute__, [
-AC_TRY_COMPILE([
-#include <stdlib.h>
-],
-[
-static void foo(void) __attribute__ ((noreturn));
-
-static void
-foo(void)
-{
- exit(1);
-}
-
-/* Check for old gcc */
-static void __attribute__ ((unused))
-bar(void)
-{
- exit (1);
-}
-
-
-],
-ac_cv___attribute__=yes,
-ac_cv___attribute__=no)])
-if test "$ac_cv___attribute__" = "yes"; then
- AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
-fi
-AC_MSG_RESULT($ac_cv___attribute__)
-])
-
diff --git a/usr.sbin/afs/src/cf/c-function.m4 b/usr.sbin/afs/src/cf/c-function.m4
deleted file mode 100644
index 4676977a347..00000000000
--- a/usr.sbin/afs/src/cf/c-function.m4
+++ /dev/null
@@ -1,33 +0,0 @@
-dnl
-dnl $KTH: c-function.m4,v 1.1 1999/05/15 22:45:20 assar Exp $
-dnl
-
-dnl
-dnl Test for __FUNCTION__
-dnl
-
-AC_DEFUN(AC_C___FUNCTION__, [
-AC_MSG_CHECKING(for __FUNCTION__)
-AC_CACHE_VAL(ac_cv___function__, [
-AC_TRY_RUN([
-#include <string.h>
-
-static char *foo()
-{
- return __FUNCTION__;
-}
-
-int main()
-{
- return strcmp(foo(), "foo") != 0;
-}
-],
-ac_cv___function__=yes,
-ac_cv___function__=no,
-ac_cv___function__=no)])
-if test "$ac_cv___function__" = "yes"; then
- AC_DEFINE(HAVE___FUNCTION__, 1, [define if your compiler has __FUNCTION__])
-fi
-AC_MSG_RESULT($ac_cv___function__)
-])
-
diff --git a/usr.sbin/afs/src/cf/check-declaration.m4 b/usr.sbin/afs/src/cf/check-declaration.m4
deleted file mode 100644
index 703e7bafddf..00000000000
--- a/usr.sbin/afs/src/cf/check-declaration.m4
+++ /dev/null
@@ -1,25 +0,0 @@
-dnl $KTH: check-declaration.m4,v 1.2 1999/10/06 03:15:53 assar Exp $
-dnl
-dnl
-dnl Check if we need the declaration of a variable
-dnl
-
-dnl AC_CHECK_DECLARATION(includes, variable)
-AC_DEFUN(AC_CHECK_DECLARATION, [
-AC_MSG_CHECKING([if $2 is properly declared])
-AC_CACHE_VAL(ac_cv_var_$2_declaration, [
-AC_TRY_COMPILE([$1
-extern struct { int foo; } $2;],
-[$2.foo = 1;],
-eval "ac_cv_var_$2_declaration=no",
-eval "ac_cv_var_$2_declaration=yes")
-])
-
-define(foo, [HAVE_]translit($2, [a-z], [A-Z])[_DECLARATION])
-
-AC_MSG_RESULT($ac_cv_var_$2_declaration)
-if eval "test \"\$ac_cv_var_$2_declaration\" = yes"; then
- AC_DEFINE(foo, 1, [define if your system declares $2])
-fi
-undefine([foo])
-])
diff --git a/usr.sbin/afs/src/cf/check-dirsiz.m4 b/usr.sbin/afs/src/cf/check-dirsiz.m4
deleted file mode 100644
index c11a75b7194..00000000000
--- a/usr.sbin/afs/src/cf/check-dirsiz.m4
+++ /dev/null
@@ -1,45 +0,0 @@
-dnl
-dnl $KTH: check-dirsiz.m4,v 1.1 1999/05/15 22:45:21 assar Exp $
-dnl
-
-dnl
-dnl Check where DIRSIZ lives
-dnl
-
-AC_DEFUN(AC_CHECK_DIRSIZ, [
-
-AC_CACHE_CHECK([if DIRSIZ lives in dirent.h], ac_cv_dirsiz_in_dirent,
-AC_EGREP_CPP(yes,[#include <dirent.h>
-#ifdef DIRSIZE
-yes
-#endif],
-eval "ac_cv_dirsiz_in_dirent=yes",
-eval "ac_cv_dirsiz_in_dirent=no"))
-if test "$ac_cv_dirsiz_in_dirent" = "yes"; then
- AC_DEFINE(DIRSIZ_IN_DIRENT_H, 1, [define if DIRSIZ is defined in dirent.h])
-fi
-
-AC_CACHE_CHECK([if DIRSIZ lives in sys/dir.h], ac_cv_dirsiz_in_sys_dir,
-AC_EGREP_CPP(yes,[#include <sys/dir.h>
-#ifdef DIRSIZ
-yes
-#endif],
-eval "ac_cv_dirsiz_in_sys_dir=yes",
-eval "ac_cv_dirsiz_in_sys_dir=no"))
-if test "$ac_cv_dirsiz_in_sys_dir" = "yes"; then
- AC_DEFINE(DIRSIZ_IN_SYS_DIR_H, 1, [define if DIRSIZ is defined in sys/dir.h])
-fi
-
-AC_CACHE_CHECK([if _GENERIC_DIRSIZ lives in sys/dirent.h],
-ac_cv_generic_dirsiz_in_sys_dirent,
-AC_EGREP_CPP(yes,[#include <sys/dirent.h>
-#ifdef _GENERIC_DIRSIZ
-yes
-#endif],
-eval "ac_cv_generic_dirsiz_in_sys_dirent=yes",
-eval "ac_cv_generic_dirsiz_in_sys_dirent=no"))
-if test "$ac_cv_generic_dirsiz_in_sys_dirent" = "yes"; then
- AC_DEFINE(GENERIC_DIRSIZ_IN_SYS_DIRENT_H, 1,
- [define if DIRSIZ is defined in sys/dirent.h])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/check-getpwnam_r-posix.m4 b/usr.sbin/afs/src/cf/check-getpwnam_r-posix.m4
deleted file mode 100644
index b3287735249..00000000000
--- a/usr.sbin/afs/src/cf/check-getpwnam_r-posix.m4
+++ /dev/null
@@ -1,24 +0,0 @@
-dnl $KTH: check-getpwnam_r-posix.m4,v 1.1 1999/05/15 22:45:21 assar Exp $
-dnl
-dnl check for getpwnam_r, and if it's posix or not
-
-AC_DEFUN(AC_CHECK_GETPWNAM_R_POSIX,[
-AC_FIND_FUNC_NO_LIBS(getpwnam_r,c_r)
-if test "$ac_cv_func_getpwnam_r" = yes; then
- AC_CACHE_CHECK(if getpwnam_r is posix,ac_cv_func_getpwnam_r_posix,
- ac_libs="$LIBS"
- LIBS="$LIBS $LIB_getpwnam_r"
- AC_TRY_RUN([
-#include <pwd.h>
-int main()
-{
- struct passwd pw, *pwd;
- return getpwnam_r("", &pw, NULL, 0, &pwd) < 0;
-}
-],ac_cv_func_getpwnam_r_posix=yes,ac_cv_func_getpwnam_r_posix=no,:)
-LIBS="$ac_libs")
-if test "$ac_cv_func_getpwnam_r_posix" = yes; then
- AC_DEFINE(POSIX_GETPWNAM_R, 1, [Define if getpwnam_r has POSIX flavour.])
-fi
-fi
-]) \ No newline at end of file
diff --git a/usr.sbin/afs/src/cf/check-glibc.m4 b/usr.sbin/afs/src/cf/check-glibc.m4
deleted file mode 100644
index 4107057f704..00000000000
--- a/usr.sbin/afs/src/cf/check-glibc.m4
+++ /dev/null
@@ -1,22 +0,0 @@
-dnl
-dnl $KTH: check-glibc.m4,v 1.2 2000/03/14 00:04:09 assar Exp $
-dnl
-dnl
-dnl test for GNU libc
-dnl
-
-AC_DEFUN(AC_CHECK_GLIBC,[
-AC_CACHE_CHECK([for glibc],ac_cv_libc_glibc,[
-AC_EGREP_CPP(yes,
-[#include <features.h>
-#ifdef __GLIBC__
-yes
-#endif
-],
-eval "ac_cv_libc_glibc=yes",
-eval "ac_cv_libc_glibc=no")])
-if test "$ac_cv_libc_glibc" = "yes";then
- AC_DEFINE(HAVE_GLIBC, 1,
- [define if you have a glibc-based system])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/check-kafs.m4 b/usr.sbin/afs/src/cf/check-kafs.m4
deleted file mode 100644
index 83b450b4ac0..00000000000
--- a/usr.sbin/afs/src/cf/check-kafs.m4
+++ /dev/null
@@ -1,55 +0,0 @@
-dnl
-dnl $KTH: check-kafs.m4,v 1.7.2.1 2001/04/16 23:07:48 lha Exp $
-dnl
-dnl check for libkafs/krbafs
-dnl
-
-dnl check_kafs_fluff(LIB_DIR,LIB_LIBS)
-define(check_kafs_fluff,[
-for b in "kafs" "krbafs"; do
- LIBS="$saved_LIBS ${KAFS_LIBS_FLAGS} $1 -l$b $2"
- AC_TRY_LINK([],
- [k_hasafs()],
- [ac_cv_funclib_k_hasafs=yes
- ac_cv_libkafs_flags="$KAFS_LIBS_FLAGS $1 -l$b $2"
- break 2],
- [ac_cv_funclib_k_hasafs=no])
-done])
-
-AC_DEFUN(AC_CHECK_KAFS,[
-
-AC_ARG_WITH(krbafs,
-[ --with-krbafs=dir use libkrbafs (from cmu, extracted from kth-krb) in dir],
-
-[if test "$with_krbafs" = "yes"; then
- AC_MSG_ERROR([You have to give the path to krbafs lib])
-elif test "$with_krbafs" = "no"; then
- ac_cv_funclib_k_hasafs=no
-else
- KAFS_LIBS_FLAGS="-L${with_krbafs}/lib"
-fi])
-
-AC_CACHE_CHECK([for libkafs/libkrbafs],
-[ac_cv_funclib_k_hasafs],[
-
-saved_LIBS="$LIBS"
-
-for a in "foo" ; do
-check_kafs_fluff([],[])
-check_kafs_fluff([${KRB4_LIB_DIR}],[${KRB4_LIB_LIBS}])
-check_kafs_fluff([${KRB5_LIB_DIR}],[${KRB5_LIB_LIBS}])
-check_kafs_fluff([${KRB4_LIB_DIR} ${KRB5_LIB_DIR}],
-[${KRB5_LIB_LIBS} ${KRB4_LIB_LIBS}])
-done
-
-undefine([check_kafs_fluff])
-
-LIBS="$saved_LIBS"])
-
-if test "X$ac_cv_funclib_k_hasafs" != "Xno"; then
- KAFS_LIBS="$ac_cv_libkafs_flags"
-fi
-
-AC_SUBST(KAFS_LIBS)dnl
-
-])dnl
diff --git a/usr.sbin/afs/src/cf/check-kerberos.m4 b/usr.sbin/afs/src/cf/check-kerberos.m4
deleted file mode 100644
index c63e7216ca4..00000000000
--- a/usr.sbin/afs/src/cf/check-kerberos.m4
+++ /dev/null
@@ -1,488 +0,0 @@
-dnl
-dnl $KTH: check-kerberos.m4,v 1.38.2.2 2001/10/23 23:27:23 ahltorp Exp $
-dnl
-dnl Check if the dog is alive
-dnl
-dnl Arguments:
-dnl
-dnl AC_CHECK_KERBEROS(4):
-dnl check for krb4 libs and krb5 krb4 compat libs
-dnl AC_CHECK_KERBEROS(45):
-dnl check for krb4 libs and krb5 libs
-dnl AC_CHECK_KERBEROS(5):
-dnl check for krb5 libs
-dnl AC_CHECK_KERBEROS([45]auto):
-dnl check for kerberos without a --with-krbN
-dnl
-dnl Set:
-dnl ac_cv_found_krb4=[yes|no]
-dnl KRB4_{LIB|INC}_DIR
-dnl KRB4_{LIB,INC}_FLAGS
-dnl KRB4_LIB_LIBS
-dnl
-dnl ac_cv_found_krb5=[yes|no]
-dnl KRB5_{LIB|INC}_DIR
-dnl KRB5_{LIB,INC}_FLAGS
-dnl KRB5_LIB_LIBS
-dnl
-dnl
-dnl Check order
-dnl krb5
-dnl include testing of libk5crypto/libcrypto
-dnl krb4
-dnl krb5 compat if needed (included in krb4 test)
-dnl this is the reson krb5 is tested first
-dnl
-
-AC_DEFUN(AC_CHECK_KERBEROS,[
-
-dnl
-dnl Parse args for kerberos4
-dnl
-
-ifelse(-1,regexp($1,[[45]]),[
- errprint(__file__:__line__: [CHECK_KERBEROS: have to give at lease 4 or 5
-])
- m4exit(1)
-])
-
-ifelse(-1,regexp($1,4),[with_krb4=no],[ dnl WITHOUT KERBEROS4 (1)
-
-AC_ARG_WITH(krb4,
-[ --with-krb4=dir use kerberos 4 in dir],
-[if test "X$withval" = "X"; then
- ifelse(-1,regexp($1,[auto]),[
- AC_MSG_ERROR([You have to give a dir to --with-krb4])],
- [:])
-fi],
-[ifelse(-1,regexp($1,auto),[with_krb4=no],[with_krb4=yes])])
-
-AC_ARG_WITH(krb4-lib,
-[ --with-krb4-lib=dir use kerberos 4 libraries in dir],
-[if test "$withval" = "yes" -o "$withval" = "no"; then
- AC_MSG_ERROR([No argument for --with-krb4-lib])
-fi])
-
-AC_ARG_WITH(krb4-include,
-[ --with-krb4-include=dir use kerberos 4 headers in dir],
-[if test "$withval" = "yes" -o "$withval" = "no"; then
- AC_MSG_ERROR([No argument for --with-krb4-include])
-fi])
-
-]) dnl WITHOUT KERBEROS4 (1)
-
-dnl
-dnl Parse args for kerberos5
-dnl
-
-AC_ARG_WITH(krb5,
-[ --with-krb5=dir use ]dnl
-ifelse(-1,regexp($1,5),[kerberos 4 compat from ])[kerberos 5 in dir],
-[
-if test "X$withval" = "X"; then
- ifelse(-1,regexp($1,[auto]),[
- AC_MSG_ERROR([You have to give a dir to --with-krb5])],
- [:])
- ifelse(-1,regexp($1,5),[
- if test "X$with_krb4" != "Xno"; then
- AC_MSG_ERROR([Already specified kerberos 4 with --with-krb4])
- fi])
-elif test "$withval" = "no"; then
-ifelse(-1,regexp($1,4),[with_krb5=no],
-[if test "$with_krb4" = "yes"; then
- with_krb5=compat
-else
- with_krb5=no
-fi])
-fi
-],
-[ifelse(-1,regexp($1,auto),[with_krb5=compat],[with_krb5=yes])])
-
-AC_ARG_WITH(krb5-include,
-[ --with-krb5-include=dir use ]dnl
-ifelse(-1,regexp($1,5),[kerberos 4 compat from ])[kerberos 5 headers in dir],
-[if test "$withval" = "yes" -o "$withval" = "no"; then
- AC_MSG_ERROR([No argument for --with-krb5-include])
-fi
-ifelse(-1,regexp($1,5),[
-if test "X$with_krb4_include" != "X"; then
- AC_MSG_ERROR([Already specified kerberos 4 headers with --with-krb4-include])
-fi])])
-
-AC_ARG_WITH(krb5-lib,
-[ --with-krb5-lib=dir use kerberos 5 libraries in dir],
-[if test "$withval" = "yes" -o "$withval" = "no"; then
- AC_MSG_ERROR([No argument for --with-krb5-lib])
-fi
-ifelse(-1,regexp($1,5),[
-if test "X$with_krb4_lib" != "X"; then
- AC_MSG_ERROR([Already specified kerberos 4 libraries with --with-krb4-lib])
-fi])])
-
-
-dnl
-dnl Check for kerberos5
-dnl
-
-case X"$with_krb5" in
- Xyes|Xno|Xcompat)
- ;;
- *)
- ac_cv_krb5_where_lib="$with_krb5/lib"
- ac_cv_krb5_where_inc="$with_krb5/include"
- ac_cv_found_krb5=yes
- ;;
-esac
-
-if test "X$with_krb5_include" != "X"; then
- ac_cv_krb4_where_inc=$with_krb5_include
- ac_cv_found_krb5=yes
-fi
-
-if test "X$with_krb5_lib" != "X"; then
- ac_cv_krb5_where_lib=$with_krb5_lib
- with_krb5=yes
-fi
-
-ifelse(-1,regexp($1,auto),[],[
-if test "$with_krb5" != "no"; then
- if test "$ac_cv_krb5_where_lib" = ""; then
- AC_KRB5_LIB_WHERE(["" /usr/heimdal/lib /usr/athena/lib /usr/kerberos/lib /usr/local/lib])
- else
- AC_KRB5_LIB_WHERE($ac_cv_krb5_where_lib)
- fi
-fi
-])
-
-if test "X$with_krb5_include" != "X"; then
- ac_cv_krb5_where_inc=$with_krb5_include
- ac_cv_found_krb5=yes
- with_krb5=yes
-fi
-
-ifelse(-1,regexp($1,auto),[],[ dnl KRB5-AUTO
-if test "$with_krb5" != "no"; then
- if test "$ac_cv_krb5_where_inc" = ""; then
- AC_KRB5_INC_WHERE(["" /usr/heimdal/include /usr/athena/include /usr/kerberos/include /usr/include/kerberosV /usr/include/kerberos /usr/include/krb5 /usr/local/include])
- else
- AC_KRB5_INC_WHERE($ac_cv_krb5_where_inc)
- fi
-fi
-]) dnl KRB5-AUTO
-
-ifelse(-1,regexp($1,4),[],[ dnl WITHOUT KERBEROS4 (2)
-
-dnl
-dnl Check for kerberos4
-dnl
-
-if test "X$with_krb4" != "Xyes" -a "X$with_krb4" != "Xno"; then
- ac_cv_krb4_where_lib=$with_krb4/lib
- ac_cv_krb4_where_inc=$with_krb4/include
- ac_cv_found_krb4=yes
- ifelse(-1,regexp($1,5),[ac_cv_found_krb5=no])
-fi
-
-if test "X$with_krb4_lib" != "X"; then
- ac_cv_krb4_where_lib=$with_krb4_lib
- ac_cv_found_krb4=yes
-fi
-
-ifelse(-1,regexp($1,auto),[],[
-if test "$with_krb4" != "no"; then
- if test "$ac_cv_krb4_where_lib" = ""; then
- AC_KRB4_LIB_WHERE(["" /usr/athena/lib /usr/kerberos/lib /usr/lib /usr/local/lib])
- else
- AC_KRB4_LIB_WHERE($ac_cv_krb4_where_lib)
- fi
-fi
-])
-
-if test "X$with_krb4_include" != "X"; then
- ac_cv_krb4_where_inc=$with_krb4_include
- ac_cv_found_krb4=yes
-fi
-
-ifelse(-1,regexp($1,auto),[],[
-if test "$with_krb4" != "no"; then
- if test "$ac_cv_krb4_where_inc" = ""; then
- AC_KRB4_INC_WHERE(["" /usr/include /usr/athena/include /usr/kerberos/include /usr/include/kerberos /usr/local/include])
- else
- AC_KRB4_INC_WHERE($ac_cv_krb4_where_inc)
- fi
-fi
-])
-
-]) dnl WITHOUT KERBEROS4 (2)
-
-
-dnl
-dnl
-dnl
-
-ifelse(-1,regexp($1,5),[],[ dnl KRB5 VARS
-
-if test "X$ac_cv_found_krb5" = "Xyes"; then
- KRB5_INC_DIR=$ac_cv_krb5_where_inc
- KRB5_LIB_DIR=$ac_cv_krb5_where_lib
- KRB5_INC_FLAGS=
- if test "X$KRB5_INC_DIR" != "X" ; then
- KRB5_INC_FLAGS="-I${KRB5_INC_DIR}"
- fi
- if test "X$KRB5_LIB_DIR" != "X" ; then
- KRB5_LIB_DIR="-L$KRB5_LIB_DIR"
- fi
- KRB5_LIB_LIBS="-lkrb5 -lcom_err $ac_cv_krb5_extralib"
- KRB5_LIB_FLAGS="$KRB5_LIB_DIR $KRB5_LIB_LIBS"
-fi
-
-]) dnl KRB5 VARS
-
-ifelse(-1,regexp($1,4),[],[ dnl KRB4 VARS
-
-if test "X$ac_cv_found_krb4" = "Xyes"; then
- KRB4_INC_DIR=$ac_cv_krb4_where_inc
- KRB4_LIB_DIR=$ac_cv_krb4_where_lib
- KRB4_INC_FLAGS=
- if test "X$KRB4_INC_DIR" != "X" ; then
- KRB4_INC_FLAGS="-I${KRB4_INC_DIR}"
- fi
- KRB4_LIB_LIBS="$ac_cv_krb4_extralib"
- if test "X$KRB4_LIB_DIR" != "X" ; then
- KRB4_LIB_DIR="-L${KRB4_LIB_DIR}"
- fi
- KRB4_LIB_FLAGS="$KRB4_LIB_DIR $KRB4_LIB_LIBS"
-fi
-
-]) dnl KRB4 VARS
-
-
-dnl
-dnl Export variables, but only we have want it
-dnl
-
-dnl KRB 5 - export
-
-if test "X$ac_cv_found_krb5" = "Xyes"; then
- if test "X$ac_cv_found_krb4_lib" = "Xcompat"; then
- ac_cv_found_krb4=yes
- with_krb4=yes
- ifelse(-1,regexp($1,5),[ dnl 5
- ac_cv_found_krb5=no
- ],[
- AC_DEFINE(HAVE_KRB5_COMPAT_KRB4, 1,
- [define if you have kerberos 4 compat])
- ]) dnl END 5
- fi
- ifelse(-1,regexp($1,5),[],[
- with_krb5=yes
- AC_DEFINE(HAVE_KRB5, 1, [define if you have kerberos 5])
- ])
- AC_DEFINE(KERBEROS, 1, [define if you have kerberos])
-fi
-
-ifelse(-1,regexp($1,5),[],[
-AC_SUBST(KRB5_LIB_DIR)
-AC_SUBST(KRB5_INC_DIR)
-AC_SUBST(KRB5_INC_FLAGS)
-AC_SUBST(KRB5_LIB_LIBS)
-AC_SUBST(KRB5_LIB_FLAGS)]) dnl END KRB5 - export
-
-dnl KRB 4 - export
-
-ifelse(-1,regexp($1,4),[],[
-
-if test "$ac_cv_found_krb4" = "yes"; then
- with_krb4=yes
- AC_DEFINE(KERBEROS, 1, [define if you have kerberos])
- AC_DEFINE(HAVE_KRB4, 1, [define if you have kerberos 4])
-fi
-
-AC_SUBST(KRB4_LIB_DIR)
-AC_SUBST(KRB4_INC_DIR)
-AC_SUBST(KRB4_INC_FLAGS)
-AC_SUBST(KRB4_LIB_LIBS)
-AC_SUBST(KRB4_LIB_FLAGS)]) dnl END KRB4 - export
-
-]) dnl END AC_CHECK_KERBEROS end of this short function
-
-dnl
-dnl KRB4 tests
-dnl
-
-AC_DEFUN(AC_KRB4_INC_WHERE1, [
-saved_CPPFLAGS="${CPPFLAGS}"
-if test -n "$1"; then
- CPPFLAGS="$saved_CPPFLAGS -I$1"
-fi
-AC_TRY_COMPILE([#include <krb.h>],
-[struct ktext foo;],
-[ac_cv_found_krb4=yes
-ac_cv_found_krb4_inc=yes],
-ac_cv_found_krb4_inc=no)
-CPPFLAGS=$saved_CPPFLAGS
-])
-
-AC_DEFUN(AC_KRB4_INC_WHERE, [
- for i in $1; do
- for j in "" kerberos "kerberosIV"; do
- if test -n "$i"; then
- if test -n "$j"; then
- d="$i/$j"
- else
- d="$i"
- fi
- else
- d="$j"
- fi
- AC_MSG_CHECKING(for kerberos4 headers in $d)
- AC_KRB4_INC_WHERE1($d)
- if test "$ac_cv_found_krb4_inc" = "yes"; then
- ac_cv_krb4_where_inc=$d
- AC_MSG_RESULT(found)
- break 2
- else
- AC_MSG_RESULT(not found)
- fi
- done
- done
-])
-
-dnl
-dnl
-dnl
-
-
-AC_DEFUN(AC_KRB4_LIB_WHERE1, [
-saved_LIBS=$LIBS
-ac_cv_found_krb4_lib=no
-for a in "-lkrb -ldes" dnl kth-krb && mit-krb
- "-lkrb -ldes $LIB_roken" dnl kth-krb in nbsd
- "-lkrb -ldes $LIB_roken -lcom_err" dnl kth-krb in nbsd for real
- "-lkrb -ldes -lcom_err" dnl kth-krb in fbsd
- "-lkrb -ldes -lcom_err -lcrypt" dnl CNS q96 à la SCS
- "-lkrb -lcrypto" dnl kth-krb with openssl
- ; do
- LIBS="$saved_LIBS"
- if test "X$1" != "X"; then
- LIBS="$LIBS -L$1"
- fi
- LIBS="$LIBS $a"
- AC_TRY_LINK([],
- [dest_tkt();],
- [ac_cv_found_krb4_lib=yes
- ac_cv_krb4_extralib="$a"
- ac_cv_found_krb4=yes
- break])
-done
-
- if test "$ac_cv_found_krb4_lib" = "no"; then
- for a in "-lkrb4 -ldes425 -lkrb5 -lcom_err $ac_cv_krb5_extralib" dnl
- "-lkrb4 -ldes524 -lkrb5 -lcom_err $ac_cv_krb5_extralib" dnl
- ; do
- LIBS="$saved_LIBS"
- if test "X$1" != "X"; then
- LIBS="$LIBS -L$1"
- fi
- LIBS="$LIBS $a"
- AC_TRY_LINK([],
- [dest_tkt();],
- [ac_cv_found_krb4_lib=compat
- ac_cv_krb4_extralib="$a"
- break])
-done
-fi
-LIBS=$saved_LIBS
-])
-
-AC_DEFUN(AC_KRB4_LIB_WHERE, [
- for i in $1; do
- AC_MSG_CHECKING(for kerberos4 libraries in $i)
- AC_KRB4_LIB_WHERE1($i)
- if test "$ac_cv_found_krb4_lib" != "no" ; then
- ac_cv_krb4_where_lib=$i
- AC_MSG_RESULT(found)
- break
- else
- AC_MSG_RESULT(not found)
- fi
- done
-])
-
-dnl
-dnl KRB5 tests
-dnl
-
-AC_DEFUN(AC_KRB5_INC_WHERE1, [
-saved_CPPFLAGS=$CPPFLAGS
-if test "X$1" != "X" ; then
- CPPFLAGS="$saved_CPPFLAGS -I$1"
-fi
-AC_TRY_COMPILE([#include <krb5.h>],
-[krb5_kvno foo;],
-ac_cv_found_krb5_inc=yes,
-ac_cv_found_krb5_inc=no)
-CPPFLAGS=$saved_CPPFLAGS
-])
-
-AC_DEFUN(AC_KRB5_INC_WHERE, [
- for i in $1; do
- AC_MSG_CHECKING(for kerberos5 headers in $i)
- AC_KRB5_INC_WHERE1($i)
- if test "$ac_cv_found_krb5_inc" = "yes"; then
- ac_cv_krb5_where_inc=$i
- AC_MSG_RESULT(found)
- break
- else
- AC_MSG_RESULT(not found)
- fi
- done
-])
-
-
-dnl
-dnl
-dnl
-
-AC_DEFUN(AC_KRB5_LIB_WHERE1, [
-saved_LIBS=$LIBS
-for a in "-lk5crypto -lcom_err" dnl new mit krb
- "-lcrypto -lcom_err" dnl old mit krb
- "-lasn1 -ldes $LIB_roken" dnl heimdal w/ roken w/o dep on db
- "-lasn1 -ldes $LIB_roken -lresolv" dnl heimdal w/ roken w/o dep on db w/ dep on resolv
- "-lasn1 -lcrypto -lcom_err $LIB_roken" dnl heimdal-BSD w/ roken w/o dep on db
- "-lasn1 -ldes $LIB_roken -ldb" dnl heimdal w/ roken w/ dep on db
- "-lasn1 -ldes $LIB_roken -ldb -lresolv" dnl heimdal w/ roken w/ dep on db w/ dep on resolv
- "-lasn1 -lcrypto -lcom_err $LIB_roken -ldb" dnl heimdal-BSD w/ roken w/ dep on db
- ; do
- LIBS="$saved_LIBS"
- if test "X$1" != "X"; then
- LIBS="$LIBS -L$1"
- fi
- LIBS="$LIBS -lkrb5 $a"
- AC_TRY_LINK([],
- [krb5_init_context();],
- [ac_cv_found_krb5_lib=yes
- ac_cv_found_krb5=yes
- ac_cv_krb5_extralib=$a
- break],
- ac_cv_found_krb5_lib=no)
-done
-LIBS=$saved_LIBS
-])
-
-AC_DEFUN(AC_KRB5_LIB_WHERE, [
- for i in $1; do
- AC_MSG_CHECKING(for kerberos5 libraries in $i)
- AC_KRB5_LIB_WHERE1($i)
- if test "$ac_cv_found_krb5_lib" != "no" ; then
- ac_cv_krb5_where_lib=$i
- AC_MSG_RESULT(found)
- break
- else
- AC_MSG_RESULT(not found)
- fi
- done
-])
-
-
diff --git a/usr.sbin/afs/src/cf/check-kernel-func.m4 b/usr.sbin/afs/src/cf/check-kernel-func.m4
deleted file mode 100644
index f21db505f2e..00000000000
--- a/usr.sbin/afs/src/cf/check-kernel-func.m4
+++ /dev/null
@@ -1,11 +0,0 @@
-dnl
-dnl $KTH: check-kernel-func.m4,v 1.2 1999/08/09 23:02:01 assar Exp $
-dnl
-
-dnl AC_CHECK_KERNEL_FUNC(func, param, [includes])
-AC_DEFUN(AC_CHECK_KERNEL_FUNC,
-AC_CHECK_KERNEL($1, ac_cv_kernel_func_$1, [$1]([$2]), $4)
-: << END
-@@@funcs="$funcs [patsubst([$1], [\w+], [kernel_\&])]"@@@
-END
-)
diff --git a/usr.sbin/afs/src/cf/check-kernel-funcs.m4 b/usr.sbin/afs/src/cf/check-kernel-funcs.m4
deleted file mode 100644
index 6b4ee2b15a4..00000000000
--- a/usr.sbin/afs/src/cf/check-kernel-funcs.m4
+++ /dev/null
@@ -1,15 +0,0 @@
-dnl
-dnl $KTH: check-kernel-funcs.m4,v 1.2 1999/08/09 23:02:45 assar Exp $
-dnl
-
-dnl AC_CHECK_KERNEL_FUNCS(functions...)
-AC_DEFUN(AC_CHECK_KERNEL_FUNCS,
-[for ac_func in $1
-do
-AC_CHECK_KERNEL($ac_func, ac_cv_kernel_func_$ac_func, [$ac_func]())
-done
-]
-: << END
-@@@funcs="$funcs [patsubst([$1], [\w+], [kernel_\&])]"@@@
-END
-)
diff --git a/usr.sbin/afs/src/cf/check-kernel-var.m4 b/usr.sbin/afs/src/cf/check-kernel-var.m4
deleted file mode 100644
index 34c1f73e84d..00000000000
--- a/usr.sbin/afs/src/cf/check-kernel-var.m4
+++ /dev/null
@@ -1,11 +0,0 @@
-dnl
-dnl $KTH: check-kernel-var.m4,v 1.2 2000/01/25 20:31:24 assar Exp $
-dnl
-
-dnl AC_CHECK_KERNEL_VAR(var, type, [includes])
-AC_DEFUN(AC_CHECK_KERNEL_VAR,
-AC_CHECK_KERNEL($1, ac_cv_kernel_var_$1, [extern $2 $1; return $1], $4)
-: << END
-@@@funcs="$funcs kernel_$1"@@@
-END
-)
diff --git a/usr.sbin/afs/src/cf/check-kernel-vop-t.m4 b/usr.sbin/afs/src/cf/check-kernel-vop-t.m4
deleted file mode 100644
index c05e6f3ebd8..00000000000
--- a/usr.sbin/afs/src/cf/check-kernel-vop-t.m4
+++ /dev/null
@@ -1,17 +0,0 @@
-dnl
-dnl $KTH: check-kernel-vop-t.m4,v 1.1 1999/05/15 22:45:22 assar Exp $
-dnl
-
-dnl
-dnl try to find out if we have a vop_t
-dnl
-
-AC_DEFUN(AC_CHECK_KERNEL_VOP_T, [
-
-AC_CACHE_CHECK(for vop_t, ac_cv_type_vop_t,
-AC_EGREP_HEADER(vop_t, sys/vnode.h, ac_cv_type_vop_t=yes, ac_cv_type_vop_t=no))
-
-if test "$ac_cv_type_vop_t" = "yes"; then
- AC_DEFINE(HAVE_VOP_T, 1, [define if you have a vop_t])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/check-kernel.m4 b/usr.sbin/afs/src/cf/check-kernel.m4
deleted file mode 100644
index 17051885997..00000000000
--- a/usr.sbin/afs/src/cf/check-kernel.m4
+++ /dev/null
@@ -1,66 +0,0 @@
-dnl
-dnl $KTH: check-kernel.m4,v 1.6.2.2 2001/04/27 11:43:40 ahltorp Exp $
-dnl
-
-dnl there are two different heuristics for doing the kernel tests
-dnl a) running nm and greping the output
-dnl b) trying linking against the kernel
-
-dnl AC_CHECK_KERNEL(name, cv, magic, [includes])
-AC_DEFUN(AC_CHECK_KERNEL,
-[AC_MSG_CHECKING([for $1 in kernel])
-AC_CACHE_VAL($2,
-[
-if expr "$target_os" : "darwin" > /dev/null 2>&1; then
- if nm $KERNEL | egrep "\\<_?$1\\>" >/dev/null 2>&1; then
- eval "$2=yes"
- else
- eval "$2=no"
- fi
-elif expr "$target_os" : "osf" >/dev/null 2>&1; then
- if nm $KERNEL | egrep "^$1 " > /dev/null 2>&1; then
- eval "$2=yes"
- else
- eval "$2=no"
- fi
-else
-cat > conftest.$ac_ext <<EOF
-dnl This sometimes fails to find confdefs.h, for some reason.
-dnl [#]line __oline__ "[$]0"
-[#]line __oline__ "configure"
-#include "confdefs.h"
-[$4]
-int _foo() {
-return foo();
-}
-int foo() {
-[$3];
-return 0; }
-EOF
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $test_KERNEL_CFLAGS $KERNEL_CPPFLAGS"
-if AC_TRY_EVAL(ac_compile) && AC_TRY_EVAL(ac_kernel_ld) && test -s conftest; then
- eval "$2=yes"
-else
- eval "$2=no"
- echo "configure: failed program was:" >&AC_FD_CC
- cat conftest.$ac_ext >&AC_FD_CC
-fi
-CFLAGS="$save_CFLAGS"
-rm -f conftest*
-fi])
-changequote(, )dnl
-eval "ac_tr_var=HAVE_KERNEL_`echo $1 | tr '[a-z]' '[A-Z]'`"
-changequote([, ])dnl
-
-AC_MSG_RESULT(`eval echo \\${$2}`)
-if test `eval echo \\${$2}` = yes; then
- AC_DEFINE_UNQUOTED($ac_tr_var, 1)
-fi
-])
-
-dnl define([foo], [[HAVE_KERNEL_]translit($1, [a-z], [A-Z])])
-dnl : << END
-dnl @@@syms="$syms foo"@@@
-dnl END
-dnl undefine([foo])
diff --git a/usr.sbin/afs/src/cf/check-lfs.m4 b/usr.sbin/afs/src/cf/check-lfs.m4
deleted file mode 100644
index 4eca32f7e3e..00000000000
--- a/usr.sbin/afs/src/cf/check-lfs.m4
+++ /dev/null
@@ -1,31 +0,0 @@
-dnl
-dnl $KTH: check-lfs.m4,v 1.2 2000/03/14 00:04:10 assar Exp $
-dnl
-
-AC_DEFUN(AC_HAVE_GETCONF, [
-AC_CHECK_PROG(ac_cv_prog_getconf,[getconf],yes)
-])
-
-AC_DEFUN(AC_GETCONF_FLAGS,[
-if test "$ac_cv_prog_getconf" = "yes";then
-AC_MSG_CHECKING([if we have $1])
-FOO="`getconf $1 2>/dev/null >/dev/null`"
-if test $? = 0 ;then
-$2="[$]$2 $FOO"
-AC_MSG_RESULT([yes $FOO])
-else
-AC_MSG_RESULT(no)
-fi
-fi
-
-])
-
-AC_DEFUN(AC_CHECK_LFS, [
-if test "${ac_cv_prog_getconf-set}" = set ;then
-AC_HAVE_GETCONF
-fi
-AC_GETCONF_FLAGS(LFS_CFLAGS, CFLAGS)
-AC_GETCONF_FLAGS(LFS_LDFLAGS, LDFLAGS)
-])
-
-
diff --git a/usr.sbin/afs/src/cf/check-man.m4 b/usr.sbin/afs/src/cf/check-man.m4
deleted file mode 100644
index 708ed84618d..00000000000
--- a/usr.sbin/afs/src/cf/check-man.m4
+++ /dev/null
@@ -1,59 +0,0 @@
-dnl $KTH: check-man.m4,v 1.1 1999/05/15 22:45:23 assar Exp $
-dnl check how to format manual pages
-dnl
-
-AC_DEFUN(AC_CHECK_MAN,
-[AC_PATH_PROG(NROFF, nroff)
-AC_PATH_PROG(GROFF, groff)
-AC_CACHE_CHECK(how to format man pages,ac_cv_sys_man_format,
-[cat > conftest.1 << END
-.Dd January 1, 1970
-.Dt CONFTEST 1
-.Sh NAME
-.Nm conftest
-.Nd
-foobar
-END
-
-if test "$NROFF" ; then
- for i in "-mdoc" "-mandoc"; do
- if "$NROFF" $i conftest.1 2> /dev/null | \
- grep Jan > /dev/null 2>&1 ; then
- ac_cv_sys_man_format="$NROFF $i"
- break
- fi
- done
-fi
-if test "$ac_cv_sys_man_format" = "" -a "$GROFF" ; then
- for i in "-mdoc" "-mandoc"; do
- if "$GROFF" -Tascii $i conftest.1 2> /dev/null | \
- grep Jan > /dev/null 2>&1 ; then
- ac_cv_sys_man_format="$GROFF -Tascii $i"
- break
- fi
- done
-fi
-if test "$ac_cv_sys_man_format"; then
- ac_cv_sys_man_format="$ac_cv_sys_man_format \[$]< > \[$]@"
-fi
-])
-if test "$ac_cv_sys_man_format"; then
- CATMAN="$ac_cv_sys_man_format"
- AC_SUBST(CATMAN)
-fi
-AM_CONDITIONAL(CATMAN, test "$CATMAN")
-AC_CACHE_CHECK(extension of pre-formatted manual pages,ac_cv_sys_catman_ext,
-[if grep _suffix /etc/man.conf > /dev/null 2>&1; then
- ac_cv_sys_catman_ext=0
-else
- ac_cv_sys_catman_ext=number
-fi
-])
-if test "$ac_cv_sys_catman_ext" = number; then
- CATMANEXT='$$ext'
-else
- CATMANEXT=0
-fi
-AC_SUBST(CATMANEXT)
-
-]) \ No newline at end of file
diff --git a/usr.sbin/afs/src/cf/check-roken.m4 b/usr.sbin/afs/src/cf/check-roken.m4
deleted file mode 100644
index 60fc62b45ac..00000000000
--- a/usr.sbin/afs/src/cf/check-roken.m4
+++ /dev/null
@@ -1,84 +0,0 @@
-dnl
-dnl $KTH: check-roken.m4,v 1.1.2.1 2002/02/01 14:18:23 ahltorp Exp $
-dnl
-
-AC_DEFUN(AC_CHECK_ROKEN,[
-
-ROKEN_H=roken.h
-DIR_roken=roken
-LIB_roken='$(top_builddir)/lib/roken/libroken.a'
-INC_roken='-I$(top_builddir)/include'
-
-AC_ARG_WITH(roken,
-[ --with-roken=dir make with roken in dir],
-[if test "$with_roken" != "no"; then
- ROKEN_H=
- DIR_roken=
- if test "X$withval" != "X"; then
- LIB_roken="$withval/lib/libroken.a"
- INC_roken="-I$withval/include"
- else
- LIB_roken='-lroken'
- INC_roken=
- fi
-fi])
-
-AC_ARG_WITH(roken-include,
-[ --roken-include=dir make with roken headers in dir],
-[if test "$with_roken" != "no"; then
- ROKEN_H=
- DIR_roken=
- if test "X$withval" != "X"; then
- INC_roken="-I$withval"
- else
- INC_roken=
- fi
-fi])
-
-AC_ARG_WITH(roken-lib,
-[ --roken-lib=dir make with roken lib in dir],
-[if test "$with_roken" != "no"; then
- ROKEN_H=
- DIR_roken=
- if test "X$withval" != "X"; then
- LIB_roken="$withval/libroken.a"
- else
- LIB_roken="-lroken"
- fi
-fi])
-
-if test "X$ROKEN_H" = "X"; then
-
-AC_CACHE_CHECK([check what roken depends on ],[ac_cv_roken_deps],[
-ac_cv_roken_deps="error"
-saved_LIBS="$LIBS"
-for a in "" "-lcrypt" ; do
- LIBS="$saved_LIBS $LIB_roken $a"
- AC_TRY_LINK([],[getarg()],[
- if test "X$a" = "X"; then
- ac_cv_roken_deps="nothing"
- else
- ac_cv_roken_deps="$a"
- fi],[])
- LIBS="$saved_LIBS"
- if test $ac_cv_roken_deps != "error"; then break; fi
-done
-LIBS="$saved_LIBS"
-])
-
-if test "$ac_cv_roken_deps" = "error"; then
- AC_MSG_ERROR([failed to figure out libroken depencies])
-fi
-
-if test "$ac_cv_roken_deps" != "nothing"; then
- LIB_roken="$LIB_roken $ac_cv_roken_deps"
-fi
-
-fi
-
-AC_SUBST(INC_roken)
-AC_SUBST(LIB_roken)
-AC_SUBST(DIR_roken)
-AC_SUBST(ROKEN_H)
-
-])
diff --git a/usr.sbin/afs/src/cf/check-type-extra.m4 b/usr.sbin/afs/src/cf/check-type-extra.m4
deleted file mode 100644
index 6f5be8a23d0..00000000000
--- a/usr.sbin/afs/src/cf/check-type-extra.m4
+++ /dev/null
@@ -1,23 +0,0 @@
-dnl $KTH: check-type-extra.m4,v 1.1 1999/05/15 22:45:23 assar Exp $
-dnl
-dnl ac_check_type + extra headers
-
-dnl AC_CHECK_TYPE_EXTRA(TYPE, DEFAULT, HEADERS)
-AC_DEFUN(AC_CHECK_TYPE_EXTRA,
-[AC_REQUIRE([AC_HEADER_STDC])dnl
-AC_MSG_CHECKING(for $1)
-AC_CACHE_VAL(ac_cv_type_$1,
-[AC_EGREP_CPP(dnl
-changequote(<<,>>)dnl
-<<$1[^a-zA-Z_0-9]>>dnl
-changequote([,]), [#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-$3], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
-AC_MSG_RESULT($ac_cv_type_$1)
-if test $ac_cv_type_$1 = no; then
- AC_DEFINE($1, $2, [Define this to what the type $1 should be.])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/check-var.m4 b/usr.sbin/afs/src/cf/check-var.m4
deleted file mode 100644
index c5d8efa0f2f..00000000000
--- a/usr.sbin/afs/src/cf/check-var.m4
+++ /dev/null
@@ -1,20 +0,0 @@
-dnl $KTH: check-var.m4,v 1.1 1999/05/15 22:45:24 assar Exp $
-dnl
-dnl AC_CHECK_VAR(includes, variable)
-AC_DEFUN(AC_CHECK_VAR, [
-AC_MSG_CHECKING(for $2)
-AC_CACHE_VAL(ac_cv_var_$2, [
-AC_TRY_LINK([extern int $2;
-int foo() { return $2; }],
- [foo()],
- ac_cv_var_$2=yes, ac_cv_var_$2=no)
-])
-define([foo], [HAVE_]translit($2, [a-z], [A-Z]))
-
-AC_MSG_RESULT(`eval echo \\$ac_cv_var_$2`)
-if test `eval echo \\$ac_cv_var_$2` = yes; then
- AC_DEFINE_UNQUOTED(foo, 1, [define if you have $2])
- AC_CHECK_DECLARATION([$1],[$2])
-fi
-undefine([foo])
-])
diff --git a/usr.sbin/afs/src/cf/check-x.m4 b/usr.sbin/afs/src/cf/check-x.m4
deleted file mode 100644
index ad9d10481b6..00000000000
--- a/usr.sbin/afs/src/cf/check-x.m4
+++ /dev/null
@@ -1,52 +0,0 @@
-dnl
-dnl See if there is any X11 present
-dnl
-dnl $KTH: check-x.m4,v 1.1 1999/07/13 21:20:51 joda Exp $
-
-AC_DEFUN(KRB_CHECK_X,[
-AC_PATH_XTRA
-
-# try to figure out if we need any additional ld flags, like -R
-# and yes, the autoconf X test is utterly broken
-if test "$no_x" != yes; then
- AC_CACHE_CHECK(for special X linker flags,krb_cv_sys_x_libs_rpath,[
- ac_save_libs="$LIBS"
- ac_save_cflags="$CFLAGS"
- CFLAGS="$CFLAGS $X_CFLAGS"
- krb_cv_sys_x_libs_rpath=""
- krb_cv_sys_x_libs=""
- for rflag in "" "-R" "-R " "-rpath "; do
- if test "$rflag" = ""; then
- foo="$X_LIBS"
- else
- foo=""
- for flag in $X_LIBS; do
- case $flag in
- -L*)
- foo="$foo $flag `echo $flag | sed \"s/-L/$rflag/\"`"
- ;;
- *)
- foo="$foo $flag"
- ;;
- esac
- done
- fi
- LIBS="$ac_save_libs $foo -lX11"
- AC_TRY_RUN([
- #include <X11/Xlib.h>
- foo()
- {
- XOpenDisplay(NULL);
- }
- main()
- {
- return 0;
- }
- ], krb_cv_sys_x_libs_rpath="$rflag"; krb_cv_sys_x_libs="$foo"; break,:)
- done
- LIBS="$ac_save_libs"
- CFLAGS="$ac_save_cflags"
- ])
- X_LIBS="$krb_cv_sys_x_libs"
-fi
-])
diff --git a/usr.sbin/afs/src/cf/check-xau.m4 b/usr.sbin/afs/src/cf/check-xau.m4
deleted file mode 100644
index ca87be3001f..00000000000
--- a/usr.sbin/afs/src/cf/check-xau.m4
+++ /dev/null
@@ -1,54 +0,0 @@
-dnl $KTH: check-xau.m4,v 1.1 1999/05/15 22:45:24 assar Exp $
-dnl
-dnl check for Xau{Read,Write}Auth
-dnl
-AC_DEFUN(AC_CHECK_XAU,[
-save_CFLAGS="$CFLAGS"
-CFLAGS="$X_CFLAGS $CFLAGS"
-save_LIBS="$LIBS"
-dnl LIBS="$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS $LIBS"
-LIBS="$X_PRE_LIBS $X_EXTRA_LIBS $LIBS"
-save_LDFLAGS="$LDFLAGS"
-LDFLAGS="$LDFLAGS $X_LIBS"
-
-## check for XauWriteAuth first, so we detect the case where
-## XauReadAuth is in -lX11, but XauWriteAuth is only in -lXau this
-## could be done by checking for XauReadAuth in -lXau first, but this
-## breaks in IRIX 6.5
-
-AC_FIND_FUNC_NO_LIBS(XauWriteAuth, X11 Xau)
-ac_xxx="$LIBS"
-LIBS="$LIB_XauWriteAuth $LIBS"
-AC_FIND_FUNC_NO_LIBS(XauReadAuth, X11 Xau)
-LIBS="$ac_xxx"
-
-## set LIB_XauReadAuth to union of these tests, since this is what the
-## Makefiles are using
-case "$ac_cv_funclib_XauWriteAuth" in
-yes) ;;
-no) ;;
-*) if test "$ac_cv_funclib_XauReadAuth" = yes; then
- LIB_XauReadAuth="$LIB_XauWriteAuth"
- else
- LIB_XauReadAuth="$LIB_XauReadAuth $LIB_XauWriteAuth"
- fi
- ;;
-esac
-
-if test "$AUTOMAKE" != ""; then
- AM_CONDITIONAL(NEED_WRITEAUTH, test "$ac_cv_func_XauWriteAuth" != "yes")
-else
- AC_SUBST(NEED_WRITEAUTH_TRUE)
- AC_SUBST(NEED_WRITEAUTH_FALSE)
- if test "$ac_cv_func_XauWriteAuth" != "yes"; then
- NEED_WRITEAUTH_TRUE=
- NEED_WRITEAUTH_FALSE='#'
- else
- NEED_WRITEAUTH_TRUE='#'
- NEED_WRITEAUTH_FALSE=
- fi
-fi
-CFLAGS=$save_CFLAGS
-LIBS=$save_LIBS
-LDFLAGS=$save_LDFLAGS
-])
diff --git a/usr.sbin/afs/src/cf/elf-object-format.m4 b/usr.sbin/afs/src/cf/elf-object-format.m4
deleted file mode 100644
index 4f8502a8be3..00000000000
--- a/usr.sbin/afs/src/cf/elf-object-format.m4
+++ /dev/null
@@ -1,15 +0,0 @@
-dnl
-dnl $KTH: elf-object-format.m4,v 1.1 1999/05/15 22:45:24 assar Exp $
-dnl
-dnl test for ELF
-
-AC_DEFUN(AC_ELF_OBJECT_FORMAT,[
-AC_CACHE_CHECK([for ELF object format], ac_cv_sys_elf_object_format,[
-ac_cv_sys_elf_object_format=no
-echo 'int foo;' > conftest.$ac_ext
-if AC_TRY_EVAL(ac_compile); then
- case `file conftest.o 2> /dev/null` in
- *ELF*) ac_cv_sys_elf_object_format=yes ;;
- esac
-fi
-rm -f conftest*])])
diff --git a/usr.sbin/afs/src/cf/find-func-no-libs.m4 b/usr.sbin/afs/src/cf/find-func-no-libs.m4
deleted file mode 100644
index 5a7184ff7d7..00000000000
--- a/usr.sbin/afs/src/cf/find-func-no-libs.m4
+++ /dev/null
@@ -1,9 +0,0 @@
-dnl $KTH: find-func-no-libs.m4,v 1.3 1999/10/30 21:04:34 assar Exp $
-dnl
-dnl
-dnl Look for function in any of the specified libraries
-dnl
-
-dnl AC_FIND_FUNC_NO_LIBS(func, libraries, includes, arguments, extra libs, extra args)
-AC_DEFUN(AC_FIND_FUNC_NO_LIBS, [
-AC_FIND_FUNC_NO_LIBS2([$1], ["" $2], [$3], [$4], [$5], [$6])])
diff --git a/usr.sbin/afs/src/cf/find-func-no-libs2.m4 b/usr.sbin/afs/src/cf/find-func-no-libs2.m4
deleted file mode 100644
index ed7254c1386..00000000000
--- a/usr.sbin/afs/src/cf/find-func-no-libs2.m4
+++ /dev/null
@@ -1,63 +0,0 @@
-dnl $KTH: find-func-no-libs2.m4,v 1.3 1999/10/30 21:03:36 assar Exp $
-dnl
-dnl
-dnl Look for function in any of the specified libraries
-dnl
-
-dnl AC_FIND_FUNC_NO_LIBS2(func, libraries, includes, arguments, extra libs, extra args)
-AC_DEFUN(AC_FIND_FUNC_NO_LIBS2, [
-
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(ac_cv_funclib_$1,
-[
-if eval "test \"\$ac_cv_func_$1\" != yes" ; then
- ac_save_LIBS="$LIBS"
- for ac_lib in $2; do
- if test -n "$ac_lib"; then
- ac_lib="-l$ac_lib"
- else
- ac_lib=""
- fi
- LIBS="$6 $ac_lib $5 $ac_save_LIBS"
- AC_TRY_LINK([$3],[$1($4)],eval "if test -n \"$ac_lib\";then ac_cv_funclib_$1=$ac_lib; else ac_cv_funclib_$1=yes; fi";break)
- done
- eval "ac_cv_funclib_$1=\${ac_cv_funclib_$1-no}"
- LIBS="$ac_save_LIBS"
-fi
-])
-
-eval "ac_res=\$ac_cv_funclib_$1"
-
-dnl autoheader tricks *sigh*
-: << END
-@@@funcs="$funcs $1"@@@
-@@@libs="$libs $2"@@@
-END
-
-# $1
-eval "ac_tr_func=HAVE_[]upcase($1)"
-eval "ac_tr_lib=HAVE_LIB[]upcase($ac_res | sed -e 's/-l//')"
-eval "LIB_$1=$ac_res"
-
-case "$ac_res" in
- yes)
- eval "ac_cv_func_$1=yes"
- eval "LIB_$1="
- AC_DEFINE_UNQUOTED($ac_tr_func)
- AC_MSG_RESULT([yes])
- ;;
- no)
- eval "ac_cv_func_$1=no"
- eval "LIB_$1="
- AC_MSG_RESULT([no])
- ;;
- *)
- eval "ac_cv_func_$1=yes"
- eval "ac_cv_lib_`echo "$ac_res" | sed 's/-l//'`=yes"
- AC_DEFINE_UNQUOTED($ac_tr_func)
- AC_DEFINE_UNQUOTED($ac_tr_lib)
- AC_MSG_RESULT([yes, in $ac_res])
- ;;
-esac
-AC_SUBST(LIB_$1)
-])
diff --git a/usr.sbin/afs/src/cf/find-func.m4 b/usr.sbin/afs/src/cf/find-func.m4
deleted file mode 100644
index 85d758b18af..00000000000
--- a/usr.sbin/afs/src/cf/find-func.m4
+++ /dev/null
@@ -1,9 +0,0 @@
-dnl $KTH: find-func.m4,v 1.1 1999/05/15 22:45:25 assar Exp $
-dnl
-dnl AC_FIND_FUNC(func, libraries, includes, arguments)
-AC_DEFUN(AC_FIND_FUNC, [
-AC_FIND_FUNC_NO_LIBS([$1], [$2], [$3], [$4])
-if test -n "$LIB_$1"; then
- LIBS="$LIB_$1 $LIBS"
-fi
-])
diff --git a/usr.sbin/afs/src/cf/find-if-not-broken.m4 b/usr.sbin/afs/src/cf/find-if-not-broken.m4
deleted file mode 100644
index 25e46fc4aff..00000000000
--- a/usr.sbin/afs/src/cf/find-if-not-broken.m4
+++ /dev/null
@@ -1,13 +0,0 @@
-dnl $KTH: find-if-not-broken.m4,v 1.1 1999/05/15 22:45:25 assar Exp $
-dnl
-dnl
-dnl Mix between AC_FIND_FUNC and AC_BROKEN
-dnl
-
-AC_DEFUN(AC_FIND_IF_NOT_BROKEN,
-[AC_FIND_FUNC([$1], [$2], [$3], [$4])
-if eval "test \"$ac_cv_func_$1\" != yes"; then
-LIBOBJS[]="$LIBOBJS $1.o"
-fi
-AC_SUBST(LIBOBJS)dnl
-])
diff --git a/usr.sbin/afs/src/cf/func-getvfsbyname.m4 b/usr.sbin/afs/src/cf/func-getvfsbyname.m4
deleted file mode 100644
index a82c283b5c5..00000000000
--- a/usr.sbin/afs/src/cf/func-getvfsbyname.m4
+++ /dev/null
@@ -1,24 +0,0 @@
-dnl
-dnl $Id: func-getvfsbyname.m4,v 1.1 2000/09/11 14:40:47 art Exp $
-dnl
-
-AC_DEFUN(AC_FUNC_GETVFSBYNAME, [
-AC_CHECK_FUNCS(getvfsbyname)
-if test "$ac_cv_func_getvfsbyname" = "yes"; then
-AC_CACHE_CHECK(for two argument getvfsbyname,
-ac_cv_func_getvfsbyname_two_arguments,
-AC_TRY_COMPILE(
-[#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mount.h>],
-[struct vfsconf vfc;
-int foo = getvfsbyname("arla", &vfc);
-],
-ac_cv_func_getvfsbyname_two_arguments=yes,
-ac_cv_func_getvfsbyname_two_arguments=no))
-if test "$ac_cv_func_getvfsbyname_two_arguments" = "yes"; then
- AC_DEFINE(HAVE_GETVFSBYNAME_TWO_ARGS, 1,
- [define if getvfsbyname takes two arguments])
-fi
-fi
-])
diff --git a/usr.sbin/afs/src/cf/func-hstrerror-const.m4 b/usr.sbin/afs/src/cf/func-hstrerror-const.m4
deleted file mode 100644
index 017cf3d94f5..00000000000
--- a/usr.sbin/afs/src/cf/func-hstrerror-const.m4
+++ /dev/null
@@ -1,18 +0,0 @@
-dnl
-dnl $KTH: func-hstrerror-const.m4,v 1.2 1999/05/28 13:18:04 assar Exp $
-dnl
-dnl Test if hstrerror wants const or not
-dnl
-
-dnl AC_FUNC_HSTRERROR_CONST(includes, function)
-
-AC_DEFUN(AC_FUNC_HSTRERROR_CONST, [
-AC_CACHE_CHECK([if hstrerror needs const], ac_cv_func_hstrerror_const,
-AC_TRY_COMPILE([netdb.h],
-[const char *hstrerror(int);],
-ac_cv_func_hstrerror_const=no,
-ac_cv_func_hstrerror_const=yes))
-if test "$ac_cv_func_hstrerror_const" = "yes"; then
- AC_DEFINE(NEED_HSTRERROR_CONST, 1, [define if hstrerror is const])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/func-krb-get-default-principal.m4 b/usr.sbin/afs/src/cf/func-krb-get-default-principal.m4
deleted file mode 100644
index e8e000d852d..00000000000
--- a/usr.sbin/afs/src/cf/func-krb-get-default-principal.m4
+++ /dev/null
@@ -1,30 +0,0 @@
-dnl
-dnl $KTH: func-krb-get-default-principal.m4,v 1.1.2.1 2001/02/02 01:26:07 assar Exp $
-dnl
-
-dnl
-dnl Check for krb_get_default_principal
-dnl
-
-AC_DEFUN(AC_FUNC_KRB_GET_DEFAULT_PRINCIPAL, [
-
-AC_CACHE_CHECK(for krb_get_default_principal, ac_cv_func_krb_get_default_principal, [
-if test "$ac_cv_found_krb4" = "yes"; then
-save_CPPFLAGS="${CPPFLAGS}"
-save_LIBS="${LIBS}"
-CPPFLAGS="${KRB4_INC_FLAGS} ${CPPFLAGS}"
-LIBS="${KRB4_LIB_FLAGS} ${LIBS}"
-AC_TRY_LINK([#include <krb.h>],
-[krb_get_default_principal(0, 0, 0);],
-ac_cv_func_krb_get_default_principal=yes,
-ac_cv_func_krb_get_default_principal=no)
-CPPFLAGS="${save_CPPFLAGS}"
-LIBS="${save_LIBS}"
-else
-ac_cv_func_krb_get_default_principal=no
-fi
-])
-if test "$ac_cv_func_krb_get_default_principal" = "yes"; then
- AC_DEFINE(HAVE_KRB_GET_DEFAULT_PRINCIPAL, 1, [define if you have krb_get_default_principal])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/func-krb-get-default-tkt-root.m4 b/usr.sbin/afs/src/cf/func-krb-get-default-tkt-root.m4
deleted file mode 100644
index f6cde19844d..00000000000
--- a/usr.sbin/afs/src/cf/func-krb-get-default-tkt-root.m4
+++ /dev/null
@@ -1,31 +0,0 @@
-dnl
-dnl $KTH: func-krb-get-default-tkt-root.m4,v 1.3 2000/01/23 16:53:21 lha Exp $
-dnl
-
-dnl
-dnl Check for krb_get_default_tkt_root
-dnl
-
-AC_DEFUN(AC_FUNC_KRB_GET_DEFAULT_TKT_ROOT, [
-
-AC_CACHE_CHECK(for krb_get_default_tkt_root, ac_cv_func_krb_get_default_tkt_root, [
-if test "$ac_cv_found_krb4" = "yes"; then
-save_CPPFLAGS="${CPPFLAGS}"
-save_LIBS="${LIBS}"
-CPPFLAGS="${KRB4_INC_FLAGS} ${CPPFLAGS}"
-LIBS="${KRB4_LIB_FLAGS} ${LIBS}"
-AC_TRY_LINK([#include <krb.h>],
-[krb_get_default_tkt_root();],
-ac_cv_func_krb_get_default_tkt_root=yes,
-ac_cv_func_krb_get_default_tkt_root=no)
-CPPFLAGS="${save_CPPFLAGS}"
-LIBS="${save_LIBS}"
-else
-dnl Make it say no
-eval "ac_cv_func_krb_get_default_tkt_root=no"
-fi
-])
-if test "$ac_cv_func_krb_get_default_tkt_root" = "yes"; then
- AC_DEFINE(HAVE_KRB_GET_DEFAULT_TKT_ROOT, 1, [define if you have krb_get_default_tkt_root])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/func-krb-get-err-text.m4 b/usr.sbin/afs/src/cf/func-krb-get-err-text.m4
deleted file mode 100644
index 189d18d71c3..00000000000
--- a/usr.sbin/afs/src/cf/func-krb-get-err-text.m4
+++ /dev/null
@@ -1,28 +0,0 @@
-dnl
-dnl $KTH: func-krb-get-err-text.m4,v 1.3 2000/01/23 13:01:51 lha Exp $
-dnl
-
-dnl
-dnl Check for krb_get_err_text
-dnl
-
-AC_DEFUN(AC_FUNC_KRB_GET_ERR_TEXT, [
-
-AC_CACHE_CHECK(for krb_get_err_text, ac_cv_func_krb_get_err_text, [
-if test "$ac_cv_found_krb4" = "yes"; then
-save_CPPFLAGS="${CPPFLAGS}"
-save_LIBS="${LIBS}"
-CPPFLAGS="${KRB4_INC_FLAGS} ${CPPFLAGS}"
-LIBS="${KRB4_LIB_FLAGS} ${LIBS}"
-AC_TRY_LINK([#include <krb.h>],
-[krb_get_err_text(0);],
-ac_cv_func_krb_get_err_text=yes,
-ac_cv_func_krb_get_err_text=no)
-CPPFLAGS="${save_CPPFLAGS}"
-LIBS="${save_LIBS}"
-fi
-])
-if test "$ac_cv_func_krb_get_err_text" = "yes"; then
- AC_DEFINE(HAVE_KRB_GET_ERR_TEXT, 1, [define if you have krb_get_err_text])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/func-krb-kdctimeofday.m4 b/usr.sbin/afs/src/cf/func-krb-kdctimeofday.m4
deleted file mode 100644
index 0699374b4e8..00000000000
--- a/usr.sbin/afs/src/cf/func-krb-kdctimeofday.m4
+++ /dev/null
@@ -1,31 +0,0 @@
-dnl
-dnl $KTH: func-krb-kdctimeofday.m4,v 1.4 2000/05/23 07:21:24 assar Exp $
-dnl
-
-dnl
-dnl Check for krb_kdctimeofday
-dnl
-
-AC_DEFUN(AC_FUNC_KRB_KDCTIMEOFDAY, [
-
-AC_CACHE_CHECK(for krb_kdctimeofday, ac_cv_func_krb_kdctimeofday, [
-if test "$ac_cv_found_krb4" = "yes"; then
-save_CPPFLAGS="${CPPFLAGS}"
-save_LIBS="${LIBS}"
-CPPFLAGS="${KRB4_INC_FLAGS} ${CPPFLAGS}"
-LIBS="${KRB4_LIB_FLAGS} ${LIBS}"
-AC_TRY_LINK([#include <krb.h>],
-[krb_kdctimeofday(0);],
-ac_cv_func_krb_kdctimeofday=yes,
-ac_cv_func_krb_kdctimeofday=no)
-CPPFLAGS="${save_CPPFLAGS}"
-LIBS="${save_LIBS}"
-else
-dnl Make it say no
-eval "ac_cv_func_krb_kdctimeofday=no"
-fi
-])
-if test "$ac_cv_func_krb_kdctimeofday" = "yes"; then
- AC_DEFINE(HAVE_KRB_KDCTIMEOFDAY, 1, [define if you have krb_kdctimeofday])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/func-ntohl.m4 b/usr.sbin/afs/src/cf/func-ntohl.m4
deleted file mode 100644
index cc3b9be50f9..00000000000
--- a/usr.sbin/afs/src/cf/func-ntohl.m4
+++ /dev/null
@@ -1,38 +0,0 @@
-dnl
-dnl $KTH: func-ntohl.m4,v 1.1 1999/05/15 22:45:26 assar Exp $
-dnl
-dnl test for how to do ntohl
-dnl
-
-AC_DEFUN(AC_FUNC_NTOHL, [
-AC_REQUIRE([AC_CANONICAL_TARGET])
-AC_MSG_CHECKING(for efficient ntohl)
-AC_CACHE_VAL(ac_cv_func_ntohl, [
-case "$target_cpu" in
-changequote(, )dnl
-i[3-9]86) AC_TRY_RUN(
-changequote([, ])dnl
-[
-#if defined(__GNUC__) && defined(i386)
-unsigned long foo(unsigned long x)
-{
- asm("bswap %0" : "=r" (x) : "0" (x));
- return x;
-}
-#endif
-
-int main(void)
-{
- return foo(0x12345678) != 0x78563412;
-}
-],
-ac_cv_func_ntohl="bswap",
-ac_cv_func_ntohl="ntohl",
-ac_cv_func_ntohl="ntohl") ;;
-alpha) ac_cv_func_ntohl="bswap32" ;;
-*) ac_cv_func_ntohl="ntohl" ;;
-esac
-])
-AC_MSG_RESULT($ac_cv_func_ntohl)
-AC_DEFINE_UNQUOTED(EFF_NTOHL, $ac_cv_func_ntohl, [how should ntohl be done?])
-])
diff --git a/usr.sbin/afs/src/cf/grok-type.m4 b/usr.sbin/afs/src/cf/grok-type.m4
deleted file mode 100644
index ed7a4b5723d..00000000000
--- a/usr.sbin/afs/src/cf/grok-type.m4
+++ /dev/null
@@ -1,35 +0,0 @@
-dnl $KTH: grok-type.m4,v 1.1 1999/05/15 22:45:26 assar Exp $
-dnl
-AC_DEFUN(AC_GROK_TYPE, [
-AC_CACHE_VAL(ac_cv_type_$1,
-AC_TRY_COMPILE([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_BITYPES_H
-#include <sys/bitypes.h>
-#endif
-#ifdef HAVE_BIND_BITYPES_H
-#include <bind/bitypes.h>
-#endif
-#ifdef HAVE_NETINET_IN6_MACHTYPES_H
-#include <netinet/in6_machtypes.h>
-#endif
-],
-$i x;
-,
-eval ac_cv_type_$1=yes,
-eval ac_cv_type_$1=no))])
-
-AC_DEFUN(AC_GROK_TYPES, [
-for i in $1; do
- AC_MSG_CHECKING(for $i)
- AC_GROK_TYPE($i)
- eval ac_res=\$ac_cv_type_$i
- if test "$ac_res" = yes; then
- type=HAVE_[]upcase($i)
- AC_DEFINE_UNQUOTED($type)
- fi
- AC_MSG_RESULT($ac_res)
-done
-])
diff --git a/usr.sbin/afs/src/cf/have-def.m4 b/usr.sbin/afs/src/cf/have-def.m4
deleted file mode 100644
index f774f72e771..00000000000
--- a/usr.sbin/afs/src/cf/have-def.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-dnl
-dnl $KTH: have-def.m4,v 1.2.24.1 2001/04/16 23:07:50 lha Exp $
-dnl
-
-dnl AC_HAVE_DEF(includes, [struct|typedef])
-AC_DEFUN(AC_HAVE_DEF, [
-define(cache_val, translit(ac_cv_have_def_$2, [A-Z ], [a-z_]))
-AC_CACHE_CHECK([if $2 exists], cache_val, [
-AC_TRY_COMPILE([$1],
-[$2 foo],
-cache_val=yes,
-cache_val=no)])
-if test "$cache_val" = yes; then
- define(foo, translit(HAVE_DEF_$2, [a-z ], [A-Z_]))
- AC_DEFINE(foo, 1, [Define if you have $2])
- undefine([foo])
-fi
-undefine([cache_val])
-])
diff --git a/usr.sbin/afs/src/cf/have-kernel-struct-field.m4 b/usr.sbin/afs/src/cf/have-kernel-struct-field.m4
deleted file mode 100644
index 41044ea3715..00000000000
--- a/usr.sbin/afs/src/cf/have-kernel-struct-field.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-dnl
-dnl $KTH: have-kernel-struct-field.m4,v 1.3.22.1 2001/04/16 23:07:52 lha Exp $
-dnl
-
-dnl AC_HAVE_KERNEL_STRUCT_FIELD(includes, struct, type, field)
-AC_DEFUN(AC_HAVE_KERNEL_STRUCT_FIELD, [
-define(cache_val, translit(ac_cv_struct_$2_$4, [A-Z ], [a-z_]))
-AC_CACHE_CHECK([if struct $2 has a field $4], cache_val, [
-AC_TRY_COMPILE_KERNEL([$1],
-[struct $2 foo; $3 bar = foo.$4; ],
-cache_val=yes,
-cache_val=no)])
-if test "$cache_val" = yes; then
- define(foo, translit(HAVE_STRUCT_$2_$4, [a-z ], [A-Z_]))
- AC_DEFINE(foo, 1, [Define if struct $2 has field $4])
- undefine([foo])
-fi
-undefine([cache_val])
-])
diff --git a/usr.sbin/afs/src/cf/have-linux-kernel-type.m4 b/usr.sbin/afs/src/cf/have-linux-kernel-type.m4
deleted file mode 100644
index 5197c8b2201..00000000000
--- a/usr.sbin/afs/src/cf/have-linux-kernel-type.m4
+++ /dev/null
@@ -1,24 +0,0 @@
-dnl
-dnl $KTH: have-linux-kernel-type.m4,v 1.2 1999/12/05 10:33:09 assar Exp $
-dnl
-dnl Check for types in the Linux kernel
-dnl
-
-dnl AC_HAVE_LINUX_KERNEL_TYPE(type)
-AC_DEFUN(AC_HAVE_LINUX_KERNEL_TYPE, [
-cv=`echo "$1" | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-AC_MSG_CHECKING(for $i in the linux kernel)
-AC_CACHE_VAL(ac_cv_linux_kernel_type_$cv,
-AC_TRY_COMPILE_KERNEL([
-#define __KERNEL__
-#include <linux/types.h>
-],
-[$1 x;],
-eval "ac_cv_linux_kernel_type_$cv=yes",
-eval "ac_cv_linux_kernel_type_$cv=no"))dnl
-AC_MSG_RESULT(`eval echo \\$ac_cv_linux_kernel_type_$cv`)
-if test `eval echo \\$ac_cv_linux_kernel_type_$cv` = yes; then
- ac_tr_hdr=HAVE_LINUX_KERNEL_`echo $1 | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- AC_DEFINE_UNQUOTED($ac_tr_hdr, 1)
-fi
-])
diff --git a/usr.sbin/afs/src/cf/have-linux-kernel-types.m4 b/usr.sbin/afs/src/cf/have-linux-kernel-types.m4
deleted file mode 100644
index 18b3bcc5491..00000000000
--- a/usr.sbin/afs/src/cf/have-linux-kernel-types.m4
+++ /dev/null
@@ -1,14 +0,0 @@
-dnl
-dnl $KTH: have-linux-kernel-types.m4,v 1.1 1999/05/15 22:45:27 assar Exp $
-dnl
-dnl Check for types in the Linux kernel
-dnl
-
-AC_DEFUN(AC_HAVE_LINUX_KERNEL_TYPES, [
-for i in $1; do
- AC_HAVE_LINUX_KERNEL_TYPE($i)
-done
-: << END
-@@@funcs="$funcs patsubst([$1], [\w+], [linux_kernel_\&])"@@@
-END
-])
diff --git a/usr.sbin/afs/src/cf/have-pragma-weak.m4 b/usr.sbin/afs/src/cf/have-pragma-weak.m4
deleted file mode 100644
index d566c1a03ec..00000000000
--- a/usr.sbin/afs/src/cf/have-pragma-weak.m4
+++ /dev/null
@@ -1,37 +0,0 @@
-dnl $KTH: have-pragma-weak.m4,v 1.1 1999/05/15 22:45:27 assar Exp $
-dnl
-AC_DEFUN(AC_HAVE_PRAGMA_WEAK, [
-if test "${enable_shared}" = "yes"; then
-AC_MSG_CHECKING(for pragma weak)
-AC_CACHE_VAL(ac_have_pragma_weak, [
-ac_have_pragma_weak=no
-cat > conftest_foo.$ac_ext <<'EOF'
-[#]line __oline__ "configure"
-#include "confdefs.h"
-#pragma weak foo = _foo
-int _foo = 17;
-EOF
-cat > conftest_bar.$ac_ext <<'EOF'
-[#]line __oline__ "configure"
-#include "confdefs.h"
-extern int foo;
-
-int t() {
- return foo;
-}
-
-int main() {
- return t();
-}
-EOF
-if AC_TRY_EVAL('CC -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest_foo.$ac_ext conftest_bar.$ac_ext 1>&AC_FD_CC'); then
-ac_have_pragma_weak=yes
-fi
-rm -rf conftest*
-])
-if test "$ac_have_pragma_weak" = "yes"; then
- AC_DEFINE(HAVE_PRAGMA_WEAK, 1, [Define this if your compiler supports \`#pragma weak.'])dnl
-fi
-AC_MSG_RESULT($ac_have_pragma_weak)
-fi
-])
diff --git a/usr.sbin/afs/src/cf/have-struct-field.m4 b/usr.sbin/afs/src/cf/have-struct-field.m4
deleted file mode 100644
index 527eccdbef9..00000000000
--- a/usr.sbin/afs/src/cf/have-struct-field.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-dnl $KTH: have-struct-field.m4,v 1.1.28.1 2001/04/16 23:07:54 lha Exp $
-dnl
-dnl check for fields in a structure
-dnl
-dnl AC_HAVE_STRUCT_FIELD(struct, field, headers)
-
-AC_DEFUN(AC_HAVE_STRUCT_FIELD, [
-define(cache_val, translit(ac_cv_type_$1_$2, [A-Z ], [a-z_]))
-AC_CACHE_CHECK([for $2 in $1], cache_val,[
-AC_TRY_COMPILE([$3],[$1 x; x.$2;],
-cache_val=yes,
-cache_val=no)])
-if test "$cache_val" = yes; then
- define(foo, translit(HAVE_$1_$2, [a-z ], [A-Z_]))
- AC_DEFINE(foo, 1, [Define if $1 has field $2.])
- undefine([foo])
-fi
-undefine([cache_val])
-])
diff --git a/usr.sbin/afs/src/cf/have-type.m4 b/usr.sbin/afs/src/cf/have-type.m4
deleted file mode 100644
index dc328b8bccc..00000000000
--- a/usr.sbin/afs/src/cf/have-type.m4
+++ /dev/null
@@ -1,32 +0,0 @@
-dnl $KTH: have-type.m4,v 1.2 1999/12/31 03:12:22 assar Exp $
-dnl
-dnl check for existance of a type
-
-dnl AC_HAVE_TYPE(TYPE,INCLUDES)
-AC_DEFUN(AC_HAVE_TYPE, [
-AC_REQUIRE([AC_HEADER_STDC])
-cv=`echo "$1" | sed 'y%./+- %__p__%'`
-AC_MSG_CHECKING(for $1)
-AC_CACHE_VAL([ac_cv_type_$cv],
-AC_TRY_COMPILE(
-[#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-$2],
-[$1 foo;],
-eval "ac_cv_type_$cv=yes",
-eval "ac_cv_type_$cv=no"))dnl
-AC_MSG_RESULT(`eval echo \\$ac_cv_type_$cv`)
-if test `eval echo \\$ac_cv_type_$cv` = yes; then
- ac_tr_hdr=HAVE_`echo $1 | sed 'y%abcdefghijklmnopqrstuvwxyz./- %ABCDEFGHIJKLMNOPQRSTUVWXYZ____%'`
-dnl autoheader tricks *sigh*
-define(foo,translit($1, [ ], [_]))
-: << END
-@@@funcs="$funcs foo"@@@
-END
-undefine([foo])
- AC_DEFINE_UNQUOTED($ac_tr_hdr, 1)
-fi
-])
diff --git a/usr.sbin/afs/src/cf/have-types.m4 b/usr.sbin/afs/src/cf/have-types.m4
deleted file mode 100644
index b801004aba0..00000000000
--- a/usr.sbin/afs/src/cf/have-types.m4
+++ /dev/null
@@ -1,14 +0,0 @@
-dnl
-dnl $KTH: have-types.m4,v 1.1 1999/05/15 22:45:28 assar Exp $
-dnl
-
-AC_DEFUN(AC_HAVE_TYPES, [
-for i in $1; do
- AC_HAVE_TYPE($i)
-done
-: << END
-changequote(`,')dnl
-@@@funcs="$funcs $1"@@@
-changequote([,])dnl
-END
-])
diff --git a/usr.sbin/afs/src/cf/header-dirent-dir-h.m4 b/usr.sbin/afs/src/cf/header-dirent-dir-h.m4
deleted file mode 100644
index 063e6d65369..00000000000
--- a/usr.sbin/afs/src/cf/header-dirent-dir-h.m4
+++ /dev/null
@@ -1,21 +0,0 @@
-dnl $KTH: header-dirent-dir-h.m4,v 1.1 2000/03/24 04:07:32 assar Exp $
-
-dnl
-dnl Check if we can include both dirent.h and sys/dir.h
-dnl
-
-AC_DEFUN(AC_DIRENT_SYS_DIR_H, [
-AC_CACHE_CHECK(if we can include both dirent.h and sys/dir.h,
-ac_cv_header_dirent_and_sys_dir,
-AC_TRY_CPP([
-#include <sys/types.h>
-#include <dirent.h>
-#include <sys/dir.h>
-],
-ac_cv_header_dirent_and_sys_dir=yes,
-ac_cv_header_dirent_and_sys_dir=no))
-if test "$ac_cv_header_dirent_and_sys_dir" = yes; then
- AC_DEFINE(DIRENT_AND_SYS_DIR_H, 1,
- [define if you can include both dirent.h and sys/dir.h])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/kernel-have-def.m4 b/usr.sbin/afs/src/cf/kernel-have-def.m4
deleted file mode 100644
index 3b45d783e0e..00000000000
--- a/usr.sbin/afs/src/cf/kernel-have-def.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-dnl
-dnl $KTH: kernel-have-def.m4,v 1.1.24.1 2001/04/16 23:07:57 lha Exp $
-dnl
-
-dnl AC_HAVE_KERNEL_DEF(includes, [struct|typedef])
-AC_DEFUN(AC_HAVE_KERNEL_DEF, [
-define(cache_val, translit(ac_cv_have_def_$2, [A-Z ], [a-z_]))
-AC_CACHE_CHECK([if $2 exists], cache_val, [
-AC_TRY_COMPILE_KERNEL([$1],
-[$2 foo],
-cache_val=yes,
-cache_val=no)])
-if test "$cache_val" = yes; then
- define(foo, translit(HAVE_DEF_$2, [a-z ], [A-Z_]))
- AC_DEFINE(foo, 1, [Define if you have $2])
- undefine([foo])
-fi
-undefine([cache_val])
-])
diff --git a/usr.sbin/afs/src/cf/kernel-need-proto.m4 b/usr.sbin/afs/src/cf/kernel-need-proto.m4
deleted file mode 100644
index 965aa814f52..00000000000
--- a/usr.sbin/afs/src/cf/kernel-need-proto.m4
+++ /dev/null
@@ -1,14 +0,0 @@
-dnl $KTH: kernel-need-proto.m4,v 1.1.2.1 2001/02/14 12:55:08 lha Exp $
-dnl
-dnl
-dnl Check if we need the prototype for a function in kernel-space
-dnl
-
-dnl AC_KERNEL_NEED_PROTO(includes, function)
-
-AC_DEFUN(AC_KERNEL_NEED_PROTO, [
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $test_KERNEL_CFLAGS $KERNEL_CPPFLAGS"
-AC_NEED_PROTO([$1],[$2])
-CFLAGS="$save_CFLAGS"
-])
diff --git a/usr.sbin/afs/src/cf/kernel.m4 b/usr.sbin/afs/src/cf/kernel.m4
deleted file mode 100644
index e117154ecd4..00000000000
--- a/usr.sbin/afs/src/cf/kernel.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-dnl
-dnl $KTH: kernel.m4,v 1.1 1999/05/15 22:45:28 assar Exp $
-dnl
-
-dnl
-dnl Check for where the kernel is stored
-dnl
-
-AC_DEFUN(AC_KERNEL,
-[
-dnl XXX XXX XXX *** this test sucks *** XXX XXX XXX
-if test "$ac_kernel_ld" = ""; then
-if test "$ac_cv_sys_elf_object_format" = yes; then
-ac_kernel_ld='${LD-ld} -o conftest $LDFLAGS -R $KERNEL conftest.o -e _foo 1>&AC_FD_CC'
-else
-ac_kernel_ld='${LD-ld} -o conftest $LDFLAGS -A $KERNEL conftest.o -e _foo 1>&AC_FD_CC'
-fi
-fi
-])
diff --git a/usr.sbin/afs/src/cf/krb-bigendian.m4 b/usr.sbin/afs/src/cf/krb-bigendian.m4
deleted file mode 100644
index 8932e15d700..00000000000
--- a/usr.sbin/afs/src/cf/krb-bigendian.m4
+++ /dev/null
@@ -1,53 +0,0 @@
-dnl
-dnl $KTH: krb-bigendian.m4,v 1.2 2000/08/19 15:34:21 assar Exp $
-dnl
-
-dnl check if this computer is little or big-endian
-dnl if we can figure it out at compile-time then don't define the cpp symbol
-dnl otherwise test for it and define it. also allow options for overriding
-dnl it when cross-compiling
-
-AC_DEFUN(KRB_C_BIGENDIAN, [
-AC_ARG_ENABLE(bigendian,
-[ --enable-bigendian the target is big endian],
-krb_cv_c_bigendian=yes)
-AC_ARG_ENABLE(littleendian,
-[ --enable-littleendian the target is little endian],
-krb_cv_c_bigendian=no)
-AC_CACHE_CHECK(whether byte order is known at compile time,
-krb_cv_c_bigendian_compile,
-[AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/param.h>],[
-#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
- bogus endian macros
-#endif], krb_cv_c_bigendian_compile=yes, krb_cv_c_bigendian_compile=no)])
-AC_CACHE_CHECK(whether byte ordering is bigendian, krb_cv_c_bigendian,[
- if test "$krb_cv_c_bigendian_compile" = "yes"; then
- AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/param.h>],[
-#if BYTE_ORDER != BIG_ENDIAN
- not big endian
-#endif], krb_cv_c_bigendian=yes, krb_cv_c_bigendian=no)
- else
- AC_TRY_RUN([main () {
- /* Are we little or big endian? From Harbison&Steele. */
- union
- {
- long l;
- char c[sizeof (long)];
- } u;
- u.l = 1;
- exit (u.c[sizeof (long) - 1] == 1);
- }], krb_cv_c_bigendian=no, krb_cv_c_bigendian=yes,
- AC_MSG_ERROR([specify either --enable-bigendian or --enable-littleendian]))
- fi
-])
-if test "$krb_cv_c_bigendian" = "yes"; then
- AC_DEFINE(WORDS_BIGENDIAN, 1, [define if target is big endian])dnl
-fi
-if test "$krb_cv_c_bigendian_compile" = "yes"; then
- AC_DEFINE(ENDIANESS_IN_SYS_PARAM_H, 1, [define if sys/param.h defines the endiness])dnl
-fi
-])
diff --git a/usr.sbin/afs/src/cf/krb-find-db.m4 b/usr.sbin/afs/src/cf/krb-find-db.m4
deleted file mode 100644
index 882d5b8f5b5..00000000000
--- a/usr.sbin/afs/src/cf/krb-find-db.m4
+++ /dev/null
@@ -1,89 +0,0 @@
-dnl $KTH: krb-find-db.m4,v 1.1 1999/05/15 22:45:28 assar Exp $
-dnl
-dnl find a suitable database library
-dnl
-dnl AC_FIND_DB(libraries)
-AC_DEFUN(KRB_FIND_DB, [
-
-lib_dbm=no
-lib_db=no
-
-for i in $1; do
-
- if test "$i"; then
- m="lib$i"
- l="-l$i"
- else
- m="libc"
- l=""
- fi
-
- AC_MSG_CHECKING(for dbm_open in $m)
- AC_CACHE_VAL(ac_cv_krb_dbm_open_$m, [
-
- save_LIBS="$LIBS"
- LIBS="$l $LIBS"
- AC_TRY_RUN([
-#include <unistd.h>
-#include <fcntl.h>
-#include <ndbm.h>
-int main()
-{
- DBM *d;
-
- d = dbm_open("conftest", O_RDWR | O_CREAT, 0666);
- if(d == NULL)
- return 1;
- dbm_close(d);
- return 0;
-}], [
- if test -f conftest.db; then
- ac_res=db
- else
- ac_res=dbm
- fi], ac_res=no, ac_res=no)
-
- LIBS="$save_LIBS"
-
- eval ac_cv_krb_dbm_open_$m=$ac_res])
- eval ac_res=\$ac_cv_krb_dbm_open_$m
- AC_MSG_RESULT($ac_res)
-
- if test "$lib_dbm" = no -a $ac_res = dbm; then
- lib_dbm="$l"
- elif test "$lib_db" = no -a $ac_res = db; then
- lib_db="$l"
- break
- fi
-done
-
-AC_MSG_CHECKING(for NDBM library)
-ac_ndbm=no
-if test "$lib_db" != no; then
- LIB_DBM="$lib_db"
- ac_ndbm=yes
- AC_DEFINE(HAVE_NEW_DB, 1, [Define if NDBM really is DB (creates files ending in .db).])
- if test "$LIB_DBM"; then
- ac_res="yes, $LIB_DBM"
- else
- ac_res=yes
- fi
-elif test "$lib_dbm" != no; then
- LIB_DBM="$lib_dbm"
- ac_ndbm=yes
- if test "$LIB_DBM"; then
- ac_res="yes, $LIB_DBM"
- else
- ac_res=yes
- fi
-else
- LIB_DBM=""
- ac_res=no
-fi
-test "$ac_ndbm" = yes && AC_DEFINE(NDBM, 1, [Define if you have NDBM (and not DBM)])dnl
-AC_SUBST(LIB_DBM)
-DBLIB="$LIB_DBM"
-AC_SUBST(DBLIB)
-AC_MSG_RESULT($ac_res)
-
-])
diff --git a/usr.sbin/afs/src/cf/krb-func-getcwd-broken.m4 b/usr.sbin/afs/src/cf/krb-func-getcwd-broken.m4
deleted file mode 100644
index 2f173b812e8..00000000000
--- a/usr.sbin/afs/src/cf/krb-func-getcwd-broken.m4
+++ /dev/null
@@ -1,42 +0,0 @@
-dnl $KTH: krb-func-getcwd-broken.m4,v 1.1 1999/05/15 22:45:28 assar Exp $
-dnl
-dnl
-dnl test for broken getcwd in (SunOS braindamage)
-dnl
-
-AC_DEFUN(AC_KRB_FUNC_GETCWD_BROKEN, [
-if test "$ac_cv_func_getcwd" = yes; then
-AC_MSG_CHECKING(if getcwd is broken)
-AC_CACHE_VAL(ac_cv_func_getcwd_broken, [
-ac_cv_func_getcwd_broken=no
-
-AC_TRY_RUN([
-#include <errno.h>
-char *getcwd(char*, int);
-
-void *popen(char *cmd, char *mode)
-{
- errno = ENOTTY;
- return 0;
-}
-
-int main()
-{
- char *ret;
- ret = getcwd(0, 1024);
- if(ret == 0 && errno == ENOTTY)
- return 0;
- return 1;
-}
-], ac_cv_func_getcwd_broken=yes,:,:)
-])
-if test "$ac_cv_func_getcwd_broken" = yes; then
- AC_DEFINE(BROKEN_GETCWD, 1, [Define if getcwd is broken (like in SunOS 4).])dnl
- LIBOBJS="$LIBOBJS getcwd.o"
- AC_SUBST(LIBOBJS)dnl
- AC_MSG_RESULT($ac_cv_func_getcwd_broken)
-else
- AC_MSG_RESULT([seems ok])
-fi
-fi
-])
diff --git a/usr.sbin/afs/src/cf/krb-func-getlogin.m4 b/usr.sbin/afs/src/cf/krb-func-getlogin.m4
deleted file mode 100644
index 44aad26a969..00000000000
--- a/usr.sbin/afs/src/cf/krb-func-getlogin.m4
+++ /dev/null
@@ -1,23 +0,0 @@
-dnl
-dnl $KTH: krb-func-getlogin.m4,v 1.1 2000/10/14 00:11:05 lha Exp $
-dnl $Heimdal: krb-func-getlogin.m4,v 1.1 1999/07/13 17:45:30 assar Exp $
-dnl
-dnl test for POSIX (broken) getlogin
-dnl
-
-
-AC_DEFUN(AC_FUNC_GETLOGIN, [
-AC_CHECK_FUNCS(getlogin setlogin)
-if test "$ac_cv_func_getlogin" = yes; then
-AC_CACHE_CHECK(if getlogin is posix, ac_cv_func_getlogin_posix, [
-if test "$ac_cv_func_getlogin" = yes -a "$ac_cv_func_setlogin" = yes; then
- ac_cv_func_getlogin_posix=no
-else
- ac_cv_func_getlogin_posix=yes
-fi
-])
-if test "$ac_cv_func_getlogin_posix" = yes; then
- AC_DEFINE(POSIX_GETLOGIN, 1, [Define if getlogin has POSIX flavour (and not BSD).])
-fi
-fi
-])
diff --git a/usr.sbin/afs/src/cf/krb-ipv6.m4 b/usr.sbin/afs/src/cf/krb-ipv6.m4
deleted file mode 100644
index 06773f13a19..00000000000
--- a/usr.sbin/afs/src/cf/krb-ipv6.m4
+++ /dev/null
@@ -1,122 +0,0 @@
-dnl $KTH: krb-ipv6.m4,v 1.2 2000/10/11 03:52:10 assar Exp $
-dnl
-dnl test for IPv6
-dnl
-AC_DEFUN(AC_KRB_IPV6, [
-AC_ARG_WITH(ipv6,
-[ --without-ipv6 do not enable IPv6 support],[
-if test "$withval" = "no"; then
- ac_cv_lib_ipv6=no
-fi])
-AC_CACHE_VAL(ac_cv_lib_ipv6,
-[dnl check for different v6 implementations (by itojun)
-v6type=unknown
-v6lib=none
-
-AC_MSG_CHECKING([ipv6 stack type])
-for i in v6d toshiba kame inria zeta linux; do
- case $i in
- v6d)
- AC_EGREP_CPP(yes, [dnl
-#include </usr/local/v6/include/sys/types.h>
-#ifdef __V6D__
-yes
-#endif],
- [v6type=$i; v6lib=v6;
- v6libdir=/usr/local/v6/lib;
- CFLAGS="-I/usr/local/v6/include $CFLAGS"])
- ;;
- toshiba)
- AC_EGREP_CPP(yes, [dnl
-#include <sys/param.h>
-#ifdef _TOSHIBA_INET6
-yes
-#endif],
- [v6type=$i; v6lib=inet6;
- v6libdir=/usr/local/v6/lib;
- CFLAGS="-DINET6 $CFLAGS"])
- ;;
- kame)
- AC_EGREP_CPP(yes, [dnl
-#include <netinet/in.h>
-#ifdef __KAME__
-yes
-#endif],
- [v6type=$i; v6lib=inet6;
- v6libdir=/usr/local/v6/lib;
- CFLAGS="-DINET6 $CFLAGS"])
- ;;
- inria)
- AC_EGREP_CPP(yes, [dnl
-#include <netinet/in.h>
-#ifdef IPV6_INRIA_VERSION
-yes
-#endif],
- [v6type=$i; CFLAGS="-DINET6 $CFLAGS"])
- ;;
- zeta)
- AC_EGREP_CPP(yes, [dnl
-#include <sys/param.h>
-#ifdef _ZETA_MINAMI_INET6
-yes
-#endif],
- [v6type=$i; v6lib=inet6;
- v6libdir=/usr/local/v6/lib;
- CFLAGS="-DINET6 $CFLAGS"])
- ;;
- linux)
- if test -d /usr/inet6; then
- v6type=$i
- v6lib=inet6
- v6libdir=/usr/inet6
- CFLAGS="-DINET6 $CFLAGS"
- fi
- ;;
- esac
- if test "$v6type" != "unknown"; then
- break
- fi
-done
-AC_MSG_RESULT($v6type)
-
-if test "$v6lib" != "none"; then
- for dir in $v6libdir /usr/local/v6/lib /usr/local/lib; do
- if test -d $dir -a -f $dir/lib$v6lib.a; then
- LIBS="-L$dir -l$v6lib $LIBS"
- break
- fi
- done
-fi
-AC_TRY_LINK([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_NETINET_IN6_H
-#include <netinet/in6.h>
-#endif
-],
-[
- struct sockaddr_in6 sin6;
- int s;
-
- s = socket(AF_INET6, SOCK_DGRAM, 0);
-
- sin6.sin6_family = AF_INET6;
- sin6.sin6_port = htons(17);
- sin6.sin6_addr = in6addr_any;
- bind(s, (struct sockaddr *)&sin6, sizeof(sin6));
-],
-ac_cv_lib_ipv6=yes,
-ac_cv_lib_ipv6=no)])
-AC_MSG_CHECKING(for IPv6)
-AC_MSG_RESULT($ac_cv_lib_ipv6)
-if test "$ac_cv_lib_ipv6" = yes; then
- AC_DEFINE(HAVE_IPV6, 1, [Define if you have IPv6.])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/krb-prog-ln-s.m4 b/usr.sbin/afs/src/cf/krb-prog-ln-s.m4
deleted file mode 100644
index 7774faa2c25..00000000000
--- a/usr.sbin/afs/src/cf/krb-prog-ln-s.m4
+++ /dev/null
@@ -1,28 +0,0 @@
-dnl $KTH: krb-prog-ln-s.m4,v 1.1 1999/05/15 22:45:29 assar Exp $
-dnl
-dnl
-dnl Better test for ln -s, ln or cp
-dnl
-
-AC_DEFUN(AC_KRB_PROG_LN_S,
-[AC_MSG_CHECKING(for ln -s or something else)
-AC_CACHE_VAL(ac_cv_prog_LN_S,
-[rm -f conftestdata
-if ln -s X conftestdata 2>/dev/null
-then
- rm -f conftestdata
- ac_cv_prog_LN_S="ln -s"
-else
- touch conftestdata1
- if ln conftestdata1 conftestdata2; then
- rm -f conftestdata*
- ac_cv_prog_LN_S=ln
- else
- ac_cv_prog_LN_S=cp
- fi
-fi])dnl
-LN_S="$ac_cv_prog_LN_S"
-AC_MSG_RESULT($ac_cv_prog_LN_S)
-AC_SUBST(LN_S)dnl
-])
-
diff --git a/usr.sbin/afs/src/cf/krb-prog-ranlib.m4 b/usr.sbin/afs/src/cf/krb-prog-ranlib.m4
deleted file mode 100644
index eb5c70fdee8..00000000000
--- a/usr.sbin/afs/src/cf/krb-prog-ranlib.m4
+++ /dev/null
@@ -1,8 +0,0 @@
-dnl $KTH: krb-prog-ranlib.m4,v 1.1 1999/05/15 22:45:30 assar Exp $
-dnl
-dnl
-dnl Also look for EMXOMF for OS/2
-dnl
-
-AC_DEFUN(AC_KRB_PROG_RANLIB,
-[AC_CHECK_PROGS(RANLIB, ranlib EMXOMF, :)])
diff --git a/usr.sbin/afs/src/cf/krb-prog-yacc.m4 b/usr.sbin/afs/src/cf/krb-prog-yacc.m4
deleted file mode 100644
index 32f09f63d55..00000000000
--- a/usr.sbin/afs/src/cf/krb-prog-yacc.m4
+++ /dev/null
@@ -1,8 +0,0 @@
-dnl $KTH: krb-prog-yacc.m4,v 1.1 1999/05/15 22:45:30 assar Exp $
-dnl
-dnl
-dnl We prefer byacc or yacc because they do not use `alloca'
-dnl
-
-AC_DEFUN(AC_KRB_PROG_YACC,
-[AC_CHECK_PROGS(YACC, byacc yacc 'bison -y')])
diff --git a/usr.sbin/afs/src/cf/krb-struct-sockaddr-sa-len.m4 b/usr.sbin/afs/src/cf/krb-struct-sockaddr-sa-len.m4
deleted file mode 100644
index 04d2d540935..00000000000
--- a/usr.sbin/afs/src/cf/krb-struct-sockaddr-sa-len.m4
+++ /dev/null
@@ -1,22 +0,0 @@
-dnl $KTH: krb-struct-sockaddr-sa-len.m4,v 1.1 1999/05/15 22:45:30 assar Exp $
-dnl
-dnl
-dnl Check for sa_len in sys/socket.h
-dnl
-
-AC_DEFUN(AC_KRB_STRUCT_SOCKADDR_SA_LEN, [
-AC_MSG_CHECKING(for sa_len in struct sockaddr)
-AC_CACHE_VAL(ac_cv_struct_sockaddr_sa_len, [
-AC_TRY_COMPILE(
-[#include <sys/types.h>
-#include <sys/socket.h>],
-[struct sockaddr sa;
-int foo = sa.sa_len;],
-ac_cv_struct_sockaddr_sa_len=yes,
-ac_cv_struct_sockaddr_sa_len=no)
-])
-if test "$ac_cv_struct_sockaddr_sa_len" = yes; then
- AC_DEFINE(SOCKADDR_HAS_SA_LEN)dnl
-fi
-AC_MSG_RESULT($ac_cv_struct_sockaddr_sa_len)
-])
diff --git a/usr.sbin/afs/src/cf/krb-struct-spwd.m4 b/usr.sbin/afs/src/cf/krb-struct-spwd.m4
deleted file mode 100644
index 466251fa9cf..00000000000
--- a/usr.sbin/afs/src/cf/krb-struct-spwd.m4
+++ /dev/null
@@ -1,22 +0,0 @@
-dnl $KTH: krb-struct-spwd.m4,v 1.2 2000/03/14 00:04:10 assar Exp $
-dnl
-dnl Test for `struct spwd'
-
-AC_DEFUN(AC_KRB_STRUCT_SPWD, [
-AC_MSG_CHECKING(for struct spwd)
-AC_CACHE_VAL(ac_cv_type_struct_spwd, [
-AC_TRY_COMPILE(
-[#include <pwd.h>
-#ifdef HAVE_SHADOW_H
-#include <shadow.h>
-#endif],
-[struct spwd foo;],
-ac_cv_struct_spwd=yes,
-ac_cv_struct_spwd=no)
-])
-AC_MSG_RESULT($ac_cv_struct_spwd)
-
-if test "$ac_cv_struct_spwd" = "yes"; then
- AC_DEFINE(HAVE_STRUCT_SPWD, 1, [define if you have struct spwd])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/krb-struct-winsize.m4 b/usr.sbin/afs/src/cf/krb-struct-winsize.m4
deleted file mode 100644
index b353266c509..00000000000
--- a/usr.sbin/afs/src/cf/krb-struct-winsize.m4
+++ /dev/null
@@ -1,27 +0,0 @@
-dnl $KTH: krb-struct-winsize.m4,v 1.1 1999/05/15 22:45:31 assar Exp $
-dnl
-dnl
-dnl Search for struct winsize
-dnl
-
-AC_DEFUN(AC_KRB_STRUCT_WINSIZE, [
-AC_MSG_CHECKING(for struct winsize)
-AC_CACHE_VAL(ac_cv_struct_winsize, [
-ac_cv_struct_winsize=no
-for i in sys/termios.h sys/ioctl.h; do
-AC_EGREP_HEADER(
-changequote(, )dnl
-struct[ ]*winsize,dnl
-changequote([,])dnl
-$i, ac_cv_struct_winsize=yes; break)dnl
-done
-])
-if test "$ac_cv_struct_winsize" = "yes"; then
- AC_DEFINE(HAVE_STRUCT_WINSIZE, 1, [define if struct winsize is declared in sys/termios.h])
-fi
-AC_MSG_RESULT($ac_cv_struct_winsize)
-AC_EGREP_HEADER(ws_xpixel, termios.h,
- AC_DEFINE(HAVE_WS_XPIXEL, 1, [define if struct winsize has ws_xpixel]))
-AC_EGREP_HEADER(ws_ypixel, termios.h,
- AC_DEFINE(HAVE_WS_YPIXEL, 1, [define if struct winsize has ws_ypixel]))
-])
diff --git a/usr.sbin/afs/src/cf/krb-sys-aix.m4 b/usr.sbin/afs/src/cf/krb-sys-aix.m4
deleted file mode 100644
index 8a80540b5f5..00000000000
--- a/usr.sbin/afs/src/cf/krb-sys-aix.m4
+++ /dev/null
@@ -1,15 +0,0 @@
-dnl $KTH: krb-sys-aix.m4,v 1.1 1999/05/15 22:45:31 assar Exp $
-dnl
-dnl
-dnl AIX have a very different syscall convention
-dnl
-AC_DEFUN(AC_KRB_SYS_AIX, [
-AC_MSG_CHECKING(for AIX)
-AC_CACHE_VAL(krb_cv_sys_aix,
-AC_EGREP_CPP(yes,
-[#ifdef _AIX
- yes
-#endif
-], krb_cv_sys_aix=yes, krb_cv_sys_aix=no) )
-AC_MSG_RESULT($krb_cv_sys_aix)
-])
diff --git a/usr.sbin/afs/src/cf/krb-sys-nextstep.m4 b/usr.sbin/afs/src/cf/krb-sys-nextstep.m4
deleted file mode 100644
index 6b8471d4a04..00000000000
--- a/usr.sbin/afs/src/cf/krb-sys-nextstep.m4
+++ /dev/null
@@ -1,22 +0,0 @@
-dnl $KTH: krb-sys-nextstep.m4,v 1.2 1999/05/16 13:44:46 assar Exp $
-dnl
-dnl
-dnl NEXTSTEP is not posix compliant by default,
-dnl you need a switch -posix to the compiler
-dnl
-
-AC_DEFUN(AC_KRB_SYS_NEXTSTEP, [
-AC_MSG_CHECKING(for NEXTSTEP)
-AC_CACHE_VAL(krb_cv_sys_nextstep,
-AC_EGREP_CPP(yes,
-[#if defined(NeXT) && !defined(__APPLE__)
- yes
-#endif
-], krb_cv_sys_nextstep=yes, krb_cv_sys_nextstep=no) )
-if test "$krb_cv_sys_nextstep" = "yes"; then
- CFLAGS="$CFLAGS -posix"
- CPPFLAGS="$CPPFLAGS -posix"
- LIBS="$LIBS -posix"
-fi
-AC_MSG_RESULT($krb_cv_sys_nextstep)
-])
diff --git a/usr.sbin/afs/src/cf/krb-version.m4 b/usr.sbin/afs/src/cf/krb-version.m4
deleted file mode 100644
index 2bccd2df8e8..00000000000
--- a/usr.sbin/afs/src/cf/krb-version.m4
+++ /dev/null
@@ -1,25 +0,0 @@
-dnl $KTH: krb-version.m4,v 1.3 2000/06/03 20:31:44 lha Exp $
-dnl
-dnl
-dnl output a C header-file with some version strings
-dnl
-AC_DEFUN(AC_KRB_VERSION,[
-dnl AC_OUTPUT_COMMANDS([
-cat > include/${PACKAGE}-newversion.h.in <<FOOBAR
-char *${PACKAGE}_long_version = "@(#)\$Version: $PACKAGE-$VERSION by @USER@ on @HOST@ ($host) @DATE@ \$";
-char *${PACKAGE}_version = "$PACKAGE-$VERSION";
-FOOBAR
-
-if test -f include/${PACKAGE}-version.h && cmp -s include/${PACKAGE}-newversion.h.in include/${PACKAGE}-version.h.in; then
- echo "include/${PACKAGE}-version.h is unchanged"
- rm -f include/${PACKAGE}-newversion.h.in
-else
- echo "creating include/${PACKAGE}-version.h"
- User=${USER-${LOGNAME}}
- Host=`(hostname || uname -n) 2>/dev/null | sed 1q`
- Date=`date`
- mv -f include/${PACKAGE}-newversion.h.in include/${PACKAGE}-version.h.in
- sed -e "s/@USER@/$User/" -e "s/@HOST@/$Host/" -e "s/@DATE@/$Date/" include/${PACKAGE}-version.h.in > include/${PACKAGE}-version.h
-fi
-dnl ],host=$host PACKAGE=$PACKAGE VERSION=$VERSION)
-])
diff --git a/usr.sbin/afs/src/cf/linux-d_delete-void.m4 b/usr.sbin/afs/src/cf/linux-d_delete-void.m4
deleted file mode 100644
index c936d8bed01..00000000000
--- a/usr.sbin/afs/src/cf/linux-d_delete-void.m4
+++ /dev/null
@@ -1,26 +0,0 @@
-dnl
-dnl $KTH: linux-d_delete-void.m4,v 1.1.2.1 2002/01/31 10:23:22 lha Exp $
-dnl
-
-AC_DEFUN(AC_LINUX_D_DELETE_VOID, [
-AC_CACHE_CHECK(if d_delete in struct dentry_operations returns void,
-ac_cv_member_dentry_operations_d_delete_void,
-AC_TRY_COMPILE_KERNEL([#include <asm/current.h>
-#include <linux/fs.h>
-#include <linux/dcache.h>],
-[
-struct dentry_operations foo_operations;
-
-int hata_foo(void)
-{
- return foo_operations.d_delete(0);
-}
-],
-ac_cv_member_dentry_operations_d_delete_void=no,
-ac_cv_member_dentry_operations_d_delete_void=yes))
-
-if test "$ac_cv_member_dentry_operations_d_delete_void" = "yes"; then
- AC_DEFINE(HAVE_D_DELETE_VOID, 1,
- [define if d_delete in struct dentry_operations returns void])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/linux-filldir-dt-type.m4 b/usr.sbin/afs/src/cf/linux-filldir-dt-type.m4
deleted file mode 100644
index cb5d60578f0..00000000000
--- a/usr.sbin/afs/src/cf/linux-filldir-dt-type.m4
+++ /dev/null
@@ -1,21 +0,0 @@
-dnl
-dnl $KTH: linux-filldir-dt-type.m4,v 1.1.4.1 2001/05/07 01:29:59 ahltorp Exp $
-dnl
-
-AC_DEFUN(AC_LINUX_FILLDIR_DT_TYPE, [
-AC_CACHE_CHECK([for whether filldir_t includes a dt_type],
-ac_cv_type_filldir_dt_type,
-AC_TRY_COMPILE_KERNEL([#include <asm/current.h>
-#include <linux/fs.h>],
-[
-filldir_t bar;
-
-bar(0, 0, 0, 0, 0, 0);
-],
-ac_cv_type_filldir_dt_type=yes,
-ac_cv_type_filldir_dt_type=no))
-
-if test "$ac_cv_type_filldir_dt_type" = "yes"; then
- AC_DEFINE(HAVE_FILLDIR_T_DT_TYPE, 1, [define if filldir_t takes a dt_type argument])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/linux-func-d_alloc_root-two_args.m4 b/usr.sbin/afs/src/cf/linux-func-d_alloc_root-two_args.m4
deleted file mode 100644
index 46baafd5446..00000000000
--- a/usr.sbin/afs/src/cf/linux-func-d_alloc_root-two_args.m4
+++ /dev/null
@@ -1,21 +0,0 @@
-dnl
-dnl $KTH: linux-func-d_alloc_root-two_args.m4,v 1.2 1999/07/22 04:59:34 assar Exp $
-dnl
-
-AC_DEFUN(AC_LINUX_FUNC_D_ALLOC_ROOT_TWO_ARGS, [
-AC_CACHE_CHECK(if d_alloc_root takes two arguments,
-ac_cv_func_d_alloc_root_two_args,
-AC_TRY_COMPILE_KERNEL([#include <asm/current.h>
-#include <linux/fs.h>
-#include <linux/dcache.h>],
-[
-d_alloc_root(NULL, NULL)
-],
-ac_cv_func_d_alloc_root_two_args=yes,
-ac_cv_func_d_alloc_root_two_args=no))
-
-if test "$ac_cv_func_d_alloc_root_two_args" = "yes"; then
- AC_DEFINE(HAVE_D_ALLOC_ROOT_TWO_ARGS, 1,
- [define if d_alloc_root takes two arguments])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/linux-func-devfs-register-eleven-args.m4 b/usr.sbin/afs/src/cf/linux-func-devfs-register-eleven-args.m4
deleted file mode 100644
index 3963bbc296d..00000000000
--- a/usr.sbin/afs/src/cf/linux-func-devfs-register-eleven-args.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-dnl
-dnl $KTH: linux-func-devfs-register-eleven-args.m4,v 1.1 1999/11/03 01:09:04 mackan Exp $
-dnl
-
-AC_DEFUN(AC_LINUX_FUNC_DEVFS_REGISTER_ELEVEN_ARGS, [
-
-AC_CACHE_CHECK(if devfs_register takes the dir argument,
-ac_cv_func_devfs_register_eleven_args,
-AC_TRY_COMPILE_KERNEL([#include <linux/devfs_fs_kernel.h>
-],[devfs_handle_t de;
-devfs_register(de, NULL, 0, 0, 0, 0, 0, 0, 0, NULL, NULL);
-],
-ac_cv_func_devfs_register_eleven_args=yes,
-ac_cv_func_devfs_register_eleven_args=no))
-if test "$ac_cv_func_devfs_register_eleven_args" = "yes"; then
- AC_DEFINE(HAVE_DEVFS_REGISTER_ELEVEN_ARGS, 1,
- [define if devfs_register takes eleven arguments])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/linux-func-dget-locked.m4 b/usr.sbin/afs/src/cf/linux-func-dget-locked.m4
deleted file mode 100644
index 2460f69b6cd..00000000000
--- a/usr.sbin/afs/src/cf/linux-func-dget-locked.m4
+++ /dev/null
@@ -1,20 +0,0 @@
-dnl
-dnl $KTH: linux-func-dget-locked.m4,v 1.1 2000/09/14 07:19:31 assar Exp $
-dnl
-
-AC_DEFUN(AC_LINUX_FUNC_DGET_LOCKED, [
-AC_CACHE_CHECK([for dget_locked],
-ac_cv_func_dget_locked, [
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS $test_KERNEL_CFLAGS $KERNEL_CPPFLAGS"
-AC_EGREP_CPP([dget_locked],
-[#include <linux/dcache.h>],
-ac_cv_func_dget_locked=yes,
-ac_cv_func_dget_locked=no)]
-CPPFLAGS="$save_CPPFLAGS"
-)
-if test "$ac_cv_func_dget_locked" = "yes"; then
- AC_DEFINE(HAVE_DGET_LOCKED, 1,
- [define if you have a function dget_locked])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/linux-func-init-mutex.m4 b/usr.sbin/afs/src/cf/linux-func-init-mutex.m4
deleted file mode 100644
index 2c055b954d0..00000000000
--- a/usr.sbin/afs/src/cf/linux-func-init-mutex.m4
+++ /dev/null
@@ -1,23 +0,0 @@
-dnl
-dnl $KTH: linux-func-init-mutex.m4,v 1.6.12.1 2002/01/31 12:34:45 lha Exp $
-dnl
-
-AC_DEFUN(AC_LINUX_FUNC_INIT_MUTEX, [
-AC_CACHE_CHECK([for init_MUTEX],
-ac_cv_func_init_mutex, [
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS $test_KERNEL_CFLAGS $KERNEL_CPPFLAGS"
-AC_EGREP_CPP([init_MUTEX],
-[#include <asm/semaphore.h>
-#ifdef init_MUTEX
-init_MUTEX
-#endif],
-ac_cv_func_init_mutex=yes,
-ac_cv_func_init_mutex=no)]
-CPPFLAGS="$save_CPPFLAGS"
-)
-if test "$ac_cv_func_init_mutex" = "yes"; then
- AC_DEFINE(HAVE_INIT_MUTEX, 1,
- [define if you have a function init_MUTEX])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/linux-func-init-wait-queue-head.m4 b/usr.sbin/afs/src/cf/linux-func-init-wait-queue-head.m4
deleted file mode 100644
index 5298c16f5ec..00000000000
--- a/usr.sbin/afs/src/cf/linux-func-init-wait-queue-head.m4
+++ /dev/null
@@ -1,21 +0,0 @@
-dnl
-dnl $KTH: linux-func-init-wait-queue-head.m4,v 1.2 2000/09/25 09:13:56 lha Exp $
-dnl
-
-AC_DEFUN(AC_LINUX_FUNC_INIT_WAITQUEUE_HEAD, [
-AC_CACHE_CHECK([for init_waitqueue_head],
-ac_cv_func_init_waitqueue_head,[
-AC_TRY_COMPILE_KERNEL([
-#ifdef HAVE_LINUX_STDDEF_H
-#include <linux/stddef.h>
-#endif
-#include <linux/wait.h>],
-[wait_queue_head_t foo;
-init_waitqueue_head(&foo)],
-ac_cv_func_init_waitqueue_head=yes,
-ac_cv_func_init_waitqueue_head=no)])
-if test "$ac_cv_func_init_waitqueue_head" = "yes"; then
- AC_DEFINE(HAVE_INIT_WAITQUEUE_HEAD, 1,
- [define if you have a init_waitqueue_head])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/linux-func-list-del-init.m4 b/usr.sbin/afs/src/cf/linux-func-list-del-init.m4
deleted file mode 100644
index f28f9480890..00000000000
--- a/usr.sbin/afs/src/cf/linux-func-list-del-init.m4
+++ /dev/null
@@ -1,20 +0,0 @@
-dnl
-dnl $KTH: linux-func-list-del-init.m4,v 1.1.2.1 2002/01/31 13:03:16 lha Exp $
-dnl
-
-AC_DEFUN(AC_LINUX_FUNC_LIST_DEL_INIT, [
-AC_CACHE_CHECK([for list_del_init],
-ac_cv_func_list_del_init, [
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS $test_KERNEL_CFLAGS $KERNEL_CPPFLAGS"
-AC_EGREP_CPP([list_del_init],
-[#include <linux/list.h>],
-ac_cv_func_list_del_init=yes,
-ac_cv_func_list_del_init=no)]
-CPPFLAGS="$save_CPPFLAGS"
-)
-if test "$ac_cv_func_list_del_init" = "yes"; then
- AC_DEFINE(HAVE_LIST_DEL_INIT, 1,
- [define if you have a function list_del_init])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/linux-type-wait-queue-head.m4 b/usr.sbin/afs/src/cf/linux-type-wait-queue-head.m4
deleted file mode 100644
index 97fa1d84d37..00000000000
--- a/usr.sbin/afs/src/cf/linux-type-wait-queue-head.m4
+++ /dev/null
@@ -1,16 +0,0 @@
-dnl
-dnl $KTH: linux-type-wait-queue-head.m4,v 1.2 1999/05/16 16:38:36 assar Exp $
-dnl
-
-AC_DEFUN(AC_LINUX_TYPE_WAIT_QUEUE_HEAD_T, [
-AC_CACHE_CHECK([for wait_queue_head_t],
-ac_cv_type_wait_queue_head_t,[
-AC_TRY_COMPILE_KERNEL([#include <linux/wait.h>],
-[wait_queue_head_t foo;],
-ac_cv_type_wait_queue_head_t=yes,
-ac_cv_type_wait_queue_head_t=no)])
-if test "$ac_cv_type_wait_queue_head_t" = "yes"; then
- AC_DEFINE(HAVE_WAIT_QUEUE_HEAD_T, 1,
- [define if you have a wait_queue_head_t])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/linux-type-wait-queue-task-list.m4 b/usr.sbin/afs/src/cf/linux-type-wait-queue-task-list.m4
deleted file mode 100644
index 99574a3edda..00000000000
--- a/usr.sbin/afs/src/cf/linux-type-wait-queue-task-list.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-dnl
-dnl $KTH: linux-type-wait-queue-task-list.m4,v 1.1 2000/09/25 09:14:55 lha Exp $
-dnl
-
-AC_DEFUN(AC_LINUX_TYPE_WAIT_QUEUE_TASK_LIST, [
-AC_CACHE_CHECK([for wait_queue_task_list],
-ac_cv_type_wait_queue_task_list,[
-AC_TRY_COMPILE_KERNEL([#include <linux/stddef.h>
-#include <linux/wait.h>],
-[wait_queue_head_t foo;
-void *p;
-p = &foo.task_list;],
-ac_cv_type_wait_queue_task_list=yes,
-ac_cv_type_wait_queue_task_list=no)])
-if test "$ac_cv_type_wait_queue_task_list" = "yes"; then
- AC_DEFINE(HAVE_WAIT_QUEUE_TASK_LIST, 1,
- [define if you have a wait_queue_task_list])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/mips-abi.m4 b/usr.sbin/afs/src/cf/mips-abi.m4
deleted file mode 100644
index e4669645114..00000000000
--- a/usr.sbin/afs/src/cf/mips-abi.m4
+++ /dev/null
@@ -1,87 +0,0 @@
-dnl $KTH: mips-abi.m4,v 1.1 1999/05/15 22:45:33 assar Exp $
-dnl
-dnl
-dnl Check for MIPS/IRIX ABI flags. Sets $abi and $abilibdirext to some
-dnl value.
-
-AC_DEFUN(AC_MIPS_ABI, [
-AC_ARG_WITH(mips_abi,
-[ --with-mips-abi=abi ABI to use for IRIX (32, n32, or 64)])
-
-case "$host_os" in
-irix*)
-with_mips_abi="${with_mips_abi:-yes}"
-if test -n "$GCC"; then
-
-# GCC < 2.8 only supports the O32 ABI. GCC >= 2.8 has a flag to select
-# which ABI to use, but only supports (as of 2.8.1) the N32 and 64 ABIs.
-#
-# Default to N32, but if GCC doesn't grok -mabi=n32, we assume an old
-# GCC and revert back to O32. The same goes if O32 is asked for - old
-# GCCs doesn't like the -mabi option, and new GCCs can't output O32.
-#
-# Don't you just love *all* the different SGI ABIs?
-
-case "${with_mips_abi}" in
- 32|o32) abi='-mabi=32'; abilibdirext='' ;;
- n32|yes) abi='-mabi=n32'; abilibdirext='32' ;;
- 64) abi='-mabi=64'; abilibdirext='64' ;;
- no) abi=''; abilibdirext='';;
- *) AC_ERROR("Invalid ABI specified") ;;
-esac
-if test -n "$abi" ; then
-ac_foo=krb_cv_gcc_`echo $abi | tr =- __`
-dnl
-dnl can't use AC_CACHE_CHECK here, since it doesn't quote CACHE-ID to
-dnl AC_MSG_RESULT
-dnl
-AC_MSG_CHECKING([if $CC supports the $abi option])
-AC_CACHE_VAL($ac_foo, [
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $abi"
-AC_TRY_COMPILE(,int x;, eval $ac_foo=yes, eval $ac_foo=no)
-CFLAGS="$save_CFLAGS"
-])
-ac_res=`eval echo \\\$$ac_foo`
-AC_MSG_RESULT($ac_res)
-if test $ac_res = no; then
-# Try to figure out why that failed...
-case $abi in
- -mabi=32)
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -mabi=n32"
- AC_TRY_COMPILE(,int x;, ac_res=yes, ac_res=no)
- CLAGS="$save_CFLAGS"
- if test $ac_res = yes; then
- # New GCC
- AC_ERROR([$CC does not support the $with_mips_abi ABI])
- fi
- # Old GCC
- abi=''
- abilibdirext=''
- ;;
- -mabi=n32|-mabi=64)
- if test $with_mips_abi = yes; then
- # Old GCC, default to O32
- abi=''
- abilibdirext=''
- else
- # Some broken GCC
- AC_ERROR([$CC does not support the $with_mips_abi ABI])
- fi
- ;;
-esac
-fi #if test $ac_res = no; then
-fi #if test -n "$abi" ; then
-else
-case "${with_mips_abi}" in
- 32|o32) abi='-32'; abilibdirext='' ;;
- n32|yes) abi='-n32'; abilibdirext='32' ;;
- 64) abi='-64'; abilibdirext='64' ;;
- no) abi=''; abilibdirext='';;
- *) AC_ERROR("Invalid ABI specified") ;;
-esac
-fi #if test -n "$GCC"; then
-;;
-esac
-])
diff --git a/usr.sbin/afs/src/cf/misc.m4 b/usr.sbin/afs/src/cf/misc.m4
deleted file mode 100644
index ac1a716254d..00000000000
--- a/usr.sbin/afs/src/cf/misc.m4
+++ /dev/null
@@ -1,3 +0,0 @@
-dnl $KTH: misc.m4,v 1.1 1999/05/15 22:45:33 assar Exp $
-dnl
-define(upcase,`echo $1 | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`)dnl
diff --git a/usr.sbin/afs/src/cf/need-proto.m4 b/usr.sbin/afs/src/cf/need-proto.m4
deleted file mode 100644
index 76be5bf18fb..00000000000
--- a/usr.sbin/afs/src/cf/need-proto.m4
+++ /dev/null
@@ -1,25 +0,0 @@
-dnl $KTH: need-proto.m4,v 1.1 1999/05/15 22:45:33 assar Exp $
-dnl
-dnl
-dnl Check if we need the prototype for a function
-dnl
-
-dnl AC_NEED_PROTO(includes, function)
-
-AC_DEFUN(AC_NEED_PROTO, [
-if test "$ac_cv_func_$2+set" != set -o "$ac_cv_func_$2" = yes; then
-AC_CACHE_CHECK([if $2 needs a prototype], ac_cv_func_$2_noproto,
-AC_TRY_COMPILE([$1],
-[struct foo { int foo; } xx;
-extern int $2 (struct foo*);
-$2(&xx);
-],
-eval "ac_cv_func_$2_noproto=yes",
-eval "ac_cv_func_$2_noproto=no"))
-define([foo], [NEED_]translit($2, [a-z], [A-Z])[_PROTO])
-if test "$ac_cv_func_$2_noproto" = yes; then
- AC_DEFINE(foo, 1, [define if the system is missing a prototype for $2()])
-fi
-undefine([foo])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/osf-func-ubc-lookup.m4 b/usr.sbin/afs/src/cf/osf-func-ubc-lookup.m4
deleted file mode 100644
index 9f1548d6574..00000000000
--- a/usr.sbin/afs/src/cf/osf-func-ubc-lookup.m4
+++ /dev/null
@@ -1,24 +0,0 @@
-dnl
-dnl $KTH: osf-func-ubc-lookup.m4,v 1.2 2000/06/12 06:57:40 assar Exp $
-dnl
-
-AC_DEFUN(AC_OSF_FUNC_UBC_LOOKUP, [
-AC_CACHE_CHECK(if ubc_lookup takes six arguments,
-ac_cv_func_ubc_lookup_six_args,
-AC_TRY_COMPILE_KERNEL([
-#if defined(__osf__) && defined(__GNUC__)
-#define asm __foo_asm
-#endif
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/proc.h>
-#include <sys/lock.h>
-#include <vm/vm_ubc.h>
-], [ubc_lookup(NULL, 0, 0, 0, NULL, NULL)],
-ac_cv_func_ubc_lookup_six_args=yes,
-ac_cv_func_ubc_lookup_six_args=no))
-if test "$ac_cv_func_ubc_lookup_six_args" = yes; then
- AC_DEFINE(HAVE_SIX_ARGUMENT_UBC_LOOKUP, 1,
- [define if ubc_lookup takes six arguments])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/osf-func-vfs-name-hash.m4 b/usr.sbin/afs/src/cf/osf-func-vfs-name-hash.m4
deleted file mode 100644
index 300b1970971..00000000000
--- a/usr.sbin/afs/src/cf/osf-func-vfs-name-hash.m4
+++ /dev/null
@@ -1,47 +0,0 @@
-dnl
-dnl $KTH: osf-func-vfs-name-hash.m4,v 1.1.2.1 2001/05/28 23:22:48 mattiasa Exp $
-dnl
-
-AC_DEFUN(AC_OSF_FUNC_VFS_NAME_HASH, [
-
-AC_CACHE_CHECK(if vfs_name_hash takes four arguments,
-ac_cv_func_vfs_name_hash_four_args,
-AC_TRY_COMPILE_KERNEL([
-#if defined(__osf__) && defined(__GNUC__)
-#define asm __foo_asm
-#endif
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/proc.h>
-#include <sys/lock.h>
-#include <sys/vfs_proto.h>
-#include <vm/vm_ubc.h>
-], [vfs_name_hash(NULL, NULL, NULL, NULL)],
-ac_cv_func_vfs_name_hash_four_args=yes,
-ac_cv_func_vfs_name_hash_four_args=no))
-if test "$ac_cv_func_vfs_name_hash_four_args" = yes; then
- AC_DEFINE(HAVE_FOUR_ARGUMENT_VFS_NAME_HASH, 1,
- [define if vfs_name_hash takes four arguments])
-fi
-
-AC_CACHE_CHECK(if vfs_name_hash takes three arguments,
-ac_cv_func_vfs_name_hash_three_args,
-AC_TRY_COMPILE_KERNEL([
-#if defined(__osf__) && defined(__GNUC__)
-#define asm __foo_asm
-#endif
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/proc.h>
-#include <sys/lock.h>
-#include <sys/vfs_proto.h>
-#include <vm/vm_ubc.h>
-], [vfs_name_hash(NULL, NULL, NULL)],
-ac_cv_func_vfs_name_hash_three_args=yes,
-ac_cv_func_vfs_name_hash_three_args=no))
-if test "$ac_cv_func_vfs_name_hash_three_args" = yes; then
- AC_DEFINE(HAVE_THREE_ARGUMENT_VFS_NAME_HASH, 1,
- [define if vfs_name_hash takes three arguments])
-fi
-
-])
diff --git a/usr.sbin/afs/src/cf/osfc2.m4 b/usr.sbin/afs/src/cf/osfc2.m4
deleted file mode 100644
index dd9ade5014f..00000000000
--- a/usr.sbin/afs/src/cf/osfc2.m4
+++ /dev/null
@@ -1,14 +0,0 @@
-dnl $KTH: osfc2.m4,v 1.1 1999/05/15 22:45:33 assar Exp $
-dnl
-dnl enable OSF C2 stuff
-
-AC_DEFUN(AC_CHECK_OSFC2,[
-AC_ARG_ENABLE(osfc2,
-[ --enable-osfc2 enable some OSF C2 support])
-LIB_security=
-if test "$enable_osfc2" = yes; then
- AC_DEFINE(HAVE_OSFC2, 1, [Define to enable basic OSF C2 support.])
- LIB_security=-lsecurity
-fi
-AC_SUBST(LIB_security)
-])
diff --git a/usr.sbin/afs/src/cf/prog-cc-flags.m4 b/usr.sbin/afs/src/cf/prog-cc-flags.m4
deleted file mode 100644
index 1df320326c6..00000000000
--- a/usr.sbin/afs/src/cf/prog-cc-flags.m4
+++ /dev/null
@@ -1,15 +0,0 @@
-dnl
-dnl $KTH: prog-cc-flags.m4,v 1.2 2000/01/23 12:34:11 assar Exp $
-dnl
-
-AC_DEFUN(AC_PROG_CC_FLAGS, [
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_MSG_CHECKING(for $CC warning options)
-if test "$GCC" = "yes"; then
- extra_flags="-Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs"
- CFLAGS="$CFLAGS $extra_flags"
- AC_MSG_RESULT($extra_flags)
-else
- AC_MSG_RESULT(none)
-fi
-])
diff --git a/usr.sbin/afs/src/cf/proto-compat.m4 b/usr.sbin/afs/src/cf/proto-compat.m4
deleted file mode 100644
index 7edc5ae09f5..00000000000
--- a/usr.sbin/afs/src/cf/proto-compat.m4
+++ /dev/null
@@ -1,22 +0,0 @@
-dnl $KTH: proto-compat.m4,v 1.1 1999/05/15 22:45:34 assar Exp $
-dnl
-dnl
-dnl Check if the prototype of a function is compatible with another one
-dnl
-
-dnl AC_PROTO_COMPAT(includes, function, prototype)
-
-AC_DEFUN(AC_PROTO_COMPAT, [
-AC_CACHE_CHECK([if $2 is compatible with system prototype],
-ac_cv_func_$2_proto_compat,
-AC_TRY_COMPILE([$1],
-[$3;],
-eval "ac_cv_func_$2_proto_compat=yes",
-eval "ac_cv_func_$2_proto_compat=no"))
-define([foo], translit($2, [a-z], [A-Z])[_PROTO_COMPATIBLE])
-if test "$ac_cv_func_$2_proto_compat" = yes; then
- AC_DEFINE(foo, 1, [define if prototype of $2 is compatible with
- $3])
-fi
-undefine([foo])
-]) \ No newline at end of file
diff --git a/usr.sbin/afs/src/cf/shared-libs.m4 b/usr.sbin/afs/src/cf/shared-libs.m4
deleted file mode 100644
index 4bef01eb13d..00000000000
--- a/usr.sbin/afs/src/cf/shared-libs.m4
+++ /dev/null
@@ -1,186 +0,0 @@
-dnl
-dnl $KTH: shared-libs.m4,v 1.1 1999/05/15 22:45:34 assar Exp $
-dnl
-dnl Shared library stuff has to be different everywhere
-dnl
-
-AC_DEFUN(AC_SHARED_LIBS, [
-
-dnl Check if we want to use shared libraries
-AC_ARG_ENABLE(shared,
-[ --enable-shared create shared libraries for Kerberos])
-
-AC_SUBST(CFLAGS)dnl
-AC_SUBST(LDFLAGS)dnl
-
-case ${enable_shared} in
- yes ) enable_shared=yes;;
- no ) enable_shared=no;;
- * ) enable_shared=no;;
-esac
-
-# NOTE: Building shared libraries may not work if you do not use gcc!
-#
-# OS $SHLIBEXT
-# HP-UX sl
-# Linux so
-# NetBSD so
-# FreeBSD so
-# OSF so
-# SunOS5 so
-# SunOS4 so.0.5
-# Irix so
-#
-# LIBEXT is the extension we should build (.a or $SHLIBEXT)
-LINK='$(CC)'
-AC_SUBST(LINK)
-lib_deps=yes
-REAL_PICFLAGS="-fpic"
-LDSHARED='$(CC) $(PICFLAGS) -shared'
-LIBPREFIX=lib
-build_symlink_command=@true
-install_symlink_command=@true
-install_symlink_command2=@true
-REAL_SHLIBEXT=so
-changequote({,})dnl
-SHLIB_VERSION=`echo $VERSION | sed 's/\([0-9.]*\).*/\1/'`
-SHLIB_SONAME=`echo $VERSION | sed 's/\([0-9]*\).*/\1/'`
-changequote([,])dnl
-case "${host}" in
-*-*-hpux*)
- REAL_SHLIBEXT=sl
- REAL_LD_FLAGS='-Wl,+b$(libdir)'
- if test -z "$GCC"; then
- LDSHARED="ld -b"
- REAL_PICFLAGS="+z"
- fi
- lib_deps=no
- ;;
-*-*-linux*)
- LDSHARED='$(CC) -shared -Wl,-soname,$(LIBNAME).so.'"${SHLIB_SONAME}"
- REAL_LD_FLAGS='-Wl,-rpath,$(libdir)'
- REAL_SHLIBEXT=so.$SHLIB_VERSION
- build_symlink_command='$(LN_S) -f [$][@] $(LIBNAME).so'
- install_symlink_command='$(LN_S) -f $(LIB) $(DESTDIR)$(libdir)/$(LIBNAME).so.'"${SHLIB_SONAME}"';$(LN_S) -f $(LIB) $(DESTDIR)$(libdir)/$(LIBNAME).so'
- install_symlink_command2='$(LN_S) -f $(LIB2) $(DESTDIR)$(libdir)/$(LIBNAME2).so.'"${SHLIB_SONAME}"';$(LN_S) -f $(LIB2) $(DESTDIR)$(libdir)/$(LIBNAME2).so'
- ;;
-*-*-freebsd3*)
- REAL_SHLIBEXT=so.$SHLIB_VERSION
- LDSHARED='ld -Bshareable'
- REAL_LD_FLAGS='-Wl,-R$(libdir)'
- build_symlink_command='$(LN_S) -f [$][@] $(LIBNAME).so'
- install_symlink_command='$(LN_S) -f $(LIB) $(DESTDIR)$(libdir)/$(LIBNAME).so'
- install_symlink_command2='$(LN_S) -f $(LIB2) $(DESTDIR)$(libdir)/$(LIBNAME2).so'
- ;;
-*-*-*bsd*)
- REAL_SHLIBEXT=so.$SHLIB_VERSION
- LDSHARED='ld -Bshareable'
- REAL_LD_FLAGS='-Wl,-R$(libdir)'
- ;;
-*-*-osf*)
- REAL_LD_FLAGS='-Wl,-rpath,$(libdir)'
- REAL_PICFLAGS=
- LDSHARED='ld -shared -expect_unresolved \*'
- ;;
-*-*-solaris2*)
- REAL_LD_FLAGS='-Wl,-R$(libdir)'
- if test -z "$GCC"; then
- LDSHARED='$(CC) -G'
- REAL_PICFLAGS="-Kpic"
- fi
- ;;
-*-fujitsu-uxpv*)
- REAL_LD_FLAGS='' # really: LD_RUN_PATH=$(libdir) cc -o ...
- REAL_LINK='LD_RUN_PATH=$(libdir) $(CC)'
- LDSHARED='$(CC) -G'
- REAL_PICFLAGS="-Kpic"
- lib_deps=no # fails in mysterious ways
- ;;
-*-*-sunos*)
- REAL_SHLIBEXT=so.$SHLIB_VERSION
- REAL_LD_FLAGS='-Wl,-L$(libdir)'
- lib_deps=no
- ;;
-*-*-irix*)
- libdir="${libdir}${abilibdirext}"
- REAL_LD_FLAGS="${abi} -Wl,-rpath,\$(libdir)"
- LD_FLAGS="${abi} -Wl,-rpath,\$(libdir)"
- LDSHARED="\$(CC) -shared ${abi}"
- REAL_PICFLAGS=
- CFLAGS="${abi} ${CFLAGS}"
- ;;
-*-*-os2*)
- LIBPREFIX=
- EXECSUFFIX='.exe'
- RANLIB=EMXOMF
- LD_FLAGS=-Zcrtdll
- REAL_SHLIBEXT=nobuild
- ;;
-*-*-cygwin32*)
- EXECSUFFIX='.exe'
- REAL_SHLIBEXT=nobuild
- ;;
-*) REAL_SHLIBEXT=nobuild
- REAL_PICFLAGS=
- ;;
-esac
-
-if test "${enable_shared}" != "yes" ; then
- PICFLAGS=""
- SHLIBEXT="nobuild"
- LIBEXT="a"
- build_symlink_command=@true
- install_symlink_command=@true
- install_symlink_command2=@true
-else
- PICFLAGS="$REAL_PICFLAGS"
- SHLIBEXT="$REAL_SHLIBEXT"
- LIBEXT="$SHLIBEXT"
- AC_MSG_CHECKING(whether to use -rpath)
- case "$libdir" in
- /lib | /usr/lib | /usr/local/lib)
- AC_MSG_RESULT(no)
- REAL_LD_FLAGS=
- LD_FLAGS=
- ;;
- *)
- LD_FLAGS="$REAL_LD_FLAGS"
- test "$REAL_LINK" && LINK="$REAL_LINK"
- AC_MSG_RESULT($LD_FLAGS)
- ;;
- esac
-fi
-
-if test "$lib_deps" = yes; then
- lib_deps_yes=""
- lib_deps_no="# "
-else
- lib_deps_yes="# "
- lib_deps_no=""
-fi
-AC_SUBST(lib_deps_yes)
-AC_SUBST(lib_deps_no)
-
-# use supplied ld-flags, or none if `no'
-if test "$with_ld_flags" = no; then
- LD_FLAGS=
-elif test -n "$with_ld_flags"; then
- LD_FLAGS="$with_ld_flags"
-fi
-
-AC_SUBST(REAL_PICFLAGS) dnl
-AC_SUBST(REAL_SHLIBEXT) dnl
-AC_SUBST(REAL_LD_FLAGS) dnl
-
-AC_SUBST(PICFLAGS) dnl
-AC_SUBST(SHLIBEXT) dnl
-AC_SUBST(LDSHARED) dnl
-AC_SUBST(LD_FLAGS) dnl
-AC_SUBST(LIBEXT) dnl
-AC_SUBST(LIBPREFIX) dnl
-AC_SUBST(EXECSUFFIX) dnl
-
-AC_SUBST(build_symlink_command)dnl
-AC_SUBST(install_symlink_command)dnl
-AC_SUBST(install_symlink_command2)dnl
-])
diff --git a/usr.sbin/afs/src/cf/test-package.m4 b/usr.sbin/afs/src/cf/test-package.m4
deleted file mode 100644
index 7b648723f4f..00000000000
--- a/usr.sbin/afs/src/cf/test-package.m4
+++ /dev/null
@@ -1,88 +0,0 @@
-dnl $KTH: test-package.m4,v 1.1 1999/05/15 22:45:34 assar Exp $
-dnl
-dnl AC_TEST_PACKAGE_NEW(package,headers,libraries,extra libs,default locations)
-
-AC_DEFUN(AC_TEST_PACKAGE,[AC_TEST_PACKAGE_NEW($1,[#include <$2>],$4,,$5)])
-
-AC_DEFUN(AC_TEST_PACKAGE_NEW,[
-AC_ARG_WITH($1,
-[ --with-$1=dir use $1 in dir])
-AC_ARG_WITH($1-lib,
-[ --with-$1-lib=dir use $1 libraries in dir],
-[if test "$withval" = "yes" -o "$withval" = "no"; then
- AC_MSG_ERROR([No argument for --with-$1-lib])
-elif test "X$with_$1" = "X"; then
- with_$1=yes
-fi])
-AC_ARG_WITH($1-include,
-[ --with-$1-include=dir use $1 headers in dir],
-[if test "$withval" = "yes" -o "$withval" = "no"; then
- AC_MSG_ERROR([No argument for --with-$1-include])
-elif test "X$with_$1" = "X"; then
- with_$1=yes
-fi])
-
-AC_MSG_CHECKING(for $1)
-
-case "$with_$1" in
-yes) ;;
-no) ;;
-"") ;;
-*) if test "$with_$1_include" = ""; then
- with_$1_include="$with_$1/include"
- fi
- if test "$with_$1_lib" = ""; then
- with_$1_lib="$with_$1/lib$abilibdirext"
- fi
- ;;
-esac
-header_dirs=
-lib_dirs=
-d='$5'
-for i in $d; do
- header_dirs="$header_dirs $i/include"
- lib_dirs="$lib_dirs $i/lib$abilibdirext"
-done
-
-case "$with_$1_include" in
-yes) ;;
-no) ;;
-*) header_dirs="$with_$1_include $header_dirs";;
-esac
-case "$with_$1_lib" in
-yes) ;;
-no) ;;
-*) lib_dirs="$with_$1_lib $lib_dirs";;
-esac
-
-save_CFLAGS="$CFLAGS"
-save_LIBS="$LIBS"
-ires= lres=
-for i in $header_dirs; do
- CFLAGS="-I$i $save_CFLAGS"
- AC_TRY_COMPILE([$2],,ires=$i;break)
-done
-for i in $lib_dirs; do
- LIBS="-L$i $3 $4 $save_LIBS"
- AC_TRY_LINK([$2],,lres=$i;break)
-done
-CFLAGS="$save_CFLAGS"
-LIBS="$save_LIBS"
-
-if test "$ires" -a "$lres"; then
- $1_includedir="$ires"
- $1_libdir="$lres"
- INCLUDE_$1="-I$$1_includedir"
- LIB_$1="-L$$1_libdir $3"
- AC_DEFINE_UNQUOTED(upcase($1),1,[Define if you have the $1 package.])
- with_$1=yes
- AC_MSG_RESULT([headers $ires, libraries $lres])
-else
- INCLUDE_$1=
- LIB_$1=
- with_$1=no
- AC_MSG_RESULT($with_$1)
-fi
-AC_SUBST(INCLUDE_$1)
-AC_SUBST(LIB_$1)
-])
diff --git a/usr.sbin/afs/src/cf/try-compile-kernel.m4 b/usr.sbin/afs/src/cf/try-compile-kernel.m4
deleted file mode 100644
index e19f0123085..00000000000
--- a/usr.sbin/afs/src/cf/try-compile-kernel.m4
+++ /dev/null
@@ -1,15 +0,0 @@
-dnl
-dnl $KTH: try-compile-kernel.m4,v 1.2.12.1 2001/05/28 23:22:51 mattiasa Exp $
-dnl
-
-AC_DEFUN(AC_TRY_COMPILE_KERNEL,[
-save_CFLAGS="$CFLAGS"
-save_CC="$CC"
-if test "X${KERNEL_CC}" != "X"; then
- CC="$KERNEL_CC"
-fi
-CFLAGS="$CFLAGS $test_KERNEL_CFLAGS $KERNEL_CPPFLAGS"
-AC_TRY_COMPILE([$1], [$2], [$3], [$4])
-CFLAGS="$save_CFLAGS"
-CC="$save_CC"
-])
diff --git a/usr.sbin/afs/src/cf/try-cpp-kernel.m4 b/usr.sbin/afs/src/cf/try-cpp-kernel.m4
deleted file mode 100644
index ca31fcf6a34..00000000000
--- a/usr.sbin/afs/src/cf/try-cpp-kernel.m4
+++ /dev/null
@@ -1,10 +0,0 @@
-dnl
-dnl $KTH: try-cpp-kernel.m4,v 1.1 2000/03/16 10:20:34 assar Exp $
-dnl
-
-AC_DEFUN(AC_TRY_CPP_KERNEL,[
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS $KERNEL_CPPFLAGS"
-AC_TRY_CPP([$1], [$2], [$3])
-CPPFLAGS="$save_CPPFLAGS"
-])
diff --git a/usr.sbin/afs/src/cf/type-iovec.m4 b/usr.sbin/afs/src/cf/type-iovec.m4
deleted file mode 100644
index 7f3f0e1fe5d..00000000000
--- a/usr.sbin/afs/src/cf/type-iovec.m4
+++ /dev/null
@@ -1,23 +0,0 @@
-dnl
-dnl $KTH: type-iovec.m4,v 1.2 1999/06/24 01:44:58 assar Exp $
-dnl
-
-dnl
-dnl Check for struct iovec
-dnl
-
-AC_DEFUN(AC_TYPE_IOVEC, [
-
-AC_CACHE_CHECK(for struct iovec, ac_cv_struct_iovec, [
-AC_EGREP_HEADER(
-changequote(, )dnl
-struct[ ]*iovec,
-changequote([,])dnl
-sys/uio.h,
-ac_cv_struct_iovec=yes,
-ac_cv_struct_iovec=no)
-])
-if test "$ac_cv_struct_iovec" = "yes"; then
- AC_DEFINE(HAVE_STRUCT_IOVEC, 1, [define if you have struct iovec])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/type-krb-principal.m4 b/usr.sbin/afs/src/cf/type-krb-principal.m4
deleted file mode 100644
index 2760688e6da..00000000000
--- a/usr.sbin/afs/src/cf/type-krb-principal.m4
+++ /dev/null
@@ -1,26 +0,0 @@
-dnl
-dnl $KTH: type-krb-principal.m4,v 1.3 2000/01/23 13:01:42 lha Exp $
-dnl
-
-dnl
-dnl Check for struct krb_principal
-dnl
-
-AC_DEFUN(AC_TYPE_KRB_PRINCIPAL, [
-
-AC_CACHE_CHECK(for krb_principal, ac_cv_struct_krb_principal, [
-if test "$ac_cv_found_krb4" = "yes"; then
-save_CPPFLAGS="${CPPFLAGS}"
-CPPFLAGS="${KRB4_INC_FLAGS} $CPPFLAGS"
-AC_EGREP_HEADER(krb_principal, krb.h,ac_cv_struct_krb_principal=yes)
-CPPFLAGS="${save_CPPFLAGS}"
-eval "ac_cv_struct_krb_principal=${ac_cv_struct_krb_principal-no}"
-else
-dnl Gross hack to avoid struct krb_principal get defined when we don't have krb
-eval "ac_cv_struct_krb_principal=no"
-fi
-])
-if test "$ac_cv_struct_krb_principal" = "yes"; then
- AC_DEFINE(HAVE_KRB_PRINCIPAL, 1, [define if you have a struct krb_principal])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/type-msghdr.m4 b/usr.sbin/afs/src/cf/type-msghdr.m4
deleted file mode 100644
index aac659628f8..00000000000
--- a/usr.sbin/afs/src/cf/type-msghdr.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-dnl
-dnl $KTH: type-msghdr.m4,v 1.1 1999/05/15 22:45:35 assar Exp $
-dnl
-
-dnl
-dnl Check for struct msghdr
-dnl
-
-AC_DEFUN(AC_TYPE_MSGHDR, [
-
-AC_CACHE_CHECK(for struct msghdr, ac_cv_struct_msghdr, [
-AC_EGREP_HEADER([struct msghdr], sys/socket.h,
-ac_cv_struct_msghdr=yes,
-ac_cv_struct_msghdr=no)
-])
-if test "$ac_cv_struct_msghdr" = "yes"; then
- AC_DEFINE(HAVE_STRUCT_MSGHDR, 1, [define if you have struct msghdr])
-fi
-])
diff --git a/usr.sbin/afs/src/cf/wflags.m4 b/usr.sbin/afs/src/cf/wflags.m4
deleted file mode 100644
index 0b37e2fc324..00000000000
--- a/usr.sbin/afs/src/cf/wflags.m4
+++ /dev/null
@@ -1,21 +0,0 @@
-dnl $KTH: wflags.m4,v 1.1 1999/05/15 22:45:35 assar Exp $
-dnl
-dnl set WFLAGS
-
-AC_DEFUN(AC_WFLAGS,[
-WFLAGS_NOUNUSED=""
-WFLAGS_NOIMPLICITINT=""
-if test -z "$WFLAGS" -a "$GCC" = "yes"; then
- # -Wno-implicit-int for broken X11 headers
- # leave these out for now:
- # -Wcast-align doesn't work well on alpha osf/1
- # -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast
- # -Wmissing-declarations -Wnested-externs
- WFLAGS="ifelse($#, 0,-Wall, $1)"
- WFLAGS_NOUNUSED="-Wno-unused"
- WFLAGS_NOIMPLICITINT="-Wno-implicit-int"
-fi
-AC_SUBST(WFLAGS)dnl
-AC_SUBST(WFLAGS_NOUNUSED)dnl
-AC_SUBST(WFLAGS_NOIMPLICITINT)dnl
-])
diff --git a/usr.sbin/afs/src/conf/CellServDB b/usr.sbin/afs/src/conf/CellServDB
deleted file mode 100644
index 725cbb4c0a2..00000000000
--- a/usr.sbin/afs/src/conf/CellServDB
+++ /dev/null
@@ -1,728 +0,0 @@
->wu-wien.ac.at # University of Economics, Vienna, Austria
-137.208.3.33 #afsdb1.wu-wien.ac.at
-137.208.7.4 #afsdb2.wu-wien.ac.at
-137.208.7.7 #afsdb3.wu-wien.ac.at
->hephy.at # hephy-vienna
-193.170.243.10 #mougli.oeaw.ac.at
-193.170.243.12 #balu.oeaw.ac.at
->glade.yorku.ca #York U, Canada
-130.63.241.16 #aqua.glade.yorku.ca
->writer.yorku.ca #York U, Canada
-130.63.1.2 #writer.yorku.ca
->cern.ch # European Laboratory for Particle Physics, Geneva
-137.138.128.148 #afsdb1.cern.ch
-137.138.246.50 #afsdb3.cern.ch
-137.138.246.51 #afsdb2.cern.ch
->ethz.ch # Swiss Federal Inst. of Tech. - Zurich, Switzerland
-129.132.98.25 #himalia.ethz.ch
-129.132.76.2 #charon.ethz.ch
-129.132.98.68 #nereide.ethz.ch
->zurich.ibm.ch # IBM Zurich Internet Cell
-193.5.61.131 #uetliberg.zurich.ibm.ch
->atc.alcoa.com #Alcoa Technical Center
-132.226.16.174 #cjm-amct.atc.alcoa.com
-132.226.16.16 #afs1-amct.atc.alcoa.com
-132.226.16.17 #afs2-amct.atc.alcoa.com
->rtp.avanticorp.com #foo
-192.160.17.221 #i
-192.160.17.222 #dont
-192.160.17.223 #know
->cards.com # Cards - Electronic Warfare Associates
-192.133.70.11 #gofish.cards.com
-192.133.70.2 #dealer.cards.com
-192.133.70.4 #solitaire.cards.com
->gza.com #GZA - Geer Zolot Associates cell
-192.231.148.28 #mary-chungs.gza.com
->palo_alto.hpl.hp.com # HP Palo Alto
-15.255.176.10 #pub.hpl.hp.com
->sleeper.nsa.hp.com #HP Cupertino
-15.255.88.33 #telford.nsa.hp.com
->afs.hursley.ibm.com # IBM Hursley, UK (external cell)
-194.196.110.156 #sp2tr6.hursley.ibm.com
->ctp.se.ibm.com # IBM/4C, Chalmers, Sweden
-192.36.23.71 #ritchie.ctp.se.ibm.com
->mtxinu.com #mt Xinu Incorporated
-131.106.1.22 #kineo.mtxinu.com
->munin.com #Munin Systems, Inc.
-192.131.124.100 #raven.munin.com
->qualcomm.com #qualcomm
-129.46.50.67 #afs-q1.qualcomm.com
-129.46.50.68 #afs-q2.qualcomm.com
-129.46.50.69 #afs-q3.qualcomm.com
->stars.com # STARS Technology Center - Ballston, Va.
-128.126.164.2 #falcon.stars.ballston.paramax.com
->telos.com # Telos Systems Group - Chantilly, Va.
-198.116.7.53 #tis.telos.com
->transarc.com # Transarc Corporation
-192.54.226.60 #xafs1.transarc.com
-192.54.226.61 #xafs2.transarc.com
-192.54.226.62 #xafs3.transarc.com
->mandos.dce.transarc.com #Transarc DCE cell
-158.98.7.205 #testlab-7-205.transarc.com
->test.transarc.com #Transarc Corporation test cell
-192.55.207.5 #barley.transarc.com
->usenix.transarc.com #Transarc Corporation demo cell
-192.55.207.101 #afssun.transarc.com
->stars.reston.unisys.com # Paramax (Unisys) - Reston, Va.
-128.126.162.1 #aviary.stars.reston.paramax.com
->afs.brain.de #BeSD on Berlin Research and Information Network (BRAIN)
-130.73.72.84 #zibsw1.brain.de
-130.73.72.85 #zibsw2.brain.de
-130.73.103.29 #zibsw3.brain.de
->desy.de # Deutsches Elektronen-Synchrotron
-131.169.30.50 #rikki.desy.de
-131.169.55.19 #shiva.desy.de
-131.169.244.60 #solar00.desy.de
->dkrz.de #Deutsches Klimarechenzentrum Hamburg
-136.172.110.215 #donau.dkrz.de
-136.172.110.81 #rhein.dkrz.de
-136.172.100.16 #elbe.dkrz.de
->fh-heilbronn.de #Fachhochschule Heilbronn
-141.7.1.40 #jupiter.rz.fh-heilbronn.de
->ifh.de # DESY-IfH Zeuthen
-141.34.100.32 #moira.ifh.de
-141.34.1.29 #hekate.ifh.de
->lrz-muenchen.de # Leibniz-Rechenzentrum Muenchen Germany
-129.187.10.36 #afs1.lrz-muenchen.de
-129.187.14.10 #afs3.lrz-muenchen.de
-129.187.14.12 #afs2.lrz-muenchen.de
->ipp-garching.mpg.de #Institut fuer Plasmaphysik
-130.183.9.5 #afs-serv1.ipp-garching.mpg.de
-130.183.100.10 #spinf.aug.ipp-garching.mpg.de
-130.183.100.23 #s30l6s3.aug.ipp-garching.mpg.de
->ipp-hgw.mpg.de #IPP site at Greifswald
-194.94.214.4 #greif-01.ipp-hgw.mpg.de
->mpa-garching.mpg.de # Max-Planck-Institut fuer Astrophysik
-130.183.83.31 #ibm-1.mpa-garching.mpg.de
-130.183.83.32 #ibm-2.mpa-garching.mpg.de
-130.183.83.33 #ibm-3.mpa-garching.mpg.de
->hrzone.th-darmstadt.de # TH-Darmstadt
-130.83.126.5 #rs25.hrz.th-darmstadt.de
-130.83.126.8 #rs102.hrz.th-darmstadt.de
-130.83.22.3 #rs100.hrz.th-darmstadt.de
->tu-chemnitz.de # Technische Universitaet Chemnitz-Zwickau, Germany
-134.109.2.1 #zuse-f.hrz.tu-chemnitz.de
-134.109.200.7 #aetius.hrz.tu-chemnitz.de
-134.109.2.15 #phoenix.hrz.tu-chemnitz.de
->thermo-a.mw.tu-muenchen.de # Lehrstuhl A fuer Thermodynamik,TUM
-129.187.110.38 #nusselt.thermo-a.mw.tu-muenchen.de
->uni-bonn.de # Rheinische Friedrich Wilhelm Univesitaet Bonn
-131.220.16.10 # work1.rhrz.uni-bonn.de
-131.220.16.60 # work2.rhrz.uni-bonn.de
->uni-freiburg.de # Albert-Ludwigs-Universitat Freiburg
-132.230.7.21 #afs1.ruf.uni-freiburg.de
-132.230.7.22 #afs2.ruf.uni-freiburg.de
-132.230.7.23 #afs3.ruf.uni-freiburg.de
->urz.uni-heidelberg.de # Universitaet Heidelberg
-129.206.119.10 #afsdb.urz.uni-heidelberg.de
-129.206.119.16 #afsdb1.urz.uni-heidelberg.de
-129.206.119.17 #afsdb2.urz.uni-heidelberg.de
->uni-hohenheim.de # University of Hohenheim
-144.41.2.2 #rs13.serv.uni-hohenheim.de
-144.41.2.3 #rs14.serv.uni-hohenheim.de
-144.41.2.4 #rs15.serv.uni-hohenheim.de
->rz.uni-jena.de # Rechenzentrum University of Jena, Germany
-141.35.4.66 #fsuj01.rz.uni-jena.de
-141.35.4.21 #fsuj70.rz.uni-jena.de
->rhrk.uni-kl.de # Rechenzentrum University of Kaiserslautern
-131.246.137.10 #aix10.rhrk.uni-kl.de
-131.246.137.11 #aix11.rhrk.uni-kl.de
-131.246.137.9 #aix9.rhrk.uni-kl.de
->geo.uni-koeln.de # Univ. of Cologne - Inst. for Geophysics & Meteorology
-134.95.160.10 #trick.geo.uni-koeln.de
-134.95.160.11 #track.geo.uni-koeln.de
-134.95.164.120 #helferlein.geo.uni-koeln.de
-134.95.164.124 #majestix.geo.uni-koeln.de
-134.95.180.94 #nimbus.geo.uni-koeln.de
->meteo.uni-koeln.de # Univ. of Cologne - Inst. for Geophysics & Meteorology
-134.95.144.200 #bora.meteo.uni-koeln.de
-134.95.144.208 #monsun.meteo.uni-koeln.de
-134.95.144.213 #brise.meteo.uni-koeln.de
->rrz.uni-koeln.de # University of Cologne - Reg Comp Center
-134.95.100.212 #rs2.rrz.uni-koeln.de
-134.95.19.3 #afsdb1.rrz.uni-koeln.de
-134.95.100.220 #fileserv2.rrz.uni-koeln.de
-134.95.140.208 #dec01.rrz.uni-koeln.de
-134.95.67.97 #afs.thp.uni-koeln.de
->urz.uni-magdeburg.de # Otto-von-Guericke-Universitaet, Magdeburg
-141.44.7.6 #lem.urz.uni-magdeburg.de
-141.44.8.14 #bowles.urz.uni-magdeburg.de
-141.44.13.5 #strugazki.urz.uni-magdeburg.de
->zdv.uni-mainz.de # Johannes-Gutenberg-Universitaet Mainz
-134.93.8.13 #kingluey.zdv.Uni-Mainz.DE
-134.93.8.169 #alice.zdv.Uni-Mainz.DE
-134.93.178.127 #donald.zdv.Uni-Mainz.DE
->uni-mannheim.de #Uni Mannheim (Rechenzentrum)
-134.155.50.37 #afsdb1.uni-mannheim.de
-134.155.50.38 #afsdb2.uni-mannheim.de
-134.155.50.40 #afsdb3.uni-mannheim.de
->cipool.uni-stuttgart.de #CIP Pool, Rechenzentrum University of Stuttgart
-129.69.21.12 #zeus.rus.uni-stuttgart.de
->dce.uni-stuttgart.de #University of Stuttgart - DCE/DFS Cell
-129.69.1.170 #jupiter.rus.uni-stuttgart.de
-129.69.18.29 #uranus.rus.uni-stuttgart.de
-129.69.18.30 #saturn.rus.uni-stuttgart.de
-129.69.3.34 #fortuna.rus.uni-stuttgart.de
->csv.ica.uni-stuttgart.de #Institut fuer Computeranwendungen, Universitaet Stuttgart
-129.69.118.12 #iris8.csv.ica.uni-stuttgart.de
->ihf.uni-stuttgart.de # University of Stuttgart, Institut fuer Hochfrequenz-Tec
-129.69.95.103 #ihfrs3.ihf.uni-stuttgart.de
-129.69.95.105 #ihfrs5.ihf.uni-stuttgart.de
->ike.uni-stuttgart.de #Institut fuer Kernenergetik, Universitaet Stuttgart
-129.69.25.100 #ikedc1.ike.uni-stuttgart.de
->mathematik.uni-stuttgart.de # University of Stuttgart, Math Dept.
-129.69.116.32 #maxwell.mathematik.uni-stuttgart.de
-129.69.116.33 #hopf.mathematik.uni-stuttgart.de
-129.69.116.34 #kolmogorov.mathematik.uni-stuttgart.de
->mathematik-cip.uni-stuttgart.de # CIP-Pool of Math. Dept, University of Stuttgart
-129.69.116.100 #cip00.mathematik.uni-stuttgart.de
-129.69.116.101 #cip01.mathematik.uni-stuttgart.de
-129.69.116.102 #cip02.mathematik.uni-stuttgart.de
->rus.uni-stuttgart.de # Rechenzentrum University of Stuttgart
-129.69.1.155 #servus05.rus.uni-stuttgart.de
-129.69.18.216 #servus16.rus.uni-stuttgart.de
-129.69.3.4 #syssrv1.rus.uni-stuttgart.de
->belwue.uni-tuebingen.de #ZDV Universitaet Tuebingen
-134.2.2.15 #belwue1.zdv.uni-tuebingen.de
-134.2.2.117 #belwue2.zdv.uni-tuebingen.de
->biocenter.helsinki.fi # Univ of Helsinki, Institute of Biotechnology, Finland
-128.214.58.174 # afsdb1.biocenter.helsinki.fi
-128.214.88.114 # afsdb2.biocenter.helsinki.fi
->zdvpool.uni-tuebingen.de # Eberhard-Karls-Universitaet Tuebingen, WS-Pools
-134.2.4.1 #aixserv1.zdv.uni-tuebingen.de
->cs.arizona.edu # University of Arizona - Computer Science Dept.
-192.12.69.8 #benguiat.cs.arizona.edu
->asu.edu # ASU
-129.219.10.69 #authen2.asu.edu
-129.219.10.70 #authen1.asu.edu
->cs.brown.edu # Brown University Department of Computer Science
-128.148.37.20 #monk.cs.brown.edu
->bu.edu # Boston University
-128.197.27.12 #software2.bu.edu
-128.197.27.6 #software3.bu.edu
-128.197.27.15 #ns2.bu.edu
-128.197.27.92 #ns4.bu.edu
->gg.caltech.edu # Caltech Computer Graphics Group
-131.215.129.25 #meagger.gg.caltech.edu
->cmu.edu # Carnegie Mellon University
-128.2.206.46 #cmu2.cs.cmu.edu
-128.2.35.186 #cmu1.acs.cmu.edu
->andrew.cmu.edu # Carnegie Mellon University - Campus
-128.2.10.11 #vice11.fs.andrew.cmu.edu
-128.2.10.12 #vice12.fs.andrew.cmu.edu
-128.2.10.2 #vice2.fs.andrew.cmu.edu
-128.2.10.28 #vice28.fs.andrew.cmu.edu
-128.2.10.7 #vice7.fs.andrew.cmu.edu
->club.cc.cmu.edu # Carnegie Mellon University Computer Club
-128.2.4.131 #yttrium.club.cc.cmu.edu
-128.2.4.132 #zirconium.club.cc.cmu.edu
->ce.cmu.edu # Carnegie Mellon University - Civil Eng. Dept.
-128.2.231.39 #newmark.ce.cmu.edu
->cheme.cmu.edu # Carnegie Mellon Univ. Chemical Engineering Dept.
-128.2.55.30 #cheme.cmu.edu
->cs.cmu.edu # Carnegie Mellon University - School of Comp. Sci.
-128.2.206.130 #cucumber.srv.cs.cmu.edu
-128.2.222.199 #papaya.srv.cs.cmu.edu
-128.2.242.86 #lemon.srv.cs.cmu.edu
->test.cs.cmu.edu #Test Cell-CMU SCS
-128.2.209.214 #blackberry.srv.cs.cmu.edu
-128.2.222.221 #chokeberry.srv.cs.cmu.edu
-128.2.250.251 #honeydew.srv.cs.cmu.edu
->ece.cmu.edu # Carnegie Mellon University - Elec. Comp. Eng. Dept.
-128.2.129.7 #porok.ece.cmu.edu
-128.2.129.8 #vicio.ece.cmu.edu
-128.2.129.9 #e-xing.ece.cmu.edu
->me.cmu.edu # Carnegie Mellon University - Mechanical Engineering
-128.2.62.3 #edison.me.cmu.edu
->haycorn.psy.cmu.edu #CMU Psy Test cell
-128.2.248.86 #haycorn.psy.cmu.edu
->msc.cornell.edu #Cornell University Materials Science Center
-128.84.231.242 #miranda.ccmr.cornell.edu
-128.84.241.35 #co.ccmr.cornell.edu
-128.84.249.78 #dax.ccmr.cornell.edu
->kiewit.dartmouth.edu # Dartmouth College, Kiewit
-129.170.16.42 #northservc.dartmouth.edu
->northstar.dartmouth.edu #Dartmouth College, Project Northstar
-129.170.16.22 #halley.dartmouth.edu
-129.170.16.42 #oort.dartmouth.edu
-129.170.16.43 #cygnusx1.dartmouth.edu
->acpub.duke.edu #Duke academic computing (clusters)
-152.3.233.4 #clarke.acpub.duke.edu
-152.3.233.5 #delany.acpub.duke.edu
-152.3.233.6 #ellison.acpub.duke.edu
->afs1.scri.fsu.edu # Supercomputer Computations Research Instit
-144.174.128.60 #afs1.scri.fsu.edu
->iastate.edu # Iowa State University
-129.186.1.243 #afsdb-1.iastate.edu
-129.186.6.243 #afsdb-2.iastate.edu
-129.186.142.243 #afsdb-3.iastate.edu
->isi.edu # University of Southern California/ISI
-128.9.208.78 #afs.isi.edu
->cc.lehigh.edu #lehigh
-128.180.1.3 #fs1.CC.Lehigh.EDU
-128.180.1.26 #fs2.CC.Lehigh.EDU
-128.180.1.37 #fs3.CC.Lehigh.EDU
->cva.ai.mit.edu #MIT/private Concurrent VLSI Architecture Group
-128.52.36.20 #raisin-scone.ai.mit.edu.
->brain.mit.edu #MIT/private Brain & Cognitive Sciences
-128.52.32.25 #www-douzzer.ai.mit.edu.
->threede.mit.edu #MIT/private 3DES AFS testing cell
-18.177.0.130 #twode.mit.edu.
->athena.mit.edu #MIT/Athena cell
-18.158.0.37 #prill.mit.edu.
-18.145.0.25 #agamemnon.mit.edu.
-18.7.1.66 #paris.mit.edu
->dev.mit.edu #MIT/IS Development cell
-18.7.1.70 #wham.mit.edu.
-18.86.0.50 #hum.mit.edu
-18.7.15.89 #rattle.mit.edu
->lees.mit.edu #MIT/Lab for Electromagnetic and Electronic Systems
-18.90.1.184 #power.mit.edu
->ops.mit.edu #MIT/Athena Ops Group cell
-18.7.14.107 #bitterness.mit.edu.
-18.7.14.108 #heartbreak.mit.edu.
-18.7.14.109 #despair.mit.edu.
->net.mit.edu #MIT/Network Group cell
-18.72.1.38 #gracie.mit.edu.
-18.72.0.26 #cetus.mit.edu.
->sipb.mit.edu # MIT/SIPB cell
-18.181.0.19 #reynelda.mit.edu
-18.181.0.22 #rosebud.mit.edu
-18.181.0.23 #ronald-ann.mit.edu
->zone.mit.edu #MIT/Watchmaker Zone cell
-18.18.0.229 #casio.mit.edu
-18.18.0.231 #timex.mit.edu
-18.18.0.232 #seiko.mit.edu
->msu.edu #Michigan State University home cell
-35.9.7.10 #afsdb0.cl.msu.edu
-35.9.7.11 #afsdb1.cl.msu.edu
-35.9.7.12 #afsdb2.cl.msu.edu
->ncat.edu # North Carolina Agricultural and Technical State Univ
-152.8.244.141 #afsserv1.ncat.edu
-152.8.244.142 #afsserv2.ncat.edu
-152.8.244.143 #afsserv3.ncat.edu
->bp.ncsu.edu #North Carolina State University - Backbone Prototype
-152.1.1.27 #tourian.cc.ncsu.edu
-152.1.1.28 #norfair.cc.ncsu.edu
-152.1.1.29 #maridia.cc.ncsu.edu
->catt.ncsu.edu #NCSU - Computer and Technologies Theme Program
-152.1.43.33 #nermal.catt.ncsu.edu
->eos.ncsu.edu #NCSU - College of Engineering
-152.1.9.3 #eos05f.eos.ncsu.edu
-152.1.19.3 #eos02b.eos.ncsu.edu
-152.1.29.3 #eos03b.eos.ncsu.edu
->tx.ncsu.edu #NCSU College of Textiles - Project Eos&Unity Mutant
-152.1.39.7 #sparc3.tx.ncsu.edu
->unity.ncsu.edu #NCSU Campus
-152.1.1.36 #cc00db.unity.ncsu.edu
-152.1.1.37 #cc01db.unity.ncsu.edu
-152.1.1.38 #cc02db.unity.ncsu.edu
->zorglub.ncsu.edu #NCSU Experimental Cell
-152.1.9.80 #borg.eos.ncsu.edu
->nd.edu # University of Notre Dame
-129.74.223.17 #john.helios.nd.edu
-129.74.223.33 #lizardo.helios.nd.edu
-129.74.223.65 #buckaroo.helios.nd.edu
->pitt.edu # University of Pittsburgh
-136.142.8.15 #afs09.srv.cis.pitt.edu
-136.142.8.20 #afs10.srv.cis.pitt.edu
-136.142.8.21 #afs11.srv.cis.pitt.edu
->cs.pitt.edu #University of Pittsburgh - Computer Science
-136.142.79.3 #lurch.cs.pitt.edu
->discovery.pitt.edu #University of Pittsburgh Test Cell
-130.49.254.49 #server1.discovery.pitt.edu
->med.pitt.edu #Office of Biomedical Informatics, UPitt
-150.212.5.1 #mimas.sv.med.pitt.edu
-150.212.5.2 #titan.sv.med.pitt.edu
->psc.edu # PSC (Pittsburgh Supercomputing Center)
-128.182.59.182 #shaggy.psc.edu
-128.182.66.184 #velma.psc.edu
-128.182.66.185 #daphne.psc.edu
->big.psc.edu #PSC max strat
-128.182.62.231 #max.psc.edu
->huge.psc.edu #PSC Max Strat server
-128.182.73.94 #utnapishtim-f.psc.edu
->slow.psc.edu #PSC slow cell for Cray testing
-128.182.62.222 #pele.psc.edu
->test.psc.edu #PSC Performance Evaluation
-128.182.66.71 #afsrv2.psc.edu
->psu.edu # Penn State
-128.118.2.5 #spot.cac.psu.edu
->cac.psu.edu #Penn State University CAC Cluster
-128.118.57.4 #camaton.cac.psu.edu
-146.186.125.1 #sundae.hbc.psu.edu
->rose-hulman.edu # Rose-Hulman Institute of Technology
-137.112.7.11 #afs1.rose-hulman.edu
-137.112.7.12 #afs2.rose-hulman.edu
-137.112.7.13 #afs3.rose-hulman.edu
->cs.rose-hulman.edu # Rose-Hulman Inst. of Tech., CS Department
-137.112.40.5 #afs1.cs.rose-hulman.edu
->rpi.edu #Rensselaer Polytechnic Institute
-128.113.100.31 #asher.its.rpi.edu
-128.113.100.34 #samuel.sss.rpi.edu
-128.113.100.36 #samson.its.rpi.edu
-128.113.100.100 #nebuchadnezzar.its.rpi.edu
->ifs.rpi.edu #RPI IFS cell
-128.113.26.81 # ifsserver.its.rpi.edu
->dsg.stanford.edu # Stanford Univ. - Comp. Sci. - Distributed Systems
-36.18.0.243 #greyhawk.stanford.edu
-36.18.0.69 #lahaina.stanford.edu
-36.18.0.8 #pescadero.stanford.edu
->ir.stanford.edu # Stanford University
-171.64.7.222 #afsdb1.stanford.edu
-171.64.7.234 #afsdb2.stanford.edu
-171.64.7.246 #afsdb3.stanford.edu
->olympia.stanford.edu # Stanford DECathena AFS cell - local
-36.53.0.106 #olympia.stanford.edu
->slac.stanford.edu # Stanford Linear Accelerator Center
-134.79.18.25 #afsdb1.slac.stanford.edu
-134.79.18.26 #afsdb2.slac.stanford.edu
-134.79.18.27 #afsdb3.slac.stanford.edu
->eng.uc.edu #u cincinnati eng
-129.137.40.8 #monster.occ.uc.edu
-129.137.40.130 #sputnik.occ.uc.edu
-129.137.40.100 #nfl.occ.uc.edu
->ece.ucdavis.edu # Univ California - Davis campus
-128.120.57.1 #clover.ece.ucdavis.edu
-128.120.57.135 #anaconda.ece.ucdavis.edu
-128.120.67.27 #vision.cipic.ucdavis.edu
->src.uchicago.edu # University of Chicago - Social Science Research Computing
-128.135.252.12 #silk.src.uchicago.edu
-128.135.252.13 #cotton.src.uchicago.edu
-128.135.252.14 #wool.src.uchicago.edu
->ucop.edu #University of California Office of the President
-128.48.141.2 #ganges.ucop.edu
-128.48.141.9 #holmes.ucop.edu
-128.48.108.39 #volga.ucop.edu
->cats.ucsc.edu #UC Santa Cruz, Comp and Tech Services, California U.S.A
-128.114.129.14 #elan.ucsc.edu
-128.114.129.15 #ichabod.ucsc.edu
-128.114.129.18 #maneki.ucsc.edu
->ncsa.uiuc.edu # University of Illinois
-141.142.230.19 #jinx.ncsa.uiuc.edu
-141.142.3.5 #congo.ncsa.uiuc.edu
-141.142.3.8 #nile.ncsa.uiuc.edu
->glue.umd.edu #University of Maryland - Project Glue
-129.2.70.82 #olmec.umd.edu
-128.8.10.21 #babylon.umd.edu
-129.2.128.53 #egypt.umd.edu
->wam.umd.edu # University of Maryland Network WAM Project
-128.8.70.9 #csc-srv.wam.umd.edu
-128.8.73.9 #pg2-srv.wam.umd.edu
-128.8.77.2 #wor-srv.wam.umd.edu
->umich.edu # University of Michigan - Campus
-141.211.1.32 #fear.ifs.umich.edu
-141.211.1.33 #surprise.ifs.umich.edu
-141.211.1.34 #ruthless.ifs.umich.edu
->citi.umich.edu # University of Michigan - IFS Development
-141.211.92.144 #babble.citi.umich.edu
->engin.umich.edu # University of Michigan - CAEN
-141.212.2.75 #artes.engin.umich.edu
-141.212.2.76 #scientia.engin.umich.edu
-141.212.2.77 #veritas.engin.umich.edu
->aix.ifs.umich.edu #University of Michigan - AIX (test)
-141.211.168.40 #ifsaix.ifs.umich.edu
->bigserv.ifs.umich.edu #University of Michigan - MVS (brich test)
-141.211.168.33 #barnone.ifs.umich.edu
->mvs.ifs.umich.edu #University of Michigan - MVS (test)
-141.211.168.41 #ifsaix.ifs.umich.edu
->lsa.umich.edu # University of Michigan - College of LS&A
-141.211.61.23 #zee.admin.lsa.umich.edu
-141.211.75.246 #jake.admin.lsa.umich.edu
-141.211.54.132 #curtis.admin.lsa.umich.edu
->math.lsa.umich.edu # University of Michigan - Math Department
-141.211.61.11 #patton.math.lsa.umich.edu
-141.211.62.11 #bradley.math.lsa.umich.edu
-141.211.62.12 #macarthur.math.lsa.umich.edu
->dmsv.med.umich.edu # University of Michigan - DMSV
-141.214.58.20 #pollock.dmsv.med.umich.edu
-141.214.58.21 #magritte.dmsv.med.umich.edu
-141.214.58.22 #kandinsky.dmsv.med.umich.edu
->sph.umich.edu # University of Michigan -- School of Public
-141.211.50.41 #afssph0.sph.umich.edu
->umr.edu # UMR - Missouri's Technological University
-131.151.1.59 #afs1.umr.edu
-131.151.1.70 #afs6.umr.edu
-131.151.1.146 #afs5.umr.edu
->cs.unc.edu # University of North Carolina at Chapel Hill
-152.2.128.1 #crow.cs.unc.edu
-152.2.128.2 #falcon.cs.unc.edu
-152.2.128.8 #thrush.cs.unc.edu
->isis.unc.edu #UNC campus computing
-152.2.25.120 #db0.isis.unc.edu
-152.2.25.121 #db1.isis.unc.edu
-152.2.25.122 #db2.isis.unc.edu
->oit.unc.edu #UNC OIT development cell
-152.2.22.11 #akbash.oit.unc.edu
->oit-miglab.unc.edu #UNC OIT test cell
-152.2.21.46 #daisy.oit.unc.edu
->utah.edu # University of Utah Information Tech. Service
-128.110.1.1 #its.utah.edu
-128.110.1.2 #its2.utah.edu
->cs.utah.edu # University of Utah Computer Science Dept
-128.110.2.50 #afs1.cs.utah.edu
-155.99.212.41 #afs2.cs.utah.edu
-155.99.222.104 #cadeserv.eng.utah.edu
->css.cs.utah.edu #University of Utah - CSS center
-155.99.212.102 #jensen.cs.utah.edu
-128.110.4.156 #fast.cs.utah.edu
->eng.utah.edu #University of Utah College of Engineering
-155.99.222.40 #afs1.eng.utah.edu
-155.99.222.41 #afs2.eng.utah.edu
->cs.washington.edu # University of Washington Comp Sci Department
-128.95.2.238 #silk.cs.washington.edu
-128.95.2.239 #satin.cs.washington.edu
-128.95.2.240 #lace.cs.washington.edu
->cs.wisc.edu # Univ. of Wisconsin-Madison, Computer Sciences Dept.
-128.105.132.14 #timon.cs.wisc.edu
-128.105.132.15 #pumbaa.cs.wisc.edu
-128.105.132.16 #zazu.cs.wisc.edu
->engr.wisc.edu # Univ. of Wisconsin-Madison, College of Engineering
-144.92.240.97 #afs1.cae.wisc.edu
-144.92.240.98 #afs2.cae.wisc.edu
-144.92.240.99 #afs3.cae.wisc.edu
->dapnia.saclay.cea.fr #Axlan-CEA
-132.166.32.7 #dphrsg.saclay.cea.fr
->in2p3.fr #IN2P3 production cell
-134.158.232.11 #ccafsdb1.in2p3.fr
-134.158.232.12 #ccafsdb2.in2p3.fr
-134.158.232.13 #ccafsdb3.in2p3.fr
->mcc.ac.gb #University of Manchester
-130.88.203.11 #cfs1.mcc.ac.uk
-130.88.203.12 #cfs2.mcc.ac.uk
-130.88.203.14 #zeus.mcc.ac.uk
->anl.gov # Argonne National Laboratory
-146.137.162.88 #agamemnon.ctd.anl.gov
-146.137.96.33 #arteus.ctd.anl.gov
-146.137.194.80 #antenor.ctd.anl.gov
->fl.mcs.anl.gov # Argonne National Laboratory MCS Division FL
-140.221.32.92 #barge.mcs.anl.gov
->bnl.gov # Brookhaven National Laboratory
-130.199.54.21 #afs1.ccd.bnl.gov
->phy.bnl.gov # Physics Deptpartment, Brookhaven National Lab
-130.199.80.126 #h0h08.rhic.bnl.gov
->fnal.gov # Fermi National Acclerator Laboratory
-131.225.68.1 #fsus01.fnal.gov
-131.225.68.14 #fsus04.fnal.gov
-131.225.68.4 #fsus03.fnal.gov
->inel.gov #Idaho National Engineering Lab
-134.20.8.7 #mica.inel.gov
->jpl.nasa.gov # Jet Propulsion Laboratory
-137.78.160.21 #afsdb08.jpl.nasa.gov
-137.78.160.22 #afsdb09.jpl.nasa.gov
-137.78.160.23 #afsdb10.jpl.nasa.gov
->nersc.gov # National Energy Research Supercomputer Center
-128.55.128.250 #mars.nersc.gov
-128.55.128.252 #alfred.nersc.gov
-128.55.128.254 #lurch.nersc.gov
->alw.nih.gov # National Institutes of Health
-137.187.114.10 #vice1.alw.nih.gov
-137.187.114.11 #vice3.alw.nih.gov
-137.187.114.15 #vice7.alw.nih.gov
->nrel.gov #National Renewable Energy Laboratory
-192.33.19.104 #syssrv4.nrel.gov
-192.174.52.125 #sst.nrel.gov
-199.117.159.87 #syssrv7.nrel.gov
->dce.emsl.pnl.gov # EMSL's DCE Cell
-198.128.85.133 #tomcat.emsl.pnl.gov
-198.128.85.135 #hellcat.emsl.pnl.gov
-198.128.85.136 #bearcat.emsl.pnl.gov
->msrc.pnl.gov #EMSL's AFS Cell
-198.128.85.251 #castors.emsl.pnl.gov
-198.128.85.252 #polluxs.emsl.pnl.gov
-198.128.85.253 #rosebuds.emsl.pnl.gov
->pppl.gov # Princeton Plasma Physics Laboratory
-198.35.4.70 #lyman.pppl.gov
-198.35.6.44 #draco.pppl.gov
->controls.ssc.gov #Superconducting Supercollider Lab
-134.3.45.30 #psychosis.ssc.gov
->nersc.test.gov #NERSC test cell
-128.55.128.239 #jupiter.nersc.gov
->caspur.it # CASPUR Inter-University Computing Consortium, Rome
-193.204.5.45 #pomodoro.caspur.it
-193.204.5.46 #banana.caspur.it
-193.204.5.50 #maslo.caspur.it
->le.caspur.it # Universita' di Lecce, Italia
-192.84.152.40 #afs1.le.infn.it
->infn.it #Istituto Nazionale di Fisica Nucleare, Italia
-131.154.1.7 #afs1.infn.it
-141.108.3.252 #afs2.infn.it
-192.84.134.75 #afs3.infn.it
->le.infn.it # INFN, Sezione di Lecce, Italia
-192.84.152.37 #aixserver.le.infn.it
->lngs.infn.it # INFN, Laboratori Nazionali di Gran Sasso, Italia
-192.84.135.3 #rsgs02.lngs.infn.it
->pi.infn.it # INFN Sezione di Pisa
-192.84.133.7 #aix.pi.infn.it
-192.84.133.50 #aix1.pi.infn.it
->dis.uniroma1.it # DIS, Univ. "La Sapienza", Rome, area Buonarotti
-151.100.5.21 #peano.dis.uniroma1.it
-151.100.16.9 #viola.dis.uniroma1.it
-151.100.16.36 #rosa.dis.uniroma1.it
->spv.uniroma1.it # Universita' La Sapienza, area SPV, Roma, Italia
-151.100.39.2 #aurea.ing.uniroma1.it
->vn.uniroma3.it # University of Rome 3, Area Vasca Navale, Italy
-193.204.162.11 #euclide.inf.uniroma3.it
->cc.keio.ac.jp # Keio University, Faculty of Science and Technology Computing Center
-131.113.1.21 #afs0.cc.keio.ac.jp
-131.113.191.21 #afs0.med.keio.ac.jp
-131.113.192.21 #afs0.mita.keio.ac.jp
-131.113.224.21 #afs0.hc.keio.ac.jp
->sfc.keio.ac.jp # Keio University, Japan
-133.27.68.82 #afs2.sfc.keio.ac.jp
->isl.ntt.jp # NTT Information and Communication Systems Labs.
-129.60.67.15 #mx.isl.ntt.jp
-129.60.105.29 #dufour.isl.ntt.jp
->rwcp.or.jp # Real World Computer Partnership(rwcp)
-163.220.1.2 #fs1.trc.rwcp.or.jp
-163.220.1.4 #fs3.trc.rwcp.or.jp
-163.220.1.6 #fs2.trc.rwcp.or.jp
->postech.ac.kr # Pohang University of Science and Technology, Korea
-141.223.7.71 # xafs-fs1.postech.ac.kr
-141.223.7.72 # xafs-fs2.postech.ac.kr
-141.223.7.73 # xafs-fs3.postech.ac.kr
->ait.nrl.navy.mil #Naval Research Lab
-132.250.128.19 #intrepid.ait.nrl.navy.mil
->cmf.nrl.navy.mil # Naval Research Lab - CCS
-134.207.10.68 #picard.cmf.nrl.navy.mil
-134.207.10.69 #riker.cmf.nrl.navy.mil
-134.207.10.70 #kirk.cmf.nrl.navy.mil
->lcp.nrl.navy.mil # Naval Research Lab - Lab for Computational Physics
-132.250.116.39 #ernie.lcp.nrl.navy.mil
-132.250.116.48 #bert.lcp.nrl.navy.mil
-132.250.116.41 #orange.lcp.nrl.navy.mil
->nrlfs1.nrl.navy.mil # Naval Research Lab - CCS
-132.250.118.3 #nrlfs1.nrl.navy.mil
->vl.nrl.navy.mil #Vis Lab CCS/ITD/NRL
-132.250.110.101 #ohm.nrl.navy.mil
-132.250.110.108 #nimitz.nrl.navy.mil
->invermexico.com.mx #fucking
-185.134.80.59 #firewalls
->mty.itesm.mx #?
-131.178.4.4 #academ07.mty.itesm.mx
-131.178.4.17 #academ03.mty.itesm.mx
-131.178.4.18 #academ06.mty.itesm.mx
->nce_sdsc #San Diego Supercomputer Center
-132.249.51.100 #osprey.sdsc.edu
-132.249.20.59 #anxiety-closet.sdsc.edu
->federation.atd.net # Multi Resident AFS at Naval Research Lab - CCS
-134.207.10.40 #federation.cmf.nrl.navy.mil
->huge.wabit.atd.net #Wabit cell
-134.207.12.37 #hades.cmf.nrl.navy.mil
->es.net # Energy Sciences Net
-198.128.3.21 #fs1.es.net
-198.128.3.22 #fs2.es.net
-198.128.3.23 #fs3.es.net
->hep.net # US High Energy Physics Information cell
-131.225.110.11 #hepnrc.hep.net
->cert.org #CERT/Coordination Center
-192.88.210.121 #fs1.cert.org
-192.88.210.122 #fs2.cert.org
-192.88.210.123 #fs3.cert.org
->ciesin.org # CIESIN
-160.39.8.90 #afsdb0.ciesin.org
->research.ec.org # Esprit Research Network of Excellence
-128.240.150.111 #albion.ncl.ac.uk
-130.89.181.106 #cabernet.pegasus.esprit.ec.org
-140.93.13.7 #sauterne.laas.fr
->iway.org # I-WAY - Information Wide Area Year
-128.84.152.60 #myway.tc.cornell.edu
->dce.osf.org #OSF DCE cell
-130.105.4.17 #maalox.osf.org
->gr.osf.org # OSF Research Institute, Grenoble
-130.105.64.17 #tallien.gr.osf.org
-130.105.64.40 #cobra.gr.osf.org
-130.105.64.9 #barere.gr.osf.org
->ri.osf.org # OSF Research Institute
-130.105.3.23 #riafs1.osf.org
-130.105.3.24 #riafs5.osf.org
-130.105.3.25 #riafs6.osf.org
->syseng.osf.org #OSF cell used to be ap.mit.edu
-130.105.36.2 #csserver.osf.org
->thekeep.org #Dan Root
-128.2.35.108 #afs.thekeep.org
->rhic #Relativistic Heavy Ion Collider
-130.199.6.69 #rafs01.rcf.bnl.gov
-130.199.6.52 #rafs02.rcf.bnl.gov
-130.199.6.51 #rafs03.rcf.bnl.gov
->others.chalmers.se # Chalmers University of Technology - General users
-129.16.19.11 #vice1.utc.chalmers.se
-129.16.19.12 #vice2.utc.chalmers.se
-129.16.20.156 #fibbla.ce.chalmers.se
-129.16.97.44 #idun.phc.chalmers.se
->alfvenlab.kth.se # Royal Institute of Technology, Alfvenlab
-130.237.47.56 #tatooine.fusion.kth.se
-130.237.47.9 #callisto.fusion.kth.se
->e.kth.se # Royal Institute of Technology, Elektro
-130.237.48.7 #anden.e.kth.se
-130.237.48.8 #sonen.e.kth.se
-130.237.48.244 #fadern.e.kth.se
->arla.e.kth.se # KTH, Elektro, Arla cell
->hallf.kth.se # Royal Institute of Technology, Solid Mechanics
-130.237.24.141 #rasmus13.hallf.kth.se
-130.237.24.152 #rasmus3.hallf.kth.se
->isk.kth.se # KTH College of Engineering
-130.237.206.13 #afsdb1.isk.kth.se
-130.237.202.12 #afsdb2.isk.kth.se
-130.237.209.141 #afsdb3.isk.kth.se
->it.kth.se # Royal Institute of Technology, IT
-130.237.212.15 #ptah.it.kth.se
-130.237.212.16 #toth.it.kth.se
-130.237.215.7 #isis.it.kth.se
->mech.kth.se # Royal Institute of Technology, MECH
-130.237.233.142 #eiger.mech.kth.se
->nada.kth.se # Royal Institute of Technology, NADA
-130.237.222.20 #kosmos.nada.kth.se
-130.237.223.12 #sputnik.nada.kth.se
-130.237.224.78 #mir.nada.kth.se
-130.237.227.23 #gagarin.nada.kth.se
-130.237.228.28 #laika.nada.kth.se
->pdc.kth.se # Royal Institute of Technology, PDC
-130.237.232.29 #crab.pdc.kth.se
-130.237.232.112 #anna.pdc.kth.se
-130.237.232.114 #hokkigai.pdc.kth.se
->stacken.kth.se # Stacken Computer Club, KTH, Sweden
-130.237.234.3 #milko.stacken.kth.se
-130.237.234.43 #hot.stacken.kth.se
-130.237.237.230 #fishburger.stacken.kth.se
->telge.kth.se # Royal Institute of Technology, Telge
-130.237.77.7 #gandalf.telge.kth.se
->admin.kth.se # Royal Institute of Technology, Admin
-130.237.32.19 #malvolio.admin.kth.se
->hpc2n.umu.se # High Performance Computer Center North
->bcc.ac.uk # Bloomsbury Computing Consortium
-128.40.101.3 #rs6-svr-3.cls-1.bcc.ac.uk
->athena.ox.ac.uk #Oxford cell
-129.67.42.91 #neon.athena.ox.ac.uk
-129.67.42.90 #krypton.athena.ox.ac.uk
->rl.ac.uk #Rutherford Appleton Lab, England
-130.246.15.135 #tinkerbel.cc.rl.ac.uk
-130.246.12.45 #isabel.cc.rl.ac.uk
-130.246.183.164 #wallace.cc.rl.ac.uk
->ibm.uk # IBM UK, AIX Systems Support Centre
-160.100.240.2 #affinity.aixssc.uk.ibm.com
->ualberta.ca # University of Alberta
-129.128.1.131 #file13.ucs.ualberta.ca
-129.128.98.17 #mystery.ucs.ualberta.ca
-129.128.125.40 #drake-en0.ucs.ualberta.ca
->theorie-fhi.mpg.de #Fritz-Haber-Institut Berlin, Theory Group
-141.14.64.1 #afs1.RZ-Berlin.MPG.DE
-141.14.64.4 #afs2.RZ-Berlin.MPG.DE
-141.14.136.93 #afs3.RZ-Berlin.MPG.DE
->informatik.uni-tuebingen.de #informatik, Universitaet Tuebingen
-134.2.12.2 #pu-afs.informatik.uni-tuebingen.de
-134.2.10.50 #ra-afs.informatik.uni-tuebingen.de
-134.2.14.2 #ti-afs1.informatik.uni-tuebingen.de
->ies.auc.dk # Aalborg Univ., Inst. of Electronic Systems, Denmark
-130.225.51.73 #afsdb1.kom.auc.dk
-130.225.51.74 #afsdb2.kom.auc.dk
->zepa.net #Kolya/zepa.net cell
->extundo.com # Simon Josefsson's cell
->dementia.org #Dementia Unlimited
->grand.central.org #GCO Public CellServDB 15 Feb 2002
->openafs.org #OpenAFS project
-128.2.121.218 #virtue.openafs.org
->dynarc.se # Dynarc
-62.65.1.17 #adder.dynarc.se
->su.se # Stockholm University
->lns.mit.edu #MIT/LNS Cell
diff --git a/usr.sbin/afs/src/conf/Makefile.in b/usr.sbin/afs/src/conf/Makefile.in
deleted file mode 100644
index 7f599fd3cf2..00000000000
--- a/usr.sbin/afs/src/conf/Makefile.in
+++ /dev/null
@@ -1,60 +0,0 @@
-# $KTH: Makefile.in,v 1.20 2000/10/08 06:20:42 lha Exp $
-
-srcdir = @srcdir@
-top_builddir = ..
-VPATH = @srcdir@
-
-SHELL = /bin/sh
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-ARLACACHEDIR = @ARLACACHEDIR@
-CHMOD = @chmod@
-
-prefix = @prefix@
-sysconfdir = @sysconfdir@
-
-CONF_FILES = CellServDB ThisCell arla.conf SuidCells
-
-all: arla.spec
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(ARLACACHEDIR)
- $(CHMOD) 700 $(DESTDIR)$(ARLACACHEDIR)
- $(MKINSTALLDIRS) $(DESTDIR)$(sysconfdir)
- @CONF_FILES='$(CONF_FILES)'; \
- for x in $$CONF_FILES; do \
- echo $(INSTALL_DATA) $(srcdir)/$$x $(DESTDIR)$(sysconfdir)/$$x.default; \
- $(INSTALL_DATA) $(srcdir)/$$x $(DESTDIR)$(sysconfdir)/$$x.default; \
- if test -f $(DESTDIR)$(sysconfdir)/$$x; then \
- echo "$@ will not overwrite $(DESTDIR)$(sysconfdir)/$$x"; \
- else \
- echo $(INSTALL_DATA) $(srcdir)/$$x $(DESTDIR)$(sysconfdir)/$$x; \
- $(INSTALL_DATA) $(srcdir)/$$x $(DESTDIR)$(sysconfdir)/$$x; \
- fi; \
- done
-
-uninstall:
- CONF_FILES='$(CONF_FILES)'; \
- for x in $$CONF_FILES; do \
- rm -f $(DESTDIR)$(sysconfdir)/$$x.default; \
- rm -f $(DESTDIR)$(sysconfdir)/$$x; \
- done
-
-clean :
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile
-
-realclean: distclean
-
-arla.spec: arla.spec.in ../config.status
- (cd .. ; CONFIG_FILES=conf/arla.spec CONFIG_HEADERS= $(SHELL) ./config.status)
-
-Makefile: Makefile.in ../config.status
- (cd .. ; CONFIG_FILES=conf/Makefile CONFIG_HEADERS= $(SHELL) ./config.status)
-
-.PHONY: all install uninstall clean mostlyclean distclean realclean
diff --git a/usr.sbin/afs/src/conf/SuidCells b/usr.sbin/afs/src/conf/SuidCells
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/usr.sbin/afs/src/conf/SuidCells
+++ /dev/null
diff --git a/usr.sbin/afs/src/conf/ThisCell b/usr.sbin/afs/src/conf/ThisCell
deleted file mode 100644
index 0f10dd24d2d..00000000000
--- a/usr.sbin/afs/src/conf/ThisCell
+++ /dev/null
@@ -1 +0,0 @@
-stacken.kth.se
diff --git a/usr.sbin/afs/src/conf/arla.conf b/usr.sbin/afs/src/conf/arla.conf
deleted file mode 100644
index 10ace4ed9c7..00000000000
--- a/usr.sbin/afs/src/conf/arla.conf
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Arla conffile
-#
-# $KTH: arla.conf,v 1.8 2000/09/12 07:22:42 lha Exp $
-#
-# The upper limit of (arlad) vnodes (think files and directories)
-# (high-water mark)
-#
-high_vnodes 4000
-#
-# The number of used vnodes we try to have
-# (low-water mark)
-#
-low_vnodes 3000
-#
-# The upper limit of bytes in the cache
-# (high-water mark)
-#
-high_bytes 100M
-#
-# The number of bytes we try to use
-# (low-water mark)
-#
-low_bytes 90M
-#
-# The number of credentials in arla, both unauthentic,
-# and authentic (like Kerberos V4 creds)
-#
-numcreds 100
-#
-# The maximum connections arla will have to all servers
-#
-numconns 100
-#
-# The number of volumes stored in cache.
-#
-numvols 100
-#
-# File priority, the describes how the cleaner process will clean out
-# files when set to a non-zero value. You might lose files that you
-# fell is important (and isn't marked with priority flag) when you are
-# in disconnected mode. You might not want to set this since then you'll
-# loose valuble diskspace for to `sticky' files.
-#
-fpriority 0
-#
-#
-# The End.
diff --git a/usr.sbin/afs/src/conf/arla.conf.in b/usr.sbin/afs/src/conf/arla.conf.in
deleted file mode 100644
index f8a43c395b4..00000000000
--- a/usr.sbin/afs/src/conf/arla.conf.in
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# Arlad config file
-#
-# $arla: arla.conf.in,v 1.2 2002/12/19 13:45:25 lha Exp $
-#
-# The upper limit of (arlad) vnodes (think files and directories)
-# (high-water mark)
-#
-high_vnodes @ARLA_CONF_HIGHVNODES@
-#
-# The number of used vnodes we try to have
-# (low-water mark)
-#
-low_vnodes @ARLA_CONF_LOWVNODES@
-#
-# The upper limit of bytes in the cache
-# (high-water mark)
-#
-high_bytes @ARLA_CONF_HIGHBYTES@
-#
-# The number of bytes we try to use
-# (low-water mark)
-#
-low_bytes @ARLA_CONF_LOWBYTES@
-#
-# The number of credentials in arla, both unauthentic,
-# and authentic (like Kerberos V4 creds)
-#
-numcreds 100
-#
-# The maximum connections arla will have to all servers
-#
-numconns 100
-#
-# The number of volumes stored in cache.
-#
-numvols 100
-#
-# Dynamic root, generates your /afs directory from CellServDB or
-# DynRootDB. Useful when you don't want to use your cell's root.afs.
-#
-#dynroot [yes|true|no|false]
-#
-# The sysname is possible to specify in the configuration file. Its
-# overridden by the command like argument --sysname=
-#
-#sysname nbsd_16pre
-#
-# Rxkad encryption level, this sets the minimum encryption level for
-# rxkad.
-#
-#rxkad-level [clear|auth|crypt]
-#
-# Fetch block size, this is the amount of the data that the
-# cachemanager will fetch more then the user requested. It used since
-# most new fileservers will have their peek fetch-rate larger then 64K
-# that is the default fetch block size.
-#
-#fetch_block 4M
-#
-#
-# The End.
diff --git a/usr.sbin/afs/src/conf/arla.spec.in b/usr.sbin/afs/src/conf/arla.spec.in
deleted file mode 100644
index 65f186e8cd3..00000000000
--- a/usr.sbin/afs/src/conf/arla.spec.in
+++ /dev/null
@@ -1,134 +0,0 @@
-#
-# $arla: arla.spec.in,v 1.5 2002/09/07 10:43:39 lha Exp $
-#
-# A spec file for build a arla rpm
-#
-# Build both smp and up modules for the current kernel
-#
-# Puts the configurationfiles in /etc/arla
-#
-# Note: it doesn't create the ThisCell file you have to
-# do that yourself.
-#
-#
-%define version @VERSION@
-%define prefix @prefix@
-
-Summary: A free AFS clone
-Name: arla
-
-Version: %{version}
-Release: 1
-Copyright: BSD
-
-Source: ftp.stacken.kth.se:/pub/arla/snap/arla-%{version}.tar.gz
-Group: System Environment/Daemons
-Distribution: Arla
-Vendor: KTH
-URL: http://www.stacken.kth.se/projekt/arla/
-
-BuildRoot: /var/tmp/arla-%{version}-%{release}-root
-Prefix: %{prefix}
-
-Provides: arla
-
-%description
-A free implementation of AFS
-
-%changelog
-
-* Wed Sep 20 2000 <lha@stacken.kth.se>
- Cleaned some
-
-* Thu Jan 21 2000 <lha@s3.kth.se>
- Added to distribution
-
-* Thu Jan 21 2000 <lha@s3.kth.se>
- arla 0.30
-
-* Thu Dec 16 1999 <lha@s3.kth.se>
- arla 0.29.2
-
-* Mon Dec 13 1999 <lha@s3.kth.se>
- arla 0.29.1
-
-* Thu Nov 25 1999 <lha@s3.kth.se>
- arla 0.28
-
-* Mon Nov 8 1999 <lha@s3.kth.se>
- Build a up and smp module, don't install ThisCell its up to the
- admin to do right, patch startarla to find what module to use.
- Do relocateable. Added krb4 requirement.
-
-* Fri Nov 5 1999 <lha@s3.kth.se>
- First spec with a ChangeLog-entry
-
-%prep
-%setup
-%build
-
-rm -rf ${RPM_BUILD_ROOT}
-
-mkdir ${RPM_BUILD_ROOT}
-
-CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --sysconfdir=/etc/arla
-make
-
-cd nnpfs/linux
-make clean
-CPPFLAGS="-D__BOOT_KERNEL_SMP=1 -D__BOOT_KERNEL_UP=0" make
-mv nnpfs.o nnpfs.smp.o.save
-
-make clean
-CPPFLAGS="-D__BOOT_KERNEL_SMP=0 -D__BOOT_KERNEL_UP=1" make
-mv nnpfs.o nnpfs.up.o.save
-
-
-
-echo "dummy file, to be removed later" > nnpfs.o
-
-mv nnpfs.up.o.save nnpfs.up.o
-mv nnpfs.smp.o.save nnpfs.smp.o
-
-%install
-
-mkdir ${RPM_BUILD_ROOT}/etc
-mkdir ${RPM_BUILD_ROOT}/sbin
-make install DESTDIR=$RPM_BUILD_ROOT
-rm $RPM_BUILD_ROOT/%{prefix}/bin/nnpfs.o
-
-KERNEL_VERSION=$(uname -r | sed 's/smp$//')
-
-cp nnpfs/linux/nnpfs.{smp,up}.o $RPM_BUILD_ROOT%{prefix}/bin
-
-mkdir -p $RPM_BUILD_ROOT/lib/modules/${KERNEL_VERSION}/fs
-cp nnpfs/linux/nnpfs.up.o \
- $RPM_BUILD_ROOT/lib/modules/${KERNEL_VERSION}/fs/nnpfs.o
-mkdir -p $RPM_BUILD_ROOT/lib/modules/${KERNEL_VERSION}smp/fs
-cp nnpfs/linux/nnpfs.smp.o \
- $RPM_BUILD_ROOT/lib/modules/${KERNEL_VERSION}smp/fs/nnpfs.o
-
-cp nnpfs/linux/libgetcwd.so $RPM_BUILD_ROOT%{prefix}/lib
-chmod 555 $RPM_BUILD_ROOT%{prefix}/lib/libgetcwd.so
-
-%post
-
-depmod -a
-
-%files
-
-%defattr(-,root,root)
-
-%doc README NEWS ChangeLog
-
-%config /etc/arla/CellServDB
-%config /etc/arla/arla.conf
-%config /etc/arla/SuidCells
-
-%{prefix}/bin
-%{prefix}/lib
-%{prefix}/include
-%{prefix}/cache
-/etc
-/sbin
-/lib/modules
diff --git a/usr.sbin/afs/src/conf/bos.conf b/usr.sbin/afs/src/conf/bos.conf
deleted file mode 100644
index fd53c2f16cc..00000000000
--- a/usr.sbin/afs/src/conf/bos.conf
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# $arla: bos.conf,v 1.3 2000/09/06 16:48:44 tol Exp $
-#
-# Syntax:
-#
-# [section_name]
-# field = value
-# field = value...
-#
-#
-# fields for [bos]
-#
-# serverfile
-# email
-#
-#
-# fields for other sections
-#
-# arguments
-# email
-# program
-# coredir
-# savecore
-# trydebug
-
-
-[bos]
- email = root
-
-[vldbserver]
- program = /usr/arla/libexec/vldbserver
- email = true
-
-[ptserver]
- program = /usr/arla/libexec/ptserver
- email = true
-
-[fileserver]
- program = /usr/arla/libexec/fileserver
- email = true
diff --git a/usr.sbin/afs/src/conf/check-cellservdb.pl b/usr.sbin/afs/src/conf/check-cellservdb.pl
deleted file mode 100644
index 898daa30fea..00000000000
--- a/usr.sbin/afs/src/conf/check-cellservdb.pl
+++ /dev/null
@@ -1,190 +0,0 @@
-#!/usr/pkg/bin/perl -w
-# $arla: check-cellservdb.pl,v 1.4 2000/08/30 21:26:13 lha Exp $
-#
-# Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
-# (Royal Institute of Technology, Stockholm, Sweden).
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# 3. Neither the name of the Institute nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-
-#
-# You can install Net::DNS with ``perl -MCPAN -e install Net::DNS;''
-#
-
-use strict;
-use Net::DNS;
-use Getopt::Long;
-
-my $cell;
-my $found;
-my %db;
-my %comments;
-
-sub print_cell
-{
- my $cell = shift;
- my $comment = shift || "";
-
- print ">$cell \#$comment\n";
-}
-
-sub query_local_cell
-{
- my $cell = shift;
-
- print "local cellservdb\n";
- print_cell($cell,$comments{$cell});
- my $hostlist = $db{$cell};
- print foreach (@$hostlist);
-}
-
-sub query_remote_cell
-{
- my $cell = shift;
- my $hostlist = $db{$cell};
-
- print "query remote host\n";
- my $host;
- foreach (@$hostlist) {
- if (/^([^ \t\n]+)/) {
- system "bos listhost -server $1 -db -comment \"$comments{$cell}\" -noauth";
- last if ($? == 0);
- }
- }
-}
-
-sub query_afsdb
-{
- my $cell = shift;
- my $comment = $comments{$cell};
- my $res;
- my $query;
- my $rr;
- my @hosts = ();
- my $host;
-
- $res = new Net::DNS::Resolver;
- $query = $res->search($cell, "AFSDB");
-
- if ($query) {
- foreach $rr ($query->answer) {
- next unless $rr->type eq "AFSDB" and $rr->subtype == 1;
- push @hosts, $rr->hostname;
- }
- }
- if ($#hosts > 0) {
- printf ("query dns\n");
- print_cell($cell, $comment);
- }
- foreach $host (@hosts) {
- $query = $res->search($host, "A");
- if ($query) {
- foreach $rr ($query->answer) {
- next unless $rr->type eq "A";
- print $rr->address, " \#$host\n";
- }
- }
- }
-}
-
-sub parse_cellservdb
-{
- my $cellservdb = shift || "/usr/arla/etc/CellServDB";
- my @hosts;
- my $FILE;
-
- open FILE, "<$cellservdb";
-
- while (<FILE>) {
- $found = 0;
- if (/^>([^ \t]*)[\t ]*#(.*)/) {
- $cell = $1;
- $comments{$cell} = $2;
- $found = 1;
- } elsif (/^>([^ \t]*)/) {
- $cell = $1;
- $comments{$cell} = "";
- $found = 1;
- }
- if (!$found) {
- push @hosts, $_;
- my @hostcopy = @hosts;
- $db{$cell} = \@hostcopy;
- } else {
- while (defined(pop @hosts)) {}
- }
- }
- close FILE;
-}
-
-sub usage
-{
- print "check-cellservdb.pl";
- print "\t--help\n";
- print "\t--cell <cellname>\n";
- print "\t--CellServDB <file>\n";
- print "\t--nodns\n";
- print "\t--nolocal\n";
- print "\t--noremote\n";
- print "\t--all\n";
- exit 1;
-}
-
-my $cell = 0;
-my $all = 0;
-my $nodns = 0;
-my $noremote = 0;
-my $nolocal = 0;
-my $cellservdb;
-
-GetOptions("help" => \&usag,
- "cell=s" => \$cell,
- "CellServDB=s" => \$cellservdb,
- "nodns" => \$nodns,
- "noremote" => \$noremote,
- "nolocal" => \$nolocal,
- "all" => \$all);
-
-
-parse_cellservdb($cellservdb);
-
-if ($all) {
- my $query_cell;
- foreach $query_cell (sort { reverse($a) cmp reverse($b) } keys %db) {
-
- query_local_cell($query_cell) if(!$nolocal);
- query_remote_cell($query_cell) if(!$noremote);
- query_afsdb($query_cell) if (!$nodns);
- }
-} elsif ($cell) {
- query_local_cell($cell) if(!$nolocal);
- query_remote_cell($cell) if(!$noremote);
- query_afsdb($cell) if (!$nodns);
-} else {
- usage();
-}
diff --git a/usr.sbin/afs/src/conf/freebsd/freebsd4-rc.arla b/usr.sbin/afs/src/conf/freebsd/freebsd4-rc.arla
deleted file mode 100644
index a641d431dce..00000000000
--- a/usr.sbin/afs/src/conf/freebsd/freebsd4-rc.arla
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2002 Stockholms Universitet
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# $arla: freebsd4-rc.arla,v 1.3 2002/09/07 10:43:41 lha Exp $
-#
-
-if [ -r /etc/defaults/rc.conf ]; then
- . /etc/defaults/rc.conf
- source_rc_confs
-elif [ -r /etc/rc.conf ]; then
- . /etc/rc.conf
-fi
-
-# The startarla program
-startarla_program=${startarla_program:-/usr/arla/sbin/startarla}
-
-
-# If no argument is given, assume we are being called at boot time.
-_action=${1:-start}
-
-case ${_action} in
-start)
- case ${arla_enable} in
- [Yy][Ee][Ss])
- ${startarla_program}
- ;;
- esac
- ;;
-
-stop)
- pid=`cat /var/run/arlad.pid`
- [ X$pid != X ] && kill $pid
- /sbin/umount /afs
- /sbin/kldunload -n nnpfs
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}"
- exit 64
-esac
-exit 0
diff --git a/usr.sbin/afs/src/conf/services b/usr.sbin/afs/src/conf/services
deleted file mode 100644
index db78eaf0f20..00000000000
--- a/usr.sbin/afs/src/conf/services
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# AFS Services
-#
-afs3-fileserver 7000/udp # Fileserver
-afs3-callback 7001/udp # Callback server
-afs3-prserver 7002/udp # Protection server
-afs3-vlserver 7003/udp # Volumelocation server
-afs3-kaserver 7004/udp # Kerberos authenication server
-afs3-volser 7005/udp # Volume server
-afs3-errors 7006/udp # Error server ?
-afs3-bos 7007/udp # Basic over-see server ?
-afs3-update 7008/udp # ?
-afs3-rmtsys 7009/udp # ?
diff --git a/usr.sbin/afs/src/config.guess b/usr.sbin/afs/src/config.guess
deleted file mode 100644
index 74da35004c8..00000000000
--- a/usr.sbin/afs/src/config.guess
+++ /dev/null
@@ -1,1276 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
-
-timestamp='2001-09-04'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Written by Per Bothner <bothner@cygnus.com>.
-# Please send patches to <config-patches@gnu.org>.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
- --version | -v )
- echo "$version" ; exit 0 ;;
- --help | --h* | -h )
- echo "$usage"; exit 0 ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-
-dummy=dummy-$$
-trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script.
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int dummy(){}" > $dummy.c ;
- for c in cc gcc c89 ; do
- ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
- if test $? = 0 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- rm -f $dummy.c $dummy.o $dummy.rel ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # Netbsd (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- # Determine the machine/vendor (is the vendor relevant).
- case "${UNAME_MACHINE}" in
- amiga) machine=m68k-unknown ;;
- arm32) machine=arm-unknown ;;
- atari*) machine=m68k-atari ;;
- sun3*) machine=m68k-sun ;;
- mac68k) machine=m68k-apple ;;
- macppc) machine=powerpc-apple ;;
- hp3[0-9][05]) machine=m68k-hp ;;
- ibmrt|romp-ibm) machine=romp-ibm ;;
- *) machine=${UNAME_MACHINE}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE}" in
- i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # The OS release
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit 0 ;;
- alpha:OSF1:*:*)
- if test $UNAME_RELEASE = "V4.0"; then
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- fi
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- cat <<EOF >$dummy.s
- .data
-\$Lformat:
- .byte 37,100,45,37,120,10,0 # "%d-%x\n"
-
- .text
- .globl main
- .align 4
- .ent main
-main:
- .frame \$30,16,\$26,0
- ldgp \$29,0(\$27)
- .prologue 1
- .long 0x47e03d80 # implver \$0
- lda \$2,-1
- .long 0x47e20c21 # amask \$2,\$1
- lda \$16,\$Lformat
- mov \$0,\$17
- not \$1,\$18
- jsr \$26,printf
- ldgp \$29,0(\$26)
- mov 0,\$16
- jsr \$26,exit
- .end main
-EOF
- eval $set_cc_for_build
- $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
- if test "$?" = 0 ; then
- case `./$dummy` in
- 0-0)
- UNAME_MACHINE="alpha"
- ;;
- 1-0)
- UNAME_MACHINE="alphaev5"
- ;;
- 1-1)
- UNAME_MACHINE="alphaev56"
- ;;
- 1-101)
- UNAME_MACHINE="alphapca56"
- ;;
- 2-303)
- UNAME_MACHINE="alphaev6"
- ;;
- 2-307)
- UNAME_MACHINE="alphaev67"
- ;;
- 2-1307)
- UNAME_MACHINE="alphaev68"
- ;;
- esac
- fi
- rm -f $dummy.s $dummy
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit 0 ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit 0 ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit 0 ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit 0;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit 0 ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit 0 ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit 0;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit 0;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit 0 ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit 0 ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- i86pc:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit 0 ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit 0 ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit 0 ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit 0 ;;
- sparc*:NetBSD:*)
- echo `uname -p`-unknown-netbsd${UNAME_RELEASE}
- exit 0 ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit 0 ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit 0 ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit 0 ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit 0 ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit 0 ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit 0 ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD $dummy.c -o $dummy \
- && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && rm -f $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
- echo mips-mips-riscos${UNAME_RELEASE}
- exit 0 ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit 0 ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit 0 ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit 0 ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit 0 ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit 0 ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit 0 ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit 0 ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit 0 ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit 0 ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit 0 ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit 0 ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit 0 ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit 0 ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
- echo rs6000-ibm-aix3.2.5
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit 0 ;;
- *:AIX:*:[45])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit 0 ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit 0 ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit 0 ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit 0 ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit 0 ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit 0 ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit 0 ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit 0 ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- case "${HPUX_REV}" in
- 11.[0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- esac ;;
- esac
- fi ;;
- esac
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
- if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
- rm -f $dummy.c $dummy
- fi ;;
- esac
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit 0 ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit 0 ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
- echo unknown-hitachi-hiuxwe2
- exit 0 ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit 0 ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit 0 ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit 0 ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit 0 ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit 0 ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit 0 ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit 0 ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit 0 ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit 0 ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit 0 ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit 0 ;;
- CRAY*X-MP:*:*:*)
- echo xmp-cray-unicos
- exit 0 ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*T3D:*:*:*)
- echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
- CRAY-2:*:*:*)
- echo cray2-cray-unicos
- exit 0 ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit 0 ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:FreeBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
- *:OpenBSD:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit 0 ;;
- i*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit 0 ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit 0 ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i386-pc-interix
- exit 0 ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit 0 ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit 0 ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- *:GNU:*:*)
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit 0 ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit 0 ;;
- arm*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux
- exit 0 ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- mips:Linux:*:*)
- case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
- big) echo mips-unknown-linux-gnu && exit 0 ;;
- little) echo mipsel-unknown-linux-gnu && exit 0 ;;
- esac
- ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit 0 ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit 0 ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit 0 ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
- esac
- exit 0 ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
- exit 0 ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
- exit 0 ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
- exit 0 ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- ld_supported_targets=`cd /; ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit 0 ;;
- coff-i386)
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit 0 ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit 0 ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- cat >$dummy.c <<EOF
-#include <features.h>
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
-#ifdef __ELF__
-# ifdef __GLIBC__
-# if __GLIBC__ >= 2
- printf ("%s-pc-linux-gnu\n", argv[1]);
-# else
- printf ("%s-pc-linux-gnulibc1\n", argv[1]);
-# endif
-# else
- printf ("%s-pc-linux-gnulibc1\n", argv[1]);
-# endif
-#else
- printf ("%s-pc-linux-gnuaout\n", argv[1]);
-#endif
- return 0;
-}
-EOF
- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
- ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit 0 ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit 0 ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit 0 ;;
- i*86:*:5:[78]*)
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit 0 ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit 0 ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit 0 ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit 0 ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit 0 ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit 0 ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit 0 ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit 0 ;;
- M68*:*:R3V[567]*:*)
- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4.3${OS_REL} && exit 0
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4 && exit 0 ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit 0 ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit 0 ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit 0 ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit 0 ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit 0 ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit 0 ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit 0 ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit 0 ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit 0 ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit 0 ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit 0 ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit 0 ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit 0 ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit 0 ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit 0 ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
- *:Darwin:*:*)
- echo `uname -p`-apple-darwin${UNAME_RELEASE}
- exit 0 ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- if test "${UNAME_MACHINE}" = "x86pc"; then
- UNAME_MACHINE=pc
- fi
- echo `uname -p`-${UNAME_MACHINE}-nto-qnx
- exit 0 ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit 0 ;;
- NSR-[KW]:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit 0 ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit 0 ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit 0 ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit 0 ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit 0 ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit 0 ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit 0 ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit 0 ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit 0 ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit 0 ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit 0 ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit 0 ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit 0 ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit 0 ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
-rm -f $dummy.c $dummy
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit 0 ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit 0 ;;
- c34*)
- echo c34-convex-bsd
- exit 0 ;;
- c38*)
- echo c38-convex-bsd
- exit 0 ;;
- c4*)
- echo c4-convex-bsd
- exit 0 ;;
- esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- ftp://ftp.gnu.org/pub/gnu/config/
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/usr.sbin/afs/src/config.sub b/usr.sbin/afs/src/config.sub
deleted file mode 100644
index d6a8350a3b9..00000000000
--- a/usr.sbin/afs/src/config.sub
+++ /dev/null
@@ -1,1417 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
-
-timestamp='2001-09-04'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Please send patches to <config-patches@gnu.org>.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
- --version | -v )
- echo "$version" ; exit 0 ;;
- --help | --h* | -h )
- echo "$usage"; exit 0 ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit 0;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis)
- os=
- basic_machine=$1
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
- | c4x | clipper \
- | d10v | d30v | dsp16xx \
- | fr30 \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | i370 | i860 | i960 | ia64 \
- | m32r | m68000 | m68k | m88k | mcore \
- | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
- | mips64vr4100 | mips64vr4100el | mips64vr4300 \
- | mips64vr4300el | mips64vr5000 | mips64vr5000el \
- | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
- | mipsisa32 \
- | mn10200 | mn10300 \
- | ns16k | ns32k \
- | openrisc \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
- | pyramid \
- | s390 | s390x \
- | sh | sh[34] | sh[34]eb | shbe | shle \
- | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
- | stormy16 | strongarm \
- | tahoe | thumb | tic80 | tron \
- | v850 \
- | we32k \
- | x86 | xscale \
- | z8k)
- basic_machine=$basic_machine-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12)
- # Motorola 68HC11/12.
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alphapca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armv*-* \
- | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c54x-* \
- | clipper-* | cray2-* | cydra-* \
- | d10v-* | d30v-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fr30-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | m32r-* \
- | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | mcore-* \
- | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
- | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipsel-* \
- | mipsle-* | mipstx39-* | mipstx39el-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
- | pyramid-* \
- | romp-* | rs6000-* \
- | s390-* | s390x-* \
- | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \
- | sparc-* | sparc64-* | sparc86x-* | sparclite-* \
- | sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \
- | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
- | v850-* | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \
- | ymp-* \
- | z8k-*)
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- cray2)
- basic_machine=cray2-cray
- os=-unicos
- ;;
- [cjt]90)
- basic_machine=${basic_machine}-cray
- os=-unicos
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mipsel*-linux*)
- basic_machine=mipsel-unknown
- os=-linux-gnu
- ;;
- mips*-linux*)
- basic_machine=mips-unknown
- os=-linux-gnu
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- mmix*)
- basic_machine=mmix-knuth
- os=-mmixware
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pentium | p5 | k5 | k6 | nexgen)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2)
- basic_machine=i686-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sparclite-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=t3e-cray
- os=-unicos
- ;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- windows32)
- basic_machine=i386-pc
- os=-windows32-msvcrt
- ;;
- xmp)
- basic_machine=xmp-cray
- os=-unicos
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- mips)
- if [ x$os = x-linux-gnu ]; then
- basic_machine=mips-unknown
- else
- basic_machine=mips-mips
- fi
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh3 | sh4 | sh3eb | sh4eb)
- basic_machine=sh-unknown
- ;;
- sparc | sparcv9 | sparcv9b)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- c4x*)
- basic_machine=c4x-none
- os=-coff
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto*)
- os=-nto-qnx
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-ibm)
- os=-aix
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -vxsim* | -vxworks*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit 0
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/usr.sbin/afs/src/configure.in b/usr.sbin/afs/src/configure.in
deleted file mode 100644
index 3fe126a2513..00000000000
--- a/usr.sbin/afs/src/configure.in
+++ /dev/null
@@ -1,1937 +0,0 @@
-dnl Process this file with autoconf to produce a configure script
-dnl This requires autoconf 2.13
-AC_REVISION($KTH: 1.465.2.78 $)dnl
-AC_PREREQ(2.13)
-AC_INIT(arlad/arla.c)
-AC_CONFIG_HEADER(include/config.h)
-
-dnl
-dnl definitions
-dnl
-
-PACKAGE=arla
-AC_SUBST(PACKAGE)dnl
-VERSION=0.35.7
-AC_SUBST(VERSION)dnl
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [what package is this?])dnl
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [and what version?])dnl
-
-# This may be overridden using --prefix=/usr to configure
-AC_PREFIX_DEFAULT(/usr/arla)
-
-CFLAGS="-g ${CFLAGS}"
-
-if test "$AS" = ""; then
- AS=as
-fi
-AC_SUBST(AS)dnl
-
-AC_PROG_CC
-AC_PROG_CC_FLAGS
-AC_PROG_CPP
-AC_PROG_MAKE_SET
-AC_PROG_INSTALL
-AC_PROG_RANLIB
-AC_PROG_LN_S
-AC_PROG_LEX
-AC_PROG_YACC
-AC_CANONICAL_HOST
-CANONICAL_HOST=$host
-AC_SUBST(CANONICAL_HOST)
-AC_CHECK_PROGS(SYMORDER, symorder, :)
-AC_CHECK_PROGS(MAKEINFO, makeinfo, :)
-AC_CHECK_PROGS(DVI2PS, dvi2ps, :)
-AC_CHECK_PROGS(TEXI2DVI, texi2dvi, :)
-AC_CHECK_PROGS(TEXI2PDF, texi2pdf, :)
-AC_CHECK_PROGS(TEXI2HTML, texi2html, :)
-AC_CHECK_PROGS(DVIPS, dvips, :)
-AC_CHECK_PROGS(chmod, chmod, :)
-AC_PATH_PROGS(GUILE_GTK, guile-gtk, /bin/false)
-
-
-dnl
-dnl See if there is any X11 present
-dnl
-KRB_CHECK_X
-if test "$no_x" = "yes" ; then
- MAKE_X_PROGS_BIN=""
-else
- MAKE_X_PROGS_BIN='$(X_PROGS_BIN)'
-fi
-AC_SUBST(MAKE_X_PROGS_BIN)dnl
-
-
-AC_FUNC_NTOHL
-
-AC_ARG_ENABLE(smp,
-[ --enable-smp compile for SMP (for Linux and FreeBSD)],
-[if test "$enableval" = "yes"; then
- smp="-DSMP -D__SMP__"
-else
- smp="no"
-fi
-])
-
-
-AC_ARG_ENABLE(kld,
-[ --enable-kld build kld modules (only FreeBSD 3.0)],
-[if test "$enableval" = "yes"; then
- kld="yes"
-else
- kld="no"
-fi
-])
-
-# what kind of lwp
-
-LWP_PROCESS="process.o"
-LWP_C="lwp_asm.c"
-LWP_O="lwp_asm.o"
-LWP_H="lwp_asm.h"
-PLWP_LIB_FLAGS=""
-PLWP_INC_FLAGS=""
-
-AC_ARG_WITH(pthreads,
-[ --with-pthreads=dir compile liblwp as pthreads wrapper using pthreads in dir],
-[if test "$with_pthreads" = "windows"; then
- with_pthreads=win
-elif test "$with_pthreads" != "no"; then
- LWP_PROCESS=""
- LWP_C="plwp.c"
- LWP_O="plwp.o"
- LWP_H="plwp.h"
- PLWP_INC_FLAGS="-DPTHREADS_LWP"
- if test "$with_pthreads" != "yes"; then
- AC_FIND_FUNC_NO_LIBS(pthread_create, pthread,,,[-L${with_pthreads}/lib])
- PLWP_LIB_FLAGS="-L${with_pthreads}/lib $LIB_pthread_create"
- PLWP_INC_FLAGS="-I${with_pthreads}/include -DPTHREADS_LWP"
- else
- AC_FIND_FUNC_NO_LIBS(pthread_create, pthread)
- PLWP_LIB_FLAGS="$LIB_pthread_create"
- PLWP_INC_FLAGS="-DPTHREADS_LWP"
- fi
-fi],[with_pthreads=no])
-
-# where the source tree is located
-
-case "$target_os" in
- linux*)
- default_sys=/usr/src/linux
- ;;
- *)
- default_sys=/sys
- ;;
-esac
-AC_ARG_WITH(sys,
-[ --with-sys=dir use dir as your kernel source code directory
- default $default_sys],
-[SYS=$withval],
-[SYS="$default_sys"])
-AC_SUBST(SYS)
-
-xfs_target="$target_os"
-AC_ARG_ENABLE(xfs,
-[ --disable-xfs build arla w/o xfs],
-[if test "$enableval" = "no" ; then
- xfs_target="without_xfs";
-fi])
-
-AC_MSG_CHECKING(for kernel stuff)
-case "$xfs_target" in
-sunos4.1*)
- KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/xfs/sunos
- KERNEL_SRCS='sunos-subr.c'
- KERNEL_HDRS=''
- XFS_SUBDIR=sunos
- KERNEL=/vmunix
- AC_MSG_RESULT(SunOS 4.1.x)
- ;;
-solaris*)
- KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/xfs/solaris
- KERNEL_SRCS='solaris-subr.c'
- KERNEL_HDRS=''
- XFS_SUBDIR=solaris
- KERNEL=/dev/ksyms
- KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -D_KERNEL"
- AC_MSG_RESULT(Solaris)
- case "$target_cpu" in
- sparc64) AC_DEFINE(NEED_VICEIOCTL32, 1,
- [define if you need 32 bit compat pioctl])
- KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -D_SYSCALL32 -D_SYSCALL32_IMPL"
- ;;
- esac
- ;;
-irix*)
- KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/xfs/irix
- KERNEL_SRCS='irix-subr.c'
- KERNEL_HDRS=''
- ip=`hinv -c processor | awk '$4 ~ /IP/ { print $4}'`
- cpu=`hinv -t cpu | awk '{print $3}'`
- KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -D$ip -D$cpu -DR4000"
- XFS_SUBDIR=irix
- KERNEL=/unix
- case "$target_os" in
-changequote(, )dnl
- irix6.[4-9])
-changequote([,])dnl
- AC_DEFINE(IRIX_64, 1, [define this if on Irix6.4 or higher]) ;;
- esac
- AC_MSG_RESULT(Irix)
- ;;
-hpux*)
- KERNEL_SRCS='hpux-subr.c'
- AC_MSG_RESULT(hp-ux)
- KERNEL=/hp-ux
- KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/xfs/unknown
- AC_MSG_WARN(No kernel support for $target_os, compiling only user-level stuff)
- ;;
-aix*)
- KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/xfs/aix
- KERNEL_SRCS='aix-subr.c'
- KERNEL_HDRS=''
- XFS_SUBDIR=aix
- AC_MSG_RESULT(AIX)
- ;;
-openbsd*)
- KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/xfs/bsd
- KERNEL_SRCS='bsd-subr.c'
- KERNEL_HDRS=''
- MODULE=xfs_mod.o
- cat > conftest.mk << END
-.include <bsd.lkm.mk>
-.if defined(UVM) && (\${UVM} != "no")
-CFLAGS+=-DUVM
-.endif
-.if PMAP_NEW
-CFLAGS+=-DPMAP_NEW
-.endif
-echo:
- @echo \$(CFLAGS)
-END
- ac_out=`/usr/bin/make S=$SYS -f conftest.mk echo 2> /dev/null`
- incl=-I$SYS
- defs= flags=
- for i in $ac_out; do
- case "$i" in
- -I*) if test "$i" != -I. -a "$i" != "-I`pwd`"; then
- incl="$incl${incl:+ }$i"
- fi
- ;;
- -D*) defs="$defs${defs:+ }$i" ;;
- -m*) flags="$flags${flags:+ }$i" ;;
- *) ;;
- esac
- done
-## -DKERNEL -DLKM -DACTUALLY_LKM_NOT_KERNEL ??
- # make sure we compile with -mno-fp-regs on alpha
- if test `uname -m` = alpha -a `expr "$flags" : ".*-mno-fp-regs"` -eq 0
- then
- flags="$flags${flags:+ }-mno-fp-regs"
- fi
- KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -D_LKM"
- KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} $defs${defs:+ }$flags${flags:+ }$incl"
- test_KERNEL_CFLAGS="${KERNEL_CFLAGS}"
- KERNEL_LD='ld'
- XFS_SRCS='xfs_wrap-bsd.c xfs_common-bsd.c xfs_dev-common.c xfs_dev-bsd.c xfs_syscalls-common.c xfs_syscalls-wrap-bsd.c xfs_node-bsd.c xfs_vfsops-common.c xfs_vfsops-bsd.c xfs_vfsops-openbsd.c xfs_vnodeops-common.c xfs_vnodeops-bsd.c'
- XFS_SUBDIR=bsd
- KERNEL=/bsd
- MODLOAD=modload
- MODUNLOAD=modunload
- AC_MSG_RESULT(OpenBSD)
- ;;
-netbsd* | netbsdelf*)
- dnl There is a nasty bug in 1.4.2 that make shared libs
- dnl together with syscall(2) fail with bus error.
- case "$target_os" in
- netbsd1.4.2)
- if test X"$GCC" = Xyes ; then
- CC="$CC -static"
- else
- AC_MSG_WARN([There is a problem with netbsd 1.4.2, you should build it static])
- fi
- ;;
- esac
- KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/xfs/bsd
- KERNEL_SRCS='bsd-subr.c'
- KERNEL_HDRS=''
- MODULE=xfs_mod.o
- cat > conftest.mk << END
-.include <bsd.kmod.mk>
-.if UVM
-CFLAGS+=-DUVM
-.endif
-.if PMAP_NEW
-CFLAGS+=-DPMAP_NEW
-.endif
-echo:
- @echo \$(CFLAGS)
-END
- ac_out=`/usr/bin/make S=$SYS -f conftest.mk echo 2> /dev/null`
- incl=-I$SYS
- defs= flags=
- for i in $ac_out; do
- case "$i" in
- -I*) if test "$i" != -I. -a "$i" != "-I`pwd`"; then
- incl="$incl${incl:+ }$i"
- fi
- ;;
- -D*) defs="$defs${defs:+ }$i" ;;
- -m*) flags="$flags${flags:+ }$i" ;;
- *) ;;
- esac
- done
-## -DKERNEL -DLKM -DACTUALLY_LKM_NOT_KERNEL ??
- # make sure we compile with -mno-fp-regs on alpha
- if test `uname -m` = alpha -a `expr "$flags" : ".*-mno-fp-regs"` -eq 0
- then
- flags="$flags${flags:+ }-mno-fp-regs"
- fi
- KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} $defs${defs:+ }$flags${flags:+ }$incl"
- test_KERNEL_CFLAGS="${KERNEL_CFLAGS}"
- KERNEL_LD='ld'
- XFS_SRCS='xfs_wrap-bsd.c xfs_common-bsd.c xfs_dev-common.c xfs_dev-bsd.c xfs_syscalls-common.c xfs_syscalls-wrap-bsd.c xfs_node-bsd.c xfs_vfsops-common.c xfs_vfsops-bsd.c xfs_vfsops-netbsd.c xfs_vnodeops-common.c xfs_vnodeops-bsd.c'
- XFS_SUBDIR=bsd
- KERNEL=/netbsd
- MODLOAD=modload
- MODUNLOAD=modunload
- AC_MSG_RESULT(NetBSD)
- ;;
-changequote(, )dnl
-freebsd[345]* | freebsdelf[345]*)
- AC_MSG_RESULT(FreeBSD [345].x)
-changequote([,])dnl
- KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/xfs/bsd
- KERNEL_SRCS='bsd-subr.c'
- KERNEL_HDRS=''
- KERNEL=`sysctl -n kern.bootfile`
- AC_MSG_CHECKING(for kernel object format)
- kernobjformat=aout
- case `file $KERNEL 2>/dev/null` in
- *ELF*) kernobjformat=elf ;;
- esac
- AC_MSG_RESULT($kernobjformat)
-
- AC_MSG_CHECKING(if /kernel and headers match)
- HDRVERSION=`awk '/#define __FreeBSD_version/ { printf("%2.1f\n",$3/100000); }' < $SYS/sys/param.h`
- KERNELVERSION=`uname -r | cut -f1 -d-`
-
- if test X"${HDRVERSION}" != X"${KERNELVERSION}" ; then
- AC_MSG_ERROR([version mismatch headerfiles $HDRVERSION != kernel $KERNELVERSION])
- fi
- AC_MSG_RESULT(yes)
-
- AC_MSG_CHECKING(for kld)
- dnl Default to kld if freebsd4.0
- case "$target_os" in
-changequote(, )dnl
- freebsd[45]*)
-changequote([,])dnl
- if test "X$kld" = "X"; then
- kld="yes";
- fi
- if test "X$smp" != "Xno" -a "X$smp" != "X"; then
- smp="-DAPIC_IO $smp"
- else
- smp=""
- fi
- ;;
- esac
- dnl Or if the kernel is ELF
- case "$kernobjformat" in
- elf*)
- if test "X$kld" = "X"; then
- kld=yes;
- fi
- ;;
- esac
- KERNEL_CFLAGS="${KERNEL_CFLAGS}${KERNEL_CFLAGS:+ }-O"
- if test `uname -m` = alpha -a `expr "$KERNEL_CFLAGS" : ".*-mno-fp-regs"` -eq 0
- then
- KERNEL_CFLAGS="${KERNEL_CFLAGS}${KERNEL_CFLAGS:+ }-mno-fp-regs"
- fi
- if test "$kld" = "yes"; then
- KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} $smp -DKERNEL -D_KERNEL -DVFS_KLD -DKLD_MODULE -I$SYS/arch -I$SYS -I."
- test_KERNEL_CFLAGS="-$kernobjformat ${KERNEL_CFLAGS}"
- KERNEL_LD='ld'
- case "$kernobjformat" in
- aout) extra_LDFLAGS="-A" ;;
- elf) extra_LDFLAGS="-R" ;;
- *) AC_MSG_ERROR([Unknown object format $kernobjformat])
- esac
- ac_kernel_ld='${LD-ld} -$kernobjformat -o conftest $LDFLAGS $extra_LDFLAGS $KERNEL conftest.o -e _foo 1>&AC_FD_CC'
- MODULE=xfs.ko
- AC_MSG_RESULT(yes)
- else
- if test "$kernobjformat" != "aout"; then
- AC_MSG_WARN([You cannot build LKMs against $kernobjformat kernels])
- fi
- KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} $smp -DKERNEL -D_KERNEL -DLKM -D_LKM -DVFS_LKM -DACTUALLY_LKM_NOT_KERNEL -I$SYS/arch -I$SYS -I."
- test_KERNEL_CFLAGS="-aout ${KERNEL_CFLAGS}"
- KERNEL_LD='ld -aout'
- ac_kernel_ld='${LD-ld} -aout -o conftest $LDFLAGS -A $KERNEL conftest.o -e _foo 1>&AC_FD_CC'
- MODULE=xfs_mod.o
- AC_MSG_RESULT(no)
- fi
-
- XFS_SUBDIR=bsd
- XFS_SRCS='xfs_wrap-bsd.c xfs_common-bsd.c xfs_dev-common.c xfs_dev-bsd.c xfs_syscalls-common.c xfs_syscalls-wrap-freebsd.c xfs_node-bsd.c xfs_vfsops-common.c xfs_vfsops-bsd.c xfs_vfsops-freebsd.c xfs_vnodeops-common.c xfs_vnodeops-bsd.c'
- MODLOAD=modload
- MODUNLOAD=modunload
-
- ;;
-macos*|darwin*)
- AC_MSG_RESULT(MacOS)
- KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/xfs/bsd
- KERNEL_SRCS='bsd-subr.c'
- KERNEL_HDRS=''
- KERNEL=/mach
-
- ac_cv_func_mmap_fixed_mapped=no dnl disable mmap for darwin
-
- KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -DKERNEL -D_KERNEL -I/System/Library/Frameworks/Kernel.framework/Headers -static -DKERNEL_PRIVATE -DDIAGNOSTIC -DUSE_SELECT -DMACH_USER_API -traditional-cpp"
- CFLAGS="${CFLAGS} -traditional-cpp"
- LDFLAGS="${LDFLAGS} -flat_namespace"
- KERNEL_CFLAGS="${KERNEL_CFLAGS} -fno-common -Wno-format -pipe -finline -fno-keep-inline-functions -force_cpusubtype_ALL -msoft-float -mlong-branch"
- test_KERNEL_CFLAGS="${KERNEL_CFLAGS}"
- KERNEL_LD='ld'
- MODULE=xfs_mod.o
-
- MODLOAD=kmodload
- MODUNLOAD=kmodunload
-
- XFS_SUBDIR=bsd
- XFS_SRCS='xfs_wrap-bsd.c xfs_common-bsd.c xfs_dev-common.c xfs_dev-bsd.c xfs_syscalls-common.c xfs_syscalls-wrap-macos.c xfs_node-bsd.c xfs_vfsops-common.c xfs_vfsops-bsd.c xfs_vfsops-macos.c xfs_vnodeops-common.c xfs_vnodeops-bsd.c xfs_info.c'
-
- ;;
-linux*)
- AC_MSG_RESULT(Linux)
- KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/xfs/linux
- KERNEL_SRCS='bsd-subr.c'
- KERNEL_HDRS=''
- AC_MSG_CHECKING(for smp)
-if test "X$smp" = "Xno"; then
- smp=
-elif test "X$smp" = "X"; then
- AC_EGREP_CPP(
-changequote(, )dnl
-smp_[0-9a-z_]*,dnl
-changequote([,])dnl
-[#include <linux/config.h>
-#ifdef CONFIG_MODVERSIONS
-#define MODVERSIONS
-#include <linux/modversions.h>
-#endif
-__ver_get_module_symbol], smp='-D__SMP__', [
-changequote(, )dnl
-if grep 'smp_[0-9a-zA-Z_]*\>' /proc/ksyms >/dev/null || test `grep -c '^processor' /proc/cpuinfo` -gt 1; then
- smp='-D__SMP__'
-fi
-changequote([,])dnl
-fi
-])
- if test "X$smp" = "X"; then
- AC_MSG_RESULT(no)
- else
- AC_MSG_RESULT(yes)
- fi
- KERNEL_CPPFLAGS="-I$SYS/include -DMODULE -D__KERNEL__ $smp ${KERNEL_CPPFLAGS} "
- case "$target_cpu" in
- alpha*)
- KERNEL_CC=${KERNEL_CC:-$CC}
- KERNEL_CFLAGS="${KERNEL_CFLAGS} -mno-fp-regs -ffixed-8" ;;
- sparc64*)
- KERNEL_CFLAGS="${KERNEL_CFLAGS} -mno-fpu -ffixed-g4 -fcall-used-g5 -fcall-used-g7"
- KERNEL_LDFLAGS="-m elf64_sparc"
- KERNEL_CC=${KERNEL_CC:-sparc64-linux-gcc}
- AC_DEFINE(NEED_VICEIOCTL32, 1,
- [define if you need 32 bit compat pioctl]) ;;
- *)
- KERNEL_CC=${KERNEL_CC:-$CC} ;;
- esac
- test_KERNEL_CFLAGS="${KERNEL_CFLAGS}"
- XFS_SUBDIR=linux
- KERNEL=/dev/null
- ;;
-osf*)
- KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/xfs/bsd
- KERNEL_SRCS=bsd-subr.c
- KERNEL_HDRS=
- KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -DKERNEL -D_KERNEL -DMACH"
- XFS_SRCS='xfs_wrap-osf.c xfs_common-osf.c xfs_dev-common.c xfs_dev-osf.c xfs_syscalls-common.c xfs_syscalls-wrap-osf.c xfs_node-osf.c xfs_vfsops-common.c xfs_vfsops-osf.c xfs_vnodeops-common.c xfs_vnodeops-osf.c'
- # XXX find kernel include dir
- nodename=`hostname | sed 's/\..*//' | tr 'a-z' 'A-Z'`
- foo=`ls $SYS/inet.h $SYS/GENERIC/inet.h $SYS/$nodename/inet.h $SYS/*/inet.h 2> /dev/null | head -1 | sed -e 's,/inet.h,,'`
- KERNEL_CPPFLAGS="${KERNEL_CPPFLAGS} -I/usr/sys/include -I$foo"
- test_KERNEL_CFLAGS="-w2 ${KERNEL_CFLAGS}"
- KERNEL_LD='ld'
- KERNEL_CC="cc -std0"
- XFS_SUBDIR=bsd
- AC_MSG_RESULT(osf/1)
- KERNEL=/vmunix
- case "$CC" in
- cc)
- CC="$CC -std1"
- ;;
- esac
- MODLOAD=modload
- MODUNLOAD=modunload
- ;;
-cygwin*)
- AC_MSG_RESULT(cygwin/VC)
- AC_MSG_WARN([Only kernel support for NT])
- if test "$with_pthreads" = "windows"; then
- AC_MSG_WARN([Using LWP on windows native threads])
- LWP_PROCESS=""
- LWP_C="plwp.c"
- LWP_O="plwp.o"
- LWP_H="plwp.h"
- PLWP_INC_FLAGS="-DWINDOWS_THREADS_LWP"
- else
- AC_MSG_WARN([Using LWP on asm threads or pthreads])
- fi
- KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/xfs/unknown
- KERNEL_SRCS=unknown-subr.c
- KERNEL_HDRS=
- KERNEL=/dev/null
- XFS_SUBDIR=
- ;;
-*)
- AC_MSG_RESULT(none)
- if test "$xfs_target" != "without_xfs"; then
- AC_MSG_WARN([No kernel support for $target_os, compiling only user-level stuff])
- fi
- KERNEL_INCLUDE=-I`(cd $srcdir; pwd)`/xfs/unknown
- KERNEL_SRCS=unknown-subr.c
- KERNEL_HDRS=
- KERNEL=/dev/null
- XFS_SUBDIR=
- ;;
-esac
-if test "$XFS_SUBDIR" != ""; then
- XFS_SUBDIR_Makefile=xfs/$XFS_SUBDIR/Makefile
- XFS_SUBDIR_BIN_Makefile=xfs/$XFS_SUBDIR/bin/Makefile
-fi
-
-AM_CONDITIONAL(OSF1, test "`uname`" = OSF1)dnl
-
-# Check where to put the cache
-
-AC_ARG_WITH(arlacachedir,
-[ --with-arlacachedir=dir use dir as cachedir instead of \$prefix/cache],
-[ARLACACHEDIR=$withval],
-[ARLACACHEDIR='${prefix}/cache'])
-
-# Check where to find the configuration
-
-AC_ARG_WITH(arlaconffile,
-[ --with-arlaconffile=file use file for configuration instead of \$prefix/etc/arla.conf],
-[ARLACONFFILE=$withval],
-[ARLACONFFILE='${sysconfdir}/arla.conf'])
-
-# Do we want knfs ?
-
-ARLA_KNFS=""
-AC_ARG_ENABLE(knfs,
-[ --enable-knfs make afs nfs-mountable],
-[ARLA_KNFS="-DARLA_KNFS"])
-AC_SUBST(ARLA_KNFS)
-
-dnl
-dnl
-dnl
-
-AC_CHECK_ROKEN
-
-dnl
-dnl If we want to use pthreads
-dnl
-
-AC_SUBST(LWP_PROCESS)
-AC_SUBST(PLWP_LIB_FLAGS)
-AC_SUBST(PLWP_INC_FLAGS)
-AC_SUBST(LWP_C)
-AC_SUBST(LWP_O)
-AC_SUBST(LWP_H)
-
-AC_CHECK_KERBEROS(45auto)
-AC_CHECK_KAFS
-
-if test "X$ac_cv_found_krb4" = "Xyes"; then
- RXKAD="rxkad"
- RXKAD_MAKEFILE="rxkad/Makefile"
- RXKAD_LIBS="-L../rxkad -lrxkad $KRB4_LIB_FLAGS"
- MILKO_RXKAD_LIBS=`echo $RXKAD_LIBS | sed s,\.\./,\.\./\.\./,`
- MILKO_RXKAD_LIBS2=`echo $MILKO_RXKAD_LIBS | sed s,\.\./,\.\./\.\./,`
- APPL_SUBDIRS='afsutils amon fs'
-else
- APPL_SUBDIRS=
-fi
-
-#
-# check for tf_util
-#
-
-AC_FIND_FUNC_NO_LIBS2(tf_init, "", , , [$KRB4_LIB_FLAGS])
-
-if test "$ac_cv_func_tf_init" = yes; then
- APPL_SUBDIRS="$APPL_SUBDIRS kalog"
-fi
-
-
-AC_SUBST(APPL_SUBDIRS)dnl
-
-AC_TYPE_MSGHDR
-AC_TYPE_IOVEC
-AC_TYPE_KRB_PRINCIPAL
-AC_FUNC_KRB_GET_ERR_TEXT
-AC_FUNC_KRB_GET_DEFAULT_TKT_ROOT
-AC_FUNC_KRB_GET_DEFAULT_PRINCIPAL
-AC_FUNC_KRB_KDCTIMEOFDAY
-
-dnl AC_TYPE_MODE_T
-dnl AC_CHECK_TYPE(nlink_t, int)
-
-dnl
-dnl Tests for readline/editline
-dnl
-
-AC_TEST_PACKAGE_NEW(readline,[
-#include <stdio.h>
-#include <readline.h>
-],-lreadline)
-
-if test "$with_readline" = "no"; then
- AC_FIND_FUNC_NO_LIBS(tgetent, termcap ncurses curses)
- if test "$ac_cv_funclib_tgetent" = "no"; then
- AC_MSG_ERROR([Could not find tgetent, needed by edit/editline])
- fi
- AC_FIND_FUNC_NO_LIBS(readline, editline edit readline, [], [], [$LIB_tgetent])
- if test "$ac_cv_func_readline" = "no"; then
- AC_FIND_FUNC_NO_LIBS(el_init, edit, [], [], [$LIB_tgetent])
- if test "$ac_cv_func_el_init" = yes; then
- editline_OBJS=edit_compat.o
- LIB_readline='-L'`pwd`'/lib/editline -leditline '"$LIB_el_init";
- INCLUDE_readline='-I'`pwd`'/lib/editline -I$(top_srcdir)/lib/editline'
- else
- editline_OBJS="editline.o complete.o sysunix.o"
- LIB_readline='-L'`pwd`'/lib/editline -leditline'
- INCLUDE_readline='-I'`pwd`'/lib/editline -I$(top_srcdir)/lib/editline'
- fi
- fi
-fi
-AC_DEFINE(HAVE_READLINE, 1, [define if you have a function readline])dnl
-LIB_readline="$LIB_readline \$(LIB_tgetent)"
-
-AC_ARG_ENABLE(mmap,
-[ --disable-mmap don't use mmap],
-[if test "$enableval" = "no"; then
- ac_cv_func_mmap_fixed_mapped=no
- fi])
-
-AC_ARG_ENABLE(mmaptime,
-[ --enable-mmaptime use mmaptime time, read the README before use (disable by default)],
-[if test "$enableval" = "yes" -o "X$enableval" = "X"; then
- AC_DEFINE(USE_MMAPTIME, 1, [define if you want to use mmaptime])
-fi])
-
-aix_dynamic_afs=yes
-AC_ARG_ENABLE(dynamic-afs,
-[ --disable-dynamic-afs don't use loaded AFS library with AIX],[
-if test "$enableval" = "no"; then
- aix_dynamic_afs=no
-fi
-])
-
-AC_CHECK_LFS
-AC_CHECK_GLIBC
-
-AC_SUBST(LIB_readline)
-AC_SUBST(INCLUDE_readline)
-AC_SUBST(editline_OBJS)dnl
-if test "$editline_OBJS" != ""; then
- editline_dir=editline
-fi
-AC_SUBST(editline_dir)
-
-AC_SUBST(GCC)
-AC_SUBST(CFLAGS)
-AC_SUBST(LDFLAGS)
-AC_SUBST(KERNEL_INCLUDE)
-AC_SUBST(KERNEL_SRCS)
-AC_SUBST(KERNEL_HDRS)
-AC_SUBST(KERNEL_CPPFLAGS)
-AC_SUBST(KERNEL_CFLAGS)
-AC_SUBST(KERNEL_LDFLAGS)
-AC_SUBST(KERNEL_CC)
-AC_SUBST(KERNEL_LD)
-AC_SUBST(MODLOAD)
-AC_SUBST(MODUNLOAD)
-AC_SUBST(MODULE)
-AC_SUBST(XFS_SUBDIR)
-AC_SUBST(XFS_SRCS)
-AC_SUBST(RXKAD)
-AC_SUBST(MILKO_RXKAD_LIBS)
-AC_SUBST(MILKO_RXKAD_LIBS2)
-AC_SUBST(RXKAD_LIBS)
-AC_SUBST(ARLACACHEDIR)
-AC_SUBST(ARLACONFFILE)
-AC_FUNC_MMAP
-
-dnl
-dnl Various checks for headers and their contents
-dnl
-
-AC_HEADER_STDC
-AC_HEADER_TIME
-
-AC_CHECK_HEADERS([ \
- arpa/inet.h \
- arpa/nameser.h \
- crypt.h \
- dbm.h \
- dirent.h \
- errno.h \
- fcntl.h \
- grp.h \
- inttypes.h \
- kvm.h \
- libelf/nlist.h \
- machine/alpha/asm.h \
- machine/asm.h \
- machine/endian.h \
- machine/regdef.h \
- miscfs/genfs/genfs.h \
- ndbm.h \
- netdb.h \
- netinet/in.h \
- netinet/in6.h \
- netinet/in6_machtypes.h \
- netinet6/in6.h \
- nlist.h \
- paths.h \
- pwd.h \
- regdef.h \
- resolv.h \
- rpcsvc/dbm.h \
- shadow.h \
- sys/attr.h \
- sys/bitypes.h \
- sys/cdefs.h \
- sys/dir.h \
- sys/filedesc.h \
- sys/ioccom.h \
- sys/ioctl.h \
- sys/libkern.h \
- sys/lkm.h \
- sys/mman.h \
- sys/module.h \
- sys/mount.h \
- sys/param.h \
- sys/poll.h \
- sys/prctl.h \
- sys/proc.h \
- sys/queue.h \
- sys/resource.h \
- sys/select.h \
- sys/signalvar.h \
- sys/socket.h \
- sys/sockio.h \
- sys/stat.h \
- sys/syscallargs.h \
- sys/sysconfig.h \
- sys/sysctl.h \
- sys/sysent.h \
- sys/sysproto.h \
- sys/systm.h \
- sys/time.h \
- sys/tty.h \
- sys/types.h \
- sys/ubc.h \
- sys/uio.h \
- sys/user.h \
- sys/utsname.h \
- sys/vfs.h \
- sys/vfs_proto.h \
- sys/vnode.h \
- sys/wait.h \
- syslog.h \
- termios.h \
- unistd.h \
- uvm/uvm_extern.h \
- vm/vm.h \
- vm/vm_extern.h \
- vm/vm_object.h \
- vm/vm_pager.h \
- vm/vm_zone.h \
- vm/vnode_pager.h \
-])
-
-dnl
-dnl Check for endian-ness
-dnl
-KRB_C_BIGENDIAN
-
-dnl
-dnl check for const
-dnl
-
-AC_C_CONST
-
-dnl
-dnl Check for inline
-dnl
-
-AC_C_INLINE
-
-dnl
-dnl Check for __FUNCTION__
-dnl
-
-AC_C___FUNCTION__
-
-dnl
-dnl Check for __attribute__
-dnl
-
-AC_C___ATTRIBUTE__
-
-dnl
-dnl Look for berkeley db, gdbm, and ndbm in that order.
-dnl
-
-KRB_FIND_DB("" $berkeley_db gdbm ndbm)
-
-dnl
-dnl Check for strange operating systems that you need to handle differently
-dnl
-
-AC_KRB_SYS_NEXTSTEP
-AC_KRB_SYS_AIX
-
-if test "$krb_cv_sys_aix" = yes ;then
- if test "$aix_dynamic_afs" = yes; then
- AFS_EXTRA_OBJS='$(srcdir)/afsl.exp dlfcn.o'
- AFS_EXTRA_LIBS=afslib.so
- # this works differently in AIX <=3 and 4
- if test `uname -v` = 4 ; then
- AFS_EXTRA_LD="-bnoentry"
- else
- AFS_EXTRA_LD="-e _nostart"
- fi
- AFS_EXTRA_DEFS=
- AIX_EXTRA_KAFS="-lld"
- else
- AFS_EXTRA_OBJS='$(srcdir)/afsl.exp afslib.o'
- AFS_EXTRA_LIBS=
- AFS_EXTRA_DEFS='-DSTATIC_AFS_SYSCALLS'
- AIX_EXTRA_KAFS=
- fi
- AC_SUBST(AFS_EXTRA_OBJS)dnl
- AC_SUBST(AFS_EXTRA_LIBS)dnl
- AC_SUBST(AFS_EXTRA_LD)dnl
- AC_SUBST(AFS_EXTRA_DEFS)dnl
- AC_SUBST(AIX_EXTRA_KAFS)dnl
-fi
-
-dnl
-dnl Check for struct winsize
-dnl
-
-AC_KRB_STRUCT_WINSIZE
-
-dnl
-dnl Various checks for libraries and their contents
-dnl
-
-AC_FIND_FUNC(syslog, syslog)
-
-dnl
-dnl System V is have misplaced the socket routines, should really be in libc
-dnl
-
-AC_FIND_FUNC(socket, socket)
-AC_FIND_FUNC(gethostbyname, nsl)
-AC_FIND_FUNC(gethostbyname2, inet6 ip6)
-
-dnl we don't actually use v6 functions in this code, but some generic
-dnl functions such as getnameinfo et al can reside in libraries that are
-dnl found by this macro
-
-AC_KRB_IPV6
-
-AC_FIND_FUNC(res_search, resolv,
-[
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-#include <arpa/nameser.h>
-#endif
-#ifdef HAVE_RESOLV_H
-#include <resolv.h>
-#endif
-],
-[0,0,0,0,0])
-
-AC_FIND_FUNC(res_init, resolv,
-[
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-#include <arpa/nameser.h>
-#endif
-#ifdef HAVE_RESOLV_H
-#include <resolv.h>
-#endif
-],
-[])
-
-AC_FIND_FUNC(dn_expand, resolv,
-[
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_NAMESER_H
-#include <arpa/nameser.h>
-#endif
-#ifdef HAVE_RESOLV_H
-#include <resolv.h>
-#endif
-],
-[0,0,0,0,0])
-
-AC_BROKEN_SNPRINTF
-
-AC_CHECK_FUNCS(asnprintf asprintf vasprintf vasnprintf vsnprintf)
-
-AC_CHECK_FUNCS(thr_yield)
-
-AC_EGREP_HEADER(sigaction, signal.h,
- AC_DEFINE(HAVE_POSIX_SIGNALS, 1, [define if you have sigaction]))
-
-save_CPPFLAGS="${CPPFLAGS}"
-if test "$KRB4_INC_DIR"; then
- CPPFLAGS="-I${KRB4_INC_DIR} $CPPFLAGS"
-fi
-AC_HAVE_TYPES(int8_t int16_t int32_t int64_t)
-AC_HAVE_TYPES(int16 int32)
-AC_HAVE_TYPES(u_int8_t u_int16_t u_int32_t u_int64_t)
-AC_HAVE_TYPES(u_int16 u_int32)
-AC_HAVE_TYPES(bool ssize_t)
-AC_HAVE_TYPES(register_t)
-AC_HAVE_TYPES(intptr_t)
-AC_HAVE_TYPES(off64_t)
-AC_CHECK_HEADERS(ktypes.h com_err.h et/com_err.h)
-CPPFLAGS="${save_CPPFLAGS}"
-
-AC_TYPE_SIGNAL
-
-dnl
-dnl check for old libkafs
-dnl
-
-AC_FIND_FUNC_NO_LIBS2(krb_afslog_uid, "", , , [$KAFS_LIBS $KRB4_LIB_FLAGS])
-
-#
-# libroken
-#
-
-AC_FUNC_GETLOGIN
-
-AC_FIND_IF_NOT_BROKEN(hstrerror, resolv,
-[#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif],
-17)
-AC_NEED_PROTO([
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif],
-hstrerror)
-AC_FUNC_HSTRERROR_CONST
-
-AC_BROKEN(chown daemon err errx fchown flock getcwd getdtablesize getopt)
-AC_BROKEN(getusershell initgroups lstat localtime_r memmove mkstemp)
-AC_BROKEN(putenv rcmd readv recvmsg sendmsg setegid setenv seteuid)
-AC_BROKEN(strcasecmp strdup strerror strftime strlcat strlcpy strlwr)
-AC_BROKEN(strnlen strsep strsep_copy strptime strtok_r strupr unsetenv)
-AC_BROKEN(verr verrx vsyslog vwarn vwarnx warn warnx writev)
-
-AC_BROKEN(getipnodebyname getipnodebyaddr freehostent copyhostent)
-AC_BROKEN(gai_strerror freeaddrinfo getaddrinfo getnameinfo)
-AC_BROKEN(inet_aton inet_ntop inet_pton)
-
-
-if test "$ac_cv_func_inet_aton" = "yes"; then
-AC_NEED_PROTO([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif],
-inet_aton)
-fi
-
-AC_CHECK_FUNCS(fcntl getrlimit getrusage getspnam getspuid mktime setregid)
-AC_CHECK_FUNCS(setresuid setreuid setsid setsockopt sysconf sysctl)
-
-AC_CHECK_FUNCS(get_progname set_progname warnerr)
-
-AC_CHECK_FUNCS(getitimer)
-
-AC_CHECK_FUNCS(getfh fhopen)
-
-AC_CHECK_VAR([#include <stdlib.h>], optreset)dnl
-if test "$ac_cv_var_optreset" = yes; then
- AC_CHECK_DECLARATION([#include <stdlib.h>], optreset)dnl
-fi
-
-dnl
-dnl Test if hstrerror needs const (like on SunOS 5.6)
-dnl
-
-dnl XXX - AC_HSTRERROR_CONST
-
-dnl
-dnl Test if we can mmap time, speed hack
-dnl
-
-AC_FIND_FUNC(kvm_open, kvm)
-AC_FIND_FUNC(kvm_nlist, kvm)
-#AC_MMAP_TIME($with_mmap_time)
-
-dnl
-dnl prototypes
-dnl
-
-AC_NEED_PROTO([
-#include <string.h>
-],
-strtok_r)
-
-AC_NEED_PROTO([
-#include <sys/types.h>
-#include <sys/time.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-],
-select)
-
-AC_DIRENT_SYS_DIR_H
-
-AC_HAVE_STRUCT_FIELD(struct dirent, d_type,
-[#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#include <dirent.h>
-])
-
-dnl
-dnl Check for sa_len in sys/socket.h
-dnl
-
-AC_HAVE_STRUCT_FIELD(struct sockaddr,
-sa_len,
-[#include <sys/types.h>
-#include <sys/socket.h>])
-
-dnl
-dnl Check for sin_len
-dnl
-
-AC_HAVE_STRUCT_FIELD(struct sockaddr_in,
-sin_len,
-[#include <sys/types.h>
-#include <sys/socket.h>
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif])
-
-AC_HAVE_TYPE([sa_family_t],[#include <sys/socket.h>])
-AC_HAVE_TYPE([socklen_t],[#include <sys/socket.h>])
-AC_HAVE_TYPE([struct sockaddr], [#include <sys/socket.h>])
-AC_HAVE_TYPE([struct sockaddr_storage], [#include <sys/socket.h>])
-AC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])
-
-dnl
-dnl variable checks
-dnl
-
-AC_CHECK_VAR([#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif],
-h_errno)
-
-AC_CHECK_VAR([#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif],
-h_errlist)
-
-AC_CHECK_VAR([#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif],
-h_nerr)
-
-dnl
-dnl check for strange as stuff on solaris
-dnl
-
-case "$target_os" in
-solaris*)
- AC_CACHE_CHECK(if as supports .register, ac_cv_prog_as_register,[
- cat > conftest.s <<EOF
- .register %g2, #scratch
- .register %g3, #scratch
- .register %g6, #scratch
- .register %g7, #scratch
-EOF
- if $AS conftest.s >/dev/null 2>&1; then
- ac_cv_prog_as_register=yes
- else
- ac_cv_prog_as_register=no
- fi
- rm -f conftest.s a.out
-])
- if test "$ac_cv_prog_as_register" = "yes"; then
- AC_DEFINE(AS_UNDERSTANDS_REGISTER, 1,
- [define this if your as understands .register])
- fi
-esac
-
-dnl
-dnl kernel checks
-dnl
-
-dnl
-dnl bsd style
-dnl
-
-if test "$XFS_SUBDIR" = "bsd"; then
-
-
-AC_ELF_OBJECT_FORMAT
-AC_KERNEL
-
-AC_CHECK_KERNEL_FUNCS( \
-cdevsw_add \
-debuglockmgr \
-lockmgr \
-make_dev \
-vop_revoke \
-genfs_revoke \
-vfs_opv_init \
-vfs_opv_init_default \
-vfs_opv_init_explicit \
-vfs_add_vnodeops \
-vfs_attach \
-vfs_deallocate_syncvnode \
-vfs_register \
-vfs_getvfs \
-vgonel \
-zfreei \
-vfs_cache_lookup \
-vnode_pager_generic_putpages \
-vnode_pager_generic_getpages \
-vnode_pager_setsize \
-devtoname \
-udev2dev \
-snprintf \
-nosys \
-sys_nosys \
-sys_lkmnosys \
-cache_purgevfs \
-vfs_name_hash \
-)
-AC_CHECK_KERNEL_FUNC(memcpy, [0,0,0])
-
-AC_BSD_HEADER_VNODE_IF_H
-
-AC_KERNEL_NEED_PROTO([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_PROC_H
-#include <sys/proc.h>
-#endif
-#ifdef HAVE_SYS_VNODE_H
-#include <sys/vnode.h>
-#endif
-],
-vgonel)
-
-AC_KERNEL_NEED_PROTO([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_PROC_H
-#include <sys/proc.h>
-#endif
-#include <sys/signal.h>
-#include <sys/signalvar.h>
-],
-issignal)
-
-AC_KERNEL_NEED_PROTO([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_PROC_H
-#include <sys/proc.h>
-#endif
-#ifdef HAVE_SYS_VNODE_H
-#include <sys/vnode.h>
-#endif
-#ifdef HAVE_SYS_VFS_PROTO_H
-#include <sys/vfs_proto.h>
-#endif
-],
-vn_writechk)
-
-AC_KERNEL_NEED_PROTO([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_PROC_H
-#include <sys/proc.h>
-#endif
-#ifdef HAVE_SYS_VNODE_H
-#include <sys/vnode.h>
-#endif
-#ifdef HAVE_SYS_UBC_H
-#include <sys/ubc.h>
-#endif
-],
-ubc_pushdirty)
-
-AC_KERNEL_NEED_PROTO([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_LIBKERN_H
-#include <sys/libkern.h>
-#endif
-#ifdef HAVE_SYS_SYSTM_H
-#include <sys/systm.h>
-#endif
-],
-strncmp)
-
-AC_CHECK_KERNEL_VAR(doforce, int)
-AC_CHECK_KERNEL_VAR(aout_sysent, struct sysent*,[#include <sys/systm.h>])
-AC_CHECK_KERNEL_VOP_T
-AC_BSD_FUNC_VFS_OBJECT_CREATE
-AC_BSD_FUNC_VOP_LOCK
-AC_BSD_FUNC_VFS_BUSY
-AC_BSD_FUNC_VGET
-AC_BSD_FUNC_SUSER
-AC_BSD_FUNC_VFS_GETNEWFSID
-AC_BSD_FUNC_LOCKMGR
-AC_BSD_FUNC_LOCKSTATUS
-AC_BSD_FUNC_SELRECORD
-case "$target_os" in
-osf*)
-AC_OSF_FUNC_UBC_LOOKUP
-AC_OSF_FUNC_VFS_NAME_HASH
-;;
-esac
-
-AC_CHECK_DIRSIZ
-
-dnl
-dnl Find out if have have proc.p_sigmask
-dnl
-
-AC_HAVE_STRUCT_FIELD(
-struct proc,
-p_sigmask,
-[#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_PROC_H
-#include <sys/proc.h>
-#endif])
-
-AC_HAVE_STRUCT_FIELD(
-struct proc,
-p_sigctx,
-[#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_PROC_H
-#include <sys/proc.h>
-#endif])
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_PROC_H
-#include <sys/proc.h>
-#endif
-#ifdef HAVE_SYS_VNODE_H
-#include <sys/vnode.h>
-#endif
-#ifdef HAVE_SYS_MOUNT_H
-#include <sys/mount.h>
-#endif
-],
-mount,
-struct vnode *,
-mnt_syncer)
-
-dnl FreeBSD 4.5 and above changed mnt_vnodelist to mnt_nvnodelist
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_PROC_H
-#include <sys/proc.h>
-#endif
-#ifdef HAVE_SYS_VNODE_H
-#include <sys/vnode.h>
-#endif
-#ifdef HAVE_SYS_MOUNT_H
-#include <sys/mount.h>
-#endif
-],
-mount,
-struct vnodelst,
-mnt_nvnodelist)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_PROC_H
-#include <sys/proc.h>
-#endif
-#ifdef HAVE_SYS_VNODE_H
-#include <sys/vnode.h>
-#endif
-#ifdef HAVE_SYS_MOUNT_H
-#include <sys/mount.h>
-#endif
-],
-mount,
-qaddr_t,
-m_info)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-],
-vfsconf,
-int,
-vfc_refcount)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-],
-vfsconf,
-int (*)(void),
-vfc_mountroot)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/uio.h>
-],
-uio,
-struct proc *,
-uio_procp)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-],
-vfsops,
-struct vnodeopv_desc **,
-vfs_opv_descs)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-],
-vfsops,
-char *,
-vfs_name)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-],
-vfsops,
-void *,
-vfs_uninit)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-],
-vfsops,
-void *,
-vfs_reinit)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-],
-vfsops,
-struct sysctl_oid *,
-vfs_oid)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-],
-vfsops,
-int,
-vfs_done)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-],
-vfsops,
-void *,
-vfs_checkexp)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-],
-vfsops,
-void *,
-vfs_mountroot)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-],
-vfsops,
-void *,
-vfs_swapvp)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-],
-vfsops,
-void *,
-vfs_smoothsync)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#include <sys/systm.h>
-],
-sysent,
-int,
-sy_flags)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#include <sys/systm.h>
-],
-sysent,
-unsigned char,
-sy_info)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/vnode.h>
-],
-vop_fsync_args,
-int,
-a_flags)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/vnode.h>
-],
-vop_putpages_args,
-int,
-a_sync)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_PROC_H
-#include <sys/proc.h>
-#endif
-],
-proc,
-register_t *,
-p_retval)
-
-AC_HAVE_KERNEL_DEF([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_MOUNT_H
-#include <sys/mount.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_PROC_H
-#include <sys/proc.h>
-#endif
-#ifdef HAVE_SYS_SYSPROTO_H
-#include <sys/sysproto.h>
-#endif
-#ifdef HAVE_SYS_SYSCALLARGS_H
-#include <sys/syscallargs.h>
-#endif
-],
-struct setgroups_args)
-
-AC_HAVE_KERNEL_DEF([
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_MOUNT_H
-#include <sys/mount.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_PROC_H
-#include <sys/proc.h>
-#endif
-#ifdef HAVE_SYS_SYSPROTO_H
-#include <sys/sysproto.h>
-#endif
-#ifdef HAVE_SYS_SYSCALLARGS_H
-#include <sys/syscallargs.h>
-#endif
-],
-struct sys_setgroups_args)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/conf.h>
-],
-cdevsw,
-d_stop_t *,
-d_stop)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/conf.h>
-],
-cdevsw,
-d_reset_t *,
-d_reset)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/conf.h>
-],
-cdevsw,
-d_reset_t *,
-d_bogoreset)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/conf.h>
-],
-cdevsw,
-d_devtotty_t *,
-d_devtotty)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/conf.h>
-],
-cdevsw,
-d_parms_t *,
-d_bogoparms)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/conf.h>
-],
-cdevsw,
-void *,
-d_spare)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/conf.h>
-],
-cdevsw,
-int,
-d_maxio)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/conf.h>
-],
-cdevsw,
-int,
-d_bmaj)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <sys/uio.h>
-#include <sys/namei.h>
-],
-componentname,
-u_long,
-cn_hash)
-
-AC_CHECK_BSD_UVM_ONLY
-
-dnl
-dnl linux
-dnl
-
-elif test "$XFS_SUBDIR" = "linux"; then
-
-dnl Linux devfs check
-AC_CHECK_HEADERS(linux/devfs_fs.h linux/devfs_fs_kernel.h linux/stddef.h)
-
-AC_LINUX_FUNC_D_ALLOC_ROOT_TWO_ARGS
-AC_LINUX_FUNC_DEVFS_REGISTER_ELEVEN_ARGS
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#define __KERNEL__
-#include <asm/current.h>
-#include <linux/fs.h>
-],
-ViceIoctl,
-caddr_t,
-in)
-
-AC_HAVE_LINUX_KERNEL_TYPES(int8_t int16_t int32_t int64_t)
-AC_HAVE_LINUX_KERNEL_TYPES(u_int8_t u_int16_t u_int32_t u_int64_t)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <asm/current.h>
-#include <linux/fs.h>
-typedef int (*notify_change_type)(struct dentry *, struct iattr *);
-],
-super_operations,
-notify_change_type,
-notify_change)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <asm/current.h>
-#include <linux/fs.h>
-],
-inode_operations,
-struct file_operations *,
-default_file_ops)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <asm/current.h>
-#include <linux/fs.h>
-typedef int (*updatepage_type)(struct file *, struct page *, unsigned long, unsigned int, int);
-],
-inode_operations,
-updatepage_type,
-updatepage)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <asm/current.h>
-#include <linux/fs.h>
-typedef int (*bmap_type)(struct inode *,int);
-],
-inode_operations,
-bmap_type,
-bmap)
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <asm/current.h>
-#include <linux/fs.h>
-typedef int (*smap_type)(struct inode *,int);
-],
-inode_operations,
-smap_type,
-smap)
-
-AC_LINUX_TYPE_WAIT_QUEUE_HEAD_T
-AC_LINUX_TYPE_WAIT_QUEUE_TASK_LIST
-AC_LINUX_FUNC_INIT_WAITQUEUE_HEAD
-AC_LINUX_FUNC_INIT_MUTEX
-AC_LINUX_FUNC_LIST_DEL_INIT
-AC_LINUX_FILLDIR_DT_TYPE
-AC_LINUX_FUNC_DGET_LOCKED
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <asm/current.h>
-#include <linux/sched.h>
-],
-task_struct,
-[struct sigpending],
-pending)
-
-AC_LINUX_D_DELETE_VOID
-
-elif test "$XFS_SUBDIR" = "solaris"; then
-
-AC_HAVE_KERNEL_STRUCT_FIELD([
-#include <sys/types.h>
-#include <sys/vfs.h>
-typedef void (*freevfs_type)(struct vfs *);
-],
-vfsops,
-freevfs_type,
-vfs_freevfs)
-
-fi # end of OS-specific tests
-
-dnl
-dnl Global kernel checks
-dnl
-
-AC_CHECK_KERNEL_FUNCS(strlcpy)
-
-dnl
-dnl
-dnl
-
-AC_MSG_CHECKING(for working htonl)
-AC_CACHE_VAL(ac_cv_htonl_works, [
-AC_TRY_LINK([#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-],
-[htonl(0);],
-ac_cv_htonl_works=yes,
-ac_cv_htonl_works=no)])
-AC_MSG_RESULT($ac_cv_htonl_works)
-
-if test "$ac_cv_htonl_works" = "no"; then
-AC_MSG_CHECKING(if htonl is repairable)
-AC_CACHE_VAL(ac_cv_htonl_hack_works, [
-AC_TRY_LINK(
-[#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#define htonl(x) __cpu_to_be32(x)
-],
-[htonl(0);],
-ac_cv_htonl_hack_works=yes,
-ac_cv_htonl_hack_works=no)])
-AC_MSG_RESULT($ac_cv_htonl_hack_works)
-
-if test "$ac_cv_htonl_hack_works" = "no"; then
-AC_MSG_ERROR([Cannot repair htonl])
-else
- AC_DEFINE(HAVE_REPAIRABLE_HTONL, 1, [define?])
-fi
-
-fi
-
-# Almost done....
-
-AC_OUTPUT(Makefile \
- include/Makefile \
- arlad/Makefile \
- lwp/Makefile \
- xfs/Makefile \
- $XFS_SUBDIR_Makefile \
- $XFS_SUBDIR_BIN_Makefile \
- rx/Makefile \
- $RXKAD_MAKEFILE \
- rxdef/Makefile \
- appl/Makefile \
- appl/lib/Makefile \
- appl/asrvutil/Makefile \
- appl/kalog/Makefile \
- appl/afsmgr/Makefile \
- appl/afsutils/Makefile \
- appl/amon/Makefile \
- appl/fs/Makefile \
- appl/pts/Makefile \
- appl/udebug/Makefile \
- appl/vos/Makefile \
- appl/bos/Makefile \
- appl/mac/Makefile \
- appl/mac/Arla_Configuration/Makefile \
- appl/mac/Arla_Configuration/Info.plist \
- doc/Makefile \
- lib/Makefile \
- lib/roken/Makefile \
- lib/sl/Makefile \
- lib/cmd/Makefile \
- lib/editline/Makefile \
- lib/ko/Makefile \
- lib/acl/Makefile \
- lib/bufdir/Makefile \
- util/Makefile \
- ydr/Makefile \
- conf/Makefile \
- conf/arla.spec \
- milko/Makefile \
- milko/lib/Makefile \
- milko/lib/vstatus/Makefile \
- milko/lib/dpart/Makefile \
- milko/lib/voldb/Makefile \
- milko/lib/vld/Makefile \
- milko/lib/ropa/Makefile \
- milko/lib/msecurity/Makefile \
- milko/lib/mlog/Makefile \
- milko/appl/Makefile \
- milko/appl/sked/Makefile \
- milko/appl/perf/Makefile \
- milko/appl/bootstrap/Makefile \
- milko/fs/Makefile \
- milko/vldb/Makefile \
- milko/pts/Makefile \
- milko/bos/Makefile \
- tests/Makefile)
-
-AC_KRB_VERSION
diff --git a/usr.sbin/afs/src/doc/Makefile.in b/usr.sbin/afs/src/doc/Makefile.in
deleted file mode 100644
index df37048a608..00000000000
--- a/usr.sbin/afs/src/doc/Makefile.in
+++ /dev/null
@@ -1,195 +0,0 @@
-# $KTH: Makefile.in,v 1.18 2000/12/01 08:30:46 lha Exp $
-#
-
-SHELL = /bin/sh
-ED = ed
-AWK = awk
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-top_builddir = ..
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-infodir = @infodir@
-mandir = @mandir@
-
-DISTDIR =
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
-PACKAGE = @PACKAGE@
-VERSION = @VERSION@
-
-info_TEXINFOS = arla.texi
-arla_TEXINFOS = ack.texi \
- intro.texi \
- partsofarla.texi \
- tools.texi \
- debugging.texi \
- authors.texi \
- storage.texi \
- timeline.texi \
- real-world.texi \
- index.texi \
- afs-basics.texi
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../include/config.h
-CONFIG_CLEAN_FILES =
-TEXI2DVI = @TEXI2DVI@
-TEXI2PDF = @TEXI2PDF@
-TEXI2HTML = @TEXI2HTML@
-TEXINFO_TEX = $(srcdir)/texinfo.tex
-INFO_DEPS = arla.info
-DVIS = arla.dvi
-MAKEINFO = @MAKEINFO@
-TEXINFOS = arla.texi
-DIST_COMMON = $(arla_TEXINFOS) Makefile.am Makefile.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = tar
-GZIP = --best
-all: Makefile
-
-.SUFFIXES:
-.SUFFIXES: .dvi .info .ps .texi .texinfo .txi .pdf .html
-
-Makefile: Makefile.in ../config.status
- cd .. && CONFIG_FILES=doc/Makefile CONFIG_HEADERS= $(SHELL) ./config.status
-
-arla.info: arla.texi $(arla_TEXINFOS)
-arla.dvi: arla.texi $(arla_TEXINFOS)
-
-ack.texi: ack.texi.in Makefile.in ../THANKS
- rm -f tempfile
- $(AWK) 'BEGIN { FS="|";foo=0;printf("/%%THANKS%%\nd\ni\n"); } \
- /@/ { if (foo) { \
- printf("@item %s\n\n",$$1);\
- } \
- } /expect you to/ { foo=1; } \
- END { printf(".\n1,$$s/<.*@/&@/g\n1,$$s/</\\\n@tab @email{/g\n1,$$s/>/}/g\nw %s\nq\n", "$(srcdir)/ack.texi") ;} ' < $(srcdir)/../THANKS > tempfile
- $(ED) $(srcdir)/ack.texi.in < tempfile
- rm -f tempfile
-
-DVIPS = @DVIPS@
-
-.texi.info:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.texi.dvi:
- TEXINPUTS=$(srcdir):$$TEXINPUTS \
- MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
-
-.texi.pdf:
- TEXINPUTS=$(srcdir):$$TEXINPUTS \
- MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2PDF) $<
-
-.texi.html:
- TEXINPUTS=$(srcdir):$$TEXINPUTS \
- MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2HTML) -split=chapter $<
-
-.texi:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.texinfo.info:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.texinfo:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.texinfo.dvi:
- TEXINPUTS=$(srcdir):$$TEXINPUTS \
- MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
-
-.txi.info:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.txi.dvi:
- TEXINPUTS=$(srcdir):$$TEXINPUTS \
- MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
-
-.txi:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-.dvi.ps:
- $(DVIPS) $< -o $@
-
-install:
- $(mkinstalldirs) $(DESTDIR)$(infodir)
- @for file in $(INFO_DEPS); do \
- d=$(srcdir); \
- for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
- if test -f $$d/$$ifile; then \
- echo "$(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
- $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
- else : ; fi; \
- done; \
- done
-
-uninstall:
- @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
- ii=yes; \
- else ii=; fi; \
- for file in $(INFO_DEPS); do \
- test -z "$ii" \
- || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
- done
- for file in $(INFO_DEPS); do \
- (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
- done
-
-dist-info: $(INFO_DEPS)
- for base in $(INFO_DEPS); do \
- d=$(srcdir); \
- for file in `cd $$d && eval echo $$base*`; do \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
- done; \
- done
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = doc
-
-distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
- done
- $(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
-info: $(INFO_DEPS)
-dvi: $(DVIS)
-
-clean:
- rm -f arla.aux arla.cp arla.cps arla.dvi arla.fn arla.fns arla.ky \
- arla.kys arla.ps arla.log arla.pg arla.toc arla.tp arla.tps \
- arla.vr arla.vrs arla.op arla.tr arla.cv arla.cn *.html
-
-distclean:
- rm -f *.dvi *.info *.ps *.ps *.html *.pdf
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/usr.sbin/afs/src/doc/ack.texi b/usr.sbin/afs/src/doc/ack.texi
deleted file mode 100644
index 96e6a74edd8..00000000000
--- a/usr.sbin/afs/src/doc/ack.texi
+++ /dev/null
@@ -1,191 +0,0 @@
-@c Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-@c $arla: ack.texi,v 1.20 2002/05/26 14:49:33 lha Exp $
-
-@node Acknowledgments, Index, Authors, Top
-@comment node-name, next, previous, up
-@appendix Acknowledgments
-
-lwp and rx are copyrighted by IBM. We're grateful to Derrick J
-Brashear @email{shadow@@dementia.org} and Jim Doyle @email{jrd@@bu.edu}
-for making them available.
-
-the @code{rxkad} implementation was written by Björn Grönvall
-@email{bg@@sics.se} and is also part of the kth-krb distribution.
-
-Some of the files in @file{libroken} come from Berkeley by the way of
-NetBSD/FreeBSD
-
-@code{editline} was written by Simmule Turner and Rich Salz.
-
-The code for gluing these together were written by ourselves.
-
-Bugfixes, documentation, encouragement, and code has been contributed by:
-
-@multitable @columnfractions .5 .5
-
-@item Aaron M. Ucko
-@tab @email{amu@@MIT.EDU}
-
-@item Alec Wolman
-@tab @email{wolman@@cs.washington.edu}
-
-@item Alexandra Ellwood
-@tab @email{lxs@@MIT.EDU}
-
-@item Brad Keryan
-@tab @email{keryan@@andrew.cmu.edu}
-
-@item Constantine Sapuntzakis
-@tab @email{csapuntz@@openbsd.org}
-
-@item Dan Winship
-@tab @email{danw@@MIT.EDU}
-
-@item Derrick J Brashear
-@tab @email{shadow@@dementia.org}
-
-@item Harald Barth
-@tab @email{haba@@pdc.kth.se}
-
-@item Jim Doyle
-@tab @email{jrd@@bu.edu}
-
-@item John Davison
-@tab @email{davisoja@@clarkson.edu}
-
-@item John Hawkinson
-@tab @email{jhawk@@MIT.EDU}
-
-@item Karl Ramm
-@tab @email{kcr@@MIT.EDU}
-
-@item Mark Eichin
-@tab @email{eichin@@kitten.gen.ma.us}
-
-@item Per Boussard T/ED
-@tab @email{Per.Boussard@@era-t.ericsson.se}
-
-@item Dima Ruban
-@tab @email{dima@@best.net}
-
-@item Max
-@tab @email{davros@@cyclone.Stanford.EDU}
-
-@item Andrzej Filinski
-@tab @email{andrzej@@daimi.aau.dk}
-
-@item Chuck Lever
-@tab @email{chuckl@@netscape.com}
-
-@item WUWEI SHEN
-@tab @email{wwshen@@engin.umich.edu}
-
-@item Cheng Jin
-@tab @email{chengjin@@eecs.umich.edu}
-
-@item Paul Callaway
-@tab @email{pcallawa@@umich.edu}
-
-@item Brandon S. Allbery
-@tab @email{allbery@@ece.cmu.edu}
-
-@item Ken Raeburn
-@tab @email{raeburn@@raeburn.org}
-
-@item Jeffrey Hutzelman
-@tab @email{jhutz+@@cmu.edu}
-
-@item Hee-Seok Heo
-@tab @email{hsheo@@postech.ac.kr}
-
-@item Paul Ewing Jr.
-@tab @email{ewing@@ima.umn.edu}
-
-@item Niklas Hallqvist
-@tab @email{niklas@@appli.se}
-
-@item Marko Asplund
-@tab @email{aspa@@hip.fi}
-
-@item Chris Wing
-@tab @email{wingc@@engin.umich.edu}
-
-@item Simon Josefsson
-@tab @email{jas@@pdc.kth.se}
-
-@item Magnus Lindström
-@tab @email{magnus.lindstrom@@s3.kth.se}
-
-@item Greg Stark
-@tab @email{gsstark@@mit.edu}
-
-@item Matt
-@tab @email{deberg@@mit.edu}
-
-@item Björn Grönvall
-@tab @email{bg@@sics.se}
-
-@item Tino Schwarze
-@tab @email{tino.schwarze@@informatik.tu-chemnitz.de}
-
-@item David Sanderson
-@tab @email{david@@transarc.ibm.com}
-
-@item Roman Hodek
-@tab @email{Roman.Hodek@@informatik.uni-erlangen.de}
-
-@item Michael Sperber
-@tab @email{sperber@@informatik.uni-tuebingen.de}
-
-@item Dr. Lex Wennmacher
-@tab @email{wennmach@@geo.Uni-Koeln.DE}
-
-@item Janne Johansson
-@tab @email{jj@@dynarc.se}
-
-@item Dr A V Le Blanc
-@tab @email{LeBlanc@@mcc.ac.uk}
-
-@item Dave Morrison
-@tab @email{dave@@bnl.gov}
-
-@item Jochen Saile
-@tab @email{saile@@sfs.nphil.uni-tuebingen.de}
-
-@item Chris Kuklewicz
-@tab @email{chrisk@@MIT.EDU}
-
-@item Nickolai Zeldovich
-@tab @email{kolya@@MIT.EDU}
-
-@item Adam Thornton
-@tab @email{adam@@sinenomine.net}
-
-@item Neale Ferguson
-@tab @email{Neale.Ferguson@@SoftwareAG-usa.com}
-
-@item Hidvegi
-@tab @email{hzoli@@austin.ibm.com}
-
-@item Todd T. Fries
-@tab @email{todd@@fries.net}
-
-@item Andrea Campi
-@tab @email{andrea@@webcom.it}
-
-@item William Uther
-@tab @email{will+@@cs.cmu.edu}
-
-
-@end multitable
-
-If you have done something and are not mentioned here, please send
-mail to @email{arla-drinkers@@stacken.kth.se}.
-
-If you are mentioned here and have not contributed, that's because we
-expect you to.
-
-
-
diff --git a/usr.sbin/afs/src/doc/ack.texi.in b/usr.sbin/afs/src/doc/ack.texi.in
deleted file mode 100644
index 1b13017587e..00000000000
--- a/usr.sbin/afs/src/doc/ack.texi.in
+++ /dev/null
@@ -1,39 +0,0 @@
-@c Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-@c $arla: ack.texi.in,v 1.5 2000/12/01 08:30:45 lha Exp $
-
-@node Acknowledgments, Index, Authors, Top
-@comment node-name, next, previous, up
-@appendix Acknowledgments
-
-lwp and rx are copyrighted by IBM. We're grateful to Derrick J
-Brashear @email{shadow@@dementia.org} and Jim Doyle @email{jrd@@bu.edu}
-for making them available.
-
-the @code{rxkad} implementation was written by Björn Grönvall
-@email{bg@@sics.se} and is also part of the kth-krb distribution.
-
-Some of the files in @file{libroken} come from Berkeley by the way of
-NetBSD/FreeBSD
-
-@code{editline} was written by Simmule Turner and Rich Salz.
-
-The code for gluing these together were written by ourselves.
-
-Bugfixes, documentation, encouragement, and code has been contributed by:
-
-@multitable @columnfractions .5 .5
-
-%THANKS%
-
-@end multitable
-
-If you have done something and are not mentioned here, please send
-mail to @email{arla-drinkers@@stacken.kth.se}.
-
-If you are mentioned here and have not contributed, that's because we
-expect you to.
-
-
-
diff --git a/usr.sbin/afs/src/doc/afs-basics.texi b/usr.sbin/afs/src/doc/afs-basics.texi
deleted file mode 100644
index f433d32a4c8..00000000000
--- a/usr.sbin/afs/src/doc/afs-basics.texi
+++ /dev/null
@@ -1,262 +0,0 @@
-@c Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-
-@c $arla: afs-basics.texi,v 1.17 2000/12/01 08:31:07 lha Exp $
-
-@node AFS infrastructure, Organization of data, Introduction, Top
-@comment node-name, next, previous, up
-@chapter AFS infrastructure
-
-This is an overview of the AFS infrastructure as viewed from a Transarc
-perspective, since most people still run Transarc cells.
-
-@section AFS Filespace
-
-@cindex AFS Filespace
-@cindex Filespace
-@cindex Cell
-
-AFS filespace is split up in smaller parts called cells. These cells are
-usually listed under @file{/afs}. A cell is usually a whole organization
-or an adminstative unit within an organization. An example is e.kth.se
-(with the path @file{/afs/e.kth.se}), that is the department of
-electrical engineering at KTH, which obviously has the @file{e.kth.se}
-domain in DNS. Using DNS domains for cell names is the typical and most
-convenient way.
-
-Note that cell names are written in lowercase by convention.
-
-@section CellServDB
-
-@cindex CellServDB
-All cells (and their db-servers) in the AFS world are listed in a file
-named @file{CellServDB}. There is a central copy that is maintained by
-Transarc at @file{/afs/transarc.com/service/etc/CellServDB}.
-
-In spite of being organized in IPnumber - name pairs, where the name
-parts resemble comments, both values are used by Transarc software and
-confusion may arise if they are not synchronized with each other.
-
-@example
-
->e.kth.se # Royal Institute of Technology, Elektro
-130.237.48.8 #sonen.e.kth.se.
-130.237.48.7 #anden.e.kth.se.
-130.237.48.244 #fadern.e.kth.se.
-
-@end example
-
-Again, please note that the text after the # in the cell-name is a
-comment, @strong{but} the hostnames after the # on the rows of an
-IP-address is @strong{not} a comment. The host and the ip-address needs
-to point at the same computer.
-
-@section AFSDB
-
-@cindex AFSDB
-@cindex DNS
-
-In addition Arla can use DNS to find the db-servers of a cell. The DNS
-resource record that is used is the @samp{AFSDB}. The resourcerecord was
-created by Transarc but have never been implemeted in released
-software.
-
-@samp{AFSDB} tells you what machines are db servers for a particular
-cell. The @samp{AFSDB} resourcerecord is also used for DCE/DFS. An example
-(the 1 means AFS, 2 is used for DCE):
-
-@example
-e.kth.se. IN AFSDB 1 fadern.e.kth.se.
-e.kth.se. IN AFSDB 1 sonen.e.kth.se.
-e.kth.se. IN AFSDB 1 anden.e.kth.se.
-@end example
-
-@section Shortcut names
-
-Some cells use the abbreviated version
-@file{/afs/<word-before-first-dot>} (in the example above that would be
-@file{/afs/e/}. This might be convenient when typing them, but is a bad
-idea, because it does not create the same name space everywhere. If you
-create a symbolic link to @file{/afs/e/foo/bar}, it will not work for
-people in other cells.
-
-@section Server organization
-
-There are several servers running in an AFS cell. For performance and
-redundancy reasons, these servers are often run on different hosts.
-There is a built in hierarchy within the servers (in two different
-dimensions).
-
-There is one server that keeps track of the other servers within a host,
-restart them when they die, make sure they run in the correct order,
-save their core-files when they crash, and provide an interface for the
-sysadmin to start/stop/restart the servers. This server is called
-bos-server (Basic Overseer Server).
-
-Another hierarchy is the one who keeps track of data (volumes, users,
-passwords, etc) and who is performing the real hard work (serving files)
-There is the the database server that keeps the database (obviously),
-and keeps several database copies on different hosts relpicated with
-Ubik (see below). The fileserver and the client software (like the
-afsd/arlad, pts and, vos) are pulling meta-data out of the dbserver to
-find where to find user-privileges and where volumes resides.
-
-@section Basic overseer - boserver
-
-@cindex Bos server
-The Bos server is making sure the servers are running. If they crash, it
-saves the corefile, and starts a new server. It also makes sure that
-servers/services that are not supposted to run at the same time do not.
-An example of this is the fileserver/volserver and salvage. It would be
-devastating if salvage tried to correct data that the fileserver is
-changing. The salvager is run before the fileserver starts. The
-administrator can also force a file server to run through salvage again.
-
-@section Ubik
-
-@cindex Ubik
-Ubik is a distributed database. It is really a (distributed) flat file
-that you can perform read/write/lseek operation on. The important
-property of Ubik is that it provides a way to make sure that updates are
-done once (transactions), and that the database is kept consistent. It
-also provides read-only access to the database when there is one (or
-more) available database-server(s).
-
-This works the following way: A newly booted server sends out a message
-to all other servers that tells them that it believes that it is the new
-master server. If the server gets a notice back from an other server
-that tells it that the other server believes that it (or a third server)
-is the master, depending on how long it has been masterserver it will
-switch to the new server. If they can't agree, the one with the lowest
-ip-address is supposed to win the argument. If the server is a slave it
-still updates the database to the current version of the database.
-
-A update to the database can only be done if more than half of the
-servers are available and vote for the master. A update is first
-propaged to all servers, then after that is done, and if all servers
-agree with the change, a commit message is sent out from the server, and
-the update is written to disk and the serial number of the database is
-increased.
-
-All servers in AFS use Ubik to store their data.
-
-@section Volume Location database server - vlserver
-
-@cindex Vlserver
-@cindex Vldbserver
-The vldb-server is resposible for the information on what fileserver
-every volume resides and of what kind of volumes exists on each
-fileserver.
-
-To confuse you even more there are three types of support for the
-clients. Basically there is AFS 3.3, 3.4, and 3.6 support. The different
-interfaces look the same for the system administrator, but there are
-some important differences.
-
-AFS 3.3 is the classic interface. 3.4 adds the possibility of multihomed
-servers for the client to talk to, and that introduces the N interface.
-To deal with multihomed clients AFS 3.5 was introduced. This is called
-call the U interface. The name is due to how the functions are named.
-
-The N interface added more replication-sites in the database-entry
-structure. The U interface changed the server and clients in two ways.
-
-When a 3.5 server boot it registers all its ip-addresses. This means
-that a server can add (or remove) an network interface without
-rebooting. When registering at the vldb server, the file server presents
-itself with an UUID, an unique identifier. This UUID will be stored in a
-file so the UUID keeps constant even when network addresses are changed,
-added, or removed.
-
-@section Protection server - ptserver
-
-@cindex Ptserver
-The protection server keeps track of all users and groups. It's used a
-lot by the file servers. Users can self create, modify and delete
-groups.
-
-When a fileserver is access they are durring the authentication giving
-the name of the client. This name if looked up in the
-protection-database via the protection server that returns the id of the
-user and all the groups that the user belongs too.
-
-This information is used when to check if the user have access to a
-particular file or directory. All files created by the user are assigned
-the user id that the protectionserver returned.
-
-@section Kerberos server - kaserver
-
-The kaserver is a Kerberos server, but in other clothes. There is a new
-RPC interface to get tickets (tokens) and administer the server. The
-old Kerberos v4 interface is also implemented, and can be used by
-ordinary Kerberos v4 clients.
-
-You can replace this server with an Heimdal kdc, since it provides a
-superset of the functionality.
-
-@section Backup server - buserver
-
-@cindex Backup server
-@cindex Buserver
-The backup server keeps the backup database that is used when backing up
-and restoring volumes. The backup server is not used by other servers,
-only operators.
-
-@section Update server - upserver
-
-@cindex Upserver
-With the update server its possible to automagicly update configuration
-files, server binaries. You keep masters that are supposed to contain the
-correct copy of all the files and then other servers can fetch them from there.
-
-@section Fileserver and Volume Server - fs and volser
-
-@cindex Fileserver
-@cindex Fsserver
-@cindex Volser
-@cindex Volumeserver
-The file server serves data to the clients, keeps track of callbacks,
-and breaks callbacks when needed. Volser is the administative interface
-where you add, move, change, and delete volumes from the server.
-
-The volume server and file server are ran at the same time and they sync
-with each other to make sure that fileserver does not access a volume
-that volser is about to modify.
-
-Every time a fileserver is started it registers it IP addresses with the
-vldbserserver using the VL_RegisterAddrs rpc-call. As the unique identifier
-for itself it uses its afsUUID.
-
-The afsUUID for a fileserver is stored in /usr/afs/local/sysid. This is
-the reson you must not clone a server w/o removing the sysid
-file. Otherwise the new filserver will register as the old one and all
-volumes on the old fileserver are pointed to the new one (where the
-probably doesn't exist).
-
-The fileserver doesn't bind to a specific interface (read address), gets
-all packets that are destined for port 7000 (afs-fileserver/udp). All
-outgoing packets are send on the same socket, and means that your
-operatingsystem will choose the source-address of the udp datagram.
-
-This have the side-effect that you will have asymmetric routing on
-mulithomed fileserver for 3.4 (and older) compatible clients if they
-don't use the closest address when sorting the vldb entry. Arla avoids
-this problem.
-
-@section Salvage
-
-@cindex Salvage
-Salvage is not a real server. It is run before the fileserver and volser
-are started to make sure the partitions are consistent.
-
-It's imperative that salvager is NOT run at the same time as the
-fileserver/volser is running.
-
-@section Things that milko does differently.
-
-Fileserver, volumeserver, and salvage are all in one program.
-
-There is no bu nor ka-server. The ka-server is replaced by kth-krb or
-Heimdal. Heimdal's kdc even implements a ka-server readonly interface,
-so your users can keep using programs like klog.
diff --git a/usr.sbin/afs/src/doc/arla-logo.eps b/usr.sbin/afs/src/doc/arla-logo.eps
deleted file mode 100644
index 09e519477b1..00000000000
--- a/usr.sbin/afs/src/doc/arla-logo.eps
+++ /dev/null
@@ -1 +0,0 @@
-%!PS-Adobe-3.0 %%Creator: Adobe Illustrator(R) 8.0 %%AI8_CreatorVersion: 8 %%For: (- - -) (KTH/Nada) %%CreationDate: (5/1/00) (8:41 PM) %%BoundingBox: 112 349 500 552 %%HiResBoundingBox: 112.9502 349.9502 499.0498 552 %%DocumentProcessColors: Black %%DocumentSuppliedResources: procset Adobe_level2_AI5 1.2 0 %%+ procset Adobe_ColorImage_AI6 1.3 0 %%+ procset Adobe_Illustrator_AI5 1.3 0 %%+ procset Adobe_cshow 2.0 8 %%+ procset Adobe_shading_AI8 1.0 0 %AI5_FileFormat 4.0 %AI3_ColorUsage: Black&White %AI7_ImageSettings: 0 %%CMYKProcessColor: 1 1 1 1 ([Passm\212rke]) %%AI6_ColorSeparationSet: 1 1 (AI6 Default Color Separation Set) %%+ Options: 1 16 0 1 0 1 1 1 0 1 1 1 1 8.504 0 0 0 0 0 0 0 0 -1 -1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 2 3 4 %%+ PPD: 1 21 0 0 60 45 2 2 1 0 0 1 0 0 0 0 0 0 0 0 0 0 () %AI3_TemplateBox: 306 396 306 396 %AI3_TileBox: 25 -5 584 801 %AI3_DocumentPreview: None %AI5_ArtSize: 595.2756 841.8898 %AI5_RulerUnits: 2 %AI5_ArtFlags: 0 0 0 1 0 0 1 0 0 %AI5_TargetResolution: 800 %AI5_NumLayers: 2 %AI8_OpenToView: -325.5 991.5 0.6667 1040 762 18 1 1 0 22 0 0 %AI5_OpenViewLayers: 72 %%PageOrigin:25 -5 %%AI3_PaperRect:-17 822 577 -19 %%AI3_Margin:17 -16 -18 19 %AI7_GridSettings: 24 8 24 8 1 0 0.8 0.8 0.8 0.9 0.9 0.9 %%EndComments %%BeginProlog %%BeginResource: procset Adobe_level2_AI5 1.2 0 %%Title: (Adobe Illustrator (R) Version 5.0 Level 2 Emulation) %%Version: 1.2 0 %%CreationDate: (04/10/93) () %%Copyright: ((C) 1987-1996 Adobe Systems Incorporated All Rights Reserved) userdict /Adobe_level2_AI5 26 dict dup begin put /packedarray where not { userdict begin /packedarray { array astore readonly } bind def /setpacking /pop load def /currentpacking false def end 0 } if pop userdict /defaultpacking currentpacking put true setpacking /initialize { Adobe_level2_AI5 begin } bind def /terminate { currentdict Adobe_level2_AI5 eq { end } if } bind def mark /setcustomcolor where not { /findcmykcustomcolor { (AI8_CMYK_CustomColor) 6 packedarray } bind def /findrgbcustomcolor { (AI8_RGB_CustomColor) 5 packedarray } bind def /setcustomcolor { exch aload pop dup (AI8_CMYK_CustomColor) eq { pop pop 4 { 4 index mul 4 1 roll } repeat 5 -1 roll pop setcmykcolor } { dup (AI8_RGB_CustomColor) eq { pop pop 3 { 1 exch sub 3 index mul 1 exch sub 3 1 roll } repeat 4 -1 roll pop setrgbcolor } { pop 4 { 4 index mul 4 1 roll } repeat 5 -1 roll pop setcmykcolor } ifelse } ifelse } def } if /setAIseparationgray { false setoverprint 0 setgray /setseparationgray where{ pop setseparationgray }{ /setcolorspace where{ pop [/Separation (All) /DeviceCMYK {dup dup dup}] setcolorspace 1 exch sub setcolor }{ setgray }ifelse }ifelse } def /gt38? mark {version cvr cvx exec} stopped {cleartomark true} {38 gt exch pop} ifelse def userdict /deviceDPI 72 0 matrix defaultmatrix dtransform dup mul exch dup mul add sqrt put userdict /level2? systemdict /languagelevel known dup { pop systemdict /languagelevel get 2 ge } if put /level2ScreenFreq { begin 60 HalftoneType 1 eq { pop Frequency } if HalftoneType 2 eq { pop GrayFrequency } if HalftoneType 5 eq { pop Default level2ScreenFreq } if end } bind def userdict /currentScreenFreq level2? {currenthalftone level2ScreenFreq} {currentscreen pop pop} ifelse put level2? not { /setcmykcolor where not { /setcmykcolor { exch .11 mul add exch .59 mul add exch .3 mul add 1 exch sub setgray } def } if /currentcmykcolor where not { /currentcmykcolor { 0 0 0 1 currentgray sub } def } if /setoverprint where not { /setoverprint /pop load def } if /selectfont where not { /selectfont { exch findfont exch dup type /arraytype eq { makefont } { scalefont } ifelse setfont } bind def } if /cshow where not { /cshow { [ 0 0 5 -1 roll aload pop ] cvx bind forall } bind def } if } if cleartomark /anyColor? { add add add 0 ne } bind def /testColor { gsave setcmykcolor currentcmykcolor grestore } bind def /testCMYKColorThrough { testColor anyColor? } bind def userdict /composite? 1 0 0 0 testCMYKColorThrough 0 1 0 0 testCMYKColorThrough 0 0 1 0 testCMYKColorThrough 0 0 0 1 testCMYKColorThrough and and and put composite? not { userdict begin gsave /cyan? 1 0 0 0 testCMYKColorThrough def /magenta? 0 1 0 0 testCMYKColorThrough def /yellow? 0 0 1 0 testCMYKColorThrough def /black? 0 0 0 1 testCMYKColorThrough def grestore /isCMYKSep? cyan? magenta? yellow? black? or or or def /customColor? isCMYKSep? not def end } if end defaultpacking setpacking %%EndResource %%BeginProcSet: Adobe_ColorImage_AI6 1.3 0 userdict /Adobe_ColorImage_AI6 known not { userdict /Adobe_ColorImage_AI6 53 dict put } if userdict /Adobe_ColorImage_AI6 get begin /initialize { Adobe_ColorImage_AI6 begin Adobe_ColorImage_AI6 { dup type /arraytype eq { dup xcheck { bind } if } if pop pop } forall } def /terminate { end } def currentdict /Adobe_ColorImage_AI6_Vars known not { /Adobe_ColorImage_AI6_Vars 41 dict def } if Adobe_ColorImage_AI6_Vars begin /plateindex -1 def /_newproc null def /_proc1 null def /_proc2 null def /sourcearray 4 array def /_ptispace null def /_ptiname null def /_pti0 0 def /_pti1 0 def /_ptiproc null def /_ptiscale 0 def /_pticomps 0 def /_ptibuf 0 string def /_gtigray 0 def /_cticmyk null def /_rtirgb null def /XIEnable true def /XIType 0 def /XIEncoding 0 def /XICompression 0 def /XIChannelCount 0 def /XIBitsPerPixel 0 def /XIImageHeight 0 def /XIImageWidth 0 def /XIImageMatrix null def /XIRowBytes 0 def /XIFile null def /XIBuffer1 null def /XIBuffer2 null def /XIBuffer3 null def /XIDataProc null def /XIColorSpace /DeviceGray def /XIColorValues 0 def /XIPlateList false def end /ci6colorimage /colorimage where {/colorimage get}{null} ifelse def /ci6image systemdict /image get def /ci6curtransfer systemdict /currenttransfer get def /ci6curoverprint /currentoverprint where {/currentoverprint get}{{_of}} ifelse def /ci6foureq { 4 index ne { pop pop pop false }{ 4 index ne { pop pop false }{ 4 index ne { pop false }{ 4 index eq } ifelse } ifelse } ifelse } def /ci6testplate { Adobe_ColorImage_AI6_Vars begin /plateindex -1 def /setcmykcolor where { pop gsave 1 0 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub 0 1 0 0 setcmykcolor systemdict /currentgray get exec 1 exch sub 0 0 1 0 setcmykcolor systemdict /currentgray get exec 1 exch sub 0 0 0 1 setcmykcolor systemdict /currentgray get exec 1 exch sub grestore 1 0 0 0 ci6foureq { /plateindex 0 def }{ 0 1 0 0 ci6foureq { /plateindex 1 def }{ 0 0 1 0 ci6foureq { /plateindex 2 def }{ 0 0 0 1 ci6foureq { /plateindex 3 def }{ 0 0 0 0 ci6foureq { /plateindex 5 def } if } ifelse } ifelse } ifelse } ifelse pop pop pop pop } if plateindex end } def /ci6concatprocs { /packedarray where { pop dup type /packedarraytype eq 2 index type /packedarraytype eq or }{ false } ifelse { /_proc2 exch cvlit def /_proc1 exch cvlit def _proc1 aload pop _proc2 aload pop _proc1 length _proc2 length add packedarray cvx }{ /_proc2 exch cvlit def /_proc1 exch cvlit def /_newproc _proc1 length _proc2 length add array def _newproc 0 _proc1 putinterval _newproc _proc1 length _proc2 putinterval _newproc cvx } ifelse } def /ci6istint { type /arraytype eq } def /ci6isspot { dup type /arraytype eq { dup length 1 sub get /Separation eq }{ pop false } ifelse } def /ci6spotname { dup ci6isspot {dup length 2 sub get}{pop ()} ifelse } def /ci6altspace { aload pop pop pop ci6colormake } def /ci6numcomps { dup /DeviceGray eq { pop 1 }{ dup /DeviceRGB eq { pop 3 }{ /DeviceCMYK eq { 4 }{ 1 } ifelse } ifelse } ifelse } def /ci6marksplate { dup /DeviceGray eq { pop plateindex 3 eq }{ dup /DeviceRGB eq { pop plateindex 5 ne }{ dup /DeviceCMYK eq { pop plateindex 5 ne }{ dup ci6isspot { /findcmykcustomcolor where { pop dup length 2 sub get 0.1 0.1 0.1 0.1 5 -1 roll findcmykcustomcolor 1 setcustomcolor systemdict /currentgray get exec 1 ne }{ pop plateindex 5 ne } ifelse }{ pop plateindex 5 ne } ifelse } ifelse } ifelse } ifelse } def /ci6colormake { dup ci6numcomps exch 1 index 2 add 1 roll dup 1 eq {pop}{array astore} ifelse exch } def /ci6colorexpand { dup ci6spotname exch dup ci6istint { ci6altspace exch 4 1 roll }{ 1 3 1 roll } ifelse } def /ci6colortint { dup /DeviceGray eq { 3 1 roll 1 exch sub mul 1 exch sub exch }{ dup /DeviceRGB eq { 3 1 roll {1 exch sub 1 index mul 1 exch sub exch} forall pop 3 array astore exch }{ dup /DeviceCMYK eq { 3 1 roll {1 index mul exch} forall pop 4 array astore exch }{ 3 1 roll mul exch } ifelse } ifelse } ifelse } def /ci6colortocmyk { dup /DeviceGray eq { pop 1 exch sub 0 0 0 4 -1 roll 4 array astore }{ dup /DeviceRGB eq { pop aload pop _rgbtocmyk 4 array astore }{ dup /DeviceCMYK eq { pop }{ ci6altspace ci6colortint ci6colortocmyk } ifelse } ifelse } ifelse } def /ci6makeimagedict { 7 dict begin /ImageType 1 def /Decode exch def /DataSource exch def /ImageMatrix exch def /BitsPerComponent exch def /Height exch def /Width exch def currentdict end } def /ci6stringinvert { 0 1 2 index length 1 sub { dup 2 index exch get 255 exch sub 2 index 3 1 roll put } for } def /ci6stringknockout { 0 1 2 index length 1 sub { 255 2 index 3 1 roll put } for } def /ci6stringapply { 0 1 4 index length 1 sub { dup 4 index exch get 3 index 3 1 roll 3 index exec } for pop exch pop } def /ci6walkrgbstring { 0 3 index dup length 1 sub 0 3 3 -1 roll { 3 getinterval {} forall 5 index exec 3 index } for 5 {pop} repeat } def /ci6walkcmykstring { 0 3 index dup length 1 sub 0 4 3 -1 roll { 4 getinterval {} forall 6 index exec 3 index } for 5 { pop } repeat } def /ci6putrgbtograystr { .11 mul exch .59 mul add exch .3 mul add cvi 3 copy put pop 1 add } def /ci6putcmyktograystr { exch .11 mul add exch .59 mul add exch .3 mul add dup 255 gt { pop 255 } if 255 exch sub cvi 3 copy put pop 1 add } def /ci6rgbtograyproc { Adobe_ColorImage_AI6_Vars begin sourcearray 0 get exec XIBuffer3 dup 3 1 roll /ci6putrgbtograystr load exch ci6walkrgbstring end } def /ci6cmyktograyproc { Adobe_ColorImage_AI6_Vars begin sourcearray 0 get exec XIBuffer3 dup 3 1 roll /ci6putcmyktograystr load exch ci6walkcmykstring end } def /ci6separatecmykproc { Adobe_ColorImage_AI6_Vars begin sourcearray 0 get exec XIBuffer3 0 2 index plateindex 4 2 index length 1 sub { get 255 exch sub 3 copy put pop 1 add 2 index } for pop pop exch pop end } def /ci6compositeimage { dup 1 eq { pop pop image }{ /ci6colorimage load null ne { ci6colorimage }{ 3 1 roll pop sourcearray 0 3 -1 roll put 3 eq {/ci6rgbtograyproc}{/ci6cmyktograyproc} ifelse load image } ifelse } ifelse } def /ci6knockoutimage { gsave 0 ci6curtransfer exec 1 ci6curtransfer exec eq { 0 ci6curtransfer exec 0.5 lt }{ 0 ci6curtransfer exec 1 ci6curtransfer exec gt } ifelse {{pop 0}}{{pop 1}} ifelse systemdict /settransfer get exec ci6compositeimage grestore } def /ci6drawimage { ci6testplate -1 eq { pop ci6compositeimage }{ dup type /arraytype eq { dup length plateindex gt {plateindex get}{pop false} ifelse }{ { true }{ dup 1 eq {plateindex 3 eq}{plateindex 3 le} ifelse } ifelse } ifelse { dup 1 eq { pop pop ci6image }{ dup 3 eq { ci6compositeimage }{ pop pop sourcearray 0 3 -1 roll put /ci6separatecmykproc load ci6image } ifelse } ifelse }{ ci6curoverprint { 7 {pop} repeat }{ ci6knockoutimage } ifelse } ifelse } ifelse } def /ci6proctintimage { /_ptispace exch store /_ptiname exch store /_pti1 exch store /_pti0 exch store /_ptiproc exch store /_pticomps _ptispace ci6numcomps store /_ptiscale _pti1 _pti0 sub store level2? { _ptiname length 0 gt version cvr 2012 ge and { [/Separation _ptiname _ptispace {_ptiproc}] setcolorspace [_pti0 _pti1] ci6makeimagedict ci6image }{ [/Indexed _ptispace 255 {255 div _ptiscale mul _pti0 add _ptiproc}] setcolorspace [0 255] ci6makeimagedict ci6image } ifelse }{ _pticomps 1 eq { { dup { 255 div _ptiscale mul _pti0 add _ptiproc 255 mul cvi put } ci6stringapply } ci6concatprocs ci6image }{ { dup length _pticomps mul dup _ptibuf length ne {/_ptibuf exch string store}{pop} ifelse _ptibuf { exch _pticomps mul exch 255 div _ptiscale mul _pti0 add _ptiproc _pticomps 2 add -2 roll _pticomps 1 sub -1 0 { 1 index add 2 index exch 5 -1 roll 255 mul cvi put } for pop pop } ci6stringapply } ci6concatprocs false _pticomps /ci6colorimage load null eq {7 {pop} repeat}{ci6colorimage} ifelse } ifelse } ifelse } def /ci6graytintimage { /_gtigray 5 -1 roll store {1 _gtigray sub mul 1 exch sub} 4 1 roll /DeviceGray ci6proctintimage } def /ci6cmyktintimage { /_cticmyk 5 -1 roll store {_cticmyk {1 index mul exch} forall pop} 4 1 roll /DeviceCMYK ci6proctintimage } def /ci6rgbtintimage { /_rtirgb 5 -1 roll store {_rtirgb {1 exch sub 1 index mul 1 exch sub exch} forall pop} 4 1 roll /DeviceRGB ci6proctintimage } def /ci6tintimage { ci6testplate -1 eq { ci6colorexpand 3 -1 roll 5 -1 roll {0}{0 exch} ifelse 4 2 roll dup /DeviceGray eq { pop ci6graytintimage }{ dup /DeviceRGB eq { pop ci6rgbtintimage }{ pop ci6cmyktintimage } ifelse } ifelse }{ dup ci6marksplate { plateindex 5 lt { ci6colortocmyk plateindex get dup 0 eq ci6curoverprint and { 7 {pop} repeat }{ 1 exch sub exch {1 0}{0 1} ifelse () ci6graytintimage } ifelse }{ pop exch {0}{0 exch} ifelse 0 3 1 roll () ci6graytintimage } ifelse }{ ci6curoverprint { 8 {pop} repeat }{ pop pop pop {pop 1} 0 1 () /DeviceGray ci6proctintimage } ifelse } ifelse } ifelse } def /XINullImage { } def /XIImageMask { XIImageWidth XIImageHeight false [XIImageWidth 0 0 XIImageHeight neg 0 0] /XIDataProc load imagemask } def /XIImageTint { XIImageWidth XIImageHeight XIBitsPerPixel [XIImageWidth 0 0 XIImageHeight neg 0 0] /XIDataProc load XIType 3 eq XIColorValues XIColorSpace ci6tintimage } def /XIImage { XIImageWidth XIImageHeight XIBitsPerPixel [XIImageWidth 0 0 XIImageHeight neg 0 0] /XIDataProc load false XIChannelCount XIPlateList ci6drawimage } def /XG { pop pop } def /XF { 13 {pop} repeat } def /Xh { Adobe_ColorImage_AI6_Vars begin gsave /XIType exch def /XIImageHeight exch def /XIImageWidth exch def /XIImageMatrix exch def 0 0 moveto XIImageMatrix concat XIImageWidth XIImageHeight scale /_lp /null ddef _fc /_lp /imagemask ddef end } def /XH { Adobe_ColorImage_AI6_Vars begin grestore end } def /XIEnable { Adobe_ColorImage_AI6_Vars /XIEnable 3 -1 roll put } def /XC { Adobe_ColorImage_AI6_Vars begin ci6colormake /XIColorSpace exch def /XIColorValues exch def end } def /XIPlates { Adobe_ColorImage_AI6_Vars begin /XIPlateList exch def end } def /XI { Adobe_ColorImage_AI6_Vars begin gsave /XIType exch def cvi dup 256 idiv /XICompression exch store 256 mod /XIEncoding exch store pop pop /XIChannelCount exch def /XIBitsPerPixel exch def /XIImageHeight exch def /XIImageWidth exch def pop pop pop pop /XIImageMatrix exch def XIBitsPerPixel 1 eq { XIImageWidth 8 div ceiling cvi }{ XIImageWidth XIChannelCount mul } ifelse /XIRowBytes exch def XIEnable { /XIBuffer3 XIImageWidth string def XICompression 0 eq { /XIBuffer1 XIRowBytes string def XIEncoding 0 eq { {currentfile XIBuffer1 readhexstring pop} }{ {currentfile XIBuffer1 readstring pop} } ifelse }{ /XIBuffer1 256 string def /XIBuffer2 XIRowBytes string def {currentfile XIBuffer1 readline pop (%) anchorsearch {pop} if} /ASCII85Decode filter /DCTDecode filter /XIFile exch def {XIFile XIBuffer2 readstring pop} } ifelse /XIDataProc exch def XIType 1 ne { 0 setgray } if XIType 1 eq { XIImageMask }{ XIType 2 eq XIType 3 eq or { XIImageTint }{ XIImage } ifelse } ifelse }{ XINullImage } ifelse /XIPlateList false def grestore end } def end %%EndProcSet %%BeginResource: procset Adobe_Illustrator_AI5 1.3 0 %%Title: (Adobe Illustrator (R) Version 8.0 Full Prolog) %%Version: 1.3 0 %%CreationDate: (3/7/1994) () %%Copyright: ((C) 1987-1998 Adobe Systems Incorporated All Rights Reserved) currentpacking true setpacking userdict /Adobe_Illustrator_AI5_vars 112 dict dup begin put /_?cmyk false def /_eo false def /_lp /none def /_pf { } def /_ps { } def /_psf { } def /_pss { } def /_pjsf { } def /_pjss { } def /_pola 0 def /_doClip 0 def /cf currentflat def /_lineorientation 0 def /_charorientation 0 def /_yokoorientation 0 def /_tm matrix def /_renderStart [ /e0 /r0 /a0 /o0 /e1 /r1 /a1 /i0 ] def /_renderEnd [ null null null null /i1 /i1 /i1 /i1 ] def /_render -1 def /_shift [0 0] def /_ax 0 def /_ay 0 def /_cx 0 def /_cy 0 def /_leading [ 0 0 ] def /_ctm matrix def /_mtx matrix def /_sp 16#020 def /_hyphen (-) def /_fontSize 0 def /_fontAscent 0 def /_fontDescent 0 def /_fontHeight 0 def /_fontRotateAdjust 0 def /Ss 256 string def Ss 0 (fonts/) putinterval /_cnt 0 def /_scale [1 1] def /_nativeEncoding 0 def /_useNativeEncoding 0 def /_tempEncode 0 def /_pntr 0 def /_tDict 2 dict def /_hfname 100 string def /_hffound false def /Tx { } def /Tj { } def /CRender { } def /_AI3_savepage { } def /_gf null def /_cf 4 array def /_rgbf 3 array def /_if null def /_of false def /_fc { } def /_gs null def /_cs 4 array def /_rgbs 3 array def /_is null def /_os false def /_sc { } def /_pd 1 dict def /_ed 15 dict def /_pm matrix def /_fm null def /_fd null def /_fdd null def /_sm null def /_sd null def /_sdd null def /_i null def /_lobyte 0 def /_hibyte 0 def /_cproc null def /_cscript 0 def /_hvax 0 def /_hvay 0 def /_hvwb 0 def /_hvcx 0 def /_hvcy 0 def /_bitfont null def /_bitlobyte 0 def /_bithibyte 0 def /_bitkey null def /_bitdata null def /_bitindex 0 def /discardSave null def /buffer 256 string def /beginString null def /endString null def /endStringLength null def /layerCnt 1 def /layerCount 1 def /perCent (%) 0 get def /perCentSeen? false def /newBuff null def /newBuffButFirst null def /newBuffLast null def /clipForward? false def end userdict /Adobe_Illustrator_AI5 known not { userdict /Adobe_Illustrator_AI5 100 dict put } if userdict /Adobe_Illustrator_AI5 get begin /initialize { Adobe_Illustrator_AI5 dup begin Adobe_Illustrator_AI5_vars begin /_aicmykps where {pop /_?cmyk _aicmykps def}if discardDict { bind pop pop } forall dup /nc get begin { dup xcheck 1 index type /operatortype ne and { bind } if pop pop } forall end newpath } def /terminate { end end } def /_ null def /ddef { Adobe_Illustrator_AI5_vars 3 1 roll put } def /xput { dup load dup length exch maxlength eq { dup dup load dup length 2 mul dict copy def } if load begin def end } def /npop { { pop } repeat } def /hswj { dup stringwidth 3 2 roll { _hvwb eq { exch _hvcx add exch _hvcy add } if exch _hvax add exch _hvay add } cforall } def /vswj { 0 0 3 -1 roll { dup 255 le _charorientation 1 eq and { dup cstring stringwidth 5 2 roll _hvwb eq { exch _hvcy sub exch _hvcx sub } if exch _hvay sub exch _hvax sub 4 -1 roll sub exch 3 -1 roll sub exch } { _hvwb eq { exch _hvcy sub exch _hvcx sub } if exch _hvay sub exch _hvax sub _fontHeight sub } ifelse } cforall } def /swj { 6 1 roll /_hvay exch ddef /_hvax exch ddef /_hvwb exch ddef /_hvcy exch ddef /_hvcx exch ddef _lineorientation 0 eq { hswj } { vswj } ifelse } def /sw { 0 0 0 6 3 roll swj } def /vjss { 4 1 roll { dup cstring dup length 1 eq _charorientation 1 eq and { -90 rotate currentpoint _fontRotateAdjust add moveto gsave false charpath currentpoint 5 index setmatrix stroke grestore _fontRotateAdjust sub moveto _sp eq { 5 index 5 index rmoveto } if 2 copy rmoveto 90 rotate } { currentpoint _fontHeight sub 5 index sub 3 index _sp eq { 9 index sub } if currentpoint exch 4 index stringwidth pop 2 div sub exch _fontAscent sub moveto gsave 2 index false charpath 6 index setmatrix stroke grestore moveto pop pop } ifelse } cforall 6 npop } def /hjss { 4 1 roll { dup cstring gsave false charpath currentpoint 5 index setmatrix stroke grestore moveto _sp eq { 5 index 5 index rmoveto } if 2 copy rmoveto } cforall 6 npop } def /jss { _lineorientation 0 eq { hjss } { vjss } ifelse } def /ss { 0 0 0 7 3 roll jss } def /vjsp { 4 1 roll { dup cstring dup length 1 eq _charorientation 1 eq and { -90 rotate currentpoint _fontRotateAdjust add moveto false charpath currentpoint _fontRotateAdjust sub moveto _sp eq { 5 index 5 index rmoveto } if 2 copy rmoveto 90 rotate } { currentpoint _fontHeight sub 5 index sub 3 index _sp eq { 9 index sub } if currentpoint exch 4 index stringwidth pop 2 div sub exch _fontAscent sub moveto 2 index false charpath moveto pop pop } ifelse } cforall 6 npop } def /hjsp { 4 1 roll { dup cstring false charpath _sp eq { 5 index 5 index rmoveto } if 2 copy rmoveto } cforall 6 npop } def /jsp { matrix currentmatrix _lineorientation 0 eq {hjsp} {vjsp} ifelse } def /sp { matrix currentmatrix 0 0 0 7 3 roll _lineorientation 0 eq {hjsp} {vjsp} ifelse } def /pl { transform 0.25 sub round 0.25 add exch 0.25 sub round 0.25 add exch itransform } def /setstrokeadjust where { pop true setstrokeadjust /c { curveto } def /C /c load def /v { currentpoint 6 2 roll curveto } def /V /v load def /y { 2 copy curveto } def /Y /y load def /l { lineto } def /L /l load def /m { moveto } def } { /c { pl curveto } def /C /c load def /v { currentpoint 6 2 roll pl curveto } def /V /v load def /y { pl 2 copy curveto } def /Y /y load def /l { pl lineto } def /L /l load def /m { pl moveto } def } ifelse /d { setdash } def /cf { } def /i { dup 0 eq { pop cf } if setflat } def /j { setlinejoin } def /J { setlinecap } def /M { setmiterlimit } def /w { setlinewidth } def /XR { 0 ne /_eo exch ddef } def /H { } def /h { closepath } def /N { _pola 0 eq { _doClip 1 eq { _eo {eoclip} {clip} ifelse /_doClip 0 ddef } if newpath } { /CRender { N } ddef } ifelse } def /n { N } def /F { _pola 0 eq { _doClip 1 eq { gsave _pf grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _fc /_doClip 0 ddef } { _pf } ifelse } { /CRender { F } ddef } ifelse } def /f { closepath F } def /S { _pola 0 eq { _doClip 1 eq { gsave _ps grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc /_doClip 0 ddef } { _ps } ifelse } { /CRender { S } ddef } ifelse } def /s { closepath S } def /B { _pola 0 eq { _doClip 1 eq gsave F grestore { gsave S grestore _eo {eoclip} {clip} ifelse newpath /_lp /none ddef _sc /_doClip 0 ddef } { S } ifelse } { /CRender { B } ddef } ifelse } def /b { closepath B } def /W { /_doClip 1 ddef } def /* { count 0 ne { dup type /stringtype eq { pop } if } if newpath } def /u { } def /U { } def /q { _pola 0 eq { gsave } if } def /Q { _pola 0 eq { grestore } if } def /*u { _pola 1 add /_pola exch ddef } def /*U { _pola 1 sub /_pola exch ddef _pola 0 eq { CRender } if } def /D { pop } def /*w { } def /*W { } def /` { /_i save ddef clipForward? { nulldevice } if 6 1 roll 4 npop concat pop userdict begin /showpage { } def 0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin 10 setmiterlimit [] 0 setdash /setstrokeadjust where {pop false setstrokeadjust} if newpath 0 setgray false setoverprint } def /~ { end _i restore } def /_rgbtocmyk { 3 { 1 exch sub 3 1 roll } repeat 3 copy 1 4 1 roll 3 { 3 index 2 copy gt { exch } if pop 4 1 roll } repeat pop pop pop 4 1 roll 3 { 3 index sub 3 1 roll } repeat 4 -1 roll } def /setrgbfill { _rgbf astore pop /_fc { _lp /fill ne { _of setoverprint _rgbf aload pop setrgbcolor /_lp /fill ddef } if } ddef /_pf { _fc _eo {eofill} {fill} ifelse } ddef /_psf { _fc hvashow } ddef /_pjsf { _fc hvawidthshow } ddef /_lp /none ddef } def /setrgbstroke { _rgbs astore pop /_sc { _lp /stroke ne { _os setoverprint _rgbs aload pop setrgbcolor /_lp /stroke ddef } if } ddef /_ps { _sc stroke } ddef /_pss { _sc ss } ddef /_pjss { _sc jss } ddef /_lp /none ddef } def /O { 0 ne /_of exch ddef /_lp /none ddef } def /R { 0 ne /_os exch ddef /_lp /none ddef } def /g { /_gf exch ddef /_fc { _lp /fill ne { _of setoverprint _gf setgray /_lp /fill ddef } if } ddef /_pf { _fc _eo {eofill} {fill} ifelse } ddef /_psf { _fc hvashow } ddef /_pjsf { _fc hvawidthshow } ddef /_lp /none ddef } def /G { /_gs exch ddef /_sc { _lp /stroke ne { _os setoverprint _gs setgray /_lp /stroke ddef } if } ddef /_ps { _sc stroke } ddef /_pss { _sc ss } ddef /_pjss { _sc jss } ddef /_lp /none ddef } def /k { _cf astore pop /_fc { _lp /fill ne { _of setoverprint _cf aload pop setcmykcolor /_lp /fill ddef } if } ddef /_pf { _fc _eo {eofill} {fill} ifelse } ddef /_psf { _fc hvashow } ddef /_pjsf { _fc hvawidthshow } ddef /_lp /none ddef } def /K { _cs astore pop /_sc { _lp /stroke ne { _os setoverprint _cs aload pop setcmykcolor /_lp /stroke ddef } if } ddef /_ps { _sc stroke } ddef /_pss { _sc ss } ddef /_pjss { _sc jss } ddef /_lp /none ddef } def /Xa { _?cmyk { 3 npop k }{ setrgbfill 4 npop } ifelse } def /XA { _?cmyk { 3 npop K }{ setrgbstroke 4 npop } ifelse } def /Xs { /_gf exch ddef 5 npop /_fc { _lp /fill ne { _of setoverprint _gf setAIseparationgray /_lp /fill ddef } if } ddef /_pf { _fc _eo {eofill} {fill} ifelse } ddef /_psf { _fc hvashow } ddef /_pjsf { _fc hvawidthshow } ddef /_lp /none ddef } def /XS { /_gs exch ddef 5 npop /_sc { _lp /stroke ne { _os setoverprint _gs setAIseparationgray /_lp /stroke ddef } if } ddef /_ps { _sc stroke } ddef /_pss { _sc ss } ddef /_pjss { _sc jss } ddef /_lp /none ddef } def /Xx { exch /_gf exch ddef 0 eq { findcmykcustomcolor }{ _?cmyk {true}{/findrgbcustomcolor where{pop false}{true}ifelse}ifelse { 4 1 roll 3 npop findcmykcustomcolor }{ 8 -4 roll 4 npop findrgbcustomcolor } ifelse } ifelse /_if exch ddef /_fc { _lp /fill ne { _of setoverprint _if _gf 1 exch sub setcustomcolor /_lp /fill ddef } if } ddef /_pf { _fc _eo {eofill} {fill} ifelse } ddef /_psf { _fc hvashow } ddef /_pjsf { _fc hvawidthshow } ddef /_lp /none ddef } def /XX { exch /_gs exch ddef 0 eq { findcmykcustomcolor }{ _?cmyk {true}{/findrgbcustomcolor where{pop false}{true}ifelse}ifelse { 4 1 roll 3 npop findcmykcustomcolor }{ 8 -4 roll 4 npop findrgbcustomcolor } ifelse } ifelse /_is exch ddef /_sc { _lp /stroke ne { _os setoverprint _is _gs 1 exch sub setcustomcolor /_lp /stroke ddef } if } ddef /_ps { _sc stroke } ddef /_pss { _sc ss } ddef /_pjss { _sc jss } ddef /_lp /none ddef } def /x { /_gf exch ddef findcmykcustomcolor /_if exch ddef /_fc { _lp /fill ne { _of setoverprint _if _gf 1 exch sub setcustomcolor /_lp /fill ddef } if } ddef /_pf { _fc _eo {eofill} {fill} ifelse } ddef /_psf { _fc hvashow } ddef /_pjsf { _fc hvawidthshow } ddef /_lp /none ddef } def /X { /_gs exch ddef findcmykcustomcolor /_is exch ddef /_sc { _lp /stroke ne { _os setoverprint _is _gs 1 exch sub setcustomcolor /_lp /stroke ddef } if } ddef /_ps { _sc stroke } ddef /_pss { _sc ss } ddef /_pjss { _sc jss } ddef /_lp /none ddef } def /XK { 3 -1 roll pop 0 eq { 1 exch sub 3 {dup 3 1 roll mul 5 1 roll} repeat mul 4 1 roll K } { 1 exch sub 4 1 roll 3 {1 exch sub 3 index mul 1 exch sub 3 1 roll} repeat 4 -1 roll pop XA } ifelse } def /Xk { 3 -1 roll pop 0 eq { 1 exch sub 3 {dup 3 1 roll mul 5 1 roll} repeat mul 4 1 roll k } { 1 exch sub 4 1 roll 3 {1 exch sub 3 index mul 1 exch sub 3 1 roll} repeat 4 -1 roll pop Xa } ifelse } def /A { pop } def /annotatepage { userdict /annotatepage 2 copy known {get exec} {pop pop} ifelse } def /XT { pop pop } def /Xt { pop } def /discard { save /discardSave exch store discardDict begin /endString exch store gt38? { 2 add } if load stopped pop end discardSave restore } bind def userdict /discardDict 7 dict dup begin put /pre38Initialize { /endStringLength endString length store /newBuff buffer 0 endStringLength getinterval store /newBuffButFirst newBuff 1 endStringLength 1 sub getinterval store /newBuffLast newBuff endStringLength 1 sub 1 getinterval store } def /shiftBuffer { newBuff 0 newBuffButFirst putinterval newBuffLast 0 currentfile read not { stop } if put } def 0 { pre38Initialize mark currentfile newBuff readstring exch pop { { newBuff endString eq { cleartomark stop } if shiftBuffer } loop } { stop } ifelse } def 1 { pre38Initialize /beginString exch store mark currentfile newBuff readstring exch pop { { newBuff beginString eq { /layerCount dup load 1 add store } { newBuff endString eq { /layerCount dup load 1 sub store layerCount 0 eq { cleartomark stop } if } if } ifelse shiftBuffer } loop } if } def 2 { mark { currentfile buffer {readline} stopped { % assume error was due to overfilling the buffer }{ not { stop } if endString eq { cleartomark stop } if }ifelse } loop } def 3 { /beginString exch store /layerCnt 1 store mark { currentfile buffer {readline} stopped { % assume error was due to overfilling the buffer }{ not { stop } if dup beginString eq { pop /layerCnt dup load 1 add store } { endString eq { layerCnt 1 eq { cleartomark stop } { /layerCnt dup load 1 sub store } ifelse } if } ifelse }ifelse } loop } def end userdict /clipRenderOff 15 dict dup begin put { /n /N /s /S /f /F /b /B } { { _doClip 1 eq { /_doClip 0 ddef _eo {eoclip} {clip} ifelse } if newpath } def } forall /Tr /pop load def /Bb {} def /BB /pop load def /Bg {12 npop} def /Bm {6 npop} def /Bc /Bm load def /Bh {4 npop} def end /Lb { 6 npop 7 2 roll 5 npop 0 eq { 0 eq { (%AI5_BeginLayer) 1 (%AI5_EndLayer--) discard } { /clipForward? true def /Tx /pop load def /Tj /pop load def currentdict end clipRenderOff begin begin } ifelse } { 0 eq { save /discardSave exch store } if } ifelse } bind def /LB { discardSave dup null ne { restore } { pop clipForward? { currentdict end end begin /clipForward? false ddef } if } ifelse } bind def /Pb { pop pop 0 (%AI5_EndPalette) discard } bind def /Np { 0 (%AI5_End_NonPrinting--) discard } bind def /Ln /pop load def /Ap /pop load def /Ar { 72 exch div 0 dtransform dup mul exch dup mul add sqrt dup 1 lt { pop 1 } if setflat } def /Mb { q } def /Md { } def /MB { Q } def /nc 4 dict def nc begin /setgray { pop } bind def /setcmykcolor { 4 npop } bind def /setrgbcolor { 3 npop } bind def /setcustomcolor { 2 npop } bind def currentdict readonly pop end /XP { 4 npop } bind def /XD { pop } bind def end setpacking %%EndResource %%BeginResource: procset Adobe_cshow 2.0 8 %%Title: (Writing System Operators) %%Version: 2.0 8 %%CreationDate: (1/23/89) () %%Copyright: ((C) 1992-1996 Adobe Systems Incorporated All Rights Reserved) currentpacking true setpacking userdict /Adobe_cshow 14 dict dup begin put /initialize { Adobe_cshow begin Adobe_cshow { dup xcheck { bind } if pop pop } forall end Adobe_cshow begin } def /terminate { currentdict Adobe_cshow eq { end } if } def /cforall { /_lobyte 0 ddef /_hibyte 0 ddef /_cproc exch ddef /_cscript currentfont /FontScript known { currentfont /FontScript get } { -1 } ifelse ddef { /_lobyte exch ddef _hibyte 0 eq _cscript 1 eq _lobyte 129 ge _lobyte 159 le and _lobyte 224 ge _lobyte 252 le and or and _cscript 2 eq _lobyte 161 ge _lobyte 254 le and and _cscript 3 eq _lobyte 161 ge _lobyte 254 le and and _cscript 25 eq _lobyte 161 ge _lobyte 254 le and and _cscript -1 eq or or or or and { /_hibyte _lobyte ddef } { _hibyte 256 mul _lobyte add _cproc /_hibyte 0 ddef } ifelse } forall } def /cstring { dup 256 lt { (s) dup 0 4 3 roll put } { dup 256 idiv exch 256 mod (hl) dup dup 0 6 5 roll put 1 4 3 roll put } ifelse } def /clength { 0 exch { 256 lt { 1 } { 2 } ifelse add } cforall } def /hawidthshow { { dup cstring show _hvax _hvay rmoveto _hvwb eq { _hvcx _hvcy rmoveto } if } cforall } def /vawidthshow { { dup 255 le _charorientation 1 eq and { -90 rotate 0 _fontRotateAdjust rmoveto cstring _hvcx _hvcy _hvwb _hvax _hvay 6 -1 roll awidthshow 0 _fontRotateAdjust neg rmoveto 90 rotate } { currentpoint _fontHeight sub exch _hvay sub exch _hvax sub 2 index _hvwb eq { exch _hvcy sub exch _hvcx sub } if 3 2 roll cstring dup stringwidth pop 2 div neg _fontAscent neg rmoveto show moveto } ifelse } cforall } def /hvawidthshow { 6 1 roll /_hvay exch ddef /_hvax exch ddef /_hvwb exch ddef /_hvcy exch ddef /_hvcx exch ddef _lineorientation 0 eq { hawidthshow } { vawidthshow } ifelse } def /hvwidthshow { 0 0 3 -1 roll hvawidthshow } def /hvashow { 0 0 0 6 -3 roll hvawidthshow } def /hvshow { 0 0 0 0 0 6 -1 roll hvawidthshow } def currentdict readonly pop end setpacking %%EndResource %%BeginResource: procset Adobe_shading_AI8 1.0 0 %%Title: (Adobe Illustrator 8 Shading Procset) %%Version: 1.0 0 %%CreationDate: (12/17/97) () %%Copyright: ((C) 1987-1997 Adobe Systems Incorporated All Rights Reserved) userdict /defaultpacking currentpacking put true setpacking userdict /Adobe_shading_AI8 10 dict dup begin put /initialize { Adobe_shading_AI8 begin Adobe_shading_AI8 bdprocs Mesh /initialize get exec } def /terminate { currentdict Adobe_shading_AI8 eq { end } if } def /bdprocs { { dup xcheck 1 index type /arraytype eq and { bind } if pop pop } forall } def /X! {pop} def /X# {pop pop} def /Mesh 40 dict def Mesh begin /initialize { Mesh bdprocs Mesh begin /emulate? /AI8MeshEmulation where { pop AI8MeshEmulation }{ systemdict /shfill known not } ifelse def end } def /bd { shadingdict begin } def /paint { emulate? { end }{ /_lp /none ddef _fc /_lp /none ddef /AIColorSpace AIColorSpace tocolorspace store /ColorSpace AIColorSpace topsspace store version_ge_3010.106 not systemdict /setsmoothness known and { 0.0001 setsmoothness } if composite? { /DataSource getdatasrc def Matrix concat currentdict end shfill }{ AIColorSpace makesmarks AIPlateList markingplate and not isoverprint and { end }{ /ColorSpace /DeviceGray store /Decode [0 1 0 1 0 1] store /DataSource getplatesrc def Matrix concat currentdict end shfill } ifelse } ifelse } ifelse } def /shadingdict 12 dict def shadingdict begin /ShadingType 6 def /BitsPerCoordinate 16 def /BitsPerComponent 8 def /BitsPerFlag 8 def end /datafile null def /databuf 256 string def /dataptr 0 def /srcspace null def /srcchannels 0 def /dstchannels 0 def /dstplate 0 def /srctodstcolor null def /getplatesrc { /srcspace AIColorSpace store /srcchannels AIColorSpace getnchannels store /dstchannels 1 store /dstplate getplateindex store /srctodstcolor srcspace makesmarks { dstplate 4 eq { {1 exch sub} }{ {srcspace tocmyk 3 dstplate sub index 1 exch sub 5 1 roll 4 {pop} repeat} } ifelse }{ {srcchannels {pop} repeat 1} } ifelse store /datafile getdatasrc store /rdpatch168 load DataLength () /SubFileDecode filter } def /getdatasrc { /rdcmntline load /ASCII85Decode filter } def /rdpatch168 { /dataptr 0 store 49 rdcount 4 { dup {pop srcchannels getint8} if dup {pop srctodstcolor dstchannels putint8 true} if } repeat {databuf 0 dataptr getinterval}{()} ifelse } def /rdpatch3216 { /dataptr 0 store 97 rdcount 4 { dup {pop srcchannels getint16} if dup {pop srctodstcolor dstchannels putint16 true} if } repeat {databuf 0 dataptr getinterval}{()} ifelse } def /rdcount { dup 0 gt { datafile databuf dataptr 4 -1 roll getinterval readstring exch length dataptr add /dataptr exch store }{ true } ifelse } def /getint8 { mark true 3 -1 roll { dup {pop datafile read} if dup {pop 255 div true} if } repeat { counttomark 1 add -1 roll pop true }{ cleartomark false } ifelse } def /putint8 { dup dataptr add /dataptr exch store dataptr exch { 1 sub exch 255 mul cvi databuf 2 index 3 -1 roll put } repeat pop } def /getint16 { mark true 3 -1 roll { dup {pop datafile read} if dup {pop 256 mul datafile read} if dup {pop add 65535 div true} if } repeat { counttomark 1 add -1 roll pop true }{ cleartomark false } ifelse } def /putint16 { dup 2 mul dataptr add /dataptr exch store dataptr exch { 2 sub exch 65535 mul cvi dup 256 idiv databuf 3 index 3 -1 roll put 256 mod databuf 2 index 1 add 3 -1 roll put } repeat pop } def /srcbuf 256 string def /rdcmntline { currentfile srcbuf readline pop (%) anchorsearch {pop} if } def /getplateindex { 0 [cyan? magenta? yellow? black? customColor?] {{exit} if 1 add} forall } def /aicsarray 4 array def /aicsaltvals 4 array def /aicsaltcolr aicsaltvals def /tocolorspace { dup type /arraytype eq { mark exch aload pop aicsarray 0 3 -1 roll put aicsarray 1 3 -1 roll put dup aicsarray 2 3 -1 roll put gettintxform aicsarray 3 3 -1 roll put counttomark aicsaltvals 0 3 -1 roll getinterval /aicsaltcolr exch store aicsaltcolr astore pop pop aicsarray } if } def /subtintxform {aicsaltcolr {1 index mul exch} forall pop} def /addtintxform {aicsaltcolr {1 sub 1 index mul 1 add exch} forall pop} def /gettintxform { /DeviceRGB eq {/addtintxform}{/subtintxform} ifelse load } def /getnchannels { dup type /arraytype eq {0 get} if colorspacedict exch get begin Channels end } def /makesmarks { composite? { pop true }{ dup dup type /arraytype eq {0 get} if colorspacedict exch get begin MarksPlate end } ifelse } def /markingplate { composite? { pop true }{ dup type /arraytype eq { dup length getplateindex gt {getplateindex get}{pop false} ifelse } if } ifelse } def /tocmyk { dup dup type /arraytype eq {0 get} if colorspacedict exch get begin ToCMYK end } def /topsspace { dup dup type /arraytype eq {0 get} if colorspacedict exch get begin ToPSSpace end } def /colorspacedict 5 dict dup begin /DeviceGray 4 dict dup begin /Channels 1 def /MarksPlate {pop black?} def /ToCMYK {pop 1 exch sub 0 0 0 4 -1 roll} def /ToPSSpace {} def end def /DeviceRGB 4 dict dup begin /Channels 3 def /MarksPlate {pop isCMYKSep?} def /ToCMYK {pop _rgbtocmyk} def /ToPSSpace {} def end def /DeviceCMYK 4 dict dup begin /Channels 4 def /MarksPlate {pop isCMYKSep?} def /ToCMYK {pop} def /ToPSSpace {} def end def /Separation 4 dict dup begin /Channels 1 def /MarksPlate { /findcmykcustomcolor where { pop dup 1 exch ToCMYK 5 -1 roll 1 get findcmykcustomcolor 1 setcustomcolor systemdict /currentgray get exec 1 ne }{ pop false } ifelse } def /ToCMYK { dup 2 get mark exch 4 2 roll 3 get exec counttomark -1 roll tocmyk 5 -1 roll pop } def /ToPSSpace {} def end def /Process 4 dict dup begin /Channels 1 def /MarksPlate { isCMYKSep? { 1 exch ToCMYK 4 array astore getplateindex get 0 ne }{ pop false } ifelse } def /ToCMYK { dup 2 get mark exch 4 2 roll 3 get exec counttomark -1 roll tocmyk 5 -1 roll pop } def /ToPSSpace { 4 array copy dup 0 /Separation put } def end def end def /isoverprint { /currentoverprint where {pop currentoverprint}{_of} ifelse } def /version_ge_3010.106 { version {cvr} stopped { pop false }{ 3010.106 ge } ifelse } def end end defaultpacking setpacking %%EndResource %%EndProlog %%BeginSetup userdict /_useSmoothShade false put userdict /_aicmykps false put userdict /_forceToCMYK false put Adobe_level2_AI5 /initialize get exec Adobe_cshow /initialize get exec Adobe_ColorImage_AI6 /initialize get exec Adobe_shading_AI8 /initialize get exec Adobe_Illustrator_AI5 /initialize get exec %%EndSetup %AI5_BeginLayer 0 1 0 1 0 0 0 0 79 128 255 0 50 Lb (Lager 1) Ln 0 A u u 0 R 0 0 0 1 0 0 0 XA 300 Ar 0 J 0 j 8.1 w 10 M []0 d %AI3_Note: 0 D 0 XR 116.6133 407.9141 m 116.6133 437.7227 140.8047 461.9146 170.6133 461.9146 c 200.4209 461.9146 224.6133 437.7227 224.6133 407.9141 c S /BBAccumRotation (4.712389) XT 116.6133 407.9141 m 116.6133 378.1074 140.8047 353.9141 170.6133 353.9141 c 200.4209 353.9141 224.6133 378.1074 224.6133 407.9141 c S /BBAccumRotation (4.712389) XT 386.6123 407.9141 m 386.6123 437.7227 410.8047 461.9146 440.6123 461.9146 c 470.4209 461.9146 494.6123 437.7227 494.6123 407.9141 c S /BBAccumRotation (4.712389) XT 386.6123 407.9141 m 386.6123 378.1074 410.8047 353.9141 440.6123 353.9141 c 470.4209 353.9141 494.6123 378.1074 494.6123 407.9141 c S /BBAccumRotation (4.712389) XT 395.6221 488.9229 m 404.9814 505.6011 422.6162 515.9263 441.7412 515.9263 c 470.9326 515.9263 494.625 492.2344 494.625 463.0425 c 494.625 462.6733 494.6211 462.3042 494.6133 461.9351 c S /BBAccumRotation (4.712389) XT 242.6123 461.9351 m 242.6045 462.3042 242.6006 462.6733 242.6006 463.0425 c 242.6006 492.2344 266.293 515.9263 295.4854 515.9263 c 314.6094 515.9263 332.2441 505.6011 341.6035 488.9229 c S /BBAccumRotation (4.712389) XT 125.6221 488.9229 m 134.9814 505.6011 152.6162 515.9263 171.7412 515.9263 c 200.9326 515.9263 224.625 492.2344 224.625 463.0425 c 224.625 462.6733 224.6211 462.3042 224.6133 461.9351 c S /BBAccumRotation (4.712389) XT 368.6123 551.9146 m 368.6123 353.9141 l S /BBAccumRotation (4.712389) XT 224.6133 461.9146 m 224.6133 353.9141 l S /BBAccumRotation (4.712389) XT 242.6133 353.9141 m 242.6133 461.9146 l S /BBAccumRotation (4.712389) XT 494.6123 461.9146 m 494.6123 353.9141 l S /BBAccumRotation (4.712389) XT U /BBAccumRotation (0.000000) XT U /BBAccumRotation (0.000000) XT LB %AI5_EndLayer-- %AI5_BeginLayer 1 1 1 1 0 0 1 1 255 79 79 0 50 Lb (Lager 2) Ln 0 A 0 R 0 0 0 1 0 0 0 XA 800 Ar 0 J 0 j 8.1 w 10 M []0 d %AI3_Note: 0 D 0 XR 125.5 489.1665 m 141.5 517.5 175.1665 520.1665 191.8335 512.1665 c 218.0479 499.584 225 482.6255 225 450 c 225 423 225 381.333 225 354 c S 1 Ap 225 408 m 225 378.1768 200.8232 354 171 354 c 141.1768 354 117 378.1768 117 408 c 117 437.8232 141.1768 462 171 462 c 200.8232 462 225 437.8232 225 408 c s 0 Ap 342.5 489.1665 m 326.5 517.5 292.834 520.1665 276.167 512.1665 c 249.9531 499.584 243 482.6255 243 450 c 243 423 243 381.333 243 354 c S 369 552 m 369 528.0264 369 369 369 354 c S 395.5 489.1665 m 411.5 517.5 445.166 520.1665 461.834 512.1665 c 488.0479 499.584 495 482.6255 495 450 c 495 423 495 381.333 495 354 c S 1 Ap 495 408 m 495 378.1768 470.8232 354 441 354 c 411.1768 354 387 378.1768 387 408 c 387 437.8232 411.1768 462 441 462 c 470.8232 462 495 437.8232 495 408 c s LB %AI5_EndLayer-- %%PageTrailer gsave annotatepage grestore showpage %%Trailer Adobe_Illustrator_AI5 /terminate get exec Adobe_shading_AI8 /terminate get exec Adobe_ColorImage_AI6 /terminate get exec Adobe_cshow /terminate get exec Adobe_level2_AI5 /terminate get exec %%EOF \ No newline at end of file
diff --git a/usr.sbin/afs/src/doc/arla.info b/usr.sbin/afs/src/doc/arla.info
deleted file mode 100644
index c653598c91e..00000000000
--- a/usr.sbin/afs/src/doc/arla.info
+++ /dev/null
@@ -1,2408 +0,0 @@
-This is arla.info, produced by makeinfo version 4.0 from arla.texi.
-
-INFO-DIR-SECTION Arla
-START-INFO-DIR-ENTRY
-* Arla: (arla). Arla - A Free AFS Implementation
-END-INFO-DIR-ENTRY
-
-
-File: arla.info, Node: Top, Prev: (dir), Up: (dir)
-
-Arla
-****
-
-Arla is a free AFS implementation from KTH.
-
-Please send comments (and fixes) on this manual and the arla programs to
-<arla-drinkers@stacken.kth.se>.
-
-* Menu:
-
-* Introduction:: Introduction to Arla.
-* AFS infrastructure:: A description of the afs infrastructure.
-* Organization of data:: How different data is organized in AFS.
-* AFS and the real world:: Common problems and their solutions.
-* Parts of Arla:: Description of different parts of arla.
-* Debugging:: How to debug arla when its not working.
-* Porting:: That you need to know to port arla.
-* Programming:: Programming documentation of arla.
-* Oddities:: Strange things that did happen to us.
-* Themis:: Tool to keep your files system up-to-date.
-* Arla timeline:: Short timeline of arla.
-* Authors:: The authors of arla.
-* Acknowledgments:: People that have helped us.
-* Index:: Index.
-
-
- --- The Detailed Node Listing ---
-
-* Introduction::
-* AFS infrastructure::
-
-How data and servers are organized in AFS.
-
-* Requirements::
-* Data organization::
-* Callbacks::
-* Volume management::
-* Relationship between pts uid and unix uid::
-
-How to cope with reality
-
-* NAT::
-* Samba::
-* Integration with Kerberos::
-* Kerberos tickets and AFS tokens::
-
-The parts of arla
-
-* How arla works::
-* The relation between Arlad and NNPFS::
-* The life of a file::
-* Tools and libs::
-* The files in arlad/::
-* pioctl and kafs::
-
-How to debug arla when its not working
-
-* Arlad::
-* Debugging LWP with GDB::
-* nnpfs::
-* nnpfs on linux::
-* Debugging techniques::
-* Kernel debuggers::
-* Darwin/MacOS X::
-
-Porting arla
-
-* Porting::
-* Porting user-space::
-* Porting NNPFS::
-
-Programming
-
-* Programming::
-* Disco with arla::
-* afsUUID::
-
-Odd stuff you find when looking around
-
-* Oddities::
-
-Miscellaneous
-
-* Arla timeline::
-* Authors::
-* Acknowledgments::
-
-* Index::
-
-
-File: arla.info, Node: Introduction, Next: AFS infrastructure, Prev: Top, Up: Top
-
-Introduction
-************
-
- *Caution:* Parts of this package are not yet stable software. If
- something doesn't work, it's probably because it doesn't. If you
- don't have backup of your data, take backup.
-
-What is Arla?
-=============
-
-Arla is a free AFS implementation. Some of the goals are:
-
- * to have an implementation that is free and can be used for adding
- and playing with cool stuff, like support for disconnected-mode.
- Implement features you can't get from commercial AFS.
-
- * to provide an alternative to Transarc's and OpenAFS AFS-clients and
- server implementations.
-
- * to add support for platfroms that don't have AFS support from
- Transarc or OpenAFS today.
-
-This release is known to work on the following platforms: NetBSD,
-OpenBSD, FreeBSD, Linux, Solaris, Darwin/MacOS X.
-
-Earlier releases are known to work on current or earlier versions of the
-following platforms: SunOS, AIX, IRIX, Digital UNIX. Some fixes might
-be necessary to make Arla work.
-
-There is or has been done work to support the following platforms: HPUX,
-Fujitsu UXP/V. Some development is necessary to make Arla work.
-
-There is work going on to support the following platform: Windows
-NT/2000. Contributions are very welcome.
-
-Status
-======
-
-Arla has the following features (quality varies between stable and not
-implemented):
-
- * a rxgen implementation called ydr (stable).
-
- * a cache manager replacing Transarc's afsd. The cache managers
- quality depends on platform: *BSD, Linux i386 and Solaris are
- stable, others platforms are not as tested ane therefore not as
- stable.
-
- * partly implemented fs, vos, pts commands. Commands typically issued
- by users are stable, commands issued by administrators may return
- unmotivated errors or are not implemented yet.
-
- * an implementaion of rxkad written outside USA without any export
- restrictions (stable).
-
- * a server implementation called milko, containing file server,
- volume server and protection server. The file server has an API to
- the storage backend(s). Milko is still unstable and not fit for
- production yet.
-
-Bug reports
-===========
-
-If you find bugs in this software, make sure it is a genuine bug and not
-just a part of the code that isn't implemented.
-
-Bug reports should be sent to <arla-drinkers@stacken.kth.se>. Please
-include information on what machine and operating system (including
-version) you are running, what you are trying to do, what happens, what
-you think should have happened, an example for us to repeat, the output
-you get when trying the example, and a patch for the problem if you have
-one. Please make any patches with `diff -u' or `diff -c'.
-
-Suggestions, comments and other non bug reports are also welcome.
-
-Mailing list
-============
-
-There are two mailing lists with talk about Arla.
-<arla-announce@stacken.kth.se> is a low-volume announcement list, while
-<arla-drinkers@stacken.kth.se> is for general discussion.
-
-There is also commit list <arla-commit@stacken.kth.se>. Send a message
-to <LIST-request@stacken.kth.se> to subscribe.
-
-The list are achived on <http://www.stacken.kth.se/lists/>.
-
-Please note that the mailinglists have a policy of subscriber only
-posting. So if you want to mail a message to the list, subscribe to it
-first, otherwise it wont be posted on the list.
-
-
-File: arla.info, Node: AFS infrastructure, Next: Organization of data, Prev: Introduction, Up: Top
-
-AFS infrastructure
-******************
-
-This is an overview of the AFS infrastructure as viewed from a Transarc
-perspective, since most people still run Transarc cells.
-
-AFS Filespace
-=============
-
-AFS filespace is split up in smaller parts called cells. These cells are
-usually listed under `/afs'. A cell is usually a whole organization or
-an adminstative unit within an organization. An example is e.kth.se
-(with the path `/afs/e.kth.se'), that is the department of electrical
-engineering at KTH, which obviously has the `e.kth.se' domain in DNS.
-Using DNS domains for cell names is the typical and most convenient way.
-
-Note that cell names are written in lowercase by convention.
-
-CellServDB
-==========
-
-All cells (and their db-servers) in the AFS world are listed in a file
-named `CellServDB'. There is a central copy that is maintained by
-Transarc at `/afs/transarc.com/service/etc/CellServDB'.
-
-In spite of being organized in IPnumber - name pairs, where the name
-parts resemble comments, both values are used by Transarc software and
-confusion may arise if they are not synchronized with each other.
-
-
- >e.kth.se # Royal Institute of Technology, Elektro
- 130.237.48.8 #sonen.e.kth.se.
- 130.237.48.7 #anden.e.kth.se.
- 130.237.48.244 #fadern.e.kth.se.
-
-Again, please note that the text after the # in the cell-name is a
-comment, *but* the hostnames after the # on the rows of an IP-address
-is *not* a comment. The host and the ip-address needs to point at the
-same computer.
-
-AFSDB
-=====
-
-In addition Arla can use DNS to find the db-servers of a cell. The DNS
-resource record that is used is the `AFSDB'. The resourcerecord was
-created by Transarc but have never been implemeted in released software.
-
-`AFSDB' tells you what machines are db servers for a particular cell.
-The `AFSDB' resourcerecord is also used for DCE/DFS. An example (the 1
-means AFS, 2 is used for DCE):
-
- e.kth.se. IN AFSDB 1 fadern.e.kth.se.
- e.kth.se. IN AFSDB 1 sonen.e.kth.se.
- e.kth.se. IN AFSDB 1 anden.e.kth.se.
-
-Shortcut names
-==============
-
-Some cells use the abbreviated version `/afs/<word-before-first-dot>'
-(in the example above that would be `/afs/e/'. This might be
-convenient when typing them, but is a bad idea, because it does not
-create the same name space everywhere. If you create a symbolic link
-to `/afs/e/foo/bar', it will not work for people in other cells.
-
-Server organization
-===================
-
-There are several servers running in an AFS cell. For performance and
-redundancy reasons, these servers are often run on different hosts.
-There is a built in hierarchy within the servers (in two different
-dimensions).
-
-There is one server that keeps track of the other servers within a host,
-restart them when they die, make sure they run in the correct order,
-save their core-files when they crash, and provide an interface for the
-sysadmin to start/stop/restart the servers. This server is called
-bos-server (Basic Overseer Server).
-
-Another hierarchy is the one who keeps track of data (volumes, users,
-passwords, etc) and who is performing the real hard work (serving files)
-There is the the database server that keeps the database (obviously),
-and keeps several database copies on different hosts relpicated with
-Ubik (see below). The fileserver and the client software (like the
-afsd/arlad, pts and, vos) are pulling meta-data out of the dbserver to
-find where to find user-privileges and where volumes resides.
-
-Basic overseer - boserver
-=========================
-
-The Bos server is making sure the servers are running. If they crash, it
-saves the corefile, and starts a new server. It also makes sure that
-servers/services that are not supposted to run at the same time do not.
-An example of this is the fileserver/volserver and salvage. It would be
-devastating if salvage tried to correct data that the fileserver is
-changing. The salvager is run before the fileserver starts. The
-administrator can also force a file server to run through salvage again.
-
-Ubik
-====
-
-Ubik is a distributed database. It is really a (distributed) flat file
-that you can perform read/write/lseek operation on. The important
-property of Ubik is that it provides a way to make sure that updates are
-done once (transactions), and that the database is kept consistent. It
-also provides read-only access to the database when there is one (or
-more) available database-server(s).
-
-This works the following way: A newly booted server sends out a message
-to all other servers that tells them that it believes that it is the new
-master server. If the server gets a notice back from an other server
-that tells it that the other server believes that it (or a third server)
-is the master, depending on how long it has been masterserver it will
-switch to the new server. If they can't agree, the one with the lowest
-ip-address is supposed to win the argument. If the server is a slave it
-still updates the database to the current version of the database.
-
-A update to the database can only be done if more than half of the
-servers are available and vote for the master. A update is first
-propaged to all servers, then after that is done, and if all servers
-agree with the change, a commit message is sent out from the server, and
-the update is written to disk and the serial number of the database is
-increased.
-
-All servers in AFS use Ubik to store their data.
-
-Volume Location database server - vlserver
-==========================================
-
-The vldb-server is resposible for the information on what fileserver
-every volume resides and of what kind of volumes exists on each
-fileserver.
-
-To confuse you even more there are three types of support for the
-clients. Basically there is AFS 3.3, 3.4, and 3.6 support. The different
-interfaces look the same for the system administrator, but there are
-some important differences.
-
-AFS 3.3 is the classic interface. 3.4 adds the possibility of multihomed
-servers for the client to talk to, and that introduces the N interface.
-To deal with multihomed clients AFS 3.5 was introduced. This is called
-call the U interface. The name is due to how the functions are named.
-
-The N interface added more replication-sites in the database-entry
-structure. The U interface changed the server and clients in two ways.
-
-When a 3.5 server boot it registers all its ip-addresses. This means
-that a server can add (or remove) an network interface without
-rebooting. When registering at the vldb server, the file server presents
-itself with an UUID, an unique identifier. This UUID will be stored in a
-file so the UUID keeps constant even when network addresses are changed,
-added, or removed.
-
-Protection server - ptserver
-============================
-
-The protection server keeps track of all users and groups. It's used a
-lot by the file servers. Users can self create, modify and delete
-groups.
-
-When a fileserver is access they are durring the authentication giving
-the name of the client. This name if looked up in the
-protection-database via the protection server that returns the id of the
-user and all the groups that the user belongs too.
-
-This information is used when to check if the user have access to a
-particular file or directory. All files created by the user are assigned
-the user id that the protectionserver returned.
-
-Kerberos server - kaserver
-==========================
-
-The kaserver is a Kerberos server, but in other clothes. There is a new
-RPC interface to get tickets (tokens) and administer the server. The
-old Kerberos v4 interface is also implemented, and can be used by
-ordinary Kerberos v4 clients.
-
-You can replace this server with an Heimdal kdc, since it provides a
-superset of the functionality.
-
-Backup server - buserver
-========================
-
-The backup server keeps the backup database that is used when backing up
-and restoring volumes. The backup server is not used by other servers,
-only operators.
-
-Update server - upserver
-========================
-
-With the update server its possible to automagicly update configuration
-files, server binaries. You keep masters that are supposed to contain
-the correct copy of all the files and then other servers can fetch them
-from there.
-
-Fileserver and Volume Server - fs and volser
-============================================
-
-The file server serves data to the clients, keeps track of callbacks,
-and breaks callbacks when needed. Volser is the administative interface
-where you add, move, change, and delete volumes from the server.
-
-The volume server and file server are ran at the same time and they sync
-with each other to make sure that fileserver does not access a volume
-that volser is about to modify.
-
-Every time a fileserver is started it registers it IP addresses with the
-vldbserserver using the VL_RegisterAddrs rpc-call. As the unique
-identifier for itself it uses its afsUUID.
-
-The afsUUID for a fileserver is stored in /usr/afs/local/sysid. This is
-the reson you must not clone a server w/o removing the sysid file.
-Otherwise the new filserver will register as the old one and all
-volumes on the old fileserver are pointed to the new one (where the
-probably doesn't exist).
-
-The fileserver doesn't bind to a specific interface (read address), gets
-all packets that are destined for port 7000 (afs-fileserver/udp). All
-outgoing packets are send on the same socket, and means that your
-operatingsystem will choose the source-address of the udp datagram.
-
-This have the side-effect that you will have asymmetric routing on
-mulithomed fileserver for 3.4 (and older) compatible clients if they
-don't use the closest address when sorting the vldb entry. Arla avoids
-this problem.
-
-Salvage
-=======
-
-Salvage is not a real server. It is run before the fileserver and volser
-are started to make sure the partitions are consistent.
-
-It's imperative that salvager is NOT run at the same time as the
-fileserver/volser is running.
-
-Things that milko does differently.
-===================================
-
-Fileserver, volumeserver, and salvage are all in one program.
-
-There is no bu nor ka-server. The ka-server is replaced by kth-krb or
-Heimdal. Heimdal's kdc even implements a ka-server readonly interface,
-so your users can keep using programs like klog.
-
-
-File: arla.info, Node: Organization of data, Next: AFS and the real world, Prev: AFS infrastructure, Up: Top
-
-Organization of data
-********************
-
-This chapter describes how data is stored and how AFS is different from,
-for example, NFS. It also describes how data is kept consistent and what
-the requirements were and how that inpacted on the design.
-
-* Menu:
-
-* Requirements::
-* Data organization::
-* Callbacks::
-* Volume management::
-* Relationship between pts uid and unix uid::
-
-
-File: arla.info, Node: Requirements, Next: Data organization, Prev: Organization of data, Up: Organization of data
-
-Requirements
-============
-
- * Scalability
-
- It should be possible to use AFS with hundred-thousands of users
- without problems.
-
- Writes that are done to different parts of the filesystem should
- not affect each other. It should be possible to distribute out the
- reads and writes over many fileservers. If you have a file that is
- accessed by many clients, it should be possible to distribute the
- load.
-
- * Transparent to users
-
- Users should not need to know where their files are stored. It
- should be possible to move their files while they are using their
- files.
-
- * Easy to admin
-
- It should be easy for a administrator to make changes to the
- filesystem. For example to change quota for a user or project. It
- should also be possible to move the users data for a fileserver to
- a less loaded one, or one with more diskspace available.
-
- Some benefits of using AFS are:
-
- * user-transparent data migration
-
- * an ability for on-line backups;
-
- * data replication that provides both load balancing and
- robustness of critical data
-
- * global name space without automounters and other add-ons;
-
- * @sys variables for platform-independent paths to binary
- location;
-
- * enhanced security;
-
- * client-side caching;
-
-Anti-requirements
-=================
-
- * No databases
-
- AFS isn't constructed for storing databases. It would be possible
- to use AFS for storing a database if a layer above for locking and
- synchronizing data would be provided.
-
- One of the problems is that AFS doesn't include mandatory
- byte-range locks. AFS uses advisory locking on whole files.
-
- If you need a real database, use one, they are much more efficent
- on solving a database problem. Don't use AFS.
-
-
-
-File: arla.info, Node: Data organization, Next: Callbacks, Prev: Requirements, Up: Organization of data
-
-Volume
-======
-
-A volume is a unit that is smaller than a partition. It is usually (or
-should be) a well defined area, like a user's home directory, a project
-work area, or a program distribution.
-
-Quota is controlled on volume-level. All day-to-day management is done
-on volumes.
-
-Partition
-=========
-
-In AFS a partition is what normally is named a partition. All partions
-that afs is using are named a special way, `/vicepNN', where NN is
-ranged from a to z, continuing with aa to zz. The fileserver (and
-volser) automaticly picks upp all partitions starting with `/vicep'
-
-Volumes are stored in a partition. Volumes can't span several
-partitions. Partitions are added when the fileserver is created or when
-a new disk is added to a filesystem.
-
-Volume cloning and read-only clones
-===================================
-
-A clone of a volume is often needed for volume operations. A clone is a
-copy-on-write copy of a volume, the clone is the read-only version.
-
-Two special versions of a clone are the read-only volume and the backup
-volume. The read-only volume is a snapshot of a read-write volume (that
-is what a clone is) that can be replicated to several fileservers to
-distribute the load. Each fileserver plus partition where a read-only
-clone is located is called a replication-site. It usually does not make
-sense to have more than one read-only clone on each fileserver.
-
-The backup volume is a clone that typically is made (with `vos
-backupsys') each night to enable the user to retrieve yesterday's data
-when they happen to remove a file. This is a very useful feature, since
-it lessens the load on the system-administrators to restore files from
-backup. The volume is usually mounted in the root user's home directory
-under the name OldFiles. A special feature of the backup volume is that
-you can't follow mountpoints out of a backup volume.
-
-Mountpoints
-===========
-
-Volumes are independent of each other. To glue together the file tree
-there are `mountpoint's. Mountpoints are really symlinks that are
-formated in a special way so that they point out a volume and an
-optional cell. An AFS-cache-manager will show a mountpoint as directory
-and in fact it will be the root directory of the target volume.
-
-
-File: arla.info, Node: Callbacks, Next: Volume management, Prev: Data organization, Up: Organization of data
-
-Callbacks
-=========
-
-Callbacks are messages that enable the AFS-cache-manager to keep the
-files without asking the server if there is newer version of the file.
-
-A callback is a promise from the fileserver that it will notify the
-client if the file (or directory) changes within the timelimit of the
-callback.
-
-For contents of read-only volumes there is only one callback per volume
-called a volume callback and it will be broken when the read-only volume
-is updated.
-
-The time range of callbacks is from 5 to 60 minutes depending on how
-many users of the file exist.
-
-
-File: arla.info, Node: Volume management, Next: Relationship between pts uid and unix uid, Prev: Callbacks, Up: Organization of data
-
-Volume management
-=================
-
-All volume managment is done with the `vos' command. To get a list of
-all commands `vos help' can be used. For help on a specific vos
-subcommand, `vos subcommand -h' can be used.
-
- * Create
-
- vos create mim c HO.staff.lha.fluff -quota 400000
-
- * Move
-
- Volumes can be moved from a server to another, even when users are
- using the volume.
-
- * Replicate
-
- Read-only volumes can be replicated over several servers, they are
- first added with `vos addsite', and the replicated with `vos
- release' over the servers.
-
- * Release
-
- When you want to distribute the changes in the readwrite volume to
- the read-only clones.
-
- * Remove
-
- Volumes can be removed
-
- Note that you shouldn't remove the last readonly volume since this
- makes clients misbehave. If you are moving the volume you should
- rather add a new RO to the new server and then remove it from the
- old server.
-
- * Backup and restoration of volumes.
-
- `vos backup' and `vos backupsys' creates the backup volume.
-
- To stream a volume out to a `file' or `stdout' you use `vos dump'.
- The opposite command is named `vos restore'.
-
-
-
-File: arla.info, Node: Relationship between pts uid and unix uid, Prev: Volume management, Up: Organization of data
-
-Relationship between pts uid and unix uid
-=========================================
-
-Files in AFS are created with the pts uid of the token that was valid at
-the time. The pts uid number is then by commands like `ls -l'
-interpreted as a unix uid and translated into a username. If the pts and
-the unix uids differ, this might confuse the user as it looks like as
-her files are owned by someone else. This is however not the case.
-Complications can occur if programs impose further access restrictions
-based on these wrongly interpreted uids instead of using the `access()'
-system call for that purpose. Graphical file browsers are typically
-prone to that problem with the effect that the users are not able to
-see their own files in these tools.
-
-
-File: arla.info, Node: AFS and the real world, Next: Parts of Arla, Prev: Organization of data, Up: Top
-
-AFS and the real world
-**********************
-
-This chapter tries to describe problems that you see in the real (not
-that perfect) world and show possible solutions to these problems.
-
-* Menu:
-
-* NAT:: Truly evil stuff.
-* Samba:: Export AFS to Windows computers.
-* Integration with Kerberos:: How to integrate Kerberos with AFS.
-* Kerberos tickets and AFS tokens:: History and tools
-
-
-File: arla.info, Node: NAT, Next: Samba, Prev: AFS and the real world, Up: AFS and the real world
-
-NAT
-===
-
-There's something evil out there that's called NAT, which stands for
-Network Address Translation. For whatever reasons, people are using it
-and will continue doing so.
-
-First of all, it seemed like AFS should work just fine through NAT, you
-just appear to be coming from the NAT-address and some random port
-instead. Looking closer at different NAT implementations it seems like
-they have a rather short timeout:
-
-`FreeBSD natd'
- 60 seconds
-
-`Cisco IOS'
- 300 seconds
-
-`NetBSD ipf (ipnat)'
- 600 seconds
-
-`Linux Nat (masq)'
- 300 seconds
-
-If the client doesn't transmit any traffic to a particular host for that
-amount of time, it will get mapped to one of the IP address of the
-NAT-server (if you happen to run PAT, the port will be randomized too).
-
-The authors of Rx realized that keeping a Rx connection associated with
-(IP-address,port) pair was a bad idea. One example is that you get
-problems with multi-homed hosts. So Rx keeps its own connection id data
-in the packet. With this feature client and server should be able to
-detect address changes.
-
-Unfortunately, the use of the orignal Rx-code stops this from happening
-in Transarc/OpenAFS code. The code keeps track of incoming packets and
-keeps track of the right peer (client). But it never updates the
-IP-address,port pair in its data structure, so the answer packet will go
-to the old IP-address,port pair.
-
-If you can control your NAT machine you can have static mapping for your
-AFS hosts (Transarc/OpenAFS uses source port 7000 and Arla uses source
-port 4711). You can try to use Natkeep
-<http://mit.edu/fredette/www/natkeep/> if you run an old Arla or
-Transarc/OpenAFS client. From version 0.36 arla will have support for
-polling the servers at the right interval to prevent NAT from dropping
-information about your session.
-
-
-File: arla.info, Node: Samba, Next: Integration with Kerberos, Prev: NAT, Up: AFS and the real world
-
-Samba
-=====
-
-The major problem when exporting the AFS filespace read-write to SMB
-(Windows fileshareing) using Samba is the transfer of the user token to
-the smb-server. The simple may is to use clear-text password between the
-Windows client and the samba-server, and then to get tokens for the user
-with this password. This solution is clearly not acceptable for security
-aware AFS administrators.
-
-Describe here how to make AFS work "securely" with samba.
-
-On solution is to use `kimpersonate' + store afs key on fileserver
-(talk to Love).
-
-
-File: arla.info, Node: Integration with Kerberos, Next: Kerberos tickets and AFS tokens, Prev: Samba, Up: AFS and the real world
-
-Integration with Kerberos
-=========================
-
-Kerberos 4 and 5 can be integrated quite well with AFS. This is mainly
-due to the fact that the security model used in AFS is Kerberos. The
-kaserver is a Kerberos 4 server with pre-authentication. The kaserver
-also provides a feature that limits the number of password retries, and
-after that you are locked out for half an hour. This feature can only be
-used in the ka interface as it requires pre-authentication, but since
-the kaserver provides a Kerberos 4 interface (without pre-authentication
-and without this limitation) it is quite worthless.
-
-Many sites indeed use a kerberosserver instead of a kaserver. One of
-the reasons is that they want to use Kerberos 5 (which is required for
-Windows 2000).
-
-To use a kerberosserver, you have to put the same key into the AFS
-KeyFile and the principal named afs of your kerberos realm. If you have
-a cell which has another name than lowercase of your realmname, the
-instance is the cellname. As the cellname often contains dots, this can
-be quite confusing in Kerberos 4: afs.stacken.kth.se@STACKEN.KTH.SE. The
-first dot is the seperator between principal and instance, the other
-dots are part of the name. The simplest way to do create a KeyFile on
-your AFS server is to use heimdal's kadmin to generate and extract a
-KeyFile. It has an option designed to do so. Be aware that the serial
-number of the afs principal must match on all kerberos servers and all
-KeyFiles on all AFS servers.
-
-The default cellname to get a kerberos ticket for is contained in the
-configuration file `ThisCell'. If you got more than one cell, you want
-to list all cells to get tickets for in the `TheseCells' file.
-
-
-File: arla.info, Node: Kerberos tickets and AFS tokens, Prev: Integration with Kerberos, Up: AFS and the real world
-
-Kerberos tickets and AFS tokens
-===============================
-
-To further confuse the poor user, AFS and Kerberos programmers decided
-that they wanted to store their credentials at different places. In AFS,
-the kernel was a natural place to store the credentials (named token)
-since the CMU/Transarc AFS/OpenAFS implementation lives in the kernel.
-The Kerberos people on the other hand thought that storing the
-credentials (named ticket) in a file would be a good idea.
-
-So know you have to synchronize the credentials if you just want to
-enter your password once. There are several tools that can do that for
-you. The question is what tools to use for what problem.
-
-To add to the confusion not all tools talk to both Kerberos and
-kaservers. There is also a bogus user-id in the token that is supposed
-to be the same as your pts-user-id. Not that it makes any difference,
-but some people get confused when unknown numbers show up in the token.
-The easily confused people are often the ones that have more than one
-principal in the same realm/cell (read sysadmins).
-
-If you want to get your ticket from your Kerberos server, you use
-`kinit', and then use `afslog' or `aklog' to get AFS tokens and push
-them to the kernel (and AFS daemon). Some `kinit' (and `kauth') can do
-both for you, use `kinit --afslog' or simply `kauth'. Note that `kinit'
-and `kauth' don't get set your AFS-token user-id right, and thus can be
-confusing for people who think that this is important.
-
-The `klog' program that you get with Transarc/OpenAFS talks to the
-kaserver and behaves just-right in the sense that it talks to the pts
-server to get the AFS-token user-id right, but `klog' talks only to the
-kaserver which will not work for people with a Kerberos server. `Klog'
-in Arla was written by Chris Wing <wingc@engin.umich.edu> as a part of
-a packet called `afsutils', they did the right thing and talked to the
-pts-server to get the user-id. However, it uses Kerberos libs to talk
-to the server. These libraries require the files `/etc/krb.conf' and
-`/etc/krb.realms' to be setup correctly for their cell/realm. Not that
-easy.
-
-A long time ago Ken Hornstein <kenh@cmf.nrl.navy.mil> wrote the AFS
-Migration Kit that helped you to migrate from AFS to MIT Kerberos 5.
-It included a tool named aklog that could convert a Kerberos tickets to
-tokens. This tool was also rewritten in Arla by Brandon S. Allbery
-<allbery@ece.cmu.edu>. `aklog' can't get you new credentials, it just
-converts old ones to new ones.
-
-Then Transarc decided that they needed to fix a security hole in their
-kaserver, and while doing that, they managed to break a part in the
-kaserver so it ceased to work for kerberos requests.
-
-First the defect existed unnoticed for a long time, later Transarc has
-not managed to distribute a working version of the kaserver. Due to
-this, a lot of sites run a kaserver with this defect. Instead of
-installing working authentification servers from another sources,
-people started to whine again and Love <lha@stacken.kth.se> wrote the
-tool `kalog' that talked the ka-protocol (but didn't do the AFS user-id
-right) to work around that problem.
-
-All tools that use Kerberos 4 need a working `/etc/krb.conf' and
-`/etc/krb.realms'. Kerberos 5 programs need `/etc/krb5.conf'. AFS
-aware tools need `/usr/arla/etc/CellServDB' or
-`/usr/vice/etc/CellServDB'.
-
-Also the Kerberos implementations from KTH (kth-krb and Heimdal) include
-AFS support to make your life more pleasant. One thing is that you can
-have a file `$HOME/.TheseCells' that lists the cells you use and the
-Kerberos tools will try to get tickes and tokens for those cells.
-Heimdal contains support for converting a Kerberos 4 srvtab to an AFS
-KeyFile.
-
-Below is a table that describes what tools does what, what
-inheritance(s) they have, and what protocol(s) they speak. From the
-inheritance (also in a table below) it is possible to deduct what
-configuration files the tools use.
-
-Tool Inheritance Protocol Produces
-Transarc/OpenAFS klog afs authlib KA Ticket and tokens
-Arla klog Kerberos and Kerberos Ticket and tokens
- libkafs
-AFS Migration kit's MIT Kerberos Kerberos Converts Kerberos
-aklog and Ken tickets to tokens
- Hornstein's
- afslib
-Arla's aklog Kerberos and Kerberos Converts Kerberos
- libkafs tickets to tokens
-kth-krb's and Kerberos and Kerberos Converts Kerberos
-Heimdal's afslog libkafs tickets to tokens
-kalog arla and KA Get initial
- libkafs ticket, store
- tokens and tickets
-
-Inheritance table
-
-`afs authlib'
- Reads `CellServDB' and `ThisCell' in `/usr/vice/etc'
-
-`Kerberos and libkafs'
- Kerberos 4 uses `/etc/krb.conf' and `/etc/krb.realms'. Kerberos 5
- uses `/etc/krb5.conf'.
-
-`arla'
- Arla uses `CellServDB' and `ThisCell' in `/usr/vice/etc' and
- `/usr/arla/etc'
-
-`libkafs'
- Libkafs uses DNS and `CellServDB' in `/usr/vice/etc' and
- `/usr/arla/etc' to figure out what ticket it should convert into
- tables. The file `TheseCells' and `$HOME/.TheseCells' is used to
- get extra tokens.
-
-
-File: arla.info, Node: Parts of Arla, Next: Debugging, Prev: AFS and the real world, Up: Top
-
-Parts of Arla
-*************
-
- *Caution:* This text just tries to give a general picture. For
- real info read the code. If you have any questions, mail
- <arla-drinkers@stacken.kth.se>.
-
-* Menu:
-
-* How arla works::
-* The relation between Arlad and NNPFS::
-* The life of a file::
-* Tools and libs::
-* The files in arlad/::
-* pioctl and kafs::
-
-
-File: arla.info, Node: How arla works, Next: The relation between Arlad and NNPFS, Prev: Parts of Arla, Up: Parts of Arla
-
-How does arla work
-==================
-
-Arla consists of two parts, a userland process (arlad) and the
-kernel-module (nnpfs).
-
-Arlad is written in user-space for simpler debugging (and less
-rebooting). As a uset space program arlad does not have the same
-limitations as if it would be written in the kernel. To avoid
-performance loss as much as possible, nnpfs is caching data.
-
-nnpfs and arlad communicate with each other via a char-device-driver.
-There is a rpc-protocol currenly used specially written for this
-(`arlad/message.c')
-
-nnpfs is written to be as simple as possible. Theoretically, nnpfs could be
-used by other user-space daemons to implement a file system. Some
-parts, such as syscalls, are arla-specific. These parts are designed to
-be as general as possible.
-
-For example, nnpfs does not recognize which pioctl the user-level program
-calls, it just passes this information on to arlad.
-
-
-File: arla.info, Node: The relation between Arlad and NNPFS, Next: The life of a file, Prev: How arla works, Up: Parts of Arla
-
-The relation between Arlad and NNPFS
-==================================
-
- Userland
-
- ---------
- Edit file | Arlad | ------> Network
- | ---------
- ----|-----------------|[1]----
- ------- -------
- Kernel | VFS | <--[2]--> | NNPFS |
- ------- -------
-
-[1] A char device (/dev/nnpfs0)
-
-[2] Xfs provides a filesystem for the vfs-layer in
- the operating system.
-
-
-File: arla.info, Node: The life of a file, Next: Tools and libs, Prev: The relation between Arlad and NNPFS, Up: Parts of Arla
-
-The life of a file
-==================
-
-Step by step description of what happens during the creation of a file.
-The names are inspired of BSD-style VFS-layer but the idea is the same
-in most operating systems.
-
- * The user decides to open a file.
-
- * open(2) syscall is issued.
-
- * The vfslayer sends a VOP_LOOKUP to nnpfs that is forwarded to arlad
- with a getnode() (seq-num 1).
-
- * arlad tries to find the requested file and then, if found, sends an
- install_node to nnpfs by writing to the nnpfs character device.
-
- * nnpfs inserts the node into the cache and returns from the device
- write.
-
- * arlad sends a wakeup rpc message (seq-num 1) to nnpfs. If the
- return value is zero nnpfs tries to find the node in the cache, if
- not found it might have been flushed out of the cache and the whole
- thing is repeated.
-
- * If a none-zero return value is returned, this value is sent as
- reply to the user. This way arla can decide what error message is
- returned, without nnpfs having support for each error.
-
- * nnpfs now checks if it has the valid attributes. If the attributes
- are invalid, nnpfs will send a rpc message to arlad to refresh it.
-
- * Since the user wanted to open the file, a getdata rpc message is
- sent from nnpfs to arlad. Now arlad fetches the files from the afs
- file server.
-
- * Arlad stores the file in the file cache. All vnode operations will
- be done on this file. Now arlad sends a installdata to nnpfs.
-
- * When nnpfs recives the installdata it looks up the node in the cache,
- and then it does a VOP_LOOKUP to find a vnode to the cachefile
- (and store it to keep it for future use).
-
- * The same thing is done when the file is a directory, except that
- the directory is converted from the afs directory format to an
- operating system dependent format and stored in a file. nnpfs reads
- this file instead.
-
- * If the directory is modified locally, write operations are done on
- the file obtained from the afs-server, and when done the newly
- changed file is converted and reinstalled.
-
- * Now the user wants to read a file.
-
- * read(2) system call is issued.
-
- * A VOP_READ is sent to the from the vfs-layer to nnpfs.
-
- * nnpfs checks if it has valid attributes/and data (and updates if
- needed). Now VOP_READ is simply performed on the stored vnode of
- the cachefile.
-
-
-
-File: arla.info, Node: Tools and libs, Next: The files in arlad/, Prev: The life of a file, Up: Parts of Arla
-
-Tools and libs
-==============
-
-What other tools does the arla suite consists of
-
-libutil: `util/libutil.a' - A library for the most often used
- modules like hashtable, double-linked list, logging functions,
- date-parsing, etc
-
-rx: `rx/librx.a' - The library for the rx protocol
- (*note Rx protocol::).
-
-lwp: `lwp/liblwp.a' - The library for the lwp thread-package
- (*note LWP::).
-
-ydr: `ydr/ydr' - A stub generator that replaces rxgen.
-
-rxkad: `rxkad/librxkad.a' - The rx Kerberos authentication package.
-
-roken: `lib/roken/libroken.a' - The library that will unbreak
- things that are missing or broken.
-
-ko: `lib/ko/libko.a' - A library of functions that are arlad-core
- related but also are useful for programs like vos, pts, fs, etc.
-
-arlalib: `appl/lib/libarlalib.a' - A broken library that does all
- the hard work with connections etc.
-
-fs: `appl/fs/fs' - The fs util, extra feature
- (amongst others): getfid.
-
-vos: `appl/vos/vos' - The vos util.
-
-pts: `appl/pts/pts' - The pts util, extra feature: dump.
-
-udebug: `appl/udebug/udebug' - Debug your ubik server.
-
-File: arla.info, Node: Rx protocol, Next: LWP, Up: Tools and libs
-
-Rx protocol
-===========
-
-Rx is run over UDP.
-
-One of rxgen or ydr is used to generate stub-files, ydr is better since
-it generates prototypes, too.
-
-The current implemetation of rx it not that beautiful.
-
-
-File: arla.info, Node: LWP, Prev: Rx protocol, Up: Tools and libs
-
-LWP
-===
-
-LWP is a preepmtive thread package. It does it's context-switching by
-creating a private stack for each thread. The heart of the package is
-select(2).
-
-The stack is checked for overruns in context-switches, but that is often
-too late. It might be an idea to add a `red zone' at the top of the
-stack to be able to detect overruns.
-
-
-File: arla.info, Node: The files in arlad/, Next: pioctl and kafs, Prev: Tools and libs, Up: Parts of Arla
-
-The files in arlad/
-===================
-
-This is a short describtion of the files to bring new deveplopers up to
-speed.
-
-The core of arlad
------------------
-
-`adir.c' - contains all functions needed to to operations
- on afs-directory files.
-
-`afsdir_check.c' - check if an AFS-directory looks sane.
-
-`arla.c' - The startup and the standalone (-t) code.
-
-`arladeb.c' - The logging code specific to arla, like aliases
- for debugging masks.
-
-`cmcb.c' - The callback-server that is contacted by the
- server when a callback expires or a server wants to send an
- InitCallBackState.
-
-`conn.c' - The connection cache, responsible for caching connection
- based on pag and security index. It will also create new
- connection when needed.
-
-`cred.c' - Keep track of all credentials that all users have
- inserted. Indexed on pag.
-
-`fbuf.c' - An interface between rx and filedescriptors. It is also
- used to mmap files. Used by `adir.c'.
-
-`fcache.c' - Responsible for keeping track of files in the cache.
- Also fetches files from the afs-server.
-
-`fprio.c' - Tries to give files priority. These files are
- therefore not garbarge-collected as fast as they would be
- otherwise. If you wonder what this is for, think of the
- disconnected mode.
-
-`inter.c' - An interface to hide all junk in fcache, just give
- the items a VenusFid and you can access them this way.
-
-`kernel.c' - The interface between arlad and the char-device.
-
-`messages.c' - The rpc interface between arlad and nnpfs.
-
-`volcache.c' - Cache for all volumes.
-Operating system specific files
--------------------------------
-
-These are the files that contain operating specific functions. Today
-it's just conv_dir().
-
-`aix-subr.c' - AIX
-
-`bsd-subr.c' - FreeBSD 2.2.6, OpenBSD 2.2, 2.3, NetBSD 1.3.x
-
-`hpux-subr.c' - HPUX
-
-`irix-subr.c' - Irix
-
-`linux-subr.c' - Linux 2.0.x, 2.1.x, 2.2
-
-`solaris-subr.c' - Solaris 2.5.x, 2.6, 7
-
-`sunos-subr.c' - SunOS
-
-`unknown-subr.c' - Stub used when compiled on a unknown OS.
-
-File: arla.info, Node: pioctl and kafs, Prev: The files in arlad/, Up: Parts of Arla
-
-pioctl and kafs
-===============
-
-The pioctl interface is the only part of nnpfs that is afs related.
-
-pioctl is a ioctl but called with a path instead of a filedescriptor.
-When you probe if there is a live afsclient you first run `k_hasafs()'
-that probes if there is an afsclient around. It also sets up some
-static variables in the library. So if you start to do `pioctl()' w/o
-running `k_hasafs()', you're up to funny errors, and/or get a corefile.
-
-`k_hasafs()' does an `AFSCALL_PIOCTL' with opcode `VIOCSETTOK' and
-insize == 0, ie you try to set a token (ticket) that is 0 bytes long.
-This is cleary invalid and kafs expects to find an `EINVAL' returned
-from `syscall(2)'.
-
-The pioctl is used more then just for `AFSCALL_PIOCTL', an other use is
-`AFSCALL_SETPAG' (setting pag). It has also been in use for setting nnpfs
-debugging levels.
-
-When nnpfs discovers that a path is given in the `pioctl()' it does a
-`VOP_LOOKUP' on the path and if the returned value is a vnode that
-resides in afs then it extracts the nnpfs-handle for that node (that just
-happens to be the VenusFid) and passes that on to arlad.
-
-The only ugly thing about the current implentation is that the syscall
-code assumes that the arlad on "nnpfs-fd" is the arlad that should get
-this syscall.
-
-An example of using `pioctl()':
-
- int
- fs_getfilecellname(char *path, char *cell, size_t len)
- {
- struct ViceIoctl a_params;
-
- a_params.in_size=0;
- a_params.out_size=len;
- a_params.in=NULL;
- a_params.out=cell;
-
- if (k_pioctl(path,VIOC_FILE_CELL_NAME,&a_params,1) == -1)
- return errno;
-
- return 0;
- }
-
- int
- main (int argc, char **argv)
- {
- char cell[100];
-
- if (!k_hasafs())
- errx (1, "there is no afs");
-
- if (fs_getfilecellname (".", cell, sizeof(cell)))
- errx (1, "fs_getfilecellname failed");
-
- printf ("cell for `.' is %s", cell);
- return 0;
- }
-
-
-File: arla.info, Node: Debugging, Next: Arlad, Prev: Parts of Arla, Up: Top
-
-Debugging
-*********
-
-This chapter of the manual includes tips that are useful when debugging
-arla.
-
-Arla and nnpfs contains logging facilities that is quite useful when
-debugging when something goes wrong. This and some kernel debugging tips
-are described.
-
-* Menu:
-
-* Arlad::
-* Debugging LWP with GDB::
-* nnpfs::
-* nnpfs on linux::
-* Debugging techniques::
-* Kernel debuggers::
-* Darwin/MacOS X::
-
-
-File: arla.info, Node: Arlad, Next: Debugging LWP with GDB, Prev: Debugging, Up: Debugging
-
-Arlad
-=====
-
-If arlad is run without any arguments arlad will fork(2) and log to
-syslog(3). To disable forking use the -no-fork (-n) switch. In the
-current state of the code, arlad is allways to be started with the
-recover (-z) switch. This will invalidate your cache at startup. This
-restriction may be dropped in the future.
-
-To enable more debuggning run arla with the switch
--debug=module1,module2,... One useful combination is
- --debug=all,-cleaner
-The cleaner output is usully not that intresting and can be ignored.
-
-A convenient way to debug arlad is to start it inside gdb.
- datan:~# gdb /usr/arla/libexec/arlad
- (gdb) run -z -n
-This gives you the opportunity to examine a crashed arlad.
- (gdb) bt
-The arla team appreciates cut and paste information from the beginning
-to the end of the bt output from such a gdb run.
-
-To set the debugging with a running arlad use `fs arladeb' as root.
-
- datan:~# fs arladeb
- arladebug is: none
- datan:~# fs arladeb almost-all
- datan:~#
-
-By default, arlad logs through syslog if running as a daemon and to
-stderr when running in the foreground (with `--no-fork').
-
-
-File: arla.info, Node: Debugging LWP with GDB, Next: nnpfs, Prev: Arlad, Up: Debugging
-
-Debugging LWP with GDB
-======================
-
-For easy tracing of threads we have patch
-(<http://www.stacken.kth.se/projekt/arla/gdb-4.18-backfrom.diff>) for
-gdb 4.18 (a new command) and a gdb sequence (think script).
-
-The sequence only works for i386, but its just matter of choosing
-different offset in topstack to find $fp and $pc in the lwp_ps_internal
-part of the sequence.
-
-You should copy the `.gdbinit' (that you can find in the arlad
-directory in the source-code) to your home-directory, the directory from
-where you startat the patched gdb or use flag -x to gdb.
-
-Your debugging session might look like this:
-
- (gdb) lwp_ps
- Runnable[0]
- name: IO MANAGER
- eventlist:
- fp: 0x806aac4
- pc: 0x806aac4
- name: producer
- eventlist: 8048b00
- fp: 0x8083b40
- pc: 0x8083b40
- Runnable[1]
- [...]
- (gdb) help backfrom
- Print backtrace of FRAMEPOINTER and PROGRAMCOUNTER.
-
- (gdb) backfrom 0x8083b40 0x8083b40
- #0 0x8083b40 in ?? ()
- #1 0x8049e2f in LWP_MwaitProcess (wcount=1, evlist=0x8083b70)
- at /afs/e.kth.se/home/staff/lha/src/cvs/arla-foo/lwp/lwp.c:567
- #2 0x8049eaf in LWP_WaitProcess (event=0x8048b00)
- at /afs/e.kth.se/home/staff/lha/src/cvs/arla-foo/lwp/lwp.c:585
- #3 0x8048b12 in Producer (foo=0x0)
- at /afs/e.kth.se/home/staff/lha/src/cvs/arla-foo/lwp/testlwp.c:76
- #4 0x804a00c in Create_Process_Part2 ()
- at /afs/e.kth.se/home/staff/lha/src/cvs/arla-foo/lwp/lwp.c:629
- #5 0xfffefdfc in ?? ()
- #6 0x8051980 in ?? ()
-
-There also the possibility to run arla with pthreads (run configure with
--with-pthreads).
-
-
-File: arla.info, Node: nnpfs, Next: nnpfs on linux, Prev: Debugging LWP with GDB, Up: Debugging
-
-nnpfs
-===
-
-NNPFS debugging does almost look the same on all platforms. They all
-share same debugging flags, but not all are enabled on all platforms.
-
-Change the debugging with the `fs nnpfsdebug' command.
-
- datan:~# fs nnpfsdebug
- nnpfsdebug is: none
- datan:~# fs nnpfsdebug almost-all
- datan:~#
-
-If it crashes before you have an opportunity to set the debug level, you
-will have to edit `nnpfs/YOUR-OS/nnpfs_deb.c' and recompile.
-
-The logging of nnpfs ends up in your syslog. Syslog usully logs to
-/var/log or /var/adm (look in /etc/syslog.conf).
-
-
-File: arla.info, Node: nnpfs on linux, Next: Debugging techniques, Prev: nnpfs, Up: Debugging
-
-nnpfs on linux
-============
-
-There is a problem with klogd, it's too slow. Cat the `/proc/kmsg' file
-instead. Remember to kill klogd, since the reader will delete the text
-from the ring-bufer, and you will only get some of the message in your
-cat.
-
-
-File: arla.info, Node: Debugging techniques, Next: Kernel debuggers, Prev: nnpfs on linux, Up: Debugging
-
-Debugging techniques
-====================
-
-Kernel debugging can sometimes force you to exercise your imagination.
-We have learned some different techniques that can be useful.
-
-Signals
--------
-
-On operatingsystems with kernel debugger that you can use probably find
-where in the kernel a user-program live, and thus deadlocks or trigger
-the bad event, that later will result in a bug. This is a problem, how
-do you some a process to find where it did the intresting thing when you
-can't set a kernel breakpoint ?
-
-One way to be notified is to send a signal from the kernel module
-(psignal() on a BSD and force_sig() on linux). SIGABRT() is quite useful
-if you want to force a coredump. If you want to continue debugging, use
-SIGSTOP.
-
-Recreateable testcases
-----------------------
-
-Make sure bugs don't get reintroduced.
-
-
-File: arla.info, Node: Kernel debuggers, Next: Darwin/MacOS X, Prev: Debugging techniques, Up: Debugging
-
-Kernel debuggers
-================
-
-Kernel debuggers are the most useful tool when you are trying to figure
-out what's wrong with nnpfs. Unfortunately they also seem to have their
-own life and do not always behave as expected.
-
-Using GDB
----------
-
-Kernel debugging on NetBSD, OpenBSD, FreeBSD and Darwin are almost the
-same. You get the idea from the NetBSD example below:
-
- (gdb) file netbsd.N
- (gdb) target kcore netbsd.N.core
- (gdb) symbol-file /sys/arch/i386/compile/NUTCRACKER/netbsd.gdb
-
-This example loads the kernel symbols into gdb. But this doesn't show
-the nnpfs symbols, and that makes your life harder.
-
-Getting all symbols loaded at the same time
--------------------------------------------
-
-If you want to use the symbols of nnpfs, there is a gdb command called
-`add-symbol-file' that is useful. The symbol file is obtained by
-loading the kernel module nnpfs with `kmodload -o /tmp/nnpfs-sym' (Darwin)
-or `modload' (NetBSD and OpenBSD). FreeBSD has a linker in the kernel
-that does the linking instead of relying on `ld'. The symbol address
-where the module is loaded get be gotten from `modstat', `kldstat' or
-`kmodstat' (it's in the `area' field).
-
-If you forgot the to run modstat/kldstat/kmodstat, you can extract the
-information from the kernel. In Darwin you look at the variable kmod
-(you might have to case it to a (kmod_info_t *). We have seen gdb loose
-the debugging info). kmod is the start of a linked list. Other BSDs have
-some variant of this.
-
-You should also source the commands in /sys/gdbscripts (NetBSD), or
-System/xnu/osfmk/.gdbinit (Darwin) to get commands like ps inside gdb.
-
- datan:~# modstat Type Id Off Loadaddr Size Info Rev Module
- Name DEV 0 29 ce37f000 002c ce388fc0 1 nnpfs_mod [...]
- [...]
- (gdb) add-symbol-table nnpfs.sym ce37f000
-
-Debugging processes, examine their stack, etc
----------------------------------------------
-
-One of diffrencies between the BSD's are the `proc', a command that
-enables you do to a backtrace on all processes. On FreeBSD you give the
-`proc' command a `pid', but on NetBSD and OpenBSD you give a pointer to
-a `struct proc'.
-
-After you have ran `proc' to set the current process, you can examine
-the backtrace with the regular `backtrace' command.
-
-Darwin does't have a `proc' command. Instead you are supposed to use
-gdb sequences (System/xnu/osfmk/.gdbinit) to print process stacks,
-threads, activations, and other information.
-
-Debugging Linux
----------------
-
-You can't get a crashdump for linux with patching the kernel. There are
-two projects have support for this. Mission Critical Linux
-<http://www.missioncritiallinux.com> and SGI <http://oss.sgi.com/>.
-
-Remember save the context of /proc/ksyms before you crash, since this is
-needed to figure out where the nnpfs symbols are located in the kernel.
-
-But you can still use the debugger (or objdump) to figure out where in
-the binary that you crashed.
-
-`ksymoops' can be used to create a backtrace.
-
-Using adb
----------
-
-Adb is not a symbolic debugger, this means that you have to read the
-disassembled object-code to figure out where it made the wrong turn and
-died. You might be able to use GNU objdump to list the assembler and
-source-code intertwined (`objdump -S -d mod_nnpfs.o'). Remember that GNU
-binutils for sparc-v9 isn't that good yet.
-
-You can find the script that use use for the adb command `$<' in
-`/usr/lib/adb' and `/usr/platform/PLATFORNAME/adb'.
-
-Debugging a live kernel
------------------------
-
-An important thing to know is that you can debug a live kernel too, this
-can be useful to find dead-locks. To attach to a kernel you use a
-command like this on a BSD system (that is using gdb):
-
- (gdb) file /netbsd
- (gdb) target kcore /dev/mem
- (gdb) symbol-file /sys/arch/i386/compile/NUTCRACKER/netbsd.gdb
-
-And on Solaris:
-
- # adb -k /dev/ksyms /dev/mem
-
-Other useful debugging tools
-----------------------------
-
-Most diagnosics tools like ps, dmesg, and pstat on BSD systems used to
-look in kernel memory to extract information (and thus earned the name
-kmem-groovlers). On some systems they have been replaced with other
-method of getting their data, like /proc and sysctl.
-
-But due to their heritage they can still be used in with a kernel and
-coredump to extract information on some system.
-
-
-File: arla.info, Node: Darwin/MacOS X, Next: Porting, Prev: Kernel debuggers, Up: Debugging
-
-Darwin/MacOS X
-==============
-
-You'll need two computers to debug arlad/nnpfs on darwin since the common
-way to debug is to use a remote kernel-debugger over IP/UDP.
-
-First you need to publish the arp-address of the computer that you are
-going to crash.
-
-We have not found any kernel symbols in MacOSX Public Beta, so you
-should probably build your own kernel. Use Darwin xnu kernel source
-with cvs-tag: Apple-103-0-1 (not xnu-103).
-
- gdb nnpfs.out
- target remote-kdp
- add-symbol-table ...
- attach <host>
-
-
-File: arla.info, Node: Porting, Next: Programming, Prev: Darwin/MacOS X, Up: Top
-
-Porting
-*******
-
-The largest part of the work needed to port Arla to a new operating
-system is in porting nnpfs, as kernel programming always is harder, less
-portable and messier than user-space dito. Arla in test mode
-(`arla-cli') should work without any porting on any system that's not
-very far away from Unix and that provides berkeley sockets (including
-cygwin32). The hard part is porting the NNPFS kernel module, and we will
-spent most of this text on how to do that.
-
-* Menu:
-
-* Porting user-space::
-* Porting NNPFS::
-
-
-File: arla.info, Node: Porting user-space, Next: Porting NNPFS, Prev: Porting, Up: Porting
-
-user-space
-==========
-
-The user-space parts should work on basically any system that is
-reasonably Posix and has berkeley sockets. The build uses autoconf and
-should adapt itself to most forseeable circumstances. If it fails to
-consider something that is missing or not working on the particular OS
-you are porting to, hard-code it to make sure that is what is missing
-and then try to create an autoconf test for it. If you fail to do so,
-or have no autoconf experience, send us the patches anyway and tell us
-where you are having the problem.
-
-LWP
----
-
-The only thing that might take a little bit more effort in porting is
-the context-switch in the LWP user-level threads package. There are
-assembler versions for most of the common architectures in `lwp'. Part
-of the problem is getting this code assembled properly. There is
-unfortunately no easy and portable way of preprocessing and assembling
-code. There is a script `lwp/make-process.o.sh' that tries to do in
-some different ways, but it may fail for you. Next problem is that
-assembler syntax can vary a lot even on the same CPU. The source files
-are written in such a way that they should be acceptable to almost any
-syntax, but if it fails you have to find out what particular syntax has
-to be used and adapt the source file for that.
-
-The more interesting problem is if there is no support for your CPU.
-The first thing to try then is the `--with-pthreads' option that uses
-the pthreads library. If that fails or you want LWP working you have
-to figure out enough details on your CPU to write two functions in
-assembler, `savecontext' and `returnto' that save and restore the
-processor context.
-
-
-File: arla.info, Node: Porting NNPFS, Prev: Porting user-space, Up: Porting
-
-NNPFS
-===
-
- 1. It helps to have source code for your operating system.
-
- In theory, if stuff was documented well enough, you wouldn't need
- it. In practice it never is, so you find out interfaces specs and
- how stuff works by reading the source code. If you're unable to
- find source code for your OS, try finding source for the closest
- match. If your OS is based on BSD, try the appropriate version of
- BSD, for example.
-
- 2. If you don't have source, try second best, include files.
-
- You can usually gather quite a lot of information on the workings
- of the kernel by reading the includes files in `<sys/*.h>'.
-
- 3. Be lazy
-
- Try to find out what other NNPFS port is most similar to your OS and
- start with that code.
-
- 4. Figure out how your kernel works.
-
- You need to figure out how a few things work in your kernel:
-
- 1. Loading/unloading kernel modules
-
- That varies quite a lot but it's probably easy to figure out
- if you have the source code for some other loadable module.
- Sometimes you can get the kernel to add your cdev, system
- call and file system automatically but usually you have to
- write code in your `entry-point' to add these to the
- appropriate tables.
-
- 2. Adding a new character device driver
-
- The kernel has a table of all known device drivers, ordered
- by major number. Some kernels have one for block devices and
- one for character devices and some have a common one. That
- entry usually consists of a number of function pointers that
- perform the operations (open, close, read, write, ...), and
- possible a name and some flags. It could look something like
- the following:
-
- struct cdevsw {
- int (*d_open)();
- int (*d_close)();
- ...
- };
-
- struct cdevsw cdevsw[];
-
- These are then usually stored in a table `cdevsw' indexed by
- the major device number. If you're really lucky there's a new
- way to get the kernel to add your `struct cdevsw' to the
- global table when loading the module or a function that does
- the addition for you. Otherwise there might be functions for
- adding/removing devices to the global table. If not, you'll
- have to fallback on looking for a free slot in the table and
- putting your struct cdevsw there. In some cases, this is not
- stored in a table but then there'll be a way of adding
- entries to the new data structure so you don't need to worry
- about it.
-
- 3. Adding a new system call
-
- This is quite similar to adding a new cdev but the table is
- usually called `sysent' instead.
-
- 4. Adding a new file system
-
- Once again, quite similar in principle. The names of the
- structures tend to vary quite a lot more.
-
- 5. Finding out how the VFS/Vnode switch works
-
- The structure vfsops contains function pointers for all of
- the file system operations. You need to figure out what
- operations you need to implement (usually at least mount,
- unmount, root, sync, and statfs).
-
- The operations that are performed on files are vnode
- operations (usually stored in a struct vnodeops), and you
- need to figure which of these you need and how they should
- work. Also, which is not as explicit, how vnodes are
- supposed to be allocated and freed and such.
-
-
- 5. Suggested plan of action
-
- 1. Start by writing a minimal hello-world module and make sure
- you can load and unload it properly.
-
- 2. Then add a device driver to the module which dummy functions
- and verify that works.
-
- 3. Try to fit the device driver functions in `nnpfs_dev.c' into the
- device driver.
-
- 4. Do a dummy module with a system call and verify that you can
- call it.
-
- 5. Start trying to add enough of the vfs/vnode operations from
- `nnpfs_vfsops.c' and `nnpfs_vnodeops.c' so that you can build it.
-
- 6. Debug it.
-
- 7. Send us patches
-
-
-
-
-File: arla.info, Node: Programming, Next: Oddities, Prev: Porting, Up: Top
-
-Programming
-***********
-
-This chapter is programming documentation of arla's internal parts.
-
-This is just to cover the ideas of the implemation, but documentation
-of the actual code, please see commends in the source code for that.
-
-* Menu:
-
-* Arla pioctl's:: Documentation of arla pioctl's
-* Disco with arla:: Disconnected mode
-* afsUUID:: afs UUID
-
-
-File: arla.info, Node: Arla pioctl's, Next: Disco with arla, Prev: Programming, Up: Programming
-
-Arla pioctl's
-*************
-
-This chaper documents arla pioctl's. Arla's pioct are in the `A' range
-of the pioctls. OpenAFS uses `O' and orignal Transarc uses `V'.
-
- `AIOC_STATISTICS'
-
- XXX max constants
-
- 1. `opcode STATISTICS_OPCODE_LIST'
-
- Get a specific host/partition entry.
-
- 2. `opcode STATISTICS_OPCODE_GETENTRY'
-
- Get a specific entry. The 5 values that are passed in are:
- opcode (STATISTICS_OPCODE_GETENTRY), ipv4-host-address,
- partition, type-of-data, slot in the histogram.
-
- Possible types of data are:
-
- 1. `STATISTICS_REQTYPE_FETCHSTATUS'
-
- 2. `STATISTICS_REQTYPE_FETCHDATA'
-
- 3. `STATISTICS_REQTYPE_BULKSTATUS'
-
- 4. `STATISTICS_REQTYPE_STOREDATA'
-
- 5. `STATISTICS_REQTYPE_STORESTATUS'
-
-
-
- `AIOC_PTSNAMETOID'
-
- Return a pts name to id for a cell, the cell is referenced by the
- file that is passed into the request, or by name.
-
- XXX document format
-
-
-
-File: arla.info, Node: Disco with arla, Next: afsUUID, Prev: Arla pioctl's, Up: Programming
-
-Disco with arla
-***************
-
-Disconnected operation of arla.
-
-The Log
-=======
-
-The binary log is written to a file. All entries are of variable size.
-A entry is never removed from the log *note Log entry optimization::.
-
-One log entry
--------------
-
-One log entry consists of a log header with magic cookie, opcode,
-checksum, and length. The entry is is always 4 byte aligned in the
-logfile. The checksum is a simple one, its just to verify that for
-data corruption hasn't occured and to make sure the entry is a valid
-one.
-
-Disconnected vs connected nodes
--------------------------------
-
-A FCacheNode is either a "disconnected node" or a "connected node". The
-later means that the node was created when arla was in connected mode
-and thus (potentially) exist on the file server.
-
-A disconnected node on the other hand was created when is disconnected
-operation. A disconnected node always have one or more entries in the
-log.
-
-Log entry offset
-----------------
-
-The offset of the entry, a unsigned 32 bit number, is called
-"disco_id". Its stored in the FCacheNode so it can be updated when
-there is a operation on this node. All nodes for a FCacheEntry are
-single linked list (from the newest log entry to the oldest), the
-optimizer uses this to modify all previous entries from a FCacheNode.
-
-A FCacheNode with disco_id equal to 0 is a connected node that there
-have been no disconnected operation made on.
-
-The first entry in the log is a nop entry to make sure not a log-offset
-that is for a "real" entry.
-
-The limit of number of entries in the log are 2^32 / the size of the
-largest entry since the offset is a 32 bit number.
-
-Log entry optimization
-======================
-
-To try to preserve bandwith when reinterating there are dependencies
-between entries. First we try to avoid storing data to the fileserver
-that was never meant to got there. For example a file that was created
-and then removed in disconnected mode, ie `DISCO_HEADER_NOP' is set in
-the flags field in the header.
-
-Removal operations
-------------------
-
-When a node is removed and the node is a disconnected node, the all
-previous entries are optizmied away by setting a flags in their entry
-headers. This make this entry/nodes be ignored by the reintergration
-code and never commited to the fileserver.
-
-Moveing a disconnected node
----------------------------
-
-If a disconnected node is moved, it will be created in the target
-directory instead of first being created and then moved.
-
-Storestatus and storedata
--------------------------
-
-Also, all entries for one node storestate/storestatus are compressed to
-one createnode (and if needed storedata).
-
-data storage
-============
-
-common data types
------------------
-
-fid - VenusFid equivalent storestatus - AFSStoreStatus equivalent
-
- 1. `nop'
-
- needs to be smaller or equal in size then the rest
-
- data storage: header flags fid
-
- 2. `storedata'
-
- (truncation is a storedata)
-
- data storage: header fid storestatus size
-
- 3. `storestatus'
-
- data storage: header fid storestatus
-
- 4. `createfile'
-
- data storage: header parentfid fid storestatus
- name[AFSNAMEMAX]
-
- 5. `createsymlink'
-
- data storage: header parentfid fid storestatus
- name[AFSNAMEMAX] targetname[AFSNAMEMAX]
-
- 6. `createlink'
-
- data storage: header parentfid fid storestatus
- name[AFSNAMEMAX] targetfid
-
- 7. `unlink'
-
- data storage: header parentfid fid /* dup info */
- name[AFSNAMEMAX]
-
- 8. `createdir'
-
- data storage: header parentfid fid /* dup info */
- storestatus name[AFSNAMEMAX]
-
- 9. `removedir'
-
- data storage: header parentfid fid /* dup info */
- name[AFSNAMEMAX]
-
-
-reintegration
-=============
-
-Cook-book
----------
-
- 1. make sure first entry in the log is a nop entry
-
- 2. if nop entry or `DISCO_HEADER_NOP' is set, continue to next
-
- 3. the parent fid is transformed to a connected fid (if needed) it
- this failes, we are unhappy and save this node for collision
- recovery
-
- 4. the fid is transformed to a connected fid (if needed) it this
- failes, we are unhappy and save this node for collision recovery
-
- 5. operation is performed
-
- 6. if there is change on a fid
-
- 1. update kernelhandle
-
- 2. update fcachehandle
-
- 3. update directory fid for this name (if needed)
-
- 4. transformed fids are stored in the transformation table
-
-
-
-
-File: arla.info, Node: afsUUID, Prev: Disco with arla, Up: Programming
-
-afsUUID
-*******
-
-`AFS' uses a `DCE UUID' (Microsoft GUID is a another version of a DCE
-UUID) is identify file servers and callback managers. The callback
-manager regenerate its `uuid' every time it restarts.
-
-The fileserver stores its `uuid' on disk and uses it to identify it
-self when registering its addresses with the VLDB-server.
-
-The `afsUUID' is special in some implementations since it uses the
-ip-address as the node identifier instead of the mac-address (IEEE OUI
-+ node address). Also the time in DCE is based on Unix epoch instead
-of DCE epoch. This will cause problems in about 287 years when the old
-generated afs UUID till start to collide with new genrated DCE UUIDs.
-Hopefully people have a solution to this problem then.
-
-
-File: arla.info, Node: Oddities, Next: Themis, Prev: Programming, Up: Top
-
-Oddities
-********
-
-AFS
-===
-
- * Directories - UnixModeBits are ignored when the vnode is a
- directory.
-
- * Errnos are sent over the network. Like Solaris ENOTEMPTY(93)
- doesn't even map to an error on sunos4 where ENOTEMPTY is 66.
-
- * Mountpoints have the mode-bits 0644, if they don't they are
- symlinks (and have the mode-bits 0755).
-
-
-Operating systems
-=================
-
- * On Irix 6.5 you have to build the dirents depending on what ABI
- of the binary you are currently running.
-
- * . and .. need to be first in directories, this is needed since some
- programs (like make) "knows" that the two first entries are . and
- .. and thus can be skiped.
-
- * Reclen (in struct dirent) shouldn't be too large. When its larger
- then the buffer used in opendir/readdir/closedir, you loose.
-
-
-
-File: arla.info, Node: Themis, Next: Arla timeline, Prev: Oddities, Up: Top
-
-Themis
-******
-
-`Themis' is a tool for keeping local file systems up-to-date with a
-file system description.
-
-All lines in the input file consist of white-space separated fields. For
-all directives except the `exclude' directive consist of one uppercase
-letter, and flags can be added directly after the directive letter.
-Flags can be specified in any order, and consist of uppercase letters.
-
-If owner, group or mode is not specified, implicit values are used.
-The default implicit values are `root' for owner, `wheel' for group,
-`755' for directory mode bits and `644' for file mode bits.
-
-These are the directives:
-
- * F<flags> <destination> <source> [<owner> <group>] [<mode>]
-
- Indicates the presence of a file.
-
- * D<flags> <destination> [<owner> <group>] [<mode>]
-
- Indicates the presence of a directory.
-
- * T<flags> <destination> <source> [<owner> <group>] [<mode>]
-
- Indicates the presence of a directory tree.
-
- * L<flags> <destination> <link data>
-
- Indicates the presence of a symbolic link.
-
- * N<flags> <destination>
-
- Indicates that themis should ignore that file/directory. If the
- file exists, it is left alone.
-
- * X<flags> <destination>
-
- Indicates that themis should remove the file/directory.
-
- * M<flags> <destination> [<owner> <group>] [<mode>]
-
- Modifies the flags, owner, group and mode of the (already
- specified) destination.
-
- * exclude <pattern>
-
- In a tree traversal, excludes all files that match <pattern>.
- Normal shell-style globbing can be used. Default exclution
- patterns that are included are: `.' and `..'. Also, when running
- with -macosx flag `._*' files are excluded.
-
- Common pattern to start to exclude are `*~', `RCS', `.OldFiles',
- `*,v', and `*.core'.
-
-
-These are the flags:
-
- * `A' The source path is absolute. When this flag is not specified,
- the destination path is appended to the source path.
-
- * `I' The file should not be overwritten if it exists.
-
- * `O' Rename existing files to .old, instead of overwriting them.
-
- * `Q' Exit with error level 4 to indicate that the file has changed.
- This can be used to check if a reboot is needed when certain
- critical files change.
-
- * `R' Only valid on directories (`D' and `T' directives). Specifies
- that the directory should be cleaned of any files that are not in
- the description file.
-
- * `P' Replaces the implicit owner, group and mode bits with the
- values from the source file.
-
-
-Normally, the input file should be pre-processed by mpp, m4, or some
-other pre-processor, to enable conditional processing and include files.
-
-
-File: arla.info, Node: Arla timeline, Next: Authors, Prev: Themis, Up: Top
-
-Arla timeline
-*************
-
-Arla have existed for quite some years.
-
-Development started in fall 1993 by Björn Grönvall <bg@nada.kth.se>
-(with an rxkad implantation), he had a working read-only implementation
-in winter 1994. Quick followers was Assar <assar@sics.se> (at that time
-<assar@pdc.kth.se>>) and Johan Danielsson <<joda@pdc.kth.se>>. The
-platform that was chosen was Sparc SunOS4 (the OS that NADA, KTH was
-using).
-
-Some work was being done by Patrik Stymne <patriks@e.kth.se> in porting
-arla to Ultrix, but this work was never finished.
-
-At this time there was no free rx, lwp or rxkad. A basic rx
-implementation was written, and the threading problem was solved by
-using pthreads.
-
-The Arla development started to slow down around 11 April 1995.
-
-In about Mar-Jun 1996 rx and lwp was released by Transarc, this was made
-possible by Jim Doyle <jrd@bu.edu>, and Derrick J. Brashear
-<shadow@dementia.org>.
-
-In September 1997, an rxkad implementation was written by Björn. At the
-same time, a need for an AFS client for OpenBSD rose at the Stacken,
-the local computer club at KTH. Other free OS:es, as NetBSD, FreeBSD
-and Linux(primarily sparc) were also in need of AFS clients.
-
-In TokKOM, a local communications system using LysKOM
-(<http://www.lysator.liu.se/lyskom/>), Assar suggested to some club
-members that it would be a nice thing to resume the arla development.
-
-Some people suggested that it would be less trouble having someone with
-access to the Transarc AFS source code port the code to the relevent
-platforms. Assar then ported nnpfs to FreeBSD 2.2.x in notime (over the
-night), just to show the high portability.
-
-People started to understand that arla was a concept that would work,
-and first out was Love Hörnqvist-Åstrand <lha@stacken.kth.se> to join.
-Development was primarily aimed at OpenBSD and NetBSD at the moment,
-and Arla lived for at least 2-3 weeks in /var/tmp on a host named
-yakko.stacken.kth.se.
-
-Magnus Ahltorp <map@stacken.kth.se> joined shortly thereafter, spending
-the rest of the year reading about the Linux VFS, and after a while,
-Artur Grabowski <art@stacken.kth.se> also started to work on arla,
-concentrating on OpenBSD kernel stuff.
-
-The first entry in ChangeLog is dated Fri Oct 24 17:20:40 1997. Around
-this time arla was given a CVS tree, to ease development. Now you could
-also mount the nnpfs-device and get the root-directory out of it.
-
-The Linux port was done in a few weeks in the beginning of 1998. Only
-the Linux 2.0 kernel was supported at this time.
-
-In April 1998 Assar hade a Arla paper presented at Freenix. Linux 2.1
-support was written also written around this time. This was a major
-work since there was a lot of stuff that had changed (namely the
-dcache).
-
-The first milko entry is dated Thu Oct 30 01:46:51 1997. Note that this
-milko in a sense "worked". You could get files out from it and store
-them.
-
-There was from this point a lot of work being done and quite a lot of
-studies was "wasted". We learned a lot, but not the stuff we were
-expected to.
-
-We added support for `dynroot' and `fake-mp' to prepare for Windows and
-Darwin/MacOSX support.
-
-In Mars 2000 preliminary support for MacOS X/Darwin 1.0 was merged in
-by Magnus and Assar.
-
-Around the same time there we hacked in support for Solaris 8 (beta2)
-There was also some work being done on Windows 2000 native driver at
-same time.
-
-In June 2000 there was a presentation on MADE2000 in Gothenburg, Sweden.
-
-In September 2000 MacOS X Beta was working.
-
-This just includes some milestones, for more information se Changelog.*
-and NEWS files in the distribution.
-
-
-File: arla.info, Node: Authors, Next: Acknowledgments, Prev: Arla timeline, Up: Top
-
-Authors
-*******
-
-Currently writing on arla are
-
-Assar Westerlund, Everything
-
-Magnus Ahltorp, Everything
-
-Artur Grabowski, BSD nnpfs, OpenBSD maintainer
-
-Love Hörnquist-Åstrand, Everything
-
-Robert Burgess, fs, Solaris nnpfs
-
-Johan Danielsson, OSF/1 nnpfs
-
-Hans Insulander, pts, OpenBSD maintainer
-
-Mattias Amnefelt, vos, milko
-
-Harald Barth, doc
-
-Tomas Olsson, milko
-
-Mikael Vidstedt (userland, some milko stuff)
-
-Jimmy Engelbercht (bos)
-Rhapsody nnpfs port was contributed by Alexandra Ellwood <lxs@MIT.EDU>
-Later, Rhapsody was renamed Darwin.
-
-Disconnected code is written by:
-
-WUWEI SHEN <wwshen@engin.umich.edu>
-
-Cheng Jin <chengjin@eecs.umich.edu>
-
-Paul Callaway <pcallawa@umich.edu>
-For contributors, see *Note Acknowledgments::.
-
-
-File: arla.info, Node: Acknowledgments, Next: Index, Prev: Authors, Up: Top
-
-Acknowledgments
-***************
-
-lwp and rx are copyrighted by IBM. We're grateful to Derrick J
-Brashear <shadow@dementia.org> and Jim Doyle <jrd@bu.edu> for making
-them available.
-
-the `rxkad' implementation was written by Björn Grönvall <bg@sics.se>
-and is also part of the kth-krb distribution.
-
-Some of the files in `libroken' come from Berkeley by the way of
-NetBSD/FreeBSD
-
-`editline' was written by Simmule Turner and Rich Salz.
-
-The code for gluing these together were written by ourselves.
-
-Bugfixes, documentation, encouragement, and code has been contributed
-by:
-
-Aaron M. Ucko <amu@MIT.EDU>
-Alec Wolman <wolman@cs.washington.edu>
-Alexandra Ellwood <lxs@MIT.EDU>
-Brad Keryan <keryan@andrew.cmu.edu>
-Constantine Sapuntzakis <csapuntz@openbsd.org>
-Dan Winship <danw@MIT.EDU>
-Derrick J Brashear <shadow@dementia.org>
-Harald Barth <haba@pdc.kth.se>
-Jim Doyle <jrd@bu.edu>
-John Davison <davisoja@clarkson.edu>
-John Hawkinson <jhawk@MIT.EDU>
-Karl Ramm <kcr@MIT.EDU>
-Mark Eichin <eichin@kitten.gen.ma.us>
-Per Boussard T/ED <Per.Boussard@era-t.ericsson.se>
-Dima Ruban <dima@best.net>
-Max <davros@cyclone.Stanford.EDU>
-Andrzej Filinski <andrzej@daimi.aau.dk>
-Chuck Lever <chuckl@netscape.com>
-WUWEI SHEN <wwshen@engin.umich.edu>
-Cheng Jin <chengjin@eecs.umich.edu>
-Paul Callaway <pcallawa@umich.edu>
-Brandon S. Allbery <allbery@ece.cmu.edu>
-Ken Raeburn <raeburn@raeburn.org>
-Jeffrey Hutzelman <jhutz+@cmu.edu>
-Hee-Seok Heo <hsheo@postech.ac.kr>
-Paul Ewing Jr. <ewing@ima.umn.edu>
-Niklas Hallqvist <niklas@appli.se>
-Marko Asplund <aspa@hip.fi>
-Chris Wing <wingc@engin.umich.edu>
-Simon Josefsson <jas@pdc.kth.se>
-Magnus Lindström <magnus.lindstrom@s3.kth.se>
-Greg Stark <gsstark@mit.edu>
-Matt <deberg@mit.edu>
-Björn Grönvall <bg@sics.se>
-Tino Schwarze <tino.schwarze@informatik.tu-chemnitz.de>
-David Sanderson <david@transarc.ibm.com>
-Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
-Michael Sperber <sperber@informatik.uni-tuebingen.de>
-Dr. Lex Wennmacher <wennmach@geo.Uni-Koeln.DE>
-Janne Johansson <jj@dynarc.se>
-Dr A V Le Blanc <LeBlanc@mcc.ac.uk>
-Dave Morrison <dave@bnl.gov>
-Jochen Saile <saile@sfs.nphil.uni-tuebingen.de>
-Chris Kuklewicz <chrisk@MIT.EDU>
-Nickolai Zeldovich <kolya@MIT.EDU>
-Adam Thornton <adam@sinenomine.net>
-Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
-Hidvegi <hzoli@austin.ibm.com>
-Todd T. Fries <todd@fries.net>
-Andrea Campi <andrea@webcom.it>
-William Uther <will+@cs.cmu.edu>
-
-If you have done something and are not mentioned here, please send mail
-to <arla-drinkers@stacken.kth.se>.
-
-If you are mentioned here and have not contributed, that's because we
-expect you to.
-
-
-File: arla.info, Node: Index, Prev: Acknowledgments, Up: Top
-
-Index
-*****
-
-* Menu:
-
-* adb: Kernel debuggers.
-* AFS Filespace: AFS infrastructure.
-* AFSDB: AFS infrastructure.
-* afslog: Kerberos tickets and AFS tokens.
-* afsUUID: afsUUID.
-* aklog: Kerberos tickets and AFS tokens.
-* ALG: NAT.
-* Archives: Introduction.
-* Arlad debugging: Arlad.
-* Backup server: AFS infrastructure.
-* Bos server: AFS infrastructure.
-* Bug reports: Introduction.
-* Buserver: AFS infrastructure.
-* Cell: AFS infrastructure.
-* CellServDB: AFS infrastructure.
-* Comments: Introduction.
-* DCE UUID: afsUUID.
-* Debugging: Debugging.
-* Debugging arlad: Arlad.
-* Debugging techniques: Debugging techniques.
-* Debugging NNPFS: nnpfs.
-* Disconected operation: Disco with arla.
-* DNS: AFS infrastructure.
-* Fileserver: AFS infrastructure.
-* Filespace: AFS infrastructure.
-* Fsserver: AFS infrastructure.
-* Gdb: Debugging LWP with GDB.
-* kalog: Kerberos tickets and AFS tokens.
-* kaserver: Integration with Kerberos.
-* kauth: Kerberos tickets and AFS tokens.
-* kerberosserver: Integration with Kerberos.
-* Kernel debugging: Kernel debuggers.
-* Kernel debuging on linux: Kernel debuggers.
-* KeyFile: Integration with Kerberos.
-* kinit: Kerberos tickets and AFS tokens.
-* klog: Kerberos tickets and AFS tokens.
-* Ksymoops: Kernel debuggers.
-* Linux kernel debugging: Kernel debuggers.
-* Live kernel: Kernel debuggers.
-* Mail archives: Introduction.
-* Mailing list: Introduction.
-* Masquerading: NAT.
-* NAT: NAT.
-* PAT: NAT.
-* pts: Relationship between pts uid and unix uid.
-* Ptserver: AFS infrastructure.
-* Salvage: AFS infrastructure.
-* Samba: Samba.
-* Themis: Themis.
-* TheseCells: Integration with Kerberos.
-* ThisCell: Integration with Kerberos.
-* Tickets: Kerberos tickets and AFS tokens.
-* Tokens: Kerberos tickets and AFS tokens.
-* Ubik: AFS infrastructure.
-* uid: Relationship between pts uid and unix uid.
-* Upserver: AFS infrastructure.
-* Vldbserver: AFS infrastructure.
-* Vlserver: AFS infrastructure.
-* Volser: AFS infrastructure.
-* Volumeserver: AFS infrastructure.
-* NNPFS debugging: nnpfs.
-
-
-
-Tag Table:
-Node: Top191
-Node: Introduction2110
-Node: AFS infrastructure5546
-Node: Organization of data15964
-Node: Requirements16460
-Node: Data organization18431
-Node: Callbacks20761
-Node: Volume management21446
-Node: Relationship between pts uid and unix uid22789
-Node: AFS and the real world23658
-Node: NAT24159
-Node: Samba26081
-Node: Integration with Kerberos26732
-Node: Kerberos tickets and AFS tokens28564
-Node: Parts of Arla34115
-Node: How arla works34567
-Node: The relation between Arlad and NNPFS35586
-Node: The life of a file36245
-Node: Tools and libs38767
-Node: Rx protocol39982
-Node: LWP40259
-Node: The files in arlad/40671
-Node: pioctl and kafs42796
-Node: Debugging44895
-Node: Arlad45371
-Node: Debugging LWP with GDB46614
-Node: nnpfs48369
-Node: nnpfs on linux49016
-Node: Debugging techniques49361
-Node: Kernel debuggers50293
-Node: Darwin/MacOS X54706
-Node: Porting55323
-Node: Porting user-space55934
-Node: Porting NNPFS57697
-Node: Programming62046
-Node: Arla pioctl's62481
-Node: Disco with arla63589
-Ref: Log entry optimization65373
-Node: afsUUID68205
-Node: Oddities69023
-Node: Themis69929
-Node: Arla timeline72653
-Node: Authors76325
-Node: Acknowledgments77145
-Node: Index81013
-
-End Tag Table
diff --git a/usr.sbin/afs/src/doc/arla.texi b/usr.sbin/afs/src/doc/arla.texi
deleted file mode 100644
index e5abf561d7b..00000000000
--- a/usr.sbin/afs/src/doc/arla.texi
+++ /dev/null
@@ -1,381 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-@c Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-
-@c %**start of header
-@c $arla: arla.texi,v 1.53 2003/02/01 17:16:03 lha Exp $
-@setfilename arla.info
-@settitle ARLA
-@iftex
-@afourpaper
-@end iftex
-@c some sensible characters, please?
-@tex
-\input latin1.tex
-@end tex
-@setchapternewpage on
-@syncodeindex pg cp
-@c %**end of header
-
-@ifinfo
-@dircategory Arla
-@direntry
-* Arla: (arla). Arla - A Free AFS Implementation
-@end direntry
-@end ifinfo
-
-@c title page
-@titlepage
-@iftex
-@image{arla-logo}
-@sp 5
-@end iftex
-
-@ifnottex
-@title Arla
-@end ifnottex
-
-@subtitle A Free AFS implementation from KTH
-@subtitle Edition 0.3, for version 0.36
-@subtitle 1999 - 2002
-
-@author Love Hörnquist-Åstrand
-@author Assar Westerlund
-@author Harald Barth
-@author last updated $arla: 2003/02/01 17:16:03 $
-
-@comment This text will show up in the output of texi2html
-@def@fnotsupported{THIS TEXT MAY CONTAIN GARBLED OUTPUT BECAUSE THIS VIEW FORMAT DOES NOT SUPPORT TEXI FUNCTIONS}
-
-@def@copynext{@vskip 20pt plus 1fil@penalty-1000}
-@def@copyrightstart{}
-@def@copyrightend{}
-
-@page
-@copyrightstart
-@example
-
-Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
-(Royal Institute of Technology, Stockholm, Sweden).
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-3. Neither the name of the Institute nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
-@end example
-
-@copynext
-@example
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-@end example
-
-@copynext
-@example
-
-Copyright (c) 1988, 1990, 1993
- The Regents of the University of California. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-3. All advertising materials mentioning features or use of this software
- must display the following acknowledgement:
- This product includes software developed by the University of
- California, Berkeley and its contributors.
-
-4. Neither the name of the University nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
-@end example
-@copynext
-@example
-
-Copyright 1992 Simmule Turner and Rich Salz. All rights reserved.
-
-This software is not subject to any license of the American Telephone
-and Telegraph Company or of the Regents of the University of California.
-
-Permission is granted to anyone to use this software for any purpose on
-any computer system, and to alter it and redistribute it freely, subject
-to the following restrictions:
-
-1. The authors are not responsible for the consequences of use of this
- software, no matter how awful, even if they arise from flaws in it.
-
-2. The origin of this software must not be misrepresented, either by
- explicit claim or by omission. Since few users ever read sources,
- credits must appear in the documentation.
-
-3. Altered versions must be plainly marked as such, and must not be
- misrepresented as being the original software. Since few users
- ever read sources, credits must appear in the documentation.
-
-4. This notice may not be removed or altered.
-
-
-@end example
-@copynext
-@example
-
-COPYRIGHT (C) 1998
-THE REGENTS OF THE UNIVERSITY OF MICHIGAN
-ALL RIGHTS RESERVED
-
-PERMISSION IS GRANTED TO USE, COPY, CREATE DERIVATIVE WORKS
-AND REDISTRIBUTE THIS SOFTWARE AND SUCH DERIVATIVE WORKS
-FOR ANY PURPOSE, SO LONG AS THE NAME OF THE UNIVERSITY OF
-MICHIGAN IS NOT USED IN ANY ADVERTISING OR PUBLICITY
-PERTAINING TO THE USE OR DISTRIBUTION OF THIS SOFTWARE
-WITHOUT SPECIFIC, WRITTEN PRIOR AUTHORIZATION. IF THE
-ABOVE COPYRIGHT NOTICE OR ANY OTHER IDENTIFICATION OF THE
-UNIVERSITY OF MICHIGAN IS INCLUDED IN ANY COPY OF ANY
-PORTION OF THIS SOFTWARE, THEN THE DISCLAIMER BELOW MUST
-ALSO BE INCLUDED.
-
-THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION
-FROM THE UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY
-PURPOSE, AND WITHOUT WARRANTY BY THE UNIVERSITY OF
-MICHIGAN OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
-WITHOUT LIMITATION THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
-REGENTS OF THE UNIVERSITY OF MICHIGAN SHALL NOT BE LIABLE
-FOR ANY DAMAGES, INCLUDING SPECIAL, INDIRECT, INCIDENTAL, OR
-CONSEQUENTIAL DAMAGES, WITH RESPECT TO ANY CLAIM ARISING
-OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE, EVEN
-IF IT HAS BEEN OR IS HEREAFTER ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-@end example
-@copynext
-@example
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-@end example
-@copyrightend
-@end titlepage
-
-@c Less filling! Tastes great!
-@iftex
-@parindent=0pt
-@global@parskip 6pt plus 1pt
-@global@chapheadingskip = 15pt plus 4pt minus 2pt
-@global@secheadingskip = 12pt plus 3pt minus 2pt
-@global@subsecheadingskip = 9pt plus 2pt minus 2pt
-@end iftex
-@ifinfo
-@paragraphindent 0
-@end ifinfo
-
-@ifinfo
-@node Top, , (dir), (dir)
-@comment node-name, next, previous, up
-@top Arla
-
-Arla is a free AFS implementation from KTH.
-
-Please send comments (and fixes) on this manual and the arla programs to
-@email{arla-drinkers@@stacken.kth.se}.
-
-@end ifinfo
-
-@menu
-* Introduction:: Introduction to Arla.
-* AFS infrastructure:: A description of the afs infrastructure.
-* Organization of data:: How different data is organized in AFS.
-* AFS and the real world:: Common problems and their solutions.
-* Parts of Arla:: Description of different parts of arla.
-* Debugging:: How to debug arla when its not working.
-* Porting:: That you need to know to port arla.
-* Programming:: Programming documentation of arla.
-* Oddities:: Strange things that did happen to us.
-* Arla timeline:: Short timeline of arla.
-* Authors:: The authors of arla.
-* Acknowledgments:: People that have helped us.
-* Index:: Index.
-@c * Building and Installing::
-@c * Unreleased parts of the arla suite::
-
-@detailmenu
-
- --- The Detailed Node Listing ---
-
-* Introduction::
-* AFS infrastructure::
-
-How data and servers are organized in AFS.
-
-* Requirements::
-* Data organization::
-* Callbacks::
-* Volume management::
-* Relationship between pts uid and unix uid::
-
-How to cope with reality
-
-* NAT::
-* Samba::
-* Integration with Kerberos::
-* Kerberos tickets and AFS tokens::
-
-The parts of arla
-
-* How arla works::
-* The relation between Arlad and NNPFS::
-* The life of a file::
-* Tools and libs::
-* The files in arlad/::
-* pioctl and kafs::
-
-How to debug arla when its not working
-
-* Arlad::
-* Debugging LWP with GDB::
-* nnpfs::
-* nnpfs on linux::
-* Debugging techniques::
-* Kernel debuggers::
-* Darwin/MacOS X::
-
-Porting arla
-
-* Porting::
-* Porting user-space::
-* Porting NNPFS::
-
-Programming
-
-* Programming::
-* Disco with arla::
-* afsUUID::
-@c * NNPFS interface::
-
-Odd stuff you find when looking around
-
-* Oddities::
-
-Miscellaneous
-
-* Arla timeline::
-* Authors::
-* Acknowledgments::
-
-* Index::
-
-@end detailmenu
-@end menu
-
-@contents
-
-@include intro.texi
-@c @include install.texi
-@include afs-basics.texi
-@include storage.texi
-@include real-world.texi
-@include partsofarla.texi
-@include debugging.texi
-@include porting.texi
-@include prog.texi
-@include oddities.texi
-@include timeline.texi
-@include authors.texi
-@include ack.texi
-@include index.texi
-
-@bye
diff --git a/usr.sbin/afs/src/doc/authors.texi b/usr.sbin/afs/src/doc/authors.texi
deleted file mode 100644
index 7762dcf7d8d..00000000000
--- a/usr.sbin/afs/src/doc/authors.texi
+++ /dev/null
@@ -1,40 +0,0 @@
-@c Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-
-@c $arla: authors.texi,v 1.15 2002/09/07 10:43:49 lha Exp $
-
-@node Authors, Acknowledgments, Arla timeline, Top
-@comment node-name, next, previous, up
-@chapter Authors
-
-Currently writing on arla are
-
-@table @asis
-@item Assar Westerlund, Everything
-@item Magnus Ahltorp, Everything
-@item Artur Grabowski, BSD nnpfs, OpenBSD maintainer
-@item Love Hörnquist-Åstrand, Everything
-@item Robert Burgess, fs, Solaris nnpfs
-@item Johan Danielsson, OSF/1 nnpfs
-@item Hans Insulander, pts, OpenBSD maintainer
-@item Mattias Amnefelt, vos, milko
-@item Harald Barth, doc
-@item Tomas Olsson, milko
-@item Mikael Vidstedt (userland, some milko stuff)
-@item Jimmy Engelbercht (bos)
-@end table
-
-Rhapsody nnpfs port was contributed by Alexandra Ellwood <lxs@@MIT.EDU>
-Later, Rhapsody was renamed Darwin.
-
-Disconnected code is written by:
-
-@table @asis
-@item WUWEI SHEN <wwshen@@engin.umich.edu>
-@item Cheng Jin <chengjin@@eecs.umich.edu>
-@item Paul Callaway <pcallawa@@umich.edu>
-@end table
-
-For contributors, see @ref{Acknowledgments}.
-
diff --git a/usr.sbin/afs/src/doc/caching-in-blocks b/usr.sbin/afs/src/doc/caching-in-blocks
deleted file mode 100644
index a4ead092b74..00000000000
--- a/usr.sbin/afs/src/doc/caching-in-blocks
+++ /dev/null
@@ -1,107 +0,0 @@
-Caching in blocks
-=================
-
-$arla: caching-in-blocks,v 1.3 2000/12/10 23:08:29 lha Exp $
-
-Why blockcache
-
- - There is just one reson that one should have blockcache.
- You want to edit filer larger then you blockcache. Example below
- is with a cache-size of 100M.
-
- : lha@nutcracker ; less kdc.3log
- kdc.3log: No space left on device
- : lha@nutcracker ; ls -l 'kdc.3log'
- -rw-r--r-- 1 314 daemon 179922925 Sep 18 00:05 kdc.3log
-
-
- - Speed is not really an issue since most files are accessed for
- head of the file to tail of the file. Then you can use
- incremental opening of the file. This would be less gross change.
-
-Prior work
- adaptive buffercache, usenix99
- - this will apply to both reading and writing
-
-Double buffering problem
-========================
-
-One way that might work is that files that are accessed read-only are
-done on the underlaying file (and in that vnode's page-cache).
-
-But as files that are write-ed too are dubblebuffered. If the file has
-been accessed before the node's and the underlaying node's all pages
-are flushed to make sure we are double buffering.
-
-Incremental open
-================
-
-This still doesn't solve the problem with large files, it only solve
-the problem that its takes long time to read the first few bytes of a
-large file.
-
-* Opening a file
-
- wait until there is a token that you want or wakeup returns an error
-
- >open
- <installdata, installs token and fhandle
- <wakeup open
-
- failure case
-
- >open
- <wakeup with errno
-
-* Reading data (read and getpage)
- check for readable data for this user
-retry:
- check if existing offset is more then wanted offset,
- do the read from the cache file, return
- check if wanted-offset over end of file, fail
- >getdata(wanted-offset)
- <installattr(filesize,existing-offset)
- goto retry
-
-* Writing data (write and putpage)
-
- XXX rewrite this with respect to
-
- check for writeable data for this user
-retry:
- check if existing offset is more then writing offset,
- do the write to the cache file, return
- check if beginning-offset over end of file, fail
- >getdata(beginning-offset)
- <installattr(filesize,beginning-offset)
- goto retry
-
-* When closing
-
- if data dirty, write back to the fileserver.
-
-Caching in blocks
-=================
-
-Writing
- - what triggers a write
- + shortage of blocks
- interesting case, necessary to detect random writing ?
- + fsync/close
- just flush all dirty blocks, or sync whole file
- just flush what blocks are dirty to userlevel
- one rpc-call with bitmask ?
- - how to cluster writing (how to detect)
- + with shortage of block in the hard one
-
-Reading
- - how to read-ahead (how far, how to detect)
- + prior work
-
-What to cache (in general terms)
-=============
-
- - how long time does it take to open a fhandle_t (fhtovp) ?
- benchmark ? (fhopen() abort 5 times faster then open())
- - how many no vnode can the layer hold up (related to above)
-
diff --git a/usr.sbin/afs/src/doc/debugging.texi b/usr.sbin/afs/src/doc/debugging.texi
deleted file mode 100644
index 0dd4a3d9ef6..00000000000
--- a/usr.sbin/afs/src/doc/debugging.texi
+++ /dev/null
@@ -1,337 +0,0 @@
-@c Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-
-@c $arla: debugging.texi,v 1.28 2002/11/29 19:53:00 tol Exp $
-
-@node Debugging, Arlad, Parts of Arla, Top
-@chapter Debugging
-
-@cindex Debugging
-
-This chapter of the manual includes tips that are useful when debugging
-arla.
-
-Arla and nnpfs contains logging facilities that is quite useful when
-debugging when something goes wrong. This and some kernel debugging tips
-are described.
-
-@menu
-* Arlad::
-* Debugging LWP with GDB::
-* nnpfs::
-* nnpfs on linux::
-* Debugging techniques::
-* Kernel debuggers::
-* Darwin/MacOS X::
-@end menu
-
-@node Arlad, Debugging LWP with GDB, Debugging, Debugging
-@comment node-name, next, previous, up
-@section Arlad
-
-@cindex Arlad debugging
-@cindex Debugging arlad
-
-If arlad is run without any arguments arlad will fork(2) and log to
-syslog(3). To disable forking use the --no-fork (-n) switch. In the
-current state of the code, arlad is allways to be started with
-the recover (-z) switch. This will invalidate your cache at startup.
-This restriction may be dropped in the future.
-
-To enable more debuggning run arla with the switch --debug=module1,module2,...
-One useful combination is
-@example
- --debug=all,-cleaner
-@end example
-The cleaner output is usully not that intresting and can be ignored.
-
-A convenient way to debug arlad is to start it inside gdb.
-@example
-datan:~# gdb /usr/arla/libexec/arlad
-(gdb) run -z -n
-@end example
-This gives you the opportunity to examine a crashed arlad.
-@example
-(gdb) bt
-@end example
-The arla team appreciates cut and paste information from
-the beginning to the end of the bt output from such a gdb run.
-
-To set the debugging with a running arlad use @code{fs arladeb} as root.
-
-@example
-datan:~# fs arladeb
-arladebug is: none
-datan:~# fs arladeb almost-all
-datan:~#
-@end example
-
-By default, arlad logs through syslog if running as a daemon and to
-stderr when running in the foreground (with @kbd{--no-fork}).
-
-@node Debugging LWP with GDB, nnpfs, Arlad, Debugging
-@comment node-name, next, previous, up
-@section Debugging LWP with GDB
-
-@cindex Gdb
-
-For easy tracing of threads we have patch
-(@url{http://www.stacken.kth.se/projekt/arla/gdb-4.18-backfrom.diff})
-for gdb 4.18 (a new command) and a gdb sequence (think script).
-
-The sequence only works for i386, but its just matter of choosing
-different offset in topstack to find $fp and $pc in the lwp_ps_internal
-part of the sequence.
-
-You should copy the @file{.gdbinit} (that you can find in the arlad
-directory in the source-code) to your home-directory, the directory from
-where you startat the patched gdb or use flag -x to gdb.
-
-Your debugging session might look like this:
-
-@example
-(gdb) lwp_ps
-Runnable[0]
- name: IO MANAGER
- eventlist:
- fp: 0x806aac4
- pc: 0x806aac4
- name: producer
- eventlist: 8048b00
- fp: 0x8083b40
- pc: 0x8083b40
-Runnable[1]
-[...]
-(gdb) help backfrom
-Print backtrace of FRAMEPOINTER and PROGRAMCOUNTER.
-
-(gdb) backfrom 0x8083b40 0x8083b40
-#0 0x8083b40 in ?? ()
-#1 0x8049e2f in LWP_MwaitProcess (wcount=1, evlist=0x8083b70)
- at /afs/e.kth.se/home/staff/lha/src/cvs/arla-foo/lwp/lwp.c:567
-#2 0x8049eaf in LWP_WaitProcess (event=0x8048b00)
- at /afs/e.kth.se/home/staff/lha/src/cvs/arla-foo/lwp/lwp.c:585
-#3 0x8048b12 in Producer (foo=0x0)
- at /afs/e.kth.se/home/staff/lha/src/cvs/arla-foo/lwp/testlwp.c:76
-#4 0x804a00c in Create_Process_Part2 ()
- at /afs/e.kth.se/home/staff/lha/src/cvs/arla-foo/lwp/lwp.c:629
-#5 0xfffefdfc in ?? ()
-#6 0x8051980 in ?? ()
-@end example
-
-There also the possibility to run arla with pthreads (run configure with
---with-pthreads).
-
-@node nnpfs, nnpfs on linux, Debugging LWP with GDB, Debugging
-@comment node-name, next, previous, up
-@section nnpfs
-
-@cindex Debugging NNPFS
-@cindex NNPFS debugging
-
-NNPFS debugging does almost look the same on all platforms. They
-all share same debugging flags, but not all are enabled on all
-platforms.
-
-Change the debugging with the @kbd{fs nnpfsdebug} command.
-
-@example
-datan:~# fs nnpfsdebug
-nnpfsdebug is: none
-datan:~# fs nnpfsdebug almost-all
-datan:~#
-@end example
-
-If it crashes before you have an opportunity to set the debug level, you
-will have to edit @file{nnpfs/@var{your-os}/nnpfs_deb.c} and recompile.
-
-The logging of nnpfs ends up in your syslog. Syslog usully logs to /var/log
-or /var/adm (look in /etc/syslog.conf).
-
-@node nnpfs on linux, Debugging techniques, nnpfs, Debugging
-@comment node-name, next, previous, up
-@section nnpfs on linux
-
-There is a problem with klogd, it's too slow. Cat the @file{/proc/kmsg}
-file instead. Remember to kill klogd, since the reader will delete the
-text from the ring-bufer, and you will only get some of the message in
-your cat.
-
-
-@node Debugging techniques, Kernel debuggers, nnpfs on linux, Debugging
-@comment node-name, next, previous, up
-@section Debugging techniques
-
-@cindex Debugging techniques
-
-Kernel debugging can sometimes force you to exercise your
-imagination. We have learned some different techniques that can be
-useful.
-
-@subsection Signals
-
-On operatingsystems with kernel debugger that you can use probably find
-where in the kernel a user-program live, and thus deadlocks or trigger
-the bad event, that later will result in a bug. This is a problem, how
-do you some a process to find where it did the intresting thing when you
-can't set a kernel breakpoint ?
-
-One way to be notified is to send a signal from the kernel module
-(psignal() on a BSD and force_sig() on linux). SIGABRT() is quite useful
-if you want to force a coredump. If you want to continue debugging,
-use SIGSTOP.
-
-@subsection Recreateable testcases
-
-Make sure bugs don't get reintroduced.
-
-@node Kernel debuggers, Darwin/MacOS X, Debugging techniques, Debugging
-@comment node-name, next, previous, up
-@section Kernel debuggers
-
-@cindex Kernel debugging
-
-Kernel debuggers are the most useful tool when you are trying to figure
-out what's wrong with nnpfs. Unfortunately they also seem to have their
-own life and do not always behave as expected.
-
-@subsection Using GDB
-
-Kernel debugging on NetBSD, OpenBSD, FreeBSD and Darwin are almost the
-same. You get the idea from the NetBSD example below:
-
-@example
- (gdb) file netbsd.N
- (gdb) target kcore netbsd.N.core
- (gdb) symbol-file /sys/arch/i386/compile/NUTCRACKER/netbsd.gdb
-@end example
-
-This example loads the kernel symbols into gdb. But this doesn't show
-the nnpfs symbols, and that makes your life harder.
-
-@subsection Getting all symbols loaded at the same time
-
-If you want to use the symbols of nnpfs, there is a gdb command called
-@samp{add-symbol-file} that is useful. The symbol file is obtained by
-loading the kernel module nnpfs with @samp{kmodload -o /tmp/nnpfs-sym}
-(Darwin) or @samp{modload} (NetBSD and OpenBSD). FreeBSD has a linker
-in the kernel that does the linking instead of relying on @samp{ld}. The
-symbol address where the module is loaded get be gotten from
-@samp{modstat}, @samp{kldstat} or @samp{kmodstat} (it's in the
-@code{area} field).
-
-If you forgot the to run modstat/kldstat/kmodstat, you can extract the
-information from the kernel. In Darwin you look at the variable kmod
-(you might have to case it to a (kmod_info_t *). We have seen gdb lose
-the debugging info). kmod is the start of a linked list. Other BSDs have
-some variant of this.
-
-You should also source the commands in /sys/gdbscripts (NetBSD), or
-System/xnu/osfmk/.gdbinit (Darwin) to get commands like ps inside gdb.
-
-@example
- datan:~# modstat Type Id Off Loadaddr Size Info Rev Module
- Name DEV 0 29 ce37f000 002c ce388fc0 1 nnpfs_mod [...]
- [...]
- (gdb) add-symbol-table nnpfs.sym ce37f000
-@end example
-
-@subsection Debugging processes, examine their stack, etc
-
-One of diffrencies between the BSD's are the @code{proc}, a command that
-enables you do to a backtrace on all processes. On FreeBSD you give the
-@code{proc} command a @samp{pid}, but on NetBSD and OpenBSD you give a
-pointer to a @code{struct proc}.
-
-After you have ran @code{proc} to set the current process, you can
-examine the backtrace with the regular @code{backtrace} command.
-
-Darwin does't have a @code{proc} command. Instead you are supposed to
-use gdb sequences (System/xnu/osfmk/.gdbinit) to print process stacks,
-threads, activations, and other information.
-
-@subsection Debugging Linux
-
-@cindex Kernel debuging on linux
-@cindex Linux kernel debugging
-
-You can't get a crashdump for linux with patching the kernel. There are
-two projects have support for this. Mission Critical Linux
-@url{http://www.missioncritiallinux.com} and SGI
-@url{http://oss.sgi.com/}.
-
-Remember save the context of /proc/ksyms before you crash, since this is
-needed to figure out where the nnpfs symbols are located in the kernel.
-
-But you can still use the debugger (or objdump) to figure out where in
-the binary that you crashed.
-
-@cindex Ksymoops
-
-@code{ksymoops} can be used to create a backtrace.
-
-@subsection Using adb
-
-@cindex adb
-
-Adb is not a symbolic debugger, this means that you have to read the
-disassembled object-code to figure out where it made the wrong turn and
-died. You might be able to use GNU objdump to list the assembler and
-source-code intertwined (@samp{objdump -S -d mod_nnpfs.o}). Remember that
-GNU binutils for sparc-v9 isn't that good yet.
-
-You can find the script that use use for the adb command @samp{$<} in
-@file{/usr/lib/adb} and @file{/usr/platform/PLATFORNAME/adb}.
-
-@subsection Debugging a live kernel
-
-@cindex Live kernel
-
-An important thing to know is that you can debug a live kernel too, this
-can be useful to find dead-locks. To attach to a kernel you use a
-command like this on a BSD system (that is using gdb):
-
-@example
- (gdb) file /netbsd
- (gdb) target kcore /dev/mem
- (gdb) symbol-file /sys/arch/i386/compile/NUTCRACKER/netbsd.gdb
-@end example
-
-And on Solaris:
-
-@example
- # adb -k /dev/ksyms /dev/mem
-@end example
-
-
-@subsection Other useful debugging tools
-
-Most diagnosics tools like ps, dmesg, and pstat on BSD systems used to
-look in kernel memory to extract information (and thus earned the name
-kmem-groovlers). On some systems they have been replaced with other
-method of getting their data, like /proc and sysctl.
-
-But due to their heritage they can still be used in with a kernel and
-coredump to extract information on some system.
-
-@node Darwin/MacOS X, Porting, Kernel debuggers, Debugging
-@comment node-name, next, previous, up
-@section Darwin/MacOS X
-
-You'll need two computers to debug arlad/nnpfs on darwin since the common
-way to debug is to use a remote kernel-debugger over IP/UDP.
-
-First you need to publish the arp-address of the computer that you are
-going to crash.
-
-We have not found any kernel symbols in MacOSX Public Beta, so you
-should probably build your own kernel. Use Darwin xnu kernel source
-with cvs-tag: Apple-103-0-1 (not xnu-103).
-
-@example
-gdb nnpfs.out
-target remote-kdp
-add-symbol-table ...
-attach <host>
-@end example
diff --git a/usr.sbin/afs/src/doc/index.texi b/usr.sbin/afs/src/doc/index.texi
deleted file mode 100644
index 439994da4d6..00000000000
--- a/usr.sbin/afs/src/doc/index.texi
+++ /dev/null
@@ -1,11 +0,0 @@
-@c Copyright (c) 2000 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-
-@c $arla: index.texi,v 1.1 2000/11/25 11:39:24 lha Exp $
-
-@node Index, , Acknowledgments, Top
-@comment node-name, next, previous, up
-@appendix Index
-
-@printindex cp
diff --git a/usr.sbin/afs/src/doc/intro.texi b/usr.sbin/afs/src/doc/intro.texi
deleted file mode 100644
index 8cecde5d907..00000000000
--- a/usr.sbin/afs/src/doc/intro.texi
+++ /dev/null
@@ -1,110 +0,0 @@
-@c Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-
-@c $arla: intro.texi,v 1.16 2002/05/26 14:48:26 lha Exp $
-
-@node Introduction, AFS infrastructure, Top, Top
-@comment node-name, next, previous, up
-@chapter Introduction
-
-@quotation
-@strong{Caution:} Parts of this package are not yet stable software.
-If something doesn't work, it's probably because it doesn't. If you
-don't have backup of your data, take backup.
-@end quotation
-
-@section What is Arla?
-
-Arla is a free AFS implementation. Some of the goals are:
-
-@itemize @bullet
-@item
-to have an implementation that is free and can be used for adding and
-playing with cool stuff, like support for disconnected-mode. Implement
-features you can't get from commercial AFS.
-@item
-to provide an alternative to Transarc's and OpenAFS AFS-clients and
-server implementations.
-@item
-to add support for platfroms that don't have AFS support from Transarc
-or OpenAFS today.
-@end itemize
-
-This release is known to work on the following platforms: NetBSD,
-OpenBSD, FreeBSD, Linux, Solaris, Darwin/MacOS X.
-
-Earlier releases are known to work on current or earlier versions of the
-following platforms: SunOS, AIX, IRIX, Digital UNIX. Some fixes might
-be necessary to make Arla work.
-
-There is or has been done work to support the following platforms: HPUX,
-Fujitsu UXP/V. Some development is necessary to make Arla work.
-
-There is work going on to support the following platform: Windows
-NT/2000. Contributions are very welcome.
-
-@section Status
-
-Arla has the following features (quality varies between
-stable and not implemented):
-
-@itemize @bullet
-@item
-a rxgen implementation called ydr (stable).
-@item
-a cache manager replacing Transarc's afsd. The cache managers
-quality depends on platform: *BSD, Linux i386 and Solaris are stable,
-others platforms are not as tested ane therefore not as stable.
-@item
-partly implemented fs, vos, pts commands. Commands typically issued
-by users are stable, commands issued by administrators may return
-unmotivated errors or are not implemented yet.
-@item
-an implementaion of rxkad written outside USA without any export
-restrictions (stable).
-@item
-a server implementation called milko, containing file server,
-volume server and protection server. The file server has an
-API to the storage backend(s). Milko is still unstable and
-not fit for production yet.
-@end itemize
-
-@section Bug reports
-
-@cindex Bug reports
-@cindex Comments
-
-If you find bugs in this software, make sure it is a genuine bug and not
-just a part of the code that isn't implemented.
-
-Bug reports should be sent to @email{arla-drinkers@@stacken.kth.se}. Please
-include information on what machine and operating system (including
-version) you are running, what you are trying to do, what happens, what
-you think should have happened, an example for us to repeat, the output
-you get when trying the example, and a patch for the problem if you have
-one. Please make any patches with @code{diff -u} or @code{diff -c}.
-
-Suggestions, comments and other non bug reports are also welcome.
-
-@section Mailing list
-
-@cindex Mailing list
-@cindex Mail archives
-@cindex Archives
-
-There are two mailing lists with talk about
-Arla. @email{arla-announce@@stacken.kth.se} is a low-volume announcement
-list, while @email{arla-drinkers@@stacken.kth.se} is for general
-discussion.
-
-There is also commit list
-@email{arla-commit@@stacken.kth.se}. Send a message to
-@email{LIST-request@@stacken.kth.se} to subscribe.
-
-The list are achived on
-@url{http://www.stacken.kth.se/lists/}.
-
-Please note that the mailinglists have a policy of subscriber only
-posting. So if you want to mail a message to the list, subscribe to it
-first, otherwise it wont be posted on the list.
diff --git a/usr.sbin/afs/src/doc/latin1.tex b/usr.sbin/afs/src/doc/latin1.tex
deleted file mode 100644
index e683dd271dc..00000000000
--- a/usr.sbin/afs/src/doc/latin1.tex
+++ /dev/null
@@ -1,95 +0,0 @@
-% ISO Latin 1 (ISO 8859/1) encoding for Computer Modern fonts.
-% Jan Michael Rynning <jmr@nada.kth.se> 1990-10-12
-\def\inmathmode#1{\relax\ifmmode#1\else$#1$\fi}
-\global\catcode`\^^a0=\active \global\let^^a0=~ % no-break space
-\global\catcode`\^^a1=\active \global\def^^a1{!`} % inverted exclamation mark
-\global\catcode`\^^a2=\active \global\def^^a2{{\rm\rlap/c}} % cent sign
-\global\catcode`\^^a3=\active \global\def^^a3{{\it\$}} % pound sign
-% currency sign, yen sign, broken bar
-\global\catcode`\^^a7=\active \global\let^^a7=\S % section sign
-\global\catcode`\^^a8=\active \global\def^^a8{\"{}} % diaeresis
-\global\catcode`\^^a9=\active \global\let^^a9=\copyright % copyright sign
-% feminine ordinal indicator, left angle quotation mark
-\global\catcode`\^^ac=\active \global\def^^ac{\inmathmode\neg}% not sign
-\global\catcode`\^^ad=\active \global\let^^ad=\- % soft hyphen
-% registered trade mark sign
-\global\catcode`\^^af=\active \global\def^^af{\={}} % macron
-% ...
-\global\catcode`\^^b1=\active \global\def^^b1{\inmathmode\pm} % plus minus
-\global\catcode`\^^b2=\active \global\def^^b2{\inmathmode{{^2}}}
-\global\catcode`\^^b3=\active \global\def^^b3{\inmathmode{{^3}}}
-\global\catcode`\^^b4=\active \global\def^^b4{\'{}} % acute accent
-\global\catcode`\^^b5=\active \global\def^^b5{\inmathmode\mu} % mu
-\global\catcode`\^^b6=\active \global\let^^b6=\P % pilcroy
-\global\catcode`\^^b7=\active \global\def^^b7{\inmathmode{{\cdot}}}
-\global\catcode`\^^b8=\active \global\def^^b8{\c{}} % cedilla
-\global\catcode`\^^b9=\active \global\def^^b9{\inmathmode{{^1}}}
-% ...
-\global\catcode`\^^bc=\active \global\def^^bc{\inmathmode{{1\over4}}}
-\global\catcode`\^^bd=\active \global\def^^bd{\inmathmode{{1\over2}}}
-\global\catcode`\^^be=\active \global\def^^be{\inmathmode{{3\over4}}}
-\global\catcode`\^^bf=\active \global\def^^bf{?`} % inverted question mark
-\global\catcode`\^^c0=\active \global\def^^c0{\`A}
-\global\catcode`\^^c1=\active \global\def^^c1{\'A}
-\global\catcode`\^^c2=\active \global\def^^c2{\^A}
-\global\catcode`\^^c3=\active \global\def^^c3{\~A}
-\global\catcode`\^^c4=\active \global\def^^c4{\"A} % capital a with diaeresis
-\global\catcode`\^^c5=\active \global\let^^c5=\AA % capital a with ring above
-\global\catcode`\^^c6=\active \global\let^^c6=\AE
-\global\catcode`\^^c7=\active \global\def^^c7{\c C}
-\global\catcode`\^^c8=\active \global\def^^c8{\`E}
-\global\catcode`\^^c9=\active \global\def^^c9{\'E}
-\global\catcode`\^^ca=\active \global\def^^ca{\^E}
-\global\catcode`\^^cb=\active \global\def^^cb{\"E}
-\global\catcode`\^^cc=\active \global\def^^cc{\`I}
-\global\catcode`\^^cd=\active \global\def^^cd{\'I}
-\global\catcode`\^^ce=\active \global\def^^ce{\^I}
-\global\catcode`\^^cf=\active \global\def^^cf{\"I}
-% capital eth
-\global\catcode`\^^d1=\active \global\def^^d1{\~N}
-\global\catcode`\^^d2=\active \global\def^^d2{\`O}
-\global\catcode`\^^d3=\active \global\def^^d3{\'O}
-\global\catcode`\^^d4=\active \global\def^^d4{\^O}
-\global\catcode`\^^d5=\active \global\def^^d5{\~O}
-\global\catcode`\^^d6=\active \global\def^^d6{\"O} % capital o with diaeresis
-\global\catcode`\^^d7=\active \global\def^^d7{\inmathmode\times}% multiplication sign
-\global\catcode`\^^d8=\active \global\let^^d8=\O
-\global\catcode`\^^d9=\active \global\def^^d9{\`U}
-\global\catcode`\^^da=\active \global\def^^da{\'U}
-\global\catcode`\^^db=\active \global\def^^db{\^U}
-\global\catcode`\^^dc=\active \global\def^^dc{\"U}
-\global\catcode`\^^dd=\active \global\def^^dd{\'Y}
-% capital thorn
-\global\catcode`\^^df=\active \global\def^^df{\ss}
-\global\catcode`\^^e0=\active \global\def^^e0{\`a}
-\global\catcode`\^^e1=\active \global\def^^e1{\'a}
-\global\catcode`\^^e2=\active \global\def^^e2{\^a}
-\global\catcode`\^^e3=\active \global\def^^e3{\~a}
-\global\catcode`\^^e4=\active \global\def^^e4{\"a} % small a with diaeresis
-\global\catcode`\^^e5=\active \global\let^^e5=\aa % small a with ring above
-\global\catcode`\^^e6=\active \global\let^^e6=\ae
-\global\catcode`\^^e7=\active \global\def^^e7{\c c}
-\global\catcode`\^^e8=\active \global\def^^e8{\`e}
-\global\catcode`\^^e9=\active \global\def^^e9{\'e}
-\global\catcode`\^^ea=\active \global\def^^ea{\^e}
-\global\catcode`\^^eb=\active \global\def^^eb{\"e}
-\global\catcode`\^^ec=\active \global\def^^ec{\`\i}
-\global\catcode`\^^ed=\active \global\def^^ed{\'\i}
-\global\catcode`\^^ee=\active \global\def^^ee{\^\i}
-\global\catcode`\^^ef=\active \global\def^^ef{\"\i}
-% small eth
-\global\catcode`\^^f1=\active \global\def^^f1{\~n}
-\global\catcode`\^^f2=\active \global\def^^f2{\`o}
-\global\catcode`\^^f3=\active \global\def^^f3{\'o}
-\global\catcode`\^^f4=\active \global\def^^f4{\^o}
-\global\catcode`\^^f5=\active \global\def^^f5{\~o}
-\global\catcode`\^^f6=\active \global\def^^f6{\"o} % small o with diaeresis
-\global\catcode`\^^f7=\active \global\def^^f7{\inmathmode\div}% division sign
-\global\catcode`\^^f8=\active \global\let^^f8=\o
-\global\catcode`\^^f9=\active \global\def^^f9{\`u}
-\global\catcode`\^^fa=\active \global\def^^fa{\'u}
-\global\catcode`\^^fb=\active \global\def^^fb{\^u}
-\global\catcode`\^^fc=\active \global\def^^fc{\"u}
-\global\catcode`\^^fd=\active \global\def^^fd{\'y}
-% capital thorn
-\global\catcode`\^^ff=\active \global\def^^ff{\"y}
diff --git a/usr.sbin/afs/src/doc/milko1.fig b/usr.sbin/afs/src/doc/milko1.fig
deleted file mode 100644
index 2429ad87c29..00000000000
--- a/usr.sbin/afs/src/doc/milko1.fig
+++ /dev/null
@@ -1,111 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Inches
-A4
-100.00
-Single
--2
-1200 2
-6 525 3900 1275 4275
-2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
- 525 3900 1275 3900 1275 4275 525 4275 525 3900
-4 0 0 100 0 0 12 0.0000 4 180 360 750 4125 dpart\001
--6
-2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
- 1725 1200 2925 1200 2925 1500 1725 1500 1725 1200
-2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
- 4050 1050 4500 1050 4500 1425 4050 1425 4050 1050
-2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
- 1050 2325 1725 2325 1725 2775 1050 2775 1050 2325
-2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
- 3075 3300 3525 3300 3525 3675 3075 3675 3075 3300
-2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
- 3525 4500 4200 4500 4200 4800 3525 4800 3525 4500
-2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
- 1800 4575 2400 4575 2400 4875 1800 4875 1800 4575
-2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
- 1350 5400 2100 5400 2100 5700 1350 5700 1350 5400
-2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
- 2325 5400 3000 5400 3000 5700 2325 5700 2325 5400
-2 2 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 5
- 4650 5475 5100 5475 5100 5775 4650 5775 4650 5475
-3 0 0 1 0 7 100 0 -1 0.000 0 0 0 2
- 1725 1575 1425 2250
- 0.000 0.000
-3 0 0 1 0 7 100 0 -1 0.000 0 0 0 2
- 4200 1500 1800 2475
- 0.000 0.000
-3 0 0 1 0 7 100 0 -1 0.000 0 0 0 2
- 2400 1575 3150 3225
- 0.000 0.000
-3 0 0 1 0 7 100 0 -1 0.000 0 0 0 4
- 2250 1575 2475 3375 2400 4050 2175 4500
- 0.000 1.000 1.000 0.000
-3 0 0 1 0 7 100 0 -1 0.000 0 0 0 2
- 3150 3750 2400 4500
- 0.000 0.000
-3 0 0 1 0 7 100 0 -1 0.000 0 0 0 2
- 3375 3750 3750 4425
- 0.000 0.000
-3 0 0 1 0 7 100 0 -1 0.000 0 0 0 2
- 2025 4875 1800 5400
- 0.000 0.000
-3 0 0 1 0 7 100 0 -1 0.000 0 0 0 2
- 2250 4875 2625 5400
- 0.000 0.000
-3 0 0 1 0 7 100 0 -1 0.000 0 0 0 7
- 3600 3525 3975 3600 4275 3900 4725 4425 4800 4800 4875 5175
- 4875 5325
- 0.000 1.000 1.000 1.000 1.000 1.000 0.000
-3 0 0 1 0 7 100 0 -1 0.000 0 0 0 2
- 4350 1500 3450 3225
- 0.000 0.000
-3 0 0 1 0 7 100 0 -1 0.000 0 0 0 2
- 3000 3525 1425 3975
- 0.000 0.000
-3 1 0 1 0 7 100 0 -1 0.000 0 0 0 10
- 4500 4725 5250 4650 5625 4950 5850 5850 5325 6225 4650 6225
- 4275 5850 4200 5250 4350 4950 4500 4725
- 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
- 1.000 1.000
-3 0 1 1 0 7 100 0 -1 4.000 0 0 0 2
- 3150 5550 4500 5625
- 0.000 0.000
-3 1 0 1 0 7 100 0 -1 0.000 0 0 0 10
- 1650 4275 2325 4200 3000 4425 3300 5250 3225 5925 2100 6300
- 1200 6000 1050 5400 1200 4650 1650 4275
- 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
- 1.000 1.000
-3 0 0 1 4 7 100 0 -1 4.000 0 0 0 16
- 225 3825 750 3675 1200 3750 1650 4050 1950 4425 2325 4350
- 2625 4200 2700 3900 2850 3525 3150 3375 3300 3225 3675 2925
- 4125 2700 4800 2475 4950 2250 5025 1950
- 0.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
- 1.000 1.000 1.000 1.000 1.000 1.000 1.000 0.000
-3 0 0 1 14 7 100 0 -1 0.000 0 0 0 37
- 3975 1350 3900 1650 3600 2175 3375 2625 3225 3000 3150 3075
- 3000 3450 2850 3900 2775 4275 2250 4575 1800 4725 1650 4950
- 1500 5625 1800 5925 2025 5625 2100 5175 2100 5025 2700 4575
- 3000 4350 3225 3750 3825 3600 4200 3900 4500 4425 4650 5250
- 4725 5775 4875 6000 5100 5850 5175 5550 5250 4950 4950 4050
- 4500 3675 4050 3450 3525 2850 3600 2475 3900 1950 4125 1650
- 4200 1500
- 0.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
- 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
- 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
- 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
- 1.000 1.000 1.000 1.000 0.000
-4 0 0 100 0 0 12 0.0000 4 165 1035 1800 1425 sked/volserver\001
-4 0 0 100 0 0 12 0.0000 4 165 585 1425 5625 vdb_flat\001
-4 0 0 100 0 0 12 0.0000 4 135 300 2550 5625 ? db\001
-4 0 0 100 0 0 12 0.0000 4 120 495 3600 4725 vstatus\001
-4 0 0 100 0 0 12 0.0000 4 165 510 1125 2625 [fm]dir\001
-4 0 0 100 0 0 12 0.0000 4 135 300 4725 5700 svol\001
-4 0 0 100 0 0 12 0.0000 4 135 135 4200 1350 fs\001
-4 0 0 100 0 0 12 0.0000 4 135 225 3150 3600 vld\001
-4 0 0 100 0 0 12 0.0000 4 135 405 1875 4800 voldb\001
-4 0 4 100 0 0 12 0.0000 4 135 345 5100 1950 AFS\001
-4 0 14 100 0 0 12 0.0000 4 135 180 3300 2475 32\001
-4 0 14 100 0 0 12 0.0000 4 135 510 3075 4200 opaque\001
-4 0 14 100 0 0 12 0.0000 4 135 435 4650 3750 vnode\001
diff --git a/usr.sbin/afs/src/doc/nnpfs.txt b/usr.sbin/afs/src/doc/nnpfs.txt
deleted file mode 100644
index 822bb8ee3e5..00000000000
--- a/usr.sbin/afs/src/doc/nnpfs.txt
+++ /dev/null
@@ -1,498 +0,0 @@
-
-NNPFS DOCUMENTATION
-=================
-
-$arla: nnpfs.txt,v 1.13 2002/10/20 23:21:38 lha Exp $
-
-This is not the truth, but close to.
-
-
-TODO
-#include <nnpfs/nnpfs_attr.h>
-
-
-LIMITATIONS and CONSTANTS
-=========================
-
-You can install messages to nnpfs of max size ``MAX_XMSG_SIZE''.
-
-The kernel can at most hold rights of size ``MAXRIGHTS''.
-
-A nnpfs handle have the size of ``MAXHANDLE'', and that is at least 16
-bytes.
-
-The anonymous user had id ``NNPFS_ANONYMOUSID''.
-
-The nnpfs-fh-open-handle has the size of ``CACHEHANDLESIZE'', and it
-is an opaque data-structure.
-
-PAGS
-====
-
-Pags are a hack to separate processes of same UID to make them have
-different access-rights. Pags are saved over setuid(2)/initgroups(2)
-calls. Nnpfs uses a struct ``nnpfs_cred'' to pass over the UID and the pag.
-
-
-TOKENS
-======
-
-This section does not apply to 0.36 or older
-
-Tokens describe what parts of the node are valid, and what rights npfs
-has on those parts.
-
-Open token are requests to open a file, note that OPEN tokens are
-diffrent from DATA token, OPEN are if there is right to open data.
-DATA is if there is data installed.
-
-NNPFS_OPEN_R
-NNPFS_OPEN_W
-
-NNPFS_OPEN_{R,W}_PRE must never be requested by nnpfs in messages to
-the userland daemon. The are installed into the kernel when the
-userland daemon allows async open.
-
-NNPFS_OPEN_R_PRE
-NNPFS_OPEN_W_PRE
-
-Async is used for OPEN when the kernel have a NNPFS_OPEN_{R,W}_PRE and
-wants to notify the user land daemon that it has opened the file.
-
-NNPFS_ASYNC
-
-Attribute token, apply to all attribute except size.
-
-NNPFS_ATTR_R /* Attributes valid */
-NNPFS_ATTR_W /* Attributes valid and modifiable */
-
-Tokens that apply to node data.
-
-NNPFS_DATA_R /* Data valid */
-NNPFS_DATA_W /* Data valid and modifiable */
-
-Token that apply to locking of node
-
-NNPFS_LOCK_R /* Data Shared locks */
-NNPFS_LOCK_W /* Data Exclusive locks */
-
-XXX How should invalid node modify above ?
-
-XXX OPEN vs GETDATA should
-XXX Should it be LOOKUP and GETDATA ?
-XXX Do DATA really need to be _{R,W} ?
-
-
-MESSAGES
-========
-
-Are passed through the nnpfs device somehow.
-
-Each message is prepended by a header including the 32-bit fields
-`size'', ``opcode'', ``sequence_num'', ``pad1'' (in that
-order). ``Size'' is the size of the WHOLE message. ``Opcode'' is the
-opcode (described below). ``sequence_num'' is a messages specific field
-that is used for replying the the sender of the message (if so is
-needed).
-
-All messages (and the nnpfs_header) are padded to 64-bit boundary to
-avoid bit unaligned data in the kernel. The padding is called padN,
-where N is a number.
-
-Note that the total size of the data sent to the kernel may consist
-of several messages for performance reasons. Each data blob sent to
-the kernel must contain complete messages, the nnpfs implementation
-does not do any de-fragmentation.
-
-Nnpfs parses each individual message with the help of its size in
-the message header.
-
-The following opcodes are defined (values from 0 to
-NNPFS_MSG_COUNT - 1):
-
-The sender of the message is listed after the opcode name.
-
-NNPFS_MSG_VERSION (user-land)
-
- Probe the kernel module to send its nnpfs version.
- The kernel module returns an integer which
- identifies the capabilities of this nnpfs version.
-
- The user-land process must use this to check if it can support
- this version. It must not use the nnpfs implementation when it
- doesn't support it.
-
-NNPFS_MSG_WAKEUP (user-land|nnpfs)
-
- Wake up a message with `seqnum', and pass on `error' as return
- value.
-
-NNPFS_MSG_WAKEUP_DATA (user-land)
-
- Wake up a kernel-thread with `seqnum', and pass on `error'
- as return value. Add also a data blob for generic use.
-
- Data blob used for ??
-
-NNPFS_MSG_GETROOT (nnpfs)
-
- GETROOT is called to get the root-node with the ``cred''
-
- Its only called from nnpfs to get the root-node, this might be
- several times per mount depending on file system.
-
- User-Land answers with a NNPFS_MSG_INSTALLROOT
-
-NNPFS_MSG_INSTALLROOT (user-land)
-
- INSTALLROOT is called to insert a root node.
-
- INSTALLROOT MUST only be called on the request of GETROOT.
-
- The node to install is in ``node''.
-
- The only return value of the message is the integer return value.
-
- Multiple INSTALLROOT must be ignored by the nnpfs-implementation, and
- the return value EBUSY MUST be returned.
-
-NNPFS_MSG_GETNODE (nnpfs)
-
- GETNODE is called to get the node named ``named'' in the
- directory ``parent_handle'' with ``cred''.
-
- While there is no error in the returning WAKEUP call and there
- is corresponding node in cache the nnpfs-implementation should
- loop until there is an error.
-
-NNPFS_MSG_INSTALLNODE (user-land)
-
- Insert the ``node'' of ``name'' in the directory ``parent_handle''
- into the cache.
-
- The user-land MUST NOT install the ``node'' twice.
-
- The nnpfs-implementation SHOULD NOT install same node several
- times in the same ``parent_handle'', that is if ``node'' has
- same parent and same name (observe that same handle can be
- installed several times in the case of hard-links).
-
-NNPFS_MSG_GETATTR (nnpfs)
-
- Get the attributes for the node described by ``handle'' that
- already have been installed by INSTALLNODE with the ``cred''.
-
- The nnpfs-implementation should loop until there is an error,
- or the node is the cache with appropriate pag in the cred
- part of the node.
-
-NNPFS_MSG_INSTALLATTR (user-land)
-
- Should update the installed ``node's'' attribute.
-
- If the node found in ``node.handle'' isn't in the installed
- the nnpfs-implementation SHOULD return ENOENT.
-
- Note that it isn't an error if the node isn't in the
- nnpfs-cache since it might have been deleted from the
- nnpfs-cache before the message was sent to nnpfs (that is, the
- NNPFS_MSG_INVALIDNODE message is still in the queue to
- user-land).
-
-NNPFS_MSG_GETDATA (nnpfs)
-
- Get data for the node described in ``handle''. Otherwise same
- as GETATTR.
-
-NNPFS_MSG_INSTALLDATA (user-land)
-
- Install data for the node described by ``node.handle''. The
- vnode/inode that contains the data is pointed out by
- ``cache_handle'' if the underlying OS supports openfh/getfh.
-
- The cache file is also pointed out by the name ``cache_name'',
- and that name is relative to the current working directory of
- the user-land process that did the installdata process.
-
- In addition to the data, installdata also updates the
- attributes of the node.
-
- If the ``flag & NNPFS_ID_HANDLE_VALID'' is not set,
- ``cache_name'' will be used instead.
-
- If the ``flag & NNPFS_ID_INVALID_DNLC'' is set the
- nnpfs-implementation should flush all name cache related to this
- node. The nnpfs-implementation SHOULD check that this is a
- directory-node.
-
-NNPFS_MSG_INACTIVENODE (nnpfs)
-
- The message that nnpfs sends to the user-land daemon when
- ``handle'' no longer exists in the nnpfs-cache.
-
- To tell what state the node is in ``flag'' is set to
- appropriate value. ``NNPFS_NOREFS'' tells the user-land daemon
- that the nnpfs still has the node cached but nothing is using it
- and it can be removed at any time. ``NNPFS_DELETE'' means that
- this node already has been dropped from the cache and can't be
- used anymore.
-
-NNPFS_MSG_INVALIDNODE (user-land)
-
- Used to hint the kernel that node described by ``handle''
- should be dropped from the nnpfs-cache. Doesn't mean that the
- node has to be dropped from the cache immediately, just that
- it should be deleted when it's no longer used.
-
- This is typically used by user-land process need to propagates broken
- call-backs/oplocks to nnpfs.
-
- The user-land MUST NOT remove the node from the cache until it
- receives a NNPFS_MSG_INACTIVENODE.
-
-NNPFS_MSG_OPEN (nnpfs)
-
- Passed to the user-land to inform that ``handle'' has been
- opened with ``cred'' to do what is described in ``tokens''.
-
- Can be the same as NNPFS_MSG_GETDATA if no locking is implemented.
-
-NNPFS_MSG_PUTDATA (nnpfs)
-
- Syncs data associated to ``handle'' from nnpfs-cache to
- user-land. The associating ``cred.uid'' and ``cred.pag'' are
- sent along the data.
-
- As a side effect, ``attr'' will contain the mtime of the node.
- and user-land may use that to update the modification time of
- the data.
-
- The nature of the operation is described by ``flag''.
-
- NNPFS_READ: unused
- NNPFS_WRITE: Data is expected to be written to user-land
- NNPFS_NOBLOCK: The operations is expected to be non-blocking (async)
- NNPFS_APPEND: unused
- NNPFS_FSYNC: Flag which can be used that it is expected that user-land
- syncs the data to the next level (whatever that is).
-
- enum { NNPFS_READ = 1, NNPFS_WRITE = 2, NNPFS_NONBLOCK = 4, NNPFS_APPEND = 8, NNPFS_FSYNC};
-
-NNPFS_MSG_PUTATTR (nnpfs)
-
- Syncs attributes (like times, mode bits and size) associated to
- ``handle'' from nnpfs-cache to user-land. The associating
- ``cred.uid'' and ``cred.pag'' are sent along the data.
-
-/* Directory manipulating messages. */
-
-NNPFS_MSG_CREATE (nnpfs)
-
- Instructs user-land to create a new file node entry in
- ``parent_handle'' named ``name'' with the attributes in
- ``attr'' and authenticated with ``cred.uid'' and ``cred.pag''.
- ``mode''.
-
-NNPFS_MSG_MKDIR (nnpfs)
-
- Instructs user-land to create a new directory node entry in
- ``parent_handle'' named ``name'' with the attributes in
- ``attr'' and authenticated with ``cred.uid'' and ``cred.pag''.
-
-NNPFS_MSG_LINK (nnpfs)
-
- Instructs user-land to create a new "hard" link node entry in
- ``parent_handle'' named ``name'' using ``from_handle'' as the
- source with the attributes in ``attr'' and authenticated with
- ``cred.uid'' and ``cred.pag''.
-
-NNPFS_MSG_SYMLINK (nnpfs)
-
- Instructs user-land to create a new symbolic link node entry in
- ``parent_handle'' named ``name'' pointing on ``contents'' as
- the source with the attributes in ``attr'' and authenticated
- with ``cred.uid'' and ``cred.pag''.
-
-NNPFS_MSG_REMOVE (nnpfs)
-
- Instructs user-land to remove a file node in ``parent_handle''
- named ``name'' with the attributes in ``attr'' and
- authenticated with ``cred.uid'' and ``cred.pag''.
-
-NNPFS_MSG_RMDIR (nnpfs)
-
- Instructs user-land to remove a directory node in
- ``parent_handle'' named ``name'' with the attributes in
- ``attr'' and authenticated with ``cred.uid'' and ``cred.pag''.
-
-NNPFS_MSG_RENAME (nnpfs)
-
- Instructs user-land to rename a node in ``parent_handle'' named
- ``old_name'' to ``new_name'' authenticated with ``cred.uid''
- and ``cred.pag''.
-
-NNPFS_MSG_PIOCTL (nnpfs)
-
- If the nnpfs-cache manager get a pioctl and can not take care of
- it itself, it forwards it to user-land. Associated with the
- pioctl there are the ``opcode'' of the pioctl, a ``insize'',
- ``outsize'' and ``cred''.
-
-NNPFS_MSG_WAKEUP_DATA (user-land)
-
-NNPFS_MSG_UPDATEFID (user-land)
-
-NNPFS_MSG_ADVLOCK (nnpfs/user-land)
-
-NNPFS_MSG_GC_NODES (user-land)
-
- NNPFS_MSG_GC_NODES is almost the equivalent of
- NNPFS_MSG_INVALIDNODE, with the difference that the node isn't
- invalid, its the the user-land process that wants to free it.
-
-__END__;
-
-/* NNPFS_MSG_OPEN */
-struct nnpfs_message_open {
- struct nnpfs_message_header header;
- struct nnpfs_cred cred;
- nnpfs_handle handle;
- u_int32_t tokens;
- u_int32_t pad1;
-};
-
-/* NNPFS_MSG_PUTDATA */
-struct nnpfs_message_putdata {
- struct nnpfs_message_header header;
- nnpfs_handle handle;
- struct nnpfs_attr attr; /* XXX ??? */
- struct nnpfs_cred cred;
- u_int32_t flag;
- u_int32_t pad1;
-};
-
-/* NNPFS_MSG_PUTATTR */
-struct nnpfs_message_putattr {
- struct nnpfs_message_header header;
- nnpfs_handle handle;
- struct nnpfs_attr attr;
- struct nnpfs_cred cred;
-};
-
-/* NNPFS_MSG_CREATE */
-struct nnpfs_message_create {
- struct nnpfs_message_header header;
- nnpfs_handle parent_handle;
- char name[256]; /* XXX */
- struct nnpfs_attr attr;
- u_int32_t mode;
- u_int32_t pad1;
- struct nnpfs_cred cred;
-};
-
-/* NNPFS_MSG_MKDIR */
-struct nnpfs_message_mkdir {
- struct nnpfs_message_header header;
- nnpfs_handle parent_handle;
- char name[256]; /* XXX */
- struct nnpfs_attr attr;
- struct nnpfs_cred cred;
-};
-
-/* NNPFS_MSG_LINK */
-struct nnpfs_message_link {
- struct nnpfs_message_header header;
- nnpfs_handle parent_handle;
- char name[256]; /* XXX */
- nnpfs_handle from_handle;
- struct nnpfs_cred cred;
-};
-
-/* NNPFS_MSG_SYMLINK */
-struct nnpfs_message_symlink {
- struct nnpfs_message_header header;
- nnpfs_handle parent_handle;
- char name[256]; /* XXX */
- char contents[2048]; /* XXX */
- struct nnpfs_attr attr;
- struct nnpfs_cred cred;
-};
-
-/* NNPFS_MSG_REMOVE */
-struct nnpfs_message_remove {
- struct nnpfs_message_header header;
- nnpfs_handle parent_handle;
- char name[256]; /* XXX */
- struct nnpfs_cred cred;
-};
-
-/* NNPFS_MSG_RMDIR */
-struct nnpfs_message_rmdir {
- struct nnpfs_message_header header;
- nnpfs_handle parent_handle;
- char name[256]; /* XXX */
- struct nnpfs_cred cred;
-};
-
-/* NNPFS_MSG_RENAME */
-struct nnpfs_message_rename {
- struct nnpfs_message_header header;
- nnpfs_handle old_parent_handle;
- char old_name[256]; /* XXX */
- nnpfs_handle new_parent_handle;
- char new_name[256]; /* XXX */
- struct nnpfs_cred cred;
-};
-
-/* NNPFS_MSG_PIOCTL */
-struct nnpfs_message_pioctl {
- struct nnpfs_message_header header;
- u_int32_t opcode ;
- u_int32_t pad1;
- nnpfs_cred cred;
- u_int32_t insize;
- u_int32_t outsize;
- char msg[2048] ; /* XXX */
- nnpfs_handle handle;
-};
-
-
-/* NNPFS_MESSAGE_WAKEUP_DATA */
-struct nnpfs_message_wakeup_data {
- struct nnpfs_message_header header;
- u_int32_t sleepers_sequence_num; /* Where to send wakeup */
- u_int32_t error; /* Return value */
- u_int32_t len;
- u_int32_t pad1;
- char msg[2048] ; /* XXX */
-};
-
-/* NNPFS_MESSAGE_UPDATEFID */
-struct nnpfs_message_updatefid {
- struct nnpfs_message_header header;
- nnpfs_handle old_handle;
- nnpfs_handle new_handle;
-};
-
-/* NNPFS_MESSAGE_ADVLOCK */
-struct nnpfs_message_advlock {
- struct nnpfs_message_header header;
- nnpfs_handle handle;
- struct nnpfs_cred cred;
- nnpfs_locktype_t locktype;
-#define NNPFS_WR_LOCK 1 /* Write lock */
-#define NNPFS_RD_LOCK 2 /* Read lock */
-#define NNPFS_UN_LOCK 3 /* Unlock */
-#define NNPFS_BR_LOCK 4 /* Break lock (inform that we don't want the lock) */
- nnpfs_lockid_t lockid;
-};
-
-/* NNPFS_MESSAGE_GC_NODES */
-struct nnpfs_message_gc_nodes {
- struct nnpfs_message_header header;
-#define NNPFS_GC_NODES_MAX_HANDLE 50
- u_int32_t len;
- u_int32_t pad1;
- nnpfs_handle handle[NNPFS_GC_NODES_MAX_HANDLE];
-};
-#endif /* _xmsg_h */
diff --git a/usr.sbin/afs/src/doc/oddities.texi b/usr.sbin/afs/src/doc/oddities.texi
deleted file mode 100644
index 489f1abd9e1..00000000000
--- a/usr.sbin/afs/src/doc/oddities.texi
+++ /dev/null
@@ -1,44 +0,0 @@
-@c Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-
-@c $arla: oddities.texi,v 1.11 2003/02/01 17:15:44 lha Exp $
-
-@node Oddities, Arla timeline, Programming, Top
-@chapter Oddities
-
-@c ----------------------------------------------------
-
-@section AFS
-
-@itemize @bullet
-
-@item Directories - UnixModeBits are ignored when the vnode is a directory.
-
-@item Errnos are sent over the network. Like Solaris ENOTEMPTY(93) doesn't
- even map to an error on sunos4 where ENOTEMPTY is 66.
-
-@item Mountpoints have the mode-bits 0644, if they don't they are symlinks
-(and have the mode-bits 0755).
-
-@end itemize
-
-@c ----------------------------------------------------
-
-@section Operating systems
-
-@itemize @bullet
-
-@item On Irix 6.5 you have to build the dirents depending on what ABI
- of the binary you are currently running.
-
-@item . and .. need to be first in directories, this is needed since some
-programs (like make) "knows" that the two first entries are . and .. and
-thus can be skiped.
-
-@item Reclen (in struct dirent) shouldn't be too large. When its
-larger then the buffer used in opendir/readdir/closedir, you lose.
-
-@end itemize
-
-@c ----------------------------------------------------
diff --git a/usr.sbin/afs/src/doc/partsofarla.texi b/usr.sbin/afs/src/doc/partsofarla.texi
deleted file mode 100644
index 42f2441e2f3..00000000000
--- a/usr.sbin/afs/src/doc/partsofarla.texi
+++ /dev/null
@@ -1,366 +0,0 @@
-@c Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-
-@c $arla: partsofarla.texi,v 1.21 2003/01/11 00:29:05 lha Exp $
-
-@node Parts of Arla, Debugging, AFS and the real world, Top
-@comment node-name, next, previous, up
-@chapter Parts of Arla
-
-@quotation
-@strong{Caution:} This text just tries to give a general picture.
-For real info read the code. If you have any questions, mail
-@email{arla-drinkers@@stacken.kth.se}.
-@end quotation
-
-
-@menu
-* How arla works::
-* The relation between Arlad and NNPFS::
-* The life of a file::
-* Tools and libs::
-* The files in arlad/::
-* pioctl and kafs::
-@end menu
-
-@comment -----------------------------------------------------
-@node How arla works, The relation between Arlad and NNPFS, Parts of Arla, Parts of Arla
-@heading How does arla work
-
-Arla consists of two parts, a userland process (arlad) and the
-kernel-module (nnpfs).
-
-Arlad is written in user-space for simpler debugging (and less rebooting).
-As a uset space program arlad does not have the same limitations as if it
-would be written in the kernel. To avoid performance loss as much as possible,
-nnpfs is caching data.
-
-@c XXX ptr to coda and arla-usenix paper
-
-nnpfs and arlad communicate with each other via a char-device-driver.
-There is a rpc-protocol currenly used specially written for this
-(@file{arlad/message.c})
-
-nnpfs is written to be as simple as possible. Theoretically, nnpfs could
-be used by other user-space daemons to implement a file system. Some
-parts, such as syscalls, are arla-specific. These parts are designed
-to be as general as possible.
-
-For example, nnpfs does not recognize which pioctl the user-level
-program calls, it just passes this information on to arlad.
-
-@comment -----------------------------------------------------
-@node The relation between Arlad and NNPFS, The life of a file, How arla works, Parts of Arla
-@heading The relation between Arlad and NNPFS
-
-@example
-Userland
-
- ---------
- Edit file | Arlad | ------> Network
- | ---------
- ----|-----------------|[1]----
- ------- -------
-Kernel | VFS | <--[2]--> | NNPFS |
- ------- -------
-
-@end example
-
-@table @asis
-@item [1] A char device (/dev/nnpfs0)
-@item [2] Xfs provides a filesystem for the vfs-layer in
-the operating system.
-@end table
-
-@comment -----------------------------------------------------
-@node The life of a file, Tools and libs, The relation between Arlad and NNPFS, Parts of Arla
-@section The life of a file
-
-@comment This a rough description of the life of a file.
-
-Step by step description of what happens during the creation of a file.
-The names are inspired of BSD-style VFS-layer but the idea is the same
-in most operating systems.
-
-@itemize @bullet
-
-@item The user decides to open a file.
-
-@item open(2) syscall is issued.
-
-@item The vfslayer sends a VOP_LOOKUP to nnpfs that is forwarded
-to arlad with a getnode() (seq-num 1).
-
-@item arlad tries to find the requested file and then, if found, sends an
-install_node to nnpfs by writing to the nnpfs character device.
-
-@item nnpfs inserts the node into the cache and returns from the device write.
-
-@item arlad sends a wakeup rpc message (seq-num 1) to nnpfs.
-If the return value is zero nnpfs tries to find the node in the cache, if
-not found it might have been flushed out of the cache and the whole
-thing is repeated.
-
-@item If a none-zero return value is returned, this value is sent
-as reply to the user. This way arla can decide what error message
-is returned, without nnpfs having support for each error.
-
-@item nnpfs now checks if it has the valid attributes. If the attributes
-are invalid, nnpfs will send a rpc message to arlad to refresh it.
-
-@item Since the user wanted to open the file, a getdata rpc message is
-sent from nnpfs to arlad. Now arlad fetches the files from the
-afs file server.
-
-@item Arlad stores the file in the file cache. All vnode operations will
-be done on this file. Now arlad sends a installdata to nnpfs.
-
-@item When nnpfs recives the installdata it looks up the node in the cache,
-and then it does a VOP_LOOKUP to find a vnode to the cachefile (and store
-it to keep it for future use).
-
-@item The same thing is done when the file is a directory, except that
-the directory is converted from the afs directory format to an operating
-system dependent format and stored in a file. nnpfs reads this file
-instead.
-
-@item If the directory is modified locally, write operations are
-done on the file obtained from the afs-server, and when done the newly
-changed file is converted and reinstalled.
-
-@item Now the user wants to read a file.
-
-@item read(2) system call is issued.
-
-@item A VOP_READ is sent to the from the vfs-layer to nnpfs.
-
-@item nnpfs checks if it has valid attributes/and data (and updates if needed).
-Now VOP_READ is simply performed on the stored vnode of the cachefile.
-
-@end itemize
-
-@comment -----------------------------------------------------
-@node Tools and libs, The files in arlad/, The life of a file, Parts of Arla
-@heading Tools and libs
-
-What other tools does the arla suite consists of
-
-@table @asis
-
-@item libutil: @code{util/libutil.a} - A library for the most often used
-modules like hashtable, double-linked list, logging functions,
-date-parsing, etc
-
-@item rx: @code{rx/librx.a} - The library for the rx protocol
- (@pxref{Rx protocol}).
-
-@item lwp: @code{lwp/liblwp.a} - The library for the lwp thread-package
- (@pxref{LWP}).
-
-@item ydr: @code{ydr/ydr} - A stub generator that replaces rxgen.
-
-@item rxkad: @code{rxkad/librxkad.a} - The rx Kerberos authentication package.
-
-@item roken: @code{lib/roken/libroken.a} - The library that will unbreak
-things that are missing or broken.
-
-@item ko: @code{lib/ko/libko.a} - A library of functions that are arlad-core
-related but also are useful for programs like vos, pts, fs, etc.
-
-@item arlalib: @code{appl/lib/libarlalib.a} - A broken library that does all
-the hard work with connections etc.
-
-@item fs: @code{appl/fs/fs} - The fs util, extra feature
-(amongst others): getfid.
-
-@item vos: @code{appl/vos/vos} - The vos util.
-
-@item pts: @code{appl/pts/pts} - The pts util, extra feature: dump.
-
-@item udebug: @code{appl/udebug/udebug} - Debug your ubik server.
-
-@end table
-
-@include tools.texi
-
-@comment -----------------------------------------------------
-@node The files in arlad/, pioctl and kafs, Tools and libs, Parts of Arla
-@section The files in arlad/
-
-This is a short describtion of the files to bring new deveplopers
-up to speed.
-
-@subsection The core of arlad
-
-@table @asis
-
-@item @file{adir.c} - contains all functions needed to to operations
-on afs-directory files.
-
-@item @file{afsdir_check.c} - check if an AFS-directory looks sane.
-
-@item @file{arla.c} - The startup and the standalone (-t) code.
-
-@item @file{arladeb.c} - The logging code specific to arla, like aliases
-for debugging masks.
-
-@item @file{cmcb.c} - The callback-server that is contacted by the
-server when a callback expires or a server wants to send an InitCallBackState.
-
-@item @file{conn.c} - The connection cache, responsible for caching connection
-based on pag and security index. It will also create new connection when
-needed.
-
-@item @file{cred.c} - Keep track of all credentials that all users have
-inserted. Indexed on pag.
-
-@item @file{fbuf.c} - An interface between rx and filedescriptors. It is also
-used to mmap files. Used by @file{adir.c}.
-
-@item @file{fcache.c} - Responsible for keeping track of files in the cache.
-Also fetches files from the afs-server.
-
-@item @file{fprio.c} - Tries to give files priority. These files are
-therefore not garbarge-collected as fast as they would be otherwise.
-If you wonder what this is for, think of the disconnected mode.
-
-@item @file{inter.c} - An interface to hide all junk in fcache, just give
-the items a VenusFid and you can access them this way.
-
-@item @file{kernel.c} - The interface between arlad and the char-device.
-
-@item @file{messages.c} - The rpc interface between arlad and nnpfs.
-
-@item @file{volcache.c} - Cache for all volumes.
-
-@end table
-
-@subsection Operating system specific files
-
-These are the files that contain operating specific functions.
-Today it's just conv_dir().
-
-@table @asis
-
-@item @file{aix-subr.c} - AIX
-@item @file{bsd-subr.c} - FreeBSD 2.2.6, OpenBSD 2.2, 2.3, NetBSD 1.3.x
-@item @file{hpux-subr.c} - HPUX
-@item @file{irix-subr.c} - Irix
-@item @file{linux-subr.c} - Linux 2.0.x, 2.1.x, 2.2
-@item @file{solaris-subr.c} - Solaris 2.5.x, 2.6, 7
-@item @file{sunos-subr.c} - SunOS
-@item @file{unknown-subr.c} - Stub used when compiled on a unknown OS.
-
-@end table
-@comment -----------------------------------------------------
-
-@node pioctl and kafs, ,The files in arlad/, Parts of Arla
-@heading pioctl and kafs
-
-The pioctl interface is the only part of nnpfs that is afs related.
-
-pioctl is a ioctl but called with a path instead of a filedescriptor.
-When you probe if there is a live afsclient you first run
-@code{k_hasafs()} that probes if there is an afsclient around.
-It also sets up some static variables in the library. So if you
-start to do @code{pioctl()} w/o running @code{k_hasafs()}, you're
-up to funny errors, and/or get a corefile.
-
-@code{k_hasafs()} does an @code{AFSCALL_PIOCTL} with opcode
-@code{VIOCSETTOK} and insize == 0, ie you try to set a token
-(ticket) that is 0 bytes long. This is cleary invalid and kafs
-expects to find an @code{EINVAL} returned from @code{syscall(2)}.
-
-The pioctl is used more then just for @code{AFSCALL_PIOCTL}, an other
-use is @code{AFSCALL_SETPAG} (setting pag). It has also been in use for
-setting nnpfs debugging levels.
-
-When nnpfs discovers that a path is given in the @code{pioctl()} it does a
-@code{VOP_LOOKUP} on the path and if the returned value is a vnode that
-resides in afs then it extracts the nnpfs-handle for that node (that just
-happens to be the VenusFid) and passes that on to arlad.
-
-The only ugly thing about the current implentation is that
-the syscall code assumes that the arlad on "nnpfs-fd" is the
-arlad that should get this syscall.
-
-An example of using @code{pioctl()}:
-
-@example
-int
-fs_getfilecellname(char *path, char *cell, size_t len)
-@{
- struct ViceIoctl a_params;
-
- a_params.in_size=0;
- a_params.out_size=len;
- a_params.in=NULL;
- a_params.out=cell;
-
- if (k_pioctl(path,VIOC_FILE_CELL_NAME,&a_params,1) == -1)
- return errno;
-
- return 0;
-@}
-
-int
-main (int argc, char **argv)
-@{
- char cell[100];
-
- if (!k_hasafs())
- errx (1, "there is no afs");
-
- if (fs_getfilecellname (".", cell, sizeof(cell)))
- errx (1, "fs_getfilecellname failed");
-
- printf ("cell for `.' is %s", cell);
- return 0;
-@}
-
-@end example
-
-@comment -----------------------------------------------------
-
-@c -----------------------------------------------------------
-@c Storybook
-@c -----------------------------------------------------------
-@c
-@c Assar Westerlund tells a story to the rest of the world:
-@c
-@c John Hawkinson <jhawk@MIT.EDU> writes:
-@c > What does sl stand for?
-@c
-@c The short answer is that you should ask Mark.
-@c
-@c The long answer is that it used to be this old library part of MIT
-@c krb4 that was called `ss' (that I believe is short for subsystem, and
-@c that was part of some unknown operating system a long time ago.
-@c (Again, ask Mark.)), for reading and handling command line loops and
-@c parsing. That wasn't IMHO optimal so we wrote a new library which we
-@c called `sl'. The reason for SL is that the local transport authority
-@c in Stockholm used to be called SS (Stockholms Sparvagar) but due to
-@c the bad PR this abbreviation got under the second world war and that
-@c they almost have abandoned trolleys (Sparvagnar) today, they renamed
-@c themselves to SL (Storstockholms Lokaltrafik).
-@c
-@c
-@c [ lha: Mark is only known to assar ]
-@c [ assar: Mark == Mark Eichin ]
-@c -----------------------------------------------------------
-
-@c From: Craig_Everhart@transarc.com
-@c Subject: Re: [OpenAFS] Silly question, Just interested
-@c To: <openafs-info@openafs.org>
-@c Date: Fri, 19 Jul 2002 10:00:19 -0400 (EDT)
-@c
-@c
-@c The other way around: Vice was the Vast Integrated Computing Environment
-@c on the server, and Venus was the client-side component but I don't know
-@c if it was an acronym.
-@c
-@c Craig
-@c
-
-
diff --git a/usr.sbin/afs/src/doc/pioctl.texi b/usr.sbin/afs/src/doc/pioctl.texi
deleted file mode 100644
index d65766eccf9..00000000000
--- a/usr.sbin/afs/src/doc/pioctl.texi
+++ /dev/null
@@ -1,104 +0,0 @@
-@c Copyright (c) 2002 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-
-@c $arla: pioctl.texi,v 1.5 2002/06/02 17:52:28 lha Exp $
-
-@chapter Arla pioctl's
-
-This chaper documents arla pioctl's. Arla's pioct are in the @code{A}
-range of the pioctls. OpenAFS uses @code{O} and orignal Transarc uses
-@code{V}.
-
-@enumerate
-
-@code{AIOC_STATISTICS}
-
-XXX max constants
-
-@enumerate
-
-@item
-@code{opcode STATISTICS_OPCODE_LIST}
-
-Get a specific host/partition entry.
-
-@item
-@code{opcode STATISTICS_OPCODE_GETENTRY}
-
-Get a specific entry. The 5 values that are passed in are: opcode
-(STATISTICS_OPCODE_GETENTRY), ipv4-host-address, partition,
-type-of-data, slot in the histogram.
-
-Possible types of data are:
-
-@enumerate
-
-@item
-@code{STATISTICS_REQTYPE_FETCHSTATUS}
-
-@item
-@code{STATISTICS_REQTYPE_FETCHDATA}
-
-@item
-@code{STATISTICS_REQTYPE_BULKSTATUS}
-
-@item
-@code{STATISTICS_REQTYPE_STOREDATA}
-
-@item
-@code{STATISTICS_REQTYPE_STORESTATUS}
-
-@end enumerate
-
-@end enumerate
-
-@code{AIOC_PTSNAMETOID}
-
-Return a pts name to id for a cell, the cell is referenced by the file
-that is passed into the request, or by name.
-
-XXX document format
-
-@code{AIOC_GETCACHEPARAMS}
-
-Common format In: an int32_t that is the opcode. Out: a int64_t that
-describes the requisted value.
-
-@enumerate
-
-@item
-@code{GETCACHEPARAMS_OPCODE_HIGHBYTES}
-
-Get the high bytes watermark.
-
-@item
-@code{GETCACHEPARAMS_OPCODE_USEDBYTES}
-
-Get the current used bytes.
-
-@item
-@code{GETCACHEPARAMS_OPCODE_LOWBYTES}
-
-Get the low bytes watermark.
-
-@item
-@code{GETCACHEPARAMS_OPCODE_HIGHVNODES}
-
-Get the high vnode watermark.
-
-@item
-@code{GETCACHEPARAMS_OPCODE_USEDVNODES}
-
-Get the current used vnodes.
-
-@item
-@code{GETCACHEPARAMS_OPCODE_LOWVNODES}
-
-Get the low vnode watermark.
-
-@end enumerate
-
-
-@end enumerate
-
diff --git a/usr.sbin/afs/src/doc/porting.texi b/usr.sbin/afs/src/doc/porting.texi
deleted file mode 100644
index f706839eff6..00000000000
--- a/usr.sbin/afs/src/doc/porting.texi
+++ /dev/null
@@ -1,188 +0,0 @@
-@c Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-
-@c $arla: porting.texi,v 1.14 2002/09/07 10:43:55 lha Exp $
-
-@node Porting, Programming, Darwin/MacOS X, Top
-@comment node-name, next, previous, up
-@chapter Porting
-
-The largest part of the work needed to port Arla to a new operating
-system is in porting nnpfs, as kernel programming always is harder, less
-portable and messier than user-space dito. Arla in test mode
-(@kbd{arla-cli}) should work without any porting on any system that's
-not very far away from Unix and that provides berkeley sockets
-(including cygwin32). The hard part is porting the NNPFS kernel module,
-and we will spent most of this text on how to do that.
-
-@menu
-* Porting user-space::
-* Porting NNPFS::
-@end menu
-
-@node Porting user-space, Porting NNPFS, Porting, Porting
-@section user-space
-
-The user-space parts should work on basically any system that is
-reasonably Posix and has berkeley sockets. The build uses autoconf and
-should adapt itself to most forseeable circumstances. If it fails to
-consider something that is missing or not working on the particular OS
-you are porting to, hard-code it to make sure that is what is missing
-and then try to create an autoconf test for it. If you fail to do so,
-or have no autoconf experience, send us the patches anyway and tell us
-where you are having the problem.
-
-@subsection LWP
-
-The only thing that might take a little bit more effort in porting is
-the context-switch in the LWP user-level threads package. There are
-assembler versions for most of the common architectures in @file{lwp}.
-Part of the problem is getting this code assembled properly. There is
-unfortunately no easy and portable way of preprocessing and assembling
-code. There is a script @file{lwp/make-process.o.sh} that tries to do
-in some different ways, but it may fail for you. Next problem is that
-assembler syntax can vary a lot even on the same CPU. The source files
-are written in such a way that they should be acceptable to almost any
-syntax, but if it fails you have to find out what particular syntax has
-to be used and adapt the source file for that.
-
-The more interesting problem is if there is no support for your CPU.
-The first thing to try then is the @kbd{--with-pthreads} option that
-uses the pthreads library. If that fails or you want LWP working you
-have to figure out enough details on your CPU to write two functions in
-assembler, @samp{savecontext} and @samp{returnto} that save and
-restore the processor context.
-
-@node Porting NNPFS, , Porting user-space, Porting
-@section NNPFS
-
-@enumerate
-
-@item
-It helps to have source code for your operating system.
-
-In theory, if stuff was documented well enough, you wouldn't need it.
-In practice it never is, so you find out interfaces specs and how stuff
-works by reading the source code. If you're unable to find source code
-for your OS, try finding source for the closest match. If your OS is
-based on BSD, try the appropriate version of BSD, for example.
-
-@item
-If you don't have source, try second best, include files.
-
-You can usually gather quite a lot of information on the workings of the
-kernel by reading the includes files in @file{<sys/*.h>}.
-
-@item
-Be lazy
-
-Try to find out what other NNPFS port is most similar to your OS and start
-with that code.
-
-@item
-Figure out how your kernel works.
-
-You need to figure out how a few things work in your kernel:
-
-@enumerate
-
-@item
-Loading/unloading kernel modules
-
-That varies quite a lot but it's probably easy to figure out if you
-have the source code for some other loadable module. Sometimes you
-can get the kernel to add your cdev, system call and file system
-automatically but usually you have to write code in your `entry-point'
-to add these to the appropriate tables.
-
-@item
-Adding a new character device driver
-
-The kernel has a table of all known device drivers, ordered by major
-number. Some kernels have one for block devices and one for character
-devices and some have a common one. That entry usually consists of a
-number of function pointers that perform the operations (open, close,
-read, write, ...), and possible a name and some flags. It could look
-something like the following:
-
-@example
-struct cdevsw @{
- int (*d_open)();
- int (*d_close)();
- ...
-@};
-
-struct cdevsw cdevsw[];
-@end example
-
-These are then usually stored in a table `cdevsw' indexed by the major
-device number. If you're really lucky there's a new way to get the
-kernel to add your `struct cdevsw' to the global table when loading the
-module or a function that does the addition for you. Otherwise there
-might be functions for adding/removing devices to the global table.
-If not, you'll have
-to fallback on looking for a free slot in the table and putting your
-struct cdevsw there. In some cases, this is not stored in a table but
-then there'll be a way of adding entries to the new data structure so
-you don't need to worry about it.
-
-@item
-Adding a new system call
-
-This is quite similar to adding a new cdev but the table is usually
-called @code{sysent} instead.
-
-@item
-Adding a new file system
-
-Once again, quite similar in principle. The names of the structures
-tend to vary quite a lot more.
-
-@item
-Finding out how the VFS/Vnode switch works
-
-The structure vfsops contains function pointers for all of the file
-system operations. You need to figure out what operations you need to
-implement (usually at least mount, unmount, root, sync, and statfs).
-
-The operations that are performed on files are vnode operations
-(usually stored in a struct vnodeops), and you need to figure which of
-these you need and how they should work. Also, which is not as
-explicit, how vnodes are supposed to be allocated and freed and such.
-
-@end enumerate
-
-@item
-Suggested plan of action
-
-@enumerate
-
-@item
-Start by writing a minimal hello-world module and make sure you can load
-and unload it properly.
-
-@item
-Then add a device driver to the module which dummy functions and
-verify that works.
-
-@item
-Try to fit the device driver functions in @file{nnpfs_dev.c} into the
-device driver.
-
-@item
-Do a dummy module with a system call and verify that you can call it.
-
-@item
-Start trying to add enough of the vfs/vnode operations from
-@file{nnpfs_vfsops.c} and @file{nnpfs_vnodeops.c} so that you can build it.
-
-@item
-Debug it.
-
-@item
-Send us patches
-
-@end enumerate
-
-@end enumerate
diff --git a/usr.sbin/afs/src/doc/prog-disco.texi b/usr.sbin/afs/src/doc/prog-disco.texi
deleted file mode 100644
index 4b2a6fe8869..00000000000
--- a/usr.sbin/afs/src/doc/prog-disco.texi
+++ /dev/null
@@ -1,240 +0,0 @@
-@c Copyright (c) 2002 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-
-@c $arla: prog-disco.texi,v 1.1 2002/05/27 13:08:31 lha Exp $
-
-@cindex Disconected operation
-
-@chapter Disco with arla
-
-Disconnected operation of arla.
-
-@section The Log
-
-The binary log is written to a file. All entries are of variable size.
-A entry is never removed from the log @pxref{Log entry optimization}.
-
-@subsection One log entry
-
-One log entry consists of a log header with magic cookie, opcode,
-checksum, and length. The entry is is always 4 byte aligned in the
-logfile. The checksum is a simple one, its just to verify that for
-data corruption hasn't occured and to make sure the entry is a valid
-one.
-
-@subsection Disconnected vs connected nodes
-
-A FCacheNode is either a @dfn{disconnected node} or a @dfn{connected
-node}. The later means that the node was created when arla was in
-connected mode and thus (potentially) exist on the file server.
-
-A disconnected node on the other hand was created when is disconnected
-operation. A disconnected node always have one or more entries in the
-log.
-
-@subsection Log entry offset
-
-The offset of the entry, a unsigned 32 bit number, is called
-@dfn{disco_id}. Its stored in the FCacheNode so it can be updated when
-there is a operation on this node. All nodes for a FCacheEntry are
-single linked list (from the newest log entry to the oldest), the
-optimizer uses this to modify all previous entries from a FCacheNode.
-
-A FCacheNode with disco_id equal to 0 is a connected node that there
-have been no disconnected operation made on.
-
-The first entry in the log is a nop entry to make sure not a
-log-offset that is for a ``real'' entry.
-
-The limit of number of entries in the log are 2^32 / the size of the
-largest entry since the offset is a 32 bit number.
-
-@c @subsection Dump log / Backup of log
-@c
-@c It should be possible to extract a dump of the current state of
-@c disconnected operation (all adding operations that is). This is to
-@c make a backup of all changes before reitegration.
-
-@section Log entry optimization
-@anchor{Log entry optimization}
-
-To try to preserve bandwith when reinterating there are dependencies
-between entries. First we try to avoid storing data to the fileserver
-that was never meant to got there. For example a file that was created
-and then removed in disconnected mode, ie @code{DISCO_HEADER_NOP} is
-set in the flags field in the header.
-
-@subsection Removal operations
-
-When a node is removed and the node is a disconnected node, the all
-previous entries are optizmied away by setting a flags in their entry
-headers. This make this entry/nodes be ignored by the reintergration
-code and never commited to the fileserver.
-
-@subsection Moveing a disconnected node
-
-If a disconnected node is moved, it will be created in the target
-directory instead of first being created and then moved.
-
-@subsection Storestatus and storedata
-
-Also, all entries for one node storestate/storestatus are compressed
-to one createnode (and if needed storedata).
-
-@section data storage
-
-@subsection common data types
-
- fid - VenusFid equivalent
- storestatus - AFSStoreStatus equivalent
-
-@enumerate
-
-@item
-@code{nop}
-
- needs to be smaller or equal in size then the rest
-
- data storage:
- header
- flags
- fid
-
-@item
-@code{storedata}
-
- (truncation is a storedata)
-
- data storage:
- header
- fid
- storestatus
- size
-
-@item
-@code{storestatus}
-
- data storage:
- header
- fid
- storestatus
-
-@item
-@code{createfile}
-
- data storage:
- header
- parentfid
- fid
- storestatus
- name[AFSNAMEMAX]
-
-@item
-@code{createsymlink}
-
- data storage:
- header
- parentfid
- fid
- storestatus
- name[AFSNAMEMAX]
- targetname[AFSNAMEMAX]
-
-@item
-@code{createlink}
-
- data storage:
- header
- parentfid
- fid
- storestatus
- name[AFSNAMEMAX]
- targetfid
-
-@item
-@code{unlink}
-
- data storage:
- header
- parentfid
- fid /* dup info */
- name[AFSNAMEMAX]
-
-@item
-@code{createdir}
-
- data storage:
- header
- parentfid
- fid /* dup info */
- storestatus
- name[AFSNAMEMAX]
-
-@item
-@code{removedir}
-
- data storage:
- header
- parentfid
- fid /* dup info */
- name[AFSNAMEMAX]
-
-@end enumerate
-
-@section reintegration
-
-@subsection Cook-book
-
-@enumerate
-
-@item
-
-make sure first entry in the log is a nop entry
-
-@item
-
-if nop entry or @code{DISCO_HEADER_NOP} is set, continue to next
-
-@item
-
-the parent fid is transformed to a connected fid (if needed)
- it this failes, we are unhappy and save this node for collision
- recovery
-
-@item
-
-the fid is transformed to a connected fid (if needed)
- it this failes, we are unhappy and save this node for collision
- recovery
-
-@item
-
-operation is performed
-
-@item
-
-if there is change on a fid
-
-@enumerate
-
-@item
-
-update kernelhandle
-
-@item
-
-update fcachehandle
-
-@item
-
-update directory fid for this name (if needed)
-
-@item
-
-transformed fids are stored in the transformation table
-
-@end enumerate
-
-@end enumerate
-
diff --git a/usr.sbin/afs/src/doc/prog.texi b/usr.sbin/afs/src/doc/prog.texi
deleted file mode 100644
index bf56dd0a5df..00000000000
--- a/usr.sbin/afs/src/doc/prog.texi
+++ /dev/null
@@ -1,58 +0,0 @@
-@c Copyright (c) 2002 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-
-@c $arla: prog.texi,v 1.4 2002/09/07 10:43:57 lha Exp $
-
-@node Programming, Oddities, Porting, Top
-@comment node-name, next, previous, up
-@chapter Programming
-
-This chapter is programming documentation of arla's internal parts.
-
-This is just to cover the ideas of the implemation, but documentation
-of the actual code, please see commends in the source code for that.
-
-@menu
-* Arla pioctl's:: Documentation of arla pioctl's
-* Disco with arla:: Disconnected mode
-* afsUUID:: afs UUID
-@c * NNPFS interface::
-@end menu
-
-@node Arla pioctl's, Disco with arla, Programming, Programming
-@comment node-name, next, previous, up
-
-@include pioctl.texi
-
-@node Disco with arla, afsUUID, Arla pioctl's, Programming
-@comment node-name, next, previous, up
-
-@include prog-disco.texi
-
-@node afsUUID, , Disco with arla, Programming
-@comment node-name, next, previous, up
-
-@chapter afsUUID
-
-@cindex afsUUID
-@cindex DCE UUID
-
-@code{AFS} uses a @code{DCE UUID} (Microsoft GUID is a another version
-of a DCE UUID) is identify file servers and callback managers. The
-callback manager regenerate its @code{uuid} every time it restarts.
-
-The fileserver stores its @code{uuid} on disk and uses it to identify
-it self when registering its addresses with the VLDB-server.
-
-The @code{afsUUID} is special in some implementations since it uses
-the ip-address as the node identifier instead of the mac-address (IEEE
-OUI + node address). Also the time in DCE is based on Unix epoch
-instead of DCE epoch. This will cause problems in about 287 years when
-the old generated afs UUID till start to collide with new genrated DCE
-UUIDs. Hopefully people have a solution to this problem then.
-
-@c
-@c I have a promise from Derrick that they will solve the problem before
-@c I die, Love
-@c
diff --git a/usr.sbin/afs/src/doc/real-world.texi b/usr.sbin/afs/src/doc/real-world.texi
deleted file mode 100644
index 8db1043888f..00000000000
--- a/usr.sbin/afs/src/doc/real-world.texi
+++ /dev/null
@@ -1,279 +0,0 @@
-@c Copyright (c) 2000, 2001 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-
-@c $arla: real-world.texi,v 1.11 2002/12/20 08:44:34 lha Exp $
-
-@node AFS and the real world, Parts of Arla, Organization of data, Top
-@comment node-name, next, previous, up
-
-@chapter AFS and the real world
-
-This chapter tries to describe problems that you see in the real (not
-that perfect) world and show possible solutions to these problems.
-
-@menu
-* NAT:: Truly evil stuff.
-* Samba:: Export AFS to Windows computers.
-* Integration with Kerberos:: How to integrate Kerberos with AFS.
-* Kerberos tickets and AFS tokens:: History and tools
-@end menu
-
-@node NAT, Samba, AFS and the real world, AFS and the real world
-@comment node-name, next, previous, up
-@section NAT
-
-@cindex NAT
-@cindex Masquerading
-@cindex PAT
-@cindex ALG
-There's something evil out there that's called NAT, which stands for
-Network Address Translation. For whatever reasons, people are using it
-and will continue doing so.
-
-First of all, it seemed like AFS should work just fine through NAT, you
-just appear to be coming from the NAT-address and some random port
-instead. Looking closer at different NAT implementations it seems like
-they have a rather short timeout:
-
-@table @samp
-@item FreeBSD natd
-60 seconds
-@item Cisco IOS
-300 seconds
-@item NetBSD ipf (ipnat)
-600 seconds
-@item Linux Nat (masq)
-300 seconds
-@end table
-
-If the client doesn't transmit any traffic to a particular host for that
-amount of time, it will get mapped to one of the IP address of the
-NAT-server (if you happen to run PAT, the port will be randomized too).
-
-The authors of Rx realized that keeping a Rx connection associated with
-(IP-address,port) pair was a bad idea. One example is that you get
-problems with multi-homed hosts. So Rx keeps its own connection id data in
-the packet. With this feature client and server should be able to detect
-address changes.
-
-Unfortunately, the use of the orignal Rx-code stops this from happening
-in Transarc/OpenAFS code. The code keeps track of incoming packets and
-keeps track of the right peer (client). But it never updates the
-IP-address,port pair in its data structure, so the answer packet will go
-to the old IP-address,port pair.
-
-If you can control your NAT machine you can have static mapping for
-your AFS hosts. Transarc/OpenAFS and Arla uses source port 7001 (Arla
-older then 0.36 uses source port 4711). You can also try to use
-Natkeep @url{http://mit.edu/zacheiss/www/natkeep/} if you run an old
-Arla or Transarc/OpenAFS client. Arla 0.36 and later have support for
-polling the servers at the right interval to prevent NAT from dropping
-information about your session.
-
-@node Samba, Integration with Kerberos, NAT, AFS and the real world
-@comment node-name, next, previous, up
-@section Samba
-
-@cindex Samba
-
-The major problem when exporting the AFS filespace read-write to SMB
-(Windows fileshareing) using Samba is the transfer of the user token to
-the smb-server. The simple may is to use clear-text password between the
-Windows client and the samba-server, and then to get tokens for the user
-with this password. This solution is clearly not acceptable for security
-aware AFS administrators.
-
-Describe here how to make AFS work "securely" with samba.
-
-On solution is to use @code{kimpersonate} + store afs key on
-fileserver (talk to Love).
-
-@node Integration with Kerberos, Kerberos tickets and AFS tokens, Samba, AFS and the real world
-@comment node-name, next, previous, up
-@section Integration with Kerberos
-
-@cindex ThisCell
-@cindex TheseCells
-@cindex KeyFile
-@cindex kaserver
-@cindex kerberosserver
-
-Kerberos 4 and 5 can be integrated quite well with AFS. This is mainly
-due to the fact that the security model used in AFS is Kerberos. The
-kaserver is a Kerberos 4 server with pre-authentication. The kaserver
-also provides a feature that limits the number of password retries, and
-after that you are locked out for half an hour. This feature can only be
-used in the ka interface as it requires pre-authentication, but since
-the kaserver provides a Kerberos 4 interface (without pre-authentication
-and without this limitation) it is quite worthless.
-
-Many sites indeed use a kerberosserver instead of a kaserver. One of
-the reasons is that they want to use Kerberos 5 (which is required
-for Windows 2000).
-
-To use a kerberosserver, you have to put the same key into the AFS
-KeyFile and the principal named afs of your kerberos realm. If you have
-a cell which has another name than lowercase of your realmname, the
-instance is the cellname. As the cellname often contains dots, this can
-be quite confusing in Kerberos 4: afs.stacken.kth.se@@STACKEN.KTH.SE. The
-first dot is the seperator between principal and instance, the other
-dots are part of the name. The simplest way to do create a KeyFile on
-your AFS server is to use heimdal's kadmin to generate and extract a
-KeyFile. It has an option designed to do so. Be aware that the serial
-number of the afs principal must match on all kerberos servers and
-all KeyFiles on all AFS servers.
-
-The default cellname to get a kerberos ticket for is contained in the
-configuration file @file{ThisCell}. If you got more than one cell, you
-want to list all cells to get tickets for in the @file{TheseCells} file.
-
-@comment Still more text here on KeyFile and TheseCells?
-
-@node Kerberos tickets and AFS tokens, , Integration with Kerberos, AFS and the real world
-@comment node-name, next, previous, up
-@section Kerberos tickets and AFS tokens
-
-@cindex Tickets
-@cindex Tokens
-@cindex kinit
-@cindex kauth
-@cindex afslog
-@cindex aklog
-@cindex klog
-@cindex kalog
-
-To further confuse the poor user, AFS and Kerberos programmers decided
-that they wanted to store their credentials at different places. In AFS,
-the kernel was a natural place to store the credentials (named token)
-since the CMU/Transarc AFS/OpenAFS implementation lives in the
-kernel. The Kerberos people on the other hand thought that storing the
-credentials (named ticket) in a file would be a good idea.
-
-So know you have to synchronize the credentials if you just want to
-enter your password once. There are several tools that can do that for
-you. The question is what tools to use for what problem.
-
-To add to the confusion not all tools talk to both Kerberos and
-kaservers. There is also a bogus user-id in the token that is supposed
-to be the same as your pts-user-id. Not that it makes any difference,
-but some people get confused when unknown numbers show up in the token.
-The easily confused people are often the ones that have more than one
-principal in the same realm/cell (read sysadmins).
-
-If you want to get your ticket from your Kerberos server, you use
-@code{kinit}, and then use @code{afslog} or @code{aklog} to get AFS
-tokens and push them to the kernel (and AFS daemon). Some @code{kinit}
-(and @code{kauth}) can do both for you, use @code{kinit --afslog} or
-simply @code{kauth}. Note that @code{kinit} and @code{kauth} don't
-get set your AFS-token user-id right, and thus can be confusing
-for people who think that this is important.
-
-The @code{klog} program that you get with Transarc/OpenAFS talks to the
-kaserver and behaves just-right in the sense that it talks to the pts
-server to get the AFS-token user-id right, but @code{klog} talks only to
-the kaserver which will not work for people with a Kerberos server.
-@code{Klog} in Arla was written by Chris Wing
-@email{wingc@@engin.umich.edu} as a part of a packet called
-@code{afsutils}, they did the right thing and talked to the pts-server
-to get the user-id. However, it uses Kerberos libs to talk to the
-server. These libraries require the files @file{/etc/krb.conf} and
-@file{/etc/krb.realms} to be setup correctly for their cell/realm. Not
-that easy.
-
-A long time ago Ken Hornstein @email{kenh@@cmf.nrl.navy.mil} wrote the
-AFS Migration Kit that helped you to migrate from AFS to MIT Kerberos 5.
-It included a tool named aklog that could convert a Kerberos tickets to
-tokens. This tool was also rewritten in Arla by Brandon S. Allbery
-@email{allbery@@ece.cmu.edu}. @code{aklog} can't get you new
-credentials, it just converts old ones to new ones.
-
-Then Transarc decided that they needed to fix a security hole in their
-kaserver, and while doing that, they managed to break a part in the
-kaserver so it ceased to work for kerberos requests.
-
-First the defect existed unnoticed for a long time, later Transarc has
-not managed to distribute a working version of the kaserver. Due to this,
-a lot of sites run a kaserver with this defect. Instead of installing
-working authentification servers from another sources, people started to
-whine again and Love @email{lha@@stacken.kth.se} wrote the tool
-@code{kalog} that talked the ka-protocol (but didn't do the AFS user-id
-right) to work around that problem.
-
-All tools that use Kerberos 4 need a working @file{/etc/krb.conf} and
-@file{/etc/krb.realms}. Kerberos 5 programs need @file{/etc/krb5.conf}.
-AFS aware tools need @file{/usr/arla/etc/CellServDB} or
-@file{/usr/vice/etc/CellServDB}.
-
-Also the Kerberos implementations from KTH (kth-krb and Heimdal) include
-AFS support to make your life more pleasant. One thing is that you can
-have a file @file{$HOME/.TheseCells} that lists the cells you use and the
-Kerberos tools will try to get tickes and tokens for those cells.
-Heimdal contains support for converting a Kerberos 4 srvtab to an AFS
-KeyFile.
-
-Below is a table that describes what tools does what, what
-inheritance(s) they have, and what protocol(s) they speak. From the
-inheritance (also in a table below) it is possible to deduct what
-configuration files the tools use.
-
-@multitable {Transarc/OpenAFS klog} {MIT Kerberos} {Kerberos} {Converts tickets}
-@item Tool
-@tab Inheritance
-@tab Protocol
-@tab Produces
-
-@item Transarc/OpenAFS klog
-@tab afs authlib
-@tab KA
-@tab Ticket and tokens
-
-@item Arla klog
-@tab Kerberos and libkafs
-@tab Kerberos
-@tab Ticket and tokens
-
-@item AFS Migration kit's aklog
-@tab MIT Kerberos and Ken Hornstein's afslib
-@tab Kerberos
-@tab Converts Kerberos tickets to tokens
-
-@item Arla's aklog
-@tab Kerberos and libkafs
-@tab Kerberos
-@tab Converts Kerberos tickets to tokens
-
-@item kth-krb's and Heimdal's afslog
-@tab Kerberos and libkafs
-@tab Kerberos
-@tab Converts Kerberos tickets to tokens
-
-@item kalog
-@tab arla and libkafs
-@tab KA
-@tab Get initial ticket, store tokens and tickets
-
-@end multitable
-
-Inheritance table
-
-@table @samp
-
-@item afs authlib
-Reads @file{CellServDB} and @file{ThisCell} in @file{/usr/vice/etc}
-
-@item Kerberos and libkafs
-Kerberos 4 uses @file{/etc/krb.conf} and
-@file{/etc/krb.realms}. Kerberos 5 uses @file{/etc/krb5.conf}.
-
-@item arla
-Arla uses @file{CellServDB} and @file{ThisCell} in @file{/usr/vice/etc}
-and @file{/usr/arla/etc}
-
-@item libkafs
-Libkafs uses DNS and @file{CellServDB} in @file{/usr/vice/etc} and
-@file{/usr/arla/etc} to figure out what ticket it should convert into
-tables. The file @file{TheseCells} and @file{$HOME/.TheseCells} is used
-to get extra tokens.
-
-@end table
diff --git a/usr.sbin/afs/src/doc/servers.texi b/usr.sbin/afs/src/doc/servers.texi
deleted file mode 100644
index 6588a9b5b7a..00000000000
--- a/usr.sbin/afs/src/doc/servers.texi
+++ /dev/null
@@ -1,50 +0,0 @@
-@c Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-
-@c $arla: servers.texi,v 1.10 2000/12/01 08:32:34 lha Exp $
-
-@c
-@c This file contain random junk that should be ordered some day
-@c
-
-
-@section YDR
-
-@cindex Ydr
-@cindex Rxgen
-
-@code{Ydr} is a rxgen replacement that is generating a lot more stuff
-then rxgen (like headerfiles). It also does the same thing in one run
-instead of three (rxgen does one run for ss.c cs.c and .h, and each time
-passes the whole data thru cpp).
-
-@code{Ydr} was created when there was no free rx package.
-
-Things to remeber about ydr and ydr generated code:
-
-@itemize @bullet
-
-@item When a server function is done out mashalling and writing out data
-it will free all data that contains VARRAYs. The functions you are
-intressed in is @code{generate_server_stub} and @code{genfree}.
-
-@item When a server functions fail (ie returns != 0), mashalling of
-out-data is not done, and out-data is not freed, instead rx_Error() is
-called with that error (See @code{generate_server_stub}.
-
-@item To use ydr (to describe when is codeing a struct or running ydr on
-a file) is called ydra.
-
-@end itemize
-
-
-@c Creations of a volume
-@c VOLSER_ListPartions
-@c VL_GetEntryByNameN -> VL_NOENT
-@c VOLSER_CreateVolume
-@c VOLSER_SetFlags
-@c VOLSER_EndTrans (rcode ignored ?)
-@c VL_CreateEntryN
-
-
diff --git a/usr.sbin/afs/src/doc/storage.texi b/usr.sbin/afs/src/doc/storage.texi
deleted file mode 100644
index d2a34fce45d..00000000000
--- a/usr.sbin/afs/src/doc/storage.texi
+++ /dev/null
@@ -1,218 +0,0 @@
-@c Copyright (c) 1998 - 2001 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-
-@c $arla: storage.texi,v 1.9 2003/04/24 11:50:42 lha Exp $
-
-@node Organization of data, AFS and the real world, AFS infrastructure, Top
-@comment node-name, next, previous, up
-
-@chapter Organization of data
-
-This chapter describes how data is stored and how AFS is different from,
-for example, NFS. It also describes how data is kept consistent and what
-the requirements were and how that inpacted on the design.
-
-@menu
-* Requirements::
-* Data organization::
-* Callbacks::
-* Volume management::
-* Relationship between pts uid and unix uid::
-@end menu
-
-@node Requirements, Data organization, Organization of data, Organization of data
-@comment node-name, next, previous, up
-@section Requirements
-
-@itemize @bullet
-@item Scalability
-
-It should be possible to use AFS with hundred-thousands of users without
-problems.
-
-Writes that are done to different parts of the filesystem should not
-affect each other. It should be possible to distribute out the reads and
-writes over many fileservers. If you have a file that is accessed by
-many clients, it should be possible to distribute the load.
-
-@comment What has this to do with requirements?
-@comment If there is multiple writes to the same file, are you sure that isn't a
-@comment database.
-
-@item Transparent to users
-
-Users should not need to know where their files are stored. It should be
-possible to move their files while they are using their files.
-
-@item Easy to admin
-
-It should be easy for a administrator to make changes to the
-filesystem. For example to change quota for a user or project. It should
-also be possible to move the users data for a fileserver to a less
-loaded one, or one with more diskspace available.
-
-Some benefits of using AFS are:
-
-@itemize @bullet
-@item user-transparent data migration
-@item an ability for on-line backups;
-@item data replication that provides both load balancing and robustness of
-critical data
-@item global name space without automounters and other add-ons;
-@item @@sys variables for platform-independent paths to binary location;
-@item enhanced security;
-@item client-side caching;
-@end itemize
-@end itemize
-
-@section Anti-requirements
-
-@itemize @bullet
-@item No databases
-
-AFS isn't constructed for storing databases. It would be possible to use
-AFS for storing a database if a layer above for locking and synchronizing
-data would be provided.
-
-One of the problems is that AFS doesn't include mandatory byte-range
-locks. AFS uses advisory locking on whole files.
-
-If you need a real database, use one, they are much more efficent on
-solving a database problem. Don't use AFS.
-
-@end itemize
-
-@node Data organization, Callbacks, Requirements, Organization of data
-@comment node-name, next, previous, up
-@section Volume
-
-A volume is a unit that is smaller than a partition. It is usually (or should
-be) a well defined area, like a user's home directory, a project work
-area, or a program distribution.
-
-Quota is controlled on volume-level. All day-to-day management is done
-on volumes.
-
-@section Partition
-
-In AFS a partition is what normally is named a partition. All partions
-that afs is using are named a special way, @file{/vicepNN}, where NN is
-ranged from a to z, continuing with aa to zz. The fileserver (and
-volser) automaticly picks upp all partitions starting with @file{/vicep}
-
-Volumes are stored in a partition. Volumes can't span several
-partitions. Partitions are added when the fileserver is created or when
-a new disk is added to a filesystem.
-
-@section Volume cloning and read-only clones
-
-A clone of a volume is often needed for volume operations. A clone is
-a copy-on-write copy of a volume, the clone is the read-only version.
-
-Two special versions of a clone are the read-only volume and the backup
-volume. The read-only volume is a snapshot of a read-write volume (that
-is what a clone is) that can be replicated to several fileservers to
-distribute the load. Each fileserver plus partition where a read-only
-clone is located is called a replication-site. It usually does not make
-sense to have more than one read-only clone on each fileserver.
-
-The backup volume is a clone that typically is made (with @code{vos
-backupsys}) each night to enable the user to retrieve yesterday's data
-when they happen to remove a file. This is a very useful feature, since
-it lessens the load on the system-administrators to restore files from
-backup. The volume is usually mounted in the root user's home directory
-under the name OldFiles. A special feature of the backup volume is that
-you can't follow mountpoints out of a backup volume.
-
-@section Mountpoints
-
-Volumes are independent of each other. To glue together the file tree
-there are @samp{mountpoint}s. Mountpoints are really symlinks that are
-formated in a special way so that they point out a volume and an
-optional cell. An AFS-cache-manager will show a mountpoint as directory
-and in fact it will be the root directory of the target volume.
-
-@node Callbacks, Volume management, Data organization, Organization of data
-@comment node-name, next, previous, up
-@section Callbacks
-
-Callbacks are messages that enable the AFS-cache-manager to keep the
-files without asking the server if there is newer version of the file.
-
-A callback is a promise from the fileserver that it will notify the
-client if the file (or directory) changes within the timelimit of the
-callback.
-
-For contents of read-only volumes there is only one callback per volume
-called a volume callback and it will be broken when the read-only volume
-is updated.
-
-The time range of callbacks is from 5 to 60 minutes depending on
-how many users of the file exist.
-
-@node Volume management, Relationship between pts uid and unix uid, Callbacks, Organization of data
-@comment node-name, next, previous, up
-@section Volume management
-
-All volume management is done with the @code{vos} command. To get a list
-of all commands @code{vos help} can be used. For help on a specific vos
-subcommand, @code{vos subcommand -h} can be used.
-
-@itemize @bullet
-@item Create
-
-@example
-vos create mim c HO.staff.lha.fluff -quota 400000
-@end example
-
-@item Move
-
-Volumes can be moved from a server to another, even when users are using
-the volume.
-
-@item Replicate
-
-Read-only volumes can be replicated over several servers, they are first
-added with @code{vos addsite}, and the replicated with @code{vos
-release} over the servers.
-
-@item Release
-
-When you want to distribute the changes in the readwrite volume to the
-read-only clones.
-
-@item Remove
-
-Volumes can be removed
-
-Note that you shouldn't remove the last readonly volume since this makes
-clients misbehave. If you are moving the volume you should rather add a
-new RO to the new server and then remove it from the old server.
-
-@item Backup and restoration of volumes.
-
-@code{vos backup} and @code{vos backupsys} creates the backup volume.
-
-To stream a volume out to a @file{file} or @file{stdout} you use
-@code{vos dump}. The opposite command is named @code{vos restore}.
-
-@end itemize
-
-@node Relationship between pts uid and unix uid, , Volume management, Organization of data
-@comment node-name, next, previous, up
-@section Relationship between pts uid and unix uid
-
-@cindex pts
-@cindex uid
-
-Files in AFS are created with the pts uid of the token that was valid at
-the time. The pts uid number is then by commands like @code{ls -l}
-interpreted as a unix uid and translated into a username. If the pts and
-the unix uids differ, this might confuse the user as it looks like as
-her files are owned by someone else. This is however not the case.
-Complications can occur if programs impose further access restrictions
-based on these wrongly interpreted uids instead of using the
-@code{access()} system call for that purpose. Graphical file browsers
-are typically prone to that problem with the effect that the users are
-not able to see their own files in these tools.
diff --git a/usr.sbin/afs/src/doc/timeline.texi b/usr.sbin/afs/src/doc/timeline.texi
deleted file mode 100644
index 080e266ef55..00000000000
--- a/usr.sbin/afs/src/doc/timeline.texi
+++ /dev/null
@@ -1,101 +0,0 @@
-@c Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-
-@c $arla: timeline.texi,v 1.13 2003/02/01 17:15:00 lha Exp $
-
-@node Arla timeline, Authors, Oddities, Top
-@comment node-name, next, previous, up
-@chapter Arla timeline
-
-Arla have existed for quite some years.
-
-Development started in fall 1993 by Björn Grönvall
-@email{bg@@nada.kth.se} (with an rxkad implantation), he had a working
-read-only implementation in winter 1994. Quick followers was Assar
-@email{assar@@sics.se} (at that time @email{assar@@pdc.kth.se>}) and
-Johan Danielsson <@email{joda@@pdc.kth.se}>. The platform that was
-chosen was Sparc SunOS4 (the OS that NADA, KTH was using).
-
-Some work was being done by Patrik Stymne @email{patriks@@e.kth.se} in
-porting arla to Ultrix, but this work was never finished.
-
-At this time there was no free rx, lwp or rxkad. A basic rx
-implementation was written, and the threading problem was solved by
-using pthreads.
-
-The Arla development started to slow down around 11 April 1995.
-
-In about Mar-Jun 1996 rx and lwp was released by Transarc, this was made
-possible by Jim Doyle @email{jrd@@bu.edu}, and Derrick J. Brashear
-@email{shadow@@dementia.org}.
-
-In September 1997, an rxkad implementation was written by Björn. At
-the same time, a need for an AFS client for OpenBSD rose at the
-Stacken, the local computer club at KTH. Other free OS:es, as NetBSD,
-FreeBSD and Linux(primarily sparc) were also in need of AFS clients.
-
-In TokKOM, a local communications system using LysKOM
-(@url{http://www.lysator.liu.se/lyskom/}), Assar suggested to some club
-members that it would be a nice thing to resume the arla
-development.
-
-Some people suggested that it would be less trouble having someone with
-access to the Transarc AFS source code port the code to the relevent
-platforms. Assar then ported xfs to FreeBSD 2.2.x in notime (over the
-night), just to show the high portability.
-
-People started to understand that arla was a concept that would work,
-and first out was Love Hörnqvist-Åstrand @email{lha@@stacken.kth.se} to
-join. Development was primarily aimed at OpenBSD and NetBSD at the
-moment, and Arla lived for at least 2-3 weeks in /var/tmp on a host
-named yakko.stacken.kth.se.
-
-Magnus Ahltorp @email{map@@stacken.kth.se} joined shortly thereafter,
-spending the rest of the year reading about the Linux VFS, and after a
-while, Artur Grabowski @email{art@@stacken.kth.se} also started to work
-on arla, concentrating on OpenBSD kernel stuff.
-
-The first entry in ChangeLog is dated Fri Oct 24 17:20:40 1997. Around
-this time arla was given a CVS tree, to ease development. Now you
-could also mount the xfs-device and get the root-directory out of it.
-
-The Linux port was done in a few weeks in the beginning of 1998. Only
-the Linux 2.0 kernel was supported at this time.
-
-In April 1998 Assar hade a Arla paper presented at Freenix. Linux 2.1
-support was written also written around this time. This was a major
-work since there was a lot of stuff that had changed (namely the
-dcache).
-
-The first milko entry is dated Thu Oct 30 01:46:51 1997. Note that
-this milko in a sense "worked". You could get files out from it and
-store them.
-
-There was from this point a lot of work being done and quite a lot of
-studies was "wasted". We learned a lot, but not the stuff we were
-expected to.
-
-We added support for `dynroot' and `fake-mp' to prepare for Windows and
-Darwin/MacOSX support.
-
-Rhapsody xfs port was contributed by Alexandra Ellwood @email{lxs@@MIT.EDU}
-Later, Rhapsody was renamed Darwin.
-
-In Mars 2000 preliminary support for MacOS X/Darwin 1.0 was merged in
-by Magnus and Assar.
-
-Around the same time there we hacked in support for Solaris 8 (beta2)
-There was also some work being done on Windows 2000 native driver at
-same time.
-
-In June 2000 there was a presentation on MADE2000 in Gothenburg, Sweden.
-
-In September 2000 MacOS X Beta was working.
-
-In March 2001 Incremental open code stable for some platforms
-
-In September 2001 xfs was renamed to nnpfs.
-
-This just includes some milestones, for more information se
-Changelog.* and NEWS files in the distribution.
diff --git a/usr.sbin/afs/src/doc/tools.texi b/usr.sbin/afs/src/doc/tools.texi
deleted file mode 100644
index 8f569dcfe90..00000000000
--- a/usr.sbin/afs/src/doc/tools.texi
+++ /dev/null
@@ -1,30 +0,0 @@
-@c Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
-@c (Royal Institute of Technology, Stockholm, Sweden).
-@c All rights reserved.
-
-@c $arla: tools.texi,v 1.4 2000/10/03 01:10:33 lha Exp $
-
-@node Rx protocol, LWP, , Tools and libs
-@section Rx protocol
-
-@c XXX History of RX
-
-Rx is run over UDP.
-
-One of rxgen or ydr is used to generate stub-files, ydr is better since
-it generates prototypes, too.
-
-The current implemetation of rx it not that beautiful.
-
-@node LWP, , Rx protocol, Tools and libs
-@section LWP
-
-@c XXX History of LWP
-
-LWP is a preepmtive thread package. It does it's context-switching by
-creating a private stack for each thread. The heart of the package is
-select(2).
-
-The stack is checked for overruns in context-switches, but that is often
-too late. It might be an idea to add a @cite{red zone} at the top of the
-stack to be able to detect overruns.
diff --git a/usr.sbin/afs/src/doc/xfs.txt b/usr.sbin/afs/src/doc/xfs.txt
deleted file mode 100644
index 90bd248e0cc..00000000000
--- a/usr.sbin/afs/src/doc/xfs.txt
+++ /dev/null
@@ -1,380 +0,0 @@
-
-XFS DOCUMENTATION
-=================
-
-$KTH: xfs.txt,v 1.5 2000/06/06 15:21:12 lha Exp $
-
-This is not the truth, but close too.
-
-
-TODO
-#include <xfs/xfs_attr.h>
-
-
-LIMITATIONS and CONSTANTS
-=========================
-
-You can install messages to xfs of maxsize ``MAX_XMSG_SIZE''.
-
-The kernel can at most hold rights of size ``MAXRIGHTS''.
-
-A xfs handle have the size of ``MAXHANDLE'', and that is at least 16bytes.
-
-The annonous user had id ``XFS_ANONYMOUSID''.
-
-The xfs-fh-open-handle have the size of ``CACHEHANDLESIZE'', and its
-a opaque data-structure.
-
-PAGS
-====
-
-Pags are a hack to separate processes of same UID to make them have
-diffrent access-rights. Pags are saved over setuid(2)/initgroups(2)
-calls. Xfs uses a struct ``xfs_cred'' to pass over the UID and the pag.
-
-
-TOKENS
-======
-
-Tokens are the rights the xfs have on the node and what parts of the
-node that is valid.
-
-XXX Insert descriptions of tokens here....
-
-
-MESSAGES
-========
-
-Are passed through the xfs device somehow.
-
-Each message is prepended by a header including the 32-bit fields
-`size'', ``opcode'', ``sequence_num'', ``pad1'' (in that
-order). ``Size'' is the size of the WHOLE message. ``Opcode'' is the
-opcode (described below). ``sequence_num'' is a messages specific field
-that is used for replying the the sender of the message (if so is
-needed).
-
-All messages (and the xfs_header) are padded to 64-bit boundery to
-avoid bit unaligned data in the kernel. The padding is called padN,
-where N is a number.
-
-Note that the total size of the message may be larger then one message,
-them its two or more message pasted together for preformance resons.
-
-The opcode has a value from 0 (zero) to XFS_MSG_COUNT - 1.
-
-The following opcodes are defined:
-
-XFS_MSG_VERSION (userland)
-
- Used probe the kernelmodule to check some *basic* things that will change
- the behavior of the userland module.
-
- For each question XFS_MSG_VERSION can return XFS_VERSION_YES
- or XFS_VERSION_NO.
-
- If VERSION returns something else then XFS_VERSION_YES to
- XFS_MSG_VERSION, its not supported.
-
- ``probe'' is set to a query.
-
- Queries that exist today is:
- XFS_VERSION_VERSION - check if we have XFS_VERSION supporta
- XFS_VERSION_FHGET - have we fhget support, or do we use pathnames
- XFS_VERSION_FHGET_NATIVE- native fhget (not xfs-version ?)
- XFS_VERSION_GC_NODES - we have gc-nodes xfs-call ?
-
-XFS_MSG_WAKEUP (userland|xfs)
-
- Wakeup query ``sleepers_sequence_num'' with ``error'' (that is a
- errno or userdefined error).
-
- It may be called from both userland and the xfs-implementation.
-
-XFS_MSG_GETROOT (xfs)
-
- GETROOT is called to get the root-node with the ``cred''
-
- Its only called from xfs to get the root-node, this might be
- serveral times per mount depending on filesystem.
-
- Xfs is wake-up:ed by a XFS_MSG_WAKEUP message from userland
- after a XFS_MSG_INSTALLROOT message has been sent or and error-code is
- passed to the kernel with the wakeup-message.
-
-XFS_MSG_INSTALLROOT (userland)
-
- INSTALLROOT is called insert a root.
-
- INSTALLROOT MUST only be called on the request of GETROOT.
-
- The node to install is in ``node''.
-
- The only returnvalue of the message is the integer return value.
-
- Multiple INSTALLROOT must be ignored by the xfs-implementation, and
- the returnvalue EBUSY MUST be returned.
-
-XFS_MSG_GETNODE (xfs)
-
- GETNODE is called to get the node named ``named'' in the
- directory ``parent_handle'' with ``cred''.
-
- While there is no error in the returning WAKEUP call and there
- is corresponding node in cache the xfs-implemetation should
- loop until there is an error.
-
-XFS_MSG_INSTALLNODE (userland)
-
- Insert the ``node'' of ``name'' in the directory ``parent_handle''
- into the cache.
-
- The userland MUST NOT install the ``node'' yet onther time
-
- The xfs-implemetation SHOULD NOT install same node several
- times in the same ``parent_handle'', that is if ``node'' has
- same parent and same name (observe that same handle can be
- installed several times in the case of hardlinks).
-
-XFS_MSG_GETATTR (xfs)
-
- Get the attributes for the node described by ``handle'' that
- already have been installed by INSTALLNODE with the ``cred''.
-
- The xfs-implemetation should loop until there is an error,
- or the node is the cache with appropriate pag in the cred
- part of the node.
-
-XFS_MSG_INSTALLATTR (userland)
-
- Should update the preinstalled incache data with ``node''. If
- the node found in ``node.handle'' isn't in the cache the
- xfs-implementation MUST return 0 and MIGHT print a
- debug-message. Note that this isn't error if the node isn't in
- the xfs-cache since it might have fallen out before the
- message was sent to xfs (that is, the invalidnode message is
- still in the queue to userland).
-
-XFS_MSG_GETDATA (xfs)
-
- Get data for the node described in ``handle''. Otherwise same
- as GETATTR.
-
-XFS_MSG_INSTALLDATA (userland)
-
- Install data for the node described by ``node.handle''. The
- vnode/inode that contains the is pointed out by ``cache_handle''
- the there is support for openfh/getfh. Its also pointed out
- by the name ``cache_name'', and that name is relative to the
- current process current working directory.
-
- Installdata also updates the attributes of the node.
-
- If the ``flag & XFS_ID_INVALID_DNLC'' is set the
- xfs-implementation should flush all namecache related to this
- node. The xfs-implementation SHOULD check that this is a
- directory-node.
-
-XFS_MSG_INACTIVENODE (xfs)
-
- The message that xfs sends to the userland daemon when
- ``handle'' no longer exist in the cache.
-
- To tell what state the node is in flag in set to appropiate
- value. ``XFS_NOREFS'' tells the userland daemon that the xfs
- still have the node cached but nothing is using it and it can
- be removed at any time. ``XFS_DELETE'' mean that all this node
- has been droped from the cache and can't be used anymore.
-
-XFS_MSG_INVALIDNODE (userland)
-
- Used to hint the kernel that node described by `handle''
- should be droped from the cache. Doesn't mean that the node
- should be killed off, just that it should be that when it's no
- longer used.
-
- The userland MUST NOT remove the node from the cache until it
- receives a XFS_MSG_INACTIVENODE.
-
- XXX what is the diffrence to GC_NODE
-
-XFS_MSG_OPEN (xfs)
-
- Passed up to the userland to inform that ``handle'' has been
- opened with ``cred'' to do what is decribed in ``tokens''.
-
- Can be the same as XFS_MSG_GETDATA if no locking is implemeted.
-
-XFS_MSG_PUTDATA (xfs)
-
-enum { XFS_READ = 1, XFS_WRITE = 2, XFS_NONBLOCK = 4, XFS_APPEND = 8};
-
-XFS_MSG_PUTATTR (xfs)
-
-/* Directory manipulating messages. */
-XFS_MSG_CREATE (xfs)
-XFS_MSG_MKDIR (xfs)
-XFS_MSG_LINK (xfs)
-XFS_MSG_SYMLINK (xfs)
-
-XFS_MSG_REMOVE (xfs)
-XFS_MSG_RMDIR (xfs)
-
-XFS_MSG_RENAME (xfs)
-
-XFS_MSG_PIOCTL (xfs)
-XFS_MSG_WAKEUP_DATA (userland)
-
-XFS_MSG_UPDATEFID (userland)
-
-XFS_MSG_ADVLOCK (xfs/userland)
-
-XFS_MSG_GC_NODES (userland)
-
-
-__END__;
-
-/* XFS_MSG_OPEN */
-struct xfs_message_open {
- struct xfs_message_header header;
- struct xfs_cred cred;
- xfs_handle handle;
- u_int32_t tokens;
- u_int32_t pad1;
-};
-
-/* XFS_MSG_PUTDATA */
-struct xfs_message_putdata {
- struct xfs_message_header header;
- xfs_handle handle;
- struct xfs_attr attr; /* XXX ??? */
- struct xfs_cred cred;
- u_int32_t flag;
- u_int32_t pad1;
-};
-
-/* XFS_MSG_PUTATTR */
-struct xfs_message_putattr {
- struct xfs_message_header header;
- xfs_handle handle;
- struct xfs_attr attr;
- struct xfs_cred cred;
-};
-
-/* XFS_MSG_CREATE */
-struct xfs_message_create {
- struct xfs_message_header header;
- xfs_handle parent_handle;
- char name[256]; /* XXX */
- struct xfs_attr attr;
- u_int32_t mode;
- u_int32_t pad1;
- struct xfs_cred cred;
-};
-
-/* XFS_MSG_MKDIR */
-struct xfs_message_mkdir {
- struct xfs_message_header header;
- xfs_handle parent_handle;
- char name[256]; /* XXX */
- struct xfs_attr attr;
- struct xfs_cred cred;
-};
-
-/* XFS_MSG_LINK */
-struct xfs_message_link {
- struct xfs_message_header header;
- xfs_handle parent_handle;
- char name[256]; /* XXX */
- xfs_handle from_handle;
- struct xfs_cred cred;
-};
-
-/* XFS_MSG_SYMLINK */
-struct xfs_message_symlink {
- struct xfs_message_header header;
- xfs_handle parent_handle;
- char name[256]; /* XXX */
- char contents[2048]; /* XXX */
- struct xfs_attr attr;
- struct xfs_cred cred;
-};
-
-/* XFS_MSG_REMOVE */
-struct xfs_message_remove {
- struct xfs_message_header header;
- xfs_handle parent_handle;
- char name[256]; /* XXX */
- struct xfs_cred cred;
-};
-
-/* XFS_MSG_RMDIR */
-struct xfs_message_rmdir {
- struct xfs_message_header header;
- xfs_handle parent_handle;
- char name[256]; /* XXX */
- struct xfs_cred cred;
-};
-
-/* XFS_MSG_RENAME */
-struct xfs_message_rename {
- struct xfs_message_header header;
- xfs_handle old_parent_handle;
- char old_name[256]; /* XXX */
- xfs_handle new_parent_handle;
- char new_name[256]; /* XXX */
- struct xfs_cred cred;
-};
-
-/* XFS_MSG_PIOCTL */
-struct xfs_message_pioctl {
- struct xfs_message_header header;
- u_int32_t opcode ;
- u_int32_t pad1;
- xfs_cred cred;
- u_int32_t insize;
- u_int32_t outsize;
- char msg[2048] ; /* XXX */
- xfs_handle handle;
-};
-
-
-/* XFS_MESSAGE_WAKEUP_DATA */
-struct xfs_message_wakeup_data {
- struct xfs_message_header header;
- u_int32_t sleepers_sequence_num; /* Where to send wakeup */
- u_int32_t error; /* Return value */
- u_int32_t len;
- u_int32_t pad1;
- char msg[2048] ; /* XXX */
-};
-
-/* XFS_MESSAGE_UPDATEFID */
-struct xfs_message_updatefid {
- struct xfs_message_header header;
- xfs_handle old_handle;
- xfs_handle new_handle;
-};
-
-/* XFS_MESSAGE_ADVLOCK */
-struct xfs_message_advlock {
- struct xfs_message_header header;
- xfs_handle handle;
- struct xfs_cred cred;
- xfs_locktype_t locktype;
-#define XFS_WR_LOCK 1 /* Write lock */
-#define XFS_RD_LOCK 2 /* Read lock */
-#define XFS_UN_LOCK 3 /* Unlock */
-#define XFS_BR_LOCK 4 /* Break lock (inform that we don't want the lock) */
- xfs_lockid_t lockid;
-};
-
-/* XFS_MESSAGE_GC_NODES */
-struct xfs_message_gc_nodes {
- struct xfs_message_header header;
-#define XFS_GC_NODES_MAX_HANDLE 50
- u_int32_t len;
- u_int32_t pad1;
- xfs_handle handle[XFS_GC_NODES_MAX_HANDLE];
-};
-#endif /* _xmsg_h */
diff --git a/usr.sbin/afs/src/include/.cvsignore b/usr.sbin/afs/src/include/.cvsignore
deleted file mode 100644
index 2a9005dc419..00000000000
--- a/usr.sbin/afs/src/include/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-config.h.in
diff --git a/usr.sbin/afs/src/include/Makefile.in b/usr.sbin/afs/src/include/Makefile.in
deleted file mode 100644
index 55ca01db072..00000000000
--- a/usr.sbin/afs/src/include/Makefile.in
+++ /dev/null
@@ -1,139 +0,0 @@
-# $KTH: Makefile.in,v 1.50 2000/12/21 12:46:09 lha Exp $
-
-srcdir = @srcdir@
-top_builddir = ..
-VPATH = @srcdir@
-
-SHELL = /bin/sh
-
-CC = @CC@
-DEFS = @DEFS@ -DHOST=\"@CANONICAL_HOST@\"
-CFLAGS = @CFLAGS@ $(DEFS) -I. -I$(srcdir)
-
-LN_S = @LN_S@
-RM_F = rm -f
-MKDIR = mkdir
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-includedir = @includedir@
-
-ROKEN_H = @ROKEN_H@
-
-LOCL_HEADERS = $(ROKEN_H) ko.h sl.h part.h list.h \
- bool.h log.h \
- hash.h \
- lwp.h lock.h getarg.h err.h parse_units.h \
- resolve.h rxkad.h service.h mmaptime.h ports.h \
- heap.h fbuf.h fdir.h afs_dir.h parse_time.h parse_bytes.h \
- acl.h agetarg.h
-
-BUILDHEADERS = atypes.h fs_errors.h
-
-HEADERS = $(BUILDHEADERS)
-
-LIBS = @LIBS@
-
-BITS_OBJECTS = bits.o
-
-SOURCES = bits.c
-
-all: $(LOCL_HEADERS) $(HEADERS)
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(includedir)
- for x in $(HEADERS); \
- do \
- b=`basename $$x`; \
- if test -f $$b; then \
- $(INSTALL_DATA) $$b $(DESTDIR)$(includedir)/$$b; \
- else \
- $(INSTALL_DATA) $(srcdir)/$$b $(DESTDIR)$(includedir)/$$b; \
- fi; \
- done
-
-uninstall:
- for x in $(HEADERS); do \
- $(RM_F) $(DESTDIR)$(includedir)/$$x; \
- done
-
-bits: $(BITS_OBJECTS)
- $(CC) -o $@ $(BITS_OBJECTS) $(LIBS)
-
-bits.o: bits.c
-
-atypes.h: bits
- ./bits $@
-
-clean:
- rm -f bits *.o $(BUILDHEADERS) $(LOCL_HEADERS)
-
-distclean: clean
- rm -f Makefile
-
-Makefile: Makefile.in ../config.status
- cd ..; CONFIG_FILES=include/Makefile CONFIG_HEADERS= ./config.status
-
-roken.h:
- $(LN_S) $(srcdir)/../lib/roken/roken.h .
-sl.h:
- $(LN_S) $(srcdir)/../lib/sl/sl.h .
-ko.h:
- $(LN_S) $(srcdir)/../lib/ko/ko.h .
-part.h:
- $(LN_S) $(srcdir)/../lib/ko/part.h .
-ports.h:
- $(LN_S) $(srcdir)/../lib/ko/ports.h .
-agetarg.h:
- $(LN_S) $(srcdir)/../lib/ko/agetarg.h .
-atom.h:
- $(LN_S) $(srcdir)/../util/atom.h .
-list.h:
- $(LN_S) $(srcdir)/../util/list.h .
-bool.h:
- $(LN_S) $(srcdir)/../util/bool.h .
-log.h:
- $(LN_S) $(srcdir)/../util/log.h .
-hash.h:
- $(LN_S) $(srcdir)/../util/hash.h .
-mmaptime.h:
- $(LN_S) $(srcdir)/../util/mmaptime.h .
-lock.h:
- $(LN_S) $(srcdir)/../lwp/lock.h .
-lwp.h:
- $(LN_S) $(srcdir)/../lwp/@LWP_H@ ./lwp.h
-getarg.h:
- $(LN_S) $(srcdir)/../lib/roken/getarg.h .
-parse_units.h:
- $(LN_S) $(srcdir)/../lib/roken/parse_units.h .
-err.h:
- $(LN_S) $(srcdir)/../lib/roken/err.h .
-resolve.h:
- $(LN_S) $(srcdir)/../lib/roken/resolve.h .
-parse_time.h:
- $(LN_S) $(srcdir)/../lib/roken/parse_time.h .
-parse_bytes.h:
- $(LN_S) $(srcdir)/../lib/roken/parse_bytes.h .
-rxkad.h:
- $(LN_S) $(srcdir)/../rxkad/rxkad.h .
-service.h:
- $(LN_S) $(srcdir)/../arlad/service.h .
-heap.h:
- $(LN_S) $(srcdir)/../util/heap.h .
-fs_errors.h:
- $(LN_S) $(srcdir)/../arlad/fs_errors.h .
-fbuf.h:
- $(LN_S) $(srcdir)/../lib/bufdir/fbuf.h .
-fdir.h:
- $(LN_S) $(srcdir)/../lib/bufdir/fdir.h .
-afs_dir.h:
- $(LN_S) $(srcdir)/../lib/bufdir/afs_dir.h .
-acl.h:
- $(LN_S) $(srcdir)/../lib/acl/acl.h .
-
-.PHONY: all install uninstall clean distclean
diff --git a/usr.sbin/afs/src/include/afssysdefs.h b/usr.sbin/afs/src/include/afssysdefs.h
deleted file mode 100644
index 9308a69ede8..00000000000
--- a/usr.sbin/afs/src/include/afssysdefs.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: afssysdefs.h,v 1.7 2003/04/03 20:02:49 lha Exp $ */
-
-/*
- * This section is for machines using single entry point AFS syscalls!
- * and/or
- * This section is for machines using multiple entry point AFS syscalls!
- *
- * SunOS 4 is an example of single entry point and sgi of multiple
- * entry point syscalls.
- */
-
-#if SunOS == 40
-#define AFS_SYSCALL 31
-#endif
-
-#if SunOS >= 50 && SunOS < 57
-#define AFS_SYSCALL 105
-#endif
-
-#if SunOS >= 57
-#define AFS_SYSCALL 73
-#endif
-
-#if SunOS >= 58
-#define AFS_SYSCALL 65
-#endif
-
-#if defined(__hpux)
-#define AFS_SYSCALL 50
-#define AFS_SYSCALL2 49
-#define AFS_SYSCALL3 48
-#endif
-
-#if defined(_AIX)
-/* _AIX is too weird */
-#endif
-
-#if defined(__sgi)
-#define AFS_PIOCTL (64+1000)
-#define AFS_SETPAG (65+1000)
-#endif
-
-#if defined(__osf__)
-#define AFS_SYSCALL 232
-#define AFS_SYSCALL2 258
-#endif
-
-#if defined(__ultrix)
-#define AFS_SYSCALL 31
-#endif
-
-#if defined(__NetBSD__)
-#define AFS_SYSCALL 210
-#endif
-
-#if defined(__FreeBSD__)
-#if __FreeBSD_version >= 500000
-#define AFS_SYSCALL 339
-#else
-#define AFS_SYSCALL 210
-#endif
-#endif /* __FreeBSD__ */
-
-#if defined(__OpenBSD__)
-#define AFS_SYSCALL 208
-#endif
-
-#ifdef __APPLE__ /* MacOS X */
-#define AFS_SYSCALL 230
-#endif
-
-#ifdef SYS_afs_syscall
-#define AFS_SYSCALL3 SYS_afs_syscall
-#endif
diff --git a/usr.sbin/afs/src/include/arla-version.h b/usr.sbin/afs/src/include/arla-version.h
deleted file mode 100644
index e464cf1f443..00000000000
--- a/usr.sbin/afs/src/include/arla-version.h
+++ /dev/null
@@ -1,2 +0,0 @@
-char *arla_long_version = "@(#)$Version: arla-0.35pre by art on kurrent (sparc-unknown-openbsd2.8) Mon Aug 28 16:19:29 CEST 2000 $";
-char *arla_version = "arla-0.35pre";
diff --git a/usr.sbin/afs/src/include/bits.c b/usr.sbin/afs/src/include/bits.c
deleted file mode 100644
index 96a2f515317..00000000000
--- a/usr.sbin/afs/src/include/bits.c
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Kungliga Tekniska
- * Högskolan and its contributors.
- *
- * 4. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: bits.c,v 1.7 2002/02/07 17:59:15 lha Exp $");
-#endif
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#ifndef HAVE_STRUPR
-static void
-strupr(char *s)
-{
- unsigned char *p = (unsigned char *)s;
- while(*p){
- if(islower(*p))
- *p = toupper(*p);
- p++;
- }
-}
-#endif
-
-#define BITSIZE(TYPE) \
-{ \
- int b = 0; TYPE x = 1, zero = 0; char *pre = "u"; \
- char tmp[128], tmp2[128]; \
- while(x){ x <<= 1; b++; if(x < zero) pre=""; } \
- if(b >= len){ \
- int tabs; \
- snprintf(tmp, sizeof(tmp), "%sint%d_t" , pre, len); \
- snprintf(tmp2, sizeof(tmp2), "typedef %s %s;", #TYPE, tmp); \
- strupr(tmp); \
- tabs = 5 - strlen(tmp2) / 8; \
- fprintf(f, "%s", tmp2); \
- while(tabs-- > 0) fprintf(f, "\t"); \
- fprintf(f, "/* %2d bits */\n", b); \
- return; \
- } \
-}
-
-#ifndef HAVE___ATTRIBUTE__
-#define __attribute__(x)
-#endif
-
-static void __attribute__ ((unused))
-try_signed(FILE *f, int len)
-{
- BITSIZE(signed char);
- BITSIZE(short);
- BITSIZE(int);
- BITSIZE(long);
-#ifdef HAVE_LONG_LONG
- BITSIZE(long long);
-#endif
- fprintf(f, "/* There is no %d bit type */\n", len);
-}
-
-static void __attribute__ ((unused))
-try_unsigned(FILE *f, int len)
-{
- BITSIZE(unsigned char);
- BITSIZE(unsigned short);
- BITSIZE(unsigned int);
- BITSIZE(unsigned long);
-#ifdef HAVE_LONG_LONG
- BITSIZE(unsigned long long);
-#endif
- fprintf(f, "/* There is no %d bit type */\n", len);
-}
-
-static int __attribute__ ((unused))
-print_bt(FILE *f, int flag)
-{
- if(flag == 0){
- fprintf(f, "/* For compatibility with various type definitions */\n");
- fprintf(f, "#ifndef __BIT_TYPES_DEFINED__\n");
- fprintf(f, "#define __BIT_TYPES_DEFINED__\n");
- fprintf(f, "\n");
- }
- return 1;
-}
-
-int main(int argc, char **argv)
-{
- FILE *f;
- int flag;
- char *fn, *hb;
-
- if(argc < 2){
- fn = "bits.h";
- hb = "__BITS_H__";
- f = stdout;
- } else {
- char *p;
- fn = argv[1];
- asprintf(&hb, "__%s__", fn);
- for(p = hb; *p; p++){
- if(!isalnum((int)*p))
- *p = '_';
- }
- f = fopen(argv[1], "w");
- }
- fprintf(f, "/* %s -- this file was generated for %s by\n", fn, HOST);
- fprintf(f, " %*s %s */\n\n", strlen(fn), "",
- "$arla: bits.c,v 1.7 2002/02/07 17:59:15 lha Exp $");
- fprintf(f, "#ifndef %s\n", hb);
- fprintf(f, "#define %s\n", hb);
- fprintf(f, "\n");
-#ifdef HAVE_SYS_TYPES_H
- fprintf(f, "#include <sys/types.h>\n");
-#endif
-#ifdef HAVE_STDINT_H
- fprintf(f, "#include <stdint.h>\n");
-#endif
-#ifdef HAVE_SYS_BITYPES_H
- fprintf(f, "#include <sys/bitypes.h>\n");
-#endif
-#ifdef HAVE_NETINET_IN6_MACHTYPES_H
- fprintf(f, "#include <netinet/in6_machtypes.h>\n");
-#endif
-#ifdef HAVE_KTYPES_H
- fprintf(f, "#include <ktypes.h>\n");
-#endif
- fprintf(f, "\n");
-
- flag = 0;
-#ifndef HAVE_INT8_T
- flag = print_bt(f, flag);
- try_signed (f, 8);
-#endif /* HAVE_INT8_T */
-#ifndef HAVE_INT16_T
- flag = print_bt(f, flag);
- try_signed (f, 16);
-#endif /* HAVE_INT16_T */
-#ifndef HAVE_INT32_T
- flag = print_bt(f, flag);
- try_signed (f, 32);
-#endif /* HAVE_INT32_T */
-#if 0
-#ifndef HAVE_INT64_T
- flag = print_bt(f, flag);
- try_signed (f, 64);
-#endif /* HAVE_INT64_T */
-#endif
-
-#ifndef HAVE_UINT8_T
- flag = print_bt(f, flag);
- try_unsigned (f, 8);
-#endif /* HAVE_INT8_T */
-#ifndef HAVE_UINT16_T
- flag = print_bt(f, flag);
- try_unsigned (f, 16);
-#endif /* HAVE_UINT16_T */
-#ifndef HAVE_UINT32_T
- flag = print_bt(f, flag);
- try_unsigned (f, 32);
-#endif /* HAVE_UINT32_T */
-#if 0
-#ifndef HAVE_UINT64_T
- flag = print_bt(f, flag);
- try_unsigned (f, 64);
-#endif /* HAVE_UINT64_T */
-#endif
-
- if(flag){
- fprintf(f, "\n");
- fprintf(f, "#endif /* __BIT_TYPES_DEFINED__ */\n\n");
- }
- fprintf(f, "#endif /* %s */\n", hb);
- return 0;
-}
diff --git a/usr.sbin/afs/src/include/config.h b/usr.sbin/afs/src/include/config.h
deleted file mode 100644
index 28f7a7f56ea..00000000000
--- a/usr.sbin/afs/src/include/config.h
+++ /dev/null
@@ -1,1074 +0,0 @@
-/* include/config.h. Generated automatically by configure. */
-/* include/config.h.in. Generated automatically from configure.in by autoheader. */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define if you have a working `mmap' system call. */
-#define HAVE_MMAP 1
-
-/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define if you can safely include both <sys/time.h> and <time.h>. */
-#define TIME_WITH_SYS_TIME 1
-
-/* Define if the X Window System is missing or not being used. */
-/* #undef X_DISPLAY_MISSING */
-
-/* Define if you have the asnprintf function. */
-/* #undef HAVE_ASNPRINTF */
-
-/* Define if you have the asprintf function. */
-#define HAVE_ASPRINTF 1
-
-/* Define if you have the bool function. */
-/* #undef HAVE_BOOL */
-
-/* Define if you have the chown function. */
-#define HAVE_CHOWN 1
-
-/* Define if you have the daemon function. */
-#define HAVE_DAEMON 1
-
-/* Define if you have the dn_expand function. */
-#define HAVE_DN_EXPAND 1
-
-/* Define if you have the el_init function. */
-/* #undef HAVE_EL_INIT */
-
-/* Define if you have the err function. */
-#define HAVE_ERR 1
-
-/* Define if you have the errx function. */
-#define HAVE_ERRX 1
-
-/* Define if you have the fchown function. */
-#define HAVE_FCHOWN 1
-
-/* Define if you have the fcntl function. */
-#define HAVE_FCNTL 1
-
-/* Define if you have the fhopen function. */
-#define HAVE_FHOPEN 1
-
-/* Define if you have the flock function. */
-#define HAVE_FLOCK 1
-
-/* Define if you have the getcwd function. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the getdtablesize function. */
-#define HAVE_GETDTABLESIZE 1
-
-/* Define if you have the getfh function. */
-#define HAVE_GETFH 1
-
-/* Define if you have the gethostbyname function. */
-#define HAVE_GETHOSTBYNAME 1
-
-/* Define if you have the getitimer function. */
-#define HAVE_GETITIMER 1
-
-/* Define if you have the getopt function. */
-#define HAVE_GETOPT 1
-
-/* Define if you have the getpagesize function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define if you have the getrlimit function. */
-#define HAVE_GETRLIMIT 1
-
-/* Define if you have the getspnam function. */
-/* #undef HAVE_GETSPNAM */
-
-/* Define if you have the getspuid function. */
-/* #undef HAVE_GETSPUID */
-
-/* Define if you have the getusershell function. */
-#define HAVE_GETUSERSHELL 1
-
-/* Define if you have the getvfsbyname function. */
-/* #undef HAVE_GETVFSBYNAME */
-
-/* Define if you have the hstrerror function. */
-#define HAVE_HSTRERROR 1
-
-/* Define if you have the inet_aton function. */
-#define HAVE_INET_ATON 1
-
-/* Define if you have the initgroups function. */
-#define HAVE_INITGROUPS 1
-
-/* Define if you have the int16 function. */
-/* #undef HAVE_INT16 */
-
-/* Define if you have the int16_t function. */
-#define HAVE_INT16_T 1
-
-/* Define if you have the int32 function. */
-/* #undef HAVE_INT32 */
-
-/* Define if you have the int32_t function. */
-#define HAVE_INT32_T 1
-
-/* Define if you have the int64_t function. */
-#define HAVE_INT64_T 1
-
-/* Define if you have the int8_t function. */
-#define HAVE_INT8_T 1
-
-/* Define if you have the intptr_t function. */
-/* #undef HAVE_INTPTR_T */
-
-/* Define if you have the kernel_aout_sysent function. */
-/* #undef HAVE_KERNEL_AOUT_SYSENT */
-
-/* Define if you have the kernel_cdevsw_add function. */
-/* #undef HAVE_KERNEL_CDEVSW_ADD */
-
-/* Define if you have the kernel_debuglockmgr function. */
-/* #undef HAVE_KERNEL_DEBUGLOCKMGR */
-
-/* Define if you have the kernel_devtoname function. */
-/* #undef HAVE_KERNEL_DEVTONAME */
-
-/* Define if you have the kernel_doforce function. */
-#define HAVE_KERNEL_DOFORCE 1
-
-/* Define if you have the kernel_genfs_revoke function. */
-/* #undef HAVE_KERNEL_GENFS_REVOKE */
-
-/* Define if you have the kernel_lockmgr function. */
-#define HAVE_KERNEL_LOCKMGR 1
-
-/* Define if you have the kernel_lockstatus function. */
-#define HAVE_KERNEL_LOCKSTATUS 1
-
-/* Define if you have the kernel_make_dev function. */
-/* #undef HAVE_KERNEL_MAKE_DEV */
-
-/* Define if you have the kernel_memcpy function. */
-#define HAVE_KERNEL_MEMCPY 1
-
-/* Define if you have the kernel_nosys function. */
-/* #undef HAVE_KERNEL_NOSYS */
-
-/* Define if you have the kernel_snprintf function. */
-#define HAVE_KERNEL_SNPRINTF 1
-
-/* Define if you have the kernel_sys_lkmnosys function. */
-#define HAVE_KERNEL_SYS_LKMNOSYS 1
-
-/* Define if you have the kernel_sys_nosys function. */
-#define HAVE_KERNEL_SYS_NOSYS 1
-
-/* Define if you have the kernel_udev2dev function. */
-/* #undef HAVE_KERNEL_UDEV2DEV */
-
-/* Define if you have the kernel_vfs_add_vnodeops function. */
-/* #undef HAVE_KERNEL_VFS_ADD_VNODEOPS */
-
-/* Define if you have the kernel_vfs_attach function. */
-/* #undef HAVE_KERNEL_VFS_ATTACH */
-
-/* Define if you have the kernel_vfs_cache_lookup function. */
-/* #undef HAVE_KERNEL_VFS_CACHE_LOOKUP */
-
-/* Define if you have the kernel_vfs_getnewfsid function. */
-#define HAVE_KERNEL_VFS_GETNEWFSID 1
-
-/* Define if you have the kernel_vfs_getvfs function. */
-#define HAVE_KERNEL_VFS_GETVFS 1
-
-/* Define if you have the kernel_vfs_object_create function. */
-/* #undef HAVE_KERNEL_VFS_OBJECT_CREATE */
-
-/* Define if you have the kernel_vfs_opv_init function. */
-#define HAVE_KERNEL_VFS_OPV_INIT 1
-
-/* Define if you have the kernel_vfs_opv_init_default function. */
-#define HAVE_KERNEL_VFS_OPV_INIT_DEFAULT 1
-
-/* Define if you have the kernel_vfs_opv_init_explicit function. */
-#define HAVE_KERNEL_VFS_OPV_INIT_EXPLICIT 1
-
-/* Define if you have the kernel_vfs_register function. */
-#define HAVE_KERNEL_VFS_REGISTER 1
-
-/* Define if you have the kernel_vgonel function. */
-#define HAVE_KERNEL_VGONEL 1
-
-/* Define if you have the kernel_vnode_pager_generic_getpages function. */
-/* #undef HAVE_KERNEL_VNODE_PAGER_GENERIC_GETPAGES */
-
-/* Define if you have the kernel_vnode_pager_generic_putpages function. */
-/* #undef HAVE_KERNEL_VNODE_PAGER_GENERIC_PUTPAGES */
-
-/* Define if you have the kernel_vnode_pager_setsize function. */
-/* #undef HAVE_KERNEL_VNODE_PAGER_SETSIZE */
-
-/* Define if you have the kernel_vop_revoke function. */
-/* #undef HAVE_KERNEL_VOP_REVOKE */
-
-/* Define if you have the kernel_zfreei function. */
-/* #undef HAVE_KERNEL_ZFREEI */
-
-/* Define if you have the krb_afslog_uid function. */
-#define HAVE_KRB_AFSLOG_UID 1
-
-/* Define if you have the kvm_nlist function. */
-#define HAVE_KVM_NLIST 1
-
-/* Define if you have the kvm_open function. */
-#define HAVE_KVM_OPEN 1
-
-/* Define if you have the linux_kernel_int16_t function. */
-/* #undef HAVE_LINUX_KERNEL_INT16_T */
-
-/* Define if you have the linux_kernel_int32_t function. */
-/* #undef HAVE_LINUX_KERNEL_INT32_T */
-
-/* Define if you have the linux_kernel_int64_t function. */
-/* #undef HAVE_LINUX_KERNEL_INT64_T */
-
-/* Define if you have the linux_kernel_int8_t function. */
-/* #undef HAVE_LINUX_KERNEL_INT8_T */
-
-/* Define if you have the linux_kernel_u_int16_t function. */
-/* #undef HAVE_LINUX_KERNEL_U_INT16_T */
-
-/* Define if you have the linux_kernel_u_int32_t function. */
-/* #undef HAVE_LINUX_KERNEL_U_INT32_T */
-
-/* Define if you have the linux_kernel_u_int64_t function. */
-/* #undef HAVE_LINUX_KERNEL_U_INT64_T */
-
-/* Define if you have the linux_kernel_u_int8_t function. */
-/* #undef HAVE_LINUX_KERNEL_U_INT8_T */
-
-/* Define if you have the lstat function. */
-#define HAVE_LSTAT 1
-
-/* Define if you have the memmove function. */
-#define HAVE_MEMMOVE 1
-
-/* Define if you have the mkstemp function. */
-#define HAVE_MKSTEMP 1
-
-/* Define if you have the mktime function. */
-#define HAVE_MKTIME 1
-
-/* Define if you have the off64_t function. */
-/* #undef HAVE_OFF64_T */
-
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the rcmd function. */
-#define HAVE_RCMD 1
-
-/* Define if you have the readline function. */
-#define HAVE_READLINE 1
-
-/* Define if you have the readv function. */
-#define HAVE_READV 1
-
-/* Define if you have the recvmsg function. */
-#define HAVE_RECVMSG 1
-
-/* Define if you have the register_t function. */
-#define HAVE_REGISTER_T 1
-
-/* Define if you have the res_search function. */
-#define HAVE_RES_SEARCH 1
-
-/* Define if you have the sendmsg function. */
-#define HAVE_SENDMSG 1
-
-/* Define if you have the setegid function. */
-#define HAVE_SETEGID 1
-
-/* Define if you have the setenv function. */
-#define HAVE_SETENV 1
-
-/* Define if you have the seteuid function. */
-#define HAVE_SETEUID 1
-
-/* Define if you have the setregid function. */
-#define HAVE_SETREGID 1
-
-/* Define if you have the setresuid function. */
-/* #undef HAVE_SETRESUID */
-
-/* Define if you have the setreuid function. */
-#define HAVE_SETREUID 1
-
-/* Define if you have the setsid function. */
-#define HAVE_SETSID 1
-
-/* Define if you have the setsockopt function. */
-#define HAVE_SETSOCKOPT 1
-
-/* Define if you have the socket function. */
-#define HAVE_SOCKET 1
-
-/* Define if you have the ssize_t function. */
-#define HAVE_SSIZE_T 1
-
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strdup function. */
-#define HAVE_STRDUP 1
-
-/* Define if you have the strerror function. */
-#define HAVE_STRERROR 1
-
-/* Define if you have the strftime function. */
-#define HAVE_STRFTIME 1
-
-/* Define if you have the strlcat function. */
-#define HAVE_STRLCAT 1
-
-/* Define if you have the strlcpy function. */
-#define HAVE_STRLCPY 1
-
-/* Define if you have the strlwr function. */
-/* #undef HAVE_STRLWR */
-
-/* Define if you have the strnlen function. */
-/* #undef HAVE_STRNLEN */
-
-/* Define if you have the strptime function. */
-#define HAVE_STRPTIME 1
-
-/* Define if you have the strsep function. */
-#define HAVE_STRSEP 1
-
-/* Define if you have the strsep_copy function. */
-/* #undef HAVE_STRSEP_COPY */
-
-/* Define if you have the strtok_r function. */
-#define HAVE_STRTOK_R 1
-
-/* Define if you have the strupr function. */
-/* #undef HAVE_STRUPR */
-
-/* Define if you have the sysconf function. */
-#define HAVE_SYSCONF 1
-
-/* Define if you have the sysctl function. */
-#define HAVE_SYSCTL 1
-
-/* Define if you have the syslog function. */
-#define HAVE_SYSLOG 1
-
-/* Define if you have the tgetent function. */
-#define HAVE_TGETENT 1
-
-/* Define if you have the thr_yield function. */
-/* #undef HAVE_THR_YIELD */
-
-/* Define if you have the u_int16 function. */
-/* #undef HAVE_U_INT16 */
-
-/* Define if you have the u_int16_t function. */
-#define HAVE_U_INT16_T 1
-
-/* Define if you have the u_int32 function. */
-/* #undef HAVE_U_INT32 */
-
-/* Define if you have the u_int32_t function. */
-#define HAVE_U_INT32_T 1
-
-/* Define if you have the u_int64_t function. */
-#define HAVE_U_INT64_T 1
-
-/* Define if you have the u_int8_t function. */
-#define HAVE_U_INT8_T 1
-
-/* Define if you have the unsetenv function. */
-#define HAVE_UNSETENV 1
-
-/* Define if you have the vasnprintf function. */
-/* #undef HAVE_VASNPRINTF */
-
-/* Define if you have the vasprintf function. */
-#define HAVE_VASPRINTF 1
-
-/* Define if you have the verr function. */
-#define HAVE_VERR 1
-
-/* Define if you have the verrx function. */
-#define HAVE_VERRX 1
-
-/* Define if you have the vfsisloadable function. */
-/* #undef HAVE_VFSISLOADABLE */
-
-/* Define if you have the vfsload function. */
-/* #undef HAVE_VFSLOAD */
-
-/* Define if you have the vsnprintf function. */
-#define HAVE_VSNPRINTF 1
-
-/* Define if you have the vsyslog function. */
-#define HAVE_VSYSLOG 1
-
-/* Define if you have the vwarn function. */
-#define HAVE_VWARN 1
-
-/* Define if you have the vwarnx function. */
-#define HAVE_VWARNX 1
-
-/* Define if you have the warn function. */
-#define HAVE_WARN 1
-
-/* Define if you have the warnx function. */
-#define HAVE_WARNX 1
-
-/* Define if you have the writev function. */
-#define HAVE_WRITEV 1
-
-/* Define if you have the <arpa/inet.h> header file. */
-#define HAVE_ARPA_INET_H 1
-
-/* Define if you have the <arpa/nameser.h> header file. */
-#define HAVE_ARPA_NAMESER_H 1
-
-/* Define if you have the <com_err.h> header file. */
-#define HAVE_COM_ERR_H 1
-
-/* Define if you have the <crypt.h> header file. */
-/* #undef HAVE_CRYPT_H */
-
-/* Define if you have the <dbm.h> header file. */
-#define HAVE_DBM_H 1
-
-/* Define if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the <errno.h> header file. */
-#define HAVE_ERRNO_H 1
-
-/* Define if you have the <et/com_err.h> header file. */
-/* #undef HAVE_ET_COM_ERR_H */
-
-/* Define if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define if you have the <grp.h> header file. */
-#define HAVE_GRP_H 1
-
-/* Define if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define if you have the <ktypes.h> header file. */
-/* #undef HAVE_KTYPES_H */
-
-/* Define if you have the <kvm.h> header file. */
-#define HAVE_KVM_H 1
-
-/* Define if you have the <libelf/nlist.h> header file. */
-/* #undef HAVE_LIBELF_NLIST_H */
-
-/* Define if you have the <linux/devfs_fs.h> header file. */
-/* #undef HAVE_LINUX_DEVFS_FS_H */
-
-/* Define if you have the <linux/devfs_fs_kernel.h> header file. */
-/* #undef HAVE_LINUX_DEVFS_FS_KERNEL_H */
-
-/* Define if you have the <machine/alpha/asm.h> header file. */
-/* #undef HAVE_MACHINE_ALPHA_ASM_H */
-
-/* Define if you have the <machine/asm.h> header file. */
-#define HAVE_MACHINE_ASM_H 1
-
-/* Define if you have the <machine/endian.h> header file. */
-#define HAVE_MACHINE_ENDIAN_H 1
-
-/* Define if you have the <machine/regdef.h> header file. */
-/* Needed by mips and only used by mips. -moj */
-#define HAVE_MACHINE_REGDEF_H 1
-
-/* Define if you have the <miscfs/genfs/genfs.h> header file. */
-/* #undef HAVE_MISCFS_GENFS_GENFS_H */
-
-/* Define if you have the <ndbm.h> header file. */
-#define HAVE_NDBM_H 1
-
-/* Define if you have the <netdb.h> header file. */
-#define HAVE_NETDB_H 1
-
-/* Define if you have the <netinet/in.h> header file. */
-#define HAVE_NETINET_IN_H 1
-
-/* Define if you have the <netinet/in6.h> header file. */
-/* #undef HAVE_NETINET_IN6_H */
-
-/* Define if you have the <netinet/in6_machtypes.h> header file. */
-/* #undef HAVE_NETINET_IN6_MACHTYPES_H */
-
-/* Define if you have the <netinet6/in6.h> header file. */
-/* #undef HAVE_NETINET6_IN6_H */
-
-/* Define if you have the <nlist.h> header file. */
-#define HAVE_NLIST_H 1
-
-/* Define if you have the <paths.h> header file. */
-#define HAVE_PATHS_H 1
-
-/* Define if you have the <pwd.h> header file. */
-#define HAVE_PWD_H 1
-
-/* Define if you have the <regdef.h> header file. */
-/* #undef HAVE_REGDEF_H */
-
-/* Define if you have the <resolv.h> header file. */
-#define HAVE_RESOLV_H 1
-
-/* Define if you have the <rpcsvc/dbm.h> header file. */
-/* #undef HAVE_RPCSVC_DBM_H */
-
-/* Define if you have the <shadow.h> header file. */
-/* #undef HAVE_SHADOW_H */
-
-/* Define if you have the <sys/attr.h> header file. */
-/* #undef HAVE_SYS_ATTR_H */
-
-/* Define if you have the <sys/bitypes.h> header file. */
-/* #undef HAVE_SYS_BITYPES_H */
-
-/* Define if you have the <sys/cdefs.h> header file. */
-#define HAVE_SYS_CDEFS_H 1
-
-/* Define if you have the <sys/dir.h> header file. */
-#define HAVE_SYS_DIR_H 1
-
-/* Define if you have the <sys/filedesc.h> header file. */
-#define HAVE_SYS_FILEDESC_H 1
-
-/* Define if you have the <sys/ioccom.h> header file. */
-#define HAVE_SYS_IOCCOM_H 1
-
-/* Define if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define if you have the <sys/lkm.h> header file. */
-#define HAVE_SYS_LKM_H 1
-
-/* Define if you have the <sys/mman.h> header file. */
-#define HAVE_SYS_MMAN_H 1
-
-/* Define if you have the <sys/module.h> header file. */
-/* #undef HAVE_SYS_MODULE_H */
-
-/* Define if you have the <sys/mount.h> header file. */
-#define HAVE_SYS_MOUNT_H 1
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/poll.h> header file. */
-#define HAVE_SYS_POLL_H 1
-
-/* Define if you have the <sys/proc.h> header file. */
-#define HAVE_SYS_PROC_H 1
-
-/* Define if you have the <sys/queue.h> header file. */
-#define HAVE_SYS_QUEUE_H 1
-
-/* Define if you have the <sys/resource.h> header file. */
-#define HAVE_SYS_RESOURCE_H 1
-
-/* Define if you have the <sys/select.h> header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define if you have the <sys/signalvar.h> header file. */
-#define HAVE_SYS_SIGNALVAR_H 1
-
-/* Define if you have the <sys/socket.h> header file. */
-#define HAVE_SYS_SOCKET_H 1
-
-/* Define if you have the <sys/sockio.h> header file. */
-#define HAVE_SYS_SOCKIO_H 1
-
-/* Define if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define if you have the <sys/syscallargs.h> header file. */
-#define HAVE_SYS_SYSCALLARGS_H 1
-
-/* Define if you have the <sys/sysconfig.h> header file. */
-/* #undef HAVE_SYS_SYSCONFIG_H */
-
-/* Define if you have the <sys/sysctl.h> header file. */
-#define HAVE_SYS_SYSCTL_H 1
-
-/* Define if you have the <sys/sysent.h> header file. */
-/* #undef HAVE_SYS_SYSENT_H */
-
-/* Define if you have the <sys/sysproto.h> header file. */
-/* #undef HAVE_SYS_SYSPROTO_H */
-
-/* Define if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H 1
-
-/* Define if you have the <sys/tty.h> header file. */
-#define HAVE_SYS_TTY_H 1
-
-/* Define if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define if you have the <sys/uio.h> header file. */
-#define HAVE_SYS_UIO_H 1
-
-/* Define if you have the <sys/user.h> header file. */
-#define HAVE_SYS_USER_H 1
-
-/* Define if you have the <sys/utsname.h> header file. */
-#define HAVE_SYS_UTSNAME_H 1
-
-/* Define if you have the <sys/vfs.h> header file. */
-/* #undef HAVE_SYS_VFS_H */
-
-/* Define if you have the <sys/wait.h> header file. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define if you have the <syslog.h> header file. */
-#define HAVE_SYSLOG_H 1
-
-/* Define if you have the <termios.h> header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the <uvm/uvm_extern.h> header file. */
-#define HAVE_UVM_UVM_EXTERN_H 1
-
-/* Define if you have the <vm/vm.h> header file. */
-#define HAVE_VM_VM_H 1
-
-/* Define if you have the <vm/vm_extern.h> header file. */
-#define HAVE_VM_VM_EXTERN_H 1
-
-/* Define if you have the <vm/vm_object.h> header file. */
-#define HAVE_VM_VM_OBJECT_H 1
-
-/* Define if you have the <vm/vm_pager.h> header file. */
-#define HAVE_VM_VM_PAGER_H 1
-
-/* Define if you have the <vm/vm_zone.h> header file. */
-/* #undef HAVE_VM_VM_ZONE_H */
-
-/* Define if you have the <vm/vnode_pager.h> header file. */
-#define HAVE_VM_VNODE_PAGER_H 1
-
-/* Define if you have the curses library (-lcurses). */
-/* #undef HAVE_LIBCURSES */
-
-/* Define if you have the edit library (-ledit). */
-/* #undef HAVE_LIBEDIT */
-
-/* Define if you have the editline library (-leditline). */
-/* #undef HAVE_LIBEDITLINE */
-
-/* Define if you have the kvm library (-lkvm). */
-#define HAVE_LIBKVM 1
-
-/* Define if you have the ncurses library (-lncurses). */
-/* #undef HAVE_LIBNCURSES */
-
-/* Define if you have the nsl library (-lnsl). */
-/* #undef HAVE_LIBNSL */
-
-/* Define if you have the readline library (-lreadline). */
-#define HAVE_LIBREADLINE 1
-
-/* Define if you have the resolv library (-lresolv). */
-/* #undef HAVE_LIBRESOLV */
-
-/* Define if you have the socket library (-lsocket). */
-/* #undef HAVE_LIBSOCKET */
-
-/* Define if you have the syslog library (-lsyslog). */
-/* #undef HAVE_LIBSYSLOG */
-
-/* Define if you have the termcap library (-ltermcap). */
-#define HAVE_LIBTERMCAP 1
-
-/* what package is this? */
-#define PACKAGE "arla"
-
-/* and what version? */
-#define VERSION "0.35pre"
-
-/* how should ntohl be done? */
-#define EFF_NTOHL ntohl
-
-/* define if you need 32 bit compat pioctl */
-/* #undef NEED_VICEIOCTL32 */
-
-/* define this if on Irix6.4 or higher */
-/* #undef IRIX_64 */
-
-/* define if you need 32 bit compat pioctl */
-/* #undef NEED_VICEIOCTL32 */
-
-/* define if you have kerberos 4 compat */
-/* #undef HAVE_KRB5_COMPAT_KRB4 */
-
-/* define if you have kerberos 5 */
-/* #undef HAVE_KRB5 */
-
-/* define if you have kerberos */
-#define KERBEROS 1
-
-/* define if you have kerberos */
-#define KERBEROS 1
-
-/* define if you have kerberos 4 */
-#define HAVE_KRB4 1
-
-/* define if you have struct msghdr */
-#define HAVE_STRUCT_MSGHDR 1
-
-/* define if you have struct iovec */
-#define HAVE_STRUCT_IOVEC 1
-
-/* define if you have a struct krb_principal */
-#define HAVE_KRB_PRINCIPAL 1
-
-/* define if you have krb_get_err_text */
-#define HAVE_KRB_GET_ERR_TEXT 1
-
-/* define if you have krb_get_default_tkt_root */
-#define HAVE_KRB_GET_DEFAULT_TKT_ROOT 1
-
-/* define if you have krb_kdctimeofday */
-#define HAVE_KRB_KDCTIMEOFDAY 1
-
-/* Define if you have the readline package. */
-/* #undef READLINE */
-
-/* define if you have a function readline */
-#define HAVE_READLINE 1
-
-/* define if you want to use mmaptime */
-/* #undef USE_MMAPTIME */
-
-/* define if you have a glibc-based system */
-/* #undef HAVE_GLIBC */
-
-/* define if target is big endian */
-#define WORDS_BIGENDIAN 1
-
-/* define if sys/param.h defines the endiness */
-#define ENDIANESS_IN_SYS_PARAM_H 1
-
-/* define if your compiler has __FUNCTION__ */
-#define HAVE___FUNCTION__ 1
-
-/* define if your compiler has __attribute__ */
-#define HAVE___ATTRIBUTE__ 1
-
-/* Define if NDBM really is DB (creates files ending in .db). */
-#define HAVE_NEW_DB 1
-
-/* Define if you have NDBM (and not DBM) */
-#define NDBM 1
-
-/* define if struct winsize is declared in sys/termios.h */
-#define HAVE_STRUCT_WINSIZE 1
-
-/* define if struct winsize has ws_xpixel */
-#define HAVE_WS_XPIXEL 1
-
-/* define if struct winsize has ws_ypixel */
-#define HAVE_WS_YPIXEL 1
-
-/* define if you have a working snprintf */
-#define HAVE_SNPRINTF 1
-
-/* define if the system is missing a prototype for snprintf() */
-/* #undef NEED_SNPRINTF_PROTO */
-
-/* define if you have sigaction */
-#define HAVE_POSIX_SIGNALS 1
-
-/* define if you have res */
-/* #undef HAVE_RES */
-
-/* define if your system declares res */
-/* #undef HAVE_RES_DECLARATION */
-
-/* define if the system is missing a prototype for hstrerror() */
-/* #undef NEED_HSTRERROR_PROTO */
-
-/* define if hstrerror is const */
-#define NEED_HSTRERROR_CONST 1
-
-/* define if the system is missing a prototype for inet_aton() */
-/* #undef NEED_INET_ATON_PROTO */
-
-/* define if getvfsbyname takes two arguments */
-/* #undef HAVE_GETVFSBYNAME_TWO_ARGS */
-
-/* define if you have optreset */
-#define HAVE_OPTRESET 1
-
-/* define if your system declares optreset */
-#define HAVE_OPTRESET_DECLARATION 1
-
-/* define if your system declares optreset */
-#define HAVE_OPTRESET_DECLARATION 1
-
-/* define if the system is missing a prototype for strtok_r() */
-/* #undef NEED_STRTOK_R_PROTO */
-
-/* define if the system is missing a prototype for select() */
-/* #undef NEED_SELECT_PROTO */
-
-/* define if you can include both dirent.h and sys/dir.h */
-#define DIRENT_AND_SYS_DIR_H 1
-
-/* Define if struct dirent has field d_type. */
-#define HAVE_STRUCT_DIRENT_D_TYPE 1
-
-/* Define if struct sockaddr has field sa_len. */
-#define HAVE_STRUCT_SOCKADDR_SA_LEN 1
-
-/* define if you have h_errno */
-#define HAVE_H_ERRNO 1
-
-/* define if your system declares h_errno */
-#define HAVE_H_ERRNO_DECLARATION 1
-
-/* define if you have h_errlist */
-#define HAVE_H_ERRLIST 1
-
-/* define if your system declares h_errlist */
-/* #undef HAVE_H_ERRLIST_DECLARATION */
-
-/* define if you have h_nerr */
-#define HAVE_H_NERR 1
-
-/* define if your system declares h_nerr */
-/* #undef HAVE_H_NERR_DECLARATION */
-
-/* define this if your as understands .register */
-/* #undef AS_UNDERSTANDS_REGISTER */
-
-/* define if you have a vop_t */
-/* #undef HAVE_VOP_T */
-
-/* if vfs_object_create takes four arguments */
-/* #undef HAVE_FOUR_ARGUMENT_VFS_OBJECT_CREATE */
-
-/* define if VOP_LOCK takes one argument */
-/* #undef HAVE_ONE_ARGUMENT_VOP_LOCK */
-
-/* define if VOP_LOCK takes two arguments */
-/* #undef HAVE_TWO_ARGUMENT_VOP_LOCK */
-
-/* define if VOP_LOCK takes three arguments */
-#define HAVE_THREE_ARGUMENT_VOP_LOCK 1
-
-/* define if vfs_busy takes three arguments */
-/* #undef HAVE_THREE_ARGUMENT_VFS_BUSY */
-
-/* define if vfs_busy takes four arguments */
-/* #undef HAVE_FOUR_ARGUMENT_VFS_BUSY */
-
-/* define if vget takes one argument */
-/* #undef HAVE_ONE_ARGUMENT_VGET */
-
-/* define if vget takes two arguments */
-/* #undef HAVE_TWO_ARGUMENT_VGET */
-
-/* define if vget takes three arguments */
-#define HAVE_THREE_ARGUMENT_VGET 1
-
-/* define if suser takes two arguments */
-#define HAVE_TWO_ARGUMENT_SUSER 1
-
-/* define if vfs_getnewfsid takes two arguments */
-/* #undef HAVE_TWO_ARGUMENT_VFS_GETNEWFSID */
-
-/* define if vfs_busy takes two arguments */
-#define HAVE_TWO_ARGUMENT_VFS_BUSY 1
-
-/* define if lockmgr takes four arguments */
-#define HAVE_FOUR_ARGUMENT_LOCKMGR 1
-
-/* define if lockstatus takes two arguments */
-/* #undef HAVE_TWO_ARGUMENT_LOCKSTATUS */
-
-/* define if lockstatus takes one argument */
-#define HAVE_ONE_ARGUMENT_LOCKSTATUS 1
-
-/* define if ubc_lookup takes six arguments */
-/* #undef HAVE_SIX_ARGUMENT_UBC_LOOKUP */
-
-/* define if DIRSIZ is defined in dirent.h */
-/* #undef DIRSIZ_IN_DIRENT_H */
-
-/* define if DIRSIZ is defined in sys/dir.h */
-#define DIRSIZ_IN_SYS_DIR_H 1
-
-/* define if DIRSIZ is defined in sys/dirent.h */
-/* #undef GENERIC_DIRSIZ_IN_SYS_DIRENT_H */
-
-/* Define if struct proc has field p_sigmask. */
-#define HAVE_STRUCT_PROC_P_SIGMASK 1
-
-/* Define if struct mount has field mnt_syncer */
-#define HAVE_STRUCT_MOUNT_MNT_SYNCER 1
-
-/* Define if struct mount has field m_info */
-/* #undef HAVE_STRUCT_MOUNT_M_INFO */
-
-/* Define if struct vfsconf has field vfc_refcount */
-#define HAVE_STRUCT_VFSCONF_VFC_REFCOUNT 1
-
-/* Define if struct vfsconf has field vfc_mountroot */
-/* #undef HAVE_STRUCT_VFSCONF_VFC_MOUNTROOT */
-
-/* Define if struct uio has field uio_procp */
-#define HAVE_STRUCT_UIO_UIO_PROCP 1
-
-/* Define if struct vfsops has field vfs_opv_descs */
-/* #undef HAVE_STRUCT_VFSOPS_VFS_OPV_DESCS */
-
-/* Define if struct vfsops has field vfs_name */
-/* #undef HAVE_STRUCT_VFSOPS_VFS_NAME */
-
-/* Define if struct vfsops has field vfs_uninit */
-/* #undef HAVE_STRUCT_VFSOPS_VFS_UNINIT */
-
-/* Define if struct vfsops has field vfs_oid */
-/* #undef HAVE_STRUCT_VFSOPS_VFS_OID */
-
-/* Define if struct vfsops has field vfs_done */
-/* #undef HAVE_STRUCT_VFSOPS_VFS_DONE */
-
-/* Define if struct vfsops has field vfs_checkexp */
-#define HAVE_STRUCT_VFSOPS_VFS_CHECKEXP 1
-
-/* Define if struct vop_fsync_args has field a_flags */
-/* #undef HAVE_STRUCT_VOP_FSYNC_ARGS_A_FLAGS */
-
-/* Define if struct proc has field p_retval */
-/* #undef HAVE_STRUCT_PROC_P_RETVAL */
-
-/* Define if you have struct setgroups_args */
-/* #undef HAVE_DEF_STRUCT_SETGROUPS_ARGS */
-
-/* Define if you have struct sys_setgroups_args */
-#define HAVE_DEF_STRUCT_SYS_SETGROUPS_ARGS 1
-
-/* Define if struct cdevsw has field d_stop */
-/* #undef HAVE_STRUCT_CDEVSW_D_STOP */
-
-/* Define if struct cdevsw has field d_reset */
-/* #undef HAVE_STRUCT_CDEVSW_D_RESET */
-
-/* Define if struct cdevsw has field d_bogoreset */
-/* #undef HAVE_STRUCT_CDEVSW_D_BOGORESET */
-
-/* Define if struct cdevsw has field d_devtotty */
-/* #undef HAVE_STRUCT_CDEVSW_D_DEVTOTTY */
-
-/* Define if struct cdevsw has field d_bogoparms */
-/* #undef HAVE_STRUCT_CDEVSW_D_BOGOPARMS */
-
-/* Define if struct cdevsw has field d_spare */
-/* #undef HAVE_STRUCT_CDEVSW_D_SPARE */
-
-/* Define if struct cdevsw has field d_maxio */
-/* #undef HAVE_STRUCT_CDEVSW_D_MAXIO */
-
-/* Define if struct componentname has field cn_hash */
-#define HAVE_STRUCT_COMPONENTNAME_CN_HASH 1
-
-/* define if d_alloc_root takes two arguments */
-/* #undef HAVE_D_ALLOC_ROOT_TWO_ARGS */
-
-/* define if devfs_register takes eleven arguments */
-/* #undef HAVE_DEVFS_REGISTER_ELEVEN_ARGS */
-
-/* Define if struct ViceIoctl has field in */
-/* #undef HAVE_STRUCT_VICEIOCTL_IN */
-
-/* Define if struct super_operations has field notify_change */
-/* #undef HAVE_STRUCT_SUPER_OPERATIONS_NOTIFY_CHANGE */
-
-/* Define if struct inode_operations has field default_file_ops */
-/* #undef HAVE_STRUCT_INODE_OPERATIONS_DEFAULT_FILE_OPS */
-
-/* Define if struct inode_operations has field updatepage */
-/* #undef HAVE_STRUCT_INODE_OPERATIONS_UPDATEPAGE */
-
-/* Define if struct inode_operations has field bmap */
-/* #undef HAVE_STRUCT_INODE_OPERATIONS_BMAP */
-
-/* Define if struct inode_operations has field smap */
-/* #undef HAVE_STRUCT_INODE_OPERATIONS_SMAP */
-
-/* define if you have a wait_queue_head_t */
-/* #undef HAVE_WAIT_QUEUE_HEAD_T */
-
-/* define if you have a init_waitqueue_head */
-/* #undef HAVE_INIT_WAITQUEUE_HEAD */
-
-/* define if you have a function init_MUTEX */
-/* #undef HAVE_INIT_MUTEX */
-
-/* Define if struct vfsops has field vfs_freevfs */
-/* #undef HAVE_STRUCT_VFSOPS_VFS_FREEVFS */
-
-/* define? */
-/* #undef HAVE_REPAIRABLE_HTONL */
-
-
-/* RCSID */
-#define RCSID(msg) \
-static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
-
-/* Maximum values on all known systems */
-#define MaxHostNameLen (64+4)
-#define MaxPathLen (1024+4)
-
-/* we always have stds.h */
-#define HAVE_STDS_H
-
-/*
- * Defintions that are ugly but needed to get all the symbols used
- */
-
-/*
- * Defining this enables lots of useful (and used) extensions on
- * glibc-based systems such as Linux
- */
-
-#define _GNU_SOURCE
-
-/*
- * Defining this enables us to get the definition of `sigset_t' and
- * other importatnt definitions on Solaris.
- */
-
-#ifndef __EXTENSIONS__
-#define __EXTENSIONS__
-#endif
-
-#ifndef HAVE___ATTRIBUTE__
-#define __attribute__(x)
-#endif
diff --git a/usr.sbin/afs/src/include/config.h.in b/usr.sbin/afs/src/include/config.h.in
deleted file mode 100644
index 426464ddec5..00000000000
--- a/usr.sbin/afs/src/include/config.h.in
+++ /dev/null
@@ -1,1668 +0,0 @@
-/* include/config.h.in. Generated from configure.in by autoheader. */
-
-#ifndef OPENSSL_DES_LIBDES_COMPATIBILITY
-#define OPENSSL_DES_LIBDES_COMPATIBILITY 1
-#endif
-
-#ifndef RCSID
-#define RCSID(msg) \
-static /**/const char *const rcsid[] = { (const char *)rcsid, "@(#)" msg }
-#endif
-
-/* Maximum values on all known systems */
-#define MaxHostNameLen (64+4)
-#define MaxPathLen (1024+4)
-
-
-
-/* Define if realloc(NULL) doesn't work. */
-#undef BROKEN_REALLOC
-
-/* define if you can include both dirent.h and sys/dir.h */
-#undef DIRENT_AND_SYS_DIR_H
-
-/* define if DIRSIZ is defined in dirent.h */
-#undef DIRSIZ_IN_DIRENT_H
-
-/* define if DIRSIZ is defined in sys/dir.h */
-#undef DIRSIZ_IN_SYS_DIR_H
-
-/* how should ntohl be done? */
-#undef EFF_NTOHL
-
-/* define if sys/param.h defines the endiness */
-#undef ENDIANESS_IN_SYS_PARAM_H
-
-/* define if DIRSIZ is defined in sys/dirent.h */
-#undef GENERIC_DIRSIZ_IN_SYS_DIRENT_H
-
-/* define if prototype of gethostbyaddr is compatible with struct hostent
- *gethostbyaddr(const void *, size_t, int) */
-#undef GETHOSTBYADDR_PROTO_COMPATIBLE
-
-/* define if prototype of gethostbyname is compatible with struct hostent
- *gethostbyname(const char *) */
-#undef GETHOSTBYNAME_PROTO_COMPATIBLE
-
-/* define if prototype of getservbyname is compatible with struct servent
- *getservbyname(const char *, const char *) */
-#undef GETSERVBYNAME_PROTO_COMPATIBLE
-
-/* define if prototype of getsockname is compatible with int getsockname(int,
- struct sockaddr*, socklen_t*) */
-#undef GETSOCKNAME_PROTO_COMPATIBLE
-
-/* Define if you have the `altzone' variable. */
-#undef HAVE_ALTZONE
-
-/* define if your system declares altzone */
-#undef HAVE_ALTZONE_DECLARATION
-
-/* Define to 1 if you have the <arpa/inet.h> header file. */
-#undef HAVE_ARPA_INET_H
-
-/* Define to 1 if you have the <arpa/nameser.h> header file. */
-#undef HAVE_ARPA_NAMESER_H
-
-/* Define to 1 if you have the `asnprintf' function. */
-#undef HAVE_ASNPRINTF
-
-/* Define to 1 if you have the `asprintf' function. */
-#undef HAVE_ASPRINTF
-
-/* Define to 1 if you have the `atexit' function. */
-#undef HAVE_ATEXIT
-
-/* Define to 1 if you have the `bool' function. */
-#undef HAVE_BOOL
-
-/* Define to 1 if you have the `bswap16' function. */
-#undef HAVE_BSWAP16
-
-/* Define to 1 if you have the `bswap32' function. */
-#undef HAVE_BSWAP32
-
-/* Define to 1 if you have the `cgetent' function. */
-#undef HAVE_CGETENT
-
-/* Define if you have the function `chown'. */
-#undef HAVE_CHOWN
-
-/* Define to 1 if you have the <com_err.h> header file. */
-#undef HAVE_COM_ERR_H
-
-/* Define to 1 if you have the <config.h> header file. */
-#undef HAVE_CONFIG_H
-
-/* Define if you have the function `copyhostent'. */
-#undef HAVE_COPYHOSTENT
-
-/* Define to 1 if you have the `crypt' function. */
-#undef HAVE_CRYPT
-
-/* Define to 1 if you have the <crypt.h> header file. */
-#undef HAVE_CRYPT_H
-
-/* Define if you have the function `daemon'. */
-#undef HAVE_DAEMON
-
-/* define if you have a berkeley db1/2 library */
-#undef HAVE_DB1
-
-/* define if you have a berkeley db3/4 library */
-#undef HAVE_DB3
-
-/* Define to 1 if you have the <db3/db.h> header file. */
-#undef HAVE_DB3_DB_H
-
-/* Define to 1 if you have the <db4/db.h> header file. */
-#undef HAVE_DB4_DB_H
-
-/* Define to 1 if you have the `dbm_firstkey' function. */
-#undef HAVE_DBM_FIRSTKEY
-
-/* Define to 1 if you have the <dbm.h> header file. */
-#undef HAVE_DBM_H
-
-/* Define to 1 if you have the `dbopen' function. */
-#undef HAVE_DBOPEN
-
-/* Define to 1 if you have the <db_185.h> header file. */
-#undef HAVE_DB_185_H
-
-/* Define to 1 if you have the `db_create' function. */
-#undef HAVE_DB_CREATE
-
-/* Define to 1 if you have the <db.h> header file. */
-#undef HAVE_DB_H
-
-/* define if you have ndbm compat in db */
-#undef HAVE_DB_NDBM
-
-/* Define if you have struct setgroups_args */
-#undef HAVE_DEF_STRUCT_SETGROUPS_ARGS
-
-/* Define if you have struct sys_setgroups_args */
-#undef HAVE_DEF_STRUCT_SYS_SETGROUPS_ARGS
-
-/* define if devfs_register takes eleven arguments */
-#undef HAVE_DEVFS_REGISTER_ELEVEN_ARGS
-
-/* define if you have a function dget_locked */
-#undef HAVE_DGET_LOCKED
-
-/* Define to 1 if you have the <dirent.h> header file. */
-#undef HAVE_DIRENT_H
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define to 1 if you have the `dn_expand' function. */
-#undef HAVE_DN_EXPAND
-
-/* define if d_alloc_root takes two arguments */
-#undef HAVE_D_ALLOC_ROOT_TWO_ARGS
-
-/* define if d_delete in struct dentry_operations returns void */
-#undef HAVE_D_DELETE_VOID
-
-/* Define if you have the function `ecalloc'. */
-#undef HAVE_ECALLOC
-
-/* Define to 1 if you have the <elflib/nlist.h> header file. */
-#undef HAVE_ELFLIB_NLIST_H
-
-/* Define to 1 if you have the `el_init' function. */
-#undef HAVE_EL_INIT
-
-/* Define if you have the function `emalloc'. */
-#undef HAVE_EMALLOC
-
-/* define if your system declares environ */
-#undef HAVE_ENVIRON_DECLARATION
-
-/* Define if you have the function `erealloc'. */
-#undef HAVE_EREALLOC
-
-/* Define if you have the function `err'. */
-#undef HAVE_ERR
-
-/* Define to 1 if you have the <errno.h> header file. */
-#undef HAVE_ERRNO_H
-
-/* Define if you have the function `errx'. */
-#undef HAVE_ERRX
-
-/* Define to 1 if you have the <err.h> header file. */
-#undef HAVE_ERR_H
-
-/* Define if you have the function `estrdup'. */
-#undef HAVE_ESTRDUP
-
-/* Define to 1 if you have the <et/com_err.h> header file. */
-#undef HAVE_ET_COM_ERR_H
-
-/* Define if you have the function `fchown'. */
-#undef HAVE_FCHOWN
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
-/* Define to 1 if you have the `fhopen' function. */
-#undef HAVE_FHOPEN
-
-/* define if filldir_t takes a dt_type argument */
-#undef HAVE_FILLDIR_T_DT_TYPE
-
-/* Define if you have the function `flock'. */
-#undef HAVE_FLOCK
-
-/* Define if you have the function `fnmatch'. */
-#undef HAVE_FNMATCH
-
-/* Define to 1 if you have the <fnmatch.h> header file. */
-#undef HAVE_FNMATCH_H
-
-/* define if lockmgr takes four arguments */
-#undef HAVE_FOUR_ARGUMENT_LOCKMGR
-
-/* define if vfs_busy takes four arguments */
-#undef HAVE_FOUR_ARGUMENT_VFS_BUSY
-
-/* define if vfs_name_hash takes four arguments */
-#undef HAVE_FOUR_ARGUMENT_VFS_NAME_HASH
-
-/* if vfs_object_create takes four arguments */
-#undef HAVE_FOUR_ARGUMENT_VFS_OBJECT_CREATE
-
-/* Define to 1 if you have the `freeaddrinfo' function. */
-#undef HAVE_FREEADDRINFO
-
-/* Define if you have the function `freehostent'. */
-#undef HAVE_FREEHOSTENT
-
-/* Define to 1 if you have the `gai_strerror' function. */
-#undef HAVE_GAI_STRERROR
-
-/* Define to 1 if you have the <gdbm/ndbm.h> header file. */
-#undef HAVE_GDBM_NDBM_H
-
-/* Define to 1 if you have the `getaddrinfo' function. */
-#undef HAVE_GETADDRINFO
-
-/* Define to 1 if you have the `getattrlist' function. */
-#undef HAVE_GETATTRLIST
-
-/* Define to 1 if you have the `getconfattr' function. */
-#undef HAVE_GETCONFATTR
-
-/* Define if you have the function `getcwd'. */
-#undef HAVE_GETCWD
-
-/* Define if you have the function `getdtablesize'. */
-#undef HAVE_GETDTABLESIZE
-
-/* Define if you have the function `getegid'. */
-#undef HAVE_GETEGID
-
-/* Define if you have the function `geteuid'. */
-#undef HAVE_GETEUID
-
-/* Define to 1 if you have the `getfh' function. */
-#undef HAVE_GETFH
-
-/* Define if you have the function `getgid'. */
-#undef HAVE_GETGID
-
-/* Define to 1 if you have the `gethostbyname' function. */
-#undef HAVE_GETHOSTBYNAME
-
-/* Define to 1 if you have the `gethostbyname2' function. */
-#undef HAVE_GETHOSTBYNAME2
-
-/* Define if you have the function `gethostname'. */
-#undef HAVE_GETHOSTNAME
-
-/* Define if you have the function `getifaddrs'. */
-#undef HAVE_GETIFADDRS
-
-/* Define if you have the function `getipnodebyaddr'. */
-#undef HAVE_GETIPNODEBYADDR
-
-/* Define if you have the function `getipnodebyname'. */
-#undef HAVE_GETIPNODEBYNAME
-
-/* Define to 1 if you have the `getlogin' function. */
-#undef HAVE_GETLOGIN
-
-/* Define to 1 if you have the `getnameinfo' function. */
-#undef HAVE_GETNAMEINFO
-
-/* Define if you have the function `getopt'. */
-#undef HAVE_GETOPT
-
-/* Define to 1 if you have the `getpagesize' function. */
-#undef HAVE_GETPAGESIZE
-
-/* Define to 1 if you have the `getprogname' function. */
-#undef HAVE_GETPROGNAME
-
-/* Define to 1 if you have the `getrlimit' function. */
-#undef HAVE_GETRLIMIT
-
-/* Define to 1 if you have the `getrusage' function. */
-#undef HAVE_GETRUSAGE
-
-/* Define to 1 if you have the `getsockopt' function. */
-#undef HAVE_GETSOCKOPT
-
-/* Define to 1 if you have the `getspnam' function. */
-#undef HAVE_GETSPNAM
-
-/* Define if you have the function `gettimeofday'. */
-#undef HAVE_GETTIMEOFDAY
-
-/* Define if you have the function `getuid'. */
-#undef HAVE_GETUID
-
-/* Define if you have the function `getusershell'. */
-#undef HAVE_GETUSERSHELL
-
-/* define if you have a glibc-based system */
-#undef HAVE_GLIBC
-
-/* define if you have a glob() that groks GLOB_BRACE, GLOB_NOCHECK,
- GLOB_QUOTE, GLOB_TILDE, and GLOB_LIMIT */
-#undef HAVE_GLOB
-
-/* Define to 1 if you have the <glob.h> header file. */
-#undef HAVE_GLOB_H
-
-/* Define to 1 if you have the <grp.h> header file. */
-#undef HAVE_GRP_H
-
-/* Define to 1 if you have the `hstrerror' function. */
-#undef HAVE_HSTRERROR
-
-/* Define if you have the `h_errlist' variable. */
-#undef HAVE_H_ERRLIST
-
-/* define if your system declares h_errlist */
-#undef HAVE_H_ERRLIST_DECLARATION
-
-/* Define if you have the `h_errno' variable. */
-#undef HAVE_H_ERRNO
-
-/* define if your system declares h_errno */
-#undef HAVE_H_ERRNO_DECLARATION
-
-/* Define if you have the `h_nerr' variable. */
-#undef HAVE_H_NERR
-
-/* define if your system declares h_nerr */
-#undef HAVE_H_NERR_DECLARATION
-
-/* Define to 1 if you have the <ifaddrs.h> header file. */
-#undef HAVE_IFADDRS_H
-
-/* Define if you have the in6addr_loopback variable */
-#undef HAVE_IN6ADDR_LOOPBACK
-
-/* define */
-#undef HAVE_INET_ATON
-
-/* define */
-#undef HAVE_INET_NTOP
-
-/* define */
-#undef HAVE_INET_PTON
-
-/* Define if you have the function `initgroups'. */
-#undef HAVE_INITGROUPS
-
-/* Define to 1 if you have the `initstate' function. */
-#undef HAVE_INITSTATE
-
-/* define if you have a function init_MUTEX */
-#undef HAVE_INIT_MUTEX
-
-/* define if you have a init_waitqueue_head */
-#undef HAVE_INIT_WAITQUEUE_HEAD
-
-/* Define if you have the function `innetgr'. */
-#undef HAVE_INNETGR
-
-/* Define to 1 if you have the `int16' function. */
-#undef HAVE_INT16
-
-/* Define to 1 if you have the `int16_t' function. */
-#undef HAVE_INT16_T
-
-/* Define to 1 if you have the `int32' function. */
-#undef HAVE_INT32
-
-/* Define to 1 if you have the `int32_t' function. */
-#undef HAVE_INT32_T
-
-/* Define to 1 if you have the `int64_t' function. */
-#undef HAVE_INT64_T
-
-/* Define to 1 if you have the `int8_t' function. */
-#undef HAVE_INT8_T
-
-/* Define to 1 if you have the `intptr_t' function. */
-#undef HAVE_INTPTR_T
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define if you have IPv6. */
-#undef HAVE_IPV6
-
-/* Define if you have the function `iruserok'. */
-#undef HAVE_IRUSEROK
-
-/* Define to 1 if you have the `issetugid' function. */
-#undef HAVE_ISSETUGID
-
-/* define if you have kafs_settoken_rxkad */
-#undef HAVE_KAFS_SETTOKEN_RXKAD
-
-/* Define to 1 if you have the `kernel_aout_sysent' function. */
-#undef HAVE_KERNEL_AOUT_SYSENT
-
-/* Define to 1 if you have the `kernel_cache_purgevfs' function. */
-#undef HAVE_KERNEL_CACHE_PURGEVFS
-
-/* Define to 1 if you have the `kernel_cdevsw_add' function. */
-#undef HAVE_KERNEL_CDEVSW_ADD
-
-/* Define to 1 if you have the `kernel_debuglockmgr' function. */
-#undef HAVE_KERNEL_DEBUGLOCKMGR
-
-/* Define to 1 if you have the `kernel_devtoname' function. */
-#undef HAVE_KERNEL_DEVTONAME
-
-/* Define to 1 if you have the `kernel_doforce' function. */
-#undef HAVE_KERNEL_DOFORCE
-
-/* Define to 1 if you have the `kernel_genfs_mmap' function. */
-#undef HAVE_KERNEL_GENFS_MMAP
-
-/* Define to 1 if you have the `kernel_genfs_revoke' function. */
-#undef HAVE_KERNEL_GENFS_REVOKE
-
-/* Define to 1 if you have the `kernel_lf_advlock' function. */
-#undef HAVE_KERNEL_LF_ADVLOCK
-
-/* Define to 1 if you have the `kernel_lockmgr' function. */
-#undef HAVE_KERNEL_LOCKMGR
-
-/* Define to 1 if you have the `kernel_lockstatus' function. */
-#undef HAVE_KERNEL_LOCKSTATUS
-
-/* Define to 1 if you have the `kernel_memcpy' function. */
-#undef HAVE_KERNEL_MEMCPY
-
-/* Define to 1 if you have the `kernel_namei_hash' function. */
-#undef HAVE_KERNEL_NAMEI_HASH
-
-/* Define to 1 if you have the `kernel_nosys' function. */
-#undef HAVE_KERNEL_NOSYS
-
-/* Define to 1 if you have the `kernel_snprintf' function. */
-#undef HAVE_KERNEL_SNPRINTF
-
-/* Define to 1 if you have the `kernel_strlcpy' function. */
-#undef HAVE_KERNEL_STRLCPY
-
-/* Define to 1 if you have the `kernel_sys_lkmnosys' function. */
-#undef HAVE_KERNEL_SYS_LKMNOSYS
-
-/* Define to 1 if you have the `kernel_sys_nosys' function. */
-#undef HAVE_KERNEL_SYS_NOSYS
-
-/* Define to 1 if you have the `kernel_udev2dev' function. */
-#undef HAVE_KERNEL_UDEV2DEV
-
-/* Define to 1 if you have the `kernel_uma_zfree_arg' function. */
-#undef HAVE_KERNEL_UMA_ZFREE_ARG
-
-/* define if we only can include uvm headers */
-#undef HAVE_KERNEL_UVM_ONLY
-
-/* Define to 1 if you have the `kernel_vfs_add_vnodeops' function. */
-#undef HAVE_KERNEL_VFS_ADD_VNODEOPS
-
-/* Define to 1 if you have the `kernel_vfs_attach' function. */
-#undef HAVE_KERNEL_VFS_ATTACH
-
-/* Define to 1 if you have the `kernel_vfs_cache_lookup' function. */
-#undef HAVE_KERNEL_VFS_CACHE_LOOKUP
-
-/* Define to 1 if you have the `kernel_vfs_deallocate_syncvnode' function. */
-#undef HAVE_KERNEL_VFS_DEALLOCATE_SYNCVNODE
-
-/* Define to 1 if you have the `kernel_vfs_getnewfsid' function. */
-#undef HAVE_KERNEL_VFS_GETNEWFSID
-
-/* Define to 1 if you have the `kernel_vfs_getvfs' function. */
-#undef HAVE_KERNEL_VFS_GETVFS
-
-/* Define to 1 if you have the `kernel_vfs_object_create' function. */
-#undef HAVE_KERNEL_VFS_OBJECT_CREATE
-
-/* Define to 1 if you have the `kernel_vfs_opv_init' function. */
-#undef HAVE_KERNEL_VFS_OPV_INIT
-
-/* Define to 1 if you have the `kernel_vfs_opv_init_default' function. */
-#undef HAVE_KERNEL_VFS_OPV_INIT_DEFAULT
-
-/* Define to 1 if you have the `kernel_vfs_opv_init_explicit' function. */
-#undef HAVE_KERNEL_VFS_OPV_INIT_EXPLICIT
-
-/* Define to 1 if you have the `kernel_vfs_register' function. */
-#undef HAVE_KERNEL_VFS_REGISTER
-
-/* Define to 1 if you have the `kernel_vgonel' function. */
-#undef HAVE_KERNEL_VGONEL
-
-/* Define to 1 if you have the `kernel_vnode_pager_generic_getpages' function.
- */
-#undef HAVE_KERNEL_VNODE_PAGER_GENERIC_GETPAGES
-
-/* Define to 1 if you have the `kernel_vnode_pager_generic_putpages' function.
- */
-#undef HAVE_KERNEL_VNODE_PAGER_GENERIC_PUTPAGES
-
-/* Define to 1 if you have the `kernel_vnode_pager_setsize' function. */
-#undef HAVE_KERNEL_VNODE_PAGER_SETSIZE
-
-/* Define to 1 if you have the `kernel_vop_revoke' function. */
-#undef HAVE_KERNEL_VOP_REVOKE
-
-/* Define to 1 if you have the `kernel_vop_stdpathconf' function. */
-#undef HAVE_KERNEL_VOP_STDPATHCONF
-
-/* Define to 1 if you have the `kernel_zfree' function. */
-#undef HAVE_KERNEL_ZFREE
-
-/* Define to 1 if you have the `kernel_zfreei' function. */
-#undef HAVE_KERNEL_ZFREEI
-
-/* define if you have kerberos 4 */
-#undef HAVE_KRB4
-
-/* define if you have kerberos 5 */
-#undef HAVE_KRB5
-
-/* define if you have kerberos 4 compat */
-#undef HAVE_KRB5_COMPAT_KRB4
-
-/* Define to 1 if you have the `krb_afslog_uid' function. */
-#undef HAVE_KRB_AFSLOG_UID
-
-/* define if you have krb_get_default_principal */
-#undef HAVE_KRB_GET_DEFAULT_PRINCIPAL
-
-/* define if you have krb_get_default_tkt_root */
-#undef HAVE_KRB_GET_DEFAULT_TKT_ROOT
-
-/* define if you have krb_get_err_text */
-#undef HAVE_KRB_GET_ERR_TEXT
-
-/* define if you have krb_kdctimeofday */
-#undef HAVE_KRB_KDCTIMEOFDAY
-
-/* define if you have a struct krb_principal */
-#undef HAVE_KRB_PRINCIPAL
-
-/* Define to 1 if you have the <ktypes.h> header file. */
-#undef HAVE_KTYPES_H
-
-/* Define to 1 if you have the <kvm.h> header file. */
-#undef HAVE_KVM_H
-
-/* Define to 1 if you have the <libelf/nlist.h> header file. */
-#undef HAVE_LIBELF_NLIST_H
-
-/* Define to 1 if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
-/* Define to 1 if you have the <linux/devfs_fs.h> header file. */
-#undef HAVE_LINUX_DEVFS_FS_H
-
-/* Define to 1 if you have the <linux/devfs_fs_kernel.h> header file. */
-#undef HAVE_LINUX_DEVFS_FS_KERNEL_H
-
-/* Define to 1 if you have the `linux_kernel_int16_t' function. */
-#undef HAVE_LINUX_KERNEL_INT16_T
-
-/* Define to 1 if you have the `linux_kernel_int32_t' function. */
-#undef HAVE_LINUX_KERNEL_INT32_T
-
-/* Define to 1 if you have the `linux_kernel_int64_t' function. */
-#undef HAVE_LINUX_KERNEL_INT64_T
-
-/* Define to 1 if you have the `linux_kernel_int8_t' function. */
-#undef HAVE_LINUX_KERNEL_INT8_T
-
-/* Define to 1 if you have the `linux_kernel_uint16_t' function. */
-#undef HAVE_LINUX_KERNEL_UINT16_T
-
-/* Define to 1 if you have the `linux_kernel_uint32_t' function. */
-#undef HAVE_LINUX_KERNEL_UINT32_T
-
-/* Define to 1 if you have the `linux_kernel_uint64_t' function. */
-#undef HAVE_LINUX_KERNEL_UINT64_T
-
-/* Define to 1 if you have the `linux_kernel_uint8_t' function. */
-#undef HAVE_LINUX_KERNEL_UINT8_T
-
-/* Define to 1 if you have the <linux/stddef.h> header file. */
-#undef HAVE_LINUX_STDDEF_H
-
-/* define if you have a function list_del_init */
-#undef HAVE_LIST_DEL_INIT
-
-/* define if there exists a localtime_r */
-#undef HAVE_LOCALTIME_R
-
-/* Define to 1 if the system has the type `long long'. */
-#undef HAVE_LONG_LONG
-
-/* Define if you have the function `lstat'. */
-#undef HAVE_LSTAT
-
-/* Define to 1 if you have the <machine/asm.h> header file. */
-#undef HAVE_MACHINE_ASM_H
-
-/* Define to 1 if you have the <machine/regdef.h> header file. */
-#undef HAVE_MACHINE_REGDEF_H
-
-/* Define to 1 if you have the <mach/alpha/asm.h> header file. */
-#undef HAVE_MACH_ALPHA_ASM_H
-
-/* Define if you have the function `memmove'. */
-#undef HAVE_MEMMOVE
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the <miscfs/genfs/genfs.h> header file. */
-#undef HAVE_MISCFS_GENFS_GENFS_H
-
-/* Define to 1 if you have the <miscfs/syncfs/syncfs.h> header file. */
-#undef HAVE_MISCFS_SYNCFS_SYNCFS_H
-
-/* Define if you have the function `mkstemp'. */
-#undef HAVE_MKSTEMP
-
-/* Define to 1 if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* define if you have a ndbm library */
-#undef HAVE_NDBM
-
-/* Define to 1 if you have the <ndbm.h> header file. */
-#undef HAVE_NDBM_H
-
-/* Define to 1 if you have the <netdb.h> header file. */
-#undef HAVE_NETDB_H
-
-/* Define to 1 if you have the <netinet6/in6.h> header file. */
-#undef HAVE_NETINET6_IN6_H
-
-/* Define to 1 if you have the <netinet6/in6_var.h> header file. */
-#undef HAVE_NETINET6_IN6_VAR_H
-
-/* Define to 1 if you have the <netinet/in6.h> header file. */
-#undef HAVE_NETINET_IN6_H
-
-/* Define to 1 if you have the <netinet/in6_machtypes.h> header file. */
-#undef HAVE_NETINET_IN6_MACHTYPES_H
-
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#undef HAVE_NETINET_IN_H
-
-/* Define to 1 if you have the <netinet/in_systm.h> header file. */
-#undef HAVE_NETINET_IN_SYSTM_H
-
-/* Define to 1 if you have the <netinet/ip.h> header file. */
-#undef HAVE_NETINET_IP_H
-
-/* Define to 1 if you have the <netinet/tcp.h> header file. */
-#undef HAVE_NETINET_TCP_H
-
-/* Define to 1 if you have the <net/if_dl.h> header file. */
-#undef HAVE_NET_IF_DL_H
-
-/* Define to 1 if you have the <net/if.h> header file. */
-#undef HAVE_NET_IF_H
-
-/* Define to 1 if you have the <net/if_types.h> header file. */
-#undef HAVE_NET_IF_TYPES_H
-
-/* Define if NDBM really is DB (creates files *.db) */
-#undef HAVE_NEW_DB
-
-/* Define to 1 if you have the <nlist.h> header file. */
-#undef HAVE_NLIST_H
-
-/* Define to 1 if you have the `off64_t' function. */
-#undef HAVE_OFF64_T
-
-/* define if lockstatus takes one argument */
-#undef HAVE_ONE_ARGUMENT_LOCKSTATUS
-
-/* define if vget takes one argument */
-#undef HAVE_ONE_ARGUMENT_VGET
-
-/* define if VOP_LOCK takes one argument */
-#undef HAVE_ONE_ARGUMENT_VOP_LOCK
-
-/* Define to 1 if you have the `on_exit' function. */
-#undef HAVE_ON_EXIT
-
-/* define if your system declares optarg */
-#undef HAVE_OPTARG_DECLARATION
-
-/* define if your system declares opterr */
-#undef HAVE_OPTERR_DECLARATION
-
-/* define if your system declares optind */
-#undef HAVE_OPTIND_DECLARATION
-
-/* define if your system declares optopt */
-#undef HAVE_OPTOPT_DECLARATION
-
-/* Define if you have the `optreset' variable. */
-#undef HAVE_OPTRESET
-
-/* define if your system declares optreset */
-#undef HAVE_OPTRESET_DECLARATION
-
-/* Define to 1 if you have the <paths.h> header file. */
-#undef HAVE_PATHS_H
-
-/* Define to 1 if you have the `pidfile' function. */
-#undef HAVE_PIDFILE
-
-/* define if you have sigaction */
-#undef HAVE_POSIX_SIGNALS
-
-/* Define to 1 if you have the `pthread_create' function. */
-#undef HAVE_PTHREAD_CREATE
-
-/* Define if you have the function `putenv'. */
-#undef HAVE_PUTENV
-
-/* Define to 1 if you have the <pwd.h> header file. */
-#undef HAVE_PWD_H
-
-/* Define to 1 if you have the `random' function. */
-#undef HAVE_RANDOM
-
-/* Define if you have the function `rcmd'. */
-#undef HAVE_RCMD
-
-/* define if you have a function readline */
-#undef HAVE_READLINE
-
-/* Define if you have the function `readv'. */
-#undef HAVE_READV
-
-/* Define if you have the function `recvmsg'. */
-#undef HAVE_RECVMSG
-
-/* Define to 1 if you have the <regdef.h> header file. */
-#undef HAVE_REGDEF_H
-
-/* Define to 1 if you have the `register_t' function. */
-#undef HAVE_REGISTER_T
-
-/* define? */
-#undef HAVE_REPAIRABLE_HTONL
-
-/* Define to 1 if you have the <resolv.h> header file. */
-#undef HAVE_RESOLV_H
-
-/* Define to 1 if you have the `res_init' function. */
-#undef HAVE_RES_INIT
-
-/* Define to 1 if you have the `res_nsearch' function. */
-#undef HAVE_RES_NSEARCH
-
-/* Define to 1 if you have the `res_search' function. */
-#undef HAVE_RES_SEARCH
-
-/* Define to 1 if you have the <rpcsvc/dbm.h> header file. */
-#undef HAVE_RPCSVC_DBM_H
-
-/* Define to 1 if you have the <rpcsvc/ypclnt.h> header file. */
-#undef HAVE_RPCSVC_YPCLNT_H
-
-/* Define to 1 if the system has the type `sa_family_t'. */
-#undef HAVE_SA_FAMILY_T
-
-/* Define if you have the function `sendmsg'. */
-#undef HAVE_SENDMSG
-
-/* Define to 1 if you have the `setattrlist' function. */
-#undef HAVE_SETATTRLIST
-
-/* Define if you have the function `setegid'. */
-#undef HAVE_SETEGID
-
-/* Define if you have the function `setenv'. */
-#undef HAVE_SETENV
-
-/* Define if you have the function `seteuid'. */
-#undef HAVE_SETEUID
-
-/* Define to 1 if you have the `setlogin' function. */
-#undef HAVE_SETLOGIN
-
-/* Define to 1 if you have the `setprogname' function. */
-#undef HAVE_SETPROGNAME
-
-/* Define to 1 if you have the `setsockopt' function. */
-#undef HAVE_SETSOCKOPT
-
-/* Define to 1 if you have the `setstate' function. */
-#undef HAVE_SETSTATE
-
-/* Define to 1 if you have the <shadow.h> header file. */
-#undef HAVE_SHADOW_H
-
-/* define if ubc_lookup takes six arguments */
-#undef HAVE_SIX_ARGUMENT_UBC_LOOKUP
-
-/* define if you have a working snprintf */
-#undef HAVE_SNPRINTF
-
-/* Define to 1 if you have the `socket' function. */
-#undef HAVE_SOCKET
-
-/* Define to 1 if the system has the type `socklen_t'. */
-#undef HAVE_SOCKLEN_T
-
-/* Define to 1 if you have the `ssize_t' function. */
-#undef HAVE_SSIZE_T
-
-/* Define to 1 if you have the <standards.h> header file. */
-#undef HAVE_STANDARDS_H
-
-/* Define to 1 if you have the `statvfs' function. */
-#undef HAVE_STATVFS
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* We always have <stds.h>, needed by rxkad */
-#undef HAVE_STDS_H
-
-/* Define if you have the function `strcasecmp'. */
-#undef HAVE_STRCASECMP
-
-/* Define if you have the function `strdup'. */
-#undef HAVE_STRDUP
-
-/* Define if you have the function `strerror'. */
-#undef HAVE_STRERROR
-
-/* Define if you have the function `strftime'. */
-#undef HAVE_STRFTIME
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define if you have the function `strlcat'. */
-#undef HAVE_STRLCAT
-
-/* Define if you have the function `strlcpy'. */
-#undef HAVE_STRLCPY
-
-/* Define if you have the function `strlwr'. */
-#undef HAVE_STRLWR
-
-/* Define if you have the function `strncasecmp'. */
-#undef HAVE_STRNCASECMP
-
-/* Define if you have the function `strndup'. */
-#undef HAVE_STRNDUP
-
-/* Define if you have the function `strnlen'. */
-#undef HAVE_STRNLEN
-
-/* Define if you have the function `strptime'. */
-#undef HAVE_STRPTIME
-
-/* Define if you have the function `strsep'. */
-#undef HAVE_STRSEP
-
-/* Define if you have the function `strsep_copy'. */
-#undef HAVE_STRSEP_COPY
-
-/* Define to 1 if you have the `strsvis' function. */
-#undef HAVE_STRSVIS
-
-/* Define if you have the function `strtok_r'. */
-#undef HAVE_STRTOK_R
-
-/* Define to 1 if you have the `strtoll' function. */
-#undef HAVE_STRTOLL
-
-/* Define to 1 if you have the `strtoq' function. */
-#undef HAVE_STRTOQ
-
-/* Define to 1 if the system has the type `struct addrinfo'. */
-#undef HAVE_STRUCT_ADDRINFO
-
-/* Define if struct cdevsw has field d_bmaj */
-#undef HAVE_STRUCT_CDEVSW_D_BMAJ
-
-/* Define if struct cdevsw has field d_bogoparms */
-#undef HAVE_STRUCT_CDEVSW_D_BOGOPARMS
-
-/* Define if struct cdevsw has field d_bogoreset */
-#undef HAVE_STRUCT_CDEVSW_D_BOGORESET
-
-/* Define if struct cdevsw has field d_devtotty */
-#undef HAVE_STRUCT_CDEVSW_D_DEVTOTTY
-
-/* Define if struct cdevsw has field d_kqfilter */
-#undef HAVE_STRUCT_CDEVSW_D_KQFILTER
-
-/* Define if struct cdevsw has field d_maxio */
-#undef HAVE_STRUCT_CDEVSW_D_MAXIO
-
-/* Define if struct cdevsw has field d_psize */
-#undef HAVE_STRUCT_CDEVSW_D_PSIZE
-
-/* Define if struct cdevsw has field d_reset */
-#undef HAVE_STRUCT_CDEVSW_D_RESET
-
-/* Define if struct cdevsw has field d_spare */
-#undef HAVE_STRUCT_CDEVSW_D_SPARE
-
-/* Define if struct cdevsw has field d_stop */
-#undef HAVE_STRUCT_CDEVSW_D_STOP
-
-/* Define if struct componentname has field cn_hash */
-#undef HAVE_STRUCT_COMPONENTNAME_CN_HASH
-
-/* Define if struct dirent has field d_type. */
-#undef HAVE_STRUCT_DIRENT_D_TYPE
-
-/* Define to 1 if the system has the type `struct ifaddrs'. */
-#undef HAVE_STRUCT_IFADDRS
-
-/* Define if struct inode_operations has field default_file_ops */
-#undef HAVE_STRUCT_INODE_OPERATIONS_DEFAULT_FILE_OPS
-
-/* Define to 1 if the system has the type `struct iovec'. */
-#undef HAVE_STRUCT_IOVEC
-
-/* Define if struct mount has field mnt_syncer */
-#undef HAVE_STRUCT_MOUNT_MNT_SYNCER
-
-/* Define if struct mount has field m_info */
-#undef HAVE_STRUCT_MOUNT_M_INFO
-
-/* Define to 1 if the system has the type `struct msghdr'. */
-#undef HAVE_STRUCT_MSGHDR
-
-/* Define if struct proc has field p_sigctx. */
-#undef HAVE_STRUCT_PROC_P_SIGCTX
-
-/* Define if struct proc has field p_sigmask. */
-#undef HAVE_STRUCT_PROC_P_SIGMASK
-
-/* Define to 1 if the system has the type `struct sockaddr'. */
-#undef HAVE_STRUCT_SOCKADDR
-
-/* Define if struct sockaddr_in has field sin_len. */
-#undef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
-
-/* Define if struct sockaddr has field sa_len. */
-#undef HAVE_STRUCT_SOCKADDR_SA_LEN
-
-/* Define to 1 if the system has the type `struct sockaddr_storage'. */
-#undef HAVE_STRUCT_SOCKADDR_STORAGE
-
-/* define if you have struct spwd */
-#undef HAVE_STRUCT_SPWD
-
-/* Define if struct super_operations has field notify_change */
-#undef HAVE_STRUCT_SUPER_OPERATIONS_NOTIFY_CHANGE
-
-/* Define if struct sysent has field sy_flags */
-#undef HAVE_STRUCT_SYSENT_SY_FLAGS
-
-/* Define if struct sysent has field sy_info */
-#undef HAVE_STRUCT_SYSENT_SY_INFO
-
-/* Define if struct task_struct has field pending */
-#undef HAVE_STRUCT_TASK_STRUCT_PENDING
-
-/* Define if struct tm has field tm_gmtoff. */
-#undef HAVE_STRUCT_TM_TM_GMTOFF
-
-/* Define if struct tm has field tm_zone. */
-#undef HAVE_STRUCT_TM_TM_ZONE
-
-/* Define if struct uio has field uio_procp */
-#undef HAVE_STRUCT_UIO_UIO_PROCP
-
-/* Define if struct vfsconf has field vfc_mountroot */
-#undef HAVE_STRUCT_VFSCONF_VFC_MOUNTROOT
-
-/* Define if struct vfsconf has field vfc_refcount */
-#undef HAVE_STRUCT_VFSCONF_VFC_REFCOUNT
-
-/* Define if struct vfsops has field vfs_checkexp */
-#undef HAVE_STRUCT_VFSOPS_VFS_CHECKEXP
-
-/* Define if struct vfsops has field vfs_done */
-#undef HAVE_STRUCT_VFSOPS_VFS_DONE
-
-/* Define if struct vfsops has field vfs_freevfs */
-#undef HAVE_STRUCT_VFSOPS_VFS_FREEVFS
-
-/* Define if struct vfsops has field vfs_mount */
-#undef HAVE_STRUCT_VFSOPS_VFS_MOUNT
-
-/* Define if struct vfsops has field vfs_mountroot */
-#undef HAVE_STRUCT_VFSOPS_VFS_MOUNTROOT
-
-/* Define if struct vfsops has field vfs_name */
-#undef HAVE_STRUCT_VFSOPS_VFS_NAME
-
-/* Define if struct vfsops has field vfs_oid */
-#undef HAVE_STRUCT_VFSOPS_VFS_OID
-
-/* Define if struct vfsops has field vfs_opv_descs */
-#undef HAVE_STRUCT_VFSOPS_VFS_OPV_DESCS
-
-/* Define if struct vfsops has field vfs_reinit */
-#undef HAVE_STRUCT_VFSOPS_VFS_REINIT
-
-/* Define if struct vfsops has field vfs_smoothsync */
-#undef HAVE_STRUCT_VFSOPS_VFS_SMOOTHSYNC
-
-/* Define if struct vfsops has field vfs_swapvp */
-#undef HAVE_STRUCT_VFSOPS_VFS_SWAPVP
-
-/* Define if struct vfsops has field vfs_uninit */
-#undef HAVE_STRUCT_VFSOPS_VFS_UNINIT
-
-/* Define if struct ViceIoctl has field in */
-#undef HAVE_STRUCT_VICEIOCTL_IN
-
-/* Define if struct vop_fsync_args has field a_flags */
-#undef HAVE_STRUCT_VOP_FSYNC_ARGS_A_FLAGS
-
-/* Define if struct vop_getpages_args has field a_offset */
-#undef HAVE_STRUCT_VOP_GETPAGES_ARGS_A_OFFSET
-
-/* Define if struct vop_putpages_args has field a_sync */
-#undef HAVE_STRUCT_VOP_PUTPAGES_ARGS_A_SYNC
-
-/* define if struct winsize is declared in sys/termios.h */
-#undef HAVE_STRUCT_WINSIZE
-
-/* Define to 1 if you have the `strunvis' function. */
-#undef HAVE_STRUNVIS
-
-/* Define if you have the function `strupr'. */
-#undef HAVE_STRUPR
-
-/* Define to 1 if you have the `strvis' function. */
-#undef HAVE_STRVIS
-
-/* Define to 1 if you have the `strvisx' function. */
-#undef HAVE_STRVISX
-
-/* Define to 1 if you have the `svis' function. */
-#undef HAVE_SVIS
-
-/* Define if you have the function `swab'. */
-#undef HAVE_SWAB
-
-/* Define to 1 if you have the `sysconf' function. */
-#undef HAVE_SYSCONF
-
-/* Define to 1 if you have the `sysctl' function. */
-#undef HAVE_SYSCTL
-
-/* Define to 1 if you have the `syslog' function. */
-#undef HAVE_SYSLOG
-
-/* Define to 1 if you have the <syslog.h> header file. */
-#undef HAVE_SYSLOG_H
-
-/* Define to 1 if you have the <sys/attr.h> header file. */
-#undef HAVE_SYS_ATTR_H
-
-/* Define to 1 if you have the <sys/bitypes.h> header file. */
-#undef HAVE_SYS_BITYPES_H
-
-/* Define to 1 if you have the <sys/bswap.h> header file. */
-#undef HAVE_SYS_BSWAP_H
-
-/* Define to 1 if you have the <sys/cdefs.h> header file. */
-#undef HAVE_SYS_CDEFS_H
-
-/* Define to 1 if you have the <sys/dir.h> header file. */
-#undef HAVE_SYS_DIR_H
-
-/* Define to 1 if you have the <sys/file.h> header file. */
-#undef HAVE_SYS_FILE_H
-
-/* Define to 1 if you have the <sys/inttypes.h> header file. */
-#undef HAVE_SYS_INTTYPES_H
-
-/* Define to 1 if you have the <sys/ioccom.h> header file. */
-#undef HAVE_SYS_IOCCOM_H
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#undef HAVE_SYS_IOCTL_H
-
-/* Define to 1 if you have the <sys/libkern.h> header file. */
-#undef HAVE_SYS_LIBKERN_H
-
-/* Define to 1 if you have the <sys/lkm.h> header file. */
-#undef HAVE_SYS_LKM_H
-
-/* Define to 1 if you have the <sys/lock.h> header file. */
-#undef HAVE_SYS_LOCK_H
-
-/* Define to 1 if you have the <sys/mkdev.h> header file. */
-#undef HAVE_SYS_MKDEV_H
-
-/* Define to 1 if you have the <sys/mman.h> header file. */
-#undef HAVE_SYS_MMAN_H
-
-/* Define to 1 if you have the <sys/module.h> header file. */
-#undef HAVE_SYS_MODULE_H
-
-/* Define to 1 if you have the <sys/mount.h> header file. */
-#undef HAVE_SYS_MOUNT_H
-
-/* Define to 1 if you have the <sys/mutex.h> header file. */
-#undef HAVE_SYS_MUTEX_H
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define to 1 if you have the <sys/poll.h> header file. */
-#undef HAVE_SYS_POLL_H
-
-/* Define to 1 if you have the <sys/prctl.h> header file. */
-#undef HAVE_SYS_PRCTL_H
-
-/* Define to 1 if you have the <sys/proc.h> header file. */
-#undef HAVE_SYS_PROC_H
-
-/* Define to 1 if you have the <sys/queue.h> header file. */
-#undef HAVE_SYS_QUEUE_H
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#undef HAVE_SYS_RESOURCE_H
-
-/* Define to 1 if you have the <sys/select.h> header file. */
-#undef HAVE_SYS_SELECT_H
-
-/* Define to 1 if you have the <sys/selinfo.h> header file. */
-#undef HAVE_SYS_SELINFO_H
-
-/* Define to 1 if you have the <sys/signalvar.h> header file. */
-#undef HAVE_SYS_SIGNALVAR_H
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#undef HAVE_SYS_SOCKET_H
-
-/* Define to 1 if you have the <sys/sockio.h> header file. */
-#undef HAVE_SYS_SOCKIO_H
-
-/* Define to 1 if you have the <sys/statfs.h> header file. */
-#undef HAVE_SYS_STATFS_H
-
-/* Define to 1 if you have the <sys/statvfs.h> header file. */
-#undef HAVE_SYS_STATVFS_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/syscallargs.h> header file. */
-#undef HAVE_SYS_SYSCALLARGS_H
-
-/* Define to 1 if you have the <sys/sysctl.h> header file. */
-#undef HAVE_SYS_SYSCTL_H
-
-/* Define to 1 if you have the <sys/sysent.h> header file. */
-#undef HAVE_SYS_SYSENT_H
-
-/* Define to 1 if you have the <sys/sysproto.h> header file. */
-#undef HAVE_SYS_SYSPROTO_H
-
-/* Define to 1 if you have the <sys/systm.h> header file. */
-#undef HAVE_SYS_SYSTM_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
-/* Define to 1 if you have the <sys/tty.h> header file. */
-#undef HAVE_SYS_TTY_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <sys/ubc.h> header file. */
-#undef HAVE_SYS_UBC_H
-
-/* Define to 1 if you have the <sys/uio.h> header file. */
-#undef HAVE_SYS_UIO_H
-
-/* Define to 1 if you have the <sys/user.h> header file. */
-#undef HAVE_SYS_USER_H
-
-/* Define to 1 if you have the <sys/utsname.h> header file. */
-#undef HAVE_SYS_UTSNAME_H
-
-/* Define to 1 if you have the <sys/vfs.h> header file. */
-#undef HAVE_SYS_VFS_H
-
-/* Define to 1 if you have the <sys/vfs_proto.h> header file. */
-#undef HAVE_SYS_VFS_PROTO_H
-
-/* Define to 1 if you have the <sys/vnode.h> header file. */
-#undef HAVE_SYS_VNODE_H
-
-/* Define to 1 if you have the <sys/wait.h> header file. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define to 1 if you have the <termios.h> header file. */
-#undef HAVE_TERMIOS_H
-
-/* Define to 1 if you have the `tf_init' function. */
-#undef HAVE_TF_INIT
-
-/* Define to 1 if you have the `tgetent' function. */
-#undef HAVE_TGETENT
-
-/* define if selrecord takes three arguments */
-#undef HAVE_THREE_ARGUMENT_SELRECORD
-
-/* define if vfs_busy takes three arguments */
-#undef HAVE_THREE_ARGUMENT_VFS_BUSY
-
-/* define if vfs_name_hash takes three arguments */
-#undef HAVE_THREE_ARGUMENT_VFS_NAME_HASH
-
-/* define if vget takes three arguments */
-#undef HAVE_THREE_ARGUMENT_VGET
-
-/* define if VOP_LOCK takes three arguments */
-#undef HAVE_THREE_ARGUMENT_VOP_LOCK
-
-/* Define to 1 if you have the `thr_yield' function. */
-#undef HAVE_THR_YIELD
-
-/* Define if you have the `timezone' variable. */
-#undef HAVE_TIMEZONE
-
-/* define if your system declares timezone */
-#undef HAVE_TIMEZONE_DECLARATION
-
-/* define if lockstatus takes two arguments */
-#undef HAVE_TWO_ARGUMENT_LOCKSTATUS
-
-/* define if suser takes two arguments */
-#undef HAVE_TWO_ARGUMENT_SUSER
-
-/* define if vfs_getnewfsid takes two arguments */
-#undef HAVE_TWO_ARGUMENT_VFS_GETNEWFSID
-
-/* define if vfs_busy takes two arguments */
-#undef HAVE_TWO_ARGUMENT_VFS_BUSY
-
-/* define if vget takes two arguments */
-#undef HAVE_TWO_ARGUMENT_VGET
-
-/* define if VOP_LOCK takes two arguments */
-#undef HAVE_TWO_ARGUMENT_VOP_LOCK
-
-/* Define to 1 if you have the `uint16_t' function. */
-#undef HAVE_UINT16_T
-
-/* Define to 1 if you have the `uint32_t' function. */
-#undef HAVE_UINT32_T
-
-/* Define to 1 if you have the `uint64_t' function. */
-#undef HAVE_UINT64_T
-
-/* Define to 1 if you have the `uint8_t' function. */
-#undef HAVE_UINT8_T
-
-/* Define to 1 if you have the `uintptr_t' function. */
-#undef HAVE_UINTPTR_T
-
-/* Define to 1 if you have the `uname' function. */
-#undef HAVE_UNAME
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define if you have the function `unsetenv'. */
-#undef HAVE_UNSETENV
-
-/* Define to 1 if you have the `unvis' function. */
-#undef HAVE_UNVIS
-
-/* Define to 1 if you have the <userconf.h> header file. */
-#undef HAVE_USERCONF_H
-
-/* Define to 1 if you have the <usersec.h> header file. */
-#undef HAVE_USERSEC_H
-
-/* Define to 1 if you have the <util.h> header file. */
-#undef HAVE_UTIL_H
-
-/* Define to 1 if you have the <uvm/uvm_extern.h> header file. */
-#undef HAVE_UVM_UVM_EXTERN_H
-
-/* Define to 1 if you have the `u_int16' function. */
-#undef HAVE_U_INT16
-
-/* Define to 1 if you have the `u_int16_t' function. */
-#undef HAVE_U_INT16_T
-
-/* Define to 1 if you have the `u_int32' function. */
-#undef HAVE_U_INT32
-
-/* Define to 1 if you have the `u_int32_t' function. */
-#undef HAVE_U_INT32_T
-
-/* Define to 1 if you have the `u_int64_t' function. */
-#undef HAVE_U_INT64_T
-
-/* Define to 1 if you have the `u_int8_t' function. */
-#undef HAVE_U_INT8_T
-
-/* Define to 1 if you have the `vasnprintf' function. */
-#undef HAVE_VASNPRINTF
-
-/* Define to 1 if you have the `vasprintf' function. */
-#undef HAVE_VASPRINTF
-
-/* Define if you have the function `verr'. */
-#undef HAVE_VERR
-
-/* Define if you have the function `verrx'. */
-#undef HAVE_VERRX
-
-/* Define to 1 if you have the `vis' function. */
-#undef HAVE_VIS
-
-/* Define to 1 if you have the <vis.h> header file. */
-#undef HAVE_VIS_H
-
-/* Define to 1 if you have the <vm/uma.h> header file. */
-#undef HAVE_VM_UMA_H
-
-/* Define to 1 if you have the <vm/vm_extern.h> header file. */
-#undef HAVE_VM_VM_EXTERN_H
-
-/* Define to 1 if you have the <vm/vm.h> header file. */
-#undef HAVE_VM_VM_H
-
-/* Define to 1 if you have the <vm/vm_object.h> header file. */
-#undef HAVE_VM_VM_OBJECT_H
-
-/* Define to 1 if you have the <vm/vm_pager.h> header file. */
-#undef HAVE_VM_VM_PAGER_H
-
-/* Define to 1 if you have the <vm/vm_zone.h> header file. */
-#undef HAVE_VM_VM_ZONE_H
-
-/* Define to 1 if you have the <vm/vnode_pager.h> header file. */
-#undef HAVE_VM_VNODE_PAGER_H
-
-/* define if you have a vop_t */
-#undef HAVE_VOP_T
-
-/* define if you have a working vsnprintf */
-#undef HAVE_VSNPRINTF
-
-/* Define if you have the function `vsyslog'. */
-#undef HAVE_VSYSLOG
-
-/* Define if you have the function `vwarn'. */
-#undef HAVE_VWARN
-
-/* Define if you have the function `vwarnx'. */
-#undef HAVE_VWARNX
-
-/* define if you have a wait_queue_head_t */
-#undef HAVE_WAIT_QUEUE_HEAD_T
-
-/* define if you have a wait_queue_task_list */
-#undef HAVE_WAIT_QUEUE_TASK_LIST
-
-/* Define if you have the function `warn'. */
-#undef HAVE_WARN
-
-/* Define if you have the function `warnx'. */
-#undef HAVE_WARNX
-
-/* Define to 1 if you have the <winsock.h> header file. */
-#undef HAVE_WINSOCK_H
-
-/* Define if you have the function `writev'. */
-#undef HAVE_WRITEV
-
-/* define if struct winsize has ws_xpixel */
-#undef HAVE_WS_XPIXEL
-
-/* define if struct winsize has ws_ypixel */
-#undef HAVE_WS_YPIXEL
-
-/* Define if you have the `_res' variable. */
-#undef HAVE__RES
-
-/* define if your system declares _res */
-#undef HAVE__RES_DECLARATION
-
-/* define if your compiler has __attribute__ */
-#undef HAVE___ATTRIBUTE__
-
-/* define if your compiler has __FUNCTION__ */
-#undef HAVE___FUNCTION__
-
-/* Define if you have the `__progname' variable. */
-#undef HAVE___PROGNAME
-
-/* define if your system declares __progname */
-#undef HAVE___PROGNAME_DECLARATION
-
-/* define this if on Irix6.4 or higher */
-#undef IRIX_64
-
-/* define if you have kerberos */
-#undef KERBEROS
-
-/* define if the system is missing a prototype for asnprintf() */
-#undef NEED_ASNPRINTF_PROTO
-
-/* define if the system is missing a prototype for asprintf() */
-#undef NEED_ASPRINTF_PROTO
-
-/* define if the system is missing a prototype for crypt() */
-#undef NEED_CRYPT_PROTO
-
-/* define if the system is missing a prototype for gethostname() */
-#undef NEED_GETHOSTNAME_PROTO
-
-/* define if the system is missing a prototype for getusershell() */
-#undef NEED_GETUSERSHELL_PROTO
-
-/* define if the system is missing a prototype for glob() */
-#undef NEED_GLOB_PROTO
-
-/* define if the system is missing a prototype for hstrerror() */
-#undef NEED_HSTRERROR_PROTO
-
-/* define if the system is missing a prototype for inet_aton() */
-#undef NEED_INET_ATON_PROTO
-
-/* define if the system is missing a prototype for issignal() */
-#undef NEED_ISSIGNAL_PROTO
-
-/* define if the system is missing a prototype for mkstemp() */
-#undef NEED_MKSTEMP_PROTO
-
-/* define if the system is missing a prototype for select() */
-#undef NEED_SELECT_PROTO
-
-/* define if the system is missing a prototype for setenv() */
-#undef NEED_SETENV_PROTO
-
-/* libsl need sl_apropos */
-#undef NEED_SLCOMPAT_SL_APROPOS
-
-/* define if the system is missing a prototype for snprintf() */
-#undef NEED_SNPRINTF_PROTO
-
-/* define if the system is missing a prototype for strncmp() */
-#undef NEED_STRNCMP_PROTO
-
-/* define if the system is missing a prototype for strndup() */
-#undef NEED_STRNDUP_PROTO
-
-/* define if the system is missing a prototype for strsep() */
-#undef NEED_STRSEP_PROTO
-
-/* define if the system is missing a prototype for strsvis() */
-#undef NEED_STRSVIS_PROTO
-
-/* define if the system is missing a prototype for strtok_r() */
-#undef NEED_STRTOK_R_PROTO
-
-/* define if the system is missing a prototype for strunvis() */
-#undef NEED_STRUNVIS_PROTO
-
-/* define if the system is missing a prototype for strvisx() */
-#undef NEED_STRVISX_PROTO
-
-/* define if the system is missing a prototype for strvis() */
-#undef NEED_STRVIS_PROTO
-
-/* define if the system is missing a prototype for svis() */
-#undef NEED_SVIS_PROTO
-
-/* define if the system is missing a prototype for ubc_pushdirty() */
-#undef NEED_UBC_PUSHDIRTY_PROTO
-
-/* define if the system is missing a prototype for unsetenv() */
-#undef NEED_UNSETENV_PROTO
-
-/* define if the system is missing a prototype for unvis() */
-#undef NEED_UNVIS_PROTO
-
-/* define if the system is missing a prototype for vasnprintf() */
-#undef NEED_VASNPRINTF_PROTO
-
-/* define if the system is missing a prototype for vasprintf() */
-#undef NEED_VASPRINTF_PROTO
-
-/* define if the system is missing a prototype for vgonel() */
-#undef NEED_VGONEL_PROTO
-
-/* define if you need 32 bit compat pioctl */
-#undef NEED_VICEIOCTL32
-
-/* define if the system is missing a prototype for vis() */
-#undef NEED_VIS_PROTO
-
-/* define if the system is missing a prototype for vn_writechk() */
-#undef NEED_VN_WRITECHK_PROTO
-
-/* define if the system is missing a prototype for vsnprintf() */
-#undef NEED_VSNPRINTF_PROTO
-
-/* define if prototype of openlog is compatible with void openlog(const char
- *, int, int) */
-#undef OPENLOG_PROTO_COMPATIBLE
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define if getlogin has POSIX flavour (and not BSD). */
-#undef POSIX_GETLOGIN
-
-/* define this if your as understands .register */
-#undef PROG_AS_UNDERSTANDS_REGISTER
-
-/* Define if you have the readline package. */
-#undef READLINE
-
-/* Define as the return type of signal handlers (`int' or `void'). */
-#undef RETSIGTYPE
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Version number of package */
-#undef VERSION
-
-/* Define if signal handlers return void. */
-#undef VOID_RETSIGTYPE
-
-/* define if target is big endian */
-#undef WORDS_BIGENDIAN
-
-/* Define to 1 if the X Window System is missing or not being used. */
-#undef X_DISPLAY_MISSING
-
-/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
- `char[]'. */
-#undef YYTEXT_POINTER
-
-
-/*
- * Defining this enables us to get the definition of `sigset_t' and
- * other importatnt definitions on Solaris.
- */
-
-#ifndef __EXTENSIONS__
-#define __EXTENSIONS__
-#endif
-
-
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef gid_t
-
-/* Define as `__inline' if that's what the C compiler calls it, or to nothing
- if it is not supported. */
-#undef inline
-
-/* Define to `int' if <sys/types.h> does not define. */
-#undef pid_t
-
-/* Define to `unsigned' if <sys/types.h> does not define. */
-#undef size_t
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-#undef uid_t
-
-
-#if !(defined(USING_ASM) || defined(_KERNEL) || defined(__KERNEL__) || defined(_LKM) || defined(KERNEL))
-#if ENDIANESS_IN_SYS_PARAM_H
-# include <sys/types.h>
-# include <sys/param.h>
-# if BYTE_ORDER == BIG_ENDIAN
-# define WORDS_BIGENDIAN 1
-# endif
-#endif
-#endif
-
-
-#ifdef VOID_RETSIGTYPE
-#define SIGRETURN(x) return
-#else
-#define SIGRETURN(x) return (RETSIGTYPE)(x)
-#endif
-
-#ifdef BROKEN_REALLOC
-#define realloc(X, Y) isoc_realloc((X), (Y))
-#define isoc_realloc(X, Y) ((X) ? realloc((X), (Y)) : malloc(Y))
-#endif
diff --git a/usr.sbin/afs/src/include/kafs.h b/usr.sbin/afs/src/include/kafs.h
deleted file mode 100644
index aaf21a5b03c..00000000000
--- a/usr.sbin/afs/src/include/kafs.h
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: kafs.h,v 1.49 2003/01/09 16:46:56 lha Exp $ */
-
-#ifndef __KAFS_H
-#define __KAFS_H
-
-/* XXX must include krb5.h or krb.h */
-
-/* sys/ioctl.h must be included manually before kafs.h */
-
-/*
- */
-#define AFSCALL_PIOCTL 20
-#define AFSCALL_SETPAG 21
-
-#ifndef _VICEIOCTL
-#define _VICEIOCTL(id) ((unsigned int ) _IOW('V', id, struct ViceIoctl))
-#endif /* _VICEIOCTL */
-
-#ifndef _ARLAIOCTL
-#define _ARLAIOCTL(id) ((unsigned int ) _IOW('A', id, struct ViceIoctl))
-#endif /* _ARLAIOCTL */
-
-#ifndef _AFSCOMMONIOCTL
-#define _AFSCOMMONIOCTL(id) ((unsigned int ) _IOW('C', id, struct ViceIoctl))
-#endif /* _AFSCOMMONIOCTL */
-
-/*
- * this is for operating systems that support a 32-bit API while being
- * 64-bit (such as solaris 7 in 64 bit mode). The ioctls will get
- * assigned different numbers in 32bits mode and we need to support
- * both.
- */
-
-#ifdef NEED_VICEIOCTL32
-
-#ifndef _VICEIOCTL32
-#define _VICEIOCTL32(id) ((unsigned int ) _IOW('V', id, struct ViceIoctl32))
-#endif /* _VICEIOCTL32 */
-
-#ifndef _ARLAIOCTL32
-#define _ARLAIOCTL32(id) ((unsigned int ) _IOW('A', id, struct ViceIoctl32))
-#endif /* _ARLAIOCTL32 */
-
-#ifndef _AFSCOMMONIOCTL32
-#define _AFSCOMMONIOCTL32(id) ((unsigned int ) _IOW('C', id, struct ViceIoctl32))
-#endif /* _AFSCOMMONIOCTL32 */
-
-#ifndef _VICEIOCTL64
-#define _VICEIOCTL64(id) ((unsigned int ) _IOW('V', id, struct ViceIoctl64))
-#endif /* _VICEIOCTL64 */
-
-#ifndef _ARLAIOCTL64
-#define _ARLAIOCTL64(id) ((unsigned int ) _IOW('A', id, struct ViceIoctl64))
-#endif /* _ARLAIOCTL64 */
-
-#ifndef _AFSCOMMONIOCTL64
-#define _AFSCOMMONIOCTL64(id) ((unsigned int ) _IOW('C', id, struct ViceIoctl64))
-#endif /* _AFSCOMMONIOCTL64 */
-
-#endif /* NEED_VICEIOCTL32 */
-
-#include <nnpfs/nnpfs_pioctl.h>
-
-/*
- * ioctls
- */
-
-#define VIOCCLOSEWAIT_32 _VICEIOCTL32(1)
-#define VIOCABORT_32 _VICEIOCTL32(2)
-#define VIOIGETCELL_32 _VICEIOCTL32(3)
-
-/*
- * pioctls
- */
-
-#define AIOC_STATISTICS _ARLAIOCTL(1) /* arla: fetch statistics */
-#define AIOC_PTSNAMETOID _ARLAIOCTL(2) /* arla: pts name to id */
-#define AIOC_GETCACHEPARAMS _ARLAIOCTL(3) /* arla: get cache params */
-#define AIOC_GETPREFETCH _ARLAIOCTL(4) /* arla: get prefetch value */
-#define AIOC_SETPREFETCH _ARLAIOCTL(5) /* arla: set prefetch value */
-#define AFSCOMMONIOC_GKK5SETTOK _ARLAIOCTL(6) /* gk k5 set token */
-
-#define AFSCOMMONIOC_NEWALIAS _AFSCOMMONIOCTL(1) /* common: ... */
-#define AFSCOMMONIOC_LISTALIAS _AFSCOMMONIOCTL(2) /* common: ... */
-
-#ifdef NEED_VICEIOCTL32
-
-/* and now for the 32-bit versions */
-
-#define VIOCSETAL_32 _VICEIOCTL32(1)
-#define VIOCGETAL_32 _VICEIOCTL32(2)
-#define VIOCSETTOK_32 _VICEIOCTL32(3)
-#define VIOCGETVOLSTAT_32 _VICEIOCTL32(4)
-#define VIOCSETVOLSTAT_32 _VICEIOCTL32(5)
-#define VIOCFLUSH_32 _VICEIOCTL32(6)
-#define VIOCSTAT_32 _VICEIOCTL32(7)
-#define VIOCGETTOK_32 _VICEIOCTL32(8)
-#define VIOCUNLOG_32 _VICEIOCTL32(9)
-#define VIOCCKSERV_32 _VICEIOCTL32(10)
-#define VIOCCKBACK_32 _VICEIOCTL32(11)
-#define VIOCCKCONN_32 _VICEIOCTL32(12)
-#define VIOCGETTIME_32 _VICEIOCTL32(13)
-#define VIOCWHEREIS_32 _VICEIOCTL32(14)
-#define VIOCPREFETCH_32 _VICEIOCTL32(15)
-#define VIOCNOP_32 _VICEIOCTL32(16)
-#define VIOCENGROUP_32 _VICEIOCTL32(17)
-#define VIOCDISGROUP_32 _VICEIOCTL32(18)
-#define VIOCLISTGROUPS_32 _VICEIOCTL32(19)
-#define VIOCACCESS_32 _VICEIOCTL32(20)
-#define VIOCUNPAG_32 _VICEIOCTL32(21)
-#define VIOCGETFID_32 _VICEIOCTL32(22)
-#define VIOCWAITFOREVER_32 _VICEIOCTL32(23)
-#define VIOCSETCACHESIZE_32 _VICEIOCTL32(24)
-#define VIOCFLUSHCB_32 _VICEIOCTL32(25)
-#define VIOCNEWCELL_32 _VICEIOCTL32(26)
-#define VIOCGETCELL_32 _VICEIOCTL32(27)
-#define VIOC_AFS_DELETE_MT_PT_32 _VICEIOCTL32(28)
-#define VIOC_AFS_STAT_MT_PT_32 _VICEIOCTL32(29)
-#define VIOC_FILE_CELL_NAME_32 _VICEIOCTL32(30)
-#define VIOC_GET_WS_CELL_32 _VICEIOCTL32(31)
-#define VIOC_AFS_MARINER_HOST_32 _VICEIOCTL32(32)
-#define VIOC_GET_PRIMARY_CELL_32 _VICEIOCTL32(33)
-#define VIOC_VENUSLOG_32 _VICEIOCTL32(34)
-#define VIOC_GETCELLSTATUS_32 _VICEIOCTL32(35)
-#define VIOC_SETCELLSTATUS_32 _VICEIOCTL32(36)
-#define VIOC_FLUSHVOLUME_32 _VICEIOCTL32(37)
-#define VIOC_AFS_SYSNAME_32 _VICEIOCTL32(38)
-#define VIOC_EXPORTAFS_32 _VICEIOCTL32(39)
-#define VIOCGETCACHEPARAMS_32 _VICEIOCTL32(40)
-#define VIOCCONNECTMODE_32 _VICEIOCTL32(41)
-#define VIOCGETVCXSTATUS_32 _VICEIOCTL32(41)
-#define VIOC_SETSPREFS_3233 _VICEIOCTL32(42)
-#define VIOC_GETSPREFS_32 _VICEIOCTL32(43)
-#define VIOC_GAG_32 _VICEIOCTL32(44)
-#define VIOC_TWIDDLE_32 _VICEIOCTL32(45)
-#define VIOC_SETSPREFS_32 _VICEIOCTL32(46)
-#define VIOC_STORBEHIND_32 _VICEIOCTL32(47)
-#define VIOC_GCPAGS_32 _VICEIOCTL32(48)
-#define VIOC_GETINITPARAMS_32 _VICEIOCTL32(49)
-#define VIOC_GETCPREFS_32 _VICEIOCTL32(50)
-#define VIOC_SETCPREFS_32 _VICEIOCTL32(51)
-#define VIOC_FLUSHMOUNT_32 _VICEIOCTL32(52)
-#define VIOC_RXSTATPROC_32 _VICEIOCTL32(53)
-#define VIOC_RXSTATPEER_32 _VICEIOCTL32(54)
-
-#define VIOC_GETRXKCRYPT_32 _VICEIOCTL32(55) /* 48 in some implementations */
-#define VIOC_SETRXKCRYPT_32 _VICEIOCTL32(56) /* with cryptosupport in afs */
-#define VIOC_FPRIOSTATUS_32 _VICEIOCTL32(57)
-
-#define VIOC_FHGET_32 _VICEIOCTL32(58)
-#define VIOC_FHOPEN_32 _VICEIOCTL32(59)
-
-#define VIOC_NNPFSDEBUG_32 _VICEIOCTL32(60)
-#define VIOC_ARLADEBUG_32 _VICEIOCTL32(61)
-
-#define VIOC_AVIATOR_32 _VICEIOCTL32(62)
-
-#define VIOC_NNPFSDEBUG_PRINT_32 _VICEIOCTL32(63)
-
-#define VIOC_CALCULATE_CACHE_32 _VICEIOCTL32(64)
-
-#define VIOC_BREAKCALLBACK_32 _VICEIOCTL32(65)
-#define VIOC_PREFETCHTAPE_32 _VICEIOCTL32(66)
-#define VIOC_RESIDENCY_CMD_32 _VICEIOCTL32(67)
-
-/* and now for the 64-bit versions */
-
-#define VIOCSETAL_64 _VICEIOCTL64(1)
-#define VIOCGETAL_64 _VICEIOCTL64(2)
-#define VIOCSETTOK_64 _VICEIOCTL64(3)
-#define VIOCGETVOLSTAT_64 _VICEIOCTL64(4)
-#define VIOCSETVOLSTAT_64 _VICEIOCTL64(5)
-#define VIOCFLUSH_64 _VICEIOCTL64(6)
-#define VIOCSTAT_64 _VICEIOCTL64(7)
-#define VIOCGETTOK_64 _VICEIOCTL64(8)
-#define VIOCUNLOG_64 _VICEIOCTL64(9)
-#define VIOCCKSERV_64 _VICEIOCTL64(10)
-#define VIOCCKBACK_64 _VICEIOCTL64(11)
-#define VIOCCKCONN_64 _VICEIOCTL64(12)
-#define VIOCGETTIME_64 _VICEIOCTL64(13)
-#define VIOCWHEREIS_64 _VICEIOCTL64(14)
-#define VIOCPREFETCH_64 _VICEIOCTL64(15)
-#define VIOCNOP_64 _VICEIOCTL64(16)
-#define VIOCENGROUP_64 _VICEIOCTL64(17)
-#define VIOCDISGROUP_64 _VICEIOCTL64(18)
-#define VIOCLISTGROUPS_64 _VICEIOCTL64(19)
-#define VIOCACCESS_64 _VICEIOCTL64(20)
-#define VIOCUNPAG_64 _VICEIOCTL64(21)
-#define VIOCGETFID_64 _VICEIOCTL64(22)
-#define VIOCWAITFOREVER_64 _VICEIOCTL64(23)
-#define VIOCSETCACHESIZE_64 _VICEIOCTL64(24)
-#define VIOCFLUSHCB_64 _VICEIOCTL64(25)
-#define VIOCNEWCELL_64 _VICEIOCTL64(26)
-#define VIOCGETCELL_64 _VICEIOCTL64(27)
-#define VIOC_AFS_DELETE_MT_PT_64 _VICEIOCTL64(28)
-#define VIOC_AFS_STAT_MT_PT_64 _VICEIOCTL64(29)
-#define VIOC_FILE_CELL_NAME_64 _VICEIOCTL64(30)
-#define VIOC_GET_WS_CELL_64 _VICEIOCTL64(31)
-#define VIOC_AFS_MARINER_HOST_64 _VICEIOCTL64(32)
-#define VIOC_GET_PRIMARY_CELL_64 _VICEIOCTL64(33)
-#define VIOC_VENUSLOG_64 _VICEIOCTL64(34)
-#define VIOC_GETCELLSTATUS_64 _VICEIOCTL64(35)
-#define VIOC_SETCELLSTATUS_64 _VICEIOCTL64(36)
-#define VIOC_FLUSHVOLUME_64 _VICEIOCTL64(37)
-#define VIOC_AFS_SYSNAME_64 _VICEIOCTL64(38)
-#define VIOC_EXPORTAFS_64 _VICEIOCTL64(39)
-#define VIOCGETCACHEPARAMS_64 _VICEIOCTL64(40)
-#define VIOCCONNECTMODE_64 _VICEIOCTL64(41)
-#define VIOCGETVCXSTATUS_64 _VICEIOCTL64(41)
-#define VIOC_SETSPREFS_6433 _VICEIOCTL64(42)
-#define VIOC_GETSPREFS_64 _VICEIOCTL64(43)
-#define VIOC_GAG_64 _VICEIOCTL64(44)
-#define VIOC_TWIDDLE_64 _VICEIOCTL64(45)
-#define VIOC_SETSPREFS_64 _VICEIOCTL64(46)
-#define VIOC_STORBEHIND_64 _VICEIOCTL64(47)
-#define VIOC_GCPAGS_64 _VICEIOCTL64(48)
-#define VIOC_GETINITPARAMS_64 _VICEIOCTL64(49)
-#define VIOC_GETCPREFS_64 _VICEIOCTL64(50)
-#define VIOC_SETCPREFS_64 _VICEIOCTL64(51)
-#define VIOC_FLUSHMOUNT_64 _VICEIOCTL64(52)
-#define VIOC_RXSTATPROC_64 _VICEIOCTL64(53)
-#define VIOC_RXSTATPEER_64 _VICEIOCTL64(54)
-
-#define VIOC_GETRXKCRYPT_64 _VICEIOCTL64(55) /* 48 in some implementations */
-#define VIOC_SETRXKCRYPT_64 _VICEIOCTL64(56) /* with cryptosupport in afs */
-#define VIOC_FPRIOSTATUS_64 _VICEIOCTL64(57)
-
-#define VIOC_FHGET_64 _VICEIOCTL64(58)
-#define VIOC_FHOPEN_64 _VICEIOCTL64(59)
-
-#define VIOC_NNPFSDEBUG_64 _VICEIOCTL64(60)
-#define VIOC_ARLADEBUG_64 _VICEIOCTL64(61)
-
-#define VIOC_AVIATOR_64 _VICEIOCTL64(62)
-
-#define VIOC_NNPFSDEBUG_PRINT_64 _VICEIOCTL64(63)
-
-#define VIOC_CALCULATE_CACHE_64 _VICEIOCTL64(64)
-
-#define VIOC_BREAKCALLBACK_64 _VICEIOCTL64(65)
-
-#define VIOC_PREFETCHTAPE_64 _VICEIOCTL64(66)
-#define VIOC_RESIDENCY_CMD_64 _VICEIOCTL64(67)
-
-/*
- * Arla implementationspecific IOCTL'S
- */
-
-#define AIOC_STATISTICS_32 _ARLAIOCTL32(1) /* arla: fetch statistics */
-#define AIOC_STATISTICS_64 _ARLAIOCTL64(1) /* arla: fetch statistics */
-#define AIOC_PTSNAMETOID_32 _ARLAIOCTL32(2) /* arla: pts name to id */
-#define AIOC_PTSNAMETOID_64 _ARLAIOCTL64(2) /* arla: pts name to id */
-#define AIOC_GETCACHEPARAMS_32 _ARLAIOCTL32(3) /* arla: get cache param */
-#define AIOC_GETCACHEPARAMS_64 _ARLAIOCTL64(3) /* arla: get cache param */
-
-#define AFSCOMMONIOC_NEWALIAS_32 _AFSCOMMONIOCTL32(1) /* common: ... */
-#define AFSCOMMONIOC_NEWALIAS_64 _AFSCOMMONIOCTL64(1) /* common: ... */
-#define AFSCOMMONIOC_LISTALIAS_32 _AFSCOMMONIOCTL32(2) /* common: ... */
-#define AFSCOMMONIOC_LISTALIAS_64 _AFSCOMMONIOCTL64(2) /* common: ... */
-
-#endif /* NEED_VICEIOCTL32 */
-
-/*
- * GETCELLSTATUS flags
- */
-
-#define CELLSTATUS_PRIMARY 0x01 /* this is the `primary' cell */
-#define CELLSTATUS_SETUID 0x02 /* setuid honored for this cell */
-#define CELLSTATUS_OBSOLETE_VL 0x04 /* uses obsolete VL servers */
-
-/*
- * VIOCCONNECTMODE arguments
- */
-
-#define CONNMODE_PROBE 0
-#define CONNMODE_CONN 1
-#define CONNMODE_FETCH 2
-#define CONNMODE_DISCONN 3
-#define CONNMODE_PARCONNECTED 4
-#define CONNMODE_CONN_WITHCALLBACKS 5
-
-/*
- * The struct for VIOC_FPRIOSTATUS
- */
-
-#define FPRIO_MAX 100
-#define FPRIO_MIN 0
-#define FPRIO_DEFAULT FPRIO_MAX
-
-#define FPRIO_GET 0
-#define FPRIO_SET 1
-#define FPRIO_GETMAX 2
-#define FPRIO_SETMAX 3
-
-/*
- * Flags for VIOCCKSERV
- */
-
-#define CKSERV_DONTPING 1
-#define CKSERV_FSONLY 2
-
-#define CKSERV_MAXSERVERS 16 /* limitation of VIOCCKSERV number of
- returned servers */
-
-/*
- * for AIOC_STATISTICS
- */
-
-#define STATISTICS_OPCODE_LIST 0
-#define STATISTICS_OPCODE_GETENTRY 1
-
-#define STATISTICS_REQTYPE_FETCHSTATUS 1
-#define STATISTICS_REQTYPE_FETCHDATA 2
-#define STATISTICS_REQTYPE_BULKSTATUS 3
-#define STATISTICS_REQTYPE_STOREDATA 4
-#define STATISTICS_REQTYPE_STORESTATUS 5
-
-/*
- * for AIOC_GETCACHEPARAMS
- */
-
-#define GETCACHEPARAMS_OPCODE_HIGHBYTES 1
-#define GETCACHEPARAMS_OPCODE_USEDBYTES 2
-#define GETCACHEPARAMS_OPCODE_LOWBYTES 3
-#define GETCACHEPARAMS_OPCODE_HIGHVNODES 4
-#define GETCACHEPARAMS_OPCODE_USEDVNODES 5
-#define GETCACHEPARAMS_OPCODE_LOWVNODES 6
-
-
-struct ViceIoctl32 {
- uint32_t in, out; /* really caddr_t in 32 bits */
- short in_size;
- short out_size;
-};
-
-#if NEED_VICEIOCTL32
-struct ViceIoctl64 {
-#ifdef HAVE_UINT64_T
- uint64_t in, out; /* really caddr_t in 64 bits */
-#else
- caddr_t in, out;
-#endif
- short in_size;
- short out_size;
-};
-#endif /* NEED_VICEIOCTL32 */
-
-#ifndef __P
-#define __P(x) x
-#endif
-
-/* Use k_hasafs() to probe if the machine supports AFS syscalls.
- The other functions will generate a SIGSYS if AFS is not supported */
-
-int k_hasafs __P((void));
-
-int krb_afslog __P((const char *cell, const char *realm));
-int krb_afslog_uid __P((const char *cell, const char *realm, uid_t uid));
-
-int k_pioctl __P((char *a_path,
- int o_opcode,
- struct ViceIoctl *a_paramsP,
- int a_followSymlinks));
-int k_unlog __P((void));
-int k_setpag __P((void));
-int k_afs_cell_of_file __P((const char *path, char *cell, int len));
-
-/* XXX */
-#ifdef KFAILURE
-#define KRB_H_INCLUDED
-#endif
-
-#ifdef KRB5_RECVAUTH_IGNORE_VERSION
-#define KRB5_H_INCLUDED
-#endif
-
-#ifdef KRB_H_INCLUDED
-int kafs_settoken __P((const char*, uid_t, CREDENTIALS*));
-#endif
-
-#ifdef KRB5_H_INCLUDED
-krb5_error_code krb5_afslog_uid __P((krb5_context, krb5_ccache,
- const char*, krb5_const_realm, uid_t));
-krb5_error_code krb5_afslog __P((krb5_context, krb5_ccache,
- const char*, krb5_const_realm));
-#endif
-
-
-#define _PATH_VICE "/usr/vice/etc/"
-#define _PATH_THISCELL _PATH_VICE "ThisCell"
-#define _PATH_CELLSERVDB _PATH_VICE "CellServDB"
-#define _PATH_THESECELLS _PATH_VICE "TheseCells"
-
-#define _PATH_ARLA_VICE "/usr/arla/etc/"
-#define _PATH_ARLA_THISCELL _PATH_ARLA_VICE "ThisCell"
-#define _PATH_ARLA_CELLSERVDB _PATH_ARLA_VICE "CellServDB"
-#define _PATH_ARLA_THESECELLS _PATH_ARLA_VICE "TheseCells"
-
-#endif /* __KAFS_H */
diff --git a/usr.sbin/afs/src/include/netbsd-lkm/foo.c b/usr.sbin/afs/src/include/netbsd-lkm/foo.c
deleted file mode 100644
index a434e6239ad..00000000000
--- a/usr.sbin/afs/src/include/netbsd-lkm/foo.c
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * here to please make depend
- * $arla: foo.c,v 1.1 2002/06/02 22:15:08 lha Exp $
- */
-
-int
-foo(void)
-{
- return 0;
-}
diff --git a/usr.sbin/afs/src/include/stds.h b/usr.sbin/afs/src/include/stds.h
deleted file mode 100644
index 4d4401e01ad..00000000000
--- a/usr.sbin/afs/src/include/stds.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: stds.h,v 1.10 2003/06/12 05:28:19 lha Exp $ */
-
-#ifndef __STDS_H
-#define __STDS_H 1
-
-/* for compat resons with other kerberos distributions */
-
-#ifndef ANAME_SZ
-#define ANAME_SZ 40
-#endif
-#ifndef INST_SZ
-#define INST_SZ 40
-#endif
-#ifndef REALM_SZ
-#define REALM_SZ 40
-#endif
-
-#if defined(KERBEROS) && !defined(HAVE_KRB_PRINCIPAL)
-
-typedef struct krb_principal{
- char name[ANAME_SZ];
- char instance[INST_SZ];
- char realm[REALM_SZ];
-}krb_principal;
-#endif
-
-#endif /* __STDS_H */
diff --git a/usr.sbin/afs/src/install-sh b/usr.sbin/afs/src/install-sh
deleted file mode 100644
index ebc66913e94..00000000000
--- a/usr.sbin/afs/src/install-sh
+++ /dev/null
@@ -1,250 +0,0 @@
-#! /bin/sh
-#
-# install - install a program, script, or datafile
-# This comes from X11R5 (mit/util/scripts/install.sh).
-#
-# Copyright 1991 by the Massachusetts Institute of Technology
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of M.I.T. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission. M.I.T. makes no representations about the
-# suitability of this software for any purpose. It is provided "as is"
-# without express or implied warranty.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch. It can only install one file at a time, a restriction
-# shared with many OS's install programs.
-
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
- case $1 in
- -c) instcmd="$cpprog"
- shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd="$stripprog"
- shift
- continue;;
-
- -t=*) transformarg=`echo $1 | sed 's/-t=//'`
- shift
- continue;;
-
- -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
- shift
- continue;;
-
- *) if [ x"$src" = x ]
- then
- src=$1
- else
- # this colon is to work around a 386BSD /bin/sh bug
- :
- dst=$1
- fi
- shift
- continue;;
- esac
-done
-
-if [ x"$src" = x ]
-then
- echo "install: no input file specified"
- exit 1
-else
- true
-fi
-
-if [ x"$dir_arg" != x ]; then
- dst=$src
- src=""
-
- if [ -d $dst ]; then
- instcmd=:
- else
- instcmd=mkdir
- fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
-# if $src (and thus $dsttmp) contains '*'.
-
- if [ -f $src -o -d $src ]
- then
- true
- else
- echo "install: $src does not exist"
- exit 1
- fi
-
- if [ x"$dst" = x ]
- then
- echo "install: no destination specified"
- exit 1
- else
- true
- fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
- if [ -d $dst ]
- then
- dst="$dst"/`basename $src`
- else
- true
- fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-# this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
- pathcomp="${pathcomp}${1}"
- shift
-
- if [ ! -d "${pathcomp}" ] ;
- then
- $mkdirprog "${pathcomp}"
- else
- true
- fi
-
- pathcomp="${pathcomp}/"
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
- $doit $instcmd $dst &&
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
- if [ x"$transformarg" = x ]
- then
- dstfile=`basename $dst`
- else
- dstfile=`basename $dst $transformbasename |
- sed $transformarg`$transformbasename
- fi
-
-# don't allow the sed command to completely eliminate the filename
-
- if [ x"$dstfile" = x ]
- then
- dstfile=`basename $dst`
- else
- true
- fi
-
-# Make a temp file name in the proper directory.
-
- dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
- $doit $instcmd $src $dsttmp &&
-
- trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing. If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
- $doit $rmcmd -f $dstdir/$dstfile &&
- $doit $mvcmd $dsttmp $dstdir/$dstfile
-
-fi &&
-
-
-exit 0
diff --git a/usr.sbin/afs/src/lib/Makefile.in b/usr.sbin/afs/src/lib/Makefile.in
deleted file mode 100644
index 5b625a6bca7..00000000000
--- a/usr.sbin/afs/src/lib/Makefile.in
+++ /dev/null
@@ -1,47 +0,0 @@
-# $KTH: Makefile.in,v 1.18 2000/10/25 07:03:04 lha Exp $
-
-srcdir = @srcdir@
-top_builddir = ..
-VPATH = @srcdir@
-
-SHELL = /bin/sh
-
-SUBDIRS = @DIR_roken@ sl @editline_dir@ acl cmd
-
-all:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-install:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-uninstall:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-clean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-realclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-distclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
- rm -f Makefile
-
-mostlyclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-.PHONY: all install uninstall clean realclean distclean mostlyclean
diff --git a/usr.sbin/afs/src/lib/bufdir/Makefile.in b/usr.sbin/afs/src/lib/bufdir/Makefile.in
deleted file mode 100644
index 6171e8feb01..00000000000
--- a/usr.sbin/afs/src/lib/bufdir/Makefile.in
+++ /dev/null
@@ -1,96 +0,0 @@
-#
-# $KTH: Makefile.in,v 1.5 2000/10/10 20:55:58 lha Exp $
-#
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-DEFS = @DEFS@
-CFLAGS = @CFLAGS@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-INCLUDE=-I../../include -I$(srcdir) \
- -I../../rxdef \
- @INC_roken@ \
- @KRB4_INC_FLAGS@ \
- -I$(srcdir)/../..
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-
-#PICFLAGS = @PICFLAGS@
-
-LIBNAME = $(LIBPREFIX)bufdir
-#LIBEXT = @LIBEXT@
-LIBEXT = a
-#SHLIBEXT = @SHLIBEXT@
-#LIBPREFIX = @LIBPREFIX@
-LIBPREFIX = lib
-#LDSHARED = @LDSHARED@
-LIB = $(LIBNAME).$(LIBEXT)
-PROGS =
-
-LIB_SOURCES = fbuf.c fdir.c
-
-SOURCES = $(LIB_SOURCES)
-
-LIB_OBJECTS = fbuf.o fdir.o
-
-OBJECTS = $(LIB_OBJECTS)
-
-all: $(LIB) $(PROGS)
-
-Wall:
- make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDE) $(CFLAGS) $(PICFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
- $(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/$(LIB)
-
-uninstall:
- rm -f $(DESTDIR)$(libdir)/$(LIB)
-
-TAGS: $(SOURCES)
- etags $(SOURCES)
-
-check:
-
-clean:
- rm -f $(LIB) $(PROGS) *.o *.a
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *~
-
-realclean: distclean
- rm -f TAGS
-
-Makefile: ../../config.status Makefile.in
- cd ../.. ; CONFIG_FILES=lib/bufdir/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-$(LIBNAME).a: $(LIB_OBJECTS)
- rm -f $@
- $(AR) cr $@ $(LIB_OBJECTS)
- -$(RANLIB) $@
-
-#$(LIBNAME).$(SHLIBEXT): $(LIB_OBJECTS)
-# rm -f $@
-# $(LDSHARED) -o $@ $(LIB_OBJECTS)
-
-$(OBJECTS): ../../include/config.h
-
-.PHONY: all install uninstall check clean mostlyclean distclean realclean
diff --git a/usr.sbin/afs/src/lib/bufdir/afs_dir.h b/usr.sbin/afs/src/lib/bufdir/afs_dir.h
deleted file mode 100644
index 5e49f68ad3a..00000000000
--- a/usr.sbin/afs/src/lib/bufdir/afs_dir.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * The directory structure used by AFS.
- */
-
-/* $arla: afs_dir.h,v 1.8 2002/03/19 12:21:25 tol Exp $ */
-
-#ifndef _AFS_DIR_
-#define _AFS_DIR_
-
-#define AFSDIR_PAGESIZE 2048
-#define ADIRHASHSIZE 128
-#define ENTRIESPERPAGE 64
-
-#define AFSDIR_FIRST 1
-
-/* number of pages in map */
-
-#define MAXPAGES 128
-
-/*
- * We only save vnode and unique in the directory. Everything else is
- * the same as in the parent directory.
- */
-
-typedef struct {
- uint32_t Vnode;
- uint32_t Unique;
-} DirFid;
-
-typedef struct {
- union {
- struct {
- uint16_t pgcount;
- uint16_t tag; /* Should be 1234 in net-order */
- uint8_t freecount;
- uint8_t bitmap[ENTRIESPERPAGE / 8];
- } s;
- uint8_t pad[32];
- } u;
-} PageHeader;
-
-#define AFSDIRMAGIC 1234
-
-#define pg_tag u.s.tag
-#define pg_freecount u.s.freecount
-#define pg_pgcount u.s.pgcount
-#define pg_bitmap u.s.bitmap
-
-typedef struct {
- uint8_t map[MAXPAGES];
- uint16_t hash[ADIRHASHSIZE];
-} DirHeader;
-
-typedef struct {
- uint8_t flag;
- uint8_t length;
- uint16_t next;
- DirFid fid;
- char name[16]; /* If name overflows into fill, then we */
- char fill[4]; /* should use next entry too. */
-} DirEntry;
-
-typedef struct {
- PageHeader header;
- DirHeader dheader;
- DirEntry entry[1];
-} DirPage0;
-
-typedef struct {
- PageHeader header;
- DirEntry entry[1];
-} DirPage1;
-
-#endif /* _AFS_DIR_ */
diff --git a/usr.sbin/afs/src/lib/bufdir/fbuf.c b/usr.sbin/afs/src/lib/bufdir/fbuf.c
deleted file mode 100644
index f25945924ed..00000000000
--- a/usr.sbin/afs/src/lib/bufdir/fbuf.c
+++ /dev/null
@@ -1,542 +0,0 @@
-/*
- * Copyright (c) 1995 - 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <config.h>
-
-RCSID("$arla: fbuf.c,v 1.22 2003/01/23 10:34:55 tol Exp $") ;
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-#include <unistd.h>
-
-#include <fs_errors.h>
-
-#include <roken.h>
-
-#include <fbuf.h>
-
-#ifdef HAVE_MMAP
-
-/*
- * mmap version of the fbuf interface, the mmap_copy{rx2fd,fd2rx} are
- * little complicated to support reading/writing on non page
- * bonderies.
- */
-
-#if !defined(MAP_FAILED)
-#define MAP_FAILED ((void *)(-1))
-#endif
-
-/*
- * Map fbuf_flags in `flags' to mmap dito
- */
-
-static int
-mmap_flags (fbuf_flags flags)
-{
- int ret = 0;
-
- assert ((flags & (FBUF_PRIVATE | FBUF_SHARED)) == FBUF_PRIVATE
- || (flags & (FBUF_PRIVATE | FBUF_SHARED)) == FBUF_SHARED);
-
- if (flags & FBUF_PRIVATE)
- ret = MAP_PRIVATE;
- else if (flags & FBUF_SHARED)
- ret = MAP_SHARED;
- return ret;
-}
-
-/*
- * Map fbuf_flags in `flags' to mmap prot
- */
-
-static int
-mmap_prot (fbuf_flags flags)
-{
- int ret = 0;
-
- if (flags & FBUF_READ)
- ret |= PROT_READ;
- if (flags & FBUF_WRITE)
- ret |= PROT_WRITE;
- return ret;
-}
-
-/*
- * Create a fbuf with (fd, len, flags).
- * Returns 0 or error.
- */
-
-static int
-mmap_create (fbuf *f, int fd, size_t len, fbuf_flags flags)
-{
- void *buf;
-
- if (len != 0) {
- buf = mmap (0, len, mmap_prot(flags), mmap_flags(flags), fd, 0);
- if (buf == (void *) MAP_FAILED)
- return errno;
- } else
- buf = NULL;
-
- f->buf = buf;
- f->fd = fd;
- f->len = len;
- f->flags = flags;
- return 0;
-}
-
-/*
- * Change the size of the underlying file and the fbuf to `new_len'
- * bytes.
- * Returns 0 or error.
- */
-
-static int
-mmap_truncate (fbuf *f, size_t new_len)
-{
- int ret = 0;
-
- if (f->buf != NULL) {
- if (msync(f->buf, f->len, MS_ASYNC))
- ret = errno;
- if (munmap (f->buf, f->len))
- ret = errno;
- if (ret)
- return ret;
- }
- ret = ftruncate (f->fd, new_len);
- if (ret < 0)
- return errno;
- return mmap_create (f, f->fd, new_len, f->flags);
-}
-
-/*
- * End using `f'.
- * Returns 0 or error.
- */
-
-static int
-mmap_end (fbuf *f)
-{
- int ret = 0;
-
- if (msync (f->buf, f->len, MS_ASYNC))
- ret = errno;
- if (munmap (f->buf, f->len))
- ret = errno;
- return ret;
-}
-
-/*
- *
- */
-
-static size_t mmap_max_size = 10 * 1024 * 1024;
-
-/*
- * Copy `len' bytes from the rx call `call' to the file `fd'.
- * Returns 0 or error
- */
-
-static int
-mmap_copyrx2fd (struct rx_call *call, int fd, off_t off, size_t len)
-{
- void *buf;
- int r_len;
- int ret = 0;
- off_t adjust_off, adjust_len;
- size_t size;
-
- if (len == 0)
- return 0;
-
- /* padding */
- adjust_off = off % getpagesize();
-
- while (len > 0) {
-
- size = min(len + adjust_off, mmap_max_size);
- adjust_len = getpagesize() - (size % getpagesize());
-
- buf = mmap (0, size + adjust_len,
- PROT_READ | PROT_WRITE, MAP_SHARED,
- fd, off - adjust_off);
- if (buf == (void *) MAP_FAILED)
- return errno;
- r_len = rx_Read (call, ((char *) buf) + adjust_off, size - adjust_off);
- if (r_len != size - adjust_off)
- ret = conv_to_arla_errno(rx_GetCallError(call));
-
- len -= r_len;
- off += r_len;
- adjust_off = 0;
-
- if (msync (buf, size + adjust_len, MS_ASYNC))
- ret = errno;
- if (munmap (buf, size + adjust_len))
- ret = errno;
-
- if (ret)
- break;
- }
-
- return ret;
-}
-
-/*
- * Copy `len' bytes from `fd' to `call'.
- * Returns 0 or error.
- */
-
-static int
-mmap_copyfd2rx (int fd, struct rx_call *call, off_t off, size_t len)
-{
- void *buf;
- int w_len;
- int ret = 0;
- off_t adjust_off, adjust_len;
- size_t size;
-
- if (len == 0)
- return 0;
-
- adjust_off = off % getpagesize();
-
- while (len > 0) {
-
- size = min(len + adjust_off, mmap_max_size);
- adjust_len = size % getpagesize();
-
- buf = mmap (0, size + adjust_len,
- PROT_READ, MAP_PRIVATE, fd, off - adjust_off);
- if (buf == (void *) MAP_FAILED)
- return errno;
- w_len = rx_Write (call, (char *)buf + adjust_off, size - adjust_off);
- if (w_len != size - adjust_off)
- ret = conv_to_arla_errno(rx_GetCallError(call));
-
- len -= w_len;
- off += w_len;
- adjust_off = 0;
-
- if (munmap (buf, size + adjust_len))
- ret = errno;
- if (ret)
- break;
- }
-
- return ret;
-}
-
-#else /* !HAVE_MMAP */
-
-/*
- * Create a fbuf with (fd, len, flags).
- * Returns 0 or error.
- */
-
-static int
-malloc_create (fbuf *f, int fd, size_t len, fbuf_flags flags)
-{
- void *buf;
-
- buf = malloc (len);
- if (buf == NULL)
- return ENOMEM;
- if (lseek(fd, 0, SEEK_SET) == -1 ||
- read (fd, buf, len) != len) {
- free(buf);
- return errno;
- }
- f->buf = buf;
- f->fd = fd;
- f->len = len;
- f->flags = flags;
- return 0;
-}
-
-/*
- * Write out the data of `f' to the file.
- * Returns 0 or error.
- */
-
-static int
-malloc_flush (fbuf *f)
-{
- if ((f->flags & FBUF_WRITE) && (f->flags & FBUF_SHARED)) {
- lseek (f->fd, 0, SEEK_SET);
- if (write (f->fd, f->buf, f->len) != f->len)
- return errno;
- }
- return 0;
-}
-
-/*
- * End using `f'.
- * Returns 0 or error.
- */
-
-static int
-malloc_end (fbuf *f)
-{
- int ret;
-
- ret = malloc_flush (f);
- free (f->buf);
- return ret;
-}
-
-/*
- * Change the size of the underlying file and the fbuf to `new_len'
- * bytes.
- * Returns 0 or error.
- */
-
-static int
-malloc_truncate (fbuf *f, size_t new_len)
-{
- void *buf;
- int ret;
-
- ret = malloc_flush (f);
- if (ret)
- goto fail;
-
- ret = ftruncate (f->fd, new_len);
- if (ret < 0) {
- ret = errno;
- goto fail;
- }
-
- buf = realloc (f->buf, new_len);
- if (buf == NULL) {
- ret = ENOMEM;
- goto fail;
- }
-
- f->buf = buf;
- f->len = new_len;
- return 0;
-
-fail:
- free (f->buf);
- f->len = 0;
- return ret;
-}
-
-/*
- * Copy `len' bytes from the rx call `call' to the file `fd'.
- * Returns 0 or error
- */
-
-static int
-malloc_copyrx2fd (struct rx_call *call, int fd, off_t off, size_t len)
-{
- void *buf;
- struct stat statbuf;
- u_long bufsize;
- u_long nread;
- int ret = 0;
-
- if (len == 0)
- return 0;
-
- if (lseek (fd, off, SEEK_SET) == -1)
- return errno;
-
- if (fstat (fd, &statbuf)) {
-/* arla_warn (ADEBFBUF, errno, "fstat"); */
- bufsize = 1024;
- } else
- bufsize = statbuf.st_blksize;
-
- buf = malloc (bufsize);
- if (buf == NULL)
- return ENOMEM;
-
- while ( len && (nread = rx_Read (call, buf, min(bufsize,
- len))) > 0) {
- if (write (fd, buf, nread) != nread) {
- ret = errno;
- break;
- }
- len -= nread;
- }
- free (buf);
- return ret;
-}
-
-/*
- * Copy `len' bytes from at offset `off' in `fd' to `call'.
- * Returns 0 or error.
- */
-
-static int
-malloc_copyfd2rx (int fd, struct rx_call *call, off_t off, size_t len)
-{
- void *buf;
- struct stat statbuf;
- u_long bufsize;
- u_long nread;
- int ret = 0;
-
- if (len == 0)
- return 0;
-
- if (lseek (fd, off, SEEK_SET) < 0)
- return errno;
-
- if (fstat (fd, &statbuf)) {
-/* arla_warn (ADEBFBUF, errno, "fstat"); */
- bufsize = 1024;
- } else
- bufsize = statbuf.st_blksize;
-
- buf = malloc (bufsize);
- if (buf == NULL)
- return ENOMEM;
-
- while (len
- && (nread = read (fd, buf, min(bufsize, len))) > 0) {
- if (rx_Write (call, buf, nread) != nread) {
- ret = errno;
- break;
- }
- len -= nread;
- }
- free (buf);
- return ret;
-}
-#endif /* !HAVE_MMAP */
-
-/*
- * Accessor functions.
- */
-
-size_t
-fbuf_len (fbuf *f)
-{
- return f->len;
-}
-
-/*
- *
- */
-
-void *
-fbuf_buf (fbuf *f)
-{
- return f->buf;
-}
-
-/*
- * Return a pointer to a copy of this file contents. If we have mmap,
- * we use that, otherwise we have to allocate some memory and read it.
- */
-
-int
-fbuf_create (fbuf *f, int fd, size_t len, fbuf_flags flags)
-{
-#ifdef HAVE_MMAP
- return mmap_create (f, fd, len, flags);
-#else
- return malloc_create (f, fd, len, flags);
-#endif
-}
-
-/*
- * Undo everything we did in fbuf_create.
- */
-
-int
-fbuf_end (fbuf *f)
-{
-#ifdef HAVE_MMAP
- return mmap_end (f);
-#else
- return malloc_end (f);
-#endif
-}
-
-/*
- * Make the file (and the buffer) be `new_len' bytes.
- */
-
-int
-fbuf_truncate (fbuf *f, size_t new_len)
-{
-#ifdef HAVE_MMAP
- return mmap_truncate (f, new_len);
-#else
- return malloc_truncate (f, new_len);
-#endif
-}
-
-/*
- * Copy from a RX_call to a fd.
- * The area between offset and len + offset should be present in the file.
- */
-
-int
-copyrx2fd (struct rx_call *call, int fd, off_t off, size_t len)
-{
-#ifdef HAVE_MMAP
- return mmap_copyrx2fd (call, fd, off, len);
-#else
- return malloc_copyrx2fd (call, fd, off, len);
-#endif
-}
-
-/*
- * Copy from a file descriptor to a RX call.
- *
- * Returns: error number if failed
- */
-
-int
-copyfd2rx (int fd, struct rx_call *call, off_t off, size_t len)
-{
-#ifdef HAVE_MMAP
- return mmap_copyfd2rx (fd, call, off, len);
-#else
- return malloc_copyfd2rx (fd, call, off, len);
-#endif
-}
diff --git a/usr.sbin/afs/src/lib/bufdir/fbuf.h b/usr.sbin/afs/src/lib/bufdir/fbuf.h
deleted file mode 100644
index 2dc2c1cf405..00000000000
--- a/usr.sbin/afs/src/lib/bufdir/fbuf.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: fbuf.h,v 1.8 2002/09/07 10:44:06 lha Exp $ */
-
-#ifndef _FBUF_H_
-#define _FBUF_H_
-
-#ifndef _KERNEL
-#include <rx/rx.h>
-#endif
-
-typedef enum {
- FBUF_READ = 0x01,
- FBUF_WRITE = 0x02,
- FBUF_PRIVATE = 0x04,
- FBUF_SHARED = 0x08
-} fbuf_flags;
-
-struct fbuf {
- void *buf;
- int fd;
- size_t len;
- fbuf_flags flags;
-};
-
-typedef struct fbuf fbuf;
-
-#ifdef _KERNEL
-int fbuf_create (fbuf *fbuf, NNPFS_FBUF_HANDLE fd, size_t len, fbuf_flags flags);
-#else
-int fbuf_create (fbuf *fbuf, int fd, size_t len, fbuf_flags flags);
-#endif
-
-int fbuf_truncate (fbuf *fbuf, size_t new_len);
-int fbuf_end (fbuf *fbuf);
-size_t fbuf_len (fbuf *f);
-void *fbuf_buf (fbuf *f);
-
-#ifndef _KERNEL
-int copyrx2fd (struct rx_call *call, int fd, off_t off, size_t len);
-int copyfd2rx (int fd, struct rx_call *call, off_t off, size_t len);
-#endif
-#endif /* _FBUF_H_ */
diff --git a/usr.sbin/afs/src/lib/bufdir/fdir.c b/usr.sbin/afs/src/lib/bufdir/fdir.c
deleted file mode 100644
index 604d9a7a02e..00000000000
--- a/usr.sbin/afs/src/lib/bufdir/fdir.c
+++ /dev/null
@@ -1,666 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Routines for reading an AFS directory
- */
-
-#ifndef _KERNEL
-#include <config.h>
-
-RCSID("$arla: fdir.c,v 1.14 2003/02/04 17:09:04 lha Exp $") ;
-
-#include <sys/types.h>
-#include <sys/errno.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <assert.h>
-#include <rx/rx.h>
-#else
-#include <nnpfs_locl.h>
-#endif
-
-#include <afs_dir.h>
-#include <fdir.h>
-
-/*
- * Hash the filename of one entry.
- */
-
-static unsigned
-hashentry (const char *sentry)
-{
- int s = 0, h;
- const unsigned char *entry = (const unsigned char *)sentry;
-
- while (*entry)
- s = s * 173 + *entry++;
- h = s & (ADIRHASHSIZE - 1);
- if (h == 0)
- return h;
- else if( s < 0 )
- h = ADIRHASHSIZE - h;
- return h;
-}
-
-/*
- * Return the number of additional DirEntries used by an entry with
- * the filename `name`.
- */
-
-static unsigned
-additional_entries (const char *filename)
-{
- static DirEntry dummy;
-
- return (strlen(filename) - sizeof(dummy.name) + 1
- + sizeof(DirEntry) - 1)
- / sizeof(DirEntry);
-}
-
-/*
- * Return a pointer to page number `pageno'.
- */
-
-static DirPage1 *
-getpage (DirPage0 *page0, unsigned pageno)
-{
- return (DirPage1 *)((char *)page0 + AFSDIR_PAGESIZE * pageno);
-}
-
-/*
- * Return the entry `num' in the directory `page0'.
- * The directory must be continuous in memory after page0.
- */
-
-static DirEntry *
-getentry (DirPage0 *page0,
- unsigned short num)
-{
- DirPage1 *page = getpage (page0, num / ENTRIESPERPAGE);
-
- assert (page->header.pg_tag == htons(AFSDIRMAGIC));
- return &page->entry[num % ENTRIESPERPAGE];
-}
-
-/*
- * Return a pointer to the entry with name `name' in the directory `page0'.
- */
-
-static DirEntry *
-find_entry(DirPage0 *page0, const char *name)
-{
- DirEntry *entry;
- unsigned short i;
-
- for (i = ntohs(page0->dheader.hash[hashentry (name)]);
- i != 0;
- i = ntohs(entry->next)) {
- entry = getentry (page0, (unsigned short)(i - 1));
-
- if (strcmp (entry->name, name) == 0)
- return entry;
- }
- return NULL;
-}
-
-/*
- * Return the fid for the entry with `name' in `page0'. `fid' is set
- * to the fid of that file. `dir' should be the fid of the directory.
- * Return zero if succesful, and -1 otherwise.
- */
-
-static int
-find_by_name (DirPage0 *page0,
- const char *name,
- VenusFid *fid,
- const VenusFid *dir)
-{
- const DirEntry *entry = find_entry (page0, name);
-
- if (entry == NULL)
- return -1;
- fid->Cell = dir->Cell;
- fid->fid.Volume = dir->fid.Volume;
- fid->fid.Vnode = ntohl (entry->fid.Vnode);
- fid->fid.Unique = ntohl (entry->fid.Unique);
- return 0;
-}
-
-/*
- * Return true if slot `off' on `page' is being used.
- */
-
-static int
-used_slot (DirPage1 *page, int off)
-{
- return page->header.pg_bitmap[off / 8] & (1 << (off % 8));
-}
-
-/*
- * Return true if slot w/ index `off' on `page' is a valid entry.
- */
-
-static int
-first_slotp (DirPage1 *page, int off)
-{
- DirEntry *entry = &page->entry[off];
- if (used_slot(page, off + 1)
- && entry->flag == AFSDIR_FIRST)
- return TRUE;
-
- return FALSE;
-}
-
-/*
- * Is this page `pageno' empty?
- */
-
-static int
-is_page_empty (DirPage0 *page0, unsigned pageno)
-{
- DirPage1 *page;
- int i;
-
- if (pageno < MAXPAGES)
- return page0->dheader.map[pageno] == ENTRIESPERPAGE - 1;
- page = getpage (page0, pageno);
- if (page->header.pg_bitmap[0] != 1)
- return 0;
- for (i = 1; i < sizeof(page->header.pg_bitmap); ++i)
- if (page->header.pg_bitmap[i] != 0)
- return 0;
- return 1;
-}
-
-#ifndef _KERNEL
-/*
- * Change the fid for `name' to `fid'. Return 0 or -1.
- */
-
-static int
-update_fid_by_name (DirPage0 *page0,
- const char *name,
- const VenusFid *fid)
-{
- DirEntry *entry = find_entry (page0, name);
-
- if (entry == NULL)
- return -1;
-
- entry->fid.Vnode = htonl (fid->fid.Vnode);
- entry->fid.Unique = htonl (fid->fid.Unique);
- return 0;
-}
-
-/*
- * Mark slot `off' on `page' as being used.
- */
-
-static void
-set_used (DirPage1 *page, int off)
-{
- page->header.pg_bitmap[off / 8] |= 1 << (off % 8);
-}
-
-/*
- * Mark slot `off' on `page' as not being used.
- */
-
-static void
-set_unused (DirPage1 *page, int off)
-{
- page->header.pg_bitmap[off / 8] &= ~(1 << (off % 8));
-}
-
-/*
- * Add a new page to the directory in `the_fbuf', returning a pointer
- * to the new page in `ret_page'.
- * Return 0 iff succesful.
- */
-
-static int
-create_new_page (DirPage1 **ret_page,
- fbuf *the_fbuf)
-{
- int ret;
- DirPage1 *page1;
- size_t len = fbuf_len(the_fbuf);
-
- ret = fbuf_truncate (the_fbuf, len + AFSDIR_PAGESIZE);
- if (ret)
- return ret;
-
- page1 = (DirPage1 *)((char *)fbuf_buf(the_fbuf) + len);
- page1->header.pg_pgcount = htons(0);
- page1->header.pg_tag = htons(AFSDIRMAGIC);
- page1->header.pg_freecount = ENTRIESPERPAGE - 1;
- memset (page1->header.pg_bitmap, 0, sizeof(page1->header.pg_bitmap));
- set_used (page1, 0);
- *ret_page = page1;
-
- return 0;
-}
-
-/*
- * Create a new entry with name `filename', fid `fid', and next
- * pointer `next' in the page `page' with page number `pageno'.
- * Return the index in the page or -1 if unsuccesful.
- */
-
-static int
-add_to_page (DirPage0 *page0,
- DirPage1 *page,
- unsigned pageno,
- const char *filename,
- AFSFid fid,
- unsigned next)
-{
- int i, j;
- unsigned n;
-
- n = 1 + additional_entries (filename);
-
- if (pageno < MAXPAGES && page0->dheader.map[pageno] < n)
- return -1;
-
- for (i = 0; i < ENTRIESPERPAGE - n;) {
- for (j = 0; j < n && !used_slot (page, i + j + 1); ++j)
- ;
- if (j == n) {
- int k;
-
- for (k = i + 1; k < i + j + 1; ++k)
- page->header.pg_bitmap[k / 8] |= (1 << (k % 8));
-
- page->entry[i].flag = AFSDIR_FIRST;
- page->entry[i].length = 0;
- page->entry[i].next = next;
- page->entry[i].fid.Vnode = htonl(fid.Vnode);
- page->entry[i].fid.Unique = htonl(fid.Unique);
- strlcpy (page->entry[i].name, filename, (n - 1) * sizeof(DirEntry)
- + sizeof(page->entry[i].name));
- memset(page->entry[i + j - 1].fill, 0, 4);
- if (pageno < MAXPAGES)
- page0->dheader.map[pageno] -= n;
- return i;
- }
- i += j + 1;
- }
- return -1;
-}
-
-/*
- * Remove the entry `off' from the page `page' (page number `pageno').
- */
-
-static int
-remove_from_page (DirPage0 *page0,
- DirPage1 *page,
- unsigned pageno,
- unsigned off)
-{
- DirEntry *entry = &page->entry[off];
- unsigned n, i;
-
- n = 1 + additional_entries (entry->name);
-
- if (pageno < MAXPAGES)
- page0->dheader.map[pageno] += n;
-
- entry->next = 0;
- entry->fid.Vnode = 0;
- entry->fid.Unique = 0;
-
- for (i = off + 1; i < off + n + 1; ++i)
- set_unused (page, i);
- return 0;
-}
-
-/*
- * Lookup `name' in the AFS directory identified by `dir' and change the
- * fid to `fid'.
- */
-
-int
-fdir_changefid (fbuf *the_fbuf,
- const char *name,
- const VenusFid *file)
-{
- DirPage0 *page0;
- int ret;
-
- page0 = (DirPage0 *)fbuf_buf(the_fbuf);
- assert (page0);
- ret = update_fid_by_name (page0, name, file);
-
- if (ret == 0)
- return 0;
- else
- return ENOENT;
-}
-#endif
-
-/*
- * Lookup `name' in the AFS directory identified by `dir' and return
- * the Fid in `file'. Return value is 0 or error code.
- */
-
-int
-fdir_lookup (fbuf *the_fbuf, const VenusFid *dir,
- const char *name, VenusFid *file)
-{
- DirPage0 *page0;
- unsigned ind;
-
- page0 = (DirPage0 *)fbuf_buf(the_fbuf);
- assert (page0);
- ind = find_by_name (page0, name, file, dir);
-
- if (ind == 0)
- return 0;
- else
- return ENOENT;
-}
-
-/*
- * Return TRUE if dir is empty.
- */
-
-int
-fdir_emptyp (fbuf *dir)
-{
- DirPage0 *page0;
- unsigned npages;
-
- page0 = (DirPage0 *)fbuf_buf(dir);
- assert (page0);
-
- npages = ntohs(page0->header.pg_pgcount);
-
- return (npages == 1) && (page0->dheader.map[0] == 49);
-}
-
-/*
- * Read all entries in the AFS directory identified by `dir' and call
- * `func' on each entry with the fid, the name, and `arg'.
- */
-
-int
-fdir_readdir (fbuf *the_fbuf,
- fdir_readdir_func func,
- void *arg,
- VenusFid dir,
- uint32_t *offset)
-{
- DirPage0 *page0;
- unsigned i, j;
- VenusFid fid;
- unsigned len = fbuf_len(the_fbuf);
- unsigned npages;
- unsigned first_slot;
- int ret;
-
- page0 = (DirPage0 *)fbuf_buf(the_fbuf);
-
- assert (page0);
-
- npages = ntohs(page0->header.pg_pgcount);
-
- if (npages < len / AFSDIR_PAGESIZE)
- npages = len / AFSDIR_PAGESIZE;
-
- if (offset && *offset) {
- i = *offset / ENTRIESPERPAGE;
- first_slot = *offset % ENTRIESPERPAGE;
-
- assert(i > 0 || first_slot >= 12);
- } else {
- i = 0;
- first_slot = 12;
- }
-
- for (; i < npages; ++i) {
- DirPage1 *page = getpage (page0, i);
-
- for (j = first_slot; j < ENTRIESPERPAGE - 1; ++j) {
- if (first_slotp (page, j)) {
- DirEntry *entry = &page->entry[j];
-
- if (entry->flag != AFSDIR_FIRST)
- continue;
-
- fid.Cell = dir.Cell;
- fid.fid.Volume = dir.fid.Volume;
- fid.fid.Vnode = ntohl (entry->fid.Vnode);
- fid.fid.Unique = ntohl (entry->fid.Unique);
-
- ret = (*func)(&fid, entry->name, arg);
- if (ret) {
- if (ret > 0)
- j++; /* look at next entry next time */
-
- goto done;
- }
- j += additional_entries (entry->name);
- }
- }
- first_slot = 0;
- }
-
- done:
- if (offset)
- *offset = i * ENTRIESPERPAGE + j;
-
- return 0;
-}
-
-#ifndef _KERNEL
-/*
- * Create a new directory with only . and ..
- */
-
-int
-fdir_mkdir (fbuf *the_fbuf,
- AFSFid dot,
- AFSFid dot_dot)
-{
- DirPage0 *page0;
- DirPage1 *page;
- int ind;
- int i;
- int tmp;
- int ret;
-
- ret = create_new_page (&page, the_fbuf);
- if (ret)
- return ret;
-
- page0 = (DirPage0 *)fbuf_buf(the_fbuf);
- memset (&page0->dheader, 0, sizeof(page0->dheader));
- tmp = ENTRIESPERPAGE
- - (sizeof(PageHeader) + sizeof(DirHeader)) / sizeof(DirEntry);
- page0->header.pg_freecount = tmp;
- page0->dheader.map[0] = tmp;
- page0->header.pg_pgcount = htons(1);
-
- for (i = 0; i < 13; ++i)
- set_used (page, i);
-
- assert (page0->dheader.hash[hashentry(".")] == 0);
-
- ind = add_to_page (page0, page, 0, ".", dot, 0);
-
- assert (ind >= 0);
-
- page0->dheader.hash[hashentry(".")] = htons(ind + 1);
-
- assert (page0->dheader.hash[hashentry("..")] == 0);
-
- ind = add_to_page (page0, page, 0, "..", dot_dot, 0);
-
- assert (ind >= 0);
-
- page0->dheader.hash[hashentry("..")] = htons(ind + 1);
-
- return 0;
-}
-
-/*
- * Create a new entry with name `filename' and contents `fid' in `dir'.
- */
-
-int
-fdir_creat (fbuf *dir,
- const char *name,
- AFSFid fid)
-{
- int ret;
- int i;
- unsigned npages;
- DirPage0 *page0;
- DirPage1 *page;
- int ind = 0;
- unsigned hash_value, next;
-
- assert (dir->len != 0);
-
- page0 = (DirPage0 *)fbuf_buf(dir);
- assert (page0);
- npages = ntohs(page0->header.pg_pgcount);
-
- if (npages < fbuf_len(dir) / AFSDIR_PAGESIZE)
- npages = fbuf_len(dir) / AFSDIR_PAGESIZE;
-
- if (find_entry (page0, name))
- return EEXIST;
-
- hash_value = hashentry (name);
- next = page0->dheader.hash[hash_value];
-
- for (i = 0; i < npages; ++i) {
- page = getpage (page0, i);
- ind = add_to_page (page0, page, i, name, fid, next);
- if (ind >= 0)
- break;
- }
- if (i == npages) {
- ret = create_new_page (&page, dir);
- if (ret)
- return ret;
- page0 = (DirPage0 *)fbuf_buf(dir);
- page0->header.pg_pgcount = htons(npages + 1);
- if (i < MAXPAGES)
- page0->dheader.map[i] = ENTRIESPERPAGE - 1;
- ind = add_to_page (page0, page, i, name, fid, next);
- assert (ind >= 0);
- }
- ind += i * ENTRIESPERPAGE;
-
- page0->dheader.hash[hash_value] = htons(ind + 1);
-
- return 0;
-}
-
-/*
- * Remove the entry named `name' in dir.
- */
-
-int
-fdir_remove (fbuf *dir,
- const char *name,
- AFSFid *fid)
-{
- int i;
- unsigned len = dir->len;
- DirPage0 *page0;
- DirPage1 *page;
- unsigned hash_value;
- DirEntry *entry = NULL;
- DirEntry *prev_entry;
- unsigned pageno;
- int found;
- unsigned npages;
-
-
- page0 = (DirPage0 *)fbuf_buf(dir);
- npages = ntohs(page0->header.pg_pgcount);
- if (npages < len / AFSDIR_PAGESIZE)
- npages = len / AFSDIR_PAGESIZE;
-
- hash_value = hashentry (name);
- i = ntohs(page0->dheader.hash[hash_value]);
- found = i == 0;
- prev_entry = NULL;
- while (!found) {
- entry = getentry (page0, i - 1);
-
- if (strcmp (entry->name, name) == 0) {
- found = TRUE;
- } else {
- i = ntohs(entry->next);
- if (i == 0)
- found = TRUE;
- prev_entry = entry;
- }
- }
- if (i == 0)
- return ENOENT;
- else {
- if (fid) {
- fid->Vnode = ntohl(entry->fid.Vnode);
- fid->Unique = ntohl(entry->fid.Unique);
- }
-
- if (prev_entry == NULL)
- page0->dheader.hash[hash_value] = entry->next;
- else
- prev_entry->next = entry->next;
-
- pageno = (i - 1) / ENTRIESPERPAGE;
- page = getpage (page0, pageno);
- remove_from_page (page0, page, pageno, (i - 1) % ENTRIESPERPAGE);
- if (pageno == npages - 1
- && is_page_empty (page0, pageno)) {
- do {
- len -= AFSDIR_PAGESIZE;
- --pageno;
- --npages;
- } while(is_page_empty(page0, pageno));
- page0->header.pg_pgcount = htons(npages);
- fbuf_truncate (dir, len);
- }
- return 0;
- }
-}
-#endif
diff --git a/usr.sbin/afs/src/lib/bufdir/fdir.h b/usr.sbin/afs/src/lib/bufdir/fdir.h
deleted file mode 100644
index dbb68b99f63..00000000000
--- a/usr.sbin/afs/src/lib/bufdir/fdir.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Interface to directory handling routines
- */
-
-/* $arla: fdir.h,v 1.7 2002/03/06 21:41:43 tol Exp $ */
-
-#ifndef _FDIR_H_
-#define _FDIR_H_
-
-#ifndef _KERNEL
-#include <roken.h>
-#endif
-
-#include <fids.h>
-#include <fbuf.h>
-
-int
-fdir_lookup (fbuf *the_fbuf,
- const VenusFid *dir,
- const char *name,
- VenusFid *file);
-
-
-int
-fdir_changefid (fbuf *the_fbuf,
- const char *name,
- const VenusFid *file);
-
-int
-fdir_emptyp (fbuf *dir);
-
-typedef int (*fdir_readdir_func)(VenusFid *, const char *, void *);
-
-int
-fdir_readdir (fbuf *the_fbuf,
- fdir_readdir_func func,
- void *arg,
- VenusFid dir,
- uint32_t *offset);
-
-int
-fdir_creat (fbuf *dir,
- const char *filename,
- AFSFid fid);
-
-int
-fdir_remove (fbuf *dir,
- const char *name,
- AFSFid *fid);
-
-int
-fdir_mkdir (fbuf *dir,
- AFSFid dot,
- AFSFid dot_dot);
-
-#endif /* _FDIR_H_ */
diff --git a/usr.sbin/afs/src/lib/bufdir/fids.h b/usr.sbin/afs/src/lib/bufdir/fids.h
deleted file mode 100644
index dcf610e3110..00000000000
--- a/usr.sbin/afs/src/lib/bufdir/fids.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: fids.h,v 1.1 2002/03/06 16:26:35 tol Exp $ */
-
-#ifndef _FIDS_H
-#define _FIDS_H 1
-
-#ifndef _COMMON_
-
-struct AFSFid {
- uint32_t Volume;
- uint32_t Vnode;
- uint32_t Unique;
-};
-typedef struct VenusFid VenusFid;
-
-struct VenusFid {
- int32_t Cell;
- struct AFSFid fid;
-};
-typedef struct AFSFid AFSFid;
-#endif /* _COMMON_ */
-
-#endif /* _FIDS_H */
diff --git a/usr.sbin/afs/src/lib/cmd/Makefile.in b/usr.sbin/afs/src/lib/cmd/Makefile.in
deleted file mode 100644
index fc8e89954f0..00000000000
--- a/usr.sbin/afs/src/lib/cmd/Makefile.in
+++ /dev/null
@@ -1,123 +0,0 @@
-#
-# $KTH: Makefile.in,v 1.5.2.1 2001/07/14 21:00:15 lha Exp $
-#
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-DEFS = @DEFS@
-CFLAGS = @CFLAGS@
-YACC = @YACC@
-LEX = @LEX@
-LN_S = @LN_S@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-bindir = @bindir@
-mandir = @mandir@
-includedir = @includedir@
-
-LIBPREFIX = lib
-LIBEXT = a
-LIBNAME = $(LIBPREFIX)cmd
-cmd_LIB = $(LIBNAME).$(LIBEXT)
-
-testc_BIN = testc
-testc_1_MAN = testc.1
-
-PROGS = $(testc_BIN)
-install_MANS = cmd.3
-MANS = $(testc_1_MAN) $(install_MANS)
-
-LIB_SOURCES = cmd.c
-testc_SOURCES = testc.c
-
-SOURCES = $(LIB_SOURCES) $(BIN_SOURCES)
-
-LIB_OBJECTS = cmd.o
-testc_OBJECTS = testc.o
-
-OBJECTS = $(LIB_OBJECTS) $(testc_OBJECTS)
-
-all: $(cmd_LIB) $(PROGS) $(MANS)
-
-Wall:
- make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
-
-.c.o:
- $(CC) -c $(DEFS) -I../../include -I. -I$(srcdir) $(KRB4_INC_FLAGS) @INC_roken@ $(CFLAGS) $(CPPFLAGS) $(PICFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(includedir)/afs
- $(INSTALL_DATA) $(srcdir)/cmd.h $(DESTDIR)$(includedir)/afs/cmd.h
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
- $(INSTALL) -m 555 $(cmd_LIB) $(DESTDIR)$(libdir)/$(cmd_LIB)
- for man in $(install_MANS) ; do \
- for a in 1 2 3 4 5 6 7 8 9 0 ; do \
- if test `basename $$man .$$a`.$$a = $$man; then \
- if test -f $$man ; then \
- man_inst=$$man ; \
- else \
- man_inst=$(srcdir)/$$man; \
- fi ;\
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$$a; \
- $(INSTALL_DATA) $$man_inst $(mandir)/man$$a/$$man; \
- fi ; \
- done ; \
- done
-
-uninstall:
- rm -f $(DESTDIR)$(includedir)/afs/cmd.h
- rm -f $(DESTDIR)$(libdir)/$(cmd_LIB)
- for man in $(install_MANS) ; do \
- for a in 1 2 3 4 5 6 7 8 9 0 ; do \
- if test `basename $$man .$$a`.$$a = $$man; then \
- rm -f $(DESTDIR)$(mandir)/man$$a/$$man ; \
- fi ; \
- done ; \
- done
-
-TAGS: $(SOURCES)
- etags $(SOURCES)
-
-check:
-
-clean:
- rm -f $(cmd_LIB) $(PROGS) $(testc_1_MAN) *.o *.a
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *~
-
-realclean: distclean
- rm -f TAGS
-
-$(LIBNAME).a: $(LIB_OBJECTS)
- rm -f $@
- $(AR) cr $@ $(LIB_OBJECTS)
- -$(RANLIB) $@
-
-testc: $(testc_OBJECTS) $(cmd_LIB)
- $(CC) $(CFLAGS) -o $@ $(testc_OBJECTS) -L. -lcmd @LIB_roken@ @LIBS@
-
-testc.1: testc
- srcdir=$(srcdir) CMD_MANDOC=foo ./testc help > testc.1
-
-Makefile: Makefile.in ../../config.status
- cd ../..; CONFIG_FILES=lib/cmd/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-$(OBJECTS): ../../include/config.h
-
-.PHONY: all Wall install uninstall check clean mostlyclean distclean realclean
diff --git a/usr.sbin/afs/src/lib/cmd/cmd.3 b/usr.sbin/afs/src/lib/cmd/cmd.3
deleted file mode 100644
index 5d7f86423a6..00000000000
--- a/usr.sbin/afs/src/lib/cmd/cmd.3
+++ /dev/null
@@ -1,271 +0,0 @@
-.\" $KTH: cmd.3,v 1.1 2000/06/01 14:30:58 lha Exp $
-.\" Things to fix:
-.\" * use better macros for arguments (like .Pa for files)
-.\"
-.Dd June 1, 2000
-.Dt FS 3
-.Os "Arla, KTH"
-.Sh NAME
-.Nm cmd
-.Nd command line parser and mdoc manual page generator
-.Sh SYNOPSIS
-.Fo "struct cmd_syndesc * cmd_CreateSyntax"
-.Fa "const char *name"
-.Fa "cmd_proc main"
-.Fa "void *rock"
-.Fa "const char *help_str"
-.Fc
-.Fo "int cmd_setBeforeProc"
-.Fa "int (*proc) (void *rock)"
-.Fa "void *rock"
-.Fc
-.Fo "int cmd_setAfterProc"
-.Fa "int (*proc) (void *rock)"
-.Fa "void *rock"
-.Fc
-.Fo "void cmd_AddParm"
-.Fa "struct cmd_syndesc *ts"
-.Fa "const char *cmd"
-.Fa "cmd_parmdesc_type type"
-.Fa "cmd_parmdesc_flags flags"
-.Fa "const char *help_str"
-.Fc
-.Fo "int cmd_CreateAlias"
-.Fa "struct cmd_syndesc *ts"
-.Fa "const char *name"
-.Fc
-.Fo "int cmd_Seek"
-.Fa "struct cmd_syndesc *ts"
-.Fa "int pos"
-.Fc
-.Fo "int cmd_ParseLine"
-.Fa "const char *line"
-.Fa "char **argv"
-.Fa "int *n"
-.Fa "int maxn"
-.Fc
-.Fo "void cmd_FreeArgv"
-.Fa "char **argv"
-.Fc
-.Fo "int cmd_Dispatch"
-.Fa "int argc"
-.Fa "char **argv"
-.Fc
-.Sh DESCRIPTION
-.Nm
-is a suite of functions that parses file for the Arla programs in a
-AFS compatible way.
-.Pp
-There is some problems with the cmd interface,
-both that you have to do a lof of post-parsing yourself (like fetching
-converting to numbers) and the interface isn't reenterant.
-.Pp
-You create a new command by calling
-.Fn cmd_CreateSyntax .
-An alias to this command can be added with
-.Fn cmd_CreateAlias .
-Then parameters can be added to the command with
-.Fn cmd_AddParm .
-Finally
-.Fn cmd_Dispatch
-is called and the argument are parsed.
-.Pp
-The
-.Fn cmd_CreateSyntax
-function adds a new command
-.Fa name
-to the syntax. If the command is found when parsing, then function
-.Fa main
-is called with the argument
-.Fa rock.
-The helpstring
-.Fn help_str
-is shown whenever help is needed for this command.
-.Pp
-The function
-.Fn cmd_setBeforeProc
-sets a function to be called when parsing is complete and the
-.Fa main
-is about to be called for current command.
-.Fa Rock
-is passed as an argument to
-.Fa proc
-whenever called.
-.Pp
-The function
-.Fn cmd_setAfterProc
-sets a function to be called after
-the
-.Fa main
-for the current command has been called.
-.Fa Rock
-is passed as an argument to
-.Fa proc
-whenever called.
-.Pp
-The function
-.Fn cmd_AddParm
-adds a new parameter
-.Fa cmd
-to the command
-.Fa ts
-of
-.Fa type
-and with
-.Fa flags .
-If the user want help about the command,
-.Fa help_str
-is incorporated in the help output.
-.Pp
-The function
-.Fn cmd_CreateAlias
-creates a alias
-.Fa name
-for the command
-.Fa ts .
-.Pp
-The function
-.Fn cmd_Seek
-changes the argument currently being set by
-.Fn cmd_AddParm
-This makes it possible to limit a
-.Fa CMD_LIST|CMD_EXPANDS
-parmeter, with respect to how many argument that it will parse.
-.Pp
-The function
-.Fn cmd_ParseLine
-will split up the
-.Fa line
-into argument that is saved in
-.Fa argv
-maximum of
-.Fa maxn
-will be parsed.
-The number of argument will be stored in
-.Fa n.
-.Pp
-The function
-.fn cmd_FreeArgv
-will free the arguments
-.Fa argv
-that
-.Fn cmd_ParseLine
-allocated.
-.Pp
-The function
-.Fn cmd_Dispatch
-will take the current syntax and try to parse the arguments
-.Fa argc, argv.
-.Pp
-When a
-.Xr mdoc 7
-file is generated. The .ctx file for the command is read to add extra
-content to the manual-page. The file is split up in sections separated by
-.Pp
-.Dl %section-name part-name
-.Pp
-Typical lines are
-.Li %command
-.Fa commandname,
-where commandname is the name that was added with
-.Fn cmd_CreateSyntax.
-.Pp
-Other sections are
-.Bl -tag -width "section"
-.It %name description
-Description of the program (\&.Nm in mdoc).
-.It %name os
-Os version (\&.Os in mdoc).
-.It %name section
-Section of the manualpage (\&.Dt in mdoc).
-.It %section description
-Text for the DESCRIPTION section.
-.It %section errors
-Text for the ERRORS section.
-.It %section see also
-Text for the SEE ALSO section.
-.It %section history
-Text for the HISTORY section.
-.It %section authors
-Text for the AUTHORS section.
-.It %section BUGS
-Text for the bugs section.
-.El
-.Pp
-Lines starting with # are comments.
-.Sh ENVIRONMENT
-When
-.Ev CMD_MANDOC
-set to something and the built-in command
-.Cm help
-is called, mdoc output is generated.
-.Ev srcdir
-is looked upon when opening the .ctx file to enable building out of tree.
-.Sh EXAMPLES
-.Bd -literal
-#include <stdio.h>
-#include <err.h>
-#include <cmd.h>
-
-static int
-setacl (struct cmd_syndesc *t, void *ptr)
-{
- struct cmd_item *it;
- int i;
-
- printf ("setacl:");
- printf (" dir: %s aces:", (char *)t->params[0].items->data);
- for (it = t->params[1].items; it ; it = it->next) {
- printf (" %s", (char *)it->data);
- i++;
- }
- if (t->params[2].items)
- printf (" flag: -clear");
- printf ("\n");
- if (i % 2 != 0)
- errx (1, "ace pairs isn't pairs");
- return 0;
-}
-
-int
-main (int argc, char **argv)
-{
- struct cmd_syndesc *ts;
- int ret;
-
- ts = cmd_CreateSyntax ("setacl", setacl, NULL, "set a acl on a directory");
-
- cmd_CreateAlias (ts, "sa");
- cmd_AddParm (ts, "-dir", CMD_SINGLE, CMD_REQUIRED, "dir");
- cmd_AddParm (ts, "-ace", CMD_LIST, CMD_REQUIRED, "acl entry");
- cmd_AddParm (ts, "-clear", CMD_FLAG, CMD_OPTIONAL, "");
-
- ret = cmd_Dispatch (argc, argv);
- if (ret)
- errx (1, "dispatch failed");
-
- return 0;
-}
-
-.Ed
-.Sh FILES
-A file named the same way as the command binary (really argv[0]) with
-the extention .ctx will be used to add extra help-text in the mdoc
-manpage when its generated.
-.Sh SEE ALSO
-.Xr getarg 3 ,
-.Xr mdoc 7
-.Sh HISTORY
-First written on CMU. Taken up by Transarc/IBM in their AFS
-product. Reimplemented for Arla since a lot of people missed it. When
-it got added to arla it also got functionally like generating mdoc
-output.
-.Sh AUTHORS
-Love Hörnquist-Åstrand <lha@stacken.kth.se>
-.Sh BUGS
-Plenty of them.
-.Pp
-.Fn cmd_ParseLine
-and
-.Fn cmd_FreeArgv
-isn't implemented.
diff --git a/usr.sbin/afs/src/lib/cmd/cmd.c b/usr.sbin/afs/src/lib/cmd/cmd.c
deleted file mode 100644
index ae353768192..00000000000
--- a/usr.sbin/afs/src/lib/cmd/cmd.c
+++ /dev/null
@@ -1,1021 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#include <strings.h>
-#include <assert.h>
-#include <ctype.h>
-#include <err.h>
-#include <roken.h>
-
-#include <cmd.h>
-
-#ifdef RCSID
-RCSID("$KTH: cmd.c,v 1.11 2000/09/29 22:43:02 assar Exp $");
-#endif
-
-static struct cmd_syndesc *cmd_cmds = NULL;
-static struct cmd_syndesc **cmd_lastcmd = &cmd_cmds;
-static int _cmd_init = 0;
-
-static int (*before_proc) (void *rock) = NULL;
-static void *before_rock = NULL;
-static int (*after_proc) (void *rock) = NULL;
-static void *after_rock = NULL;
-
-static void
-cmd_PrintSyntaxManDoc (const char *commandname);
-
-
-static struct cmd_syndesc *
-new_cmd (const char *name, const char *help_str, struct cmd_syndesc *alias)
-{
- struct cmd_syndesc *ts;
-
- ts = malloc (sizeof(*ts));
- if (ts == NULL)
- return NULL;
- memset (ts, 0, sizeof (*ts));
-
- if (name) {
- ts->name = strdup (name);
- if (ts->name == NULL) {
- free (ts);
- return NULL;
- }
- }
- if (help_str) {
- ts->help = strdup (help_str);
- if (ts->help == NULL) {
- free (ts->name);
- free (ts);
- return NULL;
- }
- }
- if (alias) {
- ts->aliasOf = alias;
- ts->nextAlias = alias->nextAlias;
- alias->nextAlias = ts;
- ts->flags |= CMD_ALIAS;
- }
- if (ts->name == NULL) {
- assert (cmd_cmds == NULL || cmd_cmds->name != NULL);
- ts->next = cmd_cmds;
- if (&cmd_cmds == cmd_lastcmd)
- cmd_lastcmd = &ts->next;
- cmd_cmds = ts;
- } else {
- *cmd_lastcmd = ts;
- cmd_lastcmd = &ts->next;
- }
- return ts;
-}
-
-/*
- *
- */
-
-static int
-find_command (struct cmd_syndesc *cmd_cmds, const char *func,
- struct cmd_syndesc **ret)
-{
- struct cmd_syndesc *partial_match = NULL;
- struct cmd_syndesc *ts;
- int partial_len = strlen (func);
-
- for (ts = cmd_cmds; ts; ts = ts->next) {
- if (ts->name == NULL)
- continue;
- if (strcasecmp (ts->name, func) == 0) {
- if (ts->aliasOf)
- ts = ts->aliasOf;
- *ret = ts;
- return 0;
- }
- if (strncasecmp (ts->name, func, partial_len) == 0) {
- if (partial_match)
- return CMD_AMBIG;
- partial_match = ts;
- }
- }
- if (partial_match) {
- if (partial_match->aliasOf)
- partial_match = partial_match->aliasOf;
- *ret = partial_match;
- return 0;
- }
- return CMD_UNKNOWNCMD;
-}
-
-/*
- *
- */
-
-static void
-print_usage (const char *name, struct cmd_syndesc *ts)
-{
- int i;
-
- if (getenv ("CMD_MANDOC") != NULL) {
- cmd_PrintSyntaxManDoc(__progname); /* XXX */
- return;
- }
-
- printf ("%s", name);
- if (ts->name)
- printf (" %s", ts->name);
-
- for (i = 0; i < CMD_MAXPARMS ; i++) {
- char *help = ts->parms[i].help;
- char *name = ts->parms[i].name;
- if (help == NULL)
- help = "arg";
- if ((ts->parms[i].flags & CMD_HIDE) == CMD_HIDE || name == NULL)
- continue;
- printf (" ");
- if ((ts->parms[i].flags & CMD_OPTIONAL) == CMD_OPTIONAL)
- printf ("[");
- switch (ts->parms[i].type) {
- case CMD_FLAG:
- printf ("%s", name);
- break;
- case CMD_SINGLE:
- printf ("%s <%s>", name, help);
- break;
- case CMD_LIST:
- printf ("%s <%s>+", name, help);
- break;
- default:
- errx(-1, "print_usage - unknown command type\n");
- /* NOTREACHED */
- }
- if ((ts->parms[i].flags & CMD_OPTIONAL) == CMD_OPTIONAL)
- printf ("]");
- }
- if (ts->name == NULL)
- printf (" command");
- printf ("\n");
-}
-
-/*
- *
- */
-
-static int
-cmd_internal_help (struct cmd_syndesc *t, void *ptr)
-{
- struct cmd_syndesc *ts;
- char *help;
-
- if (getenv ("CMD_MANDOC") != NULL) {
- cmd_PrintSyntaxManDoc(__progname); /* XXX */
- return 0;
- }
-
- if (t->parms[0].items == NULL) {
-
- for (ts = cmd_cmds; ts; ts = ts->next) {
- if (ts->name == NULL && cmd_cmds == ts)
- continue;
- if ((ts->flags & CMD_HIDDEN) == CMD_HIDDEN)
- continue;
- if (ts->aliasOf)
- continue;
- if (ts->help)
- help = ts->help;
- else
- help = "";
-
- printf ("%-10s %s\n", ts->name, help);
- }
- } else {
- char *cmd = t->parms[0].items->data;
- struct cmd_syndesc *ts;
- int ret;
-
- ret = find_command (cmd_cmds, cmd, &ts);
- if (ret)
- return ret;
- print_usage (__progname, ts); /* XXX */
- }
- return 0;
-}
-
-/*
- *
- */
-
-static int
-cmd_internal_apropos (struct cmd_syndesc *t, void *ptr)
-{
- struct cmd_syndesc *ts;
- char *cmd, *help;
-
- cmd = t->parms[0].items->data;
-
- for (ts = cmd_cmds; ts; ts = ts->next) {
- if (ts->name == NULL && cmd_cmds == ts)
- continue;
- if (ts->help)
- help = ts->help;
- else
- help = "";
- if (strstr(ts->name, cmd))
- printf ("%-10s %s\n", ts->name, help);
- }
- return 0;
-}
-
-/*
- * Create a new command with `name' that will run the function `main'
- * with the `rock'. When help is choose `help_str' will be displayed.
- */
-
-struct cmd_syndesc *
-cmd_CreateSyntax (const char *name, cmd_proc main, void *rock,
- const char *help_str)
-{
- struct cmd_syndesc *ts;
-
- ts = new_cmd (name, help_str, NULL);
-
- ts->proc = main;
- ts->rock = rock;
-
- cmd_Seek (ts, CMD_HELPPARM);
- cmd_AddParm (ts, "-help", CMD_FLAG, CMD_OPTIONAL, "get detailed help");
- cmd_Seek (ts, 0);
-
- return ts;
-}
-
-/*
- *
- */
-
-int
-cmd_SetBeforeProc (int (*proc) (void *), void *rock)
-{
- before_proc = proc;
- before_rock = rock;
- return 0;
-}
-
-/*
- *
- */
-
-int
-cmd_SetAfterProc (int (*proc) (void *rock), void *rock)
-{
- after_proc = proc;
- after_rock = rock;
- return 0;
-}
-
-/*
- * Allocate a new parameter to `ts' with name `cmd' of `type' and with
- * `flags'. When help is needed show `help_str'.
- */
-
-void
-cmd_AddParm (struct cmd_syndesc *ts, const char *name,
- cmd_parmdesc_type type, cmd_parmdesc_flags flags,
- const char *help_str)
-{
- struct cmd_parmdesc *p = &ts->parms[ts->nParams];
-
- memset (p, 0, sizeof(*p));
-
- if (ts->nParams > CMD_HELPPARM)
- return;
-
- p->name = strdup (name);
- if (p->name == NULL)
- return;
- p->help = strdup(help_str);
- if (p->help == NULL) {
- free (p->name);
- return;
- }
- ts->nParams++;
-
- p->type = type;
- p->flags = flags;
-}
-
-/*
- *
- */
-
-int
-cmd_CreateAlias (struct cmd_syndesc *orignal, const char *name)
-{
- struct cmd_syndesc *ts;
- ts = new_cmd (name, NULL, orignal);
- if (ts == NULL)
- return CMD_INTERALERROR;
- return 0;
-}
-
-/*
- *
- */
-
-int
-cmd_Seek (struct cmd_syndesc *ts, int pos)
-{
- if (pos > CMD_HELPPARM || pos < 0)
- return CMD_EXCESSPARMS;
- ts->nParams = pos;
- return 0;
-}
-
-/*
- *
- */
-
-void
-cmd_FreeArgv (char **argv)
-{
- return;
-}
-
-/*
- *
- */
-
-#define CMD_IS_CMD(str) (str[0] == '-' && !isdigit((unsigned char)str[1]))
-
-/*
- *
- */
-
-static struct cmd_parmdesc *
-find_next_param (struct cmd_syndesc *ts, int *curval)
-{
- int i;
- for (i = *curval; i < CMD_MAXPARMS ; i++) {
- if ((ts->parms[i].flags & CMD_EXPANDS) == CMD_EXPANDS)
- break;
- if (ts->parms[i].name == NULL)
- continue;
- if (ts->parms[i].items != NULL)
- continue;
- break;
- }
- if (i >= CMD_MAXPARMS)
- return NULL;
- *curval = i;
- return &ts->parms[i];
-}
-
-/*
- *
- */
-
-static int
-find_next_name (struct cmd_syndesc *ts, const char *name,
- struct cmd_parmdesc **ret)
-{
- struct cmd_parmdesc *partial_match = NULL;
- int i, partial_len = strlen(name);
-
- for (i = 0; i < CMD_MAXPARMS; i++) {
- if (ts->parms[i].name == NULL)
- continue;
- if (strcasecmp (name, ts->parms[i].name) == 0) {
- *ret = &ts->parms[i];
- return 0;
- }
- if (strncasecmp (name, ts->parms[i].name, partial_len) == 0) {
- if (partial_match)
- return CMD_AMBIG;
- partial_match = &ts->parms[i];
- }
- }
- if (partial_match) {
- *ret = partial_match;
- return 0;
- }
- return CMD_UNKNOWNSWITCH;
-}
-
-/*
- *
- */
-
-static struct cmd_item *
-new_items (struct cmd_parmdesc *p)
-{
- struct cmd_item *i;
- i = malloc (sizeof (*i));
- if (i == NULL)
- err (1, "new_items");
- i->next = p->items;
- p->items = i;
- return i;
-}
-
-/*
- *
- */
-
-static int
-parse_options (int argc, char **argv, int *optind, struct cmd_syndesc *ts,
- int failp)
-{
- struct cmd_parmdesc *p;
- int i, ret;
-
- for (i = 0; i < CMD_MAXPARMS; i++) {
- if (ts->parms[i].name)
- break;
- }
- if (i == CMD_MAXPARMS)
- return 0;
-
-
- for (i = 0; i < argc; i++) {
- ret = find_next_name (ts, argv[i], &p);
- if (ret) {
- if (failp)
- return ret;
- break;
- }
- switch (p->type) {
- case CMD_FLAG:
- assert (p->items == NULL);
- p->items = new_items (p);
- p->items->data = p;
- break;
- case CMD_SINGLE:
- assert (p->items == NULL);
- if (i == argc - 1)
- return CMD_TOOFEW;
- i++;
- p->items = new_items (p);
- p->items->data = argv[i];
- break;
- case CMD_LIST:
- if (i == argc - 1)
- return CMD_TOOFEW;
- i++;
- while (i < argc) {
- p->items = new_items (p);
- p->items->data = argv[i];
- if (i >= argc - 1 || CMD_IS_CMD(argv[i+1]))
- break;
- i++;
- }
- break;
- default:
- errx(-1, "parse_options - unknown command type\n");
- /* NOTREACHED */
- }
- }
- if (argc < i)
- i = argc;
- *optind = i;
- return 0;
-}
-
-/*
- *
- */
-
-static int
-parse_magic_options (int argc, char **argv, int *optind,
- struct cmd_syndesc *ts)
-{
- struct cmd_parmdesc *p;
- int i, curval = 0;
-
- for (i = 0; i < argc; i++) {
- if (CMD_IS_CMD(argv[i]))
- break;
- p = find_next_param (ts, &curval);
- if (p == NULL)
- break;
- if (p->type == CMD_FLAG) {
-#if 0
- assert (p->items == NULL);
- p->items = new_items (p);
- p->items->data = p;
-#else
- break;
-#endif
- } else if (p->type == CMD_SINGLE) {
- assert (p->items == NULL);
- p->items = new_items (p);
- p->items->data = argv[i];
- } else if (p->type == CMD_LIST) {
- while (i < argc) {
- p->items = new_items (p);
- p->items->data = argv[i];
- if ((i >= argc - 1 || CMD_IS_CMD(argv[i+1]))
- || (p->flags & CMD_EXPANDS) == 0)
- break;
- i++;
- }
- } else {
- break;
- }
- }
- if (argc < i)
- i = argc;
- *optind = i;
- return 0;
-}
-
-/*
- *
- */
-
-static struct cmd_parmdesc *
-req_argumentp (struct cmd_syndesc *ts)
-{
- int i;
-
- for (i = 0; i < CMD_MAXPARMS; i++) {
- if (ts->parms[i].name == NULL)
- continue;
- if ((ts->parms[i].flags & CMD_OPTIONAL) == 0
- && ts->parms[i].items == NULL)
- return &ts->parms[i];
- }
- return NULL;
-}
-
-/*
- *
- */
-
-int
-cmd_ParseLine (const char *line, char **argv, int *n, int maxn)
-{
- return 0;
-}
-
-/*
- *
- */
-
-static int
-call_proc (const char *programname, struct cmd_syndesc *ts)
-{
- struct cmd_parmdesc *p;
- int ret;
-
- if (ts->parms[CMD_HELPPARM].items) {
- print_usage (programname, ts);
- return 0;
- }
-
- p = req_argumentp (ts);
- if (p) {
- print_usage (programname, ts);
- fprintf (stderr, "missing argument: %s\n", &p->name[1]);
- return CMD_USAGE;
- }
-
- if (before_proc)
- (*before_proc) (before_rock);
-
- ret = (*ts->proc) (ts, ts->rock);
-
- if (after_proc)
- (*after_proc) (before_rock);
- return ret;
-}
-
-/*
- *
- */
-
-int
-cmd_Dispatch (int argc, char **argv)
-{
- struct cmd_syndesc *ts;
- int optind = 0;
- int ret;
- char *programname = argv[0];
-
- argc -= 1;
- argv += 1;
-
- if (!_cmd_init) {
- if (cmd_cmds->next != NULL || cmd_cmds->proc == NULL) {
- ts = cmd_CreateSyntax ("help", cmd_internal_help, NULL, "help");
- cmd_AddParm (ts, "-cmd", CMD_SINGLE, CMD_OPTIONAL, "command");
- ts = cmd_CreateSyntax ("apropos", cmd_internal_apropos,
- NULL, "apropos");
- cmd_AddParm (ts, "-cmd", CMD_SINGLE, CMD_REQUIRED, "command");
- }
- if (cmd_cmds->name)
- ts = cmd_CreateSyntax ("main", NULL, NULL, NULL);
- _cmd_init = 1;
- }
-
- if (cmd_cmds->next == NULL && cmd_cmds->proc) {
- ret = parse_magic_options (argc, argv, &optind, ts);
- if (ret)
- return ret;
-
- argv += optind;
- argc -= optind;
- optind = 0;
- }
- ret = parse_options (argc, argv, &optind, cmd_cmds, 0);
- if (ret)
- errx (1, "main parse failed");
- if (cmd_cmds->next == NULL && cmd_cmds->proc) {
- return call_proc (programname, cmd_cmds);
- } else {
- struct cmd_parmdesc *p;
-
- if (cmd_cmds->parms[CMD_HELPPARM].items) {
- print_usage (programname, cmd_cmds);
- return 0;
- }
-
- p = req_argumentp (cmd_cmds);
- if (p) {
- fprintf (stderr, "missing argument: %s\n", &p->name[1]);
- return CMD_USAGE;
- }
- }
-
- argv += optind;
- argc -= optind;
-
- if (argc <= 0) {
- print_usage (programname, ts);
- return CMD_USAGE;
- }
-
- ret = find_command (cmd_cmds, argv[0], &ts);
- if (ret)
- return ret;
-
- argv += 1;
- argc -= 1;
- optind = 0;
-
- ret = parse_magic_options (argc, argv, &optind, ts);
- if (ret)
- return ret;
-
- argv += optind;
- argc -= optind;
- optind = 0;
-
- ret = parse_options (argc, argv, &optind, ts, 1);
- if (ret)
- return ret;
-
- argv += optind;
- argc -= optind;
-
- if (argc != 0) {
- print_usage (programname, ts);
- return CMD_USAGE;
- }
-
- return call_proc (programname, ts);
-}
-
-
-static void
-cmd_PrintParams (struct cmd_syndesc *ts)
-{
- int i;
-
- for (i = 0; i < CMD_MAXPARMS ; i++) {
- char *help = ts->parms[i].help;
- if (ts->parms[i].name == NULL)
- continue;
- if (help == NULL)
- help = "arg";
- if ((ts->parms[i].flags & CMD_HIDE) == CMD_HIDE)
- continue;
- if ((ts->parms[i].flags & CMD_OPTIONAL) == CMD_OPTIONAL)
- printf (".Op ");
- else
- printf (".");
- switch (ts->parms[i].type) {
- case CMD_FLAG:
- printf ("Cm %s\n", ts->parms[i].name);
- break;
- case CMD_SINGLE:
- printf ("Cm %s Ar %s\n", ts->parms[i].name, help);
- break;
- case CMD_LIST:
- printf ("Cm %s Ar %s ...\n", ts->parms[i].name, help);
- break;
- default:
- errx(-1, "cmd_PrintParams - unknown command type\n");
- /* NOTREACHED */
-
- }
- }
-#if 0
- for (i = 0; i < CMD_MAXPARMS ; i++) {
- if (ts->parms[i].name == NULL)
- continue;
- printf ("\tflag: %s\n", ts->parms[i].name);
- printf ("\t\thelp: %s\n", ts->parms[i].help);
- printf ("\t\tflags: ");
- if ((ts->parms[i].flags & CMD_REQUIRED) == CMD_REQUIRED)
- printf ("required");
- if ((ts->parms[i].flags & CMD_EXPANDS) == CMD_EXPANDS)
- printf ("expands");
- if ((ts->parms[i].flags & CMD_PROCESSED) == CMD_PROCESSED)
- printf ("processed");
- printf ("\n");
- }
-#endif
-}
-
-/*
- *
- */
-
-static int
-cmd_ExtraText (const char *cmd, const char *sectionname,
- const char *class, const char *name, int withcr)
-{
- char *fn, *section;
- char buf[1024];
- FILE *f;
- int len, searching = 1;
-
- asprintf (&fn, "%s.ctx", cmd);
- f = fopen (fn, "r");
- if (f == NULL) {
- free (fn);
- if (getenv ("srcdir")) {
- asprintf (&fn, "%s/%s.ctx", getenv("srcdir"), cmd);
- f = fopen (fn, "r");
- }
- if (f == NULL)
- return 0;
- }
- len = asprintf (&section, "%%%s %s", class, name);
-
- while (fgets (buf, sizeof(buf), f) != NULL) {
- if (buf[0] != '\0' && buf[strlen(buf) - 1] == '\n')
- buf[strlen(buf) - 1] = '\0';
-
- if (buf[0] == '#')
- continue;
-
- if (searching) {
- if (strncasecmp (buf, section, len) == 0) {
- searching = 0;
- if (sectionname)
- printf ("%s", sectionname);
- }
- } else {
- char *p = buf;
- if (buf[0] == '%') {
- break;
- }
- while (isspace ((unsigned char)*p)) p++;
- if (*p == '\0')
- continue;
- printf ("%s%s", p, withcr ? "\n" : "");
- }
- }
- fclose (f);
- return searching;
-}
-
-static void
-cmd_PrintSyntaxManDoc (const char *commandname)
-{
- char timestr[64], cmd[64];
- time_t t;
- struct cmd_syndesc *ts;
-
- printf(".\\\" Things to fix:\n");
- printf(".\\\" * use better macros for arguments (like .Pa for files)\n");
- printf(".\\\"\n");
-
- t = time(NULL);
- strftime(timestr, sizeof(timestr), "%B %e, %Y", localtime(&t));
- strlcpy(cmd, commandname, sizeof(cmd));
- cmd[sizeof(cmd)-1] = '\0';
-/* XXX-libroken strupr(cmd);*/
-
- printf(".Dd %s\n", timestr);
- printf(".Dt %s ", cmd);
- if (cmd_ExtraText (commandname, NULL, "name", "section", 0))
- printf("SECTION");
- printf ("\n");
- if (cmd_ExtraText (commandname, ".Os ", "name", "OS", 0))
- printf(".Os OPERATING_SYSTEM");
- printf ("\n");
- printf(".Sh NAME\n");
- printf(".Nm %s\n", commandname);
- if (cmd_ExtraText (commandname, ".Nd ", "name", "description", 1))
- printf(".Nd in search of a description\n");
- printf(".Sh SYNOPSIS\n");
- printf(".Nm\n");
- if (cmd_cmds->name == NULL)
- cmd_PrintParams (cmd_cmds);
- if (cmd_cmds->next)
- printf (".Cm command\n.Op ...");
- printf ("\n");
- printf(".Sh DESCRIPTION\n");
-
- cmd_ExtraText (commandname, NULL, "section", "description", 1);
-
- if (cmd_cmds->name == NULL && cmd_cmds->next == NULL) {
- printf (".Pp\n");
- if (cmd_ExtraText (commandname, NULL, "command", "_main", 1))
- printf ("Tell someone to add some helptext "
- "here to the .ctx file\n");
- } else {
- printf (".Bl -tag -width Ds\n");
-
- for (ts = cmd_cmds; ts; ts = ts->next) {
- struct cmd_syndesc *t = ts->nextAlias;
-
- if (ts->name == NULL && cmd_cmds == ts)
- continue;
- if ((ts->flags & CMD_HIDDEN) == CMD_HIDDEN)
- continue;
- if (ts->aliasOf)
- continue;
-
- printf (".It %s", ts->name);
-
- if (t) {
- while (t) {
- printf (", %s", t->name);
- t = t->nextAlias;
- }
- }
- printf ("\n.Pp\n");
- printf (".Nm \"%s %s\"\n", commandname, ts->name);
- cmd_PrintParams (ts);
- printf (".Pp\n");
- if (strcmp (ts->name, "help") == 0) {
- printf ("List all commands, or if\n"
- ".Ar command\n"
- "is given as an argument, help for that command.\n");
- } else if (strcmp (ts->name, "apropos") == 0) {
- printf ("List all command that have the argument\n.Ar command\n"
- "as a subtring in themself.");
- } else {
- if (cmd_ExtraText (commandname, NULL, "command", ts->name, 1))
- printf ("Tell someone to add some helptext "
- "here to the .ctx file\n");
- }
- }
- printf(".El\n");
- }
-
- cmd_ExtraText (commandname, ".Sh ERRORS\n", "section", "errors", 1);
- cmd_ExtraText (commandname, ".Sh SEE ALSO\n", "section", "see also", 1);
- cmd_ExtraText (commandname, ".Sh HISTORY\n", "section", "history", 1);
- cmd_ExtraText (commandname, ".Sh AUTHORS\n", "section", "authors", 1);
- cmd_ExtraText (commandname, ".Sh BUGS\n", "section", "bugs", 1);
-}
-
-/*
- *
- */
-
-void
-cmd_PrintSyntax (const char *commandname)
-{
- const char *name;
- struct cmd_syndesc *ts;
- int i;
-
- name = strrchr (commandname, '/');
- if (name == NULL)
- name = commandname;
- else
- name++;
-
- if (getenv ("CMD_MANDOC") != NULL) {
- cmd_PrintSyntaxManDoc(name);
- return;
- }
-
- for (ts = cmd_cmds; ts; ts = ts->next) {
- struct cmd_syndesc *t = ts->nextAlias;
-
- if (ts->name == NULL && cmd_cmds == ts)
- printf ("exec-file: %s\n", name);
- else
- printf ("command: %s - %s\n", ts->name, ts->help);
- printf ("\tflags: ");
- if ((ts->flags & CMD_ALIAS) == CMD_ALIAS)
- printf (" alias");
- if ((ts->flags & CMD_HIDDEN) == CMD_HIDDEN)
- printf (" hidden");
- printf ("\n");
- if (ts->aliasOf)
- continue;
- if (t) {
- printf ("\taliases:");
- while (t) {
- printf (" %s", t->name);
- t = t->nextAlias;
- }
- printf ("\n");
- }
- for (i = 0; i < CMD_MAXPARMS ; i++) {
- if (ts->parms[i].name == NULL)
- continue;
- printf ("\tflag: %s\n", ts->parms[i].name);
- switch (ts->parms[i].type) {
- case CMD_FLAG: printf ("\t\ttype: flag\n"); break;
- case CMD_SINGLE: printf ("\t\ttype: single\n"); break;
- case CMD_LIST: printf ("\t\ttype: list\n"); break;
- default:
- errx(-1, "cmd_PrintSyntax - unknown command type\n");
- /* NOTREACHED */
- }
- printf ("\t\thelp: %s\n", ts->parms[i].help);
- printf ("\t\tflags: ");
- if ((ts->parms[i].flags & CMD_REQUIRED) == CMD_REQUIRED)
- printf ("required");
- if ((ts->parms[i].flags & CMD_OPTIONAL) == CMD_OPTIONAL)
- printf ("optional");
- if ((ts->parms[i].flags & CMD_EXPANDS) == CMD_EXPANDS)
- printf ("expands");
- if ((ts->parms[i].flags & CMD_HIDE) == CMD_HIDE)
- printf ("hide");
- if ((ts->parms[i].flags & CMD_PROCESSED) == CMD_PROCESSED)
- printf ("processed");
- printf ("\n");
- }
- }
-}
-
-/*
- *
- */
-
-static const char *cmd_errors[] = {
- "cmd - Excess parameters",
- "cmd - Internal error",
- "cmd - Notlist",
- "cmd - Too many",
- "cmd - Usage",
- "cmd - Unknown command",
- "cmd - Unknown switch",
- "cmd - Ambigous",
- "cmd - Too few arguments",
- "cmd - Too many arguments"
-};
-
-const char *
-cmd_number2str(int error)
-{
- if (error < CMD_EXCESSPARMS || error > CMD_TOOBIG)
- return NULL;
- return cmd_errors[error - CMD_EXCESSPARMS];
-}
diff --git a/usr.sbin/afs/src/lib/cmd/cmd.h b/usr.sbin/afs/src/lib/cmd/cmd.h
deleted file mode 100644
index 340a516465f..00000000000
--- a/usr.sbin/afs/src/lib/cmd/cmd.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * $KTH: cmd.h,v 1.2 2000/06/01 18:37:26 lha Exp $
- */
-
-#ifndef _ARLA_CMD_H
-#define _ARLA_CMD_H 1
-
-/* syncdesc */
-typedef enum { CMD_ALIAS = 1,
- CMD_HIDDEN = 4 } cmd_syncdesc_flags;
-
-/* parmdesc */
-typedef enum { CMD_FLAG = 1,
- CMD_SINGLE,
- CMD_LIST } cmd_parmdesc_type;
-
-typedef enum { CMD_REQUIRED = 0x0,
- CMD_OPTIONAL = 0x1,
- CMD_EXPANDS = 0x2,
- CMD_HIDE = 0x4,
- CMD_PROCESSED = 0x8 } cmd_parmdesc_flags;
-
-enum { CMD_HELPPARM = 63, CMD_MAXPARMS = 64 } ;
-
-struct cmd_syndesc;
-
-typedef int (*cmd_proc) (struct cmd_syndesc *, void *);
-
-struct cmd_item {
- struct cmd_item *next;
- void *data;
-};
-
-struct cmd_parmdesc {
- char *name;
- cmd_parmdesc_type type;
- struct cmd_item *items;
- cmd_parmdesc_flags flags;
- char *help;
-};
-
-struct cmd_syndesc {
- struct cmd_syndesc *next;
- struct cmd_syndesc *nextAlias;
- struct cmd_syndesc *aliasOf;
- char *name;
- char *a0name;
- char *help;
- cmd_proc proc;
- void *rock;
- int nParams;
- cmd_syncdesc_flags flags;
- struct cmd_parmdesc parms[CMD_MAXPARMS];
-};
-
-struct cmd_syndesc *
-cmd_CreateSyntax (const char *name, cmd_proc main, void *rock,
- const char *help_str);
-
-int
-cmd_SetBeforeProc (int (*proc) (void *rock), void *rock);
-
-int
-cmd_SetAfterProc (int (*proc) (void *rock), void *rock);
-
-void
-cmd_AddParm (struct cmd_syndesc *ts, const char *cmd,
- cmd_parmdesc_type type, cmd_parmdesc_flags flags,
- const char *help_str);
-
-int
-cmd_CreateAlias (struct cmd_syndesc *ts, const char *name);
-
-int
-cmd_Seek (struct cmd_syndesc *ts, int pos);
-
-void
-cmd_FreeArgv (char **argv);
-
-int
-cmd_ParseLine (const char *line, char **argv, int *n, int maxn);
-
-int
-cmd_Dispatch (int argc, char **argv);
-
-void
-cmd_PrintSyntax (const char *commandname);
-
-const char *
-cmd_number2str(int error);
-
-#define CMD_EXCESSPARMS 3359744
-#define CMD_INTERALERROR 3359745
-#define CMD_NOTLIST 3359746
-#define CMD_TOOMANY 3359747
-#define CMD_USAGE 3359748
-#define CMD_UNKNOWNCMD 3359749
-#define CMD_UNKNOWNSWITCH 3359750
-#define CMD_AMBIG 3359751
-#define CMD_TOOFEW 3359752
-#define CMD_TOOBIG 3359753
-
-#endif /* _ARLA_CMD_H */
diff --git a/usr.sbin/afs/src/lib/cmd/frame.ctx b/usr.sbin/afs/src/lib/cmd/frame.ctx
deleted file mode 100644
index 099e5d9cd35..00000000000
--- a/usr.sbin/afs/src/lib/cmd/frame.ctx
+++ /dev/null
@@ -1,48 +0,0 @@
-# $KTH: frame.ctx,v 1.1 2000/06/01 14:31:00 lha Exp $
-# This is a comment
-
-%name description
-
- description here
-
-%name os
-
- "Some environment"
-
-%name section
-
- 1
-
-%command somecommand
-
- Some help text that takes
- .Ar argument
-
-%command someothercommand
-
- Even more helptext
-
-%section bugs
-
- Manual pages are boring to write
-
-%section history
-
- This file is not that old.
-
-%section see also
-
- .Xr ls(1),
- .Xr some-other-command(7).
-
-%section authors
-
- Mini-me <me@example.org>
-
-%section description
-
- This is part of the DESCRIPTION section
-
-%section errors
-
- This is part of the ERRORS section
diff --git a/usr.sbin/afs/src/lib/cmd/testc.c b/usr.sbin/afs/src/lib/cmd/testc.c
deleted file mode 100644
index 56c345a931d..00000000000
--- a/usr.sbin/afs/src/lib/cmd/testc.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <err.h>
-#include <cmd.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: testc.c,v 1.4 2000/10/16 22:03:35 assar Exp $");
-#endif
-
-static int
-MainProc (struct cmd_syndesc *t, void *ptr)
-{
- printf ("main proc\n");
- return 0;
-}
-
-static int
-setacl (struct cmd_syndesc *t, void *ptr)
-{
- struct cmd_item *it;
- int i;
-
- printf ("setacl:");
- printf (" dir:");
- for (it = t->parms[0].items; it ; it = it->next) {
- printf (" %s", (char *)it->data);
- }
- printf (" acls:");
- for (i = 0, it = t->parms[1].items; it; it = it->next, i++)
- printf (" %s", (char *)it->data);
- printf (" flags:");
- if (t->parms[2].items) printf (" -clear");
- if (t->parms[3].items) printf (" -negative");
- if (t->parms[4].items) printf (" -id");
- if (t->parms[5].items) printf (" -if");
- printf ("\n");
- if (i % 2 != 0)
- errx (1, "ace pairs isn't pairs");
- return 0;
-}
-
-static int
-listacl (struct cmd_syndesc *t, void *ptr)
-{
- struct cmd_item *it;
-
- printf ("listacl: ");
- for (it = t->parms[0].items; it ; it = it->next)
- printf (" %s", (char *)it->data);
- printf ("\n");
- return 0;
-}
-
-static int
-listquota (struct cmd_syndesc *t, void *ptr)
-{
- printf ("listquota\n");
- return 0;
-}
-
-int
-main (int argc, char **argv)
-{
- struct cmd_syndesc *ts;
- int ret;
-
- set_progname (argv[0]);
-
- ts = cmd_CreateSyntax (NULL, MainProc, NULL, "foo");
-
- ts = cmd_CreateSyntax ("setacl", setacl, NULL, "set a acl on a directory");
-
- cmd_CreateAlias (ts, "sa");
- cmd_AddParm (ts, "-dir", CMD_LIST, CMD_REQUIRED, "dir");
- cmd_AddParm (ts, "-acl", CMD_LIST, CMD_REQUIRED|CMD_EXPANDS, "acl entry");
- cmd_AddParm (ts, "-clear", CMD_FLAG, CMD_OPTIONAL, "");
- cmd_AddParm (ts, "-negative", CMD_FLAG, CMD_OPTIONAL, "");
- cmd_AddParm (ts, "-id", CMD_FLAG, CMD_OPTIONAL, "");
- cmd_AddParm (ts, "-if", CMD_FLAG, CMD_OPTIONAL, "");
-
- ts = cmd_CreateSyntax ("listacl", listacl, NULL,
- "list a acl on a directory");
- cmd_CreateAlias (ts, "la");
- cmd_AddParm (ts, "-dir", CMD_LIST, CMD_OPTIONAL|CMD_EXPANDS, "dir");
-
- ts = cmd_CreateSyntax ("listquota", listquota,
- NULL, "show quota in a volume");
- cmd_CreateAlias (ts, "lq");
-
-#if 0
- cmd_PrintSyntax("fs");
-#endif
-
- ret = cmd_Dispatch (argc, argv);
-#if 0
- if (ret) {
- const char *error = cmd_number2str (ret);
- if (error == NULL)
- error = strerror (ret);
- errx (1, "dispatch failed: %s (%d)", error, ret);
- }
-#endif
-
- return 0;
-}
-
diff --git a/usr.sbin/afs/src/lib/cmd/testc.ctx b/usr.sbin/afs/src/lib/cmd/testc.ctx
deleted file mode 100644
index e9220adeb21..00000000000
--- a/usr.sbin/afs/src/lib/cmd/testc.ctx
+++ /dev/null
@@ -1,121 +0,0 @@
-#
-# $KTH: testc.ctx,v 1.1 2000/06/01 14:30:59 lha Exp $
-#
-
-%name description
-
- command to manipulate the filesystem
-
-%name os
-
- "Arla, KTH"
-
-%name section
-
- 1
-
-%command setacl
-
- Set the ACL for the named directory
- .Ar dir
- to the list of
- .Ar acl
- entries. If the flag
- .Fl clear
- is specified all current ACL entries are removed before the
- new one is added. You must have the A-ACL on the directory to
- be able to change the ACL.
-
- The ACL entry consist of two parts, a user/group and
- rights. The rights are rwlidka.
- .Bl -tag -width "Administer"
- .It Em Read
- the user/group can read files in this directory.
- .It Em Write
- the user/group can write files in this directory.
- .It Em List
- the user/group can list files in this directory, they
- can also read symlinks.
- .It Em Insert
- the user/group can create new files in this directory.
- .It Em Delete
- the user/group can delete files from this directory.
- .It Em locK
- the user/group can do locking on files in this directory.
- .It Em Administer
- the user/group can change the acl and the modebits in this directory
- .El
- .Pp
- There is also some named ACL that is easier to remember. Those are
- .Ar all,
- .Ar read,
- .Ar write,
- .Ar none,
- .Ar mail.
- All of these are quote obvoius what they do execpt the last
- one, and you shouldn't use that one.
- .Pp
- There are three special groups that is good know know about:
- .Bl -tag -width "Administer"
- .It Em system:anyuser
- any user of the AFS system
- .It Em system:auth-user
- any user the is authenticated to the cell that this directory exists.
- Use
- .Ic fs whatcell
- to figure out what cell it is.
- .It Em system:administrators
- this is system-administrators of the cell. They can't read
- files without with, but since the always can change the ACL
- they can add them-self. You should trust them the are nice guys.
- .El
- .Pp
- Groups and (remote)users can be created with
- .Xr pts(1).
-
- .Pp
- Examples:
- .Pp
- .Nm fs setacl
- \&. lha all
- .Pp
- .Nm fs setacl
- \&. system:anyuser none
-
-%command listacl
-
- List the ACL for the directory
- .Ar dir
- (or if its isn't specifed
- .Pa .
- will be used).
-
-%section bugs
-
- Not really complete
-
-%section history
-
- The fs command first appeared in Transarc AFS, it was
- reimplemented and extended in arla project by a mixure of
- people. In DCE/DFS the fs-commands name is
- .Xr fts(1)
- and in Coda the name is
- .Xr cfs(1).
-
-%section see also
-
- .Xr vos(1),
- .Xr pts(1),
- .Xr bos(1),
- .Xr arlad(1)
-
-%section authors
-
- Love Hörnquist-Åstrand <lha@stacken.kth.se>,
- \&...
-# If you feel that you should be here, add yourself
-
-%section description
-
- Some of the commands can only be run by root.
diff --git a/usr.sbin/afs/src/lib/ko/Makefile.in b/usr.sbin/afs/src/lib/ko/Makefile.in
deleted file mode 100644
index 0d7725bfea8..00000000000
--- a/usr.sbin/afs/src/lib/ko/Makefile.in
+++ /dev/null
@@ -1,165 +0,0 @@
-#
-# $KTH: Makefile.in,v 1.30.2.3 2001/10/23 23:54:09 ahltorp Exp $
-#
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-INCLUDES = -I. \
- -I$(srcdir) \
- -I../../include \
- -I$(srcdir)/../../include \
- -I../.. -I$(srcdir)/../.. \
- -I../../rxdef \
- @INC_roken@ \
- @KRB4_INC_FLAGS@
-
-CFLAGS = @CFLAGS@
-LDFLAGS = @LDFLAGS@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-KRB4_LIB_FLAGS = @KRB4_LIB_FLAGS@
-
-LIBS = -L../../util -lutil \
- @LIB_roken@ \
- $(KRB4_LIB_FLAGS) @LIBS@
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-includedir = @includedir@
-libdir = @libdir@
-sysconfdir = @sysconfdir@
-ARLACACHEDIR = @ARLACACHEDIR@
-ARLACONFFILE = @ARLACONFFILE@
-
-target_os = @target_os@
-target_vendor = @target_vendor@
-target_cpu = @target_cpu@
-
-#PICFLAGS = @PICFLAGS@
-
-LIBNAME = $(LIBPREFIX)ko
-#LIBEXT = @LIBEXT@
-LIBEXT = a
-#SHLIBEXT = @SHLIBEXT@
-#LIBPREFIX = @LIBPREFIX@
-LIBPREFIX = lib
-#LDSHARED = @LDSHARED@
-LIB = $(LIBNAME).$(LIBEXT)
-PROGS = gensysname kotest
-
-DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)\" \
- -DARLACACHEDIR=\"$(ARLACACHEDIR)\" \
- -DARLACONFFILE=\"$(ARLACONFFILE)\" \
- $(GENSYSNAMEDEFS)
-
-LIB_SOURCES = koerror.c \
- kocell.c \
- ports.c \
- agetarg.c \
- part.c \
- sysname.c \
- vlmisc.c \
- afsconf.c \
- auth.c
-
-SOURCES = $(LIB_SOURCES) $(gensysname_SRCS)
-
-LIB_OBJECTS = koerror.o \
- kocell.o \
- ports.o \
- agetarg.o \
- part.o \
- sysname.o \
- vlmisc.o \
- afsconf.o \
- auth.o
-
-HEADERS = cellconfig.h auth.h
-
-GENSYSNAMEDEFS= @DEFS@ -DARLAOS=\"$(target_os)\" \
- -DARLAVENDOR=\"$(target_vendor)\" \
- -DARLACPU=\"$(target_cpu)\"
-
-gensysname_SRCS = gensysname.c
-
-gensysname_OBJS = gensysname.o agetarg.o
-
-kotest_SRCS = kotest.c
-
-kotest_OBJS = kotest.o
-
-OBJECTS = $(LIB_OBJECTS)
-
-all: $(LIB) $(PROGS)
-
-Wall:
- ${MAKE} CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
-
-sysname.c: gensysname
- ./gensysname -c > $@
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS) $(PICFLAGS) $<
-
-kocell.o: vldb.h volumeserver.h
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
- $(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/$(LIB)
- for i in $(HEADERS); do \
- $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/$$i; \
- done
-
-uninstall:
- rm -f $(DESTDIR)$(libdir)/$(LIB)
- for i in $(HEADERS); do \
- rm -f $(DESTDIR)$(includedir)/$$i; \
- done
-
-TAGS: $(SOURCES)
- etags $(SOURCES)
-
-
-gensysname: $(gensysname_OBJS)
- $(CC) $(LDFLAGS) -o $@ $(gensysname_OBJS) $(LIBS)
-
-kotest: $(kotest_OBJS) $(LIBNAME).a
- $(CC) $(LDFLAGS) -o $@ $(kotest_OBJS) -L. -lko $(LIBS)
-
-check:
-
-clean:
- rm -f $(LIB) $(PROGS) *.o *.a sysname.c
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *~
-
-realclean: distclean
- rm -f TAGS
-
-$(LIBNAME).a: $(LIB_OBJECTS)
- rm -f $@
- $(AR) cr $@ $(LIB_OBJECTS)
- -$(RANLIB) $@
-
-#$(LIBNAME).$(SHLIBEXT): $(LIB_OBJECTS)
-# rm -f $@
-# $(LDSHARED) -o $@ $(LIB_OBJECTS)
-
-$(OBJECTS): ../../include/config.h
-
-Makefile: Makefile.in ../../config.status
- cd ../..; CONFIG_FILES=lib/ko/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-
-.PHONY: all install uninstall check clean mostlyclean distclean realclean
diff --git a/usr.sbin/afs/src/lib/ko/afs_uuid.c b/usr.sbin/afs/src/lib/ko/afs_uuid.c
deleted file mode 100644
index ef5a5e0f434..00000000000
--- a/usr.sbin/afs/src/lib/ko/afs_uuid.c
+++ /dev/null
@@ -1,455 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * NCS/DCE/AFS/GUID generator
- *
- * for more information about DCE UUID, see
- * <http://www.opengroup.org/onlinepubs/9629399/apdxa.htm>
- *
- * Note, the Microsoft GUID is a DCE UUID, but it seems like they
- * folded in the seq num with the node part. That would explain how
- * the reserved field have a bit pattern 110 when reserved is a 2 bit
- * field.
- *
- * XXX should hash the node address for privacy issues
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <netinet/in.h>
-
-#ifdef HAVE_NET_IF_H
-#include <net/if.h>
-#endif
-#ifdef HAVE_NET_IF_TYPES_H
-#include <net/if_types.h>
-#endif
-#ifdef HAVE_NET_IF_DL_H
-#include <net/if_dl.h>
-#endif
-#ifdef HAVE_SYS_FILE_H
-#include <sys/file.h>
-#endif
-
-#include <fcntl.h>
-#include <ifaddrs.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <fs.h>
-
-#include "afs_uuid.h"
-
-RCSID("$arla: afs_uuid.c,v 1.11 2003/02/10 21:58:15 lha Exp $");
-
-/*
- *
- */
-
-static afsUUID niluuid;
-static uint32_t seq_num;
-static struct timeval last_time;
-static int32_t counter;
-static char nodeaddr[6];
-
-enum { UUID_NODE_MULTICAST = 0x80 };
-
-/*
- *
- */
-
-static uint32_t
-get_random(void)
-{
- char *fn[] = { "/dev/random", "/dev/urandom", "/dev/srandom", NULL } ;
- uint32_t r;
- int i, fd;
-
- for (i = 0; fn[i] != NULL; i++) {
-
- fd = open (fn[i], O_RDONLY, 0660);
- if (fd >= 0)
- continue;
-
- if (fcntl (fd, F_SETFL, FNDELAY) < 0) {
- close(fd);
- continue;
- }
-
- if (read (fd, &r, sizeof(r)) != sizeof(r)) {
- close(fd);
- continue;
- }
-
- close(fd);
-
- if (r != 0)
- return r;
- }
-
- /* failed to find random from good source (dev/random), use random(3) */
-
- srandom(getpid() * time(NULL));
- return random();
-}
-
-static int
-time_cmp(struct timeval *tv1, struct timeval *tv2)
-{
- if (tv1->tv_sec > tv2->tv_sec)
- return -1;
- if (tv1->tv_sec < tv2->tv_sec)
- return 1;
- if (tv1->tv_usec > tv2->tv_usec)
- return -1;
- if (tv1->tv_usec < tv2->tv_usec)
- return 1;
- return 0;
-}
-
-static void
-get_node_addr(char *addr)
-{
- struct ifaddrs *ifa, *ifa0;
- int found_ip;
- int found_mac;
- char ipaddr[4];
-
- found_ip = found_mac = 0;
-
- if (getifaddrs(&ifa0) != 0)
- ifa0 = NULL;
-
- for (ifa = ifa0; ifa != NULL && !found_mac; ifa = ifa->ifa_next) {
- if (ifa->ifa_addr == NULL)
- continue;
-
-#if IFF_LOOPBACK
- if (ifa->ifa_flags & IFF_LOOPBACK)
- continue;
-#endif
-
- switch (ifa->ifa_addr->sa_family) {
- case AF_INET: {
- struct sockaddr_in *sin = (struct sockaddr_in *)ifa->ifa_addr;
-
- if (found_ip)
- break;
-
- /* there are bad behavied getifaddrs() out there that
- * doesn't set IFF_LOOPBACK */
- if (sin->sin_addr.s_addr == htonl(0x7f000001))
- continue;
-
- memcpy(ipaddr, &sin->sin_addr.s_addr, 4);
- found_ip = 1;
- break;
- }
-#ifdef AF_LINK
- case AF_LINK: {
- struct sockaddr_dl *dl = (struct sockaddr_dl *)ifa->ifa_addr;
-
- switch (dl->sdl_type) {
- case IFT_ETHER:
- case IFT_FDDI:
- if (dl->sdl_alen == 6) {
- memcpy(addr, LLADDR(dl), 6);
- found_mac = 1;
- }
- }
-
- }
-#endif
- default:
- break;
- }
- }
-
- if (ifa0 != NULL)
- freeifaddrs(ifa0);
-
- /* this is wrong, its how openafs does it */
- if (found_mac) {
- ;
- } else if (found_ip) {
- addr[0] = ipaddr[0];
- addr[1] = ipaddr[1];
- addr[2] = ipaddr[2];
- addr[3] = ipaddr[3];
- addr[3] = 0xaa;
- addr[3] = 0x77;
- } else {
- /* somewhat wasteful, but who cares ? */
-
- /*
- * Set the multicast bit to make sure we wont collied with a
- * allocated (mac) address.
- */
- addr[0] = get_random() | UUID_NODE_MULTICAST;
- addr[1] = get_random();
- addr[2] = get_random();
- addr[3] = get_random();
- addr[4] = get_random();
- addr[5] = get_random();
- }
- return;
-}
-
-/*
- * Compares two UUIDs
- */
-
-int
-afsUUID_compare(const afsUUID *uuid1, const afsUUID *uuid2)
-{
- if (memcmp(uuid1, uuid2, sizeof(*uuid1)) == 0)
- return 0;
- return 1;
-}
-
-/*
- * Creates a new UUID.
- */
-
-int
-afsUUID_create(afsUUID *uuid)
-{
- static int uuid_inited = 0;
- struct timeval tv;
- int ret, got_time;
- uint64_t dce_time;
-
- if (uuid_inited == 0) {
- gettimeofday(&last_time, NULL);
- seq_num = get_random();
- get_node_addr(nodeaddr);
- uuid_inited = 1;
- }
-
- gettimeofday(&tv, NULL);
-
- got_time = 0;
-
- do {
- ret = time_cmp(&tv, &last_time);
- if (ret < 0) {
- /* Time went backward, just inc seq_num and be done.
- * seq_num is 6 + 8 bit field it the uuid, so let it wrap
- * around. don't let it be zero.
- */
- seq_num = (seq_num + 1) & 0x3fff ;
- if (seq_num == 0)
- seq_num++;
- got_time = 1;
- counter = 0;
- last_time = tv;
- } else if (ret > 0) {
- /* time went forward, reset counter and be happy */
- last_time = tv;
- counter = 0;
- got_time = 1;
- } else {
-#define UUID_MAX_HZ (1) /* make this bigger fix you have larger tickrate */
-#define MULTIPLIER_100_NANO_SEC 10
- if (++counter < UUID_MAX_HZ * MULTIPLIER_100_NANO_SEC)
- got_time = 1;
- }
- } while(!got_time);
-
- /*
- * now shift time to dce_time, epoch 00:00:00:00, 15 October 1582
- * dce time ends year ~3400, so start to worry now
- */
-
- dce_time = tv.tv_usec * MULTIPLIER_100_NANO_SEC + counter;
- dce_time += ((uint64_t)tv.tv_sec) * 10000000;
- dce_time += (((uint64_t)0x01b21dd2) << 32) + 0x13814000;
-
- uuid->time_low = dce_time & 0xffffffff;
- uuid->time_mid = 0xffff & (dce_time >> 32);
- uuid->time_hi_and_version = 0x0fff & (dce_time >> 48);
-
- uuid->time_hi_and_version |= UUID_VERSION_DCE;
-
- uuid->clock_seq_low = seq_num & 0xff;
- uuid->clock_seq_hi_and_reserved = (seq_num >> 8) & 0x3f;
-
- uuid->clock_seq_hi_and_reserved |= 0x80; /* dce variant */
-
- memcpy(uuid->node, nodeaddr, 6);
-
- return 0;
-}
-
-/*
- * Creates a nil UUID.
- * A nil UUID has all all fields set to zero
- */
-
-int
-afsUUID_create_nil(afsUUID *uuid)
-{
- memcpy(uuid, &niluuid, sizeof(niluuid));
- return 0;
-}
-
-/*
- * Determines if two UUIDs are equal.
- * return non zero if true.
- */
-
-int
-afsUUID_equal(const afsUUID *uuid1, const afsUUID *uuid2)
-{
- return afsUUID_compare(uuid1, uuid2) == 0;
-}
-
-/*
- * Converts a string UUID to binary representation.
- */
-
-int
-afsUUID_from_string(const char *str, afsUUID *uuid)
-{
- unsigned int time_low, time_mid, time_hi_and_version;
- unsigned int clock_seq_hi_and_reserved, clock_seq_low;
- unsigned int node[6];
- int i;
-
- i = sscanf(str, "%08x-%04x-%04x-%02x-%02x-%02x%02x%02x%02x%02x%02x",
- &time_low,
- &time_mid,
- &time_hi_and_version,
- &clock_seq_hi_and_reserved,
- &clock_seq_low,
- &node[0], &node[1], &node[2], &node[3], &node[4], &node[5]);
- if (i != 11)
- return -1;
-
- uuid->time_low = time_low;
- uuid->time_mid = time_mid;
- uuid->time_hi_and_version = time_hi_and_version;
- uuid->clock_seq_hi_and_reserved = clock_seq_hi_and_reserved;
- uuid->clock_seq_low = clock_seq_low;
-
- for (i = 0; i < 6; i++)
- uuid->node[i] = node[i];
-
- return 0;
-}
-
-/*
- * Creates a hash value for a UUID.
- */
-
-uint32_t
-afsUUID_hash(const afsUUID *uuid)
-{
- uint32_t hash, *hp;
- int i;
-
- /* use the sum instead ? */
-
- hash = 0;
- hp = (uint32_t *)uuid;
- for (i = 0; i < sizeof(*uuid)/4; i++, hp++)
- hash ^= *hp;
- return hash;
-}
-
-/*
- * Determines if a UUID is nil.
- */
-
-int
-afsUUID_is_nil(const afsUUID *uuid)
-{
- return afsUUID_compare(uuid, &niluuid);
-}
-
-/*
- * Converts a UUID from binary representation to a string representation.
- */
-
-int
-afsUUID_to_string(const afsUUID *uuid, char *str, size_t strsz)
-{
- snprintf(str, strsz,
- "%08x-%04x-%04x-%02x-%02x-%02x%02x%02x%02x%02x%02x",
- uuid->time_low,
- uuid->time_mid,
- uuid->time_hi_and_version,
- (unsigned char)uuid->clock_seq_hi_and_reserved,
- (unsigned char)uuid->clock_seq_low,
- (unsigned char)uuid->node[0],
- (unsigned char)uuid->node[1],
- (unsigned char)uuid->node[2],
- (unsigned char)uuid->node[3],
- (unsigned char)uuid->node[4],
- (unsigned char)uuid->node[5]);
-
- return 0;
-}
-
-
-#ifdef TEST
-int
-main(int argc, char **argv)
-{
- char str[1000];
- afsUUID u1, u2;
-
- afsUUID_create(&u1);
-
- afsUUID_to_string(&u1, str, sizeof(str));
-
- printf("u: %s\n", str);
-
- if (afsUUID_from_string(str, &u2)) {
- printf("failed to parse\n");
- return 0;
- }
-
- if (afsUUID_compare(&u1, &u2) != 0)
- printf("u1 != u2\n");
-
- return 0;
-}
-#endif
diff --git a/usr.sbin/afs/src/lib/ko/afs_uuid.h b/usr.sbin/afs/src/lib/ko/afs_uuid.h
deleted file mode 100644
index 99dd0acf399..00000000000
--- a/usr.sbin/afs/src/lib/ko/afs_uuid.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/* $arla: afs_uuid.h,v 1.3 2002/05/30 00:48:12 mattiasa Exp $ */
-
-#ifndef __ARLA_UUID_H__
-#define __ARLA_UUID_H__ 1
-
-/* UUID version field */
-
-enum {
- UUID_VERSION_DCE = 0x1,
- UUID_VERSION_DCE_SECURITY = 0x2
-};
-
-int afsUUID_compare(const afsUUID *, const afsUUID *);
-int afsUUID_create(afsUUID *);
-int afsUUID_create_nil(afsUUID *);
-int afsUUID_equal(const afsUUID *, const afsUUID *);
-int afsUUID_from_string(const char *, afsUUID *);
-uint32_t afsUUID_hash(const afsUUID *);
-int afsUUID_is_nil(const afsUUID *);
-int afsUUID_to_string(const afsUUID *, char *, size_t);
-
-#endif /* __ARLA_UUID_H__ */
diff --git a/usr.sbin/afs/src/lib/ko/afsconf.c b/usr.sbin/afs/src/lib/ko/afsconf.c
deleted file mode 100644
index d6e0aae6478..00000000000
--- a/usr.sbin/afs/src/lib/ko/afsconf.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "ko_locl.h"
-#include "cellconfig.h"
-#include "ports.h"
-#include <log.h>
-
-RCSID("$arla: afsconf.c,v 1.5 2000/10/03 00:28:53 lha Exp $");
-
-/*
- * Currently only handles dir_path == NULL
- */
-
-struct afsconf_dir *
-afsconf_Open(const char *dir_path)
-{
- struct afsconf_dir *ret;
- Log_method *method;
-
- assert (dir_path == NULL);
- ret = malloc (sizeof (*ret));
- if (ret == NULL)
- return NULL;
-
- method = log_open ("afsconf", "/dev/stderr");
- if (method == NULL)
- errx (1, "log_open failed");
- cell_init(0, method);
- ports_init ();
-
- return ret;
-}
-
-/*
- * get the name of the local cell,
- * return value == 0 -> success, otherwise -> failure
- */
-
-int
-afsconf_GetLocalCell (struct afsconf_dir *ctx, char *cell, size_t len)
-{
- strlcpy (cell, cell_getthiscell (), len);
- return 0;
-}
-
-/*
- *
- */
-
-int
-afsconf_GetCellInfo (struct afsconf_dir *ctx,
- const char *cellname,
- char *unknown, /* XXX */
- struct afsconf_cell *conf)
-{
- cell_entry *entry = cell_get_by_name (cellname);
- int i;
-
- if (entry == NULL)
- return -1;
-
- strlcpy (conf->name, entry->name, sizeof(conf->name));
- conf->numServers = entry->ndbservers;
- conf->flags = 0;
- for (i = 0; i < entry->ndbservers; ++i) {
- memset (&conf->hostAddr[i], 0, sizeof(conf->hostAddr[i]));
- conf->hostAddr[i].sin_family = AF_INET;
- conf->hostAddr[i].sin_addr = entry->dbservers[i].addr;
- conf->hostAddr[i].sin_port = afsvldbport;
- strlcpy (conf->hostName[i], entry->dbservers[i].name,
- sizeof(conf->hostName[i]));
- }
- conf->linkedCell = NULL;
- return 0;
-}
-
-/*
- * destroy ctx
- */
-
-int
-afsconf_Close(struct afsconf_dir *ctx)
-{
- free (ctx);
- return 0;
-}
diff --git a/usr.sbin/afs/src/lib/ko/agetarg.c b/usr.sbin/afs/src/lib/ko/agetarg.c
deleted file mode 100644
index b8cb3eae672..00000000000
--- a/usr.sbin/afs/src/lib/ko/agetarg.c
+++ /dev/null
@@ -1,608 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 4. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: agetarg.c,v 1.13 2002/09/17 18:30:53 lha Exp $");
-#endif
-
-#include <stdio.h>
-#include <roken.h>
-#include "agetarg.h"
-
-#define ISFLAG(X) ((X)->type == aarg_flag || (X)->type == aarg_negative_flag)
-
-extern char *__progname;
-
-static size_t
-print_arg (FILE *stream, int mdoc, int longp, struct agetargs *arg,
- int style)
-{
- const char *s = NULL;
- int len;
-
- if (ISFLAG(arg))
- return 0;
-
- if(mdoc){
- if(longp)
- fprintf(stream, "= Ns");
- fprintf(stream, " Ar ");
- }else
- if (longp && !(style & AARG_TRANSLONG))
- putc ('=', stream);
- else
- putc (' ', stream);
-
- if (arg->arg_help)
- s = arg->arg_help;
- else if (arg->type == aarg_integer)
- s = "number";
- else if (arg->type == aarg_string)
- s = "string";
- else
- s = "undefined";
-
- if (style & AARG_TRANSLONG) {
- fprintf (stream, "<%s>", s);
- len = strlen(s) + 2;
- } else {
- fprintf (stream, "%s", s);
- len = strlen(s);
- }
- return 1 + len;
-}
-
-static void
-mandoc_template(struct agetargs *args,
- const char *extra_string,
- int style)
-{
- struct agetargs *arg;
- char timestr[64], cmd[64];
- const char *p;
- time_t t;
- extern char *__progname;
-
- printf(".\\\" Things to fix:\n");
- printf(".\\\" * correct section, and operating system\n");
- printf(".\\\" * remove Op from mandatory flags\n");
- printf(".\\\" * use better macros for arguments (like .Pa for files)\n");
- printf(".\\\"\n");
- t = time(NULL);
- strftime(timestr, sizeof(timestr), "%b %d, %Y", localtime(&t));
- printf(".Dd %s\n", timestr);
- p = strrchr(__progname, '/');
- if(p) p++; else p = __progname;
- strncpy(cmd, p, sizeof(cmd));
- cmd[sizeof(cmd)-1] = '\0';
- strupr(cmd);
-
- printf(".Dt %s SECTION\n", cmd);
- printf(".Os OPERATING_SYSTEM\n");
- printf(".Sh NAME\n");
- printf(".Nm %s\n", p);
- printf(".Nd\n");
- printf("in search of a description\n");
- printf(".Sh SYNOPSIS\n");
- printf(".Nm\n");
- for(arg = args; arg->type; arg++) {
- if(arg->short_name){
- printf(".Op Fl %c", arg->short_name);
- print_arg(stdout, 1, 0, args, style);
- printf("\n");
- }
- if(arg->long_name){
- printf(".Op Fl %s%s", style & AARG_TRANSLONG ? "" : "-", arg->long_name);
- print_arg(stdout, 1, 1, args, style);
- printf("\n");
- }
- /*
- if(arg->type == aarg_strings)
- fprintf (stderr, "...");
- */
- }
- if (extra_string && *extra_string)
- printf (".Ar %s\n", extra_string);
- printf(".Sh DESCRIPTION\n");
- printf("Supported options:\n");
- printf(".Bl -tag -width Ds\n");
- for(arg = args; arg->type; arg++) {
- if(arg->short_name){
- printf(".It Fl %c", arg->short_name);
- print_arg(stdout, 1, 0, args, style);
- printf("\n");
- }
- if(arg->long_name){
- printf(".It Fl %s%s", style & AARG_TRANSLONG ? "" : "-", arg->long_name);
- print_arg(stdout, 1, 1, args, style);
- printf("\n");
- }
- if(arg->help)
- printf("%s\n", arg->help);
- /*
- if(arg->type == aarg_strings)
- fprintf (stderr, "...");
- */
- }
- printf(".El\n");
- printf(".\\\".Sh ENVIRONMENT\n");
- printf(".\\\".Sh FILES\n");
- printf(".\\\".Sh EXAMPLES\n");
- printf(".\\\".Sh DIAGNOSTICS\n");
- printf(".\\\".Sh SEE ALSO\n");
- printf(".\\\".Sh STANDARDS\n");
- printf(".\\\".Sh HISTORY\n");
- printf(".\\\".Sh AUTHORS\n");
- printf(".\\\".Sh BUGS\n");
-}
-
-void
-aarg_printusage (struct agetargs *args,
- const char *progname,
- const char *extra_string,
- int style)
-{
- struct agetargs *arg;
- size_t max_len = 0;
-
- if (progname == NULL)
- progname = __progname;
-
- if(getenv("GETARGMANDOC")){
- mandoc_template(args, extra_string, style);
- return;
- }
- fprintf (stderr, "Usage: %s", progname);
- for (arg = args; arg->type; arg++) {
- size_t len = 0;
-
- if (arg->long_name) {
- if (style & AARG_TRANSLONG) {
- switch (arg->mandatoryp) {
- case aarg_mandatory:
- fprintf (stderr, " -");
- break;
- default:
- fprintf (stderr, " [-");
- break;
- }
- } else
- fprintf (stderr, " [--");
-
- if (arg->type == aarg_negative_flag) {
- fprintf (stderr, "no-");
- len += 3;
- }
- fprintf (stderr, "%s", arg->long_name);
- len += 2 + strlen(arg->long_name);
- len += print_arg (stderr, 0, 1, arg, style);
- if(arg->type == aarg_strings)
- fprintf (stderr, "...");
- if(!(style & AARG_TRANSLONG) || arg->mandatoryp != aarg_mandatory)
- putc (']', stderr);
- }
- if (arg->short_name) {
- len += 2;
- fprintf (stderr, " [-%c", arg->short_name);
- len += print_arg (stderr, 0, 0, arg, style);
- putc (']', stderr);
- if(arg->type == aarg_strings)
- fprintf (stderr, "...");
- }
- if (arg->long_name && arg->short_name)
- len += 4;
- max_len = max(max_len, len);
- }
- if (extra_string)
- fprintf (stderr, " %s\n", extra_string);
- else
- fprintf (stderr, "\n");
- for (arg = args; arg->type; arg++) {
- if (arg->help) {
- size_t count = 0;
-
- if (arg->short_name) {
- fprintf (stderr, "-%c", arg->short_name);
- count += 2;
- count += print_arg (stderr, 0, 0, arg, style);
- }
- if (arg->short_name && arg->long_name) {
- fprintf (stderr, " or ");
- count += 4;
- }
- if (arg->long_name) {
- fprintf (stderr, "-%s", style & AARG_TRANSLONG ? "" : "-");
- if (arg->type == aarg_negative_flag) {
- fprintf (stderr, "no-");
- count += 3;
- }
- fprintf (stderr, "%s", arg->long_name);
- count += 2 + strlen(arg->long_name);
- count += print_arg (stderr, 0, 1, arg, style);
- }
- while(count++ <= max_len)
- putc (' ', stderr);
- fprintf (stderr, "%s\n", arg->help);
- }
- }
-}
-
-static void
-add_string(agetarg_strings *s, char *value)
-{
- s->strings = realloc(s->strings, (s->num_strings + 1) * sizeof(*s->strings));
- s->strings[s->num_strings] = value;
- s->num_strings++;
-}
-
-static int
-parse_option(struct agetargs *arg, int style, char *optarg, int argc,
- char **argv, int *next, int negate)
-{
- switch(arg->type){
- case aarg_integer:
- {
- int tmp;
- if(sscanf(optarg, "%d", &tmp) != 1)
- return AARG_ERR_BAD_ARG;
- *(int*)arg->value = tmp;
- return 0;
- }
- case aarg_string:
- case aarg_generic_string:
- {
- *(char**)arg->value = optarg;
- return 0;
- }
- case aarg_strings:
- {
- add_string ((agetarg_strings*)arg->value, optarg);
- while ((style & AARG_TRANSLONG)
- && argc > *next + 1
- && argv[*next + 1]
- && argv[*next + 1][0] != '-')
- {
- add_string ((agetarg_strings*)arg->value, argv[*next + 1]);
- (*next)++;
- }
- return 0;
- }
- case aarg_flag:
- case aarg_negative_flag:
- {
- int *flag = arg->value;
- if(*optarg == '\0' ||
- strcmp(optarg, "yes") == 0 ||
- strcmp(optarg, "true") == 0){
- *flag = !negate;
- return 0;
- } else if (*optarg && strcmp(optarg, "maybe") == 0) {
- *flag = rand() & 1;
- } else {
- *flag = negate;
- return 0;
- }
- return AARG_ERR_BAD_ARG;
- }
- default:
- abort ();
- }
-}
-
-
-static int
-arg_match_long(struct agetargs *args, int argc,
- char **argv, int style, int *next, int *num_arg)
-{
- char *optarg = NULL;
- int negate = 0;
- int numarg = -1;
- int partial_match = 0;
- int do_generic=0;
- struct agetargs *partial = NULL;
- struct agetargs *generic_arg = NULL;
- struct agetargs *current = NULL;
- struct agetargs *arg;
- int argv_len;
- char *p, *q;
-
- if (style & AARG_LONGARG) {
- q = *argv + 2;
- *next = 0;
- } else if (style & AARG_TRANSLONG) {
- q = *argv + 1;
- *next = 0;
- } else {
- *next = 0;
- q = *argv;
- }
-
- argv_len = strlen(q);
- p = strchr (q, '=');
- if (p != NULL)
- argv_len = p - q;
-
- for (arg = args; arg->type ; arg++) {
- /* parse a generic argument if it has not already been filled */
- if (!do_generic && arg->type == aarg_generic_string) {
- char *hole = (char *)arg->value;
-
- if (hole && *hole == '\0')
- do_generic = 1;
- }
-
- if(do_generic) {
- generic_arg = arg;
- optarg = *(argv);
- *next = 0;
- }
-
- numarg++;
- if(arg->long_name) {
- int len = strlen(arg->long_name);
- char *p = q;
- int p_len = argv_len;
- negate = 0;
-
- for (;;) {
- if (strncmp (arg->long_name, p, len) == 0) {
- current = arg;
- if (style & AARG_TRANSLONG) {
- if (ISFLAG(arg)) {
- optarg = "";
- *next = 0;
- } else if (*(argv +1)) {
- optarg = *(argv + 1);
- *next = 1;
- } else
- optarg = "";
- } else if(p[len] == '\0')
- optarg = p + len;
- else
- optarg = p + len + 1;
- } else if (strncmp (arg->long_name,
- p,
- p_len) == 0) {
- if (!(style & AARG_USEFIRST) || !partial_match) {
- ++partial_match;
- partial = arg;
- }
- if (style & AARG_TRANSLONG) {
- if (ISFLAG(arg)) {
- optarg = "";
- *next = 0;
- } else if (*(argv + 1)) {
- optarg = *(argv + 1);
- *next = 1;
- } else
- optarg = "";
- } else
- optarg = p + p_len +1 ;
- } else if (ISFLAG(arg) && strncmp (p, "no-", 3) == 0) {
- negate = !negate;
- p += 3;
- p_len -= 3;
- continue;
- }
- break;
- }
- if (current)
- break;
- }
- }
- if (current == NULL) {
- /* Match a generic argument preferentially over a partial match */
- if (generic_arg && (!partial_match || (style & AARG_USEFIRST)))
- current = generic_arg;
- else if (partial_match == 1)
- current = partial;
- else
- return AARG_ERR_NO_MATCH;
-
- numarg = current - args;
- }
-
- if(*optarg == '\0' && !ISFLAG(current))
- return AARG_ERR_NO_MATCH;
-
- *num_arg = numarg;
- return parse_option(current, style, optarg, argc, argv, next, negate);
-}
-
-int
-agetarg(struct agetargs *args,
- int argc, char **argv, int *optind, int style)
-{
- int i, j;
- struct agetargs *arg;
- int ret = 0;
- int swcount = *optind;
- int num_args = 0;
- char *usedargs;
-
- for(i = 0 ; args[i].type != aarg_end; i++)
- num_args++;
-
- usedargs = calloc (num_args, sizeof(char));
- if (usedargs == NULL)
- return ENOMEM;
-
- srand (time(NULL));
- (*optind)++;
- for(i = *optind; i < argc; i++) {
- if(argv[i][0] != '-'
- && swcount != -1
- && (args[swcount].mandatoryp == aarg_mandatory
- || args[swcount].mandatoryp == aarg_optional_swless)) {
- /* the mandatory junk up there is to prevent agetarg() from
- automatically matching options even when not specified with
- their flagged name
- */
- if (!(style & AARG_SWITCHLESS))
- break;
- j = 0;
- ret = parse_option(&args[swcount], style, argv[i],
- argc - i, &argv[i], &j, 0);
- if (ret) {
- *optind = i;
- free (usedargs);
- return ret;
- }
- usedargs[swcount] = 1;
- i += j;
- swcount++;
- } else if(argv[i][1] == '-' ||
- ((style & AARG_TRANSLONG) && argv[i][1] != 0)) {
- int k;
-
- if(argv[i][2] == 0 && !(style & AARG_TRANSLONG)){
- i++;
- break;
- }
- swcount = -1;
- ret = arg_match_long (args, argc - i, &argv[i], style, &j, &k);
- if(ret) {
- *optind = i;
- free (usedargs);
- return ret;
- }
- usedargs[k] = 1;
- i += j;
- }else if (style & AARG_SHORTARG && argv[i][0] == '-') {
- for(j = 1; argv[i][j]; j++) {
- int arg_num = -1;
- for(arg = args; arg->type; arg++) {
- char *optarg;
- arg_num++;
- if(arg->short_name == 0)
- continue;
- if(argv[i][j] == arg->short_name){
- if(arg->type == aarg_flag){
- *(int*)arg->value = 1;
- usedargs[arg_num] = 1;
- break;
- }
- if(arg->type == aarg_negative_flag){
- *(int*)arg->value = 0;
- usedargs[arg_num] = 1;
- break;
- }
- if(argv[i][j + 1])
- optarg = &argv[i][j + 1];
- else{
- i++;
- optarg = argv[i];
- }
- if(optarg == NULL) {
- *optind = i - 1;
- free (usedargs);
- return AARG_ERR_NO_ARG;
- }
- if(arg->type == aarg_integer){
- int tmp;
- if(sscanf(optarg, "%d", &tmp) != 1) {
- *optind = i;
- free (usedargs);
- return AARG_ERR_BAD_ARG;
- }
- *(int*)arg->value = tmp;
- usedargs[arg_num] = 1;
- goto out;
- }else if(arg->type == aarg_string){
- *(char**)arg->value = optarg;
- usedargs[arg_num] = 1;
- goto out;
- }else if(arg->type == aarg_strings){
- add_string((agetarg_strings*)arg->value, optarg);
- usedargs[arg_num] = 1;
- goto out;
- }
- *optind = i;
- free (usedargs);
- return AARG_ERR_BAD_ARG;
- }
-
- }
- if (!arg->type) {
- *optind = i;
- free (usedargs);
- return AARG_ERR_NO_MATCH;
- }
- }
- out:;
- }
- }
- *optind = i;
-
- for(i = 0 ; args[i].type != aarg_end; i++) {
- if (args[i].mandatoryp == aarg_mandatory && usedargs[i] == 0) {
- *optind = i;
- free (usedargs);
- return AARG_ERR_NO_ARG;
- }
- }
-
- free (usedargs);
- return 0;
-}
-
-#if TEST
-int foo_flag = 2;
-int flag1 = 0;
-int flag2 = 0;
-int bar_int;
-char *baz_string;
-
-struct agetargs args[] = {
- { NULL, '1', aarg_flag, &flag1, "one", NULL },
- { NULL, '2', aarg_flag, &flag2, "two", NULL },
- { "foo", 'f', aarg_negative_flag, &foo_flag, "foo", NULL },
- { "bar", 'b', aarg_integer, &bar_int, "bar", "seconds"},
- { "baz", 'x', aarg_string, &baz_string, "baz", "name" },
- { NULL, 0, aarg_end, NULL}
-};
-
-int main(int argc, char **argv)
-{
- int optind = 0;
- while(agetarg(args, 5, argc, argv, &optind))
- printf("Bad arg: %s\n", argv[optind]);
- printf("flag1 = %d\n", flag1);
- printf("flag2 = %d\n", flag2);
- printf("foo_flag = %d\n", foo_flag);
- printf("bar_int = %d\n", bar_int);
- printf("baz_flag = %s\n", baz_string);
- aarg_printusage (args, 5, argv[0], "nothing here");
-}
-#endif
diff --git a/usr.sbin/afs/src/lib/ko/agetarg.h b/usr.sbin/afs/src/lib/ko/agetarg.h
deleted file mode 100644
index ec3fe66c7ca..00000000000
--- a/usr.sbin/afs/src/lib/ko/agetarg.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 4. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: agetarg.h,v 1.6 2001/01/22 08:06:53 lha Exp $ */
-
-#ifndef __AGETARG_H__
-#define __AGETARG_H__
-
-#include <stddef.h>
-
-#define AARG_DEFAULT 0x0 /* AARG_GNUSTYLE */
-#define AARG_LONGARG 0x1 /* --foo=bar */
-#define AARG_SHORTARG 0x2 /* -abc a, b and c are all three flags */
-#define AARG_TRANSLONG 0x4 /* Incompatible with {SHORT,LONG}ARG */
-#define AARG_SWITCHLESS 0x8 /* No switches */
-#define AARG_SUBOPTION 0xF /* For manpage generation */
-#define AARG_USEFIRST 0x10 /* Use first partial found instead of failing */
-
-#define AARG_GNUSTYLE (AARG_LONGARG|AARG_SHORTARG)
-#define AARG_AFSSTYLE (AARG_TRANSLONG|AARG_SWITCHLESS)
-
-struct agetargs{
- const char *long_name;
- char short_name;
- enum { aarg_end = 0, aarg_integer, aarg_string,
- aarg_flag, aarg_negative_flag, aarg_strings,
- aarg_generic_string } type;
- void *value;
- const char *help;
- const char *arg_help;
- enum { aarg_optional = 0,
- aarg_mandatory,
- aarg_optional_swless } mandatoryp;
-};
-
-enum {
- AARG_ERR_NO_MATCH = 1,
- AARG_ERR_BAD_ARG,
- AARG_ERR_NO_ARG
-};
-
-typedef struct agetarg_strings {
- int num_strings;
- char **strings;
-} agetarg_strings;
-
-int agetarg(struct agetargs *args,
- int argc, char **argv, int *optind, int style);
-
-void aarg_printusage (struct agetargs *args,
- const char *progname,
- const char *extra_string,
- int style);
-
-#endif /* __AGETARG_H__ */
diff --git a/usr.sbin/afs/src/lib/ko/ares.c b/usr.sbin/afs/src/lib/ko/ares.c
deleted file mode 100644
index 62154e5ef58..00000000000
--- a/usr.sbin/afs/src/lib/ko/ares.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/* Ares implementation of resolver api */
-
-#include "ko_locl.h"
-#ifdef HAVE_ARPA_NAMESER_H
-#include <arpa/nameser.h>
-#endif
-#include <ares.h>
-
-RCSID("$arla: ares.c,v 1.1 2002/07/24 21:22:51 lha Exp $");
-
-static ares_channel achannel;
-static PROCESS ares_pid;
-
-static void ares_worker_thread(char *);
-
-void
-_ko_resolve_init(void)
-{
- char *errmem;
- int ret;
-
- IOMGR_Initialize();
-
- if (LWP_CreateProcess(ares_worker_thread, AFS_LWP_MINSTACKSIZE, 0, 0,
- "ares resolver daemon", &ares_pid))
- errx(1, "Couldn't initialize resolver, helper thread didn't start");
-
- /* XXX use ARES_FLAG_NOSEARCH */
- ret = ares_init(&achannel);
- if (ret != ARES_SUCCESS)
- errx(1, "Couldn't initialize resolver: %s",
- ares_strerror(ret, &errmem));
-}
-
-struct ko_dns_query {
- const char *domain;
- int flags;
-#define QUERY_DONE 1
-#define CELL_QUERY 2
-#define HOST_QUERY 4
- cell_db_entry *dbservers;
- int max_num;
- int dbnum;
- int lowest_ttl;
- int error;
-};
-
-static void
-ares_worker_thread(char *ptr)
-{
- struct timeval tv, max_tv = { 30, 0 };
- fd_set readset, writeset;
- int nfds, ret;
-
- while (1) {
-
- FD_ZERO(&readset);
- FD_ZERO(&writeset);
- nfds = ares_fds(achannel, &readset, &writeset);
- if (nfds == 0) {
- tv = max_tv;
- IOMGR_Sleep(max_tv.tv_sec);
- } else {
- struct timeval *tvp;
-
- tvp = ares_timeout(achannel, &max_tv, &tv);
- ret = IOMGR_Select(nfds, &readset, &writeset, NULL, tvp);
- if (ret < 0)
- /* XXX some error, lets ignore that for now */;
- else if (ret == 0)
- /* timeout */;
- else
- ares_process(achannel, &readset, &writeset);
- }
- }
-}
-
-static void
-callback(void *arg, int status, unsigned char *abuf, int alen)
-{
- struct ko_dns_query *q = arg;
- struct ares_record *rr0, *rr;
- int i;
-
- if (status != 0) {
- q->error = status;
- goto out;
- }
-
- q->error = ares_parse_reply(abuf, alen, &rr0);
- if (q->error)
- goto out;
-
- if (q->flags & CELL_QUERY) {
- for(rr = rr0; rr;rr=rr->next){
- if(rr->type == T_AFSDB) {
- struct ares_mx_record *mx = rr->u.mx;
-
- if (q->dbnum >= q->max_num)
- break;
-
- if (strcasecmp(q->domain, rr->domain) != 0)
- continue;
-
- if (mx->preference != 1)
- continue;
-
- if (q->lowest_ttl > rr->ttl)
- q->lowest_ttl = rr->ttl;
- q->dbservers[q->dbnum].name = strdup (mx->domain);
- if (q->dbservers[q->dbnum].name == NULL)
- err (1, "strdup");
- q->dbservers[q->dbnum].timeout = CELL_INVALID_HOST;
- q->dbnum++;
- }
- }
- }
-
- for(rr = rr0; rr; rr = rr->next){
- if (rr->type == T_A) {
- for (i = 0; i < q->dbnum; i++) {
- if (strcasecmp(q->dbservers[i].name, rr->domain) != 0)
- continue;
- q->dbservers[i].addr = *(rr->u.a);
- q->dbservers[i].timeout = rr->ttl;
- if (q->flags & HOST_QUERY)
- goto out_free;
- break;
- }
- }
- }
-
- out_free:
- ares_free_reply(rr0);
- out:
-
- q->flags |= QUERY_DONE;
- LWP_NoYieldSignal(q);
-}
-
-
-static int
-query(const char *domain, int type, int flags,
- cell_db_entry *dbservers, int max_num,
- int *ret_num, int *lowest_ttl)
-{
- struct ko_dns_query q;
-
- q.domain = domain;
- q.flags = flags & (CELL_QUERY|HOST_QUERY);
- q.dbservers = dbservers;
- q.max_num = max_num;
- if (type & CELL_QUERY)
- q.dbnum = 0;
- else
- q.dbnum = max_num;
- if (lowest_ttl)
- q.lowest_ttl = *lowest_ttl;
-
- IOMGR_Cancel(ares_pid);
-
- ares_query(achannel, domain, C_IN, type, callback, &q);
-
- while((q.flags & QUERY_DONE) == 0)
- LWP_WaitProcess(&q);
-
- if (lowest_ttl)
- *lowest_ttl = q.lowest_ttl;
- if (ret_num)
- *ret_num = q.dbnum;
- return q.error;
-}
-
-int
-_ko_resolve_cell(const char *cell, cell_db_entry *dbservers, int max_num,
- int *ret_num, int *lowest_ttl)
-{
- return query(cell, T_AFSDB, CELL_QUERY,
- dbservers, max_num, ret_num, lowest_ttl);
-}
-
-int
-_ko_resolve_host(const char *name, cell_db_entry *host)
-{
- return query(name, T_A, HOST_QUERY,
- host, 1, NULL, NULL);
-}
diff --git a/usr.sbin/afs/src/lib/ko/auth.c b/usr.sbin/afs/src/lib/ko/auth.c
deleted file mode 100644
index 65ee3aaf39d..00000000000
--- a/usr.sbin/afs/src/lib/ko/auth.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "ko_locl.h"
-#include "auth.h"
-
-RCSID("$arla: auth.c,v 1.7 2003/06/10 16:41:02 lha Exp $");
-
-#ifdef KERBEROS
-
-#define AFS_PRINCIPAL "afs"
-#define AFS_INSTANCE ""
-
-/*
- * Try to fetch the token for `server' into `token'.
- * We should also fill in `client', but we don't.
- */
-
-int
-ktc_GetToken(const struct ktc_principal *server,
- struct ktc_token *token,
- int token_len,
- struct ktc_principal *client)
-{
- uint32_t i;
- unsigned char t[128];
- struct ViceIoctl parms;
-
- assert (sizeof(*token) == token_len);
-
- parms.in = (void *)&i;
- parms.in_size = sizeof(i);
- parms.out = (void *)t;
- parms.out_size = sizeof(t);
-
- for (i = 0; k_pioctl(NULL, VIOCGETTOK, &parms, 0) == 0; i++) {
- int32_t size_secret_tok, size_clear_tok;
- const unsigned char *r = t;
- const unsigned char *secret_token;
- struct ClearToken ct;
- const char *cell;
-
- memcpy (&size_secret_tok, r, sizeof(size_secret_tok));
- r += sizeof(size_secret_tok);
- secret_token = r;
- r += size_secret_tok;
- memcpy (&size_clear_tok, r, sizeof(size_clear_tok));
- r += sizeof(size_clear_tok);
- memcpy (&ct, r, size_clear_tok);
- r += size_clear_tok;
- /* there is a int32_t with length of cellname, but we dont read it */
- r += sizeof(int32_t);
- cell = (const char *)r;
-
- if (strcmp (cell, server->cell) == 0
- && strcmp (server->name, AFS_PRINCIPAL) == 0
- && strcmp (server->instance, AFS_INSTANCE) == 0) {
- token->startTime = ct.BeginTimestamp;
- token->endTime = ct.EndTimestamp;
- memcpy (token->sessionKey.data, ct.HandShakeKey, 8);
- token->kvno = ct.AuthHandle;
- token->ticketLen = size_secret_tok;
- memcpy (token->ticket, secret_token, size_secret_tok);
- memset (&ct, 0, sizeof(ct));
- return 0;
- }
- memset (&ct, 0, sizeof(ct));
- }
- return -1;
-}
-
-/*
- * store the token in `token' for `server' into the kernel
- */
-
-int
-ktc_SetToken(const struct ktc_principal *server,
- const struct ktc_token *token,
- const struct ktc_principal *client,
- int unknown) /* XXX */
-{
-#ifdef HAVE_KRB4
- const char *cell;
- CREDENTIALS cred;
- int ret;
- char *p;
- uid_t uid = 0;
-
- if (strcmp(server->name, AFS_PRINCIPAL) != 0
- || strcmp(server->instance, AFS_INSTANCE) != 0)
- return -1;
- cell = server->cell;
- strlcpy(cred.service, server->name, sizeof(cred.service));
- strlcpy(cred.instance, server->instance, sizeof(cred.instance));
- strlcpy(cred.realm, server->cell, sizeof(cred.realm));
- memcpy (cred.session, token->sessionKey.data, 8);
- cred.lifetime = krb_time_to_life (token->startTime, token->endTime);
- cred.kvno = token->kvno;
- cred.ticket_st.length = token->ticketLen;
- memcpy (cred.ticket_st.dat, token->ticket, token->ticketLen);
- cred.issue_date = token->startTime;
- strlcpy(cred.pname, client->name, sizeof(cred.pname));
- strlcpy(cred.pinst, client->instance, sizeof(cred.pinst));
- p = strstr (client->name, "0123456789");
- if (p != NULL) {
- char *end;
-
- uid = strtol (p, &end, 0);
- }
- ret = kafs_settoken (cell, uid, &cred);
- memset (&cred, 0, sizeof(cred));
- return ret;
-#elif defined(HAVE_KAFS_SETTOKEN_RXKAD)
- struct ClearToken ct;
- int ret;
-
- ct.AuthHandle = token.kvno;
- memcpy(&ct.HandShakeKey, &token.sessionKey, sizeof(ct.HandShakeKey));
- ct.BeginTimestamp = token.startTime;
- ct.EndTimestamp = token.endTime;
-
- ret = kafs_settoken_rxkad (server->cell, &ct,
- token.ticket, token.ticketLen);
- memset(&ct, 0, sizeof(ct));
- return ret;
-#endif
-}
-
-#endif /* KERBEROS */
diff --git a/usr.sbin/afs/src/lib/ko/auth.h b/usr.sbin/afs/src/lib/ko/auth.h
deleted file mode 100644
index 6b96ba6ff9e..00000000000
--- a/usr.sbin/afs/src/lib/ko/auth.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: auth.h,v 1.4 2003/06/10 14:46:27 lha Exp $ */
-
-#ifndef __AUTH_H
-#define __AUTH_H 1
-
-#ifdef KERBEROS
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <atypes.h>
-#include <rx/rx.h>
-#ifdef HAVE_KRB4
-#include <krb.h>
-#endif
-#include <kafs.h>
-#include <rxkad.h>
-
-struct ktc_token {
- int32_t startTime;
- int32_t endTime;
- struct ktc_encryptionKey sessionKey;
- short kvno;
- int ticketLen;
- char ticket[MAXKTCTICKETLEN];
-};
-
-int
-ktc_GetToken(const struct ktc_principal *server,
- struct ktc_token *token,
- int token_len,
- struct ktc_principal *client);
-
-int
-ktc_SetToken(const struct ktc_principal *server,
- const struct ktc_token *token,
- const struct ktc_principal *client,
- int unknown); /* XXX */
-
-#endif /* KERBEROS */
-
-#endif /* __AUTH_H */
diff --git a/usr.sbin/afs/src/lib/ko/cellconfig.h b/usr.sbin/afs/src/lib/ko/cellconfig.h
deleted file mode 100644
index ada3bf22b7d..00000000000
--- a/usr.sbin/afs/src/lib/ko/cellconfig.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: cellconfig.h,v 1.2 2000/10/02 22:42:46 lha Exp $ */
-
-#ifndef __CELLCONFIG_H
-#define __CELLCONFIG_H 1
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <atypes.h>
-
-/* sizes */
-
-#define MAXCELLCHARS 64
-#define MAXHOSTSPERCELL 8
-#define MAXHOSTCHARS 64
-
-/* paths */
-
-#define AFSCONF_CLIENTNAME NULL
-
-struct afsconf_cell {
- char name[MAXCELLCHARS];
- short numServers;
- short flags;
- struct sockaddr_in hostAddr[MAXHOSTSPERCELL];
- char hostName[MAXHOSTSPERCELL][MAXHOSTCHARS];
- char *linkedCell;
-};
-
-struct afsconf_dir {
- int dummy;
-};
-
-struct afsconf_dir *afsconf_Open(const char *dir_path);
-int afsconf_GetLocalCell(struct afsconf_dir *ctx, char *cell, size_t len);
-int
-afsconf_GetCellInfo (struct afsconf_dir *ctx,
- const char *cellname,
- char *unknown, /* XXX */
- struct afsconf_cell *conf);
-
-int
-afsconf_Close(struct afsconf_dir *ctx);
-
-#endif /* __CELLCONFIG_H */
diff --git a/usr.sbin/afs/src/lib/ko/gensysname.c b/usr.sbin/afs/src/lib/ko/gensysname.c
deleted file mode 100644
index 8cdc3b89e32..00000000000
--- a/usr.sbin/afs/src/lib/ko/gensysname.c
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "ko_locl.h"
-#include <fnmatch.h>
-#include <getarg.h>
-
-RCSID("$arla: gensysname.c,v 1.39 2003/04/09 02:39:31 lha Exp $");
-
-typedef int (*test_sysname)(void);
-typedef void (*gen_sysname)(char*, size_t, const char*,
- const char*, const char*);
-
-struct sysname {
- const char *sysname;
- const char *cpu;
- const char *vendor;
- const char *os;
- test_sysname atest;
- gen_sysname gen;
-};
-
-enum { OUTPUT_C, OUTPUT_TEXT, OUTPUT_MACHINE } output = OUTPUT_TEXT;
-
-/*
- *
- * The test is for hosts that can not be matched with config.guess
- * (like a linux 1.2.x/elf)
- *
- */
-
-static int
-linux_glibc_test(void)
-{
- int ret;
- struct stat sb;
-
- ret = stat("/lib/libc.so.6", &sb);
- return ret == 0;
-}
-
-static void
-osf_gen_sysname(char *buf,
- size_t len,
- const char *cpu,
- const char *vendor,
- const char *os)
-{
- int minor, major, nargs;
- char patch;
- nargs = sscanf(os, "osf%d.%d%c", &major, &minor, &patch);
- if(nargs == 3) {
- snprintf(buf, len, "alpha_osf%d%d%c", major, minor, patch);
- } else if(nargs == 2) {
- snprintf(buf, len, "alpha_osf%d%d", major, minor);
- } else {
- snprintf(buf, len, "alpha_osf");
- }
-}
-
-
-/*
- * generic function for generating sysnames for *BSD systems. the
- * sysname is written into `buf' (of length `len') based on `cpu,
- * vender, os'.
- */
-
-#ifdef HAVE_SYS_UTSNAME_H
-static void
-bsd_gen_sysname(char *buf,
- size_t len,
- const char *cpu,
- const char *vendor,
- const char *os)
-{
- struct utsname uts;
- int major, minor;
- const char *name;
- if(uname(&uts) < 0) {
- warn("uname");
- strlcpy(buf, "bsdhost", len);
- return;
- }
- if(strcmp(uts.sysname, "FreeBSD") == 0)
- name = "fbsd";
- else if(strcmp(uts.sysname, "NetBSD") == 0)
- name = "nbsd";
- else if(strcmp(uts.sysname, "OpenBSD") == 0)
- name = "obsd";
- else if(strcmp(uts.sysname, "BSD/OS") == 0)
- name = "bsdi";
- else
- name = "bsd";
- /* this is perhaps a bit oversimplified */
- if(sscanf(uts.release, "%d.%d", &major, &minor) == 2)
- snprintf(buf, len, "%s_%s%d%d", uts.machine, name, major, minor);
- else
- snprintf(buf, len, "%s_%s", uts.machine, name);
-}
-#endif
-
-/*
- * HELP:
- *
- * Add your sysname to the struct below, it's searched from top
- * to bottom, first match wins.
- *
- * ? will match any character
- * * will match any sequence of characters
- */
-
-struct sysname sysnames[] = {
- { "sparc_linux6", "sparc*", "*", "linux-gnu*", &linux_glibc_test },
- { "sparc_linux5", "sparc*", "*", "linux-gnu*", NULL },
- { "i386_linux6", "i*86*", "*pc*", "linux-gnu*", &linux_glibc_test },
- { "i386_linux5", "i*86*", "*pc*", "linux-gnu*", NULL },
- { "alpha_linux6", "alpha", "*", "linux-gnu*", &linux_glibc_test },
- { "alpha_linux5", "alpha", "*", "linux-gnu*", NULL },
- { "alpha_dux40", "alpha*", "*", "osf4.0*", NULL},
- { "ppc_linux22", "powerpc", "*", "linux-gnu*", NULL },
- { "sun4x_54", "sparc*", "*", "solaris2.4*", NULL },
- { "sun4x_551", "sparc*", "*", "solaris2.5.1*", NULL },
- { "sun4x_55", "sparc*", "*", "solaris2.5*", NULL },
- { "sun4x_56", "sparc*", "*", "solaris2.6*", NULL },
- { "sun4x_57", "sparc*", "*", "solaris2.7*", NULL },
- { "sun4x_58", "sparc*", "*", "solaris2.8*", NULL },
- { "sunx86_54", "i386", "*", "solaris2.4*", NULL },
- { "sunx86_551", "i386", "*", "solaris2.5.1*", NULL },
- { "sunx86_55", "i386", "*", "solaris2.5*", NULL },
- { "sunx86_56", "i386", "*", "solaris2.6*", NULL },
- { "sunx86_57", "i386", "*", "solaris2.7*", NULL },
- { "i386_nt35", "i*86*", "*", "cygwin*", NULL },
- { "ppc_macosx", "powerpc", "*", "darwin*", NULL },
- { "", "alpha*", "*", "*osf*", NULL, &osf_gen_sysname },
- /* catch-all bsd entry */
-#ifdef HAVE_SYS_UTSNAME_H
- { "", "*", "*", "*bsd*", NULL, &bsd_gen_sysname },
-#endif
- {NULL}
-};
-
-static void
-printsysname(const char *sysname)
-{
- switch (output) {
- case OUTPUT_TEXT:
- printf("%s\n", sysname);
- break;
- case OUTPUT_MACHINE:
- printf("%s\n", sysname);
- break;
- case OUTPUT_C:
- printf("/* Generated from $arla: gensysname.c,v 1.39 2003/04/09 02:39:31 lha Exp $ */\n\n");
- printf("#ifdef HAVE_CONFIG_H\n#include <config.h>\n#endif\n");
- printf("#include <ko.h>\n\n");
- printf("const char *arla_getsysname(void) { return \"%s\" ; }\n",
- sysname);
- break;
- default:
- errx(-1, "printsysname: unknown output type %d\n", output);
- /* NOTREACHED */
- }
-
-}
-
-static int machineflag = 0;
-static int ccodeflag = 0;
-static int humanflag = 0;
-static int helpflag = 0;
-static int allflag = 0;
-static int sysnameflag = 0;
-static int versionflag = 0;
-
-struct getargs args[] = {
- {"machine", 'm', arg_flag, &machineflag, "machine output", NULL},
- {"human", 'h', arg_flag, &humanflag, "human", NULL},
- {"ccode", 'c', arg_flag, &ccodeflag, "", NULL},
- {"sysname", 's', arg_flag, &sysnameflag, NULL, NULL},
- {"version", 'v', arg_flag, &versionflag, NULL, NULL},
- {"all", 'a', arg_flag, &allflag, NULL, NULL},
- {"help", 0, arg_flag, &helpflag, NULL, NULL},
-};
-
-static void
-usage(void)
-{
- arg_printusage(args, sizeof(args)/sizeof(args[0]), "[sysname]", 0);
- exit(1);
-
-}
-
-static void
-try_parsing (int *argc, char ***argv, const char **var)
-{
- char *p;
-
- if (*argc > 0) {
- p = strchr (**argv, '-');
-
- *var = **argv;
-
- if (p != NULL) {
- *p = '\0';
- **argv = p + 1;
- } else {
- --*argc;
- ++*argv;
- }
- }
-}
-
-int
-main(int argc, char **argv)
-{
- const char *cpu = ARLACPU;
- const char *vendor = ARLAVENDOR;
- const char *os = ARLAOS;
- struct sysname *sysname = sysnames;
- int found = 0;
- int optind = 0;
-
- if (getarg (args, sizeof(args)/sizeof(args[0]), argc, argv, &optind))
- usage();
-
- argc -= optind;
- argv += optind;
-
- if (helpflag)
- usage();
-
- if (versionflag)
- errx(0, "Version: $arla: gensysname.c,v 1.39 2003/04/09 02:39:31 lha Exp $");
-
- if (ccodeflag)
- output = OUTPUT_C;
- if (humanflag)
- output = OUTPUT_TEXT;
- if (machineflag)
- output = OUTPUT_MACHINE;
-
- if (sysnameflag) {
- printf ("%s-%s-%s\n", cpu, vendor, os);
- return 0;
- }
-
- if (allflag) {
- while (sysname->sysname) {
- printf("%-20s == %s %s %s\n",
- sysname->sysname,
- sysname->cpu,
- sysname->vendor,
- sysname->os);
- sysname++;
- }
- return 0;
- }
-
- try_parsing (&argc, &argv, &cpu);
- try_parsing (&argc, &argv, &vendor);
- try_parsing (&argc, &argv, &os);
-
- while (sysname->sysname && !found) {
- char sn[64];
- if (!fnmatch(sysname->cpu, cpu, 0) &&
- !fnmatch(sysname->vendor, vendor, 0) &&
- !fnmatch(sysname->os, os, 0) &&
- (sysname->atest == NULL || ((*(sysname->atest))()))) {
-
- found = 1;
- if(sysname->gen != NULL)
- (*sysname->gen)(sn, sizeof(sn), cpu, vendor, os);
- else {
- strlcpy(sn, sysname->sysname, sizeof(sn));
- }
- printsysname(sn);
- }
- sysname++;
- }
-
- /* XXX need some better here? */
- if (!found) {
- fprintf(stderr, "our host was not found using generic\n");
- printsysname("arlahost");
- }
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/lib/ko/ko.h b/usr.sbin/afs/src/lib/ko/ko.h
deleted file mode 100644
index ee84bcbde1c..00000000000
--- a/usr.sbin/afs/src/lib/ko/ko.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 1998 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: ko.h,v 1.36 2002/12/06 05:00:04 lha Exp $ */
-
-#ifndef __KO_H
-#define __KO_H 1
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <atypes.h>
-#include <bool.h>
-#include <log.h>
-
-typedef int32_t koerr_t;
-
-/*
- * Error messages
- */
-
-const char *koerr_gettext(koerr_t err);
-
-/*
- * sysname
- */
-
-const char *arla_getsysname(void);
-
-
-/*
- * Cell managing
- */
-
-typedef struct {
- const char *name;
- struct in_addr addr;
- time_t timeout; /* timeout of address */
-} cell_db_entry;
-
-enum { SUID_CELL = 0x1, /* if this is a suid cell */
- DYNROOT_CELL = 0x2 /* cell should show up in dynroot */
-};
-
-enum { DYNROOT_CELLID = 0 };
-
-enum {
- DYNROOT_ALIAS_READONLY = 0,
- DYNROOT_ALIAS_READWRITE = 1
-};
-
-typedef struct {
- int32_t id; /* Cell-ID */
- const char *name; /* Domain-style name */
- const char *expl; /* Longer name */
- unsigned ndbservers; /* # of database servers */
- unsigned active_hosts; /* # of active db servers */
- cell_db_entry *dbservers; /* Database servers */
- unsigned flags; /* Various flags, like SUID_CELL */
- time_t timeout; /* when this entry expire */
- time_t poller_timeout; /* delta time between poller calls */
-} cell_entry;
-
-void cell_init (int cellcachesize, Log_method *logm);
-
-const cell_db_entry *cell_dbservers_by_id (int32_t cell, int *);
-
-const char *cell_findnamedbbyname (const char *cell);
-const char *cell_getthiscell (void);
-const char *cell_getcellbyhost(const char *host);
-int32_t cell_name2num (const char *cell);
-const char *cell_num2name (int32_t cell);
-cell_entry *cell_get_by_name (const char *cellname);
-cell_entry *cell_get_by_id (int32_t cell);
-cell_entry *cell_new (const char *name);
-cell_entry *cell_new_dynamic (const char *name);
-Bool cell_dynroot (const cell_entry *c);
-Bool cell_issuid (const cell_entry *c);
-Bool cell_issuid_by_num (int32_t cell);
-Bool cell_issuid_by_name (const char *cell);
-Bool cell_setsuid_by_num (int32_t cell);
-int cell_setthiscell (const char *cell);
-int cell_foreach (int (*func) (const cell_entry *, void *),
- void *arg);
-typedef int (*cell_alias_fn)(const char *, const char *, int, void *);
-int cell_alias_foreach (cell_alias_fn, void *);
-int cell_addalias(const char *, const char *, const char *);
-const char *cell_expand_cell (const char *cell);
-unsigned long cell_get_version(void);
-Bool cell_is_sanep (int cell);
-const char ** cell_thesecells (void);
-void cell_print_cell (const cell_entry *c, FILE *out);
-void cell_status (FILE *f);
-time_t cell_get_poller_time(const cell_entry *c);
-void cell_set_poller_time(cell_entry *c, time_t time);
-
-
-/*
- * misc vl
- */
-
-#include <vldb.h>
-#include <volumeserver.h>
-
-void vldb2vldbN (const vldbentry *old, nvldbentry *new);
-void volintInfo2xvolintInfo (const volintInfo *old, xvolintInfo *new);
-
-int volname_canonicalize (char *volname);
-size_t volname_specific (const char *volname, int type,
- char *buf, size_t buf_sz);
-const char *volname_suffix (int type);
-
-char *vol_getopname(int32_t op, char *str, size_t sz);
-const char *volumetype_from_serverflag(int32_t flag);
-const char *volumetype_from_volsertype(int32_t type);
-
-/*
- * misc
- */
-
-int
-VenusFid_cmp (const VenusFid *fid1, const VenusFid *fid2);
-
-#endif /* __KO_H */
diff --git a/usr.sbin/afs/src/lib/ko/ko_locl.h b/usr.sbin/afs/src/lib/ko/ko_locl.h
deleted file mode 100644
index 47305ceb667..00000000000
--- a/usr.sbin/afs/src/lib/ko/ko_locl.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Private Include file for libko
- * $arla: ko_locl.h,v 1.14 2002/07/24 07:03:42 lha Exp $
- */
-
-#ifndef _LIBKO_H
-#define _LIBKO_H 1
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <ctype.h>
-#include <time.h>
-#include <errno.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-#include <sys/stat.h>
-#ifdef HAVE_SYS_IOCCOM_H
-#include <sys/ioccom.h>
-#endif
-#ifdef HAVE_SYS_UTSNAME_H
-#include <sys/utsname.h>
-#endif
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <fcntl.h>
-#include <err.h>
-#include <limits.h>
-#include <strings.h>
-#include <roken.h>
-#include <parse_units.h>
-#include <agetarg.h>
-
-#include <hash.h>
-#include <bool.h>
-#include <list.h>
-#include <log.h>
-
-#include "ko.h"
-
-/* resolver independant api for libko */
-enum { CELL_INVALID_HOST = 1 };
-
-void _ko_resolve_init(void);
-int _ko_resolve_cell(const char *, cell_db_entry *, int, int *, int *);
-int _ko_resolve_host(const char *, cell_db_entry *);
-
-#endif /* _LIBKO_H */
diff --git a/usr.sbin/afs/src/lib/ko/kocell.c b/usr.sbin/afs/src/lib/ko/kocell.c
deleted file mode 100644
index afcd384ecf0..00000000000
--- a/usr.sbin/afs/src/lib/ko/kocell.c
+++ /dev/null
@@ -1,1316 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Cell information
- */
-
-#include "ko_locl.h"
-
-#ifdef HAVE_KRB4
-#include <krb.h>
-#endif
-
-RCSID("$arla: kocell.c,v 1.75 2003/06/10 16:52:06 lha Exp $");
-
-#define TRANSARCSYSCONFDIR "/usr/vice/etc"
-#define CELLFILENAME "CellServDB"
-#define THISCELLFILENAME "ThisCell"
-#define SUIDCELLSFILENAME "SuidCells"
-#define THESECELLFILENAME "TheseCells"
-#define DYNROOTDBFILENAME "DynRootDB"
-#define ALIASDBFILENAME "AliasDB"
-#define DEFCELLCACHESIZE 499
-
-/*
- * hash tables by name and by number
- */
-
-static Hashtab *cellnamehtab, *cellnumhtab;
-
-/*
- * name of the current cell
- */
-
-static char *thiscell = NULL;
-static char **thesecells = NULL;
-static int numthesecells = 1;
-static int dynrootdb_in_use;
-
-/*
- * Logging
- */
-
-#define CDEBERR 0x800
-#define CDEBWARN 0x400
-#define CDEBDNS 0x200
-
-#define CDEBDEFAULT (CDEBWARN|CDEBERR)
-#define cdeball (CDEBWARN|CDEBERR)
-
-static struct units celldebug_units[] = {
- { "all", cdeball },
- { "almost-all", cdeball },
- { "warn", CDEBWARN },
- { "error", CDEBERR },
- { "dns", CDEBDNS },
- { NULL, 0 },
-};
-
-#undef cdeball
-
-static Log_unit *cell_log = NULL;
-
-/*
- *
- */
-
-static unsigned long celldb_version = 0;
-
-static int add_special_dynroot_cell (void);
-
-/*
- * Cell alias
- */
-
-struct cellalias {
- char *name;
- char *alias;
- int type;
- Listitem *li;
-};
-
-static List *cellaliaslist;
-
-/*
- * Functions for handling cell entries.
- */
-
-static int
-cellnamecmp (void *a, void *b)
-{
- cell_entry *c1 = (cell_entry *)a;
- cell_entry *c2 = (cell_entry *)b;
-
- return strcasecmp (c1->name, c2->name);
-}
-
-static unsigned
-cellnamehash (void *a)
-{
- cell_entry *c = (cell_entry *)a;
-
- return hashcaseadd (c->name);
-}
-
-static int
-cellnumcmp (void *a, void *b)
-{
- cell_entry *c1 = (cell_entry *)a;
- cell_entry *c2 = (cell_entry *)b;
-
- return c1->id != c2->id;
-}
-
-static unsigned
-cellnumhash (void *a)
-{
- cell_entry *c = (cell_entry *)a;
-
- return c->id;
-}
-
-/*
- * New cell from cellserver-database file
- */
-
-static cell_entry *
-newcell (char *line)
-{
- char *hash;
- cell_entry *c;
- int len;
-
- len = strcspn (line, " \t#");
- line[len] = '\0';
- c = cell_new (line);
- if (c == NULL)
- err (1, "malloc failed");
-
- line += len + 1;
- hash = strchr (line, '#');
- if (hash != NULL) {
- c->expl = strdup (hash+1);
- if (c->expl == NULL)
- err (1, "strdup");
- }
- return c;
-}
-
-/*
- * Verify that that host is valid (dns wise)
- */
-
-static void
-fetch_host (cell_entry *c, cell_db_entry *host)
-{
- struct timeval tv;
- int ret;
-
- gettimeofday (&tv, NULL);
-
- ret = _ko_resolve_host(host->name, host);
- if (ret) {
- log_log (cell_log, CDEBDNS,
- "fetch_host: failed to resolve host %s in cell %s",
- host->name, c->name);
- host->timeout = CELL_INVALID_HOST;
- return;
- }
-
- host->timeout += tv.tv_sec;
-}
-
-
-/*
- * Help function for updatehosts
- */
-
-static int
-host_sort (const void *p1, const void *p2)
-{
- const cell_db_entry *a = (const cell_db_entry *)p1;
- const cell_db_entry *b = (const cell_db_entry *)p2;
- if (a->timeout == CELL_INVALID_HOST)
- return -1;
- if (b->timeout == CELL_INVALID_HOST)
- return 1;
- return a->addr.s_addr - b->addr.s_addr;
-}
-
-/*
- * Update the hosts for this cell
- */
-
-static void
-updatehosts (cell_entry *c, int dbnum, cell_db_entry *dbservers)
-{
- cell_db_entry *old_servers = c->dbservers;
- struct timeval tv;
- int i;
-
- gettimeofday(&tv, NULL);
-
- for (i = 0; i < dbnum; i++) {
- if (dbservers[i].timeout == CELL_INVALID_HOST
- || (dbservers[i].timeout && dbservers[i].timeout < tv.tv_sec)) {
- fetch_host (c, &dbservers[i]);
- }
- }
-
- if (c->dbservers != dbservers) {
- c->ndbservers = dbnum;
- c->dbservers = malloc (dbnum * sizeof(cell_db_entry));
- if (c->dbservers == NULL && dbnum != 0)
- err (1, "malloc %lu",
- (unsigned long)dbnum * sizeof(cell_db_entry));
- memcpy (c->dbservers, dbservers, dbnum * sizeof (cell_db_entry));
- free (old_servers);
- } else {
- assert(c->ndbservers == dbnum);
- }
-
- if (c->ndbservers)
- qsort (c->dbservers, c->ndbservers, sizeof(c->dbservers[0]),
- host_sort);
-
- c->active_hosts = 0;
- for (i = 0; i < c->ndbservers; i++) {
- if (c->dbservers[i].timeout != CELL_INVALID_HOST)
- c->active_hosts++;
- }
-}
-
-/*
- * try to lookup `cell' in DNS
- * if c == NULL, a new cell will be allocated
- */
-
-static int
-dns_lookup_cell (const char *cell, cell_entry *c)
-{
- int i, ret, dbnum = 0;
- cell_db_entry dbservers[256];
- int lowest_ttl = INT_MAX;
- struct timeval tv;
-
- memset (dbservers, 0, sizeof(dbservers));
- gettimeofday(&tv, NULL);
-
- ret = _ko_resolve_cell(cell, dbservers,
- sizeof(dbservers)/sizeof(dbservers[0]),
- &dbnum, &lowest_ttl);
- if (ret) {
- log_log (cell_log, CDEBDNS,
- "dns_lookup_cell: failed to resolve cell %s", cell);
- return ret;
- }
-
- for (i = 0; i < dbnum; i++)
- if (dbservers[i].timeout != CELL_INVALID_HOST)
- dbservers[i].timeout += tv.tv_sec;
-
- if (lowest_ttl == INT_MAX)
- lowest_ttl = 5 * 60;
-
- if (c == NULL)
- c = cell_new_dynamic (cell);
- c->timeout = lowest_ttl + tv.tv_sec;
- /* catch the hosts that didn't fit in additional rr */
- updatehosts (c, dbnum, dbservers);
- return 0;
-}
-
-/*
- * If the cell-information comes from a source that have a time-limit,
- * make sure the data is uptodate.
- */
-
-static void
-update_cell (cell_entry *c)
-{
- struct timeval tv;
-
- gettimeofday(&tv, NULL);
-
- if (c->id == DYNROOT_CELLID)
- return;
-
- if ((c->timeout && c->timeout < tv.tv_sec)
- || c->ndbservers == 0) {
- dns_lookup_cell (c->name, c);
- }
- updatehosts (c, c->ndbservers, c->dbservers);
-}
-
-/*
- * cell name -> cell_entry *
- */
-
-cell_entry *
-cell_get_by_name (const char *cellname)
-{
- cell_entry key, *data;
-
- key.name = cellname;
- data = (cell_entry *)hashtabsearch (cellnamehtab, &key);
- if (data == NULL) {
- dns_lookup_cell (cellname, NULL);
- data = (cell_entry *)hashtabsearch (cellnamehtab, &key);
- }
- if (data)
- update_cell (data);
- return data;
-}
-
-/*
- * cell id -> cell_entry *
- */
-
-cell_entry *
-cell_get_by_id (int32_t cell)
-{
- cell_entry key, *data;
-
- key.id = cell;
- data = (cell_entry *)hashtabsearch (cellnumhtab, &key);
- if (data)
- update_cell (data);
- return data;
-}
-
-/*
- * cells are assigned monotonically increasing numbers
- * that dont use 0.
- */
-
-static int32_t cellno = 1;
-
-/*
- * Add the cell `name' to the cell cache.
- */
-
-cell_entry *
-cell_new (const char *name)
-{
- cell_entry *c;
-
- c = (cell_entry *)malloc (sizeof (*c));
- if (c == NULL)
- return NULL;
- c->name = strdup (name);
- if (c->name == NULL) {
- free (c);
- return NULL;
- }
- c->id = cellno++;
- assert(c->id != DYNROOT_CELLID);
- c->expl = NULL;
- c->ndbservers = 0;
- c->active_hosts = 0;
- c->dbservers = NULL;
- c->flags = 0;
- hashtabadd (cellnamehtab, c);
- hashtabadd (cellnumhtab, c);
- c->timeout = 0;
- c->poller_timeout = 0;
- celldb_version++;
- return c;
-}
-
-/*
- * add a new `dynamic' cell
- */
-
-cell_entry *
-cell_new_dynamic (const char *name)
-{
- cell_entry *c;
-
- c = cell_new (name);
- if (c == NULL)
- return NULL;
- c->expl = "dynamically added cell";
- return c;
-}
-
-/*
- * Read one line of database information.
- */
-
-static int
-readdb (char *line, cell_entry* c, int *dbnum, int maxdbs,
- cell_db_entry *dbservs, int lineno)
-{
- struct in_addr numaddr;
- char *hostname, *eh;
-
- if (*dbnum >= maxdbs) {
- return -1;
- }
-
- while (isspace((unsigned char)*line))
- ++line;
-
- if (inet_aton (line, &numaddr) == 0) {
- return -1;
- }
-
- while (*line && !isspace((unsigned char)*line) && *line != '#')
- ++line;
-
- hostname = line;
-
- while (isspace ((unsigned char)*hostname) || *hostname == '#')
- ++hostname;
-
- eh = hostname;
-
- while (*eh && !isspace((unsigned char)*eh) && *eh != '#')
- ++eh;
-
- *eh = '\0';
-
- if (*hostname == '\0')
- hostname = inet_ntoa (numaddr);
-
- dbservs[*dbnum].name = strdup (hostname);
- if (dbservs[*dbnum].name == NULL)
- err (1, "strdup");
- dbservs[*dbnum].addr = numaddr;
- dbservs[*dbnum].timeout = 0;
- ++(*dbnum);
- return 0;
-}
-
-/*
- * Read the information from the cell-server db.
- */
-
-static int
-readcellservdb (const char *filename)
-{
- FILE *f;
- char line[256];
- cell_entry *c = NULL;
- int lineno = 0;
- int dbnum;
- cell_db_entry dbservs[256];
- int i;
-
- f = fopen (filename, "r");
- if (f == NULL) {
- return 1;
- }
-
- while (fgets (line, sizeof (line), f)) {
- ++lineno;
- i = 0;
- line[strcspn(line, "\n")] = '\0';
- while (isspace((unsigned char)line[i]))
- i++;
- if (line[i] == '#' || line[i] == '\0')
- continue;
- if (line[i] == '>') {
- if (c != NULL)
- updatehosts (c, dbnum, dbservs);
- c = newcell (&line[i] + 1);
- memset (dbservs, 0, sizeof(dbservs));
- dbnum = 0;
- } else {
- if (readdb(&line[i], c, &dbnum, sizeof (dbservs) /
- sizeof(*dbservs),
- dbservs, lineno))
- continue;
- }
- }
- if (c != NULL)
- updatehosts (c, dbnum, dbservs);
- fclose (f);
- return 0;
-}
-
-/*
- * Read single line confilefiles in `filename' and send the
- * to `func'.
- */
-
-static int
-parse_simple_file (const char *filename, void (*func)(char *))
-{
- FILE *f;
- char line[256];
-
- f = fopen (filename, "r");
- if (f == NULL)
- return 1;
-
- while ((fgets (line, sizeof(line), f) != NULL)) {
- line[strcspn(line, "\n")] = '\0';
- (*func) (line);
- }
- fclose (f);
- return 0;
-}
-
-/*
- * Add expanded `cellname' to Thesecells list, filter out duplicates
- */
-
-static void
-addthesecell (char *cellname)
-{
- const char *cell;
- char **ntc;
- int i;
-
- cell = cell_expand_cell (cellname);
- for (i = 0; thesecells && thesecells[i]; i++)
- if (strcasecmp (thesecells[i], cell) == 0)
- return;
-
- ntc = realloc (thesecells, (numthesecells + 1) * sizeof (char *));
- if (ntc == NULL)
- errx(1, "realloc");
- thesecells = ntc;
-
- thesecells[numthesecells - 1] = strdup (cell);
- if (thesecells[numthesecells - 1] == NULL)
- errx(1, "strdup");
- thesecells[numthesecells] = NULL;
- ++numthesecells;
-}
-
-/*
- * Read cells in TheseCells
- */
-
-static int
-readthesecells (const char *filename)
-{
- parse_simple_file (filename, addthesecell);
- if (numthesecells == 1)
- return 1;
- return 0;
-}
-
-/*
- * Read name of this cell.
- */
-
-static int
-readthiscell (const char *filename)
-{
- FILE *f;
- char cell[256];
-
- f = fopen (filename, "r");
- if (f == NULL)
- return 1;
-
- if (fgets (cell, sizeof cell, f) == NULL) {
- log_log (cell_log, CDEBERR, "Cannot read cellname from %s",
- filename);
- return 1;
- }
- cell[strcspn(cell, "\n")] = '\0';
- thiscell = strdup (cell);
- if (thiscell == NULL)
- err (1, "strdup");
- fclose (f);
- return 0;
-}
-
-/*
- * Read suidcells file and set suidcell flag
- */
-
-static void
-addsuidcell (char *cellname)
-{
- cell_entry *e;
-
- e = cell_get_by_name (cellname);
- if (e == NULL) {
- log_log (cell_log, CDEBWARN,
- "suidcell: cell %s doesn't exist in the db", cellname);
- } else {
- e->flags |= SUID_CELL;
- }
-}
-
-static int
-readsuidcell (const char *filename)
-{
- return parse_simple_file (filename, addsuidcell);
-}
-
-/*
- *
- */
-
-static void
-add_dynroot(char *cellname)
-{
- cell_entry *e;
-
- e = cell_get_by_name (cellname);
- if (e == NULL) {
- log_log (cell_log, CDEBWARN,
- "dynroot: cell %s doesn't exist in the db", cellname);
- } else {
- e->flags |= DYNROOT_CELL;
- dynrootdb_in_use = 1;
- }
-}
-
-static int
-readdynrootdb (const char *filename)
-{
- return parse_simple_file (filename, add_dynroot);
-}
-
-static void
-add_alias(char *alias_line)
-{
- const char *delim = " \t";
- char *cellname, *aliasname, *type, *al;
- size_t sz;
-
- al = alias_line;
-
-#define ENDSTR(str) ((str) == NULL || *(str) == '\0' || *(str) == '#')
-
- sz = strspn(alias_line, delim);
- al = al + sz;
- if (ENDSTR(al))
- return;
- cellname = strsep(&al, delim);
- if (ENDSTR(cellname) || al == NULL)
- goto out;
- sz = strspn(al, delim);
- al = al + sz;
- if (ENDSTR(al))
- goto out;
- aliasname = strsep(&al, delim);
- if (ENDSTR(aliasname))
- goto out;
-
- type = "readonly";
- if (al != NULL) {
- sz = strspn(al, delim);
- al = al + sz;
- if (!ENDSTR(al)) {
- al = strsep(&al, delim);
- if (!ENDSTR(al))
- type = al;
- }
- }
-
-#undef ENDSTR
- cell_addalias(cellname, aliasname, type);
- return;
-
- out:
- log_log (cell_log, CDEBWARN,
- "alias: failed to parse line `%s'", alias_line);
-}
-
-static int
-readaliasdb (const char *filename)
-{
- return parse_simple_file (filename, add_alias);
-}
-
-/*
- * Initialize the cache of cell information.
- */
-
-static int cell_inited = 0;
-
-void
-cell_init (int cellcachesize, Log_method *logm)
-{
- char *env = NULL;
- uid_t uid,euid;
- int ret;
-
- assert (logm);
-
- if (cell_inited) {
- log_log (cell_log, CDEBWARN, "cell_init: Already initlized");
- return;
- }
- cell_inited = 1;
-
- _ko_resolve_init();
-
- cell_log = log_unit_init (logm, "cell", celldebug_units, CDEBDEFAULT);
- if (cell_log == NULL)
- errx (1, "cell_init: log_unit_init failed");
-
- if (cellcachesize == 0)
- cellcachesize = DEFCELLCACHESIZE;
-
- cellnamehtab = hashtabnew (cellcachesize, cellnamecmp, cellnamehash);
- if (cellnamehash == NULL)
- errx (1, "cell_init: hashtabnew failed");
- cellnumhtab = hashtabnew (cellcachesize, cellnumcmp, cellnumhash);
- if (cellnumhtab == NULL)
- errx (1, "cell_init: hashtabnew failed");
-
- uid = getuid();
- euid = geteuid();
-
- if(uid == euid)
- env = getenv ("AFSCELL");
-
- if (env != NULL) {
- thiscell = strdup (env);
- if (thiscell == NULL)
- errx(1, "strdup");
- } else if (readthiscell (SYSCONFDIR "/" THISCELLFILENAME)) {
- if (readthiscell(TRANSARCSYSCONFDIR "/" THISCELLFILENAME))
- errx (1, "could not open "
- SYSCONFDIR "/" THISCELLFILENAME
- " nor "
- TRANSARCSYSCONFDIR "/" THISCELLFILENAME);
- }
-
- env = NULL;
-
- if(uid == euid)
- env = getenv("CELLSERVDBFILE");
-
- if(env != NULL) {
- if(readcellservdb (env)) {
- log_log (cell_log, CDEBWARN,
- "Can't read the CellServDB file, "
- "will use DNS AFSDB entries");
- }
- } else if (readcellservdb (SYSCONFDIR "/" CELLFILENAME)) {
- if (readcellservdb(TRANSARCSYSCONFDIR "/" CELLFILENAME)) {
- log_log (cell_log, CDEBWARN,
- "Can't read the CellServDB file, "
- "will use DNS AFSDB entries");
- }
- }
- ret = add_special_dynroot_cell();
- if (ret)
- log_log (cell_log, CDEBWARN, "adding dynroot cell failed with %d", ret);
-
- if (readthesecells (SYSCONFDIR "/" THESECELLFILENAME))
- readthesecells (TRANSARCSYSCONFDIR "/" THESECELLFILENAME);
- if (getenv("HOME") != NULL) {
- char homedir[MAXPATHLEN];
- snprintf (homedir, sizeof(homedir),
- "%s/." THESECELLFILENAME,
- getenv("HOME"));
- readthesecells (homedir);
- }
- addthesecell (thiscell);
- if (readsuidcell (SYSCONFDIR "/" SUIDCELLSFILENAME))
- readsuidcell (TRANSARCSYSCONFDIR "/" SUIDCELLSFILENAME);
- if (readdynrootdb (SYSCONFDIR "/" DYNROOTDBFILENAME))
- readdynrootdb (TRANSARCSYSCONFDIR "/" DYNROOTDBFILENAME);
-
- cellaliaslist = listnew();
- if (readaliasdb (SYSCONFDIR "/" ALIASDBFILENAME))
- readaliasdb (TRANSARCSYSCONFDIR "/" ALIASDBFILENAME);
-}
-
-/*
- *
- */
-
-const char **
-cell_thesecells (void)
-{
- return (const char **)thesecells;
-}
-
-/*
- * Return all db servers for `cell' with the count in `num'.
- * NULL on error.
- */
-
-const cell_db_entry *
-cell_dbservers_by_id (int32_t id, int *num)
-{
- cell_entry *data = cell_get_by_id (id);
-
- if (data == NULL)
- return NULL;
-
- if (data->ndbservers == 0)
- dns_lookup_cell (data->name, data);
- if (data->ndbservers == 0 || data->active_hosts == 0)
- return NULL;
-
- *num = data->active_hosts;
- return data->dbservers;
-}
-
-/*
- * Return the name of the first database server in `cell' or NULL (if
- * the cell does not exist or it has no db servers).
- */
-
-const char *
-cell_findnamedbbyname (const char *cell)
-{
- cell_entry *data = cell_get_by_name (cell);
-
- if (data == NULL)
- return NULL;
- if (data->ndbservers == 0)
- dns_lookup_cell (cell, data);
- if (data->ndbservers == 0 || data->active_hosts == 0)
- return NULL;
-
- return data->dbservers[0].name ;
-}
-
-/*
- * Get the cell of the host
- */
-
-const char *
-cell_getcellbyhost(const char *host)
-{
- const char *ptr = NULL;
- assert(host);
-
-#ifdef HAVE_KRB4
- ptr = krb_realmofhost(host);
-#endif
- if (ptr)
- return ptr;
-
- ptr = strchr (host, '.');
- if (ptr == NULL)
- return NULL;
- return ptr + 1;
-}
-
-/*
- * Return the ID given the name for a cell.
- * -1 if the cell does not exist.
- */
-
-int32_t
-cell_name2num (const char *cell)
-{
- cell_entry *data = cell_get_by_name (cell);
-
- if (data != NULL)
- return data->id;
- else
- return -1;
-}
-
-/*
- * Return the name given the ID or NULL if the cell doesn't exist.
- */
-
-const char *
-cell_num2name (int32_t cell)
-{
- cell_entry *data = cell_get_by_id (cell);
-
- if (data != NULL)
- return data->name;
- else
- return NULL;
-}
-
-/*
- * Return name of the cell of the cache manager.
- */
-
-const char *
-cell_getthiscell (void)
-{
- if (thiscell == NULL)
- return "unknown-cell-missing-configuration";
- return thiscell;
-}
-
-/*
- *
- */
-
-int
-cell_setthiscell (const char *cell)
-{
- cell_entry *data;
- char * cp;
-
- data = cell_get_by_name(cell);
- if (data == NULL) {
- log_log (cell_log, CDEBWARN, "this cell doesn't exist: %s", cell);
- return 1;
- }
-
- cp = strdup (cell);
- if (cp == NULL) {
- log_log (cell_log, CDEBWARN, "setthiscell: malloc failed");
- return 1;
- }
- free (thiscell);
- thiscell = cp;
-
- return 0;
-}
-
-/*
- * Return if this should be in dynroot
- */
-
-Bool
-cell_dynroot (const cell_entry *c)
-{
- assert (c);
- if (!dynrootdb_in_use)
- return TRUE;
- return (c->flags & DYNROOT_CELL) != 0;
-}
-
-/*
- * Return if this is a suid cell
- */
-
-Bool
-cell_issuid (const cell_entry *c)
-{
- assert (c);
- return (c->flags & SUID_CELL) != 0;
-}
-
-Bool
-cell_issuid_by_num (int32_t cell)
-{
- cell_entry *c;
-
- c = cell_get_by_id (cell);
- if (c == NULL)
- return FALSE;
-
- return cell_issuid (c);
-}
-
-Bool
-cell_issuid_by_name (const char *cell)
-{
- cell_entry *c;
-
- c = cell_get_by_name (cell);
- if (c == NULL)
- return FALSE;
-
- return cell_issuid (c);
-}
-
-Bool
-cell_setsuid_by_num (int32_t cell)
-{
- cell_entry *c;
-
- c = cell_get_by_id (cell);
- if (c == NULL)
- return FALSE;
-
- c->flags |= SUID_CELL;
-
- return 0;
-}
-
-/*
- *
- */
-
-void
-cell_print_cell (const cell_entry *c, FILE *out)
-{
- int i;
- char timestr[128];
- struct tm tm;
- time_t t;
-
- fprintf (out, "name: %s id: %d type: %s\n",
- c->name, c->id, c->timeout ? "dynamic" : "static");
- fprintf (out, "comment: %s\n", c->expl);
- if (c->timeout) {
- t = c->timeout;
- if (strftime(timestr, sizeof(timestr),
- "%Y-%m-%d %H:%M:%S", localtime_r(&t, &tm)) > 0)
- fprintf (out, "timeout: %s\n", timestr);
- }
- fprintf (out, "num hosts: %d active hosts: %d\n",
- c->ndbservers, c->active_hosts);
- for (i = 0; i < c->ndbservers; i++) {
- char *buf;
- if (c->dbservers[i].timeout == CELL_INVALID_HOST)
- buf = "invalid";
- else if (c->dbservers[i].timeout == 0)
- buf = "no timeout";
- else {
- t = c->timeout;
- if (strftime(timestr, sizeof(timestr),
- "%Y-%m-%d %H:%M:%S", localtime_r(&t, &tm)) > 0)
- buf = timestr;
- else
- buf = "time-error";
- }
- fprintf (out, " host: %s %s - %s\n", c->dbservers[i].name,
- inet_ntoa (c->dbservers[i].addr), buf);
- }
-}
-
-static int
-cell_info_print (const cell_entry *e, void *ptr)
-{
- FILE *f = (FILE *)ptr;
- cell_print_cell(e, f);
- return 0;
-}
-
-/*
- * Print all cell info on `f'
- */
-
-void
-cell_status (FILE *f)
-{
- cell_foreach(cell_info_print, f);
-}
-
-
-/*
- * Iterate over all entries in the cell-db with `func'
- * (that takes the cellname and `arg' as arguments)
- */
-
-struct cell_iterate_arg {
- void *arg;
- int ret;
- int (*func) (const cell_entry *, void *);
-};
-
-static int
-cell_iterate_func (void *ptr, void *arg)
-{
- struct cell_iterate_arg *cia = (struct cell_iterate_arg *) arg;
- cell_entry *cell = (cell_entry *) ptr;
- int ret;
-
- if (cell->id == DYNROOT_CELLID)
- return 0;
-
- ret = (cia->func) (cell, cia->arg);
- if (ret)
- cia->ret = ret;
- return ret;
-}
-
-int
-cell_foreach (int (*func) (const cell_entry *, void *), void *arg)
-{
- struct cell_iterate_arg cia;
-
- cia.arg = arg;
- cia.ret = 0;
- cia.func = func;
-
- hashtabforeach (cellnamehtab, cell_iterate_func, &cia);
-
- return cia.ret;
-}
-
-/*
- *
- */
-
-struct cell_expand_arg {
- const char *cell;
- const char *fullcell;
- int32_t last_found;
-};
-
-static int
-cell_expand_cell_name (const cell_entry *cell, void *data)
-{
- struct cell_expand_arg *cea = (struct cell_expand_arg *) data;
- if (strcasecmp (cell->name, cea->cell) == 0) {
- cea->fullcell = cell->name;
- return 1;
- }
- if (strstr (cell->name, cea->cell) && cea->last_found > cell->id) {
- cea->last_found = cell->id;
- cea->fullcell = cell->name;
- }
- return 0;
-}
-
-const char *
-cell_expand_cell (const char *cell)
-{
- struct cell_expand_arg cea;
- cea.cell = cell;
- cea.fullcell = NULL;
- cea.last_found = cellno + 1;
-
- cell_foreach (cell_expand_cell_name, &cea);
- if (cea.fullcell)
- return cea.fullcell;
- return cell;
-}
-
-/*
- *
- */
-
-unsigned long
-cell_get_version(void)
-{
- return celldb_version;
-}
-
-/*
- *
- */
-
-static int
-add_special_dynroot_cell (void)
-{
- cell_entry * c;
-
- c = cell_get_by_id (0);
- if (c != NULL)
- errx(-1, "add_special_dynroot_cell: cell id 0 already present\n");
-
- c = (cell_entry *)malloc (sizeof (*c));
- if (c == NULL)
- return errno;
- c->name = strdup ("#dynrootcell#");
- if (c->name == NULL) {
- free (c);
- return errno;
- }
- c->id = DYNROOT_CELLID;
- c->expl = "The special dynroot cell";
- c->ndbservers = 0;
- c->dbservers = NULL;
- c->flags = 0;
- hashtabadd (cellnamehtab, c);
- hashtabadd (cellnumhtab, c);
- return 0;
-}
-
-/*
- * Return TRUE if ``cell'' has a sane cellnumber.
- */
-
-Bool
-cell_is_sanep (int cell)
-{
- return cell < cellno;
-}
-
-/*
- * Get the poller delta time for `cell'. Default is zero, that means
- * that the caller should use the default poller timeout.
- */
-
-time_t
-cell_get_poller_time(const cell_entry *cell)
-{
- return cell->poller_timeout;
-}
-
-/*
- * Set the poller delta `time' for `cell'.
- */
-
-void
-cell_set_poller_time(cell_entry *cell, time_t time)
-{
- cell->poller_timeout = time;
-}
-
-/*
- *
- */
-
-static int
-find_alias (const char *cellname, const char *alias, int type, void *arg)
-{
- const char *newcell = arg;
- if (strcmp(alias, newcell) == 0)
- return EEXIST;
- return 0;
-}
-
-int
-cell_addalias(const char *cellname, const char *alias, const char *stype)
-{
- struct cellalias *ca;
- int type;
- int ret;
-
- if (strcasecmp("readonly", stype) == 0 ||
- strcasecmp("ro", stype) == 0)
- type = DYNROOT_ALIAS_READONLY;
- else if (strcasecmp("readwrite", stype) == 0 ||
- strcasecmp("rw", stype) == 0)
- type = DYNROOT_ALIAS_READWRITE;
- else
- return EINVAL;
-
- ret = cell_alias_foreach(find_alias, (void *)alias);
- if (ret)
- return ret;
-
- ca = malloc(sizeof(*ca));
- if (ca == NULL)
- return ENOMEM;
- memset(ca, 0, sizeof(*ca));
-
- ca->type = type;
- ca->name = strdup(cellname);
- if (ca->name == NULL)
- goto out;
- ca->alias = strdup(alias);
- if (ca->alias == NULL)
- goto out;
- ca->li = listaddtail(cellaliaslist, ca);
- if (ca->li == NULL)
- goto out;
-
- celldb_version++;
-
- return 0;
- out:
- if (ca->name)
- free(ca->name);
- if (ca->alias)
- free(ca->alias);
- free(ca);
- return ENOMEM;
-}
-
-
-/*
- *
- */
-
-struct listalias_ctx {
- cell_alias_fn func;
- void *ptr;
- int error;
-};
-
-static Bool
-listalias_f(List *list, Listitem *li, void *arg)
-{
- struct cellalias *ca = listdata(li);
- struct listalias_ctx *ctx = arg;
-
- ctx->error = (*ctx->func)(ca->name, ca->alias, ca->type, ctx->ptr);
- if (ctx->error)
- return TRUE;
- return FALSE;
-}
-
-int
-cell_alias_foreach (cell_alias_fn func, void *ptr)
-{
- struct listalias_ctx c;
- c.func = func;
- c.ptr = ptr;
- c.error = 0;
-
- listiter(cellaliaslist, listalias_f, &c);
-
- return c.error;
-}
diff --git a/usr.sbin/afs/src/lib/ko/koerror.c b/usr.sbin/afs/src/lib/ko/koerror.c
deleted file mode 100644
index 90e099417c4..00000000000
--- a/usr.sbin/afs/src/lib/ko/koerror.c
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- * Copyright (c) 1998 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: koerror.c,v 1.27 2003/06/10 16:52:51 lha Exp $");
-#endif
-
-#include <stdio.h>
-#include <string.h>
-
-#include <roken.h>
-
-#include <rx/rx.h>
-#include <rx/rxgencon.h>
-#ifdef HAVE_KRB4
-#include <krb.h>
-#ifdef HAVE_OPENSSL
-#include <openssl/des.h>
-#else
-#include <des.h>
-#endif
-#endif /* HAVE_KRB4 */
-#include <rxkad.h>
-#include <ko.h>
-#include <fs_errors.h>
-
-#include <vldb.h>
-#include <volumeserver.h>
-#include <pts.h>
-#include <bos.h>
-#include <ubik.h>
-#include <ka.h>
-
-struct koerr {
- koerr_t code;
- const char *msg;
-};
-
-static struct koerr koerrmsg[] = {
-
- /* VL server errors */
-
- {VL_IDEXIST, "VL - Volume Id entry exists in vl database."},
- {VL_IO, "VL - I/O related error."},
- {VL_NAMEEXIST, "VL - Volume name entry exists in vl database."},
- {VL_CREATEFAIL, "VL - Internal creation failure."},
- {VL_NOENT, "VL - No such entry."},
- {VL_EMPTY, "VL - Vl database is empty."},
- {VL_ENTDELETED, "VL - Entry is deleted (soft delete)."},
- {VL_BADNAME, "VL - Volume name is illegal."},
- {VL_BADINDEX, "VL - Index is out of range."},
- {VL_BADVOLTYPE, "VL - Bad volume type."},
- {VL_BADPARTITION, "VL - Illegal server number (out of range)."},
- {VL_BADSERVER, "VL - Bad partition number."},
- {VL_REPSFULL, "VL - Run out of space for Replication sites."},
- {VL_NOREPSERVER, "VL - No such Replication server site exists."},
- {VL_DUPREPSERVER, "VL - Replication site alreay exists."},
- {VL_RWNOTFOUND, "VL - Parent R/W entry no found."},
- {VL_BADREFCOUNT, "VL - Illegal reference count numner."},
- {VL_SIZEEXCEEDED, "VL - Vl size for attributes exceeded."},
- {VL_BADENTRY, "VL - Bad incming vl entry."},
- {VL_BADVOLIDBUMP, "VL - Illegal max volid increment."},
- {VL_IDALREADHASED, "VL - RO/BACK id already hashed."},
- {VL_ENTRYLOCKED, "VL - Vl entry is already locked."},
- {VL_BADVOLOPER, "VL - Bad volume operation code."},
- {VL_BADRELLOCKTYPE, "VL - Bad release lock type."},
- {VL_RERELEASE, "VL - Status report: last release was aborted."},
- {VL_BADSERVERFLAG, "VL - Invalid replication site server flag."},
- {VL_PERM, "VL - No permission access."},
- {VL_NOMEM, "VL - malloc(realloc) failed to alloc enough memory"},
- {VL_BADVERSION, "VL - Bad version"},
- {VL_INDEXERANGE, "VL - Index out of range"},
- {VL_MULTIPADDR, "VL - Multiple IP addresses"},
- {VL_BADMASK, "VL - Bad mask"},
-
- /* VOLSER errors */
-
- {VOLSERTRELE_ERROR, "VOLSER - Internal error releasing "
- "transaction."},
- {VOLSERNO_OP, "VOLSER - Unknown internal error."},
- {VOLSERREAD_DUMPERROR, "VOLSER - Badly formatted dump."},
- {VOLSERDUMPERROR, "VOLSER - Badly formatted dump(2)."},
- {VOLSERATTACH_ERROR, "VOLSER - Could not attach volume."},
- {VOLSERILLEGAL_PARTITION, "VOLSER - Illegal partition."},
- {VOLSERDETACH_ERROR, "VOLSER - Could not detach volume."},
- {VOLSERBAD_ACCESS, "VOLSER - Insufficient privilege for "
- "volume operation."},
- {VOLSERVLDB_ERROR, "VOLSER - Error from volume location database."},
- {VOLSERBADNAME, "VOLSER - Bad volume name."},
- {VOLSERVOLMOVED, "VOLSER - Volume moved."},
- {VOLSERBADOP, "VOLSER - Illegal volume operation."},
- {VOLSERBADRELEASE, "VOLSER - Volume release failed."},
- {VOLSERVOLBUSY, "VOLSER - Volume still in use by volserver."},
- {VOLSERNO_MEMORY, "VOLSER - Out of virtual memory."},
- {VOLSERNOVOL, "VOLSER - No such volume."},
- {VOLSERMULTIRWVOL, "VOLSER - More then one read/write volume."},
- {VOLSERFAILEDOP, "VOLSER - Failed volume server operation."},
-
- {PREXIST, "PR - Entry exist."},
- {PRIDEXIST, "PR - Id exist."},
- {PRNOIDS, "PR - No Ids."},
- {PRDBFAIL, "PR - Protection-database failed."},
- {PRNOENT, "PR - No entry."},
- {PRPERM, "PR - Permission denied."},
- {PRNOTGROUP, "PR - Not a group."},
- {PRNOTUSER, "PR - Not a user."},
- {PRBADNAM, "PR - Bad name."},
- {PRBADARG, "PR - Bad argument."},
- {PRNOMORE, "PR - No more (?)."},
- {PRDBBAD, "PR - Protection-database went bad."},
- {PRGROUPEMPTY, "PR - Empty group."},
- {PRINCONSISTENT, "PR - Database inconsistency."},
- {PRBADDR, "PR - Bad address."},
- {PRTOOMANY, "PR - Too many."},
-
- {RXGEN_CC_MARSHAL, "rxgen - cc_marshal"},
- {RXGEN_CC_UNMARSHAL, "rxgen - cc_unmarshal"},
- {RXGEN_SS_MARSHAL, "rxgen - ss_marshal"},
- {RXGEN_SS_UNMARSHAL, "rxgen - ss_unmarshal"},
- {RXGEN_DECODE, "rxgen - decode"},
- {RXGEN_OPCODE, "rxgen - opcode"},
- {RXGEN_SS_XDRFREE, "rxgen - ss_xdrfree"},
- {RXGEN_CC_XDRFREE, "rxgen - cc_xdrfree"},
-
-#ifdef KERBEROS
- /* rxkad - XXX more sane messages */
-
- {RXKADINCONSISTENCY, "rxkad - Inconsistency."},
- {RXKADPACKETSHORT, "rxkad - Packet too short."},
- {RXKADLEVELFAIL, "rxkad - Security level failed."},
- {RXKADTICKETLEN, "rxkad - Invalid ticket length."},
- {RXKADOUTOFSEQUENCE, "rxkad - Out of sequence."},
- {RXKADNOAUTH, "rxkad - No authentication."},
- {RXKADBADKEY, "rxkad - Bad key."},
- {RXKADBADTICKET, "rxkad - Bad ticket."},
- {RXKADUNKNOWNKEY, "rxkad - Unknown key."},
- {RXKADEXPIRED, "rxkad - Ticket expired."},
- {RXKADSEALEDINCON, "rxkad - Seal inconsistency."},
- {RXKADDATALEN, "rxkad - Datalength error."},
- {RXKADILLEGALLEVEL, "rxkad - Illegal level."},
-
-#endif
-
- {ARLA_VSALVAGE, "arla-fs-error - salvaging"},
- {ARLA_VNOVNODE, "arla-fs-error - no such vnode"},
- {ARLA_VNOVOL, "arla-fs-error - no such volume"},
- {ARLA_VVOLEXISTS, "arla-fs-error - volume already exists"},
- {ARLA_VNOSERVICE, "arla-fs-error - no service"},
- {ARLA_VOFFLINE, "arla-fs-error - volume offline"},
- {ARLA_VONLINE, "arla-fs-error - volume online"},
- {ARLA_VDISKFULL, "arla-fs-error - disk full"},
- {ARLA_VOVERQUOTA, "arla-fs-error - quoua full"},
- {ARLA_VBUSY, "arla-fs-error - busy volume"},
- {ARLA_VMOVED, "arla-fs-error - moved volume"},
- {ARLA_VIO, "arla-fs-error - I/O error"},
- {ARLA_VRESTARTING, "arla-fs-error - restarting"},
-
- {BZNOTACTIVE, "bos - Not active"},
- {BZNOENT, "bos - No entry"},
- {BZBUSY, "bos - Busy"},
- {BZNOCREATE, "bos - No able to create"},
- {BZDOM, "bos - Out of domain"},
- {BZACCESS, "bos - No access"},
- {BZSYNTAX, "bos - Syntax error"},
- {BZIO, "bos - I/O error"},
- {BZNET, "bos - Network error"},
- {BZBADTYPE, "bos - Bad type"},
-
- /* ubik errors */
-
- {UNOQUORUM, "no quorum elected"},
- {UNOTSYNC, "not synchronization site (should work on sync site)"},
- {UNHOSTS, "too many hosts"},
- {UIOERROR, "I/O error writing dbase or log"},
- {UINTERNAL, "mysterious internal error"},
- {USYNC, "major synchronization error"},
- {UNOENT, "file not found when processing dbase"},
- {UBADLOCK, "bad lock range size (must be 1)"},
- {UBADLOG, "read error reprocessing log"},
- {UBADHOST, "problems with host name"},
- {UBADTYPE, "bad operation for this transaction type"},
- {UTWOENDS, "two commits or aborts done to transaction"},
- {UDONE, "operation done after abort (or commmit)"},
- {UNOSERVERS, "no servers appear to be up"},
- {UEOF, "premature EOF"},
- {ULOGIO, "error writing log file"},
- {UBADFAM, "UBADFAM"},
- {UBADCELL, "UBADCELL"},
- {UBADSECGRP, "UBADSECGRP"},
- {UBADGROUP, "UBADGROUP"},
- {UBADUUID, "UBADUUID"},
- {UNOMEM, "UNOMEM"},
- {UNOTMEMBER, "UNOTMEMBER"},
- {UNBINDINGS, "UNBINDINGS"},
- {UBADPRINNAME, "UBADPRINNAME"},
- {UPIPE, "UPIPE"},
- {UDEADLOCK, "UDEADLOCK"},
- {UEXCEPTION, "UEXCEPTION"},
- {UTPQFAIL, "UTPQFAIL"},
- {USKEWED, "USKEWED"},
- {UNOLOCK, "UNOLOCK"},
- {UNOACCESS, "UNOACCESS"},
- {UNOSPC, "UNOSPC"},
- {UBADPATH, "UBADPATH"},
- {UBADF, "UBADF"},
- {UREINITIALIZE, "UREINITIALIZE"},
-
- /* ka errors */
-
- {KADATABASEINCONSISTENT, "ka - database inconsistent"},
- {KAEXIST, "ka - already exists"},
- {KAIO, "ka - io error"},
- {KACREATEFAIL, "ka - creation failed"},
- {KANOENT, "ka - no such entry"},
- {KAEMPTY, "ka - empty"},
- {KABADNAME, "ka - bad name"},
- {KABADINDEX, "ka - bad index"},
- {KANOAUTH, "ka - no authorization"},
- {KAANSWERTOOLONG, "ka - answer too long"},
- {KABADREQUEST, "ka - bad request"},
- {KAOLDINTERFACE, "ka - old interface"},
- {KABADARGUMENT, "ka - bad argument"},
- {KABADCMD, "ka - bad command"},
- {KANOKEYS, "ka - no keys"},
- {KAREADPW, "ka - error reading password"},
- {KABADKEY, "ka - bad key"},
- {KAUBIKINIT, "ka - error initialing ubik"},
- {KAUBIKCALL, "ka - error in ubik call"},
- {KABADPROTOCOL, "ka - bad protocol"},
- {KANOCELLS, "ka - no cells"},
- {KANOCELL, "ka - no cell"},
- {KATOOMANYUBIKS, "ka - too many ubiks"},
- {KATOOMANYKEYS, "ka - too many keys"},
- {KABADTICKET, "ka - bad ticket"},
- {KAUNKNOWNKEY, "ka - unknown key"},
- {KAKEYCACHEINVALID, "ka - key cache invalid"},
- {KABADSERVER, "ka - bad server"},
- {KABADUSER, "ka - bad user"},
- {KABADCPW, "ka - bad change password"},
- {KABADCREATE, "ka - bad creation"},
- {KANOTICKET, "ka - no ticket"},
- {KAASSOCUSER, "ka - associated user"},
- {KANOTSPECIAL, "ka - not special"},
- {KACLOCKSKEW, "ka - clock skew"},
- {KANORECURSE, "ka - no recurse"},
- {KARXFAIL, "ka - rx failed"},
- {KANULLPASSWORD, "ka - null password"},
- {KAINTERNALERROR, "ka - internal error"},
- {KAPWEXPIRED, "ka - password expired"},
- {KAREUSED, "ka - password reused"},
- {KATOOSOON, "ka - password changed too soon"},
- {KALOCKED, "ka - account locked"},
-
- /* rx errors */
-
- {ARLA_CALL_DEAD, "rx - call dead"},
- {ARLA_INVALID_OPERATION, "rx - invalid operation"},
- {ARLA_CALL_TIMEOUT, "rx - call timeout"},
- {ARLA_EOF, "rx - end of data"},
- {ARLA_PROTOCOL_ERROR, "rx - protocol error"},
- {ARLA_USER_ABORT, "rx - user abort"},
- {ARLA_ADDRINUSE, "rx - address already in use"},
- {ARLA_MSGSIZE, "rx - packet too big"},
-
- /* Not a known error */
-
- { 0L, "Unknown error"}
-};
-
-
-
-const char *
-koerr_gettext(koerr_t err)
-{
- const char *ret = NULL;
- struct koerr *koerror = koerrmsg;
-
- while (koerror->code != 0) {
- if (err == koerror->code)
- break;
- ++koerror;
- }
-
- if (koerror->code == 0)
- ret = strerror(err);
- if (!ret)
- ret = koerror->msg;
-
- return ret;
-}
diff --git a/usr.sbin/afs/src/lib/ko/kotest.c b/usr.sbin/afs/src/lib/ko/kotest.c
deleted file mode 100644
index d4aa5fe93e2..00000000000
--- a/usr.sbin/afs/src/lib/ko/kotest.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Test if libko works as expected
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <netinet/in.h>
-#include <err.h>
-#include <roken.h>
-#include <ko.h>
-
-RCSID("$arla: kotest.c,v 1.8 2002/10/08 23:00:10 lha Exp $");
-
-int
-main (int argc, char **argv)
-{
- const char *name;
- int ret = 0;
- Log_method *method;
-
- setprogname(argv[0]);
-
- method = log_open(getprogname(), "/dev/stderr");
- if (method == NULL)
- errx (1, "log_open failed");
- cell_init(0, method);
-
- name = cell_expand_cell ("stacken");
- if (strcmp (name, "stacken.kth.se") != 0) {
- warnx ("stacken failed");
- ret = 1;
- }
-
-
- name = cell_expand_cell ("gurkmacka");
- if (strcmp (name, "gurkmacka") != 0) {
- warnx ("gurkmacka failed");
- ret = 1;
- }
-
- return ret;
-}
diff --git a/usr.sbin/afs/src/lib/ko/misc.c b/usr.sbin/afs/src/lib/ko/misc.c
deleted file mode 100644
index eeac0c3efdc..00000000000
--- a/usr.sbin/afs/src/lib/ko/misc.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1995-2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-
-#include "ko_locl.h"
-
-RCSID("$arla: misc.c,v 1.1 2002/05/26 14:51:18 lha Exp $");
-
-/*
- * Return 0 if ``fid1'' eq ``fid2''.
- */
-
-int
-VenusFid_cmp (const VenusFid *fid1, const VenusFid *fid2)
-{
- if (fid1->Cell == fid2->Cell &&
- fid1->fid.Volume == fid2->fid.Volume &&
- fid1->fid.Vnode == fid2->fid.Vnode &&
- fid1->fid.Unique == fid2->fid.Unique)
- return 0;
- return 1;
-}
diff --git a/usr.sbin/afs/src/lib/ko/part.c b/usr.sbin/afs/src/lib/ko/part.c
deleted file mode 100644
index 8d14d1ac1e7..00000000000
--- a/usr.sbin/afs/src/lib/ko/part.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "ko_locl.h"
-
-#include "part.h"
-
-RCSID("$arla: part.c,v 1.3 2000/10/02 22:43:24 lha Exp $");
-
-/*
- * partition_num2name
- *
- * write the string of the partition number `id' in `str' (which is of
- * size `sz') and return the number of characters written.
- */
-
-int
-partition_num2name (int id, char *str, size_t sz)
-{
- if (id < 26)
- return snprintf (str, sz, "/vicep%c", 'a' + id);
- else
- return snprintf (str, sz, "/vicep%c%c",
- 'a' + id / 26 - 1, 'a' + id % 26);
-}
-
-/*
- * partition_name2num
- * convert a char string that might be a partition to a
- * number.
- *
- * returns -1 is there is an error
- *
- */
-
-int
-partition_name2num(const char *name)
-{
- int ret;
-
- if (strncmp(name, "/vicep", 6) == 0)
- name += 6;
- else if (strncmp(name, "vicep", 5) == 0)
- name += 5;
-
- if (*name == '\0')
- return -1;
-
- if(*(name+1) == '\0') {
- if(isalpha((unsigned char)*name)) {
- ret = tolower((unsigned char)*name) - 'a';
- } else
- return -1;
- } else if (name[2] == '\0') {
- if (isalpha((unsigned char)name[0])
- && isalpha((unsigned char)name[1])) {
- ret = 26 * (tolower((unsigned char)*(name)) - 'a' + 1)
- + tolower((unsigned char)*(name+1)) - 'a';
- } else
- return -1;
- } else
- return -1;
-
- if(ret > 255)
- return -1;
-
- return ret;
-}
diff --git a/usr.sbin/afs/src/lib/ko/part.h b/usr.sbin/afs/src/lib/ko/part.h
deleted file mode 100644
index 18b45a00c14..00000000000
--- a/usr.sbin/afs/src/lib/ko/part.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: part.h,v 1.2 2000/10/02 22:43:29 lha Exp $ */
-
-int partition_num2name(int id, char *str, size_t sz);
-int partition_name2num(const char *name);
diff --git a/usr.sbin/afs/src/lib/ko/ports.c b/usr.sbin/afs/src/lib/ko/ports.c
deleted file mode 100644
index 478c44f0560..00000000000
--- a/usr.sbin/afs/src/lib/ko/ports.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Take care of the port stuff.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <roken.h>
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#include <stdio.h>
-
-#include "ports.h"
-
-RCSID("$arla: ports.c,v 1.12 2001/04/22 01:23:12 lha Exp $") ;
-
-typedef struct {
- const char *name; /* Name of the service */
- const char *proto; /* Protocol */
- int *port; /* Variable with port-value */
- int defport; /* Default port */
-} Port;
-
-int afsport = 0,
- afscallbackport = 0,
- afsprport = 0,
- afsvldbport = 0,
- afskaport = 0,
- afsvolport = 0,
- afserrorsport = 0,
- afsbosport = 0,
- afsupdateport = 0,
- afsrmtsys = 0;
-
-Port ports[] = {
-{"afs3-fileserver", "udp", &afsport, 7000},
-{"afs3-callback", "udp", &afscallbackport,7001},
-{"afs3-prserver", "udp", &afsprport, 7002},
-{"afs3-vlserver", "udp", &afsvldbport, 7003},
-{"afs3-kaserver", "udp", &afskaport, 7004},
-{"afs3-volser", "udp", &afsvolport, 7005},
-{"afs3-errors", "udp", &afserrorsport, 7006},
-{"afs3-bos", "udp", &afsbosport, 7007},
-{"afs3-update", "udp", &afsupdateport, 7008},
-{"afs3-rmtsys", "udp", &afsrmtsys, 7009}
-};
-
-/*
- * Find all ports and set their values.
- */
-
-void
-ports_init (void)
-{
- static int inited = 0;
- int i;
-
- if (inited)
- return;
-
- for (i = 0; i < sizeof (ports) / sizeof (*ports); ++i) {
- struct servent *service;
-
- service = getservbyname (ports[i].name, ports[i].proto);
- if (service == NULL)
- *(ports[i].port) = ports[i].defport;
- else
- *(ports[i].port) = ntohs (service->s_port);
- }
- inited = 1;
-}
-
-/*
- * port -> name
- */
-
-const char *
-ports_num2name (int port)
-{
- int i;
-
- for (i = 0; i < sizeof (ports) / sizeof (*ports); ++i) {
-
- if (*(ports[i].port) == port)
- return ports[i].name;
- }
- return NULL;
-}
diff --git a/usr.sbin/afs/src/lib/ko/ports.h b/usr.sbin/afs/src/lib/ko/ports.h
deleted file mode 100644
index 3fa86b2e6d6..00000000000
--- a/usr.sbin/afs/src/lib/ko/ports.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: ports.h,v 1.3 2000/10/02 22:43:39 lha Exp $ */
-
-/*
- * Port numbers.
- */
-
-#ifndef _PORTS_H_
-#define _PORTS_H_
-
-extern int afsport, afscallbackport, afsprport, afsvldbport,
- afskaport, afsvolport, afserrorsport, afsbosport,
- afsupdateport, afsrmtsys;
-
-void ports_init (void);
-const char *ports_num2name(int);
-
-#endif /* _PORTS_H_ */
diff --git a/usr.sbin/afs/src/lib/ko/resnull.c b/usr.sbin/afs/src/lib/ko/resnull.c
deleted file mode 100644
index 9e6a91c9c83..00000000000
--- a/usr.sbin/afs/src/lib/ko/resnull.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* Dummy implementation of resolver api */
-
-#include "ko_locl.h"
-
-RCSID("$arla: resnull.c,v 1.1 2002/07/24 07:13:16 lha Exp $");
-
-void
-_ko_resolve_init(void)
-{
-}
-
-int
-_ko_resolve_cell(const char *cell, cell_db_entry *dbservers, int max_num,
- int *ret_num, int *lowest_ttl)
-{
- *ret_num = 0;
- return 1;
-}
-
-int
-_ko_resolve_host(const char *name, cell_db_entry *host)
-{
- return 1;
-}
diff --git a/usr.sbin/afs/src/lib/ko/resolve.c b/usr.sbin/afs/src/lib/ko/resolve.c
deleted file mode 100644
index ef3d70b2161..00000000000
--- a/usr.sbin/afs/src/lib/ko/resolve.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 1998 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* Implementation of resolver api using roken resolve.h */
-
-#include "ko_locl.h"
-
-#ifdef HAVE_ARPA_NAMESER_H
-#include <arpa/nameser.h>
-#endif
-#ifdef HAVE_RESOLV_H
-#include <resolv.h>
-#endif
-
-#include "resolve.h"
-
-RCSID("$arla: resolve.c,v 1.4 2002/07/24 08:46:48 lha Exp $");
-
-void
-_ko_resolve_init(void)
-{
-#ifdef HAVE_RES_INIT
- res_init();
-#endif
-
-}
-
-
-int
-_ko_resolve_cell(const char *cell, cell_db_entry *dbservers, int max_num,
- int *ret_num, int *lowest_ttl)
-{
- struct dns_reply *r;
- struct resource_record *rr;
- int i, dbnum;
-
- r = dns_lookup(cell, "AFSDB");
- if (r == NULL)
- return 1;
-
- dbnum = 0;
- for(rr = r->head; rr;rr=rr->next){
- if(rr->type == T_AFSDB) {
- struct mx_record *mx = (struct mx_record*)rr->u.data;
-
- if (dbnum >= max_num)
- break;
-
- if (strcasecmp(cell, rr->domain) != 0)
- continue;
-
- if (mx->preference != 1)
- continue;
-
- if (*lowest_ttl > rr->ttl)
- *lowest_ttl = rr->ttl;
- dbservers[dbnum].name = strdup (mx->domain);
- if (dbservers[dbnum].name == NULL)
- err (1, "strdup");
- dbservers[dbnum].timeout = CELL_INVALID_HOST;
- dbnum++;
- }
- }
- for(rr = r->head; rr;rr=rr->next){
- if (rr->type == T_A) {
- for (i = 0; i < dbnum; i++) {
- if (strcasecmp(dbservers[i].name,rr->domain) != 0)
- continue;
- dbservers[i].addr = *(rr->u.a);
- dbservers[i].timeout = rr->ttl;
- break;
- }
- }
- }
- dns_free_data(r);
-
- *ret_num = dbnum;
-
- return 0;
-}
-
-int
-_ko_resolve_host(const char *name, cell_db_entry *host)
-{
- struct resource_record *rr;
- struct dns_reply *r;
- int ret;
-
- r = dns_lookup(host->name, "A");
- if (r == NULL)
- return 1;
-
- ret = 1;
- for(rr = r->head; rr;rr=rr->next){
- if (rr->type == T_A && strcasecmp(host->name,rr->domain) == 0) {
- host->addr = *(rr->u.a);
- host->timeout = rr->ttl;
- ret = 0;
- break;
- }
- }
- dns_free_data(r);
- return ret;
-}
diff --git a/usr.sbin/afs/src/lib/ko/restest.c b/usr.sbin/afs/src/lib/ko/restest.c
deleted file mode 100644
index 083e49bac84..00000000000
--- a/usr.sbin/afs/src/lib/ko/restest.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "ko_locl.h"
-
-RCSID("$arla: restest.c,v 1.2 2002/07/24 21:26:22 lha Exp $");
-
-static void
-print_host(cell_db_entry *e)
-{
- printf("host: %s ttl: %d addr: %s\n",
- e->name, (int)e->timeout,
- inet_ntoa(e->addr));
-}
-
-int
-main(int argc, char **argv)
-{
- cell_db_entry dbservers[256];
- int lowest_ttl = INT_MAX;
- int ret, i, dbnum = 0;
-
- char *cell = "e.kth.se";
-
- memset(dbservers, 0, sizeof(dbservers)/sizeof(dbservers[0]));
-
- _ko_resolve_init();
-
- ret = _ko_resolve_cell(cell, dbservers,
- sizeof(dbservers)/sizeof(dbservers[0]),
- &dbnum, &lowest_ttl);
- if (ret)
- errx(1, "_ko_resolve_cell failed with %d", ret);
-
- printf("cell %s, lowest_ttl %d\n", cell, lowest_ttl);
-
- for (i = 0; i < dbnum; i++)
- print_host(&dbservers[i]);
-
-
- dbservers[0].name = strdup("anden.e.kth.se");
- if (dbservers[0].name == NULL)
- err(1, "strdup");
-
- ret = _ko_resolve_host(dbservers[0].name, &dbservers[0]);
- if (ret)
- errx(1, "_ko_resolve_host failed with %d", ret);
-
- print_host(&dbservers[0]);
-
- exit(0);
-}
diff --git a/usr.sbin/afs/src/lib/ko/reswinnt.c b/usr.sbin/afs/src/lib/ko/reswinnt.c
deleted file mode 100644
index cd7f11df1e0..00000000000
--- a/usr.sbin/afs/src/lib/ko/reswinnt.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/* Implementation of resolver api using the windows api */
-
-#include "ko_locl.h"
-
-#include <windns.h>
-
-RCSID("$arla: reswinnt.c,v 1.3 2002/07/24 17:29:24 lha Exp $");
-
-#if 0
-static HANDLE dns_handle;
-#endif
-
-void
-_ko_resolve_init(void)
-{
-#if 0
- DNS_STATUS status;
- status = DnsAcquireContextHandle_A(FALSE, NULL, &dns_handle);
-
- if (status)
- errx(1, "DnsAcquireContextHandle returned 0x%x", status);
-#endif
-}
-
-int
-_ko_resolve_cell(const char *cell, cell_db_entry *dbservers, int max_num,
- int *ret_num, int *lowest_ttl)
-{
- DNS_STATUS status;
- PDNS_RECORD *rr, *rr0;
- int i;
-
- *ret_num = 0;
-
- status = DnsQuery_A(cell, DNS_TYPE_AFSDB,
- DNS_QUERY_STANDARD|DNS_QUERY_TREAT_AS_FQDN,
- NULL, &rr0, NULL);
- if (status)
- return 1;
-
- for(rr = rr0; rr; rr = rr->pNext){
- if(rr->wType == DNS_TYPE_AFSDB) {
- DNS_MX_DATA *mx = rr->Data.MX;
-
- if (dbnum >= max_num)
- break;
-
- if (strcasecmp(host->name, rr->pName) == 0)
- continue;
-
- if (mx->wPreference != 1)
- continue;
-
- if (*lowest_ttl > rr->dwTtl)
- *lowest_ttl = rr->dwTtl;
- dbservers[dbnum].name = strdup (mx->pNameExchange);
- if (dbservers[dbnum].name == NULL)
- err (1, "strdup");
- dbservers[dbnum].timeout = CELL_INVALID_HOST;
- dbnum++;
- }
- }
- /* XXX check fo DNS_TYPE_A too */
-
- DnsRecordListFree(rr0, 0); /* XXX fix free argument */
-
- *ret_num = dbnum;
-
- return 0;
-}
-
-int
-_ko_resolve_host(const char *name, cell_db_entry *host)
-{
- DNS_STATUS status;
- PDNS_RECORD *rr, *rr0;
- int ret;
-
- status = DnsQuery_A(name, DNS_TYPE_A,
- DNS_QUERY_STANDARD|DNS_QUERY_TREAT_AS_FQDN,
- NULL, &rr0, NULL);
- if (status)
- return 1;
-
- ret = 1;
- for(rr = rr0; rr; rr = rr->pNext){
- if(rr->wType == DNS_TYPE_A && strcasecmp(host->name, rr->pName) == 0) {
- host->addr = rr->Data.A.IpAddress; /* XXX what does a IP4_ADDRESS look like ? */
- host->timeout = rr->dwTtl;
- ret = 0;
- break;
- }
- }
-
- DnsRecordListFree(rr0, 0); /* XXX fix free argument */
-
- return ret;
-}
diff --git a/usr.sbin/afs/src/lib/ko/slcompat.c b/usr.sbin/afs/src/lib/ko/slcompat.c
deleted file mode 100644
index 0374cd888b2..00000000000
--- a/usr.sbin/afs/src/lib/ko/slcompat.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "ko_locl.h"
-#include <sl.h>
-
-RCSID("$arla: slcompat.c,v 1.2 2002/09/17 15:10:50 lha Exp $");
-
-#ifdef NEED_SLCOMPAT_SL_APROPOS
-
-void
-sl_apropos (SL_cmd *, const char *);
-
-void
-sl_apropos (SL_cmd *cmd, const char *topic)
-{
- for (; cmd->name != NULL; ++cmd)
- if (cmd->usage != NULL && strstr(cmd->usage, topic) != NULL)
- printf ("%-20s%s\n", cmd->name, cmd->usage);
-}
-
-#endif /* NEED_SLCOMPAT_SL_APROPOS */
diff --git a/usr.sbin/afs/src/lib/ko/uae.c b/usr.sbin/afs/src/lib/ko/uae.c
deleted file mode 100644
index d19381aa9b4..00000000000
--- a/usr.sbin/afs/src/lib/ko/uae.c
+++ /dev/null
@@ -1,475 +0,0 @@
-/*
- * Copyright (c) 2003, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Unified AFS errnos
- *
- * The idea is that we use up the et space 'uae' and 'uaf' (512
- * entries) and use those for AFS errno's that the server can use
- * then the client supports the TellMeAboutYourself callbackmanager
- * interface.
- *
- * This implemetation builds a array at start time that we can use for
- * fast lookup of the uae error to a local errno. For those that we
- * don't support, we map them one to one (just like before uae).
- */
-
-#include "ko_locl.h"
-#ifdef RCSID
-RCSID("$arla: uae.c,v 1.5 2004/07/06 13:13:51 tol Exp $") ;
-#endif
-
-static int32_t *uae_array;
-static int uae_len;
-
-static void
-uae_set(int32_t errno_error, int32_t uae_error)
-{
- int index = uae_error - UAE_ERROR_base;
- assert(index >= 0);
- assert(index < uae_len);
- uae_array[index] = errno_error;
-}
-
-/*
- *
- */
-
-int32_t
-uae_error_to_errno(int32_t error)
-{
- if (error < UAE_ERROR_base || error - UAE_ERROR_base > uae_len)
- return error;
- return uae_array[error - UAE_ERROR_base];
-}
-
-/*
- * Initialize UAE
- */
-
-void
-uae_init (void)
-{
- int i;
-
- /* arla_warnx (ADEBCONN, "inituae"); */
-
- uae_len = 256 * 2;
- uae_array = malloc(uae_len * sizeof(uae_array[0]));
- if (uae_array == NULL)
- errx(-1, "uae_init: malloc failed\n");
-
- /* guess we have a one to one mapping */
- for (i = 0; i < uae_len; i++)
- uae_array[i] = i;
-
- /*
- perl -n -e \
- 'if (/UAE_ERROR_(\w+)/) {
- print "#ifdef $1\n uae_set($1,UAE_ERROR_$1);\n#endif\n";
- }' \
- uae.h
- */
-#ifdef base
- uae_set(base,UAE_ERROR_base);
-#endif
-#ifdef EPERM
- uae_set(EPERM,UAE_ERROR_EPERM);
-#endif
-#ifdef ENOENT
- uae_set(ENOENT,UAE_ERROR_ENOENT);
-#endif
-#ifdef ESRCH
- uae_set(ESRCH,UAE_ERROR_ESRCH);
-#endif
-#ifdef EINTR
- uae_set(EINTR,UAE_ERROR_EINTR);
-#endif
-#ifdef EIO
- uae_set(EIO,UAE_ERROR_EIO);
-#endif
-#ifdef ENXIO
- uae_set(ENXIO,UAE_ERROR_ENXIO);
-#endif
-#ifdef E2BIG
- uae_set(E2BIG,UAE_ERROR_E2BIG);
-#endif
-#ifdef ENOEXEC
- uae_set(ENOEXEC,UAE_ERROR_ENOEXEC);
-#endif
-#ifdef EBADF
- uae_set(EBADF,UAE_ERROR_EBADF);
-#endif
-#ifdef ECHILD
- uae_set(ECHILD,UAE_ERROR_ECHILD);
-#endif
-#ifdef EAGAIN
- uae_set(EAGAIN,UAE_ERROR_EAGAIN);
-#endif
-#ifdef ENOMEM
- uae_set(ENOMEM,UAE_ERROR_ENOMEM);
-#endif
-#ifdef EACCES
- uae_set(EACCES,UAE_ERROR_EACCES);
-#endif
-#ifdef EFAULT
- uae_set(EFAULT,UAE_ERROR_EFAULT);
-#endif
-#ifdef ENOTBLK
- uae_set(ENOTBLK,UAE_ERROR_ENOTBLK);
-#endif
-#ifdef EBUSY
- uae_set(EBUSY,UAE_ERROR_EBUSY);
-#endif
-#ifdef EEXIST
- uae_set(EEXIST,UAE_ERROR_EEXIST);
-#endif
-#ifdef EXDEV
- uae_set(EXDEV,UAE_ERROR_EXDEV);
-#endif
-#ifdef ENODEV
- uae_set(ENODEV,UAE_ERROR_ENODEV);
-#endif
-#ifdef ENOTDIR
- uae_set(ENOTDIR,UAE_ERROR_ENOTDIR);
-#endif
-#ifdef EISDIR
- uae_set(EISDIR,UAE_ERROR_EISDIR);
-#endif
-#ifdef EINVAL
- uae_set(EINVAL,UAE_ERROR_EINVAL);
-#endif
-#ifdef ENFILE
- uae_set(ENFILE,UAE_ERROR_ENFILE);
-#endif
-#ifdef EMFILE
- uae_set(EMFILE,UAE_ERROR_EMFILE);
-#endif
-#ifdef ENOTTY
- uae_set(ENOTTY,UAE_ERROR_ENOTTY);
-#endif
-#ifdef ETXTBSY
- uae_set(ETXTBSY,UAE_ERROR_ETXTBSY);
-#endif
-#ifdef EFBIG
- uae_set(EFBIG,UAE_ERROR_EFBIG);
-#endif
-#ifdef ENOSPC
- uae_set(ENOSPC,UAE_ERROR_ENOSPC);
-#endif
-#ifdef ESPIPE
- uae_set(ESPIPE,UAE_ERROR_ESPIPE);
-#endif
-#ifdef EROFS
- uae_set(EROFS,UAE_ERROR_EROFS);
-#endif
-#ifdef EMLINK
- uae_set(EMLINK,UAE_ERROR_EMLINK);
-#endif
-#ifdef EPIPE
- uae_set(EPIPE,UAE_ERROR_EPIPE);
-#endif
-#ifdef EDOM
- uae_set(EDOM,UAE_ERROR_EDOM);
-#endif
-#ifdef ERANGE
- uae_set(ERANGE,UAE_ERROR_ERANGE);
-#endif
-#ifdef EDEADLK
- uae_set(EDEADLK,UAE_ERROR_EDEADLK);
-#endif
-#ifdef ENAMETOOLONG
- uae_set(ENAMETOOLONG,UAE_ERROR_ENAMETOOLONG);
-#endif
-#ifdef ENOLCK
- uae_set(ENOLCK,UAE_ERROR_ENOLCK);
-#endif
-#ifdef ENOSYS
- uae_set(ENOSYS,UAE_ERROR_ENOSYS);
-#endif
-#ifdef ENOTEMPTY
- uae_set(ENOTEMPTY,UAE_ERROR_ENOTEMPTY);
-#endif
-#ifdef ELOOP
- uae_set(ELOOP,UAE_ERROR_ELOOP);
-#endif
-#ifdef EWOULDBLOCK
- uae_set(EWOULDBLOCK,UAE_ERROR_EWOULDBLOCK);
-#endif
-#ifdef ENOMSG
- uae_set(ENOMSG,UAE_ERROR_ENOMSG);
-#endif
-#ifdef EIDRM
- uae_set(EIDRM,UAE_ERROR_EIDRM);
-#endif
-#ifdef ECHRNG
- uae_set(ECHRNG,UAE_ERROR_ECHRNG);
-#endif
-#ifdef EL2NSYNC
- uae_set(EL2NSYNC,UAE_ERROR_EL2NSYNC);
-#endif
-#ifdef EL3HLT
- uae_set(EL3HLT,UAE_ERROR_EL3HLT);
-#endif
-#ifdef EL3RST
- uae_set(EL3RST,UAE_ERROR_EL3RST);
-#endif
-#ifdef ELNRNG
- uae_set(ELNRNG,UAE_ERROR_ELNRNG);
-#endif
-#ifdef EUNATCH
- uae_set(EUNATCH,UAE_ERROR_EUNATCH);
-#endif
-#ifdef ENOCSI
- uae_set(ENOCSI,UAE_ERROR_ENOCSI);
-#endif
-#ifdef EL2HLT
- uae_set(EL2HLT,UAE_ERROR_EL2HLT);
-#endif
-#ifdef EBADE
- uae_set(EBADE,UAE_ERROR_EBADE);
-#endif
-#ifdef EBADR
- uae_set(EBADR,UAE_ERROR_EBADR);
-#endif
-#ifdef EXFULL
- uae_set(EXFULL,UAE_ERROR_EXFULL);
-#endif
-#ifdef ENOANO
- uae_set(ENOANO,UAE_ERROR_ENOANO);
-#endif
-#ifdef EBADRQC
- uae_set(EBADRQC,UAE_ERROR_EBADRQC);
-#endif
-#ifdef EBADSLT
- uae_set(EBADSLT,UAE_ERROR_EBADSLT);
-#endif
-#ifdef EBFONT
- uae_set(EBFONT,UAE_ERROR_EBFONT);
-#endif
-#ifdef ENOSTR
- uae_set(ENOSTR,UAE_ERROR_ENOSTR);
-#endif
-#ifdef ENODATA
- uae_set(ENODATA,UAE_ERROR_ENODATA);
-#endif
-#ifdef ETIME
- uae_set(ETIME,UAE_ERROR_ETIME);
-#endif
-#ifdef ENOSR
- uae_set(ENOSR,UAE_ERROR_ENOSR);
-#endif
-#ifdef ENONET
- uae_set(ENONET,UAE_ERROR_ENONET);
-#endif
-#ifdef ENOPKG
- uae_set(ENOPKG,UAE_ERROR_ENOPKG);
-#endif
-#ifdef EREMOTE
- uae_set(EREMOTE,UAE_ERROR_EREMOTE);
-#endif
-#ifdef ENOLINK
- uae_set(ENOLINK,UAE_ERROR_ENOLINK);
-#endif
-#ifdef EADV
- uae_set(EADV,UAE_ERROR_EADV);
-#endif
-#ifdef ESRMNT
- uae_set(ESRMNT,UAE_ERROR_ESRMNT);
-#endif
-#ifdef ECOMM
- uae_set(ECOMM,UAE_ERROR_ECOMM);
-#endif
-#ifdef EPROTO
- uae_set(EPROTO,UAE_ERROR_EPROTO);
-#endif
-#ifdef EMULTIHOP
- uae_set(EMULTIHOP,UAE_ERROR_EMULTIHOP);
-#endif
-#ifdef EDOTDOT
- uae_set(EDOTDOT,UAE_ERROR_EDOTDOT);
-#endif
-#ifdef EBADMSG
- uae_set(EBADMSG,UAE_ERROR_EBADMSG);
-#endif
-#ifdef EOVERFLOW
- uae_set(EOVERFLOW,UAE_ERROR_EOVERFLOW);
-#endif
-#ifdef ENOTUNIQ
- uae_set(ENOTUNIQ,UAE_ERROR_ENOTUNIQ);
-#endif
-#ifdef EBADFD
- uae_set(EBADFD,UAE_ERROR_EBADFD);
-#endif
-#ifdef EREMCHG
- uae_set(EREMCHG,UAE_ERROR_EREMCHG);
-#endif
-#ifdef ELIBACC
- uae_set(ELIBACC,UAE_ERROR_ELIBACC);
-#endif
-#ifdef ELIBBAD
- uae_set(ELIBBAD,UAE_ERROR_ELIBBAD);
-#endif
-#ifdef ELIBSCN
- uae_set(ELIBSCN,UAE_ERROR_ELIBSCN);
-#endif
-#ifdef ELIBMAX
- uae_set(ELIBMAX,UAE_ERROR_ELIBMAX);
-#endif
-#ifdef ELIBEXEC
- uae_set(ELIBEXEC,UAE_ERROR_ELIBEXEC);
-#endif
-#ifdef EILSEQ
- uae_set(EILSEQ,UAE_ERROR_EILSEQ);
-#endif
-#ifdef ERESTART
- uae_set(ERESTART,UAE_ERROR_ERESTART);
-#endif
-#ifdef ESTRPIPE
- uae_set(ESTRPIPE,UAE_ERROR_ESTRPIPE);
-#endif
-#ifdef EUSERS
- uae_set(EUSERS,UAE_ERROR_EUSERS);
-#endif
-#ifdef ENOTSOCK
- uae_set(ENOTSOCK,UAE_ERROR_ENOTSOCK);
-#endif
-#ifdef EDESTADDRREQ
- uae_set(EDESTADDRREQ,UAE_ERROR_EDESTADDRREQ);
-#endif
-#ifdef EMSGSIZE
- uae_set(EMSGSIZE,UAE_ERROR_EMSGSIZE);
-#endif
-#ifdef EPROTOTYPE
- uae_set(EPROTOTYPE,UAE_ERROR_EPROTOTYPE);
-#endif
-#ifdef ENOPROTOOPT
- uae_set(ENOPROTOOPT,UAE_ERROR_ENOPROTOOPT);
-#endif
-#ifdef EPROTONOSUPPORT
- uae_set(EPROTONOSUPPORT,UAE_ERROR_EPROTONOSUPPORT);
-#endif
-#ifdef ESOCKTNOSUPPORT
- uae_set(ESOCKTNOSUPPORT,UAE_ERROR_ESOCKTNOSUPPORT);
-#endif
-#ifdef EOPNOTSUPP
- uae_set(EOPNOTSUPP,UAE_ERROR_EOPNOTSUPP);
-#endif
-#ifdef EPFNOSUPPORT
- uae_set(EPFNOSUPPORT,UAE_ERROR_EPFNOSUPPORT);
-#endif
-#ifdef EAFNOSUPPORT
- uae_set(EAFNOSUPPORT,UAE_ERROR_EAFNOSUPPORT);
-#endif
-#ifdef EADDRINUSE
- uae_set(EADDRINUSE,UAE_ERROR_EADDRINUSE);
-#endif
-#ifdef EADDRNOTAVAIL
- uae_set(EADDRNOTAVAIL,UAE_ERROR_EADDRNOTAVAIL);
-#endif
-#ifdef ENETDOWN
- uae_set(ENETDOWN,UAE_ERROR_ENETDOWN);
-#endif
-#ifdef ENETUNREACH
- uae_set(ENETUNREACH,UAE_ERROR_ENETUNREACH);
-#endif
-#ifdef ENETRESET
- uae_set(ENETRESET,UAE_ERROR_ENETRESET);
-#endif
-#ifdef ECONNABORTED
- uae_set(ECONNABORTED,UAE_ERROR_ECONNABORTED);
-#endif
-#ifdef ECONNRESET
- uae_set(ECONNRESET,UAE_ERROR_ECONNRESET);
-#endif
-#ifdef ENOBUFS
- uae_set(ENOBUFS,UAE_ERROR_ENOBUFS);
-#endif
-#ifdef EISCONN
- uae_set(EISCONN,UAE_ERROR_EISCONN);
-#endif
-#ifdef ENOTCONN
- uae_set(ENOTCONN,UAE_ERROR_ENOTCONN);
-#endif
-#ifdef ESHUTDOWN
- uae_set(ESHUTDOWN,UAE_ERROR_ESHUTDOWN);
-#endif
-#ifdef ETOOMANYREFS
- uae_set(ETOOMANYREFS,UAE_ERROR_ETOOMANYREFS);
-#endif
-#ifdef ETIMEDOUT
- uae_set(ETIMEDOUT,UAE_ERROR_ETIMEDOUT);
-#endif
-#ifdef ECONNREFUSED
- uae_set(ECONNREFUSED,UAE_ERROR_ECONNREFUSED);
-#endif
-#ifdef EHOSTDOWN
- uae_set(EHOSTDOWN,UAE_ERROR_EHOSTDOWN);
-#endif
-#ifdef EHOSTUNREACH
- uae_set(EHOSTUNREACH,UAE_ERROR_EHOSTUNREACH);
-#endif
-#ifdef EALREADY
- uae_set(EALREADY,UAE_ERROR_EALREADY);
-#endif
-#ifdef EINPROGRESS
- uae_set(EINPROGRESS,UAE_ERROR_EINPROGRESS);
-#endif
-#ifdef ESTALE
- uae_set(ESTALE,UAE_ERROR_ESTALE);
-#endif
-#ifdef EUCLEAN
- uae_set(EUCLEAN,UAE_ERROR_EUCLEAN);
-#endif
-#ifdef ENOTNAM
- uae_set(ENOTNAM,UAE_ERROR_ENOTNAM);
-#endif
-#ifdef ENAVAIL
- uae_set(ENAVAIL,UAE_ERROR_ENAVAIL);
-#endif
-#ifdef EISNAM
- uae_set(EISNAM,UAE_ERROR_EISNAM);
-#endif
-#ifdef EREMOTEIO
- uae_set(EREMOTEIO,UAE_ERROR_EREMOTEIO);
-#endif
-#ifdef EDQUOT
- uae_set(EDQUOT,UAE_ERROR_EDQUOT);
-#endif
-#ifdef ENOMEDIUM
- uae_set(ENOMEDIUM,UAE_ERROR_ENOMEDIUM);
-#endif
-#ifdef EMEDIUMTYPE
- uae_set(EMEDIUMTYPE,UAE_ERROR_EMEDIUMTYPE);
-#endif
-}
diff --git a/usr.sbin/afs/src/lib/ko/uae.h b/usr.sbin/afs/src/lib/ko/uae.h
deleted file mode 100644
index 5bbb9369afe..00000000000
--- a/usr.sbin/afs/src/lib/ko/uae.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (c) 2003, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/* $arla: uae.h,v 1.4 2003/03/10 01:57:16 lha Exp $ */
-
-/*
- * Unified AFS errnos
- */
-
-#ifndef UAE_HEADER_H
-#define UAE_HEADER_H 1
-
-#define UAE_ERROR_base 49733376
-#define UAE_ERROR_EPERM (UAE_ERROR_base + 1)
-#define UAE_ERROR_ENOENT (UAE_ERROR_base + 2)
-#define UAE_ERROR_ESRCH (UAE_ERROR_base + 3)
-#define UAE_ERROR_EINTR (UAE_ERROR_base + 4)
-#define UAE_ERROR_EIO (UAE_ERROR_base + 5)
-#define UAE_ERROR_ENXIO (UAE_ERROR_base + 6)
-#define UAE_ERROR_E2BIG (UAE_ERROR_base + 7)
-#define UAE_ERROR_ENOEXEC (UAE_ERROR_base + 8)
-#define UAE_ERROR_EBADF (UAE_ERROR_base + 9)
-#define UAE_ERROR_ECHILD (UAE_ERROR_base + 10)
-#define UAE_ERROR_EAGAIN (UAE_ERROR_base + 11)
-#define UAE_ERROR_ENOMEM (UAE_ERROR_base + 12)
-#define UAE_ERROR_EACCES (UAE_ERROR_base + 13)
-#define UAE_ERROR_EFAULT (UAE_ERROR_base + 14)
-#define UAE_ERROR_ENOTBLK (UAE_ERROR_base + 15)
-#define UAE_ERROR_EBUSY (UAE_ERROR_base + 16)
-#define UAE_ERROR_EEXIST (UAE_ERROR_base + 17)
-#define UAE_ERROR_EXDEV (UAE_ERROR_base + 18)
-#define UAE_ERROR_ENODEV (UAE_ERROR_base + 19)
-#define UAE_ERROR_ENOTDIR (UAE_ERROR_base + 20)
-#define UAE_ERROR_EISDIR (UAE_ERROR_base + 21)
-#define UAE_ERROR_EINVAL (UAE_ERROR_base + 22)
-#define UAE_ERROR_ENFILE (UAE_ERROR_base + 23)
-#define UAE_ERROR_EMFILE (UAE_ERROR_base + 24)
-#define UAE_ERROR_ENOTTY (UAE_ERROR_base + 25)
-#define UAE_ERROR_ETXTBSY (UAE_ERROR_base + 26)
-#define UAE_ERROR_EFBIG (UAE_ERROR_base + 27)
-#define UAE_ERROR_ENOSPC (UAE_ERROR_base + 28)
-#define UAE_ERROR_ESPIPE (UAE_ERROR_base + 29)
-#define UAE_ERROR_EROFS (UAE_ERROR_base + 30)
-#define UAE_ERROR_EMLINK (UAE_ERROR_base + 31)
-#define UAE_ERROR_EPIPE (UAE_ERROR_base + 32)
-#define UAE_ERROR_EDOM (UAE_ERROR_base + 33)
-#define UAE_ERROR_ERANGE (UAE_ERROR_base + 34)
-#define UAE_ERROR_EDEADLK (UAE_ERROR_base + 35)
-#define UAE_ERROR_ENAMETOOLONG (UAE_ERROR_base + 36)
-#define UAE_ERROR_ENOLCK (UAE_ERROR_base + 37)
-#define UAE_ERROR_ENOSYS (UAE_ERROR_base + 38)
-#define UAE_ERROR_ENOTEMPTY (UAE_ERROR_base + 39)
-#define UAE_ERROR_ELOOP (UAE_ERROR_base + 40)
-#define UAE_ERROR_EWOULDBLOCK (UAE_ERROR_base + 41)
-#define UAE_ERROR_ENOMSG (UAE_ERROR_base + 42)
-#define UAE_ERROR_EIDRM (UAE_ERROR_base + 43)
-#define UAE_ERROR_ECHRNG (UAE_ERROR_base + 44)
-#define UAE_ERROR_EL2NSYNC (UAE_ERROR_base + 45)
-#define UAE_ERROR_EL3HLT (UAE_ERROR_base + 46)
-#define UAE_ERROR_EL3RST (UAE_ERROR_base + 47)
-#define UAE_ERROR_ELNRNG (UAE_ERROR_base + 48)
-#define UAE_ERROR_EUNATCH (UAE_ERROR_base + 49)
-#define UAE_ERROR_ENOCSI (UAE_ERROR_base + 50)
-#define UAE_ERROR_EL2HLT (UAE_ERROR_base + 51)
-#define UAE_ERROR_EBADE (UAE_ERROR_base + 52)
-#define UAE_ERROR_EBADR (UAE_ERROR_base + 53)
-#define UAE_ERROR_EXFULL (UAE_ERROR_base + 54)
-#define UAE_ERROR_ENOANO (UAE_ERROR_base + 55)
-#define UAE_ERROR_EBADRQC (UAE_ERROR_base + 56)
-#define UAE_ERROR_EBADSLT (UAE_ERROR_base + 57)
-#define UAE_ERROR_EBFONT (UAE_ERROR_base + 58)
-#define UAE_ERROR_ENOSTR (UAE_ERROR_base + 59)
-#define UAE_ERROR_ENODATA (UAE_ERROR_base + 60)
-#define UAE_ERROR_ETIME (UAE_ERROR_base + 61)
-#define UAE_ERROR_ENOSR (UAE_ERROR_base + 62)
-#define UAE_ERROR_ENONET (UAE_ERROR_base + 63)
-#define UAE_ERROR_ENOPKG (UAE_ERROR_base + 64)
-#define UAE_ERROR_EREMOTE (UAE_ERROR_base + 65)
-#define UAE_ERROR_ENOLINK (UAE_ERROR_base + 66)
-#define UAE_ERROR_EADV (UAE_ERROR_base + 67)
-#define UAE_ERROR_ESRMNT (UAE_ERROR_base + 68)
-#define UAE_ERROR_ECOMM (UAE_ERROR_base + 69)
-#define UAE_ERROR_EPROTO (UAE_ERROR_base + 70)
-#define UAE_ERROR_EMULTIHOP (UAE_ERROR_base + 71)
-#define UAE_ERROR_EDOTDOT (UAE_ERROR_base + 72)
-#define UAE_ERROR_EBADMSG (UAE_ERROR_base + 73)
-#define UAE_ERROR_EOVERFLOW (UAE_ERROR_base + 74)
-#define UAE_ERROR_ENOTUNIQ (UAE_ERROR_base + 75)
-#define UAE_ERROR_EBADFD (UAE_ERROR_base + 76)
-#define UAE_ERROR_EREMCHG (UAE_ERROR_base + 77)
-#define UAE_ERROR_ELIBACC (UAE_ERROR_base + 78)
-#define UAE_ERROR_ELIBBAD (UAE_ERROR_base + 79)
-#define UAE_ERROR_ELIBSCN (UAE_ERROR_base + 80)
-#define UAE_ERROR_ELIBMAX (UAE_ERROR_base + 81)
-#define UAE_ERROR_ELIBEXEC (UAE_ERROR_base + 82)
-#define UAE_ERROR_EILSEQ (UAE_ERROR_base + 83)
-#define UAE_ERROR_ERESTART (UAE_ERROR_base + 84)
-#define UAE_ERROR_ESTRPIPE (UAE_ERROR_base + 85)
-#define UAE_ERROR_EUSERS (UAE_ERROR_base + 86)
-#define UAE_ERROR_ENOTSOCK (UAE_ERROR_base + 87)
-#define UAE_ERROR_EDESTADDRREQ (UAE_ERROR_base + 88)
-#define UAE_ERROR_EMSGSIZE (UAE_ERROR_base + 89)
-#define UAE_ERROR_EPROTOTYPE (UAE_ERROR_base + 90)
-#define UAE_ERROR_ENOPROTOOPT (UAE_ERROR_base + 91)
-#define UAE_ERROR_EPROTONOSUPPORT (UAE_ERROR_base + 92)
-#define UAE_ERROR_ESOCKTNOSUPPORT (UAE_ERROR_base + 93)
-#define UAE_ERROR_EOPNOTSUPP (UAE_ERROR_base + 94)
-#define UAE_ERROR_EPFNOSUPPORT (UAE_ERROR_base + 95)
-#define UAE_ERROR_EAFNOSUPPORT (UAE_ERROR_base + 96)
-#define UAE_ERROR_EADDRINUSE (UAE_ERROR_base + 97)
-#define UAE_ERROR_EADDRNOTAVAIL (UAE_ERROR_base + 98)
-#define UAE_ERROR_ENETDOWN (UAE_ERROR_base + 99)
-#define UAE_ERROR_ENETUNREACH (UAE_ERROR_base + 100)
-#define UAE_ERROR_ENETRESET (UAE_ERROR_base + 101)
-#define UAE_ERROR_ECONNABORTED (UAE_ERROR_base + 102)
-#define UAE_ERROR_ECONNRESET (UAE_ERROR_base + 103)
-#define UAE_ERROR_ENOBUFS (UAE_ERROR_base + 104)
-#define UAE_ERROR_EISCONN (UAE_ERROR_base + 105)
-#define UAE_ERROR_ENOTCONN (UAE_ERROR_base + 106)
-#define UAE_ERROR_ESHUTDOWN (UAE_ERROR_base + 107)
-#define UAE_ERROR_ETOOMANYREFS (UAE_ERROR_base + 108)
-#define UAE_ERROR_ETIMEDOUT (UAE_ERROR_base + 109)
-#define UAE_ERROR_ECONNREFUSED (UAE_ERROR_base + 110)
-#define UAE_ERROR_EHOSTDOWN (UAE_ERROR_base + 111)
-#define UAE_ERROR_EHOSTUNREACH (UAE_ERROR_base + 112)
-#define UAE_ERROR_EALREADY (UAE_ERROR_base + 113)
-#define UAE_ERROR_EINPROGRESS (UAE_ERROR_base + 114)
-#define UAE_ERROR_ESTALE (UAE_ERROR_base + 115)
-#define UAE_ERROR_EUCLEAN (UAE_ERROR_base + 116)
-#define UAE_ERROR_ENOTNAM (UAE_ERROR_base + 117)
-#define UAE_ERROR_ENAVAIL (UAE_ERROR_base + 118)
-#define UAE_ERROR_EISNAM (UAE_ERROR_base + 119)
-#define UAE_ERROR_EREMOTEIO (UAE_ERROR_base + 120)
-#define UAE_ERROR_EDQUOT (UAE_ERROR_base + 121)
-#define UAE_ERROR_ENOMEDIUM (UAE_ERROR_base + 122)
-#define UAE_ERROR_EMEDIUMTYPE (UAE_ERROR_base + 123)
-
-#define AUF_ERROR_base 49733632
-
-void uae_init (void);
-int32_t uae_error_to_errno (int32_t);
-
-#endif /* UAE_HEADER_H */
diff --git a/usr.sbin/afs/src/lib/ko/vlmisc.c b/usr.sbin/afs/src/lib/ko/vlmisc.c
deleted file mode 100644
index 71044fbc65f..00000000000
--- a/usr.sbin/afs/src/lib/ko/vlmisc.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright (c) 1999 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "ko_locl.h"
-#include <volumeserver.h>
-
-RCSID("$arla: vlmisc.c,v 1.6 2002/05/25 19:12:31 lha Exp $");
-
-/*
- * Convert old style vldbentry `old` to newer vldbNentry style `new'
- */
-
-void
-vldb2vldbN (const vldbentry *old, nvldbentry *new)
-{
- int i;
-
- strlcpy (new->name, old->name, VLDB_MAXNAMELEN);
- if (old->nServers > MAXNSERVERS)
- new->nServers = MAXNSERVERS;
- else
- new->nServers = old->nServers;
-
- for (i = 0; i < new->nServers ; i++) {
- new->serverNumber[i] = old->serverNumber[i];
- new->serverPartition[i] = old->serverPartition[i];
- new->serverFlags[i] = old->serverFlags[i];
- }
- for (i = 0; i < MAXTYPES ; i++)
- new->volumeId[i] = old->volumeId[i];
- new->cloneId = old->cloneId;
- new->flags = old->flags;
-}
-
-void
-volintInfo2xvolintInfo (const volintInfo *old, xvolintInfo *new)
-{
- memset (new, 0, sizeof(*new));
- strlcpy (new->name, old->name, sizeof(new->name));
- new->volid = old->volid;
- new->type = old->type;
- new->backupID = old->backupID;
- new->parentID = old->parentID;
- new->cloneID = old->cloneID;
- new->status = old->status;
- new->copyDate = old->copyDate;
- new->inUse = old->inUse;
- new->creationDate = old->creationDate;
- new->accessDate = old->accessDate;
- new->updateDate = old->updateDate;
- new->backupDate = old->backupDate;
- new->dayUse = old->dayUse;
- new->filecount = old->filecount;
- new->maxquota = old->maxquota;
- new->size = old->size;
-}
-
-/*
- * Suffixes for volume names.
- */
-
-static char *volsuffixes[] = {
-"", /* RWVOL */
-".readonly", /* ROVOL */
-".backup" /* BACKVOL */
-};
-
-/*
- * canonicalize `volname' and return type of volume
- */
-
-int
-volname_canonicalize (char *volname)
-{
- int i;
- int type = RWVOL;
-
- for (i = 0; i < MAXTYPES; ++i) {
- char *p = strrchr (volname, '.');
- if (p != NULL && strcmp(p, volsuffixes[i]) == 0) {
- *p = '\0';
- type = i;
- break;
- }
- }
- return type;
-}
-
-/*
- * make specific volume name
- */
-
-size_t
-volname_specific (const char *volname, int type, char *buf, size_t buf_sz)
-{
- assert (type >= 0 && type < MAXTYPES);
-
- return snprintf (buf, buf_sz, "%s%s", volname, volsuffixes[type]);
-}
-
-
-/*
- * get volume suffix
- */
-
-const char *
-volname_suffix (int type)
-{
- assert (type >= 0 && type < MAXTYPES);
-
- return volsuffixes[type];
-}
-
-
-char *
-vol_getopname(int32_t op, char *str, size_t sz)
-{
- op &= VLOP_ALLOPERS;
-
- switch(op) {
- case VLOP_MOVE:
- strlcpy(str, "move", sz);
- break;
- case VLOP_RELEASE:
- strlcpy(str, "release", sz);
- break;
- case VLOP_BACKUP:
- strlcpy(str, "backup", sz);
- break;
- case VLOP_DELETE:
- strlcpy(str, "delete", sz);
- break;
- case VLOP_DUMP:
- strlcpy(str, "dump", sz);
- break;
- default:
- snprintf(str, sz, "unknown flag %x\n", op);
- break;
- }
- return str;
-}
-
-/*
- * Print the first of RW, RO, or BACKUP that there's a clone of
- * according to serverFlag.
- */
-
-const char *
-volumetype_from_serverflag(int32_t flag)
-{
- const char *str;
-
- if (flag & VLSF_RWVOL)
- str = "RW";
- else if (flag & VLSF_ROVOL)
- str = "RO";
- else if (flag & VLSF_ROVOL)
- str = "RO";
- else if (flag & VLSF_BACKVOL)
- str = "BACKUP";
- else
- str = "<unknown>";
-
- return str;
-}
-
-/*
- * Convert a volume `type' to a string.
- */
-
-const char *
-volumetype_from_volsertype(int32_t type)
-{
- const char *str;
-
- switch (type) {
- case RWVOL:
- str = "RW";
- break;
- case ROVOL:
- str = "RO";
- break;
- case BACKVOL:
- str = "BK";
- break;
- default:
- str = "<unknown>";
- }
- return str;
-}
diff --git a/usr.sbin/afs/src/lib/sl/ChangeLog b/usr.sbin/afs/src/lib/sl/ChangeLog
deleted file mode 100644
index 702c19dadda..00000000000
--- a/usr.sbin/afs/src/lib/sl/ChangeLog
+++ /dev/null
@@ -1,156 +0,0 @@
-2003-02-01 Love <lha@stacken.kth.se>
-
- * sl.c: use getprogname() not __progname
-
-2002-12-07 Love <lha@stacken.kth.se>
-
- * Makefile.am: INCLUDES += COMERR_CPPFLAGS
-
-2000-12-21 Love <lha@stacken.kth.se>
-
- * Makefile.in: added @LIBS@ to program built localy
-
-2000-09-19 Love <lha@stacken.kth.se>
-
- * Makefile.in (clean): remove symlinks
-
-2000-06-17 Assar Westerlund <assar@sics.se>
-
- * ss.c: look for com_err.h in more places
-
-2000-05-01 Harald Barth <haba@pdc.kth.se>
-
- * Makefile.in: ln -s gets upset if the (target) file exists
-
-2000-03-10 Love <lha@s3.kth.se>
-
- * Makefile.in (KRB4_INC_FLAGS): add, since sl/ss uses com_err
-
-2000-03-07 Assar Westerlund <assar@sics.se>
-
- * sl.h (SL_BADCOMMAND): define
- (sl_apropos): add prototype
-
- * sl.c: mandoc-generation
- (sl_apropos): stolen from arla
-
-2000-01-06 Assar Westerlund <assar@sics.se>
-
- * Makefile.am: bump both versions to 0:1:0
-
-1999-12-16 Assar Westerlund <assar@sics.se>
-
- * parse.y (name2number): not used here. remove.
-
-Thu Apr 1 17:03:59 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * make_cmds.c: use getarg
-
-Tue Mar 23 14:36:21 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.am: don't rename
-
-Sun Mar 21 14:13:29 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.am: don't roken-rename
-
-Sat Mar 20 03:43:30 1999 Assar Westerlund <assar@sics.se>
-
- * parse.y: replace return with YYACCEPT
-
-Fri Mar 19 14:53:20 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.am: add libss; add version-info
-
-Thu Mar 18 15:07:06 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.am: clean lex.c parse.c parse.h
-
- * Makefile.am: install ss.h
-
- * Makefile.am: include Makefile.am.common
-
-Thu Mar 11 15:01:01 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * parse.y: prototype for error_message
-
-Tue Feb 9 23:45:37 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.in: add snprintf.o to make_cmds
-
-Sun Nov 22 10:46:23 1998 Assar Westerlund <assar@sics.se>
-
- * sl.c (sl_command_loop): remove unused variable
-
- * ss.c (ss_error): remove unused variable
-
- * make_cmds.c: include err.h
- (main): remove unused variable
-
- * Makefile.in (WFLAGS): set
-
-Sun Sep 27 01:28:21 1998 Assar Westerlund <assar@sics.se>
-
- * make_cmds.c: clean-up and simplification
-
-Mon May 25 02:54:13 1998 Assar Westerlund <assar@sics.se>
-
- * Makefile.in (clean): try to remove shared library debris
-
- * Makefile.in: make symlink magic work
-
-Sun Apr 19 10:00:26 1998 Assar Westerlund <assar@sics.se>
-
- * Makefile.in: add symlink magic for linux
-
-Sun Apr 5 09:21:43 1998 Assar Westerlund <assar@sics.se>
-
- * parse.y: define alloca to malloc in case we're using bison but
- don't have alloca
-
-Sat Mar 28 11:39:00 1998 Assar Westerlund <assar@sics.se>
-
- * sl.c (sl_loop): s/2/1
-
-Sat Mar 21 00:46:51 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * sl.c (sl_loop): check that there is at least one argument before
- calling sl_command
-
-Sun Mar 1 05:14:37 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * sl.c (sl_loop): Fix general broken-ness.
-
- * sl.c: Cleanup printing of help strings.
-
-Thu Feb 26 02:22:02 1998 Assar Westerlund <assar@sics.se>
-
- * Makefile.am: @LEXLIB@
-
-Sat Feb 21 15:18:21 1998 assar westerlund <assar@sics.se>
-
- * Makefile.in: set YACC and LEX
-
-Mon Feb 16 16:08:25 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * Makefile.am: Some fixes for ss/mk_cmds.
-
-Sun Feb 15 05:12:11 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * Makefile.in: Install libsl under the `libss' name too. Install
- mk_cmds, and ss.h.
-
- * make_cmds.c: A mk_cmds clone that creates SL structures.
-
- * ss.c: SS compatibility functions.
-
- * sl.c: Move command line split to function `sl_make_argv'.
-
-Tue Feb 3 16:45:44 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * sl.c: Add sl_command_loop, that is the loop body of sl_loop.
-
-Mon Oct 20 01:13:21 1997 Assar Westerlund <assar@sics.se>
-
- * sl.c (sl_help): actually use the `help' field of `SL_cmd'
-
diff --git a/usr.sbin/afs/src/lib/sl/Makefile.in b/usr.sbin/afs/src/lib/sl/Makefile.in
deleted file mode 100644
index 35d4a55b7f6..00000000000
--- a/usr.sbin/afs/src/lib/sl/Makefile.in
+++ /dev/null
@@ -1,125 +0,0 @@
-#
-# $KTH: Makefile.in,v 1.14 2000/12/21 12:35:49 lha Exp $
-#
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-DEFS = @DEFS@
-CFLAGS = @CFLAGS@
-YACC = @YACC@
-LEX = @LEX@
-LN_S = @LN_S@
-LIBS = @LIBS@
-LIB_roken = @LIB_roken@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-bindir = @bindir@
-includedir = @includedir@
-
-KRB4_INC_FLAGS = @KRB4_INC_FLAGS@
-
-LIBPREFIX = lib
-LIBEXT = a
-LIBNAME = $(LIBPREFIX)sl
-sl_LIB = $(LIBNAME).$(LIBEXT)
-LIBNAME2 = $(LIBPREFIX)ss
-ss_LIB = $(LIBNAME2).$(LIBEXT)
-PROGS = mk_cmds
-
-LIB_SOURCES = sl.c ss.c
-EXTRA_SOURCES = strtok_r.c snprintf.c
-
-SOURCES = $(LIB_SOURCES) make_cmds.c $(EXTRA_SOURCES)
-
-LIBADD = strtok_r.o snprintf.o
-
-LIB_OBJECTS = sl.o ss.o $(LIBADD)
-
-mk_cmds_OBJECTS = make_cmds.o parse.o lex.o snprintf.o
-
-OBJECTS = $(LIB_OBJECTS) $(mk_cmds_OBJECTS)
-
-all: $(sl_LIB) $(PROGS)
-
-Wall:
- make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
-
-.c.o:
- $(CC) -c $(DEFS) -I../../include -I. -I$(srcdir) $(KRB4_INC_FLAGS) @INC_roken@ $(CFLAGS) $(CPPFLAGS) $(PICFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(includedir)/ss
- $(INSTALL_DATA) $(srcdir)/ss.h $(DESTDIR)$(includedir)/ss/ss.h
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
- $(INSTALL) -m 555 $(sl_LIB) $(DESTDIR)$(libdir)/$(sl_LIB)
- $(INSTALL) -m 555 $(sl_LIB) $(DESTDIR)$(libdir)/$(ss_LIB)
- $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
- $(INSTALL) -m 0555 $(PROGS) $(DESTDIR)$(bindir)/$(PROGS)
-
-uninstall:
- rm -f $(DESTDIR)$(includedir)/ss/ss.h
- rm -f $(DESTDIR)$(libdir)/$(sl_LIB) $(DESTDIR)$(libdir)/$(ss_LIB)
- rm -f $(DESTDIR)$(bindir)/$(PROGS)
-
-TAGS: $(SOURCES)
- etags $(SOURCES)
-
-check:
-
-clean:
- rm -f $(sl_LIB) $(PROGS) lex.c parse.c parse.h *.o *.a \
- strtok_r.c snprintf.c
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *~
-
-realclean: distclean
- rm -f TAGS
-
-$(LIBNAME).a: $(LIB_OBJECTS)
- rm -f $@
- $(AR) cr $@ $(LIB_OBJECTS)
- -$(RANLIB) $@
-
-$(OBJECTS): ../../include/config.h
-
-$(mk_cmds_OBJECTS): parse.h
-
-mk_cmds: $(mk_cmds_OBJECTS)
- $(CC) $(CFLAGS) -o $@ $(mk_cmds_OBJECTS) $(LIB_roken) $(LIBS)
-
-parse.c: parse.h
-parse.h: $(srcdir)/parse.y
- $(YACC) -d $(srcdir)/parse.y
- mv -f y.tab.h parse.h
- mv -f y.tab.c parse.c
-
-lex.c: $(srcdir)/lex.l
- $(LEX) $(srcdir)/lex.l
- mv -f lex.yy.c lex.c
-
-strtok_r.c:
- test -f strtok_r.c || $(LN_S) $(srcdir)/../roken/strtok_r.c .
-snprintf.c:
- test -f snprintf.c || $(LN_S) $(srcdir)/../roken/snprintf.c .
-
-Makefile: ../../config.status Makefile.in
- cd ../.. ; CONFIG_FILES=lib/sl/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-
-.PHONY: all Wall install uninstall check clean mostlyclean distclean realclean
diff --git a/usr.sbin/afs/src/lib/sl/lex.l b/usr.sbin/afs/src/lib/sl/lex.l
deleted file mode 100644
index aaadfaf0046..00000000000
--- a/usr.sbin/afs/src/lib/sl/lex.l
+++ /dev/null
@@ -1,119 +0,0 @@
-%{
-/*
- * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "make_cmds.h"
-#include "parse.h"
-
-RCSID("$arla: lex.l,v 1.3 2001/05/26 18:53:18 mattiasa Exp $");
-
-static unsigned lineno = 1;
-static int getstring(void);
-
-#define YY_NO_UNPUT
-
-#ifndef __osf__
-#undef ECHO
-#endif
-
-%}
-
-
-%%
-command_table { return TABLE; }
-request { return REQUEST; }
-unknown { return UNKNOWN; }
-unimplemented { return UNIMPLEMENTED; }
-end { return END; }
-#[^\n]* ;
-[ \t] ;
-\n { lineno++; }
-\" { return getstring(); }
-[a-zA-Z0-9_]+ { yylval.string = strdup(yytext); return STRING; }
-. { return *yytext; }
-%%
-
-#ifndef yywrap /* XXX */
-int
-yywrap ()
-{
- return 1;
-}
-#endif
-
-static int
-getstring(void)
-{
- char x[128];
- int i = 0;
- int c;
- int backslash = 0;
- while((c = input()) != EOF){
- if(backslash) {
- if(c == 'n')
- c = '\n';
- else if(c == 't')
- c = '\t';
- x[i++] = c;
- backslash = 0;
- continue;
- }
- if(c == '\n'){
- error_message("unterminated string");
- lineno++;
- break;
- }
- if(c == '\\'){
- backslash++;
- continue;
- }
- if(c == '\"')
- break;
- x[i++] = c;
- }
- x[i] = '\0';
- yylval.string = strdup(x);
- return STRING;
-}
-
-void
-error_message (const char *format, ...)
-{
- va_list args;
-
- va_start (args, format);
- fprintf (stderr, "%s:%d: ", filename, lineno);
- vfprintf (stderr, format, args);
- va_end (args);
- numerror++;
-}
diff --git a/usr.sbin/afs/src/lib/sl/make_cmds.c b/usr.sbin/afs/src/lib/sl/make_cmds.c
deleted file mode 100644
index 4368f61842e..00000000000
--- a/usr.sbin/afs/src/lib/sl/make_cmds.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Copyright (c) 1998-1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "make_cmds.h"
-#include <getarg.h>
-
-RCSID("$arla: make_cmds.c,v 1.4 2002/04/26 16:11:41 lha Exp $");
-
-#include <roken.h>
-#include <err.h>
-#include "parse.h"
-
-int numerror;
-extern FILE *yyin;
-FILE *c_file;
-
-extern void yyparse(void);
-
-#ifdef YYDEBUG
-extern int yydebug = 1;
-#endif
-
-char *filename;
-char *table_name;
-
-static struct command_list *commands;
-
-void
-add_command(char *function,
- char *help,
- struct string_list *aliases,
- unsigned flags)
-{
- struct command_list *cl = malloc(sizeof(*cl));
-
- if (cl == NULL)
- err (1, "malloc");
- cl->function = function;
- cl->help = help;
- cl->aliases = aliases;
- cl->flags = flags;
- cl->next = NULL;
- if(commands) {
- *commands->tail = cl;
- commands->tail = &cl->next;
- return;
- }
- cl->tail = &cl->next;
- commands = cl;
-}
-
-static char *
-quote(const char *str)
-{
- char buf[1024]; /* XXX */
- const char *p;
- char *q;
- q = buf;
-
- *q++ = '\"';
- for(p = str; *p != '\0'; p++) {
- if(*p == '\n') {
- *q++ = '\\';
- *q++ = 'n';
- continue;
- }
- if(*p == '\t') {
- *q++ = '\\';
- *q++ = 't';
- continue;
- }
- if(*p == '\"' || *p == '\\')
- *q++ = '\\';
- *q++ = *p;
- }
- *q++ = '\"';
- *q++ = '\0';
- return strdup(buf);
-}
-
-static void
-generate_commands(void)
-{
- char *base;
- char *cfn;
- char *p;
-
- p = strrchr(table_name, '/');
- if(p == NULL)
- p = table_name;
- else
- p++;
-
- base = strdup (p);
- if (base == NULL)
- err (1, "strdup");
-
- p = strrchr(base, '.');
- if(p)
- *p = '\0';
-
- asprintf(&cfn, "%s.c", base);
- if (cfn == NULL)
- err (1, "asprintf");
-
- c_file = fopen(cfn, "w");
- if (c_file == NULL)
- err (1, "cannot fopen %s", cfn);
-
- fprintf(c_file, "/* Generated from %s */\n", filename);
- fprintf(c_file, "\n");
- fprintf(c_file, "#include <stddef.h>\n");
- fprintf(c_file, "#include <sl.h>\n");
- fprintf(c_file, "\n");
-
- {
- struct command_list *cl, *xl;
- char *p, *q;
-
- for(cl = commands; cl; cl = cl->next) {
- for(xl = commands; xl != cl; xl = xl->next)
- if(strcmp(cl->function, xl->function) == 0)
- break;
- if(xl != cl)
- continue;
- /* XXX hack for ss_quit */
- if(strcmp(cl->function, "ss_quit") == 0) {
- fprintf(c_file, "int %s (int, char**);\n", cl->function);
- fprintf(c_file, "#define _ss_quit_wrap ss_quit\n\n");
- continue;
- }
- fprintf(c_file, "void %s (int, char**);\n", cl->function);
- fprintf(c_file, "static int _%s_wrap (int argc, char **argv)\n",
- cl->function);
- fprintf(c_file, "{\n");
- fprintf(c_file, " %s (argc, argv);\n", cl->function);
- fprintf(c_file, " return 0;\n");
- fprintf(c_file, "}\n\n");
- }
-
- fprintf(c_file, "SL_cmd %s[] = {\n", table_name);
- for(cl = commands; cl; cl = cl->next) {
- struct string_list *sl;
- sl = cl->aliases;
- p = quote(sl->string);
- q = quote(cl->help);
- fprintf(c_file, " { %s, _%s_wrap, %s },\n", p, cl->function, q);
- free(p);
- free(q);
-
- for(sl = sl->next; sl; sl = sl->next) {
- p = quote(sl->string);
- fprintf(c_file, " { %s },\n", p);
- free(p);
- }
- }
- fprintf(c_file, " { NULL },\n");
- fprintf(c_file, "};\n");
- fprintf(c_file, "\n");
- }
- fclose(c_file);
- free(base);
- free(cfn);
-}
-
-int version_flag;
-int help_flag;
-struct getargs args[] = {
- { "version", 0, arg_flag, &version_flag },
- { "help", 0, arg_flag, &help_flag },
- { NULL },
-};
-
-static void
-usage(int code)
-{
- arg_printusage(args, sizeof(args)/sizeof(*args), NULL, "command-table");
- exit(code);
-}
-
-int
-main(int argc, char **argv)
-{
- int optind = 0;
-
- setprogname(argv[0]);
- if(getarg(args, sizeof(args)/sizeof(*args), argc, argv, &optind))
- usage(1);
- if(help_flag)
- usage(0);
- if(version_flag) {
- printf ("$arla: make_cmds.c,v 1.4 2002/04/26 16:11:41 lha Exp $\n");
- exit(0);
- }
-
- if(argc == optind)
- usage(1);
- filename = argv[optind];
- yyin = fopen(filename, "r");
- if(yyin == NULL)
- err(1, "%s", filename);
-
- yyparse();
-
- generate_commands();
-
- if(numerror)
- return 1;
- return 0;
-}
diff --git a/usr.sbin/afs/src/lib/sl/make_cmds.h b/usr.sbin/afs/src/lib/sl/make_cmds.h
deleted file mode 100644
index 17efb8044fd..00000000000
--- a/usr.sbin/afs/src/lib/sl/make_cmds.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: make_cmds.h,v 1.2 2000/06/27 02:41:11 assar Exp $ */
-
-#ifndef __MAKE_CMDS_H__
-#define __MAKE_CMDS_H__
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-#include <roken.h>
-
-extern char *filename;
-extern char *table_name;
-extern int numerror;
-
-struct command_list {
- char *function;
- char *help;
- struct string_list *aliases;
- unsigned flags;
- struct command_list *next;
- struct command_list **tail;
-};
-
-struct string_list {
- char *string;
- struct string_list *next;
- struct string_list **tail;
-};
-
-void add_command(char*, char*, struct string_list*, unsigned);
-
-void error_message(const char *, ...)
- __attribute__ ((format (printf, 1,2)));
-
-int yylex (void);
-
-#endif /* __MAKE_CMDS_H__ */
diff --git a/usr.sbin/afs/src/lib/sl/parse.y b/usr.sbin/afs/src/lib/sl/parse.y
deleted file mode 100644
index 2b5a57c827f..00000000000
--- a/usr.sbin/afs/src/lib/sl/parse.y
+++ /dev/null
@@ -1,167 +0,0 @@
-%{
-/*
- * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "make_cmds.h"
-RCSID("$arla: parse.y,v 1.2 2000/06/27 02:41:12 assar Exp $");
-
-static void yyerror (char *s);
-
-struct string_list* append_string(struct string_list*, char*);
-void free_string_list(struct string_list *list);
-unsigned string_to_flag(const char *);
-
-/* This is for bison */
-
-#if !defined(alloca) && !defined(HAVE_ALLOCA)
-#define alloca(x) malloc(x)
-#endif
-
-%}
-
-%union {
- char *string;
- unsigned number;
- struct string_list *list;
-}
-
-%token TABLE REQUEST UNKNOWN UNIMPLEMENTED END
-%token <string> STRING
-%type <number> flag flags
-%type <list> aliases
-
-%%
-
-file : /* */
- | statements
- ;
-
-statements : statement
- | statements statement
- ;
-
-statement : TABLE STRING ';'
- {
- table_name = $2;
- }
- | REQUEST STRING ',' STRING ',' aliases ',' '(' flags ')' ';'
- {
- add_command($2, $4, $6, $9);
- }
- | REQUEST STRING ',' STRING ',' aliases ';'
- {
- add_command($2, $4, $6, 0);
- }
- | UNIMPLEMENTED STRING ',' STRING ',' aliases ';'
- {
- free($2);
- free($4);
- free_string_list($6);
- }
- | UNKNOWN aliases ';'
- {
- free_string_list($2);
- }
- | END ';'
- {
- YYACCEPT;
- }
- ;
-
-aliases : STRING
- {
- $$ = append_string(NULL, $1);
- }
- | aliases ',' STRING
- {
- $$ = append_string($1, $3);
- }
- ;
-
-flags : flag
- {
- $$ = $1;
- }
- | flags ',' flag
- {
- $$ = $1 | $3;
- }
- ;
-flag : STRING
- {
- $$ = string_to_flag($1);
- free($1);
- }
- ;
-
-
-
-%%
-
-static void
-yyerror (char *s)
-{
- error_message ("%s\n", s);
-}
-
-struct string_list*
-append_string(struct string_list *list, char *str)
-{
- struct string_list *sl = malloc(sizeof(*sl));
- sl->string = str;
- sl->next = NULL;
- if(list) {
- *list->tail = sl;
- list->tail = &sl->next;
- return list;
- }
- sl->tail = &sl->next;
- return sl;
-}
-
-void
-free_string_list(struct string_list *list)
-{
- while(list) {
- struct string_list *sl = list->next;
- free(list->string);
- free(list);
- list = sl;
- }
-}
-
-unsigned
-string_to_flag(const char *string)
-{
- return 0;
-}
diff --git a/usr.sbin/afs/src/lib/sl/roken_rename.h b/usr.sbin/afs/src/lib/sl/roken_rename.h
deleted file mode 100644
index 001ef3db6d0..00000000000
--- a/usr.sbin/afs/src/lib/sl/roken_rename.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 1998 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: roken_rename.h,v 1.1.1.1 2002/09/17 14:48:55 lha Exp $ */
-
-#ifndef __roken_rename_h__
-#define __roken_rename_h__
-
-#ifndef HAVE_STRTOK_R
-#define strtok_r _sl_strtok_r
-#endif
-#ifndef HAVE_SNPRINTF
-#define snprintf _sl_snprintf
-#endif
-#ifndef HAVE_ASPRINTF
-#define asprintf _sl_asprintf
-#endif
-#ifndef HAVE_ASNPRINTF
-#define asnprintf _sl_asnprintf
-#endif
-#ifndef HAVE_VASPRINTF
-#define vasprintf _sl_vasprintf
-#endif
-#ifndef HAVE_VASNPRINTF
-#define vasnprintf _sl_vasnprintf
-#endif
-#ifndef HAVE_VSNPRINTF
-#define vsnprintf _sl_vsnprintf
-#endif
-#ifndef HAVE_STRUPR
-#define strupr _sl_strupr
-#endif
-#ifndef HAVE_STRDUP
-#define strdup _sl_strdup
-#endif
-
-#endif /* __roken_rename_h__ */
diff --git a/usr.sbin/afs/src/lib/sl/sl.c b/usr.sbin/afs/src/lib/sl/sl.c
deleted file mode 100644
index 33f8e1c8970..00000000000
--- a/usr.sbin/afs/src/lib/sl/sl.c
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: sl.c,v 1.9 2003/02/01 19:19:01 lha Exp $");
-#endif
-
-#include "sl_locl.h"
-
-extern char *__progname;
-
-static size_t __attribute__ ((unused))
-print_sl (FILE *stream, int mdoc, int longp, SL_cmd *c)
-{
- if(mdoc){
- if(longp)
- fprintf(stream, "= Ns");
- fprintf(stream, " Ar ");
- }else
- if (longp)
- putc ('=', stream);
- else
- putc (' ', stream);
-
- return 1;
-}
-
-static void
-mandoc_template(SL_cmd *cmds,
- const char *extra_string)
-{
- SL_cmd *c, *prev;
- char timestr[64], cmd[64];
- const char *p;
- time_t t;
- extern char *__progname;
-
- printf(".\\\" Things to fix:\n");
- printf(".\\\" * correct section, and operating system\n");
- printf(".\\\" * remove Op from mandatory flags\n");
- printf(".\\\" * use better macros for arguments (like .Pa for files)\n");
- printf(".\\\"\n");
- t = time(NULL);
- strftime(timestr, sizeof(timestr), "%b %d, %Y", localtime(&t));
- printf(".Dd %s\n", timestr);
- p = strrchr(__progname, '/');
- if(p) p++; else p = __progname;
- strncpy(cmd, p, sizeof(cmd));
- cmd[sizeof(cmd)-1] = '\0';
- strupr(cmd);
-
- printf(".Dt %s SECTION\n", cmd);
- printf(".Os OPERATING_SYSTEM\n");
- printf(".Sh NAME\n");
- printf(".Nm %s\n", p);
- printf(".Nd\n");
- printf("in search of a description\n");
- printf(".Sh SYNOPSIS\n");
- printf(".Nm\n");
- for(c = cmds; c->name; ++c) {
-/* if (c->func == NULL)
- continue; */
- printf(".Op Fl %s", c->name);
-/* print_sl(stdout, 1, 0, c);*/
- printf("\n");
-
- }
- if (extra_string && *extra_string)
- printf (".Ar %s\n", extra_string);
- printf(".Sh DESCRIPTION\n");
- printf("Supported options:\n");
- printf(".Bl -tag -width Ds\n");
- prev = NULL;
- for(c = cmds; c->name; ++c) {
- if (c->func) {
- if (prev)
- printf ("\n%s\n", prev->usage);
-
- printf (".It Fl %s", c->name);
- prev = c;
- } else
- printf (", %s\n", c->name);
- }
- if (prev)
- printf ("\n%s\n", prev->usage);
-
- printf(".El\n");
- printf(".\\\".Sh ENVIRONMENT\n");
- printf(".\\\".Sh FILES\n");
- printf(".\\\".Sh EXAMPLES\n");
- printf(".\\\".Sh DIAGNOSTICS\n");
- printf(".\\\".Sh SEE ALSO\n");
- printf(".\\\".Sh STANDARDS\n");
- printf(".\\\".Sh HISTORY\n");
- printf(".\\\".Sh AUTHORS\n");
- printf(".\\\".Sh BUGS\n");
-}
-
-static SL_cmd *
-sl_match (SL_cmd *cmds, char *cmd, int exactp)
-{
- SL_cmd *c, *current = NULL, *partial_cmd = NULL;
- int partial_match = 0;
-
- for (c = cmds; c->name; ++c) {
- if (c->func)
- current = c;
- if (strcmp (cmd, c->name) == 0)
- return current;
- else if (strncmp (cmd, c->name, strlen(cmd)) == 0 &&
- partial_cmd != current) {
- ++partial_match;
- partial_cmd = current;
- }
- }
- if (partial_match == 1 && !exactp)
- return partial_cmd;
- else
- return NULL;
-}
-
-void
-sl_help (SL_cmd *cmds, int argc, char **argv)
-{
- SL_cmd *c, *prev_c;
-
- if (getenv("SLMANDOC")) {
- mandoc_template(cmds, NULL);
- return;
- }
-
- if (argc == 1) {
- prev_c = NULL;
- for (c = cmds; c->name; ++c) {
- if (c->func) {
- if(prev_c)
- printf ("\n\t%s%s", prev_c->usage ? prev_c->usage : "",
- prev_c->usage ? "\n" : "");
- prev_c = c;
- printf ("%s", c->name);
- } else
- printf (", %s", c->name);
- }
- if(prev_c)
- printf ("\n\t%s%s", prev_c->usage ? prev_c->usage : "",
- prev_c->usage ? "\n" : "");
- } else {
- c = sl_match (cmds, argv[1], 0);
- if (c == NULL)
- printf ("No such command: %s. "
- "Try \"help\" for a list of all commands\n",
- argv[1]);
- else {
- printf ("%s\t%s\n", c->name, c->usage);
- if(c->help && *c->help)
- printf ("%s\n", c->help);
- if((++c)->name && c->func == NULL) {
- printf ("Synonyms:");
- while (c->name && c->func == NULL)
- printf ("\t%s", (c++)->name);
- printf ("\n");
- }
- }
- }
-}
-
-#ifdef HAVE_READLINE
-
-char *readline(char *prompt);
-void add_history(char *p);
-
-#else
-
-static char *
-readline(char *prompt)
-{
- char buf[BUFSIZ];
- printf ("%s", prompt);
- fflush (stdout);
- if(fgets(buf, sizeof(buf), stdin) == NULL)
- return NULL;
- if (buf[0] != '\0' && buf[strlen(buf) - 1] == '\n')
- buf[strlen(buf) - 1] = '\0';
- return strdup(buf);
-}
-
-static void
-add_history(char *p)
-{
-}
-
-#endif
-
-int
-sl_command(SL_cmd *cmds, int argc, char **argv)
-{
- SL_cmd *c;
- c = sl_match (cmds, argv[0], 0);
- if (c == NULL)
- return -1;
- return (*c->func)(argc, argv);
-}
-
-struct sl_data {
- int max_count;
- char **ptr;
-};
-
-int
-sl_make_argv(char *line, int *ret_argc, char ***ret_argv)
-{
- char *foo = NULL;
- char *p;
- int argc, nargv;
- char **argv;
-
- nargv = 10;
- argv = malloc(nargv * sizeof(*argv));
- if(argv == NULL)
- return ENOMEM;
- argc = 0;
-
- for(p = strtok_r (line, " \t", &foo);
- p;
- p = strtok_r (NULL, " \t", &foo)) {
- if(argc == nargv - 1) {
- char **tmp;
- nargv *= 2;
- tmp = realloc (argv, nargv * sizeof(*argv));
- if (tmp == NULL) {
- free(argv);
- return ENOMEM;
- }
- argv = tmp;
- }
- argv[argc++] = p;
- }
- argv[argc] = NULL;
- *ret_argc = argc;
- *ret_argv = argv;
- return 0;
-}
-
-/* return values: 0 on success, -1 on fatal error, or return value of command */
-int
-sl_command_loop(SL_cmd *cmds, char *prompt, void **data)
-{
- int ret = 0;
- char *buf;
- int argc;
- char **argv;
-
- ret = 0;
- buf = readline(prompt);
- if(buf == NULL)
- return 1;
-
- if(*buf)
- add_history(buf);
- ret = sl_make_argv(buf, &argc, &argv);
- if(ret) {
- fprintf(stderr, "sl_loop: out of memory\n");
- free(buf);
- return -1;
- }
- if (argc >= 1) {
- ret = sl_command(cmds, argc, argv);
- if(ret == -1) {
- printf ("Unrecognized command: %s\n", argv[0]);
- ret = 0;
- }
- }
- free(buf);
- free(argv);
- return ret;
-}
-
-int
-sl_loop(SL_cmd *cmds, char *prompt)
-{
- void *data = NULL;
- int ret;
- while((ret = sl_command_loop(cmds, prompt, &data)) == 0)
- ;
- return ret;
-}
-
-void
-sl_apropos (SL_cmd *cmd, char *topic)
-{
- for (; cmd->name != NULL; ++cmd)
- if (cmd->usage != NULL && strstr(cmd->usage, topic) != NULL)
- printf ("%-20s%s\n", cmd->name, cmd->usage);
-}
diff --git a/usr.sbin/afs/src/lib/sl/sl.h b/usr.sbin/afs/src/lib/sl/sl.h
deleted file mode 100644
index 27b71df5e17..00000000000
--- a/usr.sbin/afs/src/lib/sl/sl.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: sl.h,v 1.4 2000/03/07 22:08:48 assar Exp $ */
-
-#ifndef _SL_H
-#define _SL_H
-
-#define SL_BADCOMMAND -1
-
-typedef int (*cmd_func)(int, char **);
-
-struct sl_cmd {
- char *name;
- cmd_func func;
- char *usage;
- char *help;
-};
-
-typedef struct sl_cmd SL_cmd;
-
-void sl_help (SL_cmd *, int argc, char **argv);
-int sl_loop (SL_cmd *, char *prompt);
-int sl_command_loop (SL_cmd *cmds, char *prompt, void **data);
-int sl_command (SL_cmd *cmds, int argc, char **argv);
-int sl_make_argv(char*, int*, char***);
-void sl_apropos (SL_cmd *cmd, char *topic);
-
-
-#endif /* _SL_H */
diff --git a/usr.sbin/afs/src/lib/sl/sl_locl.h b/usr.sbin/afs/src/lib/sl/sl_locl.h
deleted file mode 100644
index fa264357d66..00000000000
--- a/usr.sbin/afs/src/lib/sl/sl_locl.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: sl_locl.h,v 1.2 2000/03/07 22:08:48 assar Exp $ */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-
-#include <roken.h>
-
-#include <sl.h>
diff --git a/usr.sbin/afs/src/lib/sl/ss.c b/usr.sbin/afs/src/lib/sl/ss.c
deleted file mode 100644
index 094291529d6..00000000000
--- a/usr.sbin/afs/src/lib/sl/ss.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "sl_locl.h"
-#if defined(HAVE_COM_ERR_H)
-#include <com_err.h>
-#elif defined(HAVE_ET_COM_ERR_H)
-#include <et/com_err.h>
-#endif
-#include "ss.h"
-
-RCSID("$arla: ss.c,v 1.2 2000/06/17 03:14:59 assar Exp $");
-
-struct ss_subst {
- char *name;
- char *version;
- char *info;
- ss_request_table *table;
-};
-
-static struct ss_subst subsystems[2];
-static int num_subsystems;
-
-int
-ss_create_invocation(const char *subsystem,
- const char *version,
- const char *info,
- ss_request_table *table,
- int *code)
-{
- struct ss_subst *ss;
- if(num_subsystems >= sizeof(subsystems) / sizeof(subsystems[0])) {
- *code = 17;
- return 0;
- }
- ss = &subsystems[num_subsystems];
- ss->name = subsystem ? strdup(subsystem) : NULL;
- ss->version = version ? strdup(version) : NULL;
- ss->info = info ? strdup(info) : NULL;
- ss->table = table;
- *code = 0;
- return num_subsystems++;
-}
-
-void
-ss_error (int index, long code, const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- com_err_va (subsystems[index].name, code, fmt, ap);
- va_end(ap);
-}
-
-void
-ss_perror (int index, long code, const char *msg)
-{
- ss_error(index, code, "%s", msg);
-}
-
-int
-ss_execute_command(int index, char **argv)
-{
- int argc = 0;
- while(argv[argc++]);
- sl_command(subsystems[index].table, argc, argv);
- return 0;
-}
-
-int
-ss_execute_line (int index, const char *line)
-{
- char *buf = strdup(line);
- int argc;
- char **argv;
-
- sl_make_argv(buf, &argc, &argv);
- sl_command(subsystems[index].table, argc, argv);
- free(buf);
- return 0;
-}
-
-int
-ss_listen (int index)
-{
- char *prompt;
-
- if (asprintf(&prompt, "%s: ", subsystems[index].name) == -1) {
- errx(-1, "ss_listen: malloc failed\n");
- }
- sl_loop(subsystems[index].table, prompt);
- free(prompt);
- return 0;
-}
-
-int
-ss_list_requests(int argc, char **argv /* , int index, void *info */)
-{
- sl_help(subsystems[0 /* index */].table, argc, argv);
- return 0;
-}
-
-int
-ss_quit(int argc, char **argv)
-{
- return 1;
-}
diff --git a/usr.sbin/afs/src/lib/sl/ss.h b/usr.sbin/afs/src/lib/sl/ss.h
deleted file mode 100644
index f656f99fba5..00000000000
--- a/usr.sbin/afs/src/lib/sl/ss.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 1998 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-/* $arla: ss.h,v 1.1 2000/03/07 22:08:49 assar Exp $ */
-
-/* SS compatibility for SL */
-
-#ifndef __ss_h__
-#define __ss_h__
-
-#include <sl.h>
-
-typedef SL_cmd ss_request_table;
-
-int ss_create_invocation (const char *, const char *, const char*,
- ss_request_table*, int*);
-
-void ss_error (int, long, const char*, ...);
-int ss_execute_command (int, char**);
-int ss_execute_line (int, const char*);
-int ss_list_requests (int argc, char**);
-int ss_listen (int);
-void ss_perror (int, long, const char*);
-int ss_quit (int argc, char**);
-
-#endif /* __ss_h__ */
diff --git a/usr.sbin/afs/src/lib/vers/make-print-version.c b/usr.sbin/afs/src/lib/vers/make-print-version.c
deleted file mode 100644
index 48f0821fb43..00000000000
--- a/usr.sbin/afs/src/lib/vers/make-print-version.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 1998 - 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: make-print-version.c,v 1.1 2003/01/17 02:43:12 lha Exp $");
-#endif
-
-#include <stdio.h>
-
-extern const char *arla_version;
-#include <version.h>
-
-int
-main(int argc, char **argv)
-{
- FILE *f;
- if(argc != 2)
- return 1;
- f = fopen(argv[1], "w");
- if(f == NULL)
- return 1;
- fprintf(f, "#define VERSIONLIST \"");
- fprintf(f, "%s", arla_version);
- fprintf(f, "\"\n");
- fclose(f);
- return 0;
-}
diff --git a/usr.sbin/afs/src/lib/vers/print_version.c b/usr.sbin/afs/src/lib/vers/print_version.c
deleted file mode 100644
index 90c81748591..00000000000
--- a/usr.sbin/afs/src/lib/vers/print_version.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1998 - 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: print_version.c,v 1.1 2003/01/17 02:43:14 lha Exp $");
-#endif
-#include "roken.h"
-
-#include "print_version.h"
-
-void
-print_version(const char *progname)
-{
- const char *package_list = VERSIONLIST;
-
- if(progname == NULL)
- progname = getprogname();
-
- if(*package_list == '\0')
- package_list = "no version information";
- fprintf(stderr, "%s (%s)\n", progname, package_list);
- fprintf(stderr, "Copyright 1999-2003 Kungliga Tekniska Högskolan\n");
- fprintf(stderr, "Copyright 2002-2003 Stockholms Universitet\n");
- fprintf(stderr, "Send bug-reports to %s\n", PACKAGE_BUGREPORT);
-}
diff --git a/usr.sbin/afs/src/lib/vers/vers.h b/usr.sbin/afs/src/lib/vers/vers.h
deleted file mode 100644
index 7c2f3fbfc85..00000000000
--- a/usr.sbin/afs/src/lib/vers/vers.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: vers.h,v 1.1 2003/01/17 02:43:17 lha Exp $ */
-
-#ifndef __VERS_H__
-#define __VERS_H__
-
-void print_version(const char *);
-
-#endif /* __VERS_H__ */
diff --git a/usr.sbin/afs/src/lwp/LICENSE.s390 b/usr.sbin/afs/src/lwp/LICENSE.s390
deleted file mode 100644
index f0e1b1efcfc..00000000000
--- a/usr.sbin/afs/src/lwp/LICENSE.s390
+++ /dev/null
@@ -1,39 +0,0 @@
-To: adam@fsf.net
-From: Harald Barth <haba@pdc.kth.se>
-Date: Tue, 20 Feb 2001 09:32:10 +0100
-Subject: s390 LWP Arla patch - license stuff
-
-Hi again,
-
-when we - the Arla folks - tried to include your LWP patch, we
-stumbled about the IPL in there. Then we read the IPL text some times,
-and without being lawyers discovered that we got a small clash here.
-The IPL is talking about "Program" and "Contributions" to that
-program. However, here the program (Arla) is not released under the
-IPL. We really would not like to include a patch which has a license
-text which may or may not conflict with the original license Arla is
-released under. So do you have any problem to contribute under the
-3-clause BSD license that Arla is released under? Sorry to bother, but
-I don't like to feed a future population of lawyers.
-
-Regards,
-Harald.
-
-To: Harald Barth <haba@pdc.kth.se>
-From: Adam Thornton <adam@fsf.net>
-Subject: Re: s390 LWP Arla patch - license stuff
-Date: Tue, 20 Feb 2001 09:58:42 -0600
-
-Let me confirm with Neale, but I think it's OK to release as BSD.
-
-Adam
-
-To: Harald Barth <haba@pdc.kth.se>
-From: Adam Thornton <adam@fsf.net>
-Subject: Re: s390 LWP Arla patch - license stuff
-Date: Tue, 20 Feb 2001 10:59:58 -0600
-
-I assume you got the earlier message--Neale confirms, it's OK to release
-as BSD not IPL.
-
-Adam
diff --git a/usr.sbin/afs/src/lwp/Makefile.in b/usr.sbin/afs/src/lwp/Makefile.in
deleted file mode 100644
index 2229a244fb7..00000000000
--- a/usr.sbin/afs/src/lwp/Makefile.in
+++ /dev/null
@@ -1,120 +0,0 @@
-# $KTH: Makefile.in,v 1.58.2.1 2002/02/01 14:22:21 ahltorp Exp $
-
-srcdir = @srcdir@
-top_builddir = ..
-VPATH = @srcdir@
-
-CC = @CC@
-GCC = @GCC@
-CPP = @CPP@
-AS = as
-AR = ar
-RM = rm
-RANLIB = @RANLIB@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-SHELL = /bin/sh
-LN_S = @LN_S@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-includedir = @includedir@
-
-HOST_CPU = @host_cpu@
-HOST_OS = @host_os@
-
-INCLUDES = -I../include @INC_roken@
-
-PROCESS_S = process.aix22.S \
- process.alpha.S \
- process.hpux.S \
- process.i386.S \
- process.ibm032.S \
- process.m68k.S \
- process.mips.S \
- process.ppc.S \
- process.rios.S \
- process.sparc.S \
- process.x86_64.S \
- process.vax.S
-
-
-REALCFLAGS = $(INCLUDES) @DEFS@ @CFLAGS@ -DFD_SPEED_HACK -DDEBUG \
- $(CFLAGS) @PLWP_INC_FLAGS@
-
-LIB = liblwp.a
-
-include_HEADERS = lock.h preempt.h timer.h
-
-liblwp_OBJECTS = @LWP_O@ @LWP_PROCESS@ lock.o iomgr.o timer.o fasttime.o q.o \
- preempt.o
-
-TEST_PROGRAMS = testlwp rw
-
-all: $(LIB) $(TEST_PROGRAMS)
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
- $(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/$(LIB)
- for x in $(include_HEADERS); do \
- b=`basename $$x`; \
- $(INSTALL_DATA) $(srcdir)/$$b $(DESTDIR)$(includedir)/$$b; \
- done
- $(INSTALL_DATA) $(srcdir)/@LWP_H@ $(DESTDIR)$(includedir)/lwp.h
-
-uninstall:
- rm -f $(DESTDIR)$(libdir)/$(LIB)
- for x in $(include_HEADERS); do \
- rm -f $(DESTDIR)$(includedir)/$$x; \
- done
- rm -f $(DESTDIR)$(includedir)/lwp.h
-
-liblwp.a: $(liblwp_OBJECTS)
- $(RM) -f $@
- $(AR) rc $@ $(liblwp_OBJECTS)
- $(RANLIB) $@
-
-make-process.o.sh: make-process.o.sh.in ../config.status
- cd ..; CONFIG_FILES=lwp/make-process.o.sh CONFIG_HEADERS= $(SHELL) config.status
-
-# More magic, close your eyes.
-process.o: $(PROCESS_S) make-process.o.sh testprocess.o preempt.o @LWP_O@
- $(SHELL) make-process.o.sh
-
-testlwp: testlwp.o liblwp.a
- $(CC) -o testlwp testlwp.o -L. -llwp @LIB_roken@ @PLWP_LIB_FLAGS@
-rw: rw.o liblwp.a
- $(CC) -o rw rw.o -L. -llwp @LIB_roken@ @PLWP_LIB_FLAGS@
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) $(REALCFLAGS) -I$(srcdir) -I. $<
-
-# dependencies
-
-iomgr.o: iomgr.c @LWP_H@ timer.h
-preempt.o: preempt.c @LWP_H@ preempt.h
-@LWP_O@: @LWP_C@ @LWP_H@
-lock.o: lock.c lock.h @LWP_H@
-timer.o: timer.c
-fasttime.o: fasttime.c
-q.o: q.c
-rw.o: rw.c
-testprocess.o: testprocess.c
-testlwp.o: testlwp.c
-
-clean:
- rm -f *.o *.a core process.ss process.i $(LIB) make-process.o.sh testprocess $(TEST_PROGRAMS) process.S
-
-distclean: clean
- rm -f Makefile
-
-realclean: clean
-
-Makefile: Makefile.in ../config.status
- cd ..; CONFIG_FILES=lwp/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-.PHONY: all install uninstall clean distclean realclean
diff --git a/usr.sbin/afs/src/lwp/fasttime.c b/usr.sbin/afs/src/lwp/fasttime.c
deleted file mode 100644
index 4cefa1eb4e0..00000000000
--- a/usr.sbin/afs/src/lwp/fasttime.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-/*
- * fasttime.c -- Get the time of day quickly by mapping the kernel's
- * time of day variable.
- *
- * David Nichols
- * 6 January 1986
- *
- * Modification History
- * 3/21/86: Added FT_ApproxTime which returns the last time
- * in seconds returned by RT_FastTime. The intent is to give
- * routines which aren't too concerned about the exact time
- * fast access to the time, even on kernels without mmap.
- * - Bob Sidebotham.
- * 4/2/86: Fixed my previous mod and fixed FT_Init so it doesn't initialize
- * a second time if explicitly called after being implicitly called.
- * This saves a (precious) file descriptor.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: fasttime.c,v 1.10 2002/12/20 12:54:55 lha Exp $");
-#endif
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/file.h>
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-
-#ifdef HAVE_NLIST_H
-#include <nlist.h>
-#else
-#ifdef HAVE_LIBELF_NLIST_H
-#include <libelf/nlist.h>
-#endif
-#endif
-
-#include "timer.h"
-
-#define TRUE 1
-#define FALSE 0
-
-static enum InitState {
- notTried, tried, done
-} initState = notTried;
-
-/* last time returned by RT_FastTime. Used to implement FT_ApproxTime */
-struct timeval FT_LastTime;
-
-
-/*
- * Call this to get the memory mapped. It will return -1 if anything went
- * wrong. In that case, calls to FT_GetTimeOfDay will call gettimeofday
- * instead. If printErrors is true, errors in initialization will cause
- * error messages to be printed on stderr. If notReally is true, then
- * things are set up so that all calls to FT_GetTimeOfDay call gettimeofday.
- * You might want this if your program won't run too long and the nlist
- * call is too expensive. Yeah, it's pretty horrible.
- */
-int
-FT_Init(int printErrors, int notReally)
-{
-
- /*
- * This is in case explicit initialization occurs after automatic
- * initialization
- */
- if (initState != notTried && !notReally)
- return (initState == done ? 0 : -1);
-
- initState = tried;
- if (notReally)
- return 0; /* fake success, but leave initState
- * wrong. */
- return (-1);
-}
-
-/*
- * Call this to get the time of day. It will automatically initialize the
- * first time you call it. If you want error messages when you initialize,
- * call FT_Init yourself. If the initialization failed, this will just
- * call gettimeofday. If you ask for the timezone info, this routine will
- * punt to gettimeofday.
- */
-int
-FT_GetTimeOfDay(struct timeval * tv, struct timezone * tz)
-{
- int ret;
-
- ret = gettimeofday(tv, tz);
- if (!ret) {
-
- /*
- * need to bounds check 'cause Unix can fail these checks, (esp on
- * Suns) and time package can generate invalid (to select syscall)
- * values for the time until the next interesting event if it
- * encounters out of range microsecond fields
- */
- if (tv->tv_usec < 0)
- tv->tv_usec = 0;
- if (tv->tv_usec > 999999)
- tv->tv_usec = 999999;
- FT_LastTime.tv_sec = tv->tv_sec;
- FT_LastTime.tv_usec = tv->tv_usec;
- }
- return ret;
-}
-
-
-/* For compatibility. Should go away. */
-int
-TM_GetTimeOfDay(struct timeval * tv, struct timezone * tz)
-{
- return FT_GetTimeOfDay(tv, tz);
-}
-
-int
-FT_AGetTimeOfDay(struct timeval * tv, struct timezone * tz)
-{
- if (FT_LastTime.tv_sec) {
- tv->tv_sec = FT_LastTime.tv_sec;
- tv->tv_usec = FT_LastTime.tv_usec;
- return 0;
- }
- return FT_GetTimeOfDay(tv, tz);
-}
-
-unsigned int
-FT_ApproxTime(void)
-{
- if (!FT_LastTime.tv_sec) {
- FT_GetTimeOfDay(&FT_LastTime, 0);
- }
- return FT_LastTime.tv_sec;
-}
-
-
-
diff --git a/usr.sbin/afs/src/lwp/iomgr.c b/usr.sbin/afs/src/lwp/iomgr.c
deleted file mode 100644
index 03a78907903..00000000000
--- a/usr.sbin/afs/src/lwp/iomgr.c
+++ /dev/null
@@ -1,863 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/*******************************************************************\
-* *
-* Information Technology Center *
-* Carnegie-Mellon University *
-* *
-* *
-* *
-\*******************************************************************/
-
-
-/*
- * IO Manager routines & server process for VICE server.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: iomgr.c,v 1.25 2002/06/01 17:47:47 lha Exp $");
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "lwp.h"
-#include <sys/time.h>
-#include "timer.h"
-#include <signal.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/file.h>
-#include "q.h"
-#include <unistd.h>
-#include <string.h>
-#include <roken.h>
-
-/* Prototypes */
-static void SignalIO(int, fd_set *, fd_set *, fd_set *) ;
-static void SignalTimeout(int fds, struct timeval *timeout) ;
-static int SignalSignals (void);
-
-int FT_GetTimeOfDay(struct timeval *, struct timezone *);
-
-/********************************\
-* *
-* Stuff for managing IoRequests *
-* *
-\********************************/
-
-struct IoRequest {
-
- /* Pid of process making request (for use in IOMGR_Cancel) */
- PROCESS pid;
-
- /* Descriptor masks for requests */
- fd_set readfds;
- fd_set writefds;
- fd_set exceptfds;
-
- fd_set *rfds;
- fd_set *wfds;
- fd_set *efds;
-
- int nfds;
-
- struct TM_Elem timeout;
-
- /* Result of select call */
- int result;
- struct IoRequest *next;
-};
-
-/********************************\
-* *
-* Stuff for managing signals *
-* *
-\********************************/
-
-#define badsig(signo) (((signo) <= 0) || ((signo) >= NSIG))
-#define mysigmask(signo) (1 << ((signo)-1))
-
-static long openMask; /* mask of open files on an IOMGR abort */
-static long sigsHandled; /* sigmask(signo) is on if we handle signo */
-static int anySigsDelivered; /* true if any have been delivered. */
-#ifdef AFS_POSIX_SIGNALS
-static struct sigaction oldVecs[NSIG]; /* the old signal vectors */
-#else
-static struct sigvec oldVecs[NSIG]; /* the old signal vectors */
-#endif
-static char *sigEvents[NSIG]; /* the event to do an LWP signal on */
-static int sigDelivered[NSIG]; /*
- * True for signals delivered so far.
- * This is an int array to make sure
- * there are no conflicts when trying
- * to write it
- */
-/* software 'signals' */
-#define NSOFTSIG 4
-static void (*sigProc[NSOFTSIG])();
-static char *sigRock[NSOFTSIG];
-
-
-static struct IoRequest *iorFreeList = 0;
-
-static struct TM_Elem *Requests; /* List of requests */
-static struct timeval iomgr_timeout; /* global so signal handler can zap it */
-
-/* stuff for debugging */
-static int iomgr_errno;
-static struct timeval iomgr_badtv;
-static PROCESS iomgr_badpid;
-
-static void
-FreeRequest(struct IoRequest *req)
-{
- req->next = iorFreeList;
- iorFreeList = req;
-}
-
-/* stuff for handling select fd_sets */
-
-#ifndef FD_COPY
-#define FD_COPY(f, t) memcpy((t), (f), sizeof(*(f)))
-#endif
-
-/*
- * FD_OR - bitwise or of two fd_sets
- * The result goes into set1
- */
-static void
-FD_OR(fd_set *set1, fd_set *set2)
-{
- int i;
-
-#ifdef FD_SPEED_HACK
- unsigned long *s1 = (unsigned long *)set1;
- unsigned long *s2 = (unsigned long *)set2;
-
- for (i = 0; i < sizeof(fd_set)/sizeof(unsigned long); i++)
- s1[i] |= s2[i];
-#else
- for (i = 0; i < FD_SETSIZE; i++)
- if (FD_ISSET(i, set1) || FD_ISSET(i, set2))
- FD_SET(i, set1);
-#endif
-}
-
-/*
- * FD_AND - bitwise and of two fd_sets
- * The result goes into set1
- */
-static void
-FD_AND(fd_set *set1, fd_set *set2)
-{
- int i;
-
-#ifdef FD_SPEED_HACK
- unsigned long *s1 = (unsigned long *)set1;
- unsigned long *s2 = (unsigned long *)set2;
-
- for(i = 0; i < sizeof(fd_set)/sizeof(unsigned long); i++)
- s1[i] &= s2[i];
-#else
- for(i = 0; i < FD_SETSIZE; i++)
- if (FD_ISSET(i, set1) && FD_ISSET(i, set2))
- FD_SET(i, set1);
-#endif
-}
-
-/*
- * FD_LOGAND - "logical" and of two fd_sets
- * returns 0 if there are no fds that are the same in both fd_sets
- * otherwise it returns 1
- */
-static int
-FD_LOGAND(fd_set *set1, fd_set *set2)
-{
-#ifdef FD_SPEED_HACK
- int i;
-
- unsigned long *s1 = (unsigned long *)set1;
- unsigned long *s2 = (unsigned long *)set2;
-
- for(i = 0; i < sizeof(fd_set)/sizeof(unsigned long); i++)
- if ((s1[i] & s2[i]) != 0)
- return 1;
- return 0;
-#else
- fd_set tmp;
-
- FD_COPY(set1, &tmp);
- FD_AND(&tmp, set2);
-
- return !FD_ISZERO(&tmp);
-#endif
-}
-
-static struct IoRequest *
-NewRequest(void)
-{
- struct IoRequest *request;
-
- if ((request = iorFreeList) != NULL)
- iorFreeList = request->next;
- else
- request = (struct IoRequest *) malloc(sizeof(struct IoRequest));
-
- return request;
-}
-
-#define Purge(list) FOR_ALL_ELTS(req, list, { free(req->BackPointer); })
-#define MAX_FDS 32
-
-/* The IOMGR process */
-
-/*
- * Important invariant: process->iomgrRequest is null iff request not in
- * timer queue also, request->pid is valid while request is in queue, also,
- * don't signal selector while request in queue, since selector free's request.
- */
-
-static void
-IOMGR(char *dummy)
-{
- for (;;) {
- int fds;
- int nfds;
- fd_set readfds, writefds, exceptfds;
- fd_set *rfds, *wfds, *efds;
- struct TM_Elem *earliest;
- struct timeval timeout, junk;
- bool woke_someone;
-
- /*
- * Wake up anyone who has expired or who has received a
- * Unix signal between executions. Keep going until we
- * run out.
- */
- do {
- woke_someone = FALSE;
- /* Wake up anyone waiting on signals. */
- /* Note: SignalSignals() may yield! */
- if (anySigsDelivered && SignalSignals ())
- woke_someone = TRUE;
- TM_Rescan(Requests);
- for (;;) {
- struct IoRequest *req;
- struct TM_Elem *expired;
- expired = TM_GetExpired(Requests);
- if (expired == NULL) break;
- woke_someone = TRUE;
- req = (struct IoRequest *) expired -> BackPointer;
-#ifdef DEBUG
- if (lwp_debug != 0) puts("[Polling SELECT]");
-#endif /* DEBUG */
- FD_ZERO(&req->readfds);
- FD_ZERO(&req->writefds);
- FD_ZERO(&req->exceptfds);
- /* no data ready */
- req->nfds = 0;
- req->rfds = req->wfds = req->efds = NULL;
-
- req->result = 0;
- /* no fds ready */
-
- TM_Remove(Requests, &req->timeout);
-#ifdef DEBUG
- req -> timeout.Next = (struct TM_Elem *) 2;
- req -> timeout.Prev = (struct TM_Elem *) 2;
-#endif /* DEBUG */
- LWP_QSignal(req->pid);
- req->pid->iomgrRequest = 0;
- }
- if (woke_someone) LWP_DispatchProcess();
- } while (woke_someone);
-
-
- /* Collect requests & update times */
- FD_ZERO(&readfds); /* XXX - should not be needed */
- FD_ZERO(&writefds);
- FD_ZERO(&exceptfds);
- nfds = 0;
- rfds = wfds = efds = NULL;
- FOR_ALL_ELTS(r, Requests, {
- struct IoRequest *req;
- req = (struct IoRequest *) r -> BackPointer;
- if (req->rfds) {
- if (rfds)
- FD_OR(rfds, req->rfds);
- else {
- rfds = &readfds;
- FD_COPY(req->rfds, rfds);
- }
- }
-
- if (req->wfds) {
- if (wfds)
- FD_OR(wfds, req->wfds);
- else {
- wfds = &writefds;
- FD_COPY(req->wfds, wfds);
- }
- }
-
- if (req->efds) {
- if (efds)
- FD_OR(efds, req->efds);
- else {
- efds = &exceptfds;
- FD_COPY(req->efds, efds);
- }
- }
- nfds = max(nfds, req->nfds);
- })
- earliest = TM_GetEarliest(Requests);
- if (earliest != NULL) {
- timeout = earliest -> TimeLeft;
-
- /* Do select */
-#ifdef DEBUG
- if (lwp_debug != 0) {
- printf("[select(%d, %p, %p, %p, ", nfds,
- rfds, wfds, efds);
- if (timeout.tv_sec == -1 && timeout.tv_usec == -1)
- puts("INFINITE)]");
- else
- printf("<%ld, %lu>)]\n",
- (long)timeout.tv_sec,
- (unsigned long)timeout.tv_usec);
- }
-#endif /* DEBUG */
- iomgr_timeout = timeout;
- if (timeout.tv_sec == -1 && timeout.tv_usec == -1) {
- /* infinite, sort of */
- iomgr_timeout.tv_sec = 100000000;
- iomgr_timeout.tv_usec = 0;
- }
- /*
- * Check one last time for a signal delivery. If one comes after
- * this, the signal handler will set iomgr_timeout to zero,
- * causing the select to return immediately. The timer package
- * won't return a zero timeval because all of those guys were
- * handled above.
- *
- * I'm assuming that the kernel masks signals while it's picking up
- * the parameters to select. This may a bad assumption. -DN
- */
- if (anySigsDelivered)
- continue; /* go to the top and handle them. */
-
- /*
- * select runs much faster if NULL's are passed instead of &0s
- */
-
- fds = select(nfds, rfds, wfds, efds, &iomgr_timeout);
-
- /*
- * For SGI and SVR4 - poll & select can return EAGAIN ...
- */
- if (fds < 0
- && errno != EINTR && errno != EAGAIN && errno != ENOMEM) {
- iomgr_errno = errno;
- for(fds = 0; fds < FD_SETSIZE; fds++) {
- if (fcntl(fds, F_GETFD, 0) < 0 && errno == EBADF)
- openMask |= (1<<fds);
- }
- exit(-1);
- }
-
- /* force a new gettimeofday call so FT_AGetTimeOfDay calls work */
- FT_GetTimeOfDay(&junk, 0);
-
- /* See what happened */
- if (fds > 0)
- /* Action -- wake up everyone involved */
- SignalIO(fds, rfds, wfds, efds);
- else if (fds == 0
- && (iomgr_timeout.tv_sec != 0 || iomgr_timeout.tv_usec != 0))
- /* Real timeout only if signal handler hasn't set
- iomgr_timeout to zero. */
- SignalTimeout(fds, &timeout);
-
- }
- LWP_DispatchProcess();
- }
-}
-
-/************************\
-* *
-* Signalling routines *
-* *
-\************************/
-
-static void
-SignalIO(int fds, fd_set *rfds, fd_set *wfds, fd_set *efds)
-{
- /* Look at everyone who's bit mask was affected */
- FOR_ALL_ELTS(r, Requests, {
- struct IoRequest *req;
- PROCESS pid;
- int doit = 0;
- req = (struct IoRequest *) r -> BackPointer;
-
- if (rfds && req->rfds && FD_LOGAND(req->rfds, rfds)) {
- FD_AND(req->rfds, rfds);
- doit = 1;
- }
- if (wfds && req->wfds && FD_LOGAND(req->wfds, wfds)) {
- FD_AND(req->wfds, wfds);
- doit = 1;
- }
- if (efds && req->efds && FD_LOGAND(req->efds, efds)) {
- FD_AND(req->efds, efds);
- doit = 1;
- }
-
- if (doit) {
- req -> result = fds;
- TM_Remove(Requests, &req->timeout);
- LWP_QSignal(pid=req->pid);
- pid->iomgrRequest = 0;
-
- }
- })
-}
-
-static void
-SignalTimeout(int fds, struct timeval *timeout)
-{
- /* Find everyone who has specified timeout */
- FOR_ALL_ELTS(r, Requests, {
- struct IoRequest *req;
- PROCESS pid;
- req = (struct IoRequest *) r -> BackPointer;
- if (TM_eql(&r->TimeLeft, timeout)) {
- req -> result = fds;
- TM_Remove(Requests, &req->timeout);
- LWP_QSignal(pid=req->pid);
- pid->iomgrRequest = 0;
- } else
- return;
- })
-}
-
-/*****************************************************\
-* *
-* Signal handling routine (not to be confused with *
-* signalling routines, above). *
-* *
-\*****************************************************/
-static RETSIGTYPE
-SigHandler (int signo)
-{
- if (badsig(signo) || (sigsHandled & mysigmask(signo)) == 0)
- return; /* can't happen. */
- sigDelivered[signo] = TRUE;
- anySigsDelivered = TRUE;
- /* Make sure that the IOMGR process doesn't pause on the select. */
- iomgr_timeout.tv_sec = 0;
- iomgr_timeout.tv_usec = 0;
-}
-
-/* Alright, this is the signal signalling routine. It delivers LWP signals
- to LWPs waiting on Unix signals. NOW ALSO CAN YIELD!! */
-static int
-SignalSignals (void)
-{
- bool gotone = FALSE;
- int i;
- void (*p)();
- long stackSize;
-
- anySigsDelivered = FALSE;
-
- /* handle software signals */
- stackSize = (AFS_LWP_MINSTACKSIZE < lwp_MaxStackSeen?
- lwp_MaxStackSeen : AFS_LWP_MINSTACKSIZE);
- for (i=0; i < NSOFTSIG; i++) {
- PROCESS pid;
- if ((p = sigProc[i]) != NULL) /* This yields!!! */
- LWP_CreateProcess(p, stackSize, LWP_NORMAL_PRIORITY, sigRock[i],
- "SignalHandler", &pid);
- sigProc[i] = 0;
- }
-
- for (i = 1; i < NSIG; ++i) /* forall !badsig(i) */
- if ((sigsHandled & mysigmask(i)) && sigDelivered[i] == TRUE) {
- sigDelivered[i] = FALSE;
- LWP_NoYieldSignal (sigEvents[i]);
- gotone = TRUE;
- }
- return gotone;
-}
-
-
-/***************************\
-* *
-* User-callable routines *
-* *
-\***************************/
-
-
-/* Keep IOMGR process id */
-static PROCESS IOMGR_Id = NULL;
-
-int
-IOMGR_SoftSig(void (*aproc)(), char *arock)
-{
- int i;
- for (i=0;i<NSOFTSIG;i++) {
- if (sigProc[i] == 0) {
- /* a free entry */
- sigProc[i] = aproc;
- sigRock[i] = arock;
- anySigsDelivered = TRUE;
- iomgr_timeout.tv_sec = 0;
- iomgr_timeout.tv_usec = 0;
- return 0;
- }
- }
- return -1;
-}
-
-
-int
-IOMGR_Initialize(void)
-{
- PROCESS pid;
-
- /* If lready initialized, just return */
- if (IOMGR_Id != NULL) return LWP_SUCCESS;
-
- /* Init LWP if someone hasn't yet. */
- if (LWP_InitializeProcessSupport (LWP_NORMAL_PRIORITY, &pid)
- != LWP_SUCCESS)
- return -1;
-
- /* Initialize request lists */
- if (TM_Init(&Requests) < 0) return -1;
-
- /* Initialize signal handling stuff. */
- sigsHandled = 0;
- anySigsDelivered = TRUE; /*
- * A soft signal may have happened before
- * IOMGR_Initialize: so force a check for
- * signals regardless
- */
-
- return LWP_CreateProcess(IOMGR, AFS_LWP_MINSTACKSIZE, 0, 0,
- "IO MANAGER", &IOMGR_Id);
-}
-
-int
-IOMGR_Finalize(void)
-{
- int status;
-
- Purge(Requests)
- TM_Final(&Requests);
- status = LWP_DestroyProcess(IOMGR_Id);
- IOMGR_Id = NULL;
- return status;
-}
-
-/*
- * signal I/O for anyone who is waiting for a FD or a timeout;
- * not too cheap, since forces select and timeofday check
- */
-long
-IOMGR_Poll(void)
-{
- fd_set readfds, writefds, exceptfds;
- fd_set *rfds, *wfds, *efds;
- long code;
- struct timeval tv;
- int nfds;
-
- FT_GetTimeOfDay(&tv, 0); /* force accurate time check */
- TM_Rescan(Requests);
- for (;;) {
- struct IoRequest *req;
- struct TM_Elem *expired;
- expired = TM_GetExpired(Requests);
- if (expired == NULL) break;
- req = (struct IoRequest *) expired -> BackPointer;
-#ifdef DEBUG
- if (lwp_debug != 0) puts("[Polling SELECT]");
-#endif /* DEBUG */
- /* no data ready */
-
- FD_ZERO(&req->readfds);
- FD_ZERO(&req->writefds);
- FD_ZERO(&req->exceptfds);
-
- req->nfds = 0;
- req->rfds = req->wfds = req->efds = NULL;
-
- req->result = 0; /* no fds ready */
- TM_Remove(Requests, &req->timeout);
-#ifdef DEBUG
- req -> timeout.Next = (struct TM_Elem *) 2;
- req -> timeout.Prev = (struct TM_Elem *) 2;
-#endif /* DEBUG */
- LWP_QSignal(req->pid);
- req->pid->iomgrRequest = 0;
- }
-
- /* Collect requests & update times */
- FD_ZERO(&readfds); /* XXX - should not be needed */
- FD_ZERO(&writefds);
- FD_ZERO(&exceptfds);
- rfds = wfds = efds = NULL;
- nfds = 0;
- FOR_ALL_ELTS(r, Requests, {
- struct IoRequest *req;
- req = (struct IoRequest *) r -> BackPointer;
-
- if (req->rfds) {
- if (rfds)
- FD_OR(rfds, req->rfds);
- else {
- rfds = &readfds;
- FD_COPY(req->rfds, rfds);
- }
- }
-
- if (req->wfds) {
- if (wfds)
- FD_OR(wfds, req->wfds);
- else {
- wfds = &writefds;
- FD_COPY(req->wfds, wfds);
- }
- }
-
- if (req->efds) {
- if (efds)
- FD_OR(efds, req->efds);
- else {
- efds = &exceptfds;
- FD_COPY(req->efds, efds);
- }
- }
- nfds = max(nfds, req->nfds);
- })
-
- tv.tv_sec = 0;
- tv.tv_usec = 0;
- code = select(nfds, rfds, wfds, efds, &tv);
-
- if (code > 0) {
- SignalIO(code, rfds, wfds, efds);
- }
-
- LWP_DispatchProcess(); /* make sure others run */
- LWP_DispatchProcess();
- return 0;
-}
-
-int
-IOMGR_Select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
- struct timeval *timeout)
-{
- struct IoRequest *request;
- int result;
-
- /* See if polling request. If so, handle right here */
- if (timeout != NULL) {
- if (timeout->tv_sec == 0 && timeout->tv_usec == 0) {
- int fds;
-#ifdef DEBUG
- if (lwp_debug != 0) puts("[Polling SELECT]");
-#endif /* DEBUG */
-
- do {
- timeout->tv_sec = 0;
- timeout->tv_usec = 0;
- fds = select(nfds, readfds, writefds, exceptfds,
- timeout);
- } while (fds < 0 && errno == EAGAIN);
-
- return (fds > 1 ? 1 : fds);
- }
- }
-
- /* Construct request block & insert */
- request = NewRequest();
- if (readfds == NULL)
- request->rfds = NULL;
- else {
- request->rfds = &request->readfds;
- FD_COPY(readfds, request->rfds);
- }
-
- if (writefds == NULL)
- request->wfds = NULL;
- else {
- request->wfds = &request->writefds;
- FD_COPY(writefds, request->wfds);
- }
-
- if (exceptfds == NULL)
- request->efds = NULL;
- else {
- request->efds = &request->exceptfds;
- FD_COPY(exceptfds, request->efds);
- }
-
- request->nfds = nfds;
-
- if (timeout == NULL) {
- request -> timeout.TotalTime.tv_sec = -1;
- request -> timeout.TotalTime.tv_usec = -1;
- } else {
- request -> timeout.TotalTime = *timeout;
- /* check for bad request */
- if (timeout->tv_sec < 0 ||
- timeout->tv_usec < 0 ||
- timeout->tv_usec > 999999) {
- /* invalid arg */
- iomgr_badtv = *timeout;
- iomgr_badpid = LWP_ActiveProcess;
- /* now fixup request */
- if(request->timeout.TotalTime.tv_sec < 0)
- request->timeout.TotalTime.tv_sec = 1;
- request->timeout.TotalTime.tv_usec = 100000;
- }
- }
-
- request -> timeout.BackPointer = (char *) request;
-
- /* Insert my PID in case of IOMGR_Cancel */
- request -> pid = LWP_ActiveProcess;
- LWP_ActiveProcess -> iomgrRequest = request;
-
-#ifdef DEBUG
- request -> timeout.Next = (struct TM_Elem *) 1;
- request -> timeout.Prev = (struct TM_Elem *) 1;
-#endif /* DEBUG */
- TM_Insert(Requests, &request->timeout);
-
- /* Wait for action */
- LWP_QWait();
-
- /* Update parameters & return */
- if (readfds != NULL) FD_COPY(&request->readfds, readfds);
- if (writefds != NULL) FD_COPY(&request->writefds, writefds);
- if (exceptfds != NULL) FD_COPY(&request->exceptfds, exceptfds);
- result = request -> result;
- FreeRequest(request);
- return (result > 1 ? 1 : result);
-}
-
-int
-IOMGR_Cancel(PROCESS pid)
-{
- struct IoRequest *request;
-
- if ((request = pid->iomgrRequest) == 0) return -1; /* Pid not found */
-
- FD_ZERO(&request->readfds);
- FD_ZERO(&request->writefds);
- FD_ZERO(&request->exceptfds);
- request->rfds = request->wfds = request->efds = NULL;
- request->nfds = 0;
-
- request -> result = -2;
- TM_Remove(Requests, &request->timeout);
-#ifdef DEBUG
- request -> timeout.Next = (struct TM_Elem *) 5;
- request -> timeout.Prev = (struct TM_Elem *) 5;
-#endif /* DEBUG */
- LWP_QSignal(request->pid);
- pid->iomgrRequest = 0;
-
- return 0;
-}
-
-/*
- * Cause delivery of signal signo to result in a LWP_SignalProcess of
- * event.
- */
-int
-IOMGR_Signal (int signo, char *event)
-{
-#ifdef AFS_POSIX_SIGNALS
- struct sigaction sa;
-#else
- struct sigvec sv;
-#endif
-
- if (badsig(signo))
- return LWP_EBADSIG;
- if (event == NULL)
- return LWP_EBADEVENT;
-#ifdef AFS_POSIX_SIGNALS
- sa.sa_handler = SigHandler;
- sigfillset(&sa.sa_mask);
- sa.sa_flags=0;
-#else
- sv.sv_handler = SigHandler;
- sv.sv_mask = ~0; /* mask all signals */
- sv.sv_onstack = 0;
-#endif
- sigsHandled |= mysigmask(signo);
- sigEvents[signo] = event;
- sigDelivered[signo] = FALSE;
-#ifdef AFS_POSIX_SIGNALS
- if (sigaction (signo, &sa, &oldVecs[signo]) == -1)
- return LWP_ESYSTEM;
-#else
- if (sigvec (signo, &sv, &oldVecs[signo]) == -1)
- return LWP_ESYSTEM;
-#endif
- return LWP_SUCCESS;
-}
-
-/* Stop handling occurances of signo. */
-int
-IOMGR_CancelSignal (int signo)
-{
- if (badsig(signo) || (sigsHandled & mysigmask(signo)) == 0)
- return LWP_EBADSIG;
-#ifdef AFS_POSIX_SIGNALS
- sigaction (signo, &oldVecs[signo], (struct sigaction *)0);
-#else
- sigvec (signo, &oldVecs[signo], (struct sigvec *)0);
-#endif
- sigsHandled &= ~mysigmask(signo);
- return LWP_SUCCESS;
-}
-
-/*
- * This routine calls select is a fashion that simulates the standard
- * sleep routine
- */
-void
-IOMGR_Sleep (unsigned int seconds)
-{
- struct timeval timeout;
-
- timeout.tv_sec = seconds;
- timeout.tv_usec = 0;
- IOMGR_Select(0, NULL, NULL, NULL, &timeout);
-}
diff --git a/usr.sbin/afs/src/lwp/lock.c b/usr.sbin/afs/src/lwp/lock.c
deleted file mode 100644
index f5767f75774..00000000000
--- a/usr.sbin/afs/src/lwp/lock.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/*******************************************************************\
-* *
-* Information Technology Center *
-* Carnegie-Mellon University *
-* *
-* *
-* *
-\*******************************************************************/
-
-/*
- * Locking routines for Vice.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-RCSID("$arla: lock.c,v 1.11 2002/06/01 17:47:47 lha Exp $");
-#endif
-#include "lwp.h"
-#include "lock.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/time.h>
-#include <err.h>
-
-
-#define FALSE 0
-#define TRUE 1
-
-void
-Lock_Init(struct Lock *lock)
-{
- lock -> readers_reading = 0;
- lock -> excl_locked = 0;
- lock -> wait_states = 0;
- lock -> num_waiting = 0;
- lock -> thread_index = LWP_INVALIDTHREADID;
-}
-
-void
-Lock_Obtain(struct Lock *lock, int how)
-{
- switch (how) {
-
- case READ_LOCK: lock->num_waiting++;
- do {
- lock -> wait_states |= READ_LOCK;
- LWP_WaitProcess(&lock->readers_reading);
- } while (lock->excl_locked & WRITE_LOCK);
- lock->num_waiting--;
- lock->readers_reading++;
- break;
-
- case WRITE_LOCK: lock->num_waiting++;
- do {
- lock -> wait_states |= WRITE_LOCK;
- LWP_WaitProcess(&lock->excl_locked);
- } while (lock->excl_locked || lock->readers_reading);
- lock->num_waiting--;
- lock->excl_locked = WRITE_LOCK;
- break;
-
- case SHARED_LOCK: lock->num_waiting++;
- do {
- lock->wait_states |= SHARED_LOCK;
- LWP_WaitProcess(&lock->excl_locked);
- } while (lock->excl_locked);
- lock->num_waiting--;
- lock->excl_locked = SHARED_LOCK;
- break;
-
- case BOOSTED_LOCK: lock->num_waiting++;
- do {
- lock->wait_states |= WRITE_LOCK;
- LWP_WaitProcess(&lock->excl_locked);
- } while (lock->readers_reading);
- lock->num_waiting--;
- lock->excl_locked = WRITE_LOCK;
- break;
-
- default:
- errx(-1, "Can't happen, bad LOCK type: %d\n", how);
- /* NOTREACHED */
- }
-}
-
-/* release a lock, giving preference to new readers */
-void
-Lock_ReleaseR(struct Lock *lock)
-{
- if (lock->wait_states & READ_LOCK) {
- lock->wait_states &= ~READ_LOCK;
- LWP_NoYieldSignal(&lock->readers_reading);
- }
- else {
- lock->wait_states &= ~EXCL_LOCKS;
- LWP_NoYieldSignal(&lock->excl_locked);
- }
-}
-
-/* release a lock, giving preference to new writers */
-void
-Lock_ReleaseW(struct Lock *lock)
-{
- if (lock->wait_states & EXCL_LOCKS) {
- lock->wait_states &= ~EXCL_LOCKS;
- LWP_NoYieldSignal(&lock->excl_locked);
- }
- else {
- lock->wait_states &= ~READ_LOCK;
- LWP_NoYieldSignal(&lock->readers_reading);
- }
-}
-
-/*
- * These next guys exist to provide an interface to drop a lock atomically with
- * blocking. They're trivial to do in a non-preemptive LWP environment.
- */
-
-/* release a write lock and sleep on an address, atomically */
-void
-LWP_WaitProcessR(char *addr, struct Lock *alock)
-{
- ReleaseReadLock(alock);
- LWP_WaitProcess(addr);
-}
-
-/* release a write lock and sleep on an address, atomically */
-void
-LWP_WaitProcessW(char *addr, struct Lock *alock)
-{
- ReleaseWriteLock(alock);
- LWP_WaitProcess(addr);
-}
-
-/* release a write lock and sleep on an address, atomically */
-void
-LWP_WaitProcessS(char *addr, struct Lock *alock)
-{
- ReleaseSharedLock(alock);
- LWP_WaitProcess(addr);
-}
-
-#ifndef HAVE___FUNCTION__
-#define __FUNCTION__ "unknown"
-#endif
-
-#define PANICPRINT(msg) fprintf(stderr,"Panic in %s at %s:%d: %s\n", __FUNCTION__, __FILE__, __LINE__, msg)
-
-static int
-WillBlock (struct Lock *lock, int how)
-{
- switch (how) {
- case READ_LOCK:
- return ((lock)->excl_locked & WRITE_LOCK) || (lock)->wait_states;
- case WRITE_LOCK:
- return (lock)->excl_locked || (lock)->readers_reading;
- case SHARED_LOCK:
- return (lock)->excl_locked || (lock)->wait_states;
- default:
- PANICPRINT("unknown locking type");
- return 1; /* Block if unknown */
- }
-}
-
-static void
-ObtainOneLock(struct Lock *lock, int how)
-{
- switch (how) {
- case READ_LOCK:
- if (!WillBlock(lock, how))
- (lock) -> readers_reading++;
- else
- Lock_Obtain(lock, how);
- break;
- case WRITE_LOCK:
- case SHARED_LOCK:
- if (!WillBlock(lock, how))
- (lock) -> excl_locked = how;
- else
- Lock_Obtain(lock, how);
- break;
- default:
- PANICPRINT("unknown locking type");
- fprintf(stderr,"%d\n",how);
- }
-}
-
-static void
-ReleaseOneLock(struct Lock *lock, int how)
-{
- switch(how) {
- case READ_LOCK:
- if (!--(lock)->readers_reading && (lock)->wait_states)
- Lock_ReleaseW(lock);
- break;
- case WRITE_LOCK:
- (lock)->excl_locked &= ~WRITE_LOCK;
- if ((lock)->wait_states) Lock_ReleaseR(lock);
- break;
- case SHARED_LOCK:
- (lock)->excl_locked &= ~(SHARED_LOCK | WRITE_LOCK);
- if ((lock)->wait_states) Lock_ReleaseR(lock);
- break;
- default:
- PANICPRINT("unknown locking type");
- }
-}
-
-/*
- * Obtains two locks in a secure fashion (that's the idea)
- *
- * Takes two locks and two locking modes as parameters.
- */
-
-void
-_ObtainTwoLocks(struct Lock *lock1, int how1,
- struct Lock *lock2, int how2)
-{
- struct timeval timeout;
-
- timeout.tv_sec = 0;
- timeout.tv_usec = 1000;
-
-start:
- ObtainOneLock(lock1, how1);
- if (WillBlock(lock2, how2)) {
- ReleaseOneLock(lock1, how1);
- IOMGR_Select(0, 0, 0, 0, &timeout);
- goto start;
- } else {
- ObtainOneLock(lock2, how2);
- }
-}
diff --git a/usr.sbin/afs/src/lwp/lock.h b/usr.sbin/afs/src/lwp/lock.h
deleted file mode 100644
index 20e124a230c..00000000000
--- a/usr.sbin/afs/src/lwp/lock.h
+++ /dev/null
@@ -1,308 +0,0 @@
-#ifndef LWP_LOCK_H
-#define LWP_LOCK_H
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/* $arla: lock.h,v 1.13 2002/06/01 17:47:48 lha Exp $ */
-
-/*******************************************************************\
-* *
-* Information Technology Center *
-* Carnegie-Mellon University *
-* *
-* *
-* *
-\*******************************************************************/
-
-/*
- Include file for using Vice locking routines.
-*/
-
-/* The following macros allow multi statement macros to be defined safely, i.e.
- - the multi statement macro can be the object of an if statement;
- - the call to the multi statement macro may be legally followed by a semi-colon.
- BEGINMAC and ENDMAC have been tested with both the portable C compiler and
- Hi-C. Both compilers were from the Palo Alto 4.2BSD software releases, and
- both optimized out the constant loop code. For an example of the use
- of BEGINMAC and ENDMAC, see the definition for ReleaseWriteLock, below.
- An alternative to this, using "if(1)" for BEGINMAC is not used because it
- may generate worse code with pcc, and may generate warning messages with hi-C.
-*/
-
-#define BEGINMAC do {
-#define ENDMAC } while (0)
-
-/*
- * all locks wait on excl_locked except for READ_LOCK, which waits on
- * readers_reading
- */
-
-struct Lock {
- unsigned char wait_states; /* type of lockers waiting */
- unsigned char excl_locked; /* anyone have boosted, shared or write lock? */
- unsigned char readers_reading;/* # readers actually with read locks */
- unsigned char num_waiting; /* probably need this soon */
- int thread_index; /* thread that have a exclusive lock */
-#ifdef LOCK_TRACE
- char *file;
- int line;
-#endif /* LOCK_TRACE */
-};
-
-/* Prototypes */
-
-void Lock_ReleaseR(struct Lock *);
-void Lock_ReleaseW(struct Lock *);
-void Lock_Obtain(struct Lock *, int);
-void Lock_Init(struct Lock *);
-
-#define READ_LOCK 1
-#define WRITE_LOCK 2
-#define SHARED_LOCK 4
-/* this next is not a flag, but rather a parameter to Lock_Obtain */
-#define BOOSTED_LOCK 6
-
-/* next defines wait_states for which we wait on excl_locked */
-#define EXCL_LOCKS (WRITE_LOCK|SHARED_LOCK)
-
-#ifdef LOCK_DEBUG
-#define DEBUGWRITE(message,lock) do { \
- fprintf(stderr,"th#%d ", LWP_Index()); \
- fprintf(stderr,message,lock,__FILE__,__LINE__); } while (0)
-#define DEBUGWRITE_4(message,lock1,how1,lock2,how2) do { \
- fprintf(stderr,"th#%d ", LWP_Index()); \
- fprintf(stderr,message,lock1,how1,lock2,how2,__FILE__,__LINE__); } while (0)
-#else
-#define DEBUGWRITE(message,lock) do { ; } while (0)
-#define DEBUGWRITE_4(message,lock1,how1,lock2,how2) do { ; } while (0)
-#endif
-
-#ifdef LOCK_TRACE
-#define StoreFileLine(lock, f, l) \
- (lock)->file = f; \
- (lock)->line = l;
-#define GetTraceFile(lock) (lock)->file
-#define GetTraceLine(lock) (lock)->line
-#else
-#define StoreFileLine(lock, f, l)
-#define GetTraceFile(lock) "no_lock_trace"
-#define GetTraceLine(lock) 0
-#endif
-
-#ifdef NDEBUG
-#define LOCK_CHECK_OWNER 0
-#else
-#define LOCK_CHECK_OWNER 1
-#endif
-
-#ifdef LOCK_CHECK_OWNER
-#define AssertNotLockOwner(lock,owner) do { \
- if ((lock)->thread_index == (owner)) { \
- fprintf(stderr, \
- "AssertNotLockOwner failed on %s:%d with lock %p, " \
- "owned by %d, locked at (%s:%d)\n", \
- __FILE__, __LINE__, \
- (lock), (owner), \
- GetTraceFile(lock), GetTraceLine(lock)); \
- abort(); \
- } \
-} while (0)
-
-#define AssertLockOwner(lock,owner) do { \
- if ((lock)->thread_index != (owner)) { \
- fprintf(stderr, \
- "AssertLockOwner failed on %s:%d with lock %p, " \
- "should be owned by %d, " \
- "was owned by %d, locked at (%s:%d)\n", \
- __FILE__, __LINE__, \
- (lock), (owner), (lock)->thread_index, \
- GetTraceFile(lock), GetTraceLine(lock)); \
- abort(); \
- } \
-} while (0)
-
-#else /* !LOCK_CHECK_OWNER */
-
-#define AssertNotLockOwner(lock,owner) do { ; } while (0)
-#define AssertLockOwner(lock,owner) do { ; } while (0)
-
-#endif /* LOCK_CHECK_OWNER */
-
-#define AssertExclLocked(lock) \
- BEGINMAC \
- AssertLockOwner(lock,LWP_Index()); \
- ENDMAC \
-
-#define AssertNotExclLocked(lock) \
- BEGINMAC \
- AssertLockOwner(lock,LWP_INVALIDTHREADID); \
- ENDMAC \
-
-#define ObtainReadLock(lock) \
- BEGINMAC \
- DEBUGWRITE("ObtainReadLock: %p at %s:%d starting\n",lock); \
- AssertNotLockOwner(lock,LWP_Index()); \
- RealObtainReadLock(lock) \
- AssertLockOwner(lock,LWP_INVALIDTHREADID); \
- StoreFileLine(lock, __FILE__, __LINE__) \
- DEBUGWRITE("ObtainReadLock: %p at %s:%d got it\n",lock);\
- ENDMAC
-
-#define ObtainWriteLock(lock) \
- BEGINMAC \
- DEBUGWRITE("ObtainWriteLock: %p at %s:%d starting\n",lock); \
- AssertNotLockOwner(lock,LWP_Index()); \
- RealObtainWriteLock(lock) \
- AssertLockOwner(lock,LWP_Index()); \
- StoreFileLine(lock, __FILE__, __LINE__) \
- DEBUGWRITE("ObtainWriteLock: %p at %s:%d got it\n",lock);\
- ENDMAC
-
-#define ObtainSharedLock(lock) \
- BEGINMAC \
- DEBUGWRITE("ObtainSharedLock: %p at %s:%d starting\n",lock); \
- AssertNotLockOwner(lock,LWP_Index()); \
- RealObtainSharedLock(lock) \
- StoreFileLine(lock, __FILE__, __LINE__) \
- DEBUGWRITE("ObtainSharedLock: %p at %s:%d got it\n",lock);\
- ENDMAC
-
-#define BoostSharedLock(lock) \
- BEGINMAC \
- DEBUGWRITE("BoostSharedLock: %p at %s:%d starting\n",lock); \
- AssertNotLockOwner(lock,LWP_Index()); \
- RealBoostSharedLock(lock) \
- AssertLockOwner(lock,LWP_Index()); \
- StoreFileLine(lock, __FILE__, __LINE__) \
- DEBUGWRITE("BoostSharedLock: %p at %s:%d got it\n",lock);\
- ENDMAC
-
-#define UnBoostSharedLock(lock) \
- BEGINMAC \
- DEBUGWRITE("UnBoostSharedLock: %p at %s:%d starting\n",lock); \
- AssertNotLockOwner(lock,LWP_Index()); \
- RealUnboostSharedLock(lock) \
- AssertLockOwner(lock,LWP_INVALIDTHREADID); \
- StoreFileLine(lock, __FILE__, __LINE__) \
- DEBUGWRITE("UnBoostSharedLock: %p at %s:%d got it\n",lock);\
- ENDMAC
-
-#define ReleaseReadLock(lock) \
- BEGINMAC \
- DEBUGWRITE("ReleaseReadLock: %p at %s:%d\n",lock);\
- AssertNotLockOwner(lock,LWP_Index()); \
- RealReleaseReadLock(lock) \
- AssertLockOwner(lock,LWP_INVALIDTHREADID); \
- ENDMAC
-
-#define ReleaseWriteLock(lock) \
- BEGINMAC \
- DEBUGWRITE("ReleaseWriteLock: %p at %s:%d\n",lock);\
- AssertLockOwner(lock,LWP_Index()); \
- RealReleaseWriteLock(lock) \
- AssertLockOwner(lock,LWP_INVALIDTHREADID); \
- ENDMAC
-
-#define ReleaseSharedLock(lock) \
- BEGINMAC \
- DEBUGWRITE("ReleaseSharedLock: %p at %s:%d\n",lock);\
- RealReleaseSharedLock(lock) \
- AssertLockOwner(lock,LWP_INVALIDTHREADID); \
- ENDMAC
-
-#define RealObtainReadLock(lock) \
- if (!((lock)->excl_locked & WRITE_LOCK) && !(lock)->wait_states)\
- (lock) -> readers_reading++;\
- else\
- Lock_Obtain(lock, READ_LOCK);
-
-#define RealObtainWriteLock(lock)\
- if (!(lock)->excl_locked && !(lock)->readers_reading) \
- (lock) -> excl_locked = WRITE_LOCK;\
- else\
- Lock_Obtain(lock, WRITE_LOCK); \
- (lock) -> thread_index = LWP_Index();
-
-
-#define RealObtainSharedLock(lock)\
- if (!(lock)->excl_locked && !(lock)->wait_states)\
- (lock) -> excl_locked = SHARED_LOCK;\
- else\
- Lock_Obtain(lock, SHARED_LOCK);
-
-#define RealBoostSharedLock(lock)\
- if (!(lock)->readers_reading)\
- (lock)->excl_locked = WRITE_LOCK;\
- else\
- Lock_Obtain(lock, BOOSTED_LOCK); \
- (lock) -> thread_index = LWP_Index();
-
-/* this must only be called with a WRITE or boosted SHARED lock! */
-#define RealUnboostSharedLock(lock)\
- (lock) -> excl_locked = SHARED_LOCK; \
- (lock) -> thread_index = LWP_INVALIDTHREADID; \
- if((lock)->wait_states) \
- Lock_ReleaseR(lock);
-
-#define RealReleaseReadLock(lock)\
- if (!--(lock)->readers_reading && (lock)->wait_states)\
- Lock_ReleaseW(lock) ;
-
-
-#define RealReleaseWriteLock(lock)\
- (lock) -> thread_index = LWP_INVALIDTHREADID; \
- (lock)->excl_locked &= ~WRITE_LOCK;\
- if ((lock)->wait_states) Lock_ReleaseR(lock);
-
-/* can be used on shared or boosted (write) locks */
-#define RealReleaseSharedLock(lock)\
- (lock) -> thread_index = LWP_INVALIDTHREADID; \
- (lock)->excl_locked &= ~(SHARED_LOCK | WRITE_LOCK);\
- if ((lock)->wait_states) Lock_ReleaseR(lock);
-
-/* I added this next macro to make sure it is safe to nuke a lock -- Mike K. */
-#define LockWaiters(lock)\
- ((int) ((lock)->num_waiting))
-
-#define CheckLock(lock)\
- ((lock)->excl_locked? (int) -1 : (int) (lock)->readers_reading)
-
-#define WriteLocked(lock)\
- ((lock)->excl_locked & WRITE_LOCK)
-
-void LWP_WaitProcessR(char *addr, struct Lock *alock);
-void LWP_WaitProcessW(char *addr, struct Lock *alock);
-void LWP_WaitProcessS(char *addr, struct Lock *alock);
-
-/* This attempts to obtain two locks in a secure fashion */
-
-#define ObtainTwoLocks(lock1, how1, lock2, how2) \
- BEGINMAC\
- DEBUGWRITE_4("ObtainTwoLocks: %p(%d) %p(%d) at %s:%d\n",lock1,how1,lock2,how2);\
- _ObtainTwoLocks(lock1, how1, lock2, how2);\
- ENDMAC
-
-void
-_ObtainTwoLocks(struct Lock *lock1, int how1,
- struct Lock *lock2, int how2);
-
-#endif /* LOCK_H */
diff --git a/usr.sbin/afs/src/lwp/lwp_asm.c b/usr.sbin/afs/src/lwp/lwp_asm.c
deleted file mode 100644
index 48a5cf4db51..00000000000
--- a/usr.sbin/afs/src/lwp/lwp_asm.c
+++ /dev/null
@@ -1,1189 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/*******************************************************************\
-* *
-* Information Technology Center *
-* Carnegie-Mellon University *
-* *
-* *
-\*******************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-/* allocate externs here */
-#define LWP_KERNEL
-
-#include <lwp.h>
-#include "preempt.h"
-
-RCSID("$arla: lwp_asm.c,v 1.27 2002/07/16 19:35:40 lha Exp $");
-
-#ifdef AFS_AIX32_ENV
-#include <ulimit.h>
-#include <sys/errno.h>
-#include <sys/user.h>
-#include <sys/pseg.h>
-#include <sys/core.h>
-#pragma alloca
-#endif
-
-#define ON 1
-#define OFF 0
-#define TRUE 1
-#define FALSE 0
-#define READY 2
-#define WAITING 3
-#define DESTROYED 4
-#define QWAITING 5
-#define MAXINT (~(1<<((sizeof(int)*8)-1)))
-
-
-/*
- * Make sure that alignment and saving of data is right
- */
-
-#if defined(__alpha) || defined(__uxpv__) || defined(__sparcv9) || defined(__x86_64__) || defined(__m88k__) || defined(__LP64__)
-#define REGSIZE 8
-#else
-#define REGSIZE 4
-#endif
-
-/*
- * Space before first stack frame expressed in registers.
- *
- * This should maybe be a ABI specific value defined somewhere else.
- */
-
-#ifdef __hp9000s800
-#define STACK_HEADROOM 16
-#elif defined(__s390__)
-#define STACK_HEADROOM 24
-#elif defined(__m88k__)
-#define STACK_HEADROOM (32 / REGSIZE)
-#else
-#define STACK_HEADROOM 5
-#endif
-
-/* Debugging macro */
-#ifdef DEBUG
-#define Debug(level, msg)\
- if (lwp_debug && lwp_debug >= level) {\
- printf("***LWP (%p): ", lwp_cpptr);\
- printf msg;\
- putchar('\n');\
- }
-
-#else
-#define Debug(level, msg)
-
-#endif
-
-/* Prototypes */
-static void Abort_LWP(char *msg) ;
-static void Dispatcher(void);
-static void Create_Process_Part2(void);
-static void purge_dead_pcbs(void) ;
-static void Overflow_Complain (void) ;
-static void Dispose_of_Dead_PCB (PROCESS cur) ;
-static void Free_PCB(PROCESS pid) ;
-static void Exit_LWP(void);
-static void Initialize_PCB(PROCESS temp, int priority, char *stack,
- int stacksize, void (*ep)() , char *parm,
- const char *name) ;
-static long Initialize_Stack(char *stackptr,int stacksize) ;
-static int Stack_Used(char *stackptr, int stacksize) ;
-static int Internal_Signal(char *event) ;
-char (*RC_to_ASCII());
-
-#define MAX_PRIORITIES (LWP_MAX_PRIORITY+1)
-
-struct QUEUE {
- PROCESS head;
- int count;
-} runnable[MAX_PRIORITIES], blocked;
-/*
- * Invariant for runnable queues: The head of each queue points to the
- * currently running process if it is in that queue, or it points to the
- * next process in that queue that should run.
- */
-
-/* Offset of stack field within pcb -- used by stack checking stuff */
-int stack_offset;
-
-/* special user-tweakable option for AIX */
-int lwp_MaxStackSize = 32768;
-
-/* biggest LWP stack created so far */
-int lwp_MaxStackSeen = 0;
-
-/* Stack checking action */
-int lwp_overflowAction = LWP_SOABORT;
-
-/* Controls stack size counting. */
-int lwp_stackUseEnabled = TRUE; /* pay the price */
-
-int lwp_nextindex;
-
-static void
-lwp_remove(PROCESS p, struct QUEUE *q)
-{
- /* Special test for only element on queue */
- if (q->count == 1)
- q -> head = NULL;
- else {
- /* Not only element, do normal remove */
- p -> next -> prev = p -> prev;
- p -> prev -> next = p -> next;
- }
- /* See if head pointing to this element */
- if (q->head == p) q -> head = p -> next;
- q->count--;
- p -> next = p -> prev = NULL;
-}
-
-static void
-insert(PROCESS p, struct QUEUE *q)
-{
- if (q->head == NULL) { /* Queue is empty */
- q -> head = p;
- p -> next = p -> prev = p;
- } else { /* Regular insert */
- p -> prev = q -> head -> prev;
- q -> head -> prev -> next = p;
- q -> head -> prev = p;
- p -> next = q -> head;
- }
- q->count++;
-}
-
-static void
-move(PROCESS p, struct QUEUE *from, struct QUEUE *to)
-{
- lwp_remove(p, from);
-
- insert(p, to);
-}
-
-/* Iterator macro */
-#define for_all_elts(var, q, body)\
- {\
- PROCESS var, _NEXT_;\
- int _I_;\
- for (_I_=q.count, var = q.head; _I_>0; _I_--, var=_NEXT_) {\
- _NEXT_ = var -> next;\
- body\
- }\
- }
-
-/* */
-/*****************************************************************************\
-* *
-* Following section documents the Assembler interfaces used by LWP code *
-* *
-\*****************************************************************************/
-
-/*
- * savecontext(int (*ep)(), struct lwp_context *savearea, char *sp);
- * XXX - the above prototype is a lie.
- * Stub for Assembler routine that will
- * save the current SP value in the passed
- * context savearea and call the function
- * whose entry point is in ep. If the sp
- * parameter is NULL, the current stack is
- * used, otherwise sp becomes the new stack
- * pointer.
- *
- * returnto(struct lwp_context *savearea);
- *
- * Stub for Assembler routine that will
- * restore context from a passed savearea
- * and return to the restored C frame.
- *
- */
-
-void savecontext(void (*)(), struct lwp_context *, char *);
-void returnto(struct lwp_context *);
-
-/* Macro to force a re-schedule. Strange name is historical */
-#define Set_LWP_RC() savecontext(Dispatcher, &lwp_cpptr->context, NULL)
-
-static struct lwp_ctl *lwp_init = 0;
-
-int
-LWP_QWait(void)
-{
- PROCESS tp;
- (tp=lwp_cpptr) -> status = QWAITING;
- lwp_remove(tp, &runnable[tp->priority]);
- Set_LWP_RC();
- return LWP_SUCCESS;
-}
-
-int
-LWP_QSignal(PROCESS pid)
-{
- if (pid->status == QWAITING) {
- pid->status = READY;
- insert(pid, &runnable[pid->priority]);
- return LWP_SUCCESS;
- }
- else return LWP_ENOWAIT;
-}
-
-#ifdef AFS_AIX32_ENV
-char *
-reserveFromStack(size)
- long size;
-{
- char *x;
- x = alloca(size);
- return x;
-}
-#endif
-
-#if defined(LWP_REDZONE) && defined(HAVE_MMAP)
-
-/*
- * Redzone protection of stack
- *
- * We protect one page before and one after the stack to make sure
- * none over/under runs the stack. The size of the stack is saved one
- * the first page together with a magic number to make sure we free
- * the right pages.
- *
- * If the operating system doesn't support mmap, turn redzone off in
- * the autoconf glue.
- */
-
-#define P_SIZE_OFFSET 16
-#define P_MAGIC 0x7442e938
-
-static void *
-lwp_stackmalloc(size_t size)
-{
- char *p, *p_after, *p_before;
- size_t pagesize = getpagesize();
- int pages = (size - 1) / pagesize + 1;
- int fd = -1;
-
-#ifndef MAP_ANON
-#define MAP_ANON 0
-#ifndef _PATH_DEV_ZERO
-#define _PATH_DEV_ZERO "/dev/zero"
-#endif
- fd = open(_PATH_DEV_ZERO, O_RDWR, 0644);
-#endif
-
- p = mmap(0, (pages + 2) * pagesize, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANON, fd, 0);
- if (p == MAP_FAILED) {
- perror("mmap");
- exit(-1);
- }
-
- p_before = p;
- p += pagesize;
- p_after = p + pages * pagesize;
-
- /* store the magic and the length in the first page */
-
- *((unsigned long *)p_before) = P_MAGIC;
- *((unsigned long *)(p_before + P_SIZE_OFFSET)) = (pages + 2) * pagesize;
-
- /* protect pages */
-
- if (mprotect(p_before, pagesize, PROT_NONE) < 0) {
- perror("mprotect before");
- exit(-1);
- }
- if (mprotect(p_after, pagesize, PROT_NONE) < 0) {
- perror("mprotect after");
- exit(-1);
- }
- return p;
-}
-
-static void
-lwp_stackfree(void *ptr, size_t len)
-{
- size_t pagesize = getpagesize();
- char *realptr;
- unsigned long magic;
- size_t length;
-
- if (((size_t)ptr) % pagesize != 0)
- exit(-1);
-
- realptr = ((char *)ptr) - pagesize;
-
- if (mprotect(realptr, pagesize, PROT_READ) < 0) {
- perror("mprotect");
- exit(-1);
- }
-
- magic = *((unsigned long *)realptr);
- if (magic != P_MAGIC)
- exit(-1);
- length = *((unsigned long *)(realptr + P_SIZE_OFFSET));
- if (len != length - 2 * pagesize)
- exit(-1);
-
- if (munmap(realptr, length) < 0) {
- perror("munmap");
- exit(1);
- }
-}
-
-#else
-
-static void *
-lwp_stackmalloc(size_t size)
-{
- return malloc(size);
-}
-
-static void
-lwp_stackfree(void *ptr, size_t len)
-{
- free(ptr);
-}
-#endif
-
-int
-LWP_CreateProcess(void (*ep)(), int stacksize, int priority,
- char *parm, const char *name, PROCESS *pid)
-{
- PROCESS temp, temp2;
-#ifdef AFS_AIX32_ENV
- static char *stackptr = 0;
-#else
- char *stackptr;
-#endif
-
- /*
- * on some systems (e.g. hpux), a minimum usable stack size has
- * been discovered
- */
- if (stacksize < AFS_LWP_MINSTACKSIZE)
- stacksize = AFS_LWP_MINSTACKSIZE;
-
- /* more stack size computations; keep track of for IOMGR */
- if (lwp_MaxStackSeen < stacksize)
- lwp_MaxStackSeen = stacksize;
-
- Debug(0, ("Entered LWP_CreateProcess"))
- /* Throw away all dead process control blocks */
- purge_dead_pcbs();
- if (!lwp_init)
- return LWP_EINIT;
-
-
- temp = (PROCESS) malloc(sizeof(struct lwp_pcb));
- if (temp == NULL) {
- Set_LWP_RC();
- return LWP_ENOMEM;
- }
-
- /* align stacksize */
- stacksize = REGSIZE * ((stacksize+REGSIZE-1) / REGSIZE);
-
-#ifdef AFS_AIX32_ENV
- if (!stackptr) {
- /*
- * The following signal action for AIX is necessary so that in case of a
- * crash (i.e. core is generated) we can include the user's data section
- * in the core dump. Unfortunately, by default, only a partial core is
- * generated which, in many cases, isn't too useful.
- *
- * We also do it here in case the main program forgets to do it.
- */
- struct sigaction nsa;
- extern int geteuid();
-
- sigemptyset(&nsa.sa_mask);
- nsa.sa_handler = SIG_DFL;
- nsa.sa_flags = SA_FULLDUMP;
- sigaction(SIGSEGV, &nsa, NULL);
-
- /*
- * First we need to increase the default resource limits,
- * if necessary, so that we can guarantee that we have the
- * resources to create the core file, but we can't always
- * do it as an ordinary user.
- */
- if (!geteuid()) {
- setlim(RLIMIT_FSIZE, 0, 1048575); /* 1 Gig */
- setlim(RLIMIT_STACK, 0, 65536); /* 65 Meg */
- setlim(RLIMIT_CORE, 0, 131072); /* 131 Meg */
- }
- /*
- * Now reserve in one scoop all the stack space that will be used
- * by the particular application's main (i.e. non-lwp) body. This
- * is plenty space for any of our applications.
- */
- stackptr = reserveFromStack(lwp_MaxStackSize);
- }
- stackptr -= stacksize;
-#else /* !AFS_AIX32_ENV */
- if ((stackptr = (char *) lwp_stackmalloc(stacksize)) == NULL) {
- Set_LWP_RC();
- free(temp);
- return LWP_ENOMEM;
- }
-#endif /* AFS_AIX32_ENV */
- if (priority < 0 || priority >= MAX_PRIORITIES) {
- Set_LWP_RC();
- free(temp);
- return LWP_EBADPRI;
- }
- Initialize_Stack(stackptr, stacksize);
- Initialize_PCB(temp, priority, stackptr, stacksize, ep, parm, name);
- insert(temp, &runnable[priority]);
- temp2 = lwp_cpptr;
-
- if (PRE_Block != 0)
- Abort_LWP("PRE_Block not 0");
-
- /* Gross hack: beware! */
- PRE_Block = 1;
- lwp_cpptr = temp;
-#ifdef __hp9000s800
- savecontext(Create_Process_Part2, &temp2->context,
- stackptr + (REGSIZE * STACK_HEADROOM));
-#else
- savecontext(Create_Process_Part2, &temp2->context,
- stackptr + stacksize - (REGSIZE * STACK_HEADROOM));
-#endif
- /* End of gross hack */
-
- Set_LWP_RC();
- *pid = temp;
- return 0;
-}
-
-/* returns pid of current process */
-int
-LWP_CurrentProcess(PROCESS *pid)
-{
- Debug(0, ("Entered Current_Process"))
- if (lwp_init) {
- *pid = lwp_cpptr;
- return LWP_SUCCESS;
- } else
- return LWP_EINIT;
-}
-
-#define LWPANCHOR (*lwp_init)
-
-/* destroy a lightweight process */
-int
-LWP_DestroyProcess(PROCESS pid)
-{
- PROCESS temp;
-
- Debug(0, ("Entered Destroy_Process"))
- if (lwp_init) {
- if (lwp_cpptr != pid) {
- Dispose_of_Dead_PCB(pid);
- Set_LWP_RC();
- } else {
- pid -> status = DESTROYED;
- move(pid, &runnable[pid->priority], &blocked);
- temp = lwp_cpptr;
-#ifdef __hp9000s800
- savecontext(Dispatcher, &(temp -> context),
- &(LWPANCHOR.dsptchstack[(REGSIZE * STACK_HEADROOM)]));
-#else
- savecontext(Dispatcher, &(temp -> context),
- &(LWPANCHOR.dsptchstack[(sizeof LWPANCHOR.dsptchstack)
- - (REGSIZE * STACK_HEADROOM)]));
-#endif
- }
- return LWP_SUCCESS;
- } else
- return LWP_EINIT;
-}
-
-/* explicit voluntary preemption */
-int
-LWP_DispatchProcess(void)
-{
- Debug(2, ("Entered Dispatch_Process"))
- if (lwp_init) {
- Set_LWP_RC();
- return LWP_SUCCESS;
- } else
- return LWP_EINIT;
-}
-
-#ifdef DEBUG
-static void Dump_One_Process(PROCESS pid);
-
-static void
-Dump_Processes(void)
-{
- if (lwp_init) {
- int i;
- for (i=0; i<MAX_PRIORITIES; i++)
- for_all_elts(x, runnable[i], {
- printf("[Priority %d]\n", i);
- Dump_One_Process(x);
- })
- for_all_elts(x, blocked, { Dump_One_Process(x); })
- } else
- printf("***LWP: LWP support not initialized\n");
-}
-#endif
-
-/* returns process priority */
-int
-LWP_GetProcessPriority(PROCESS pid, int *priority)
-{
- Debug(0, ("Entered Get_Process_Priority"))
- if (lwp_init) {
- *priority = pid -> priority;
- return 0;
- } else
- return LWP_EINIT;
-}
-
-int
-LWP_InitializeProcessSupport(int priority, PROCESS *pid)
-{
- PROCESS temp;
- struct lwp_pcb dummy;
- int i;
-
- Debug(0, ("Entered LWP_InitializeProcessSupport"))
- if (lwp_init != NULL) return LWP_SUCCESS;
-
- /* Set up offset for stack checking -- do this as soon as possible */
- stack_offset = (char *) &dummy.stack - (char *) &dummy;
-
- if (priority >= MAX_PRIORITIES) return LWP_EBADPRI;
- for (i=0; i<MAX_PRIORITIES; i++) {
- runnable[i].head = NULL;
- runnable[i].count = 0;
- }
- blocked.head = NULL;
- blocked.count = 0;
- lwp_init = (struct lwp_ctl *) malloc(sizeof(struct lwp_ctl));
- temp = (PROCESS) malloc(sizeof(struct lwp_pcb));
- if (lwp_init == NULL || temp == NULL)
- Abort_LWP("Insufficient Storage to Initialize LWP Support");
- LWPANCHOR.processcnt = 1;
- LWPANCHOR.outerpid = temp;
- LWPANCHOR.outersp = NULL;
- Initialize_PCB(temp, priority, NULL, 0, NULL, NULL,
- "Main Process [created by LWP]");
- insert(temp, &runnable[priority]);
- savecontext(Dispatcher, &temp->context, NULL);
- LWPANCHOR.outersp = temp -> context.topstack;
- Set_LWP_RC();
- *pid = temp;
- return LWP_SUCCESS;
-}
-
-/* signal the occurence of an event */
-int
-LWP_INTERNALSIGNAL(void *event, int yield)
-{
- Debug(2, ("Entered LWP_SignalProcess"))
- if (lwp_init) {
- int rc;
- rc = Internal_Signal(event);
- if (yield) Set_LWP_RC();
- return rc;
- } else
- return LWP_EINIT;
-}
-
-/* terminate all LWP support */
-int
-LWP_TerminateProcessSupport(void)
-{
- int i;
-
- Debug(0, ("Entered Terminate_Process_Support"))
- if (lwp_init == NULL) return LWP_EINIT;
- if (lwp_cpptr != LWPANCHOR.outerpid)
- Abort_LWP("Terminate_Process_Support invoked from wrong process!");
- for (i=0; i<MAX_PRIORITIES; i++)
- for_all_elts(cur, runnable[i], { Free_PCB(cur); })
- for_all_elts(cur, blocked, { Free_PCB(cur); })
- free(lwp_init);
- lwp_init = NULL;
- return LWP_SUCCESS;
-}
-
-/* wait on m of n events */
-int
-LWP_MwaitProcess(int wcount, char *evlist[])
-{
- int ecount, i;
-
-
- Debug(0, ("Entered Mwait_Process [waitcnt = %d]", wcount))
-
- if (evlist == NULL) {
- Set_LWP_RC();
- return LWP_EBADCOUNT;
- }
-
- for (ecount = 0; evlist[ecount] != NULL; ecount++) ;
-
- if (ecount == 0) {
- Set_LWP_RC();
- return LWP_EBADCOUNT;
- }
-
- if (lwp_init) {
-
- if (wcount>ecount || wcount<0) {
- Set_LWP_RC();
- return LWP_EBADCOUNT;
- }
- if (ecount > lwp_cpptr->eventlistsize) {
-
- lwp_cpptr->eventlist = (char **)realloc(lwp_cpptr->eventlist,
- ecount*sizeof(char *));
- lwp_cpptr->eventlistsize = ecount;
- }
- for (i=0; i<ecount; i++) lwp_cpptr -> eventlist[i] = evlist[i];
- if (wcount > 0) {
- lwp_cpptr -> status = WAITING;
-
- move(lwp_cpptr, &runnable[lwp_cpptr->priority], &blocked);
- }
- lwp_cpptr -> wakevent = 0;
- lwp_cpptr -> waitcnt = wcount;
- lwp_cpptr -> eventcnt = ecount;
-
- Set_LWP_RC();
-
- return LWP_SUCCESS;
- }
-
- return LWP_EINIT;
-}
-
-/* wait on a single event */
-int
-LWP_WaitProcess(void *event)
-{
- char *tempev[2];
-
- Debug(2, ("Entered Wait_Process"))
- if (event == NULL) return LWP_EBADEVENT;
- tempev[0] = event;
- tempev[1] = NULL;
- return LWP_MwaitProcess(1, tempev);
-}
-
-int
-LWP_StackUsed(PROCESS pid, int *max, int *used)
-{
- *max = pid -> stacksize;
- *used = Stack_Used(pid->stack, *max);
- if (*used == 0)
- return LWP_NO_STACK;
- return LWP_SUCCESS;
-}
-
-/*
- * The following functions are strictly
- * INTERNAL to the LWP support package.
- */
-
-static void
-Abort_LWP(char *msg)
-{
- struct lwp_context tempcontext;
-
- Debug(0, ("Entered Abort_LWP"))
- printf("***LWP: %s\n",msg);
- printf("***LWP: Abort --- dumping PCBs ...\n");
-#ifdef DEBUG
- Dump_Processes();
-#endif
- if (LWPANCHOR.outersp == NULL)
- Exit_LWP();
- else
- savecontext(Exit_LWP, &tempcontext, LWPANCHOR.outersp);
-}
-
-/* creates a context for the new process */
-static void
-Create_Process_Part2(void)
-{
- PROCESS temp;
-
- Debug(2, ("Entered Create_Process_Part2"))
- temp = lwp_cpptr; /* Get current process id */
- savecontext(Dispatcher, &temp->context, NULL);
- (*temp->ep)(temp->parm);
- LWP_DestroyProcess(temp);
-}
-
-/* remove a PCB from the process list */
-static void
-Delete_PCB(PROCESS pid)
-{
- Debug(4, ("Entered Delete_PCB"))
- lwp_remove(pid, (pid->blockflag ||
- pid->status==WAITING ||
- pid->status==DESTROYED
- ? &blocked
- : &runnable[pid->priority]));
- LWPANCHOR.processcnt--;
-}
-
-#ifdef DEBUG
-static void
-Dump_One_Process(PROCESS pid)
-{
- int i;
-
- printf("***LWP: Process Control Block at %p\n", pid);
- printf("***LWP: Name: %s\n", pid->name);
- if (pid->ep != NULL)
- printf("***LWP: Initial entry point: %p\n", pid->ep);
- if (pid->blockflag) printf("BLOCKED and ");
- switch (pid->status) {
- case READY: printf("READY"); break;
- case WAITING: printf("WAITING"); break;
- case DESTROYED: printf("DESTROYED"); break;
- default: printf("unknown");
- }
- putchar('\n');
- printf("***LWP: Priority: %d \tInitial parameter: %p\n",
- pid->priority, pid->parm);
- if (pid->stacksize != 0) {
- printf("***LWP: Stacksize: %d \tStack base address: %p\n",
- pid->stacksize, pid->stack);
- printf("***LWP: HWM stack usage: ");
- printf("%d\n", Stack_Used(pid->stack,pid->stacksize));
- }
- printf("***LWP: Current Stack Pointer: %p\n", pid->context.topstack);
- if (pid->eventcnt > 0) {
- printf("***LWP: Number of events outstanding: %d\n", pid->waitcnt);
- printf("***LWP: Event id list:");
- for (i=0;i<pid->eventcnt;i++)
- printf(" %p", pid->eventlist[i]);
- putchar('\n');
- }
- if (pid->wakevent>0)
- printf("***LWP: Number of last wakeup event: %d\n", pid->wakevent);
-}
-#endif
-
-static void
-purge_dead_pcbs(void)
-{
- for_all_elts(cur, blocked, {
- if (cur->status == DESTROYED) Dispose_of_Dead_PCB(cur);
- })
-}
-
-int LWP_TraceProcesses = 0;
-
-/* Lightweight process dispatcher */
-static void
-Dispatcher(void)
-{
- int i;
-#ifdef DEBUG
- static int dispatch_count = 0;
-
- if (LWP_TraceProcesses > 0) {
- for (i=0; i<MAX_PRIORITIES; i++) {
- printf("[Priority %d, runnable (%d):", i, runnable[i].count);
- for_all_elts(p, runnable[i], {
- printf(" \"%s\"", p->name);
- })
- puts("]");
- }
- printf("[Blocked (%d):", blocked.count);
- for_all_elts(p, blocked, {
- printf(" \"%s\"", p->name);
- })
- puts("]");
- }
-#endif
-
- /*
- * Check for stack overflow if this lwp has a stack. Check for
- * the guard word at the front of the stack being damaged and
- * for the stack pointer being below the front of the stack.
- * WARNING! This code assumes that stacks grow downward.
- */
-#ifdef __hp9000s800
- /* Fix this (stackcheck at other end of stack???) */
- if (lwp_cpptr != NULL && lwp_cpptr->stack != NULL
- && (lwp_cpptr->stackcheck !=
- *(long *)((lwp_cpptr->stack) + lwp_cpptr->stacksize - 4)
- || lwp_cpptr->context.topstack >
- lwp_cpptr->stack + lwp_cpptr->stacksize - 4)) {
-#else
- if (lwp_cpptr != NULL && lwp_cpptr->stack != NULL
- && (lwp_cpptr->stackcheck != *(long *)(lwp_cpptr->stack)
- || lwp_cpptr->context.topstack < lwp_cpptr->stack)) {
-#endif
-
- printf("stackcheck = %lul: stack = %lul\n",
- lwp_cpptr->stackcheck,
- *(long *)lwp_cpptr->stack);
- printf("topstack = %lul\n", *(long *)lwp_cpptr->context.topstack);
-
- switch (lwp_overflowAction) {
- case LWP_SOQUIET:
- break;
- case LWP_SOABORT:
- Overflow_Complain();
- abort ();
- case LWP_SOMESSAGE:
- default:
- Overflow_Complain();
- lwp_overflowAction = LWP_SOQUIET;
- break;
- }
- }
-
-
- /*
- * Move head of current runnable queue forward if current LWP
- * is still in it.
- */
- if (lwp_cpptr != NULL && lwp_cpptr == runnable[lwp_cpptr->priority].head)
- runnable[lwp_cpptr->priority].head = runnable[lwp_cpptr->priority].head->next;
-
- /* Find highest priority with runnable processes. */
- for (i = MAX_PRIORITIES - 1; i >= 0; i--)
- if (runnable[i].head != NULL)
- break;
-
- if (i < 0)
- Abort_LWP("No READY processes");
-
-#ifdef DEBUG
- if (LWP_TraceProcesses > 0)
- printf("Dispatch %d [PCB at %p] \"%s\"\n",
- ++dispatch_count,
- runnable[i].head,
- runnable[i].head->name);
-#endif
- if (PRE_Block != 1) Abort_LWP("PRE_Block not 1");
- lwp_cpptr = runnable[i].head;
-
- returnto(&lwp_cpptr->context);
-}
-
-/* Complain of a stack overflow to stderr without using stdio. */
-static void
-Overflow_Complain (void)
-{
- static char msg1[] = "LWP: stack overflow in process ";
- static char msg2[] = "!\n";
-
- write (2, msg1, sizeof(msg1) - 1);
- write (2, lwp_cpptr->name, strlen(lwp_cpptr->name));
- write (2, msg2, sizeof(msg2) - 1);
-}
-
-static void
-Dispose_of_Dead_PCB (PROCESS cur)
-{
- Debug(4, ("Entered Dispose_of_Dead_PCB"))
- Delete_PCB(cur);
- Free_PCB(cur);
-/*
- Internal_Signal(cur);
-*/
-}
-
-static void
-Exit_LWP(void)
-{
- exit(-1);
-}
-
-static void
-Free_PCB(PROCESS pid)
-{
- Debug(4, ("Entered Free_PCB"))
- if (pid -> stack != NULL) {
- Debug(0, ("HWM stack usage: %d, [PCB at %p]",
- Stack_Used(pid->stack,pid->stacksize), pid))
- lwp_stackfree(pid -> stack, pid->stacksize);
- }
- if (pid->eventlist != NULL) free(pid->eventlist);
- free(pid);
-}
-
-static void
-Initialize_PCB(PROCESS temp, int priority, char *stack, int stacksize,
- void (*ep)(), char *parm, const char *name)
-{
- Debug(4, ("Entered Initialize_PCB"))
- if (name != NULL) {
- strncpy(temp -> name, name, sizeof(temp -> name));
- temp -> name[sizeof(temp -> name) - 1] = '\0';
- } else
- temp -> name[0] = '\0';
- temp -> status = READY;
- temp -> eventlist = (char **)malloc(EVINITSIZE*sizeof(char *));
- temp -> eventlistsize = EVINITSIZE;
- temp -> eventcnt = 0;
- temp -> wakevent = 0;
- temp -> waitcnt = 0;
- temp -> blockflag = 0;
- temp -> iomgrRequest = 0;
- temp -> priority = priority;
- temp -> index = lwp_nextindex++;
- temp -> stack = stack;
- temp -> stacksize = stacksize;
-#ifdef __hp9000s800
- if (temp -> stack != NULL)
- temp -> stackcheck = *(long *) ((temp -> stack) + stacksize - REGSIZE);
-#else
- if (temp -> stack != NULL)
- temp -> stackcheck = *(long *) (temp -> stack);
-#endif
- temp -> ep = ep;
- temp -> parm = parm;
- temp -> misc = NULL; /* currently unused */
- temp -> next = NULL;
- temp -> prev = NULL;
- temp -> rused = 0;
- temp -> level = 1; /* non-preemptable */
-}
-
-static int
-Internal_Signal(char *event)
-{
- int rc = LWP_ENOWAIT;
- int i;
-
- Debug(0, ("Entered Internal_Signal [event id %p]", event))
- if (!lwp_init) return LWP_EINIT;
- if (event == NULL) return LWP_EBADEVENT;
- for_all_elts(temp, blocked, {
- if (temp->status == WAITING)
- for (i=0; i < temp->eventcnt; i++) {
- if (temp -> eventlist[i] == event) {
- temp -> eventlist[i] = NULL;
- rc = LWP_SUCCESS;
- Debug(0, ("Signal satisfied for PCB %p", temp))
- if (--temp->waitcnt == 0) {
- temp -> status = READY;
- temp -> wakevent = i+1;
- move(temp, &blocked, &runnable[temp->priority]);
- break;
- }
- }
- }
- })
- return rc;
-}
-
-/* This can be any unlikely pattern except 0x00010203 or the reverse. */
-#define STACKMAGIC 0xBADBADBA
-static long
-Initialize_Stack(char *stackptr, int stacksize)
-{
- int i;
-
- Debug(4, ("Entered Initialize_Stack"))
- if (lwp_stackUseEnabled)
- for (i=0; i<stacksize; i++)
- stackptr[i] = i &0xff;
- else
-#ifdef __hp9000s800
- *(long *)(stackptr + stacksize - 4) = STACKMAGIC;
-#else
- *(long *)stackptr = STACKMAGIC;
-#endif
- return 0; /* XXX - added. No clue what it should be */
-}
-
-static int
-Stack_Used(char *stackptr, int stacksize)
-{
- int i;
-
-#ifdef __hp9000s800
- if (*(long *) (stackptr + stacksize - 4) == STACKMAGIC)
- return 0;
- else {
- for (i = stacksize - 1; i >= 0 ; i--)
- if ((unsigned char) stackptr[i] != (i & 0xff))
- return (i);
- return 0;
- }
-#else
- if (*(long *) stackptr == STACKMAGIC)
- return 0;
- else {
- for (i = 0; i < stacksize; i++)
- if ((unsigned char) stackptr[i] != (i & 0xff))
- return (stacksize - i);
- return 0;
- }
-#endif
-}
-
-
-/*
- * Finds a free rock and sets its value to Value.
- * Return codes:
- * LWP_SUCCESS Rock did not exist and a new one was used
- * LWP_EBADROCK Rock already exists.
- * LWP_ENOROCKS All rocks are in use.
-
- * From the above semantics, you can only set a rock value once.
- * This is specificallY to prevent multiple users of the LWP package from
- * accidentally using the same Tag value and clobbering others. You can always
- * use one level of indirection to obtain a rock whose contents can change.
- */
-
-int
-LWP_NewRock(int Tag, char *Value)
-{
- int i;
- struct rock *ra; /* rock array */
-
- ra = lwp_cpptr->rlist;
-
- for (i = 0; i < lwp_cpptr->rused; i++)
- if (ra[i].tag == Tag) return(LWP_EBADROCK);
-
- if (lwp_cpptr->rused < MAXROCKS)
- {
- ra[lwp_cpptr->rused].tag = Tag;
- ra[lwp_cpptr->rused].value = Value;
- lwp_cpptr->rused++;
- return(LWP_SUCCESS);
- }
- else return(LWP_ENOROCKS);
-}
-
-/*
- * Obtains the pointer Value associated with the rock Tag of this LWP.
- * Returns:
- * LWP_SUCCESS if specified rock exists and Value has been filled
- * LWP_EBADROCK rock specified does not exist
- */
-int
-LWP_GetRock(int Tag, char **Value)
-{
- int i;
- struct rock *ra;
-
- ra = lwp_cpptr->rlist;
-
- for (i = 0; i < lwp_cpptr->rused; i++) {
- if (ra[i].tag == Tag) {
- *Value = ra[i].value;
- return(LWP_SUCCESS);
- }
- }
- return(LWP_EBADROCK);
-}
-
-
-#ifdef AFS_AIX32_ENV
-setlim(limcon, hard, limit)
- int limcon;
- uchar_t hard;
-{
- struct rlimit rlim;
-
- (void) getrlimit(limcon, &rlim);
-
- limit = limit * 1024;
- if (hard)
- rlim.rlim_max = limit;
- else if (limit == RLIM_INFINITY && geteuid() != 0)
- rlim.rlim_cur = rlim.rlim_max;
- else
- rlim.rlim_cur = limit;
-
- /* Must use ulimit() due to Posix constraints */
- if (limcon == RLIMIT_FSIZE) {
- if (ulimit(UL_SETFSIZE, ((hard ? rlim.rlim_max : rlim.rlim_cur) / 512)) < 0) {
- printf("Can't %s%s limit\n",
- limit == RLIM_INFINITY ? "remove" : "set", hard ? " hard" : "");
- return (-1);
- }
- } else {
- if (setrlimit(limcon, &rlim) < 0) {
- perror("");
- printf("Can't %s%s limit\n",
- limit == RLIM_INFINITY ? "remove" : "set", hard ? " hard" : "");
- return (-1);
- }
- }
- return (0);
-}
-
-
-#ifdef notdef
-/*
- * Print the specific limit out
- */
-plim(name, lc, hard)
- char *name;
- long lc;
- uchar_t hard;
-{
- struct rlimit rlim;
- int lim;
-
- printf("%s \t", name);
- (void) getrlimit(lc, &rlim);
- lim = hard ? rlim.rlim_max : rlim.rlim_cur;
- if (lim == RLIM_INFINITY)
- printf("unlimited");
- printf("%d %s", lim / 1024, "kbytes");
- printf("\n");
-}
-#endif
-#endif
diff --git a/usr.sbin/afs/src/lwp/lwp_asm.h b/usr.sbin/afs/src/lwp/lwp_asm.h
deleted file mode 100644
index db69c6a7f2f..00000000000
--- a/usr.sbin/afs/src/lwp/lwp_asm.h
+++ /dev/null
@@ -1,230 +0,0 @@
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/*******************************************************************\
-* *
-* Information Technology Center *
-* Carnegie-Mellon University *
-* *
-* *
-\*******************************************************************/
-
-/* $arla: lwp_asm.h,v 1.19 2002/06/01 17:47:48 lha Exp $ */
-
-#ifndef __LWP_INCLUDE_
-#define __LWP_INCLUDE_ 1
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-
-#ifdef HAVE_POSIX_SIGNALS
-#define AFS_POSIX_SIGNALS 1
-#endif
-
-#define LWP_SUCCESS 0
-#define LWP_EBADPID -1
-#define LWP_EBLOCKED -2
-#define LWP_EINIT -3
-#define LWP_EMAXPROC -4
-#define LWP_ENOBLOCK -5
-#define LWP_ENOMEM -6
-#define LWP_ENOPROCESS -7
-#define LWP_ENOWAIT -8
-#define LWP_EBADCOUNT -9
-#define LWP_EBADEVENT -10
-#define LWP_EBADPRI -11
-#define LWP_NO_STACK -12
-/* These two are for the signal mechanism. */
-#define LWP_EBADSIG -13 /* bad signal number */
-#define LWP_ESYSTEM -14 /* system call failed */
-/* These are for the rock mechanism */
-#define LWP_ENOROCKS -15 /* all rocks are in use */
-#define LWP_EBADROCK -16 /* the specified rock does not exist */
-
-
-/* Maximum priority permissible (minimum is always 0) */
-#define LWP_MAX_PRIORITY 4 /* changed from 1 by Satya, 22 Nov. 85 */
-
-/* Usual priority used by user LWPs */
-#define LWP_NORMAL_PRIORITY (LWP_MAX_PRIORITY-2)
-
-/* Initial size of eventlist in a PCB; grows dynamically */
-#define EVINITSIZE 5
-
-typedef struct lwp_pcb *PROCESS;
-
-struct lwp_context { /* saved context for dispatcher */
- char *topstack; /* ptr to top of process stack */
-#ifdef sparc
-#ifdef save_allregs
-#ifdef __sparcv9
-#define nregs (7+1+62+2)
-#else
-#define nregs (7+1+32+2+32+2) /* g1-g7, y reg, f0-f31, fsr, fq, c0-c31, csr, cq. */
-#endif
- long globals[nregs];
-#undef nregs
-#else
- long globals[8]; /* g1-g7 and y registers. */
-#endif
-#endif
-#if defined(powerpc) || defined(ppc) || defined(powerc)
- char *linkRegister; /* the contents of the link register */
- long conditionRegister; /* the contents of the condition register */
-#endif /* defined(powerpc) || defined(ppc) || defined(powerc) */
-};
-
-struct rock
- {/* to hide things associated with this LWP under */
- int tag; /* unique identifier for this rock */
- char *value; /* pointer to some arbitrary data structure */
- };
-
-#define MAXROCKS 4 /* max no. of rocks per LWP */
-
-struct lwp_pcb { /* process control block */
- char name[32]; /* ASCII name */
- int rc; /* most recent return code */
- char status; /* status flags */
- char blockflag; /* if (blockflag), process blocked */
- char eventlistsize; /* size of eventlist array */
- char padding; /* force 32-bit alignment */
- char **eventlist; /* ptr to array of eventids */
- int eventcnt; /* no. of events currently in eventlist array*/
- int wakevent; /* index of eventid causing wakeup */
- int waitcnt; /* min number of events awaited */
- int priority; /* dispatching priority */
- struct lwp_pcb *misc; /* for LWP internal use only */
- char *stack; /* ptr to process stack */
- int stacksize; /* size of stack */
- long stackcheck; /* first word of stack for overflow checking */
- void (*ep)(); /* initial entry point */
- char *parm; /* initial parm for process */
- struct lwp_context
- context; /* saved context for next dispatch */
- int rused; /* no of rocks presently in use */
- struct rock rlist[MAXROCKS]; /* set of rocks to hide things under */
- struct lwp_pcb *next, *prev; /* ptrs to next and previous pcb */
- int level; /* nesting level of critical sections */
- struct IoRequest *iomgrRequest; /* request we're waiting for */
- int index; /* LWP index: should be small index; actually is
- incremented on each lwp_create_process */
- };
-
-extern int lwp_nextindex; /* Next lwp index to assign */
-
-
-#ifndef LWP_KERNEL
-#define LWP_INVALIDTHREADID (-1)
-#define LWP_ActiveProcess (lwp_cpptr+0)
-#define LWP_Index() (LWP_ActiveProcess->index)
-#define LWP_HighestIndex() (lwp_nextindex - 1)
-#define LWP_SignalProcess(event) LWP_INTERNALSIGNAL(event, 1)
-#define LWP_NoYieldSignal(event) LWP_INTERNALSIGNAL(event, 0)
-
-extern
-#endif
- PROCESS lwp_cpptr; /* pointer to current process pcb */
-
-struct lwp_ctl { /* LWP control structure */
- int processcnt; /* number of lightweight processes */
- char *outersp; /* outermost stack pointer */
- struct lwp_pcb *outerpid; /* process carved by Initialize */
- struct lwp_pcb *first, last; /* ptrs to first and last pcbs */
-#if defined(__hp9000s800)
- double dsptchstack[100]; /* stack for dispatcher use only */
- /* force 8 byte alignment */
-#else
-#if defined(__m88k__)
- int pad; /* force 8 byte alignment */
-#endif
- char dsptchstack[800]; /* stack for dispatcher use only */
-#endif
-};
-
-#ifndef LWP_KERNEL
-extern
-#endif
- int lwp_debug; /* ON = show LWP debugging trace */
-
-#if defined(AFS_SUN5_ENV) || defined(AFS_LINUX_ENV)
-#define AFS_POSIX_SIGNALS
-#endif
-
-/*
- * Under some unices any stack size smaller than 16K seems prone to
- * overflow problems. Set it to a somewhat larger value.
- */
-
-#define AFS_LWP_MINSTACKSIZE (100 * 1024)
-
-/* Action to take on stack overflow. */
-#define LWP_SOQUIET 1 /* do nothing */
-#define LWP_SOABORT 2 /* abort the program */
-#define LWP_SOMESSAGE 3 /* print a message and be quiet */
-extern int lwp_overflowAction;
-
-/* Tells if stack size counting is enabled. */
-extern int lwp_stackUseEnabled;
-extern int lwp_MaxStackSeen;
-
-struct timeval;
-
-int LWP_QSignal(PROCESS);
-int LWP_DispatchProcess(void);
-int LWP_InitializeProcessSupport(int, PROCESS *);
-int LWP_DestroyProcess(PROCESS);
-int LWP_QWait(void);
-
-/* exported interface */
-int LWP_CreateProcess(void (*)(), int, int, char *, const char *, PROCESS *);
-int LWP_CurrentProcess(PROCESS *);
-int LWP_WaitProcess(void *);
-int LWP_INTERNALSIGNAL(void *, int);
-int LWP_DispatchProcess(void);
-int LWP_GetProcessPriority(PROCESS pid, int *priority);
-int LWP_TerminateProcessSupport(void);
-int LWP_MwaitProcess(int wcount, char *evlist[]);
-int LWP_StackUsed(PROCESS pid, int *max, int *used);
-
-void IOMGR_Sleep(unsigned int);
-int IOMGR_Select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
-long IOMGR_Poll(void);
-int IOMGR_Cancel(PROCESS);
-int IOMGR_Initialize(void);
-int IOMGR_SoftSig(void (*aproc)(), char *arock);
-int IOMGR_Finalize(void);
-int IOMGR_Signal (int signo, char *event);
-int IOMGR_CancelSignal (int signo);
-
-int LWP_NewRock(int Tag, char *Value);
-int LWP_GetRock(int Tag, char **Value);
-
-
-#endif /* __LWP_INCLUDE_ */
diff --git a/usr.sbin/afs/src/lwp/lwp_elf.h b/usr.sbin/afs/src/lwp/lwp_elf.h
deleted file mode 100644
index eef66f319e2..00000000000
--- a/usr.sbin/afs/src/lwp/lwp_elf.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * For common usage of elf platforms
- *
- * $arla: lwp_elf.h,v 1.2 2000/03/03 08:53:43 assar Exp $
- */
-
-#ifndef _C_LABEL
-#if !defined(SYSV) && !defined(__ELF__) && !defined(AFS_SUN5_ENV)
-#ifdef __STDC__
-#define _C_LABEL(name) _##name
-#else
-#define _C_LABEL(name) _/**/name
-#endif
-#else /* SYSV || __ELF__ || AFS_SUN5_ENV */
-#define _C_LABEL(name) name
-#endif
-#endif /* _C_LABEL */
-
-#ifndef ENTRY
-#if !defined(SYSV) && !defined(__ELF__) && !defined(AFS_SUN5_ENV)
-#ifdef __STDC__
-#define ENTRY(name) _##name##:
-#else
-#define ENTRY(name) _/**/name/**/:
-#endif
-#else /* SYSV || __ELF__ || AFS_SUN5_ENV */
-#define ENTRY(name) name:
-#endif
-#endif /* _C_LABEL */
diff --git a/usr.sbin/afs/src/lwp/make-process.o.sh.in b/usr.sbin/afs/src/lwp/make-process.o.sh.in
deleted file mode 100644
index f2ee4aec94e..00000000000
--- a/usr.sbin/afs/src/lwp/make-process.o.sh.in
+++ /dev/null
@@ -1,180 +0,0 @@
-#!/bin/sh
-#
-# make-process.o.sh
-# Try to make process.o various ways.
-#
-# $arla: make-process.o.sh.in,v 1.28 2002/11/29 19:48:14 tol Exp $
-#
-
-srcdir=@srcdir@
-
-CC=${CC-"@CC@"}
-GCC=${GCC-"@GCC@"}
-CPP=${CPP-"@CPP@"}
-AS=${AS-"@AS@"}
-RM=rm
-HOST_CPU="@host_cpu@"
-HOST_OS="@host_os@"
-LN_S="@LN_S@"
-LWP_O="@LWP_O@"
-
-#
-# Here is a test to check if we manage to build process.o
-# (use this because some sh doesn't have functions)
-#
-# $CC -o testprocess testprocess.o process.o preempt.o ${LWP_O} && exit 0
-# $RM -f process.o
-
-#
-# Options that you may need to override for your CPU/OS
-#
-
-PROCESS_S="undefined_you_lose"
-USE_AS="no"
-MYDEF="-DUSING_ASM"
-
-
-#
-# Clean out the process.o
-#
-
-$RM -f process.o process.S foo.c
-
-#
-# Add PROCESS_S you need
-#
-
-case "$HOST_CPU" in
- sparc*) PROCESS_S="process.sparc.S" ;;
- i*86*) PROCESS_S="process.i386.S" ;;
- m68k) PROCESS_S="process.m68k.S" ;;
- m88k) PROCESS_S="process.m88k.S" ;;
- mips*) PROCESS_S="process.mips.S" ;;
- alpha*) PROCESS_S="process.alpha.S" ;;
- hppa*) PROCESS_S="process.hpux.S" ;;
- powerpc) PROCESS_S="process.ppc.S" ;;
- rs6000) PROCESS_S="process.rios.S" ;;
- vax) PROCESS_S="process.vax.S" ;;
- s390*) PROCESS_S="process.s390.S" ;;
- f301) ;;
- *) echo "Unknown host_cpu, good luck" ;;
-esac
-
-#
-# Add OSDEF your OS need
-#
-
-case "$HOST_OS" in
- *bsd*) OSDEF="-DHAVE_PIC -DAFS_BSD_ENV" ;;
- *linux*) OSDEF="-DAFS_LINUX_ENV" ;;
- *dux* | *osf*) OSDEF="-DAFS_OSF_ENV" ;;
- *solaris*) OSDEF="-DAFS_SUN5_ENV -D_ASM" USE_AS="yes" ;;
- *irix*) OSDEF="-Dsgi -n32 -DHAVE_PIC"; ASDEF="-n32" ;;
- *hpux*) OSDEF="-DAFS_HPUX_ENV" ;;
- aix*) CPUDEF=""; OSDEF="" ;;
- uxpv*)
- $CPP $MYDEF -P ${srcdir}/process-vpp.s > foo.s
- $AS -o process.o foo.s && $RM -f foo.s && exit 0
- $RM -f foo.s
- exit 1
- ;;
- *) ;;
-esac
-
-#
-# Now try to do the magic stuff.
-#
-
-$LN_S ${srcdir}/${PROCESS_S} process.S
-
-#
-# Can we use $CC to do the asm for us ? (GCC)
-#
-
-if test "X$GCC" = "Xyes" -a "X$USE_AS" = "Xno"; then
- ${CC} -I../include -I$srcdir -DASSEMBLER $MYDEF $CPUDEF $OSDEF -c process.S
-
-# process.o there ?
- $CC -o testprocess testprocess.o process.o preempt.o ${LWP_O} && exit 0
- $RM -f process.o
-fi
-
-#
-# Try to use $AS -P for assably
-#
-
-$AS -P -I../include -I$srcdir -DASSEMBLER $MYDEF $CPUDEF $OSDEF process.S -o process.o
-
-# process.o there ?
-$CC -o testprocess testprocess.o process.o preempt.o ${LWP_O} && exit 0
-$RM -f process.o
-
-
-#
-# Some $AS does "interesting" things, like ignorings the -o flag
-# and creats a .i file that is preprocessed. (Digital Unix)
-#
-
-if test -s process.i ; then
- $AS $ASDEF process.i -o process.o
- $RM -f process.i
-
- # process.o there ?
- $CC -o testprocess testprocess.o process.o preempt.o ${LWP_O} && exit 0
- $RM -f process.o
-fi
-
-#
-# Try to use $AS (without -P) for assably
-#
-
-$AS -I../include -I$srcdir -DASSEMBLER $MYDEF $CPUDEF $OSDEF process.S -o process.o
-
-# process.o there ?
-$CC -o testprocess testprocess.o process.o preempt.o ${LWP_O} && exit 0
-$RM -f process.o
-
-
-#
-# Some $AS does "intresting" things, like ignorings the -o flag
-# and creats a .i file that is preprocessed. (Digital Unix)
-#
-
-if test -s process.i ; then
- $AS process.i -o process.o
- $RM -f process.i
-
- # process.o there ?
- $CC -o testprocess testprocess.o process.o preempt.o ${LWP_O} && exit 0
- $RM -f process.o
-fi
-
-
-#
-# Try to use $CPP to preprocess
-#
-
-$CPP -I../include -I$srcdir $MYDEF $CPUDEF $OSDEF process.S > process.ss
-$AS process.ss -o process.o
-$RM -f process.ss
-
-# process.o there ?
-$CC -o testprocess testprocess.o process.o preempt.o ${LWP_O} && exit 0
-$RM -f process.o
-
-#
-# Try to fool $CC by adding a .c extension.
-#
-
-$LN_S process.S foo.c
-$CPP -I../include -I$srcdir $MYDEF $CPUDEF $OSDEF foo.c > process.ss
-$RM -f foo.c
-$AS process.ss -o process.o
-$RM -f process.ss
-
-# process.o there ?
-$CC -o testprocess testprocess.o process.o preempt.o ${LWP_O} && exit 0
-$RM -f process.o
-
-echo "WE HAVE NO process.o !"
-exit 1
diff --git a/usr.sbin/afs/src/lwp/plwp.c b/usr.sbin/afs/src/lwp/plwp.c
deleted file mode 100644
index e6fd1a6dc16..00000000000
--- a/usr.sbin/afs/src/lwp/plwp.c
+++ /dev/null
@@ -1,1141 +0,0 @@
-/* This version of the code is derived from the Coda version of the LWP
- * library, which can be compiled as a wrapper around Mach cthreads
- *
- * Windows Threads support was added by Love <lha@stacken.kth.se>
- * and debugged by Magnus <map@stacken.kth.se> and Robert <rb@abc.se>.
- * It provides a glue layer around the windows primitives to make
- * it look like pthreads.
- */
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* allocate externs here */
-#define LWP_KERNEL
-
-#include <lwp.h>
-#include "preempt.h"
-
-RCSID("$arla: plwp.c,v 1.22 2003/01/24 19:38:35 tol Exp $");
-
-#ifdef AFS_AIX32_ENV
-#include <ulimit.h>
-#include <sys/errno.h>
-#include <sys/user.h>
-#include <sys/pseg.h>
-#include <sys/core.h>
-#pragma alloca
-#endif
-
-#ifndef MAX
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#endif
-
-#define ON 1
-#define OFF 0
-#define TRUE 1
-#define FALSE 0
-#define READY 2
-#define WAITING 3
-#define DESTROYED 4
-#define QWAITING 5
-#define MAXINT (~(1<<((sizeof(int)*8)-1)))
-#define MINSTACK 44
-
-/* Debugging macro */
-#ifdef DEBUG
-#define Debug(level, msg) \
- do { \
- if (lwp_debug && lwp_debug >= level) { \
- printf("***LWP(max=%d) (%p): ", \
- Highest_runnable_priority, lwp_cpptr); \
- printf msg; \
- putchar('\n'); \
- } \
- } while(0)
-
-#else
-#define Debug(level, msg) do {} while (0)
-#endif
-
-#define lwp_timerclear(t) (t)->tv_sec = (t)->tv_usec = 0
-
-/* Prototypes */
-static void Abort_LWP(char *msg, ...) ;
-static void Dispatcher(void);
-static void Create_Process_Part2(PROCESS temp);
-static void purge_dead_pcbs(void) ;
-static void Dispose_of_Dead_PCB (PROCESS cur) ;
-static void Free_PCB(PROCESS pid) ;
-static void Exit_LWP();
-static void Initialize_PCB(PROCESS temp, int priority, char *stack,
- int stacksize, void (*ep)() , char *parm,
- char *name) ;
-static int Internal_Signal(char *event) ;
-char (*RC_to_ASCII());
-
-#define MAX_PRIORITIES (LWP_MAX_PRIORITY+1)
-
-struct QUEUE {
- PROCESS head;
- int count;
-} runnable[MAX_PRIORITIES], blocked;
-/*
- * Invariant for runnable queues: The head of each queue points to the
- * currently running process if it is in that queue, or it points to the
- * next process in that queue that should run.
- */
-
-/* special user-tweakable option for AIX */
-int lwp_MaxStackSize = 32768;
-int lwp_MaxStackSeen = 0;
-
-int lwp_nextindex = 0;
-
-/* Iterator macro */
-#define for_all_elts(var, q, body)\
- {\
- PROCESS var, _NEXT_;\
- int _I_;\
- for (_I_=q.count, var = q.head; _I_>0; _I_--, var=_NEXT_) {\
- _NEXT_ = var -> next;\
- body\
- }\
- }
-
-static struct lwp_ctl *lwp_init = NULL;
-
-static void Dump_One_Process(PROCESS pid);
-static void Dump_Processes();
-static void Delete_PCB(PROCESS pid);
-static void Free_PCB(PROCESS pid);
-static void Cal_Highest_runnable_priority();
-static int InitializeProcessSupport(int, PROCESS *);
-
-PROCESS lwp_cpptr;
-
-/* The global Highest_runnable_priority is only needed in NEW lwp.
- But it gets set within a for_all_elts() instance in
- InternalSignal(). */
-int Highest_runnable_priority; /* global variable for max priority */
-
-int Proc_Running; /* indicates forked proc got control */
-
-/*
- * Glue for
- */
-
-#if defined(PTHREADS_LWP)
-pthread_mutex_t run_sem, ct_mutex;
-
-#define LWP_INT_LOCK(sem) pthread_mutex_lock(sem)
-#define LWP_INT_UNLOCK(sem) pthread_mutex_unlock(sem)
-
-#define LWP_INT_WAIT(cond, mutex) pthread_cond_wait(cond, mutex)
-#define LWP_INT_SIGNAL(cond) pthread_cond_signal(cond)
-
-#define LWP_INT_EXIT(t) pthread_exit(t)
-
-#elif defined(WINDOWS_THREADS_LWP)
-
-HANDLE run_sem, ct_mutex;
-
-#if 0
-#define LWP_INT_LOCK(sem) WaitForSingleObject (sem, INFINITE)
-#define LWP_INT_UNLOCK(sem) ReleaseMutex (sem)
-#endif
-
-static
-DWORD LWP_INT_LOCK(HANDLE *sem)
-{
- DWORD ret;
- Debug(0, ("LWP_INT_LOCK: sem = %p", *sem));
- ret = WaitForSingleObject(*sem, INFINITE);
- if (ret == WAIT_FAILED) {
- DWORD err = GetLastError();
- Debug(0, ("LWP_INT_LOCK: h = %p, wait = %ld, %ld\n",
- *sem, ret, err));
- }
- Debug(0, ("LWP_INT_LOCK: got %p", *sem));
- return ret;
-}
-
-static DWORD LWP_INT_UNLOCK(HANDLE *sem)
-{
- DWORD ret;
- Debug(0, ("LWP_INT_UNLOCK: sem = %p", *sem));
- ret = ReleaseMutex(*sem);
- if (!ret) {
- DWORD err = GetLastError();
- Debug(0, ("LWP_INT_UNLOCK: h = %p, wait = %ld, %ld\n",
- *sem, ret, err));
- }
- Debug(0, ("LWP_INT_UNLOCK: %p released", *sem));
- return ret;
-}
-
-static DWORD LWP_INT_WAIT(HANDLE *cond, HANDLE *mutex)
-{
- DWORD ret;
- static int times = 0;
- int this_time = times++;
-
- Debug(0, ("LWP_INT_WAIT(%d): cond: %p mutex: %p",
- this_time, *cond, *mutex));
- ret = ReleaseMutex (*mutex);
- if (!ret) {
- DWORD err = GetLastError();
- Debug(0, ("LWP_INT_WAIT(%d): ReleaseMutex failed: %ld error: "
- "%ld mutex\n", this_time, err, *mutex));
- exit(-1);
- }
- Debug(0, ("LWP_INT_WAIT(%d): mutex released, waiting", this_time));
- ret = WaitForSingleObject (*cond, INFINITE);
- if (ret != WAIT_OBJECT_0) {
- Debug(0, ("LWP_INT_WAIT(%d): WaitForSingleObject(cond) failed: "
- "%ld mutex: %p\n", this_time, ret, *mutex));
- exit(-1);
- }
- Debug(0, ("LWP_INT_WAIT(%d): got sem, waiting for mutex", this_time));
- ret = WaitForSingleObject (*mutex, INFINITE);
- if (ret != WAIT_OBJECT_0) {
- Debug(0, ("LWP_INT_WAIT(%d): WaitForSingleObject(mutex) failed: "
- "%ld mutex: %p\n", this_time, ret, *mutex));
- exit(-1);
- }
- Debug(0, ("LWP_INT_WAIT(%d): got mutex: cond: %p mutex: %p",
- this_time, *cond, *mutex));
- return 0;
-}
-
-#define LWP_INT_SIGNAL(cond) do { \
-Debug(0, ("LWP_INT_SIGNAL: cond: %p\n", *cond)); \
-SetEvent (*cond); } while (0)
-
-
-#define LWP_INT_EXIT(t) ExitThread ((int)t); /* XXX */
-
-#endif
-
-static void
-lwpremove(PROCESS p, struct QUEUE *q)
-{
- /* Special test for only element on queue */
- if (q->count == 1)
- q -> head = NULL;
- else {
- /* Not only element, do normal remove */
- p -> next -> prev = p -> prev;
- p -> prev -> next = p -> next;
- }
- /* See if head pointing to this element */
- if (q->head == p) q -> head = p -> next;
- q->count--;
- Debug(0, ("removing, count now %d", q->count));
- p -> next = p -> prev = NULL;
-}
-
-static void
-lwpinsert(PROCESS p, struct QUEUE *q)
-{
- if (q->head == NULL) { /* Queue is empty */
- q -> head = p;
- p -> next = p -> prev = p;
- } else { /* Regular insert */
- p -> prev = q -> head -> prev;
- q -> head -> prev -> next = p;
- q -> head -> prev = p;
- p -> next = q -> head;
- }
- q->count++;
- Debug(0, ("inserting, count now %d", q->count));
-}
-
-static void
-lwpmove(PROCESS p, struct QUEUE *from, struct QUEUE *to)
-{
- lwpremove(p, from);
- lwpinsert(p, to);
-}
-
-int
-LWP_TerminateProcessSupport() /* terminate all LWP support */
-{
- int i;
-
- Debug(0, ("Entered Terminate_Process_Support"));
- if (lwp_init == NULL)
- return LWP_EINIT;
- /* free all space allocated */
- for (i=0; i<MAX_PRIORITIES; i++)
- for_all_elts(cur, runnable[i], { Free_PCB(cur);});
- for_all_elts(cur, blocked, { Free_PCB(cur);});
- free((char *)lwp_init);
- lwp_init = NULL;
- return LWP_SUCCESS;
-}
-
-int
-LWP_GetRock(int Tag, char **Value)
-{
- /* Obtains the pointer Value associated with the rock Tag of this LWP.
- Returns:
- LWP_SUCCESS if specified rock exists and Value has been filled
- LWP_EBADROCK rock specified does not exist
- */
- int i;
- struct rock *ra;
-
- ra = lwp_cpptr->rlist;
-
- for (i = 0; i < lwp_cpptr->rused; i++)
- if (ra[i].tag == Tag) {
-#ifdef PTHREADS_LWP
-#ifdef PTHREAD_GETSPECIFIC_TWOARG
- pthread_getspecific(ra[i].val, Value);
-#else
- *Value = pthread_getspecific(ra[i].val);
-#endif
-#elif WINDOWS_THREADS_LWP
- *Value = TlsGetValue((unsigned long) ra[i].val);
-#endif
- /**Value = ra[i].value;*/
- return(LWP_SUCCESS);
- }
- return(LWP_EBADROCK);
-}
-
-
-int
-LWP_NewRock(int Tag, char *Value)
-{
- /* Finds a free rock and sets its value to Value.
- Return codes:
- LWP_SUCCESS Rock did not exist and a new one was used
- LWP_EBADROCK Rock already exists.
- LWP_ENOROCKS All rocks are in use.
-
- From the above semantics, you can only set a rock value once.
- This is specifically to prevent multiple users of the LWP
- package from accidentally using the same Tag value and
- clobbering others. You can always use one level of
- indirection to obtain a rock whose contents can change. */
-
- int i;
- struct rock *ra; /* rock array */
-
- ra = lwp_cpptr->rlist;
-
- /* check if rock has been used before */
- for (i = 0; i < lwp_cpptr->rused; i++)
- if (ra[i].tag == Tag) return(LWP_EBADROCK);
-
- /* insert new rock in rock list and increment count of rocks */
- if (lwp_cpptr->rused < MAXROCKS) {
- ra[lwp_cpptr->rused].tag = Tag;
-#if defined(LWP_THREADS)
-#ifdef HAVE_PTHREAD_KEYCREATE
- if (pthread_keycreate(&ra[lwp_cpptr->rused].val, NULL))
-#else
- if (pthread_key_create(&ra[lwp_cpptr->rused].val, NULL))
-#endif
- return(LWP_EBADROCK);
- if (pthread_setspecific(ra[lwp_cpptr->rused].val, Value))
- return(LWP_EBADROCK);
-
-#elif defined(WINDOWS_THREADS_LWP)
- ra[lwp_cpptr->rused].val = (LPVOID) TlsAlloc();
- if (ra[lwp_cpptr->rused].val == (LPVOID) 0xFFFFFFFF)
- return(LWP_EBADROCK);
- if (!TlsSetValue((unsigned long) ra[lwp_cpptr->rused].val, Value))
- return(LWP_EBADROCK);
-#endif
-
- lwp_cpptr->rused++;
- return(LWP_SUCCESS);
- }
- else return(LWP_ENOROCKS);
-}
-
-static void
-Dispose_of_Dead_PCB(PROCESS cur)
-{
-
- Debug(0, ("Entered Dispose_of_Dead_PCB"));
- Delete_PCB(cur);
- Free_PCB(cur);
-}
-
-int
-LWP_CurrentProcess(PROCESS *pid)
-{
- Debug(0, ("Entered Current_Process"));
- if (lwp_init) {
- *pid = lwp_cpptr;
- return LWP_SUCCESS;
- } else
- return LWP_EINIT;
-}
-
-
-int
-LWP_GetProcessPriority(PROCESS pid, int *priority)
-{
- Debug(0, ("Entered Get_Process_Priority"));
- if (lwp_init) {
- *priority = pid -> priority;
- return 0;
- } else
- return LWP_EINIT;
-}
-
-int
-LWP_WaitProcess(void *event)
-{
- char *tempev[2];
-
- Debug(0, ("Entered Wait_Process"));
- if (event == NULL) return LWP_EBADEVENT;
- tempev[0] = event;
- tempev[1] = NULL;
- return LWP_MwaitProcess(1, tempev);
-}
-
-static void
-Delete_PCB(PROCESS pid)
-{
- Debug(0, ("Entered Delete_PCB"));
- lwpremove(pid, (pid->blockflag || pid->status==WAITING ||
- pid->status==DESTROYED ? &blocked
- : &runnable[pid->priority]));
-}
-
-static void
-purge_dead_pcbs()
-{
- for_all_elts(cur, blocked, { if (cur->status == DESTROYED)
- Dispose_of_Dead_PCB(cur); });
-}
-
-static void
-Exit_LWP()
-{
- exit (-1);
-}
-
-static void
-Dump_Processes()
-{
- if (lwp_init) {
- int i;
- for (i=0; i<MAX_PRIORITIES; i++)
- for_all_elts(x, runnable[i], {
- printf("[Priority %d]\n", i);
- Dump_One_Process(x);
- });
- for_all_elts(x, blocked, { Dump_One_Process(x); });
- } else {
- printf("***LWP: LWP support not initialized\n");
- }
-}
-
-char *
-LWP_Name()
-{
- return(lwp_cpptr->name);
-}
-
-int
-LWP_Index()
-{
- return(lwp_cpptr->index);
-}
-
-int
-LWP_HighestIndex()
-{
- return(lwp_nextindex-1);
-}
-
-/* A process calls this routine to wait until somebody signals it.
- * LWP_QWait removes the calling process from the runnable queue
- * and makes the process sleep until some other process signals via LWP_QSignal
- */
-int
-LWP_QWait()
-{
- PROCESS old_cpptr;
-
- Debug(0, ("LWP_QWait: %s is going to QWait", lwp_cpptr->name));
- lwp_cpptr->status = QWAITING;
- if (runnable[lwp_cpptr->priority].count == 0)
- Cal_Highest_runnable_priority();
-
- old_cpptr = lwp_cpptr;
-
- /* wake up next lwp */
- lwp_cpptr = runnable[Highest_runnable_priority].head;
- lwpremove(lwp_cpptr, &runnable[Highest_runnable_priority]);
- lwp_timerclear(&lwp_cpptr->lastReady);
- LWP_INT_LOCK(&ct_mutex);
- Debug(0, ("LWP_QWait:%s going to wake up %s", old_cpptr->name,
- lwp_cpptr->name));
- LWP_INT_SIGNAL(&lwp_cpptr->c);
-
- /* sleep on your own condition */
- Debug(0, ("LWP_QWait:%s going to wait on own condition",
- old_cpptr->name));
- LWP_INT_WAIT(&old_cpptr->c, &ct_mutex);
- LWP_INT_UNLOCK(&ct_mutex);
- Debug(0, ("LWP_QWait:%s woke up",
- old_cpptr->name));
-
- lwp_cpptr = old_cpptr;
-
- /* return only if calling process' priority is the highest */
- if (lwp_cpptr->priority < Highest_runnable_priority)
- Dispatcher();
- return LWP_SUCCESS;
-}
-
-
-/* signal the PROCESS pid - by adding it to the runnable queue */
-int
-LWP_QSignal(PROCESS pid)
-{
- if (pid->status == QWAITING) {
- Debug(0, ("LWP_Qsignal: %s is going to QSignal %s\n", lwp_cpptr->name,
- pid->name));
- pid->status = READY;
- lwpinsert(pid, &runnable[pid->priority]);
- Debug(0, ("LWP_QSignal: Just inserted %s into runnable queue\n",
- pid->name));
- gettimeofday(&pid->lastReady, 0);
- Highest_runnable_priority =
- MAX(Highest_runnable_priority, pid->priority);
- Debug(0, ("%s priority= %d; HRP = %d; Signalled process pri = %d",
- lwp_cpptr->name, lwp_cpptr->priority,
- Highest_runnable_priority, pid->priority));
- return LWP_SUCCESS;
- }
- else return LWP_ENOWAIT;
-}
-
-
-int
-LWP_CreateProcess(void (*ep)(), int stacksize, int priority,
- char *parm, char *name, PROCESS *pid)
-{
- PROCESS temp;
-#if defined(PTHREADS_LWP)
- pthread_t ct;
- pthread_attr_t cta;
- int retval;
-#elif defined(WINDOWS_THREADS_LWP)
- HANDLE ct;
-#endif
- PROCESS old_cpptr;
-
- Debug(0, ("Entered LWP_CreateProcess to create %s at priority %d\n",
- name, priority));
- old_cpptr = lwp_cpptr;
- /* Throw away all dead process control blocks */
- purge_dead_pcbs();
-
- if (lwp_init == NULL)
- return LWP_EINIT;
-
- /* allocate the memory for the pcb - check for malloc errors */
- temp = (PROCESS)malloc (sizeof (struct lwp_pcb));
- if (temp == NULL) {
- Dispatcher();
- return LWP_ENOMEM;
- }
-
- /* check priorities */
- if (priority < 0 || priority >= MAX_PRIORITIES) {
- Dispatcher();
- return LWP_EBADPRI;
- }
-
- Initialize_PCB(temp, priority, NULL, 0, ep, parm, name);
-
- /* make the process runnable by placing it in the runnable q */
- lwpinsert(temp, &runnable[priority]);
- gettimeofday(&temp->lastReady, 0);
-
- if (PRE_Block != 0)
- Abort_LWP("PRE_Block not 0");
-
- PRE_Block = 1;
- Proc_Running = FALSE; /* sem set true by forked process */
-
-#if defined(PTHREADS_LWP)
- pthread_attr_init(&cta);
-#ifdef _POSIX_THREAD_ATTR_STACKSIZE
- pthread_attr_setstacksize(&cta, stacksize);
-#endif
- retval = pthread_create(&ct, &cta, (void *)Create_Process_Part2, temp);
- if (retval != 0)
- Abort_LWP("pthread_create failed to create thread %d/%d",
- retval, errno);
-
- pthread_detach(ct);
- temp->a = cta;
-#elif defined(WINDOWS_THREADS_LWP)
- Debug(0,("Before CreateThread Create_Process_Part2"));
- ct = CreateThread (NULL,
- stacksize, (LPTHREAD_START_ROUTINE)Create_Process_Part2,
- temp, 0, NULL);
- Debug(0,("After CreateThread Create_Process_Part2"));
- if (ct == NULL)
- Abort_LWP("CreateThread failed to create thread: %d",
- (int)GetLastError());
- temp->t = ct;
-#endif
-
- /* check if max priority has changed */
- Highest_runnable_priority = MAX(Highest_runnable_priority, priority);
-
- LWP_INT_LOCK(&run_sem);
- Debug(0, ("Before creating process yields Proc_Running = %d\n",
- Proc_Running));
- while( !Proc_Running ){
- LWP_INT_UNLOCK(&run_sem);
-#if defined(PTHREADS_LWP)
-#if defined(HAVE_THR_YIELD)
- thr_yield();
-#elif defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
- sched_yield();
-#else
- pthread_yield();
-#endif
-#elif defined(WINDOWS_THREADS_LWP)
- Sleep(0); /* XXX */
-#endif
- LWP_INT_LOCK(&run_sem);
- Debug(0,("After creating proc yields and gets back control Proc_Running = %d\n",
- Proc_Running));
- }
- LWP_INT_UNLOCK(&run_sem);
-
- lwp_cpptr = old_cpptr;
-
- Dispatcher();
- *pid = temp;
- return LWP_SUCCESS;
-}
-
-int
-LWP_DestroyProcess(PROCESS pid)
-{
- void *t;
-
- Debug(0, ("Entered Destroy_Process"));
- if (lwp_init) {
-#if defined(PTHREADS_LWP)
- pthread_attr_destroy(&pid->a);
-#elif defined(WINDOWS_THREADS_LWP)
- CloseHandle (pid->t);
-#endif
- if (lwp_cpptr == pid){
- /* kill myself */
- pid->status = DESTROYED;
- Free_PCB(pid);
- Cal_Highest_runnable_priority();
-
- /* Calculate next runnable lwp and signal it */
- lwp_cpptr = runnable[Highest_runnable_priority].head;
- lwpremove(lwp_cpptr, &runnable[Highest_runnable_priority]);
-
- LWP_INT_LOCK(&ct_mutex);
- LWP_INT_SIGNAL(&lwp_cpptr->c);
- LWP_INT_UNLOCK(&ct_mutex);
- LWP_INT_EXIT(t);
- } else {
- /* kill some other process - mark status destroyed -
- if process is blocked, it will be purged on next create proc;
- if it is runnable the dispatcher will kill it */
- pid->status = DESTROYED ;
- Dispatcher();
- }
- return LWP_SUCCESS ;
- } else
- return LWP_EINIT;
-}
-
-int
-LWP_DispatchProcess() /* explicit voluntary preemption */
-{
- Debug(0, ("Entered Dispatch_Process"));
- if (lwp_init) {
- Dispatcher();
- return LWP_SUCCESS;
- } else {
- return LWP_EINIT;
- }
-}
-
-int
-LWP_Init(int version, int priority, PROCESS *pid)
-{
- lwp_debug = 0;
- if (version != LWP_VERSION)
- {
- fprintf(stderr, "**** FATAL ERROR: LWP VERSION MISMATCH ****\n");
- exit(-1);
- }
- else return(InitializeProcessSupport(priority, pid));
-}
-
-int
-LWP_InitializeProcessSupport(int priority, PROCESS *pid)
-{
- return(InitializeProcessSupport(priority, pid));
-}
-
-static int
-InitializeProcessSupport(int priority, PROCESS *pid)
-{
- PROCESS temp;
- int i;
-
- Debug(0, ("Entered InitializeProcessSupport"));
- if (lwp_init != NULL)
- return LWP_SUCCESS;
-
- /* check priorities and set up running and blocked queues */
- if (priority >= MAX_PRIORITIES) return LWP_EBADPRI;
- for (i=0; i<MAX_PRIORITIES; i++) {
- runnable[i].head = NULL;
- runnable[i].count = 0;
- }
- blocked.head = NULL;
- blocked.count = 0;
- lwp_init = (struct lwp_ctl *) malloc(sizeof(struct lwp_ctl));
- temp = (PROCESS) malloc(sizeof(struct lwp_pcb));
- if (lwp_init == NULL || temp == NULL)
- Abort_LWP("Insufficient Storage to Initialize LWP Support");
-
- /* check parameters */
- Initialize_PCB(temp, priority, NULL, 0, NULL, NULL,"Main Process");
- gettimeofday(&temp->lastReady, 0);
-
-#if 0
- Highest_runnable_priority = priority;
-#endif
-
- /* initialize mutex and semaphore */
- Proc_Running = TRUE;
-#if defined(PTHREADS_LWP)
- pthread_mutex_init(&run_sem, NULL);
- pthread_mutex_init(&ct_mutex, NULL);
-#elif defined(WINDOWS_THREADS_LWP)
- run_sem = CreateMutex (NULL, FALSE, "run_sem");
- if (run_sem == NULL) exit(-1);
- ct_mutex = CreateMutex (NULL, FALSE, "ct_mutex");
- if (ct_mutex == NULL) exit(-1);
-#endif
- lwp_cpptr = temp;
- Dispatcher();
- *pid = temp;
- return LWP_SUCCESS;
-}
-
-int
-LWP_INTERNALSIGNAL(void *event, int yield)
-{
- Debug(0, ("Entered LWP_SignalProcess, yield=%d", yield));
- if (lwp_init) {
- int rc;
- rc = Internal_Signal(event);
- if (yield) {
- Cal_Highest_runnable_priority();
- Debug(0, ("hipri=%d", Highest_runnable_priority));
- Dispatcher();
- }
- return rc;
- } else
- return LWP_EINIT;
-}
-
-int
-LWP_MwaitProcess(int wcount, char *evlist[]) /* wait on m of n events */
-{
- int ecount, i;
- PROCESS old_cpptr;
-
- Debug(0, ("Entered Mwait_Process [waitcnt = %d]", wcount));
- if (evlist == NULL) {
- Dispatcher();
- return LWP_EBADCOUNT;
- }
-
- /* count # of events in eventlist */
- for (ecount = 0; evlist[ecount] != NULL; ecount++) ;
- if (ecount == 0) {
- Dispatcher();
- return LWP_EBADCOUNT;
- }
-
- if (lwp_init) {
- /* check for illegal counts */
- if (wcount>ecount || wcount<0) {
- Dispatcher();
- return LWP_EBADCOUNT;
- }
-
- /* reallocate eventlist if new list has more elements than before */
- if (ecount > lwp_cpptr->eventlistsize) {
- lwp_cpptr->eventlist =
- (char **)realloc((char *)lwp_cpptr->eventlist,
- ecount*sizeof(char *));
- lwp_cpptr->eventlistsize = ecount;
- }
-
- /* place events in eventlist of the pcb */
- for (i=0; i<ecount; i++) lwp_cpptr -> eventlist[i] = evlist[i];
-
- /* if there are any events to wait on then set status to
- WAITING and place the pcb in blocked queue */
- if (wcount > 0) {
- lwp_cpptr -> status = WAITING;
- lwpinsert(lwp_cpptr, &blocked);
- }
- lwp_cpptr -> wakevent = 0; /* index of eventid causing wakeup */
- lwp_cpptr -> waitcnt = wcount;
- lwp_cpptr -> eventcnt = ecount;
- if (runnable[lwp_cpptr->priority].count == 0)
- Cal_Highest_runnable_priority();
- old_cpptr = lwp_cpptr;
-
- /* wake up next lwp */
- lwp_cpptr = runnable[Highest_runnable_priority].head;
- lwpremove(lwp_cpptr, &runnable[Highest_runnable_priority]);
- lwp_timerclear(&lwp_cpptr->lastReady);
- Debug(0, ("WaitProcess: %s Going to signal %s \n",
- old_cpptr->name, lwp_cpptr->name));
- LWP_INT_LOCK(&ct_mutex);
- LWP_INT_SIGNAL(&lwp_cpptr->c);
-
- /* sleep on your own condition */
- Debug(0, ("WaitProcess:%s going to wait \n", old_cpptr->name));
-
- LWP_INT_WAIT(&old_cpptr->c, &ct_mutex);
- LWP_INT_UNLOCK(&ct_mutex);
- Debug(0, ("WaitProcess:%s woke up \n", old_cpptr->name));
-
- /* update the global pointer */
- lwp_cpptr = old_cpptr;
-
- if (lwp_cpptr->priority < Highest_runnable_priority)
- Dispatcher();
- return LWP_SUCCESS ;
- }
- return LWP_EINIT ;
-
-}
-
-int
-LWP_StackUsed(PROCESS pid, int *max, int *used)
-{
- /* just here for compatibility */
- *max = -1;
- *used = -1;
- return LWP_SUCCESS;
-}
-
-static void
-Abort_LWP(char *msg, ...)
-{
- va_list ap;
-
- Debug(0, ("Entered Abort_LWP"));
- va_start(ap, msg);
- printf("***LWP Abort ");
- vprintf(msg, ap);
- va_end(ap);
- Dump_Processes();
- Exit_LWP();
-}
-
-static void
-Create_Process_Part2(PROCESS temp)
-{
- /* set the global Proc_Running to signal the parent */
- LWP_INT_LOCK(&run_sem);
- Proc_Running = TRUE;
- LWP_INT_UNLOCK(&run_sem);
-
- LWP_INT_LOCK(&ct_mutex);
- LWP_INT_WAIT(&temp->c, &ct_mutex);
- LWP_INT_UNLOCK(&ct_mutex);
-
- lwp_cpptr = temp;
-
-#if defined(PTHREADS_LWP)
-#ifdef _POSIX_THREAD_ATTR_STACKSIZE
- pthread_attr_setstacksize(&temp->a, temp->stacksize);
-#endif /* _POSIX_THREAD_ATTR_STACKSIZE */
-#endif /* PTHREADS_LWP */
-
- (*temp->ep)(temp->parm);
- LWP_DestroyProcess(temp);
-}
-
-static void
-Dump_One_Process(PROCESS pid)
-{
- int i;
-
- printf("***LWP: Process Control Block at 0x%x\n", (int)pid);
- printf("***LWP: Name: %s\n", pid->name);
- if (pid->ep != NULL)
- printf("***LWP: Initial entry point: 0x%x\n", (int)pid->ep);
- if (pid->blockflag) printf("BLOCKED and ");
- switch (pid->status) {
- case READY: printf("READY"); break;
- case WAITING: printf("WAITING"); break;
- case DESTROYED: printf("DESTROYED"); break;
- default: printf("unknown");
- }
- putchar('\n');
- printf("***LWP: Priority: %d \tInitial parameter: 0x%x\n",
- pid->priority, (int)pid->parm);
-
- if (pid->eventcnt > 0) {
- printf("***LWP: Number of events outstanding: %d\n", pid->waitcnt);
- printf("***LWP: Event id list:");
- for (i=0;i<pid->eventcnt;i++)
- printf(" 0x%x", (int)pid->eventlist[i]);
- putchar('\n');
- }
- if (pid->wakevent>0)
- printf("***LWP: Number of last wakeup event: %d\n", pid->wakevent);
-}
-
-static void
-Dispatcher() /* Lightweight process dispatcher */
-{
- void *t;
- int my_priority;
- PROCESS old_cpptr;
-
-
-#if 1
- int i = Highest_runnable_priority;
-
- Cal_Highest_runnable_priority();
- if (Highest_runnable_priority != i) {
- printf("hipri was %d actually %d\n", i, Highest_runnable_priority);
-#if 0
- Dump_Processes();
-#endif
- }
- Highest_runnable_priority = i;
-#endif
- my_priority = lwp_cpptr->priority;
- Debug(0, ("Dispatcher: %d runnable at pri %d hi %d blk %d",
- runnable[my_priority].count, my_priority,
- Highest_runnable_priority, PRE_Block));
- PRE_Block = 1;
- if ((my_priority < Highest_runnable_priority) ||
- (runnable[my_priority].count > 0))
- {
- Debug(0, ("Dispatcher: %s is now yielding", lwp_cpptr->name));
- /* I have to quit */
- old_cpptr = lwp_cpptr;
- lwpinsert(old_cpptr, &runnable[my_priority]);
- gettimeofday(&old_cpptr->lastReady, 0);
- lwp_cpptr = runnable[Highest_runnable_priority].head;
-
- /* remove next process from runnable queue and signal it */
- lwpremove(lwp_cpptr, &runnable[Highest_runnable_priority]);
- LWP_INT_LOCK(&ct_mutex);
- Debug(0, ("Dispatcher: %s going to signal %s condition",
- old_cpptr->name, lwp_cpptr->name));
-
- LWP_INT_SIGNAL(&lwp_cpptr->c);
-
- /* now sleep until somebody wakes me */
- Debug(0, ("Dispatcher: %s going to wait on own condition",
- old_cpptr->name));
- LWP_INT_WAIT(&old_cpptr->c, &ct_mutex);
- LWP_INT_UNLOCK(&ct_mutex);
- Debug(0, ("Dispatcher: %s woke up",
- old_cpptr->name));
-
- /* update global pointer */
- lwp_cpptr = old_cpptr;
- } else {
- Debug(0, ("Dispatcher: %s still running", lwp_cpptr->name));
- }
- /* make sure HRP is set correct */
- Highest_runnable_priority = lwp_cpptr->priority;
- if (lwp_cpptr->status == DESTROYED){
- /* the process was runnable but got destroyed by somebody */
- Free_PCB(lwp_cpptr);
- Cal_Highest_runnable_priority();
- lwp_cpptr = runnable[Highest_runnable_priority].head;
- lwpremove(lwp_cpptr, &runnable[Highest_runnable_priority]);
-
- LWP_INT_LOCK(&ct_mutex);
- LWP_INT_SIGNAL(&lwp_cpptr->c);
- LWP_INT_UNLOCK(&ct_mutex);
- LWP_INT_EXIT(t);
- }
-#if 0
- if (PRE_Block != 1) Abort_LWP("PRE_Block not 1");
-#endif
- PRE_Block = 0;
-}
-
-
-static void
-Free_PCB(PROCESS pid)
-{
- Debug(0, ("Entered Free_PCB"));
-
- if (pid->eventlist != NULL)
- free((char *)pid->eventlist);
- free((char *)pid);
-}
-
-static void
-Initialize_PCB(PROCESS temp, int priority, char *stack, int stacksize,
- void (*ep)(), char *parm, char *name)
-{
- int i = 0;
-
- Debug(0, ("Entered Initialize_PCB"));
- if (name != NULL)
- while (((temp -> name[i] = name[i]) != '\0') && (i < 31))
- i++;
- temp -> name[31] = '\0';
- temp -> status = READY;
- temp -> eventlist = (char **)malloc(EVINITSIZE*sizeof(char *));
- temp -> eventlistsize = EVINITSIZE;
- temp -> eventcnt = 0;
- temp -> wakevent = 0;
- temp -> waitcnt = 0;
- temp -> blockflag = 0;
- temp -> iomgrRequest = 0;
- temp -> priority = priority;
- temp -> index = lwp_nextindex++;
- temp -> ep = ep;
- temp -> parm = parm;
- temp -> misc = NULL; /* currently unused */
- temp -> next = NULL;
- temp -> prev = NULL;
- temp -> rused = 0;
- temp -> level = 1; /* non-preemptable */
- temp -> stacksize = stacksize;
- lwp_timerclear(&temp->lastReady);
-
- /* initialize the mutex and condition */
-#if defined(PTHREADS_LWP)
- pthread_mutex_init(&temp->m, NULL);
- pthread_cond_init(&temp->c, NULL);
-#elif defined(WINDOWS_THREADS_LWP)
- temp->m = CreateMutex (NULL, FALSE, NULL);
- if (temp->m == NULL) exit(-1);
- temp->c = CreateEvent (NULL, FALSE, FALSE, NULL);
- if (temp->c == NULL) exit(-1);
- Debug(0, ("Init_PCB: event = %p\n", temp->c));
-#endif
-
- Debug(0, ("Leaving Initialize_PCB\n"));
-}
-
-static int
-Internal_Signal(char *event)
-{
- int rc = LWP_ENOWAIT;
- int i;
-
- Debug(0, ("Entered Internal_Signal [event id 0x%x]", (int)event));
- if (lwp_init == NULL)
- return LWP_EINIT;
- if (event == NULL)
- return LWP_EBADEVENT;
-
- for_all_elts(temp, blocked, { /* for all pcb's on the blocked q */
- if (temp->status == WAITING)
- for (i=0; i < temp->eventcnt; i++) { /* check each event in list */
- if (temp -> eventlist[i] == event) {
- temp -> eventlist[i] = NULL;
- rc = LWP_SUCCESS;
- Debug(0, ("decrementing %s to %d", temp->name,
- (temp->waitcnt-1)));
- /* reduce waitcnt by 1 for the signal */
- /* if wcount reaches 0 then make the process runnable */
- if (--temp->waitcnt == 0) {
- temp -> status = READY;
- temp -> wakevent = i+1;
- lwpmove(temp, &blocked, &runnable[temp->priority]);
- gettimeofday(&temp->lastReady, 0);
- Highest_runnable_priority =
- MAX(Highest_runnable_priority, temp->priority);
- Debug(0, ("marked runnable. hi_pri %d, %d at %d",
- Highest_runnable_priority,
- runnable[temp->priority].count,
- temp->priority));
- break;
- }
- }
- }
- });
- return rc;
-}
-
-/* places the maximum of runnable task priorities in the global variable -
- * Highest_runnable_priority. No runnable process is an error */
-static void
-Cal_Highest_runnable_priority()
-{
- int i;
-
-#if 0
- Dump_Processes();
-#endif
-
- for (i = MAX_PRIORITIES - 1; i >= 0 ; i--)
- if (runnable[i].count != 0)
- break;
-#if 0
- if (i < 0)
- Abort_LWP("No ready processes");
-#endif
- if (i >= 0)
- Highest_runnable_priority = i;
-#if 0
- else
- exit(-1);
-#endif
-}
diff --git a/usr.sbin/afs/src/lwp/plwp.h b/usr.sbin/afs/src/lwp/plwp.h
deleted file mode 100644
index 39b6370de8d..00000000000
--- a/usr.sbin/afs/src/lwp/plwp.h
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * $arla: plwp.h,v 1.9 2003/01/03 16:26:08 tol Exp $
- */
-
-#ifndef LWP_INCLUDED
-#define LWP_INCLUDED
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_POSIX_SIGNALS
-#define AFS_POSIX_SIGNALS 1
-#endif
-#define AFS_LWP_MINSTACKSIZE (100 * 1024)
-#include <sys/time.h>
-#include <signal.h>
-
-#ifdef PTHREADS_LWP
-#include <pthread.h>
-#endif
-
-#include <roken.h>
-
-#ifdef WINDOWS_THREADS_LWP
-#include <windows.h>
-#endif
-
-#ifndef LWP_KERNEL
-extern
-#endif
- int lwp_debug; /* ON = show LWP debugging trace */
-
-extern int lwp_stackUseEnabled;
-extern int lwp_MaxStackSeen;
-#define LWP_ActiveProcess (lwp_cpptr+0)
-
-#define LWP_VERSION 210888001
-
-#define LWP_SUCCESS 0
-#define LWP_EBADPID -1
-#define LWP_EBLOCKED -2
-#define LWP_EINIT -3
-#define LWP_EMAXPROC -4
-#define LWP_ENOBLOCK -5
-#define LWP_ENOMEM -6
-#define LWP_ENOPROCESS -7
-#define LWP_ENOWAIT -8
-#define LWP_EBADCOUNT -9
-#define LWP_EBADEVENT -10
-#define LWP_EBADPRI -11
-#define LWP_NO_STACK -12
-/* These two are for the signal mechanism. */
-#define LWP_EBADSIG -13 /* bad signal number */
-#define LWP_ESYSTEM -14 /* system call failed */
-/* These are for the rock mechanism */
-#define LWP_ENOROCKS -15 /* all rocks are in use */
-#define LWP_EBADROCK -16 /* the specified rock does not exist */
-
-
-/* Maximum priority permissible (minimum is always 0) */
-#define LWP_MAX_PRIORITY 4
-
-/* Usual priority used by user LWPs */
-#define LWP_NORMAL_PRIORITY (LWP_MAX_PRIORITY-1)
-
-#define LWP_SignalProcess(event) LWP_INTERNALSIGNAL(event, 1)
-#define LWP_NoYieldSignal(event) LWP_INTERNALSIGNAL(event, 0)
-
-/* Users aren't really supposed to know what a pcb is, but .....*/
-typedef struct lwp_pcb *PROCESS;
-
-/* Action to take on stack overflow. */
-#define LWP_SOQUIET 1 /* do nothing */
-#define LWP_SOABORT 2 /* abort the program */
-#define LWP_SOMESSAGE 3 /* print a message and be quiet */
-extern int lwp_overflowAction;
-
-/* Invalid LWP Index */
-#define LWP_INVALIDTHREADID (-1)
-
-/* Tells if stack size counting is enabled. */
-extern int lwp_stackUseEnabled;
-
-int LWP_QWait(void);
-int LWP_QSignal(PROCESS);
-int LWP_Init(int, int, PROCESS *);
-int LWP_InitializeProcessSupport(int, PROCESS *);
-int LWP_TerminateProcessSupport();
-int LWP_CreateProcess(void (*)(), int, int, char *, char *, PROCESS *);
-int LWP_CurrentProcess(PROCESS *);
-int LWP_DestroyProcess(PROCESS);
-int LWP_DispatchProcess();
-int LWP_GetProcessPriority(PROCESS, int *);
-int LWP_INTERNALSIGNAL(void *, int);
-int LWP_WaitProcess(void *);
-int LWP_MwaitProcess(int, char **);
-int LWP_StackUsed(PROCESS, int *, int *);
-int LWP_NewRock(int, char *);
-int LWP_GetRock(int, char **);
-char *LWP_Name();
-int LWP_Index();
-int LWP_HighestIndex();
-
-int IOMGR_SoftSig(void (*)(), char *);
-int IOMGR_Initialize(void);
-int IOMGR_Finalize(void);
-long IOMGR_Poll(void);
-int IOMGR_Select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
-int IOMGR_Cancel(PROCESS);
-int IOMGR_Signal(int, char *);
-int IOMGR_CancelSignal(int);
-void IOMGR_Sleep(unsigned int);
-
-int FT_Init(int, int);
-#if __GNUC__ >= 2
-struct timezone;
-#endif
-int FT_GetTimeOfDay(struct timeval *, struct timezone *);
-int TM_GetTimeOfDay(struct timeval *, struct timezone *);
-int FT_AGetTimeOfDay(struct timeval *, struct timezone *);
-unsigned int FT_ApproxTime(void);
-
-/* Initial size of eventlist in a PCB; grows dynamically */
-#define EVINITSIZE 5
-
-struct rock
- {/* to hide things associated with this LWP under */
- int tag; /* unique identifier for this rock */
- /* pointer to some arbitrary data structure */
-#if defined(PTHREADS_LWP)
- pthread_key_t val;
-#elif defined(WINDOWS_THREADS_LWP)
- LPVOID val;
-#endif
- };
-
-#define MAXROCKS 4 /* max no. of rocks per LWP */
-
-struct lwp_pcb { /* process control block */
- char name[32];
- int rc;
- char status;
- char **eventlist;
- char eventlistsize;
- int eventcnt;
- int wakevent;
- int waitcnt;
- char blockflag;
- int priority;
- PROCESS misc;
- char *stack;
- int stacksize;
- long stackcheck;
- void (*ep)(char *);
- char *parm;
- int rused;
- struct rock rlist[MAXROCKS];
- PROCESS next, prev;
- int level;
- struct IoRequest *iomgrRequest;
- int index;
- struct timeval lastReady;
-#if defined(PTHREADS_LWP)
- pthread_mutex_t m;
- pthread_cond_t c;
- pthread_attr_t a;
-#elif defined(WINDOWS_THREADS_LWP)
- HANDLE m;
- HANDLE c;
- HANDLE t;
-#endif
-};
-
-extern int lwp_nextindex; /* Next lwp index to assign */
-
-extern PROCESS lwp_cpptr; /* pointer to current process pcb */
-struct lwp_ctl { /* LWP control structure */
- int processcnt; /* number of lightweight processes */
- char *outersp; /* outermost stack pointer */
- PROCESS outerpid; /* process carved by Initialize */
- PROCESS first, last; /* ptrs to first and last pcbs */
- char dsptchstack[800]; /* stack for dispatcher use only */
-};
-
-/* Debugging macro */
-#ifdef LWPDEBUG
-#define lwpdebug(level, msg)\
- if (lwp_debug > level) {\
- printf("***LWP (0x%x): ", lwp_cpptr);\
- printf msg;\
- putchar('\n');\
- fflush(stdout);\
- }
-#else /* LWPDEBUG */
-#define lwpdebug(level, msg)
-#endif /* LWPDEBUG */
-
-#define MAXTHREADS 100
-
-#endif /* LWP_INCLUDED */
-
-
-
diff --git a/usr.sbin/afs/src/lwp/preempt.c b/usr.sbin/afs/src/lwp/preempt.c
deleted file mode 100644
index 81000ab7896..00000000000
--- a/usr.sbin/afs/src/lwp/preempt.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/*******************************************************************\
-* *
-* Information Technology Center *
-* Carnegie-Mellon University *
-* *
-* Bradley White and M. Satyanarayanan *
-\*******************************************************************/
-
-#include <sys/time.h>
-#include <signal.h>
-#include <lwp.h>
-#include "preempt.h"
-
-RCSID("$arla: preempt.c,v 1.9 2002/06/02 11:59:54 lha Exp $");
-
-sig_atomic_t PRE_Block = 0; /* used in lwp.c and process.s */
-
-#ifdef HAVE_GETITIMER
-
-static RETSIGTYPE
-#if defined(AFS_POSIX_SIGNALS)
-AlarmHandler(int sig)
-#else
-AlarmHandler(int sig, int code, struct sigcontext *scp)
-#endif
-{
-#ifdef AFS_POSIX_SIGNALS
- sigset_t mask ;
-#endif
-
- if (PRE_Block == 0 && lwp_cpptr->level == 0) {
- PRE_BeginCritical();
-#if defined(AFS_POSIX_SIGNALS)
- sigemptyset(&mask);
- sigaddset(&mask, sig);
- sigprocmask(SIG_UNBLOCK, &mask, (sigset_t *)0);
-#else
- sigsetmask(scp->sc_mask);
-#endif
- LWP_DispatchProcess();
- PRE_EndCritical();
- }
-
-}
-
-
-
-int
-PRE_InitPreempt(struct timeval *slice)
-{
- struct itimerval itv;
-#ifdef AFS_POSIX_SIGNALS
- struct sigaction sa;
-#else
- struct sigvec vec;
-#endif
-
- if (lwp_cpptr == 0) return (LWP_EINIT);
-
- if (slice == 0) {
- itv.it_interval.tv_sec = itv.it_value.tv_sec = DEFAULTSLICE;
- itv.it_interval.tv_usec = itv.it_value.tv_usec = 0;
- } else {
- itv.it_interval = itv.it_value = *slice;
- }
-
-#ifdef AFS_POSIX_SIGNALS
- sa.sa_handler = AlarmHandler;
-#ifndef SA_NODEFER
-#define SA_NODEFER 0
-#endif
-#ifdef SA_SIGINFO
- sa.sa_flags = SA_SIGINFO|SA_NODEFER;
-#else
- sa.sa_flags = SA_NODEFER;
-#endif
-
- if ((sigaction(SIGALRM, &sa, (struct sigaction *)0) == -1) ||
- (setitimer(ITIMER_REAL, &itv, (struct itimerval *) 0) == -1))
- return(LWP_ESYSTEM);
-#else
- vec.sv_handler = AlarmHandler;
- vec.sv_mask = vec.sv_onstack = 0;
-
- if ((sigvec(SIGALRM, &vec, (struct sigvec *)0) == -1) ||
- (setitimer(ITIMER_REAL, &itv, (struct itimerval *) 0) == -1))
- return(LWP_ESYSTEM);
-#endif
-
- return(LWP_SUCCESS);
-}
-
-int
-PRE_EndPreempt(void)
-{
- struct itimerval itv;
-#ifdef AFS_POSIX_SIGNALS
- struct sigaction sa;
-#else
- struct sigvec vec;
-#endif
-
- if (lwp_cpptr == 0)
- return (LWP_EINIT);
-
- itv.it_value.tv_sec = itv.it_value.tv_usec = 0;
-
-#ifdef AFS_POSIX_SIGNALS
- sa.sa_handler = SIG_DFL;
- sa.sa_flags=0;
-
- if ((setitimer(ITIMER_REAL, &itv, (struct itimerval *) 0) == -1) ||
- (sigaction(SIGALRM, &sa, (struct sigaction *)0) == -1))
- return(LWP_ESYSTEM);
-#else
- vec.sv_handler = SIG_DFL;
- vec.sv_mask = vec.sv_onstack = 0;
-
- if ((setitimer(ITIMER_REAL, &itv, (struct itimerval *) 0) == -1) ||
- (sigvec(SIGALRM, &vec, (struct sigvec *)0) == -1))
- return(LWP_ESYSTEM);
-#endif
-
- return(LWP_SUCCESS);
-}
-
-#else /* !HAVE_GETITIMER */
-
-int
-PRE_InitPreempt(struct timeval *slice)
-{
- return LWP_SUCCESS;
-}
-
-int
-PRE_EndPreempt(void)
-{
- return LWP_SUCCESS;
-}
-
-#endif /* HAVE_GETITIMER */
diff --git a/usr.sbin/afs/src/lwp/preempt.h b/usr.sbin/afs/src/lwp/preempt.h
deleted file mode 100644
index feeb8b94791..00000000000
--- a/usr.sbin/afs/src/lwp/preempt.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* $arla: /afs/stacken.kth.se/src/SourceRepository/arla/lwp/preempt.h,v 1.3 2002/06/02 11:59:54 lha Exp $ */
-/* $arla: /afs/stacken.kth.se/src/SourceRepository/arla/lwp/preempt.h,v $ */
-
-#if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS)
-static char *rcsidpreempt = "$arla: /afs/stacken.kth.se/src/SourceRepository/arla/lwp/preempt.h,v 1.3 2002/06/02 11:59:54 lha Exp $";
-#endif
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/*******************************************************************\
-* *
-* Information Technology Center *
-* Carnegie-Mellon University *
-* *
-* Bradley White and M. Satyanarayanan *
-\*******************************************************************/
-
-
-#define PRE_PreemptMe() lwp_cpptr->level = 0
-#define PRE_BeginCritical() lwp_cpptr->level++
-#define PRE_EndCritical() lwp_cpptr->level--
-
-#define DEFAULTSLICE 10
-
-int PRE_InitPreempt(struct timeval *);
-int PRE_EndPreempt(void);
-
-extern sig_atomic_t PRE_Block;
-
diff --git a/usr.sbin/afs/src/lwp/process-vpp.s b/usr.sbin/afs/src/lwp/process-vpp.s
deleted file mode 100644
index 25abcbc1000..00000000000
--- a/usr.sbin/afs/src/lwp/process-vpp.s
+++ /dev/null
@@ -1,171 +0,0 @@
-/* -*- text -*- */
-/*
- * Copyright (c) 1998 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Kungliga Tekniska
- * Högskolan and its contributors.
- *
- * 4. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: process-vpp.s,v 1.1 1998/10/25 19:41:15 joda Exp $ */
-
-/* LWP context switch for Fujitsu UXP/V */
-
-#define registers 8 /* leave room for fp, and ra */
-#define floats (registers + 12 * 4)
-#ifdef SAVE_FLOATS
-#define FRAMESIZE (floats + 15 * 8)
-#else
-#define FRAMESIZE floats
-#endif
-
-/*
-void savecontext(int (*)(void), struct savearea*, void*);
-*/
-
- .section .text
- .global savecontext
- .align 8
-savecontext:
- /* make space */
- or %gr1, %gr0, %gr2 & st %gr2, %gr1, 4
- addi23 %gr1, -FRAMESIZE, %gr1 & st %gr3, %gr2, %gr0
-
- /* save registers */
- /* XXX save more registers? */
- st %gr4, %gr1, registers + 0
- st %gr5, %gr1, registers + 4
- st %gr6, %gr1, registers + 8
- st %gr7, %gr1, registers + 12
- st %gr8, %gr1, registers + 16
- st %gr9, %gr1, registers + 20
- st %gr10, %gr1, registers + 24
- st %gr11, %gr1, registers + 28
- st %gr12, %gr1, registers + 32
- st %gr13, %gr1, registers + 36
- st %gr14, %gr1, registers + 40
- st %gr15, %gr1, registers + 44
-
-#ifdef SAVE_FLOATS
- /* save floting point registers */
- st.d %fr1, %gr1, floats + 0
- st.d %fr2, %gr1, floats + 8
- st.d %fr3, %gr1, floats + 16
- st.d %fr4, %gr1, floats + 24
- st.d %fr5, %gr1, floats + 32
- st.d %fr6, %gr1, floats + 40
- st.d %fr7, %gr1, floats + 48
- st.d %fr8, %gr1, floats + 56
- st.d %fr9, %gr1, floats + 64
- st.d %fr10, %gr1, floats + 72
- st.d %fr11, %gr1, floats + 80
- st.d %fr12, %gr1, floats + 88
- st.d %fr13, %gr1, floats + 96
- st.d %fr14, %gr1, floats + 104
- st.d %fr15, %gr1, floats + 112
-#endif
-
- /* block */
- addi5 %gr0, 1, %gr20
- seti PRE_Block, %gr21
- st.c %gr20, %gr21, 0
-
- /* save sp */
- st %gr1, %gr17, 0
- /* new sp */
- subi5 %gr18, 0, %gr0
- brc %iccp.z, samestack
-
- /* switch to new stack */
- or %gr18, %gr0, %gr1
- /* load fp */
- ld %gr1, 0, %gr2
-
-samestack:
- /* is this necessary? */
- or %gr16, %gr0, %gr3
- jmp %gr3
-
- .type savecontext,@function
- .size savecontext,.-savecontext
-
-/*
-void returnto(struct savearea*);
-*/
- .global returnto
- .align 8
-returnto:
- seti PRE_Block, %gr17
- st.c %gr0, %gr17, 0
- /* restore sp */
- ld %gr16, 0, %gr1
- /* restore registers */
- ld %gr1, registers + 0, %gr4
- ld %gr1, registers + 4, %gr5
- ld %gr1, registers + 8, %gr6
- ld %gr1, registers + 12, %gr7
- ld %gr1, registers + 16, %gr8
- ld %gr1, registers + 20, %gr9
- ld %gr1, registers + 24, %gr10
- ld %gr1, registers + 28, %gr11
- ld %gr1, registers + 32, %gr12
- ld %gr1, registers + 36, %gr13
- ld %gr1, registers + 40, %gr14
- ld %gr1, registers + 44, %gr15
-
-#ifdef SAVE_FLOATS
- /* restore floting point registers */
- ld.d %gr1, floats + 0, %fr1
- ld.d %gr1, floats + 8, %fr2
- ld.d %gr1, floats + 16, %fr3
- ld.d %gr1, floats + 24, %fr4
- ld.d %gr1, floats + 32, %fr5
- ld.d %gr1, floats + 40, %fr6
- ld.d %gr1, floats + 48, %fr7
- ld.d %gr1, floats + 56, %fr8
- ld.d %gr1, floats + 64, %fr9
- ld.d %gr1, floats + 72, %fr10
- ld.d %gr1, floats + 80, %fr11
- ld.d %gr1, floats + 88, %fr12
- ld.d %gr1, floats + 96, %fr13
- ld.d %gr1, floats + 104, %fr14
- ld.d %gr1, floats + 112, %fr15
-#endif
- addi23 %gr1, FRAMESIZE, %gr1
- ld %gr1, 0, %gr3
- ld %gr1, 4, %gr2
-
- jmp %gr3
-
- .type returnto,@function
- .size returnto,.-returnto
diff --git a/usr.sbin/afs/src/lwp/process.aix22.S b/usr.sbin/afs/src/lwp/process.aix22.S
deleted file mode 100644
index a8cc0414eaf..00000000000
--- a/usr.sbin/afs/src/lwp/process.aix22.S
+++ /dev/null
@@ -1,120 +0,0 @@
-/* $arla: process.aix22.S,v 1.1 2000/01/02 02:11:15 lha Exp $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#include <config.h>
-
-#undef RCSID
-
-/*
-#
-# Information Technology Center
-# Carnegie-Mellon University
-#
-*/
-/*
-#
-# Process assembly language assist for Sailboats.
-#
-*/
-
- .text
- .globl .savecontext
- .align 1
-
-/*
-#
-# struct savearea {
-# char *topstack;
-# }
-#
-*/
-
-
-/*# Offsets of fields*/
-.set topstack,0
-
-/*# Stuff to allow saving/restoring registers*/
-.set regspace,64
-.set freg,0
-
-/*
-#
-# savecontext(f, area1, newsp)
-# int (*f)(); struct savearea *area1; char *newsp;
-#
-*/
-
-.savecontext:
- ai 1,1,-regspace # Save frame pointer & ...
-
-/*# Save registers*/
- stm 0,0(1) # Change this if save fewer regs.
- lr 14,0
-/*# Set preemption semaphore*/
- lis 6,1
- l 7,4(14)
- sts 6,0(7)
-/*# r3 = base of savearea*/
- st 1,topstack(3) # area1->topstack = sp
-/*# New sp is in r4.*/
- ci 4,0
- beq L1 # If newsp == 0, no stack switch
- cas 1,4,0 # Switch to new stack
-L1:
- l 6,0(2) # r2 = _f
- balrx 15,6 # f()
- cas 0,2,0
- .data 3
- .globl _savecontext
-_savecontext:
- .long .savecontext
- .long _PRE_Block
-/*
-#
-# returnto(area2)
-# struct savearea *area2;
-#
-*/
-
- .text
- .globl .returnto
- .align 1
-.returnto:
- l 1,topstack(2)
-/*
-# Now in the context of the savecontext stack to be restored.
-# Start with the registers...
-# Clear preemption semaphore
-*/
- lr 14,0
- lis 6,0
- l 7,4(14)
- sts 6,0(7)
- lm 0,0(1) # Change if saving fewer regs.
- brx 15 # Return to previous process
- ai 1,1,regspace
- .data 3
- .globl _returnto
-_returnto:
- .long .returnto
- .long _PRE_Block
diff --git a/usr.sbin/afs/src/lwp/process.alpha.S b/usr.sbin/afs/src/lwp/process.alpha.S
deleted file mode 100644
index dc36d55f521..00000000000
--- a/usr.sbin/afs/src/lwp/process.alpha.S
+++ /dev/null
@@ -1,205 +0,0 @@
-/* $arla: process.alpha.S,v 1.1 2000/01/02 02:11:15 lha Exp $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#include <config.h>
-
-#undef RCSID
-
-/* Code for DEC Alpha architecture */
-#ifdef AFS_OSF_ENV
-#include <machine/asm.h>
-#include <machine/regdef.h>
-#define fs0 $f2
-#define fs1 $f3
-#define fs2 $f4
-#define fs3 $f5
-#define fs4 $f6
-#define fs5 $f7
-#define fs6 $f8
-#define fs7 $f9
-#elif AFS_LINUX_ENV
-#define v0 $0
-#define t0 $1
-#define t1 $2
-#define t2 $3
-#define t3 $4
-#define t4 $5
-#define t5 $6
-#define t6 $7
-#define t7 $8
-
-#define s0 $9
-#define s1 $10
-#define s2 $11
-#define s3 $12
-#define s4 $13
-#define s5 $14
-#define s6 $15
-
-#define fp $15
-#define a0 $16
-#define a1 $17
-#define a2 $18
-#define a3 $19
-#define a4 $20
-#define a5 $21
-#define t8 $22
-#define t9 $23
-#define t10 $24
-#define t11 $25
-#define ra $26
-#define pv $27
-#define t12 $27
-#define at $28
-#define gp $29
-#define sp $30
-#define zero $31
-
-#define fs0 $f2
-#define fs1 $f3
-#define fs2 $f4
-#define fs3 $f5
-#define fs4 $f6
-#define fs5 $f7
-#define fs6 $f8
-#define fs7 $f9
-
-#define M_S0 0x00000200
-#define M_S1 0x00000400
-#define M_S2 0x00000800
-#define M_S3 0x00001000
-#define M_S4 0x00002000
-#define M_S5 0x00004000
-#define M_S6 0x00008000
-
-#define M_RA 0x04000000
-
-#define END(proc) \
- .end proc
-
-#define NESTED(x, fsize, rpc) \
- .globl x ; \
- .ent x,0 ; \
-x: ; \
- .frame sp,fsize, rpc
-
-
-#define LEAF(x) \
- .globl x ; \
- .ent x,0 ; \
-x: ; \
- .frame sp,0,ra
-
-#define IMPORT(sym, size) \
- .extern sym,size
-#elif defined(HAVE_MACHINE_ASM_H) /* BSD */
-#include <machine/asm.h>
-#elif defined(HAVE_MACH_ALPHA_ASM_H) /* OSF */
-#include <mach/alpha/asm.h>
-#endif
-
-#define FRAMESIZE ((8*8)+8+(7*8))
-#define floats 0
-#define registers (floats+(8*8))
-#define returnaddr (FRAMESIZE-8)
-#define topstack 0
-
-#if defined(AFS_OSF_ENV) || defined(AFS_LINUX_ENV)
- IMPORT(PRE_Block,4)
-#endif
-.align 4
-#if defined(AFS_OSF_ENV) || defined(AFS_LINUX_ENV)
-NESTED(savecontext,FRAMESIZE,ra)
-#else /* OSF || LINUX */
-NESTED(savecontext,3,FRAMESIZE,ra,0x0400f700,0x000003fc)
-#endif /* OSF */
- ldgp gp,0(pv)
- lda t0, 1(zero)
- stl t0, PRE_Block
- lda sp,-FRAMESIZE(sp)
-/* Save callee-saved registers. */
- stq s0, (registers+0) (sp)
- stq s1, (registers+8) (sp)
- stq s2, (registers+16) (sp)
- stq s3, (registers+24) (sp)
- stq s4, (registers+32) (sp)
- stq s5, (registers+40) (sp)
- stq s6, (registers+48) (sp)
-/* Save return address */
- stq ra, returnaddr(sp)
-
-#if !defined(AFS_BSD_ENV)
- .mask (M_S0|M_S1|M_S2|M_S3|M_S4|M_S5|M_S6|M_RA), -FRAMESIZE
-#endif
-
-/* Save floating point registers */
- stt fs0, (floats+0) (sp)
- stt fs1, (floats+8) (sp)
- stt fs2, (floats+16) (sp)
- stt fs3, (floats+24) (sp)
- stt fs4, (floats+32) (sp)
- stt fs5, (floats+40) (sp)
- stt fs6, (floats+48) (sp)
- stt fs7, (floats+56) (sp)
-
- .prologue 1
- stq sp, topstack(a1)
- or a0,zero,pv /* call point in pv */
- beq a2, samestack
- or a2,zero,sp /* switch stack */
-samestack:
- jsr ra,(pv),0 /* off we go */
- END(savecontext)
-
-#if defined(AFS_OSF_ENV) || defined(AFS_LINUX_ENV)
-LEAF(returnto)
-#else
-LEAF(returnto,1)
-#endif
- ldgp gp,0(pv)
-
- .prologue 1
- ldq sp, topstack(a0)
-/* Restore callee-saved regs */
- ldq s0, (registers+0) (sp)
- ldq s1, (registers+8) (sp)
- ldq s2, (registers+16) (sp)
- ldq s3, (registers+24) (sp)
- ldq s4, (registers+32) (sp)
- ldq s5, (registers+40) (sp)
- ldq s6, (registers+48) (sp)
-/* Return address */
- ldq ra, returnaddr(sp)
-/* Floating point registers */
- ldt fs0, (floats+0) (sp)
- ldt fs1, (floats+8) (sp)
- ldt fs2, (floats+16) (sp)
- ldt fs3, (floats+24) (sp)
- ldt fs4, (floats+32) (sp)
- ldt fs5, (floats+40) (sp)
- ldt fs6, (floats+48) (sp)
- ldt fs7, (floats+56) (sp)
- lda sp, FRAMESIZE(sp)
- stl zero, PRE_Block
- RET
- END(returnto)
diff --git a/usr.sbin/afs/src/lwp/process.arm.S b/usr.sbin/afs/src/lwp/process.arm.S
deleted file mode 100644
index 18ba60fc39b..00000000000
--- a/usr.sbin/afs/src/lwp/process.arm.S
+++ /dev/null
@@ -1,103 +0,0 @@
-/* $OpenBSD: process.arm.S,v 1.2 2006/11/17 20:54:47 deraadt Exp $ */
-
-/*
- * Copyright (c) 2004 Dale Rahn. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <config.h>
-
-#define FRAME_OFFSET 8 /* XXX */
-#define FRAME_SIZE (52 +(11*4)+FRAME_OFFSET) /* FP + r4-r14 */
-
-#define TOP_OF_STACK (0*4)
-#define RETURN (1*4)
-
-
-/*
- * savecontext(int (*f)(), struct savearea *save, char *newsp)
- */
- .globl savecontext
- .type savecontext%function
-savecontext:
- str r2, [r1]
- ldr r3, .LPRE_Block
- mov r2, #1
- str r2, [r3]
- ldr r2, [r1]
-
- sub sp, sp, #FRAME_SIZE
- add r3, sp, #FRAME_OFFSET
-#if __SOFTFP__
- add r3, r3, #52
-#else
- /* Store fp registers */
- sfm f4, 4, [r3], #48
- /* Store fpsr */
- rfs r3
- str r3, [r3], #0x0004
-#endif /*__SOFTFP__*/
- /* Store integer registers */
- stmia r3, {r4-r13}
-
- /* SAVE SP */
- str sp, [r1, #TOP_OF_STACK]
- str r14, [r1, #RETURN]
- cmp r2, #0
- movne sp, r2
- mov r15, r0
-
-.LPRE_Block:
- .word PRE_Block
-
-/*
- * returnto(struct savearea *area)
- */
- .globl returnto
- .type returnto%function
-returnto:
- ldr sp, [r0, #TOP_OF_STACK]
- ldr r14, [r0, #RETURN]
- add r3, sp, #FRAME_OFFSET
- mov r1, r3
-#if __SOFTFP__
- add r3, r3, #52
-#else
- /* Restore fp registers */
- lfm f4, 4, [r3], #48
- /* Restore FPSR */
- ldr r4, [r3], #0x0004
- wfs r4
-#endif /* __SOFTFP__ */
- /* Restore integer registers */
- ldmia r3, {r4-r13}
-
- ldr r3, .LPRE_Block
- mov r2, #0
- str r2, [r3]
-
- add sp, sp, #FRAME_SIZE
-#ifdef __ARM_26__
- mov r15, r14
-#else
- mov r15, r14
-#endif
diff --git a/usr.sbin/afs/src/lwp/process.hpux.S b/usr.sbin/afs/src/lwp/process.hpux.S
deleted file mode 100644
index 2502ae3246d..00000000000
--- a/usr.sbin/afs/src/lwp/process.hpux.S
+++ /dev/null
@@ -1,436 +0,0 @@
-#ifdef AFS_HPUX_ENV
-#ifdef hp9000s300
-/*
-#
-# Process assembly language assist for HP 9000 series 300s.
-#
-*/
-
- text
-
-/*
-#
-# struct savearea {
-# char *topstack;
-# }
-#
-*/
-
- global _PRE_Block
-
- set topstack,0
-
-/* Stuff to allow saving/restoring registers */
- set NREGS,13
- set REGS,0x3ffe # d1-d7 & a0-a5
-
-/*
-# savecontext(f, area1, newsp)
-# int (*f)(); struct savearea *area1; char *newsp;
-*/
-
-/* Stack offsets of arguments */
- set f,8
- set area1,12
- set newsp,16
-
- global _savecontext
-_savecontext:
- mov.l &1,_PRE_Block # Dont allow any interrupt finagling
- link %a6,&-(NREGS*4) # Save frame pointer & ...
- # ... allocate space for nregs registers
-/* Save registers */
- movem.l &REGS,(%sp)
-
- mov.l area1(%a6),%a0 # a0 = base of savearea
- mov.l %sp,topstack(%a0) # area->topstack = sp
- mov.l newsp(%a6),%d0 # Get new sp
- beq.b l1 # If newsp == 0, no stack switch
- mov.l %d0,%sp # Switch to new stack
-l1:
- mov.l f(%a6),%a0 # a0 = f
- jsr (%a0) # f()
-
-/* It is impossible to be here, so abort() */
-
- jsr _abort
-
-/*
-# returnto(area2)
-# struct savearea *area2;
-*/
-
-/* Stack offset of argument */
-set area2,8
-
- global _returnto
-_returnto:
- link %a6,&0
- mov.l area2(%a6),%a0 # Base of savearea
- mov.l topstack(%a0),%sp # Restore sp
-/* Restore registers */
- movem.l (%sp),&REGS
-
- add.l &(NREGS*4),%sp
- mov.l %sp,%a6 # Argghh...be careful here
- unlk %a6
- clr.l _PRE_Block
- rts # Return to previous process
-#else
-
-/* start of S700 code */
-#ifdef AFS_HPUX_PIC_ENV
-/* this code is PIC */
- .CODE
-
- /*
- ; savecontext(f, area1, newsp)
- ; int (*f)();
- ; struct savearea *area1;
- ; char *newsp;
- */
-savecontext
- .PROC
- /*
- ; Callinfo sets up register saves using the ENTRY_GR
- ; and ENTRY_FR parameters. ENTRY_FR=21 is only valid
- ; for PA 1.1. (How to deal with this for 800?)
- */
- .CALLINFO CALLER,FRAME=0,SAVE_RP,ENTRY_GR=18,ENTRY_FR=21
- /*
- ; The ENTER statement generates register saves and
- ; procedure setup.
- */
- .ENTER
-
- LDI 1,%r1 /* Store a (char) 1 in */
- LDW T%PRE_Block(0,%r19),%r31 /* global variable */
- STW %r1,0(0,%r31) /* PRE_Block. */
-
-
- COPY %arg0,%r22 /* Copy arg0 (f) to dyncall's input register */
-
- COMIB,= 0,%arg2,L$0001 /* Compare arg2 (newsp) to 0. Execute the */
- /* next instruction regardless of value. */
- STW %r30,0(0,%arg1) /* Store the stack pointer in the first */
- /* element (0th offset) of arg1 (area1). */
- COPY %arg2,%r30 /* Move arg2 (newsp) into the stack ptr. */
-
-L$0001
- .CALL
- BL $$dyncall,%r31 /* Dynamic call using pointer in r22. */
- COPY %r31,%r2
- COPY %r20, %r19 /* restore link table. */
-
- .CALL
- BL exit,%r2 /* Can't get here, so abort. */
- NOP
- .LEAVE
- .PROCEND
-
- /* returnto(area2)
- * struct savearea *area2;
- */
-returnto
- .PROC
- .CALLINFO CALLER,FRAME=0,SAVE_RP,ENTRY_GR=18,ENTRY_FR=21
- /* No ENTRY is used since this is a magic routine. */
- LDWS 0(0,%arg0),%r30 /* Load the stack pointer from area2 */
-
- LDW T%PRE_Block(0,%r19),%r31 /* set PRE_Block = 0; */
- STW %r0,0(0,%r31)
- .LEAVE
- .PROCEND
-
- .EXPORT savecontext,ENTRY
- .EXPORT returnto,ENTRY
- .IMPORT PRE_Block,DATA
- .IMPORT $$dyncall,MILLICODE
- .IMPORT exit,CODE
-
- .END
-#else /* AFS_HPUX_PIC_ENV */
-/* non-pic'ified code */
- .CODE
-
- /*
- ; savecontext(f, area1, newsp)
- ; int (*f)();
- ; struct savearea *area1;
- ; char *newsp;
- */
-savecontext
- .PROC
- /*
- ; Callinfo sets up register saves using the ENTRY_GR
- ; and ENTRY_FR parameters. ENTRY_FR=21 is only valid
- ; for PA 1.1. (How to deal with this for 800?)
- */
- .CALLINFO CALLER,FRAME=0,SAVE_RP,ENTRY_GR=18,ENTRY_FR=21
- /* The ENTER statement generates register saves and */
- /* procedure setup. */
- .ENTER
-
- LDI 1,%r31 /* Store a (char) 1 in */
- ADDIL L%PRE_Block-$global$,%r27 /* global variable */
- STW %r31,R%PRE_Block-$global$(0,%r1) /* PRE_Block. */
-
- COPY %r26,%r22 /* Copy arg0 (f) to dyncall's input register. */
-
- COMIB,= 0,%r24,L$0001 /* Compare arg2 (newsp) to 0. Execute the */
- /* next instruction regardless of value. */
- STWS %r30,0(0,%r25) /* Store the stack pointer in the first */
- /* element (0th offset) of arg1 (area1). */
- COPY %r24,%r30 /* Move arg2 (newsp) into the stack ptr. */
-
-L$0001
- .CALL
- BL $$dyncall,%r31 /* Dynamic call using pointer in r22. */
- COPY %r31,%r2
-
- .CALL
- BL abort,%r2 /* Can't get here, so abort.
- NOP
- .LEAVE
- .PROCEND
-
- /*
- ; returnto(area2)
- ; struct savearea *area2;
- */
-returnto
- .PROC
- .CALLINFO CALLER,FRAME=0,SAVE_RP,ENTRY_GR=18,ENTRY_FR=21
- /* No ENTRY is used since this is a magic routine. */
- ADDIL L%PRE_Block-$global$,%r27 /* PRE_Block = 0 */
- STW %r0,R%PRE_Block-$global$(0,%r1)
-
- LDWS 0(0,%r26),%r30 /* Load the stack pointer from area2 */
- .LEAVE
- .PROCEND
-
- .EXPORT savecontext,ENTRY
- .EXPORT returnto,ENTRY
- .IMPORT $global$,DATA
- .IMPORT PRE_Block,DATA
- .IMPORT $$dyncall,MILLICODE
- .IMPORT abort,CODE
-
- .END
-#endif /* AFS_HPUX_PIC_ENV */
-#endif /* hp9000s300 */
-#endif /* AFS_HPUX_ENV */
-
-#ifdef AFS_BSD_ENV
-#ifdef AFS_BSD_PIC_ENV
-/* this code is PIC */
- .CODE
-
- /*
- ; savecontext(f, area1, newsp)
- ; int (*f)();
- ; struct savearea *area1;
- ; char *newsp;
- */
-savecontext
- .PROC
- /*
- ; Callinfo sets up register saves using the ENTRY_GR
- ; and ENTRY_FR parameters. ENTRY_FR=21 is only valid
- ; for PA 1.1. (How to deal with this for 800?)
- */
- .CALLINFO CALLER,FRAME=0,SAVE_RP,ENTRY_GR=18,ENTRY_FR=21
- .ENTRY
- STW %r2, -20(%sr0,%r30)
- stwm %r3, 0x80(%r30)
- stw %r4, -0x40(%r30)
- stw %r5, -0x3c(%r30)
- stw %r6, -0x38(%r30)
- stw %r7, -0x34(%r30)
- stw %r8, -0x30(%r30)
- stw %r9, -0x2c(%r30)
- stw %r10, -0x28(%r30)
- stw %r11, -0x24(%r30)
- stw %r12, -0x20(%r30)
- stw %r13, -0x1c(%r30)
- stw %r14, -0x18(%r30)
- stw %r15, -0x14(%r30)
- stw %r16, -0x10(%r30)
- stw %r17, -0x0c(%r30)
- stw %r18, -0x08(%r30)
- stw %r19, -0x04(%r30)
-
- LDI 1,%r1 /* Store a (char) 1 in */
- LDW T%PRE_Block(%sr0,%r19),%r31 /* global variable */
- STW %r1,0(%sr0,%r31) /* PRE_Block. */
-
-
- COPY %arg0,%r22 /* Copy arg0 (f) to dyncall's input register */
-
- COMIB,= 0,%arg2,L$0001 /* Compare arg2 (newsp) to 0. Execute the */
- /* next instruction regardless of value. */
- STW %r30,0(%sr0,%arg1)/* Store the stack pointer in the first */
- /* element (0th offset) of arg1 (area1). */
- COPY %arg2,%r30 /* Move arg2 (newsp) into the stack ptr. */
-
-L$0001
- ldo 64(%r30), %r30
- .CALL
- BL $$dyncall,%r31 /* Dynamic call using pointer in r22. */
- COPY %r31,%r2
- COPY %r20, %r19 /* restore link table. */
-
- .CALL
- BL exit,%r2 /* Can't get here, so abort. */
- NOP
- .LEAVE
- .PROCEND
-
- /* returnto(area2)
- * struct savearea *area2;
- */
-returnto
- .PROC
- .CALLINFO CALLER,FRAME=0,SAVE_RP,ENTRY_GR=18,ENTRY_FR=21
- /* No ENTRY is used since this is a magic routine. */
- LDWS 0(0,%arg0),%r30 /* Load the stack pointer from area2 */
-
- ldw -0x04(%r30), %r19
- ldw -0x08(%r30), %r18
- ldw -0x0c(%r30), %r17
- ldw -0x10(%r30), %r16
- ldw -0x14(%r30), %r15
- ldw -0x18(%r30), %r14
- ldw -0x1c(%r30), %r13
- ldw -0x20(%r30), %r12
- ldw -0x24(%r30), %r11
- ldw -0x28(%r30), %r10
- ldw -0x2c(%r30), %r9
- ldw -0x30(%r30), %r8
- ldw -0x34(%r30), %r7
- ldw -0x38(%r30), %r6
- ldw -0x3c(%r30), %r5
- ldw -0x40(%r30), %r4
- ldw,mb -0x80(%r30), %r3
- LDW T%PRE_Block(0,%r19),%r31 /* set PRE_Block = 0; */
- LDW -20(%sr0,%r30), %r2
- BV %r0(%r2)
- STW %r0,0(0,%r31)
- .LEAVE
- .PROCEND
-
- .EXPORT savecontext,ENTRY
- .EXPORT returnto,ENTRY
- .IMPORT PRE_Block,DATA
- .IMPORT $$dyncall,MILLICODE
- .IMPORT exit,CODE
-
- .END
-#else /* AFS_BSD_PIC_ENV */
-/* non-pic'ified code */
- .IMPORT $global$,DATA
- .IMPORT PRE_Block,DATA
- .IMPORT $$dyncall,MILLICODE
- .IMPORT abort,CODE
-
- .text
-
- /*
- ; savecontext(f, area1, newsp)
- ; int (*f)();
- ; struct savearea *area1;
- ; char *newsp;
- */
- .EXPORT savecontext,ENTRY
-savecontext
- .PROC
- /*
- ; Callinfo sets up register saves using the ENTRY_GR
- ; and ENTRY_FR parameters. ENTRY_FR=21 is only valid
- ; for PA 1.1. (How to deal with this for 800?)
- */
- .CALLINFO CALLER,FRAME=0,SAVE_RP,ENTRY_GR=18,ENTRY_FR=21
- .ENTRY
- STW %r2, -20(%sr0,%r30)
- stwm %r3, 0x80(%r30)
- stw %r4, -0x40(%r30)
- stw %r5, -0x3c(%r30)
- stw %r6, -0x38(%r30)
- stw %r7, -0x34(%r30)
- stw %r8, -0x30(%r30)
- stw %r9, -0x2c(%r30)
- stw %r10, -0x28(%r30)
- stw %r11, -0x24(%r30)
- stw %r12, -0x20(%r30)
- stw %r13, -0x1c(%r30)
- stw %r14, -0x18(%r30)
- stw %r15, -0x14(%r30)
- stw %r16, -0x10(%r30)
- stw %r17, -0x0c(%r30)
- stw %r18, -0x08(%r30)
- stw %r19, -0x04(%r30)
-
- LDI 1,%r31 /* Store a (char) 1 in */
- ADDIL L%PRE_Block-$global$,%r27 /* global variable */
- STW %r31,R%PRE_Block-$global$(0,%r1) /* PRE_Block. */
-
- COPY %r26,%r22 /* Copy arg0 (f) to dyncall's input register. */
-
- COMIB,= 0,%r24,L$0001 /* Compare arg2 (newsp) to 0. Execute the */
- /* next instruction regardless of value. */
- STWS %r30,0(0,%r25) /* Store the stack pointer in the first */
- /* element (0th offset) of arg1 (area1). */
- COPY %r24,%r30 /* Move arg2 (newsp) into the stack ptr. */
-
-L$0001
- ldo 64(%r30), %r30
- .CALL
- BL $$dyncall,%r31 /* Dynamic call using pointer in r22. */
- COPY %r31,%r2
-
- .CALL
- BL abort,%r2 /* Can't get here, so abort. */
- NOP
- .EXIT
- .PROCEND
-
- .text
-
- /*
- ; returnto(area2)
- ; struct savearea *area2;
- */
- .EXPORT returnto,ENTRY
-returnto
- .PROC
- .CALLINFO CALLER,FRAME=0,SAVE_RP,ENTRY_GR=18,ENTRY_FR=21
- .ENTRY
- LDWS 0(0,%r26),%r30 /* Load the stack pointer from area2 */
- ADDIL L%PRE_Block-$global$,%r27 /* PRE_Block = 0 */
-
- ldw -0x04(%r30), %r19
- ldw -0x08(%r30), %r18
- ldw -0x0c(%r30), %r17
- ldw -0x10(%r30), %r16
- ldw -0x14(%r30), %r15
- ldw -0x18(%r30), %r14
- ldw -0x1c(%r30), %r13
- ldw -0x20(%r30), %r12
- ldw -0x24(%r30), %r11
- ldw -0x28(%r30), %r10
- ldw -0x2c(%r30), %r9
- ldw -0x30(%r30), %r8
- ldw -0x34(%r30), %r7
- ldw -0x38(%r30), %r6
- ldw -0x3c(%r30), %r5
- ldw -0x40(%r30), %r4
- ldw,mb -0x80(%r30), %r3
- LDW -20(%sr0,%r30), %r2
- BV %r0(%r2)
- STW %r0,R%PRE_Block-$global$(0,%r1)
- .EXIT
- .PROCEND
-
- .END
-#endif /* AFS_BSD_PIC_ENV */
-#endif /* AFS_BSD_ENV */
diff --git a/usr.sbin/afs/src/lwp/process.i386.S b/usr.sbin/afs/src/lwp/process.i386.S
deleted file mode 100644
index 3a519bc44ad..00000000000
--- a/usr.sbin/afs/src/lwp/process.i386.S
+++ /dev/null
@@ -1,111 +0,0 @@
-/* $arla: process.i386.S,v 1.1 2000/01/02 02:11:16 lha Exp $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#include <config.h>
-
-#undef RCSID
-
-/* i386 Assembly
- *
- * Written by Derek Atkins <warlord@MIT.EDU>
- * (debugging help by Chris Provenzano <proven@mit.edu>)
- * 11/1991
- * + * "ojala que sea correcto!"
- */
-
-#ifdef HAVE_MACHINE_ASM_H
-#include <machine/asm.h>
-#endif
-
-#include <lwp_elf.h>
-
-
- .file "process.s"
-
- .data
-
- .text
-
-/*
- * struct savearea {
- * char *topstack;
- * }
- */
-
- .set topstack,0
-
-/*
- * savecontext(f, area1, newsp)
- * int (*f)(); struct savearea *area1; char *newsp;
- */
-
-/* offsets, to make my life easier! */
- .set f,8
- .set area1,12
- .set newsp,16
-
-.globl _C_LABEL(PRE_Block)
-.globl _C_LABEL(savecontext)
-
-ENTRY(savecontext)
- pushl %ebp /* New Frame! */
- movl %esp,%ebp
- pushal /* Push all registers */
- movl $1,_C_LABEL(PRE_Block) /* Do not allow any interrupt finagling */
- movl area1(%ebp),%eax /* eax = base of savearea */
- movl %esp,topstack(%eax) /* area->topstack = esp */
- movl newsp(%ebp),%eax /* get new sp into eax */
- cmpl $0,%eax
- je L1 /* if new sp is 0 then dont change esp */
- movl %eax,%esp /* go ahead. make my day! */
-L1:
- jmp *f(%ebp) /* ebx = &f */
-
-/* Shouldnt be here....*/
-
- call _C_LABEL(abort)
-
-/*
- * returnto(area2)
- * struct savearea *area2;
- */
-
-/* stack offset */
- .set area2,8
-
-.globl _C_LABEL(returnto)
-
-ENTRY(returnto)
- pushl %ebp
- movl %esp, %ebp /* New frame, to get correct pointer */
- movl area2(%ebp),%eax /* eax = area2 */
- movl topstack(%eax),%esp /* restore esp */
- popal
- movl $0,_C_LABEL(PRE_Block) /* clear it up... */
- popl %ebp
- ret
-
-/* I see, said the blind man, as he picked up his hammer and saw! */
- pushl $1234
- call _C_LABEL(abort)
-
diff --git a/usr.sbin/afs/src/lwp/process.ibm032.S b/usr.sbin/afs/src/lwp/process.ibm032.S
deleted file mode 100644
index ab9873374ee..00000000000
--- a/usr.sbin/afs/src/lwp/process.ibm032.S
+++ /dev/null
@@ -1,109 +0,0 @@
-/* $arla: process.ibm032.S,v 1.1 2000/01/02 02:11:16 lha Exp $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#include <config.h>
-
-#undef RCSID
-
-|
-| Information Technology Center
-| Carnegie-Mellon University
-|
-|
- .data
- .globl .oVncs
- .set .oVncs,0
-
- .globl _savecontext
-_savecontext:
- .long _.savecontext
-
- .globl _returnto
-_returnto:
- .long _.returnto
-
-|
-| Process assembly language assist for Sailboats.
-|
-
- .text
- .align 2
-
-|
-| struct savearea {
-| char *topstack;
-| }
-|
-
-| Offsets of fields
-.set topstack,0
-
-| Stuff to allow saving/restoring registers
-.set regspace,64
-.set freg,0
-
-|
-| savecontext(f, area1, newsp)
-| int (*f)(); struct savearea *area1; char *newsp;
-|
-
- .globl _.savecontext
-_.savecontext:
- ai sp,sp,-regspace | Save frame pointer & ...
- | ... allocate space for 16 registers
-| Save registers
- stm r0,0(sp) | Change this if save fewer regs.
-| Set preemption semaphore
- get r6,$1
- get r7,$_PRE_Block
- put r6,0(r7) | PRE_Block = 1
-| r3 = base of savearea
- put sp,topstack(r3) | area1->topstack = sp
-| New sp is in r4.
- cis r4,0
- be L1 | If newsp == 0, no stack switch
- cas sp,r4,r0 | Switch to new stack
-L1:
- get r6,0(r2) | r2 = _f
- balrx r15,r6 | f()
- cas r0,r2,r0
-
-|
-| returnto(area2)
-| struct savearea *area2;
-|
-
- .globl _.returnto
-_.returnto:
- get sp,topstack(r2)
-| Now in the context of the savecontext stack to be restored.
-| Start with the registers...
-| Clear preemption semaphore
- get r6,$0
- get r7,$_PRE_Block
- put r6,0(r7) | PRE_Block = 0
- lm r0,0(sp) | Change if saving fewer regs.
- brx r15 | Return to previous process
- ai sp,sp,regspace
- .data
- .ltorg
diff --git a/usr.sbin/afs/src/lwp/process.m68k.S b/usr.sbin/afs/src/lwp/process.m68k.S
deleted file mode 100644
index bc7fd9691bf..00000000000
--- a/usr.sbin/afs/src/lwp/process.m68k.S
+++ /dev/null
@@ -1,125 +0,0 @@
-/* $arla: process.m68k.S,v 1.7 2000/08/25 14:49:04 lha Exp $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#include <config.h>
-
-#undef RCSID
-
-#include <lwp_elf.h>
-
-#if !defined(__ELF__) && !defined(sun3)
-#define reg(x) x
-#else /* __ELF__ || sun3 */
-#ifdef __STDC__
-#define reg(x) %##x
-#else
-#define reg(x) %/**/x
-#endif /* __STDC__ */
-#endif /* __ELF__ || sun3 */
-
-/*
-#
-# Information Technology Center
-# Carnegie-Mellon University
-#
-#
-*/
- .data
-
-/*
-#
-# Process assembly language assist for Suns.
-#
-*/
-
- .text
- .even
-
-/*
-#
-# struct savearea {
-# char *topstack;
-# }
-#
-*/
-
- .globl _C_LABEL(PRE_Block)
- .globl _C_LABEL(savecontext)
- .globl _C_LABEL(returnto)
-
-topstack = 0
-
-/* Stuff to allow saving/restoring registers */
-nregs = 13
-regs = 0x3ffe | d1-d7 & a0-a5
-
-/*
-# savecontext(f, area1, newsp)
-# int (*f)(); struct savearea *area1; char *newsp;
-*/
-
-/* Stack offsets of arguments */
-f = 8
-area1 = 12
-newsp = 16
-
-ENTRY(savecontext)
- movl #1,_C_LABEL(PRE_Block) | Dont allow any interrupt finagling
- link reg(a6),#-(nregs*4) | Save frame pointer & ...
- | ... allocate space for nregs registers
-/* Save registers */
- moveml #regs,reg(sp)@
-
- movl reg(a6)@(area1),reg(a0) | a0 = base of savearea
- movl reg(sp),reg(a0)@(topstack) | area->topstack = sp
- movl reg(a6)@(newsp),reg(d0) | Get new sp
- jeq forw1 | If newsp == 0, no stack switch
- movl reg(d0),reg(sp) | Switch to new stack
-forw1:
- movl reg(a6)@(f),reg(a0) | a0 = f
- jbsr reg(a0)@ | f()
-
-/* It is impossible to be here, so abort() */
-
- jbsr _C_LABEL(abort)
-
-/*
-# returnto(area2)
-# struct savearea *area2;
-*/
-
-/* Stack offset of argument */
-area2 = 8
-
-ENTRY(returnto)
- link reg(a6),#0
- movl reg(a6)@(area2),reg(a0) | Base of savearea
- movl reg(a0)@(topstack),reg(sp) | Restore sp
-/* Restore registers */
- moveml reg(sp)@,#regs
-
- addl #(nregs*4),reg(sp)
- movl reg(sp),reg(a6) | Argghh...be careful here
- unlk reg(a6)
- clrl _C_LABEL(PRE_Block)
- rts | Return to previous process
diff --git a/usr.sbin/afs/src/lwp/process.m88k.S b/usr.sbin/afs/src/lwp/process.m88k.S
deleted file mode 100644
index 32b5a5d7640..00000000000
--- a/usr.sbin/afs/src/lwp/process.m88k.S
+++ /dev/null
@@ -1,110 +0,0 @@
-/* $OpenBSD: process.m88k.S,v 1.5 2006/11/17 20:54:47 deraadt Exp $ */
-
-/*
- * Copyright (c) 2004, Miodrag Vallat.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-
-#include <config.h>
-
-.globl _C_LABEL(PRE_Block)
-
-/*
- * savecontext(int (*f)(), struct savearea *a1, char *newsp)
- */
-ENTRY(savecontext)
- /* save all registers but r0, r2, r3 and r31 on stack - we could
- skip r4 but saving it allows us to use it as a temporary below. */
- subu r31, r31, 4 * 30
- st.d r4, r31, 4 * 0
- st.d r6, r31, 4 * 2
- st.d r8, r31, 4 * 4
- st.d r10, r31, 4 * 6
- st.d r12, r31, 4 * 8
- st.d r14, r31, 4 * 10
- st.d r16, r31, 4 * 12
- st.d r18, r31, 4 * 14
- st.d r20, r31, 4 * 16
- st.d r22, r31, 4 * 18
- st.d r24, r31, 4 * 20
- st.d r26, r31, 4 * 22
- st.d r28, r31, 4 * 24
- st r30, r31, 4 * 26
- st r1, r31, 4 * 27
- fldcr r4, fcr62
- fldcr r5, fcr63
- st.d r4, r31, 4 * 28
-
- /* set preemption lock */
- or.u r4, r0, hi16(_C_LABEL(PRE_Block))
- set r1, r0, 1<0>
- st r1, r4, lo16(_C_LABEL(PRE_Block))
- ld.d r4, r31, 4 * 0
-
- /* save stack pointer, and fetch the new one if non NULL */
- bcnd.n eq0, r4, 1f
- st r31, r3, 0
- or r31, r4, r0
-1:
-
- /* invoke function */
- jsr r2
-
- /* should not return, invoke abort() if this happens */
- bsr _C_LABEL(abort)
- /* NOTREACHED */
-
-/*
- * returnto(struct savearea *a2)
-*/
-ENTRY(returnto)
- /* pick stack */
- ld r31, r2, 0
-
- /* restore registers */
- ld.d r4, r31, 4 * 28
- fstcr r4, fcr62
- fstcr r5, fcr63
- ld.d r4, r31, 4 * 0
- ld.d r6, r31, 4 * 2
- ld.d r8, r31, 4 * 4
- ld.d r10, r31, 4 * 6
- ld.d r12, r31, 4 * 8
- ld.d r14, r31, 4 * 10
- ld.d r16, r31, 4 * 12
- ld.d r18, r31, 4 * 14
- ld.d r20, r31, 4 * 16
- ld.d r22, r31, 4 * 18
- ld.d r24, r31, 4 * 20
- ld.d r26, r31, 4 * 22
- ld.d r28, r31, 4 * 24
- ld r30, r31, 4 * 26
- ld r1, r31, 4 * 27
- addu r31, r31, 4 * 30
-
- /* clear preemption lock and return */
- or.u r2, r0, hi16(_C_LABEL(PRE_Block))
- jmp.n r1
- st r0, r2, lo16(_C_LABEL(PRE_Block))
diff --git a/usr.sbin/afs/src/lwp/process.mips.S b/usr.sbin/afs/src/lwp/process.mips.S
deleted file mode 100644
index 3f8e1a0d37b..00000000000
--- a/usr.sbin/afs/src/lwp/process.mips.S
+++ /dev/null
@@ -1,233 +0,0 @@
-/* $arla: process.mips.S,v 1.1 2000/01/02 02:11:17 lha Exp $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#include <config.h>
-
-#undef RCSID
-
-#ifdef __LP64__
-#define REGSIZE 8
-#define REG_S sd
-#define REG_L ld
-#define ADDU daddu
-#define SUBU dsubu
-#else
-#define REGSIZE 4
-#define REG_S sw
-#define REG_L lw
-#define ADDU addu
-#define SUBU subu
-#endif
-
-#ifdef HAVE_PIC
- .option pic2
-
-#if defined(HAVE_MACHINE_REGDEF_H) || defined(__OpenBSD__)
-#include <machine/regdef.h>
-#elif defined(HAVE_REGDEF_H)
-#include <regdef.h>
-#endif
-
-/* 9 sregs, ra, 6 fp regs, gp, pad to 8 byte boundary */
-#ifdef __LP64__
-#define regspace 9 * REGSIZE + REGSIZE + 6 * 8 + REGSIZE
-#else
-#define regspace 9 * REGSIZE + REGSIZE + 6 * 8 + 4 + REGSIZE
-#endif
-#define floats 0
-#define registers floats + 6 * 8
-#define returnaddr regspace - REGSIZE
-#define topstack 0
-#define GPOFF regspace - 8
- .globl savecontext /* MIPS' C compiler doesnt prepend underscores. */
- .ent savecontext /* Insert debugger information. */
-savecontext:
- .set noreorder
- .cpload t9 # set up gp for KPIC
- .set reorder
- SUBU sp, regspace
- .cprestore GPOFF # trigger t9/jalr
- .set noreorder
- li t0, 1
- .extern PRE_Block
- sw t0, PRE_Block
- .set reorder
- .frame sp, regspace, ra
-/* Save registers. */
- REG_S s0, registers + (0 * REGSIZE)(sp)
- REG_S s1, registers + (1 * REGSIZE)(sp)
- REG_S s2, registers + (2 * REGSIZE)(sp)
- REG_S s3, registers + (3 * REGSIZE)(sp)
- REG_S s4, registers + (4 * REGSIZE)(sp)
- REG_S s5, registers + (5 * REGSIZE)(sp)
- REG_S s6, registers + (6 * REGSIZE)(sp)
- REG_S s7, registers + (7 * REGSIZE)(sp)
- REG_S s8, registers + (8 * REGSIZE)(sp)
-/* Save return address */
- REG_S ra, returnaddr(sp)
- .mask 0xc0ff0000, -4
-/* Need to save floating point registers? */
- s.d $f20, floats + 0(sp)
- s.d $f22, floats + 8(sp)
- s.d $f24, floats + 16(sp)
- s.d $f26, floats + 24(sp)
- s.d $f28, floats + 32(sp)
- s.d $f30, floats + 40(sp)
- .fmask 0x55400000, regspace
- REG_S sp, topstack(a1)
- beq a2, $0, samestack
- move sp, a2
-samestack:
- move t9, a0
- j t9
- nop
- .end savecontext
-
- .globl returnto
- .ent returnto
-returnto:
- .set noreorder
- .cpload t9 # set up gp for KPIC
- .set reorder
-
- REG_L sp, topstack(a0)
- REG_L s0, registers + (0 * REGSIZE)(sp)
- REG_L s1, registers + (1 * REGSIZE)(sp)
- REG_L s2, registers + (2 * REGSIZE)(sp)
- REG_L s3, registers + (3 * REGSIZE)(sp)
- REG_L s4, registers + (4 * REGSIZE)(sp)
- REG_L s5, registers + (5 * REGSIZE)(sp)
- REG_L s6, registers + (6 * REGSIZE)(sp)
- REG_L s7, registers + (7 * REGSIZE)(sp)
- REG_L s8, registers + (8 * REGSIZE)(sp)
-/* Save return address */
- REG_L ra, returnaddr(sp)
-/* Need to save floating point registers? */
- l.d $f20, floats + 0(sp)
- l.d $f22, floats + 8(sp)
- l.d $f24, floats + 16(sp)
- l.d $f26, floats + 24(sp)
- l.d $f28, floats + 32(sp)
- l.d $f30, floats + 40(sp)
- .set noreorder
- ADDU sp, regspace
- sw zero, PRE_Block
- j ra
- nop
- .set reorder
- .end returnto
-
-#else
-/* Code for MIPS R2000/R3000 architecture
- * Written by Zalman Stern April 30th, 1989.
- */
-
-#if defined(HAVE_MACHINE_REGDEF_H) || defined(__OpenBSD__)
-#include <machine/regdef.h>
-#elif defined(HAVE_REGDEF_H)
-#include <regdef.h> /* Allow use of symbolic names for registers. */
-#else
-#define sp $29
-#define ra $31
-#define t0 $8 /* XXX this only works for 32 bit systems */
-#define a0 $4
-#define a1 $5
-#define a2 $6
-#define s0 $16
-#define s1 $17
-#define s2 $18
-#define s3 $19
-#define s4 $20
-#define s5 $21
-#define s6 $22
-#define s7 $23
-#define s8 $30
-#endif
-
-#define regspace 9 * REGSIZE + REGSIZE + 6 * 8
-#define floats 0
-#define registers floats + 6 * 8
-#define returnaddr regspace - REGSIZE
-#define topstack 0
- .globl savecontext /* MIPS' C compiler doesnt prepend underscores. */
- .ent savecontext /* Insert debugger information. */
-savecontext:
- li t0, 1
- .extern PRE_Block
- sw t0, PRE_Block
- SUBU sp, regspace
- .frame sp, regspace, ra
-/* Save registers. */
- REG_S s0, registers + (0 * REGSIZE)(sp)
- REG_S s1, registers + (1 * REGSIZE)(sp)
- REG_S s2, registers + (2 * REGSIZE)(sp)
- REG_S s3, registers + (3 * REGSIZE)(sp)
- REG_S s4, registers + (4 * REGSIZE)(sp)
- REG_S s5, registers + (5 * REGSIZE)(sp)
- REG_S s6, registers + (6 * REGSIZE)(sp)
- REG_S s7, registers + (7 * REGSIZE)(sp)
- REG_S s8, registers + (8 * REGSIZE)(sp)
-/* Save return address */
- REG_S ra, returnaddr(sp)
- .mask 0xc0ff0000, -4
-/* Need to save floating point registers? */
- s.d $f20, floats + 0(sp)
- s.d $f22, floats + 8(sp)
- s.d $f24, floats + 16(sp)
- s.d $f26, floats + 24(sp)
- s.d $f28, floats + 32(sp)
- s.d $f30, floats + 40(sp)
- .fmask 0x55400000, regspace
- REG_S sp, topstack(a1)
- beq a2, $0, samestack
- addu sp, $0, a2
-samestack:
- jal a0
- .end savecontext
-
- .globl returnto
- .ent returnto
-returnto:
- REG_L sp, topstack(a0)
- REG_L s0, registers + (0 * REGSIZE)(sp)
- REG_L s1, registers + (1 * REGSIZE)(sp)
- REG_L s2, registers + (2 * REGSIZE)(sp)
- REG_L s3, registers + (3 * REGSIZE)(sp)
- REG_L s4, registers + (4 * REGSIZE)(sp)
- REG_L s5, registers + (5 * REGSIZE)(sp)
- REG_L s6, registers + (6 * REGSIZE)(sp)
- REG_L s7, registers + (7 * REGSIZE)(sp)
- REG_L s8, registers + (8 * REGSIZE)(sp)
-/* Save return address */
- REG_L ra, returnaddr(sp)
-/* Need to save floating point registers? */
- l.d $f20, floats + 0(sp)
- l.d $f22, floats + 8(sp)
- l.d $f24, floats + 16(sp)
- l.d $f26, floats + 24(sp)
- l.d $f28, floats + 32(sp)
- l.d $f30, floats + 40(sp)
- addu sp, regspace
- sw $0, PRE_Block
- .end returnto
-#endif /* HAVE_PIC */
diff --git a/usr.sbin/afs/src/lwp/process.patch.S b/usr.sbin/afs/src/lwp/process.patch.S
deleted file mode 100644
index e1db4307bc3..00000000000
--- a/usr.sbin/afs/src/lwp/process.patch.S
+++ /dev/null
@@ -1,80 +0,0 @@
---- arla-0.23/lwp/process.S~ Sun Mar 28 16:13:33 1999
-+++ arla-0.23/lwp/process.S Fri Aug 13 09:35:56 1999
-@@ -207,7 +207,7 @@
- #
- */
-
-- .globl _PRE_Block
-+ .globl PRE_Block
-
- topstack = 0
-
-@@ -225,26 +225,26 @@
- area1 = 12
- newsp = 16
-
-- .globl _savecontext
--_savecontext:
-- movb #1,_PRE_Block | Dont allow any interrupt finagling
-- link a6,#-(nregs*4) | Save frame pointer & ...
-+ .globl savecontext
-+savecontext:
-+ movb #1,PRE_Block | Dont allow any interrupt finagling
-+ link %a6,#-(nregs*4) | Save frame pointer & ...
- | ... allocate space for nregs registers
- /* Save registers */
-- moveml #regs,sp@
-+ moveml #regs,%sp@
-
-- movl a6@(area1),a0 | a0 = base of savearea
-- movl sp,a0@(topstack) | area->topstack = sp
-- movl a6@(newsp),d0 | Get new sp
-+ movl %a6@(area1),%a0 | a0 = base of savearea
-+ movl %sp,%a0@(topstack) | area->topstack = sp
-+ movl %a6@(newsp),%d0 | Get new sp
- jeq forw1 | If newsp == 0, no stack switch
-- movl d0,sp | Switch to new stack
-+ movl %d0,%sp | Switch to new stack
- forw1:
-- movl a6@(f),a0 | a0 = f
-- jbsr a0@ | f()
-+ movl %a6@(f),%a0 | a0 = f
-+ jbsr %a0@ | f()
-
- /* It is impossible to be here, so abort() */
-
-- jbsr _abort
-+ jbsr abort
-
- /*
- # returnto(area2)
-@@ -254,18 +254,18 @@
- /* Stack offset of argument */
- area2 = 8
-
-- .globl _returnto
--_returnto:
-- link a6,#0
-- movl a6@(area2),a0 | Base of savearea
-- movl a0@(topstack),sp | Restore sp
-+ .globl returnto
-+returnto:
-+ link %a6,#0
-+ movl %a6@(area2),%a0 | Base of savearea
-+ movl %a0@(topstack),%sp | Restore sp
- /* Restore registers */
-- moveml sp@,#regs
-+ moveml %sp@,#regs
-
-- addl #(nregs*4),sp
-- movl sp,a6 | Argghh...be careful here
-- unlk a6
-- clrb _PRE_Block
-+ addl #(nregs*4),%sp
-+ movl %sp,%a6 | Argghh...be careful here
-+ unlk %a6
-+ clrb PRE_Block
- rts | Return to previous process
- #endif /* mc68000 */
-
-
diff --git a/usr.sbin/afs/src/lwp/process.ppc.S b/usr.sbin/afs/src/lwp/process.ppc.S
deleted file mode 100644
index a229377805a..00000000000
--- a/usr.sbin/afs/src/lwp/process.ppc.S
+++ /dev/null
@@ -1,207 +0,0 @@
-/* $arla: process.ppc.S,v 1.3 2000/10/14 11:12:37 lha Exp $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#include <config.h>
-
-#undef RCSID
-
-
-/* Comments:
- * 1. Registers R10..R31 and CR0..CR7 are saved
- * 2. "struct savearea" must hold at least 3 pointers (long)
- * 3. This code will only work on 32 bit machines (601..604), not 620
- * 4. No floating point registers are saved
- * 5. The save stack "frame" is bigger than absolutely necessary. The
- * PowerPC [AIX] ABI needs this extra space.
- */
-
-/*
- * PowerPC Stack structure (according to apple)
- *
- * -----------------------------------------
- * | Parameter area
- * | [...]
- * -----------------------------------------
- * | Linkage area: (each row is 4 bytes)
- * | Saved GPR 2 [saved by calling if imported routine,or pointer-based call]
- * | Reserved
- * | Reserved
- * | Saved LR [ may be set by called ]
- * | Saved CR [ may be set by called ]
- * | Saved SP [ saved by calling ]
- * ----------------------------------------- <-- SP
- * | Local variables
- * | [...]
- * -----------------------------------------
- * | Parameter area
- * | [...]
- * -----------------------------------------
- * | Linkage area:
- * | [...]
- * ----------------------------------------- <-- SP
- */
-
-/* Mach-O assemblers */
-#if !defined(NeXT) && !defined(__APPLE__)
-#define r0 0
-#define r1 1
-#define r2 2
-#define r3 3
-#define r4 4
-#define r5 5
-#define r6 6
-#define r7 7
-#define r8 8
-#define r9 9
-#define r10 10
-#define r11 11
-#define r12 12
-#define r13 13
-#define r14 14
-#define r15 15
-#define r16 16
-#define r17 17
-#define r18 18
-#define r19 19
-#define r20 20
-#define r21 21
-#define r22 22
-#define r23 23
-#define r24 24
-#define r25 25
-#define r26 26
-#define r27 27
-#define r28 28
-#define r29 29
-#define r30 30
-#define r31 31
-#endif /* !NeXT && !__APPLE__ */
-
-
-/*
- * savecontext(int (*f)(), struct savearea *save, char *newsp)
- */
-
-#define FRAME_SIZE (32*4)+(8*4)
-#define FRAME_OFFSET (8*4)
-
-#define TOP_OF_STACK (0*4)
-#define RETURN (1*4)
-#define CCR (2*4)
-
-#if defined(NeXT) || defined(__APPLE__)
- .globl _savecontext
-_savecontext:
- lis r9,ha16(_PRE_Block) /* Disable interrupt fiddling */
- li r8,1
- stw r8,lo16(_PRE_Block)(r9)
-#else
- .globl savecontext
-savecontext:
- lis r9,PRE_Block@ha /* Disable interrupt fiddling */
- li r8,1
- stw r8,PRE_Block@l(r9)
-#endif /* NeXT || __APPLE__ */
- subi r1,r1,FRAME_SIZE
- mfcr r9
- stw r9,CCR(r4)
- stw r10,10*4+FRAME_OFFSET(r1) /* Save registers */
- stw r11,11*4+FRAME_OFFSET(r1)
- stw r12,12*4+FRAME_OFFSET(r1)
- stw r13,13*4+FRAME_OFFSET(r1)
- stw r14,14*4+FRAME_OFFSET(r1)
- stw r15,15*4+FRAME_OFFSET(r1)
- stw r16,16*4+FRAME_OFFSET(r1)
- stw r17,17*4+FRAME_OFFSET(r1)
- stw r18,18*4+FRAME_OFFSET(r1)
- stw r19,19*4+FRAME_OFFSET(r1)
- stw r20,20*4+FRAME_OFFSET(r1)
- stw r21,21*4+FRAME_OFFSET(r1)
- stw r22,22*4+FRAME_OFFSET(r1)
- stw r23,23*4+FRAME_OFFSET(r1)
- stw r24,24*4+FRAME_OFFSET(r1)
- stw r25,25*4+FRAME_OFFSET(r1)
- stw r26,26*4+FRAME_OFFSET(r1)
- stw r27,27*4+FRAME_OFFSET(r1)
- stw r28,28*4+FRAME_OFFSET(r1)
- stw r29,29*4+FRAME_OFFSET(r1)
- stw r30,30*4+FRAME_OFFSET(r1)
- stw r31,31*4+FRAME_OFFSET(r1)
- stw r1,TOP_OF_STACK(r4)
- cmpi 0,r5,0 /* New stack specified? */
- mflr r0
- stw r0,RETURN(r4)
- mtlr r3
- beq L1 /* No - don't muck with pointer */
-
- mr r1,r5
-L1: blr /* Return */
-
-/*
- * returnto(struct savearea *area)
- */
-#if defined(NeXT) || defined(__APPLE__)
- .globl _returnto
-_returnto:
-#else
- .globl returnto
-returnto:
-#endif /* NeXT || __APPLE__ */
- lwz r1,TOP_OF_STACK(r3) /* Update stack pointer */
- lwz r0,RETURN(r3) /* Get return address */
- mtlr r0
- lwz r4,CCR(r3)
- mtcrf 0xFF,r4
- lwz r10,10*4+FRAME_OFFSET(r1) /* Restore registers */
- lwz r11,11*4+FRAME_OFFSET(r1)
- lwz r12,12*4+FRAME_OFFSET(r1)
- lwz r13,13*4+FRAME_OFFSET(r1)
- lwz r14,14*4+FRAME_OFFSET(r1)
- lwz r15,15*4+FRAME_OFFSET(r1)
- lwz r16,16*4+FRAME_OFFSET(r1)
- lwz r17,17*4+FRAME_OFFSET(r1)
- lwz r18,18*4+FRAME_OFFSET(r1)
- lwz r19,19*4+FRAME_OFFSET(r1)
- lwz r20,20*4+FRAME_OFFSET(r1)
- lwz r21,21*4+FRAME_OFFSET(r1)
- lwz r22,22*4+FRAME_OFFSET(r1)
- lwz r23,23*4+FRAME_OFFSET(r1)
- lwz r24,24*4+FRAME_OFFSET(r1)
- lwz r25,25*4+FRAME_OFFSET(r1)
- lwz r26,26*4+FRAME_OFFSET(r1)
- lwz r27,27*4+FRAME_OFFSET(r1)
- lwz r28,28*4+FRAME_OFFSET(r1)
- lwz r29,29*4+FRAME_OFFSET(r1)
- lwz r30,30*4+FRAME_OFFSET(r1)
- lwz r31,31*4+FRAME_OFFSET(r1)
-#if defined(NeXT) || defined(__APPLE__)
- lis r9,ha16(_PRE_Block) /* Re-enable interrupt fiddling */
- li r8,0
- stw r8,lo16(_PRE_Block)(r9)
-#else
- lis r9,PRE_Block@ha /* Re-enable interrupt fiddling */
- li r8,0
- stw r8,PRE_Block@l(r9)
-#endif /* NeXT || __APPLE__ */
- addi r1,r1,FRAME_SIZE
- blr
diff --git a/usr.sbin/afs/src/lwp/process.rios.S b/usr.sbin/afs/src/lwp/process.rios.S
deleted file mode 100644
index 645e29a8ddb..00000000000
--- a/usr.sbin/afs/src/lwp/process.rios.S
+++ /dev/null
@@ -1,179 +0,0 @@
-/* $arla: process.rios.S,v 1.1 2000/01/02 02:11:19 lha Exp $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#include <config.h>
-
-#undef RCSID
-
-/* lws 92.11.18 I don't know if we have to save the TOC (R2) or not...
- * Note that stack-frame is supposed to be aligned on
- * a double-word boundary.
- * For details about RIOS calling conventions
- * see the Assembler manual and /usr/include/sys/asdef.s
- */
-
-
-/*
- * savecontext(f, area1, newsp)
- * int (*f)(); struct savearea *area1; char *newsp;
- */
- .set topstack, 0
- .set cr0, 0
- .set toc, 2
- .set r0, 0
- .set r1, 1
- .set r2, 2
- .set r3, 3
- .set r4, 4
- .set r5, 5
- .set r6, 6
- .set r7, 7
- .set r12, 12
- .set a_f, r3
- .set a_area1, r4
- .set a_newsp, r5
-
- .set argarea, 32
- .set linkarea, 24
- .set nfprs, 18
- .set ngprs, 20
- .set szdsa, 8*nfprs+4*ngprs+linkarea+argarea
-
- .csect .savecontext[PR]
- .globl .savecontext[PR]
-
- mflr r0 # save link register
-
-/*
- * save floating point registers. Interleave some other stuff for
- * timing reasons. Set up conditions and registers for branches
- * early, so that processor can prefetch instructions.
- */
- stfd 14, -144(1)
- stfd 15, -136(1)
-
- mfcr r12 # save CR
-
- stfd 16, -128(1)
- stfd 17, -120(1)
-
- l 11, 0(a_f) # r11 <- *(a_f)
-
- stfd 18, -112(1)
- stfd 19, -104(1)
-
- cmpi cr0, a_newsp, 0 # cr0 <- (a_newsp :: 0)
-
- stfd 20, -96(1)
- stfd 21, -88(1)
- stfd 22, -80(1)
-
- mtlr 11 # set up lr early so prefetch works
-
- stfd 23, -72(1)
- stfd 24, -64(1)
- stfd 25, -56(1)
-
- st r0, 8(r1) # save return addr
-
- stfd 26, -48(1)
- stfd 27, -40(1)
- stfd 28, -32(1)
-
- st 12, 4(r1) # save CR
-
- stfd 29, -24(1)
- stfd 30, -16(1)
- stfd 31, -8(1)
-
-/*
- * save general-purpose registers
- */
- stm 12, -8*nfprs-4*ngprs(r1)# save the general-purpose regs
- stu r1, -szdsa(r1) # dec SP and save back chain
-
- l r7, PRE_Block.S(toc) # r7 <- &PRE_Block
- cal r6, 1(r0) # r6 <- #1
- st r6, 0(r7) # r6 -> PRE_Block
-
- st r1, topstack(a_area1) # save old SP
-
- beq L1 # if (a_newsp == 0) goto L1
-
- mr r1, r5 # r1 <- a_newsp -- load new SP
-
-L1: brl # pc <- lr -- (*a_f)()
-
-/*
- * returnto(area2) This is a little jumbled, I tried to interleave
- * memory accesses with simple instructions for speed, and I tried to
- * set up the link register and condition register reasonably early
- * so that processor instruction prefetching might help us out a little.
- */
- .set a_area2, r3
-
- .csect .returnto[PR]
- .globl .returnto[PR]
-
- l r1, topstack(a_area2) # r1 <- a_area2->topstack
- cal r1, szdsa(r1) # pop off frame
- l r7, PRE_Block.S(toc) # r7 <- &PRE_Block
-
- l 8, 8(1) # restore lr
- mtlr 8 # do it early so prefetch works
-
- lm 12, -8*nfprs-4*ngprs(r1)
- cal r6, 0(r0) # r6 <- #0
- mtcrf 0x38, 12 # put back cr
- st r6, 0(r7) # r6 -> PRE_Block
-
-/*
- * restore FPRs here!
- */
- lfd 14, -144(1)
- lfd 15, -136(1)
- lfd 16, -128(1)
- lfd 17, -120(1)
- lfd 18, -112(1)
- lfd 19, -104(1)
- lfd 20, -96(1)
- lfd 21, -88(1)
- lfd 22, -80(1)
- lfd 23, -72(1)
- lfd 24, -64(1)
- lfd 25, -56(1)
- lfd 26, -48(1)
- lfd 27, -40(1)
- lfd 28, -32(1)
- lfd 29, -24(1)
- lfd 30, -16(1)
- lfd 31, -8(1)
-
- brl # pc <- lr -- return
-
- .toc
-
-PRE_Block.S:
- .tc PRE_Block[tc], PRE_Block[ua]
- .extern PRE_Block[ua]
-
diff --git a/usr.sbin/afs/src/lwp/process.s390.S b/usr.sbin/afs/src/lwp/process.s390.S
deleted file mode 100644
index 8af12d0fce3..00000000000
--- a/usr.sbin/afs/src/lwp/process.s390.S
+++ /dev/null
@@ -1,115 +0,0 @@
-/* $OpenBSD: process.s390.S,v 1.3 2006/12/16 17:39:19 tsi Exp $ */
-/*
- * Copyright (c) 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* Linux for S/390 (31 bit)
- *
- * Written by Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
- *
- * additional munging by Adam Thornton <adam@sinenomine.net>
- */
- .file "process.s"
-
- .globl savecontext
- .type savecontext,%function
- /*
- * savecontext(f, area1, newsp)
- * int (*f)() ; struct savearea *area1; char *newsp;
- * f - r2
- * area1 - r3
- * newsp - r4
- */
-
-savecontext:
- stm %r7,%r15,28(%r15) /* Save our registers */
- lr %r1,%r15
- ahi %r15,-96
- st %r1,0(%r15)
-
- l %r5,P_PRE /* Get A(PRE_Block) */
- la %r7,1
- st %r7,0(%r5) /* Set it */
- l %r7,124(%r15) /* Restore %r7 */
- st %r15,0(%r3) /* Save stack pointer */
- ltr %r4,%r4 /* If new sp is 0 */
- jz .L1 /* ... don't change sp */
- lr %r15,%r4 /* Set new stack pointer */
- .L1:
- br %r2 /* Call the routine */
-
- /* Can't get here....*/
-
- l %r5,P_ABORT
- basr %r14,%r5
-
- .savecontext_end:
- .size savecontext,.savecontext_end-savecontext
-
- /*
- * returnto(area2)
- * struct savearea *area2;
- *
- * area2 - r2
- */
-
- .globl returnto
- .type returnto,%function
-
-returnto:
- l %r15,0(%r2) /* New frame, to get correct pointer
- */
- l %r5,P_PRE /* Get A(PRE_Block) */
- sr %r7,%r7
- st %r7,0(%r5) /* Clear it */
- l %r15,0(%r15) /* Point to next stack frame */
- lm %r7,%r15,28(%r15) /* Restore registers */
- br %r14 /* Return */
-
- /* Can't happen */
-
- la %r2,1234
- l %r9,P_ABORT
- basr %r14,%r9
-
- .returnto_end:
- .size returnto,.returnto_end-returnto
-
- /*
- * struct savearea {
- * char *topstack;
- * }
- */
-
-P_PRE: .long PRE_Block
-P_ABORT: .long abort
-
diff --git a/usr.sbin/afs/src/lwp/process.sh.S b/usr.sbin/afs/src/lwp/process.sh.S
deleted file mode 100644
index 62c11060160..00000000000
--- a/usr.sbin/afs/src/lwp/process.sh.S
+++ /dev/null
@@ -1,135 +0,0 @@
-/* $OpenBSD: process.sh.S,v 1.6 2007/03/03 13:40:45 deraadt Exp $ */
-
-/*
- * Copyright (c) 2006 Theo de Raadt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <config.h>
-
-#undef RCSID
-
-#include <machine/asm.h>
-
-/*
-# savecontext(f, area1, newsp)
-# int (*f)(); struct savearea *area1; char *newsp;
-# r4 r5 r6
-*/
-
-ENTRY(savecontext)
-
- mov.l .L_PRE_Block, r0 /* PRE_Block = 1 */
- mov #1, r1
- mov.l r1, @r0
-
- /* sp == r15 - automatically handled */
- mov.l r14, @-sp
- mov.l r13, @-sp
- mov.l r12, @-sp
- mov.l r11, @-sp
- mov.l r10, @-sp
- mov.l r9, @-sp
- mov.l r8, @-sp
- sts.l pr, @-sp
- sts.l macl, @-sp
- sts.l mach, @-sp
-
-#if defined(__SH4__) && !defined(__SH4_NOFPU__)
- /* float point registers */
- sts fpscr, r0
- mov.l r0, @-sp
- mov #0, r1
- sts.l fpul, @-sp
- lds r1, fpscr
- fmov.s fr15, @-sp
- fmov.s fr14, @-sp
- fmov.s fr13, @-sp
- fmov.s fr12, @-sp
- frchg
- fmov.s fr15, @-sp
- fmov.s fr14, @-sp
- fmov.s fr13, @-sp
- fmov.s fr12, @-sp
- lds r0, fpscr
-#endif
-
- mov.l sp,@r5 /* store top of stack */
- tst r6,r6
- bt 1f
-
- mov r6,sp /* swap to new sp */
- mov sp, r14 /* frame pointer */
-1:
- jmp @r4
- nop
-
- .align 2
-.L_PRE_Block: .long _C_LABEL(PRE_Block)
- SET_ENTRY_SIZE(savecontext)
-
-/*
- * returnto(struct savearea *r4)
-*/
-ENTRY(returnto)
- mov.l @r4, sp
-
-#if defined(__SH4__) && !defined(__SH4_NOFPU__)
- /* float point registers */
- mov #0, r1
- lds r1, fpscr
- frchg
- fmov.s @sp+, fr12
- fmov.s @sp+, fr13
- fmov.s @sp+, fr14
- fmov.s @sp+, fr15
- frchg
- fmov.s @sp+, fr12
- fmov.s @sp+, fr13
- fmov.s @sp+, fr14
- fmov.s @sp+, fr15
- lds.l @sp+, fpul
- lds.l @sp+, fpscr
-#endif
- lds.l @sp+, mach
- lds.l @sp+, macl
- lds.l @sp+, pr
- mov.l @sp+, r8
- mov.l @sp+, r9
- mov.l @sp+, r10
- mov.l @sp+, r11
- mov.l @sp+, r12
- mov.l @sp+, r13
- mov.l @sp+, r14
- /* sp == r15 - automatically handled */
-
- mov.l .L_PRE_Block2, r0 /* PRE_Block = 0 */
- mov #0, r4
- mov.l r4, @r0
-
- rts
- nop
-
- .align 2
-.L_PRE_Block2: .long _C_LABEL(PRE_Block)
- SET_ENTRY_SIZE(returnto)
diff --git a/usr.sbin/afs/src/lwp/process.sparc.S b/usr.sbin/afs/src/lwp/process.sparc.S
deleted file mode 100644
index 1a47d7519fe..00000000000
--- a/usr.sbin/afs/src/lwp/process.sparc.S
+++ /dev/null
@@ -1,547 +0,0 @@
-/* $arla: process.sparc.S,v 1.5 2002/06/24 22:40:02 lha Exp $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#include <config.h>
-
-#undef RCSID
-
-#if defined(__sparc64__) && !defined(__sparcv9)
-#define __sparcv9 1
-#endif
-
-
-#if defined(AFS_SUN5_ENV)
-#include <sys/asm_linkage.h>
-#include <sys/trap.h>
-#elif defined(AFS_BSD_ENV)
-#ifdef HAVE_MACHINE_ASM_H
-#include <machine/asm.h>
-#endif
-#include <machine/trap.h>
-#define ST_FLUSH_WINDOWS ST_FLUSHWIN
-#elif defined(AFS_LINUX_ENV)
-#define ST_FLUSH_WINDOWS 0x03 /* XXX: from asm/traps.h */
-#else /* SunOS4 */
-#include <sun4/asm_linkage.h>
-#include <sun4/trap.h>
-#endif
-
-#ifdef __sparcv9
-
-#ifndef STACK_BIAS
-#define STACK_BIAS (2048-1)
-#endif
-#ifndef STACK_ALIGN
-#define STACK_ALIGN 8
-#endif
-#ifndef MINFRAME
-#define MINFRAME 176
-#endif
-
-#else /* !__sparcv9 */
-
-#ifndef STACK_BIAS
-#define STACK_BIAS 0
-#endif
-#ifndef STACK_ALIGN
-#define STACK_ALIGN 4
-#endif
-#ifndef MINFRAME
-#define MINFRAME 92
-#endif
-
-#endif /* __sparcv9 */
-
-#ifndef SA
-#define SA(x) (((x)+(STACK_ALIGN-1))& ~(STACK_ALIGN-1))
-#endif
-
-#include <lwp_elf.h>
-
- .data
- .globl _C_LABEL(PRE_Block)
-/*
-# savecontext(f, area1, newsp)
-# int (*f)(); struct savearea *area1; char *newsp;
-*/
-
- .text
- .globl _C_LABEL(savecontext)
-ENTRY(savecontext)
- save %sp, -SA(MINFRAME), %sp ! Get new window
- ta ST_FLUSH_WINDOWS ! FLush all other active windows
-
- /* The following 3 lines do the equivalent of: _PRE_Block = 1 */
-#ifdef __sparcv9
- sethi %hh(PRE_Block),%l0
- or %l0,%hm(PRE_Block),%l0
- sethi %lm(PRE_Block),%g1
- or %g1,%lo(PRE_Block),%g1
- sllx %l0,32,%l0
- or %l0,%g1,%l0
-#else
- sethi %hi(PRE_Block),%l0
- or %l0,%lo(_C_LABEL(PRE_Block)),%l0
-#endif
- mov 1,%l1
- st %l1, [%l0]
-
-#ifdef __sparcv9
-
-topstack = 0
-globals = 8
-
- /* These declarations are needed if you're running Solaris 7,
- * and are compiling with -xarch=v9 and have an as from WorkShop
- * Compilers 5.0 98/12/21 (or more recent). Hopefully,
- * PROG_AS_UNDERSTANDS_REGISTER will be set correctly by configure,
- * if that's not the case, edit here and send a bug report.
- */
-
-#if PROG_AS_UNDERSTANDS_REGISTER
- .register %g2, #scratch
- .register %g3, #scratch
- .register %g6, #scratch
- .register %g7, #scratch
-#endif
-
- stx %fp,[%i1+topstack] ! area1->topstack = sp
-
- stx %g1, [%i1 + globals + 0] /* Save all globals just in case */
- stx %g2, [%i1 + globals + 8]
- stx %g3, [%i1 + globals + 16]
- stx %g4, [%i1 + globals + 24]
- stx %g5, [%i1 + globals + 32]
- stx %g6, [%i1 + globals + 40]
- stx %g7, [%i1 + globals + 48]
- mov %y, %g1
- stx %g1, [%i1 + globals + 56]
-
-#ifdef save_allregs
- stx %f0, [%i1 + globals + 64 + 0]
- stx %f1, [%i1 + globals + 64 + 8]
- stx %f2, [%i1 + globals + 64 + 16]
- stx %f3, [%i1 + globals + 64 + 24]
- stx %f4, [%i1 + globals + 64 + 32]
- stx %f5, [%i1 + globals + 64 + 40]
- stx %f6, [%i1 + globals + 64 + 48]
- stx %f7, [%i1 + globals + 64 + 56]
- stx %f8, [%i1 + globals + 64 + 64]
- stx %f9, [%i1 + globals + 64 + 72]
- stx %f10, [%i1 + globals + 64 + 80]
- stx %f11, [%i1 + globals + 64 + 88]
- stx %f12, [%i1 + globals + 64 + 96]
- stx %f13, [%i1 + globals + 64 + 104]
- stx %f14, [%i1 + globals + 64 + 112]
- stx %f15, [%i1 + globals + 64 + 120]
- stx %f16, [%i1 + globals + 64 + 128]
- stx %f17, [%i1 + globals + 64 + 136]
- stx %f18, [%i1 + globals + 64 + 144]
- stx %f19, [%i1 + globals + 64 + 152]
- stx %f20, [%i1 + globals + 64 + 160]
- stx %f21, [%i1 + globals + 64 + 168]
- stx %f22, [%i1 + globals + 64 + 176]
- stx %f23, [%i1 + globals + 64 + 184]
- stx %f24, [%i1 + globals + 64 + 192]
- stx %f25, [%i1 + globals + 64 + 200]
- stx %f26, [%i1 + globals + 64 + 208]
- stx %f27, [%i1 + globals + 64 + 216]
- stx %f28, [%i1 + globals + 64 + 224]
- stx %f29, [%i1 + globals + 64 + 232]
- stx %f30, [%i1 + globals + 64 + 240]
- stx %f31, [%i1 + globals + 64 + 248]
- stx %f32, [%i1 + globals + 64 + 256]
- stx %f33, [%i1 + globals + 64 + 264]
- stx %f34, [%i1 + globals + 64 + 272]
- stx %f35, [%i1 + globals + 64 + 280]
- stx %f36, [%i1 + globals + 64 + 288]
- stx %f37, [%i1 + globals + 64 + 296]
- stx %f38, [%i1 + globals + 64 + 304]
- stx %f39, [%i1 + globals + 64 + 312]
- stx %f40, [%i1 + globals + 64 + 320]
- stx %f41, [%i1 + globals + 64 + 328]
- stx %f42, [%i1 + globals + 64 + 336]
- stx %f43, [%i1 + globals + 64 + 344]
- stx %f44, [%i1 + globals + 64 + 352]
- stx %f45, [%i1 + globals + 64 + 360]
- stx %f46, [%i1 + globals + 64 + 368]
- stx %f47, [%i1 + globals + 64 + 376]
- stx %f48, [%i1 + globals + 64 + 384]
- stx %f49, [%i1 + globals + 64 + 392]
- stx %f50, [%i1 + globals + 64 + 400]
- stx %f51, [%i1 + globals + 64 + 408]
- stx %f52, [%i1 + globals + 64 + 416]
- stx %f53, [%i1 + globals + 64 + 424]
- stx %f54, [%i1 + globals + 64 + 432]
- stx %f55, [%i1 + globals + 64 + 440]
- stx %f56, [%i1 + globals + 64 + 448]
- stx %f57, [%i1 + globals + 64 + 456]
- stx %f59, [%i1 + globals + 64 + 464]
- stx %f60, [%i1 + globals + 64 + 472]
- stx %f61, [%i1 + globals + 64 + 480]
-#ifdef notdef
- mov %fsr,%g1
- stx %g1, [%i1 + globals + 64 + 488]
- mov %fq,%g1
- stx %g1, [%i1 + globals + 64 + 496]
-#endif
-
-#endif
-
-#else /* !__sparcv9 */
-
-topstack = 0
-globals = 4
-
- st %fp,[%i1+topstack] ! area1->topstack = sp
-
- st %g1, [%i1 + globals + 0] /* Save all globals just in case */
- st %g2, [%i1 + globals + 4]
- st %g3, [%i1 + globals + 8]
- st %g4, [%i1 + globals + 12]
- st %g5, [%i1 + globals + 16]
- st %g6, [%i1 + globals + 20]
- st %g7, [%i1 + globals + 24]
- mov %y, %g1
- st %g1, [%i1 + globals + 28]
-
-#ifdef save_allregs
- st %f0, [%i1 + globals + 32 + 0] ! Save all floating point registers
- st %f1, [%i1 + globals + 32 + 4]
- st %f2, [%i1 + globals + 32 + 8]
- st %f3, [%i1 + globals + 32 + 12]
- st %f4, [%i1 + globals + 32 + 16]
- st %f5, [%i1 + globals + 32 + 20]
- st %f6, [%i1 + globals + 32 + 24]
- st %f7, [%i1 + globals + 32 + 28]
- st %f8, [%i1 + globals + 64 + 0]
- st %f9, [%i1 + globals + 64 + 4]
- st %f10, [%i1 + globals + 64 + 8]
- st %f11, [%i1 + globals + 64 + 12]
- st %f12, [%i1 + globals + 64 + 16]
- st %f13, [%i1 + globals + 64 + 20]
- st %f14, [%i1 + globals + 64 + 24]
- st %f15, [%i1 + globals + 64 + 28]
- st %f16, [%i1 + globals + 64 + 32]
- st %f17, [%i1 + globals + 64 + 36]
- st %f18, [%i1 + globals + 64 + 40]
- st %f19, [%i1 + globals + 64 + 44]
- st %f20, [%i1 + globals + 64 + 48]
- st %f21, [%i1 + globals + 64 + 52]
- st %f22, [%i1 + globals + 64 + 56]
- st %f23, [%i1 + globals + 64 + 60]
- st %f24, [%i1 + globals + 64 + 64]
- st %f25, [%i1 + globals + 64 + 68]
- st %f26, [%i1 + globals + 64 + 72]
- st %f27, [%i1 + globals + 64 + 76]
- st %f28, [%i1 + globals + 64 + 80]
- st %f29, [%i1 + globals + 64 + 84]
- st %f30, [%i1 + globals + 64 + 88]
- st %f31, [%i1 + globals + 64 + 92]
-#ifdef notdef
- mov %fsr,%g1
- st %g1, [%i1 + globals + 64 + 96]
- mov %fq,%g1
- st %g1, [%i1 + globals + 64 + 100]
-#endif
-
- st %c0, [%i1 + globals + 168 + 0] ! Save all coprocessor registers
- st %c1, [%i1 + globals + 168 + 4]
- st %c2, [%i1 + globals + 168 + 8]
- st %c3, [%i1 + globals + 168 + 12]
- st %c4, [%i1 + globals + 168 + 16]
- st %c5, [%i1 + globals + 168 + 20]
- st %c6, [%i1 + globals + 168 + 24]
- st %c7, [%i1 + globals + 168 + 28]
- st %c8, [%i1 + globals + 200 + 0]
- st %c9, [%i1 + globals + 200 + 4]
- st %c10, [%i1 + globals + 200 + 8]
- st %c11, [%i1 + globals + 200 + 12]
- st %c12, [%i1 + globals + 200 + 16]
- st %c13, [%i1 + globals + 200 + 20]
- st %c14, [%i1 + globals + 200 + 24]
- st %c15, [%i1 + globals + 200 + 28]
- st %c16, [%i1 + globals + 200 + 32]
- st %c17, [%i1 + globals + 200 + 36]
- st %c18, [%i1 + globals + 200 + 40]
- st %c19, [%i1 + globals + 200 + 44]
- st %c20, [%i1 + globals + 200 + 48]
- st %c21, [%i1 + globals + 200 + 52]
- st %c22, [%i1 + globals + 200 + 56]
- st %c23, [%i1 + globals + 200 + 60]
- st %c24, [%i1 + globals + 200 + 64]
- st %c25, [%i1 + globals + 200 + 68]
- st %c26, [%i1 + globals + 200 + 72]
- st %c27, [%i1 + globals + 200 + 76]
- st %c28, [%i1 + globals + 200 + 80]
- st %c29, [%i1 + globals + 200 + 84]
- st %c30, [%i1 + globals + 200 + 88]
- st %c31, [%i1 + globals + 200 + 92]
-#ifdef notdef
- mov %csr,%g1
- st %g1, [%i1 + globals + 200 + 96]
- mov %cq,%g1
- st %g1, [%i1 + globals + 200 + 100]
-#endif
-#endif
-
-#endif /* __sparcv9 */
-
- cmp %i2, 0
- be,a L1 ! if (newsp == 0) no stack switch
- nop
-#ifdef notdef
- add %i2, STACK_ALIGN - 1, %i2
- and %i2, ~(STACK_ALIGN - 1), %i2
- sub %i2, SA(MINFRAME), %fp
- call %i0
- restore
-#else
- ! This used to compute a new stack frame base, write it into
- ! FP, and restore to enter the new frame. But that left a window
- ! in which FP could be written into the backing store for this
- ! frame, to be tripped over later by returnto. So instead we do
- ! the restore first, then modify SP to enter the new frame. We
- ! can still refer to our argument as %02.
- restore
- add %o2, STACK_ALIGN - 1, %o2
- and %o2, ~(STACK_ALIGN - 1), %o2
- call %o0
- sub %o2, SA(MINFRAME) + STACK_BIAS, %sp
-#endif
-
-L1: call %i0 ! call f()
- nop
-
-
-! returnto(area1)
-! struct savearea *area1;
- .globl _C_LABEL(returnto)
-ENTRY(returnto)
- ta ST_FLUSH_WINDOWS ! FLush all other active windows
-
-#ifdef __sparcv9
-
-#ifdef save_allregs
- ldx [%i1 + globals + 64 + 0], %f0
- ldx [%i1 + globals + 64 + 8], %f1
- ldx [%i1 + globals + 64 + 16], %f2
- ldx [%i1 + globals + 64 + 24], %f3
- ldx [%i1 + globals + 64 + 32], %f4
- ldx [%i1 + globals + 64 + 40], %f5
- ldx [%i1 + globals + 64 + 48], %f6
- ldx [%i1 + globals + 64 + 56], %f7
- ldx [%i1 + globals + 64 + 64], %f8
- ldx [%i1 + globals + 64 + 72], %f9
- ldx [%i1 + globals + 64 + 80], %f10
- ldx [%i1 + globals + 64 + 88], %f11
- ldx [%i1 + globals + 64 + 96], %f12
- ldx [%i1 + globals + 64 + 104], %f13
- ldx [%i1 + globals + 64 + 112], %f14
- ldx [%i1 + globals + 64 + 120], %f15
- ldx [%i1 + globals + 64 + 128], %f16
- ldx [%i1 + globals + 64 + 136], %f17
- ldx [%i1 + globals + 64 + 144], %f18
- ldx [%i1 + globals + 64 + 152], %f19
- ldx [%i1 + globals + 64 + 160], %f20
- ldx [%i1 + globals + 64 + 168], %f21
- ldx [%i1 + globals + 64 + 176], %f22
- ldx [%i1 + globals + 64 + 184], %f23
- ldx [%i1 + globals + 64 + 192], %f24
- ldx [%i1 + globals + 64 + 200], %f25
- ldx [%i1 + globals + 64 + 208], %f26
- ldx [%i1 + globals + 64 + 216], %f27
- ldx [%i1 + globals + 64 + 224], %f28
- ldx [%i1 + globals + 64 + 232], %f29
- ldx [%i1 + globals + 64 + 240], %f30
- ldx [%i1 + globals + 64 + 248], %f31
- ldx [%i1 + globals + 64 + 256], %f32
- ldx [%i1 + globals + 64 + 264], %f33
- ldx [%i1 + globals + 64 + 272], %f34
- ldx [%i1 + globals + 64 + 280], %f35
- ldx [%i1 + globals + 64 + 288], %f36
- ldx [%i1 + globals + 64 + 296], %f37
- ldx [%i1 + globals + 64 + 304], %f38
- ldx [%i1 + globals + 64 + 312], %f39
- ldx [%i1 + globals + 64 + 320], %f40
- ldx [%i1 + globals + 64 + 328], %f41
- ldx [%i1 + globals + 64 + 336], %f42
- ldx [%i1 + globals + 64 + 344], %f43
- ldx [%i1 + globals + 64 + 352], %f44
- ldx [%i1 + globals + 64 + 360], %f45
- ldx [%i1 + globals + 64 + 368], %f46
- ldx [%i1 + globals + 64 + 376], %f47
- ldx [%i1 + globals + 64 + 384], %f48
- ldx [%i1 + globals + 64 + 392], %f49
- ldx [%i1 + globals + 64 + 400], %f50
- ldx [%i1 + globals + 64 + 408], %f51
- ldx [%i1 + globals + 64 + 416], %f52
- ldx [%i1 + globals + 64 + 424], %f53
- ldx [%i1 + globals + 64 + 432], %f54
- ldx [%i1 + globals + 64 + 440], %f55
- ldx [%i1 + globals + 64 + 448], %f56
- ldx [%i1 + globals + 64 + 456], %f57
- ldx [%i1 + globals + 64 + 464], %f59
- ldx [%i1 + globals + 64 + 472], %f60
- ldx [%i1 + globals + 64 + 480], %f61
-#ifdef notdef
- mov %fsr,%g1
- ldx [%i1 + globals + 64 + 488], %g1
- mov %fq,%g1
- ldx [%i1 + globals + 64 + 496], %g1
-#endif
-
-#endif
-
- ldx [%o0+topstack],%g1 ! sp = area1->topstack
- sub %g1, SA(MINFRAME), %fp ! Adjust sp to the right place
- sub %fp, SA(MINFRAME), %sp
-
- ldx [%o0 + globals + 56], %g1 ! Restore global regs back
- mov %g1, %y
- ldx [%o0 + globals + 0], %g1
- ldx [%o0 + globals + 8], %g2
- ldx [%o0 + globals + 16], %g3
- ldx [%o0 + globals + 24],%g4
- ldx [%o0 + globals + 32],%g5
- ldx [%o0 + globals + 40],%g6
- ldx [%o0 + globals + 48],%g7
-
-#else /* !__sparcv9 */
-
- ld [%o0+topstack],%g1 ! sp = area1->topstack
- sub %g1, SA(MINFRAME), %fp ! Adjust sp to the right place
- sub %fp, SA(MINFRAME), %sp
-
-#ifdef save_allregs
- ld [%o0 + globals + 32 + 0],%f0 ! Restore floating-point registers
- ld [%o0 + globals + 32 + 4],%f1
- ld [%o0 + globals + 32 + 8],%f2
- ld [%o0 + globals + 32 + 12],%f3
- ld [%o0 + globals + 32 + 16],%f4
- ld [%o0 + globals + 32 + 20],%f5
- ld [%o0 + globals + 32 + 24],%f6
- ld [%o0 + globals + 32 + 28],%f7
- ld [%o0 + globals + 64 + 0],%f8
- ld [%o0 + globals + 64 + 4],%f9
- ld [%o0 + globals + 64 + 8],%f10
- ld [%o0 + globals + 64 + 12],%f11
- ld [%o0 + globals + 64 + 16],%f12
- ld [%o0 + globals + 64 + 20],%f13
- ld [%o0 + globals + 64 + 24],%f14
- ld [%o0 + globals + 64 + 28],%f15
- ld [%o0 + globals + 64 + 32],%f16
- ld [%o0 + globals + 64 + 36],%f17
- ld [%o0 + globals + 64 + 40],%f18
- ld [%o0 + globals + 64 + 44],%f19
- ld [%o0 + globals + 64 + 48],%f20
- ld [%o0 + globals + 64 + 52],%f21
- ld [%o0 + globals + 64 + 56],%f22
- ld [%o0 + globals + 64 + 60],%f23
- ld [%o0 + globals + 64 + 64],%f24
- ld [%o0 + globals + 64 + 68],%f25
- ld [%o0 + globals + 64 + 72],%f26
- ld [%o0 + globals + 64 + 76],%f27
- ld [%o0 + globals + 64 + 80],%f28
- ld [%o0 + globals + 64 + 84],%f29
- ld [%o0 + globals + 64 + 88],%f30
- ld [%o0 + globals + 64 + 92],%f31
-#ifdef notdef
- ld [%o0 + globals + 64 + 96],%g1
- mov %g1, %fsr
- ld [%o0 + globals + 64 + 100],%g1
- mov %g1, %fq
-#endif
-
- ld [%o0 + globals + 168 + 0],%c0 ! Restore floating-point registers
- ld [%o0 + globals + 168 + 4],%c1
- ld [%o0 + globals + 168 + 8],%c2
- ld [%o0 + globals + 168 + 12],%c3
- ld [%o0 + globals + 168 + 16],%c4
- ld [%o0 + globals + 168 + 20],%c5
- ld [%o0 + globals + 168 + 24],%c6
- ld [%o0 + globals + 168 + 28],%c7
- ld [%o0 + globals + 200 + 0],%c8
- ld [%o0 + globals + 200 + 4],%c9
- ld [%o0 + globals + 200 + 8],%c10
- ld [%o0 + globals + 200 + 12],%c11
- ld [%o0 + globals + 200 + 16],%c12
- ld [%o0 + globals + 200 + 20],%c13
- ld [%o0 + globals + 200 + 24],%c14
- ld [%o0 + globals + 200 + 28],%c15
- ld [%o0 + globals + 200 + 32],%c16
- ld [%o0 + globals + 200 + 36],%c17
- ld [%o0 + globals + 200 + 40],%c18
- ld [%o0 + globals + 200 + 44],%c19
- ld [%o0 + globals + 200 + 48],%c20
- ld [%o0 + globals + 200 + 52],%c21
- ld [%o0 + globals + 200 + 56],%c22
- ld [%o0 + globals + 200 + 60],%c23
- ld [%o0 + globals + 200 + 64],%c24
- ld [%o0 + globals + 200 + 68],%c25
- ld [%o0 + globals + 200 + 72],%c26
- ld [%o0 + globals + 200 + 76],%c27
- ld [%o0 + globals + 200 + 80],%c28
- ld [%o0 + globals + 200 + 84],%c29
- ld [%o0 + globals + 200 + 88],%c30
- ld [%o0 + globals + 200 + 92],%c31
-#ifdef notdef
- ld [%o0 + globals + 200 + 96],%g1
- mov %g1, %csr
- ld [%o0 + globals + 200 + 100],%g1
- mov %g1, %cq
-#endif
-#endif
- ld [%o0 + globals + 28], %g1 ! Restore global regs back
- mov %g1, %y
- ld [%o0 + globals + 0], %g1
- ld [%o0 + globals + 4], %g2
- ld [%o0 + globals + 8], %g3
- ld [%o0 + globals + 12],%g4
- ld [%o0 + globals + 16],%g5
- ld [%o0 + globals + 20],%g6
- ld [%o0 + globals + 24],%g7
-
-#endif /* __sparcv9 */
-
- /* The following 3 lines are equivalent to: _PRE_Block = 0 */
-#ifdef __sparcv9
- sethi %hh(_C_LABEL(PRE_Block)),%l0
- or %l0,%hm(_C_LABEL(PRE_Block)),%l0
- sethi %lm(_C_LABEL(PRE_Block)),%g1
- or %g1,%lo(_C_LABEL(PRE_Block)),%g1
- sllx %l0,32,%l0
- or %l0,%g1,%l0
-#else
- sethi %hi(_C_LABEL(PRE_Block)),%l0
- or %l0,%lo(_C_LABEL(PRE_Block)),%l0
-#endif
- mov 0,%l1
- st %l1, [%l0]
-
- restore
- restore
-
- retl
- nop
-
diff --git a/usr.sbin/afs/src/lwp/process.vax.S b/usr.sbin/afs/src/lwp/process.vax.S
deleted file mode 100644
index edc8cd10fc3..00000000000
--- a/usr.sbin/afs/src/lwp/process.vax.S
+++ /dev/null
@@ -1,101 +0,0 @@
-/* $arla: process.vax.S,v 1.1 2000/01/02 02:11:20 lha Exp $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#include <config.h>
-
-#include <machine/asm.h>
-
-#undef RCSID
-
-/*
-#
-# Information Technology Center
-# Carnegie-Mellon University
-#
-#
-*/
-
-/*
-#
-# Transcribed for Vaxen by M. Satyanarayanan, September 1985
-# Algorithm: "Monkey see, monkey do"
-#
-*/
-
-/*
-#
-# struct savearea {
-# char *topstack;
-# }
-#
-*/
-
- .set topstack,0
-
-/* Stuff to allow saving/restoring registers */
-
-/*
-# savecontext(f, area1, newsp)
-# int (*f)(); struct savearea *area1; char *newsp;
-*/
-
-/* Stack offsets of arguments */
- .set f,4
- .set area1,8
- .set newsp,12
-
-ENTRY(savecontext, R2|R3|R4|R5|R6|R7|R8|R9|R10|R11)
- movl $1,_C_LABEL(PRE_Block) # Critical section for preemption code
- pushl ap # save old ap
- pushl fp # save old fp
- movl area1(ap),r0 # r0 = base of savearea
- movl sp,topstack(r0) # area->topstack = sp
- movl newsp(ap),r0 # Get new sp
- beql L1 # if new sp is 0, dont change stacks
- movl r0,sp # else switch to new stack
-L1:
- movl f(ap),r1 # r1 = f
- calls $0,0(r1) # f()
-
-/* It is impossible to be here, so abort() */
-
- calls $0,_C_LABEL(abort)
-
-/*
-# returnto(area2)
-# struct savearea *area2;
-*/
-
-/* Stack offset of argument */
- .set area2,4
-
-ENTRY(returnto, 0)
- movl area2(ap),r0 # r0 = address of area2
- movl topstack(r0),sp # Restore sp
- movl (sp)+,fp # Restore fp
- movl (sp)+,ap # ,,,,
- clrl _C_LABEL(PRE_Block) # End of preemption critical section
- ret
-
- pushl $1234 # I will gloat, Kazar
- calls $0,_C_LABEL(abort)
diff --git a/usr.sbin/afs/src/lwp/process.x86_64.S b/usr.sbin/afs/src/lwp/process.x86_64.S
deleted file mode 100644
index 766cbdaf023..00000000000
--- a/usr.sbin/afs/src/lwp/process.x86_64.S
+++ /dev/null
@@ -1,163 +0,0 @@
-/* $arla: process.x86_64.S,v 1.1 2003/04/27 10:57:25 haba Exp $ */
-
-/*
- * Copyright (c) 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <config.h>
-
-#undef RCSID
-
-/* x86_64 Assembly
- *
- * By Harald Barth <haba@stacken.kth.se> after looking
- * at Derek Atkins' i386 routines and realizing that
- * there were some differences and it was not enough
- * just renaming the registers.
- */
-
-#ifdef HAVE_MACHINE_ASM_H
-#include <machine/asm.h>
-#endif
-
-#include <lwp_elf.h>
-
- .file "process.s"
- .data
- .text
-
-/*
- * struct savearea {
- * char *topstack;
- * }
- */
-
- .set topstack,0
-
-/*
- * savecontext(int (*f)(), struct savearea *area1, char *newsp)
- */
-
-/*
- * In spite of passing arguments in registers, gcc first copies the content of the
- * registers onto the stack. I do not know why gcc does this, but for now I mimic
- * gcc's behaviour. Here are the offsets the arguments are copied to.
- */
- .set f,-8
- .set area1,-16
- .set newsp,-24
-
-.globl _C_LABEL(PRE_Block)
-.globl _C_LABEL(savecontext)
-
-ENTRY(savecontext)
- pushq %rbp /* The frame setup is just like gcc */
- movq %rsp,%rbp
- subq $32, %rsp /* make room for args on the stack */
- movq %rdi, f(%rbp) /* (3*8=24 but increments seem to */
- movq %rsi, area1(%rbp) /* i multiples of 24, so 32 it is) */
- movq %rdx, newsp(%rbp) /* and copy them there. */
-
- movl $1,_C_LABEL(PRE_Block) /* Do not allow any interrupts */
-
- pushq %rsp /* Push all registers onto the stack */
- pushq %rax /* Probably not _all_ are necessary */
- pushq %rcx /* but better one too much than one */
- pushq %rdx /* forgotten */
- pushq %rbx
- pushq %rbp
- pushq %rsi
- pushq %rdi
- pushq %r8
- pushq %r9
- pushq %r10
- pushq %r11
- pushq %r12
- pushq %r13
- pushq %r14
- pushq %r15 /* Btw, the pusha instruction is no more */
-
- movq area1(%rbp),%rax /* rax = base of savearea */
- movq %rsp,topstack(%rax) /* area->topstack = rsp */
- movq newsp(%rbp),%rax /* rax = new sp */
- cmpq $0,%rax
- je L1 /* if new sp is 0 then dont change rsp */
- movq %rax,%rsp /* Change rsp to the new sp */
-L1:
- jmp *f(%rbp) /* jump to function pointer passed in arg */
-
-/* Shouldnt be here....*/
- call _C_LABEL(abort)
-
-/*
- * returnto(struct savearea *area2)
- */
-
-/* Offset where we put arg - se savecontext */
- .set area2,-8
-
-.globl _C_LABEL(returnto)
-
-ENTRY(returnto)
- pushq %rbp /* New frame, gcc style */
- movq %rsp, %rbp /* See savecontext above */
- subq $16, %rsp /* Make room for 2 args */
- movq %rdi, area2(%rbp) /* use room to copy 1 arg */
- movq area2(%rbp),%rax /* rax = area2 */
- movq topstack(%rax),%rsp /* restore rsp from place relative rbp*/
-
- popq %r15 /* Restore regs */
- popq %r14
- popq %r13
- popq %r12
- popq %r11
- popq %r10
- popq %r9
- popq %r8
- popq %rdi
- popq %rsi
- popq %rbp
- popq %rbx
- popq %rdx
- popq %rcx
- popq %rax
- popq %rsp /* See savecontext */
-
- movl $0,_C_LABEL(PRE_Block) /* clear it up... */
- addq $32, %rsp /* We did rsp-32 above, correct that */
- popq %rbp
- ret
-
-/* We never should get here, put in emergency brake as in i386 code */
- pushq $1234
- call _C_LABEL(abort)
-
diff --git a/usr.sbin/afs/src/lwp/q.c b/usr.sbin/afs/src/lwp/q.c
deleted file mode 100644
index 85fddea3cb3..00000000000
--- a/usr.sbin/afs/src/lwp/q.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Emulate the vax instructions for queue insertion and deletion, somewhat.
- * A std_queue structure is defined here and used by these routines. These
- * routines use caddr_ts so they can operate on any structure. The std_queue
- * structure is used rather than proc structures so that when the proc struct
- * changes only process management code breaks. The ideal solution would be
- * to define a std_queue as a global type which is part of all the structures
- * which are manipulated by these routines. This would involve considerable
- * effort...
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: q.c,v 1.8 1999/12/31 05:39:49 assar Exp $") ;
-#endif
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#include <utime.h>
-
-#include "q.h"
-
-/* Ansified, made more readable, and mayby fixed /lha */
-
-struct std_queue {
- struct std_queue *q_link;
- struct std_queue *q_rlink;
-} ;
-
-void lwp_insque(void *elementp, void *quep)
-{
- struct std_queue *que = (struct std_queue *) quep ;
- struct std_queue *element = (struct std_queue *) elementp ;
-
- element->q_link = que->q_link;
- element->q_rlink = que;
-
- que->q_link->q_rlink = element;
- que->q_link = element;
-}
-
-void lwp_remque(void *elementp)
-{
- struct std_queue *element = (struct std_queue *) elementp ;
-
- element->q_link->q_rlink = element->q_rlink;
- element->q_rlink->q_link = element->q_link;
-
- element->q_rlink = element->q_link = (struct std_queue *) 0;
-}
-
diff --git a/usr.sbin/afs/src/lwp/q.h b/usr.sbin/afs/src/lwp/q.h
deleted file mode 100644
index 81393657968..00000000000
--- a/usr.sbin/afs/src/lwp/q.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* $arla: q.h,v 1.2 1998/02/12 01:03:32 assar Exp $ */
-
-void lwp_insque(void *, void *);
-void lwp_remque(void *);
diff --git a/usr.sbin/afs/src/lwp/rw.c b/usr.sbin/afs/src/lwp/rw.c
deleted file mode 100644
index 00b27623e35..00000000000
--- a/usr.sbin/afs/src/lwp/rw.c
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/*
- (Multiple) readers & writers test of LWP stuff.
-
-Created: 11/1/83, J. Rosenberg
-
-*/
-
-#include <sys/time.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <lwp.h>
-#include "lock.h"
-#include "preempt.h"
-
-#define DEFAULT_READERS 5
-
-#define STACK_SIZE (16*1024)
-
-/* The shared queue */
-typedef struct QUEUE {
- struct QUEUE *prev, *next;
- char *data;
- struct Lock lock;
-} queue;
-
-static queue *init()
-{
- queue *q;
-
- q = (queue *) malloc(sizeof(queue));
- q -> prev = q -> next = q;
- return(q);
-}
-
-static char empty(queue *q)
-{
- return (q->prev == q && q->next == q);
-}
-
-static void insert(queue *q, char *s)
-{
- queue *new;
-
- new = (queue *) malloc(sizeof(queue));
- new -> data = s;
- new -> prev = q -> prev;
- q -> prev -> next = new;
- q -> prev = new;
- new -> next = q;
-}
-
-static char *Remove(queue *q)
-{
- queue *old;
- char *s;
-
- if (empty(q)) {
- errx(-1, "rw.c Remove: Remove from empty queue");
- }
-
- old = q -> next;
- q -> next = old -> next;
- q -> next -> prev = q;
- s = old -> data;
- free(old);
- return(s);
-}
-
-queue *q;
-
-int asleep; /* Number of processes sleeping -- used for
- clean termination */
-
-static void
-read_process(char *id)
-{
- printf("\t[Reader %d]\n", *(int *)id);
- LWP_NewRock(1, id);
- LWP_DispatchProcess(); /* Just relinquish control for now */
-
- PRE_PreemptMe();
- for (;;) {
- int i;
- char *tmp;
-
- /* Wait until there is something in the queue */
- asleep++;
- ObtainReadLock(&q->lock);
- while (empty(q)) {
- ReleaseReadLock(&q->lock);
- LWP_WaitProcess((void *)q);
- ObtainReadLock(&q->lock);
- }
- asleep--;
- for (i=0; i<10000; i++) ;
- PRE_BeginCritical();
- LWP_GetRock(1, &tmp);
- printf("[%d: %s]\n", *(int *)tmp, Remove(q));
- PRE_EndCritical();
- ReleaseReadLock(&q->lock);
- LWP_DispatchProcess();
- }
-}
-
-static void write_process()
-{
- static char *messages[] =
- {
- "Mary had a little lamb,",
- "Its fleece was white as snow,",
- "And everywhere that Mary went,",
- "The lamb was sure to go",
- "Mary had a little lamb,",
- "Its fleece was white as snow,",
- "And everywhere that Mary went,",
- "The lamb was sure to go",
- "Mary had a little lamb,",
- "Its fleece was white as snow,",
- "And everywhere that Mary went,",
- "The lamb was sure to go",
- "Mary had a little lamb,",
- "Its fleece was white as snow,",
- "And everywhere that Mary went,",
- "The lamb was sure to go",
- "Mary had a little lamb,",
- "Its fleece was white as snow,",
- "And everywhere that Mary went,",
- "The lamb was sure to go",
- "Mary had a little lamb,",
- "Its fleece was white as snow,",
- "And everywhere that Mary went,",
- "The lamb was sure to go",
- "Mary had a little lamb,",
- "Its fleece was white as snow,",
- "And everywhere that Mary went,",
- "The lamb was sure to go",
- "Mary had a little lamb,",
- "Its fleece was white as snow,",
- "And everywhere that Mary went,",
- "The lamb was sure to go",
- "Mary had a little lamb,",
- "Its fleece was white as snow,",
- "And everywhere that Mary went,",
- "The lamb was sure to go",
- "Mary had a little lamb,",
- "Its fleece was white as snow,",
- "And everywhere that Mary went,",
- "The lamb was sure to go",
- 0
- };
- char **mesg;
-
- printf("\t[Writer]\n");
- PRE_PreemptMe();
-
- /* Now loop & write data */
- for (mesg=messages; *mesg!=0; mesg++) {
- ObtainWriteLock(&q->lock);
- insert(q, *mesg);
- ReleaseWriteLock(&q->lock);
- LWP_SignalProcess(q);
- }
-
- asleep++;
-}
-
-/*
- Arguments:
- 0: Unix junk, ignore
- 1: Number of readers to create (default is DEFAULT_READERS)
- 2: # msecs for interrupt (to satisfy Larry)
- 3: Present if lwp_debug to be set
-*/
-
-
-int
-main(int argc, char **argv)
-{
- int nreaders, i;
- long interval; /* To satisfy Brad */
- PROCESS *readers;
- int *readersid;
- PROCESS writer, master;
- struct timeval tv;
- char rname[9];
-
- printf("\n*Readers & Writers*\n\n");
- setbuf(stdout, 0);
-
- /* Determine # readers */
- if (argc == 1)
- nreaders = DEFAULT_READERS;
- else
- sscanf(*++argv, "%d", &nreaders);
- printf("[There will be %d readers]\n", nreaders);
-
- interval = (argc >= 3 ? atoi(*++argv)*1000 : 50000);
-
- if (argc == 4) lwp_debug = 1;
- LWP_InitializeProcessSupport(0, &master);
- printf("[Support initialized]\n");
- tv.tv_sec = 0;
- tv.tv_usec = interval;
- PRE_InitPreempt(&tv);
-
- /* Initialize queue */
- q = init();
-
- /* Initialize lock */
- Lock_Init(&q->lock);
-
- asleep = 0;
- /* Now create readers */
- printf("[Creating Readers...\n");
- readers = (PROCESS *) calloc(nreaders, sizeof(PROCESS));
- readersid = (int *) calloc(nreaders, sizeof(int));
- for (i=0; i<nreaders; i++) {
- snprintf(rname, sizeof(rname), "Reader %d", i);
- readersid[i] = i;
- LWP_CreateProcess(read_process,
- STACK_SIZE, 0, (char *)&readersid[i],
- rname, &readers[i]);
- }
- printf("done]\n");
-
- printf("\t[Creating Writer...\n");
- LWP_CreateProcess(write_process, STACK_SIZE, 1, 0, "Writer", &writer);
- printf("done]\n");
-
- /* Now loop until everyone's done */
- while (asleep != nreaders+1) LWP_DispatchProcess();
- /* Destroy the readers */
- for (i=nreaders-1; i>=0; i--) LWP_DestroyProcess(readers[i]);
- printf("\n*Exiting*\n");
- return 0;
-}
diff --git a/usr.sbin/afs/src/lwp/testlwp.c b/usr.sbin/afs/src/lwp/testlwp.c
deleted file mode 100644
index 22a9d14883a..00000000000
--- a/usr.sbin/afs/src/lwp/testlwp.c
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * testlwp
- *
- * Checks if lwp seems to work, and demostrates how to use lwp. Give
- * multiple commands on the command line to run several tests at the
- * same time.
- *
- * $arla: testlwp.c,v 1.9 2002/06/01 17:47:49 lha Exp $
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <err.h>
-#include <lwp.h>
-#include <lock.h>
-#include <unistd.h>
-#include <sys/time.h>
-
-static void Producer(void *foo) ;
-static void Consumer(void *foo) ;
-
-#ifndef AFS_LWP_MINSTACKSIZE
-#define LWPTEST_STACKSIZE (16*1024)
-#else
-#define LWPTEST_STACKSIZE AFS_LWP_MINSTACKSIZE
-#endif
-
-/*
- * Classic Producer Consumer thread testing
- *
- * Observe the use of SignalNoYield, you can't signal anything
- * that isn't sleeping.
- */
-
-static char pcfoo = 'a' - 1;
-
-static void
-Producer(void *foo)
-{
- while (1) {
- LWP_WaitProcess((char *)Producer);
- pcfoo++;
- if (pcfoo > 'z')
- pcfoo = 'a';
- printf("[producer] creating %c\n", pcfoo);
- LWP_NoYieldSignal ((char *)Consumer);
- }
-}
-
-static void
-Consumer(void *foo)
-{
- LWP_NoYieldSignal ((char *)Producer);
- while (1) {
- LWP_WaitProcess((char *)Consumer);
- printf("[consumer] eating %c\n", pcfoo);
- LWP_NoYieldSignal ((char *)Producer);
- }
-}
-
-static int
-startPCtest(void)
-{
- PROCESS consumer, producer;
-
- if (LWP_CreateProcess (Producer, LWPTEST_STACKSIZE, 1,
- NULL, "producer", &consumer))
- errx (1, "Cannot create producer process");
-
- if (LWP_CreateProcess (Consumer, LWPTEST_STACKSIZE, 1,
- NULL, "consumer", &producer))
- errx (1, "Cannot create consumer process");
- return 0;
-}
-
-/*
- * Test the LWP_Sleep() function
- */
-
-static void
-MrSleepy(void *foo)
-{
- printf("[mrsleepy] I'm going to bed\n");
- while (1) {
- IOMGR_Sleep(1);
- printf("[mrsleepy] yawn\n");
- }
-}
-
-static int
-putMrSleeptoBed(void)
-{
- PROCESS mrsleepy;
-
- if (LWP_CreateProcess (MrSleepy, LWPTEST_STACKSIZE, 1,
- NULL, "mrsleepy", &mrsleepy))
- errx (1, "Cannot create consumer process");
- return 0;
-}
-
-/*
- * The Producer Consumer thingy done over a pipe
- */
-
-int pipa[2] = { -1, -1 };
-
-static void
-SelectProducer(void *foo)
-{
- char *str = (char *) foo;
- int len ;
-
- if (str == NULL)
- str = "foo";
- len = strlen (str) ;
-
- while(1) {
- IOMGR_Sleep(1) ;
- printf("[selprodu] %s\n", str);
- }
-}
-
-static void
-SelectConsumer(void *foo)
-{
- char str[200];
- int len ;
- fd_set readset;
-
- while(1) {
- FD_ZERO(&readset);
- if (pipa[0] >= FD_SETSIZE)
- errx (1, "fd too large");
-
- FD_SET(pipa[0], &readset);
- IOMGR_Select(pipa[0] + 1, &readset, NULL, NULL, NULL);
- len = read(pipa[0], str, 199);
- if (len < 0)
- err(1, "read");
- str[len] = '\0';
- printf("[selcomsu] %s\n", str);
- }
-}
-
-static void
-startSelectPC (char *progname)
-{
- int pid;
- PROCESS consumer;
-
- if (pipa[0] == -1) {
- if (pipe(pipa))
- err(1, "pipe");
-
- if (LWP_CreateProcess (SelectConsumer, LWPTEST_STACKSIZE, 1,
- NULL, "selconsu", &consumer))
- errx (1, "Cannot create select consumer process");
- }
-
- pid = fork();
- switch (pid) {
- case -1: /* error */
- err(1, "fork");
- case 0: /* child */
- close(0);
- if (dup2(pipa[1], 0) == -1)
- err(1, "dup2");
- close(pipa[1]);
- execl(progname, "testlwp", "selectproducer", NULL);
- err(1, "execl");
- default:
- break;
- }
-}
-
-/*
- * Test cancel
- */
-
-static void
-onStrike(void *foo)
-{
- while (1) {
- printf("[onstrike] I'll never quit, block, block, block\n");
- IOMGR_Select(0, NULL, NULL, NULL, NULL);
- printf("[onstrike] Bah, you will never pay enough\n");
- }
-}
-
-static void
-freeEnterprise(void *foo)
-{
- PROCESS *pid = (PROCESS *) foo;
-
- while(1) {
- IOMGR_Sleep(1);
- printf("[enterpri] Raise salery\n");
- IOMGR_Cancel(*pid);
- }
-}
-
-static void
-yaEndlessLoop(void)
-{
- static PROCESS worker, enterprise;
-
- if (LWP_CreateProcess (onStrike, LWPTEST_STACKSIZE, 1,
- NULL, "worker", &worker))
- errx (1, "Cannot create worker process");
-
- if (LWP_CreateProcess (freeEnterprise, LWPTEST_STACKSIZE, 1,
- (void *)&worker, "enterprise", &enterprise))
- errx (1, "Cannot create enterprise process");
-}
-
-static void
-deadlock_write (void)
-{
- struct Lock lock;
-
- Lock_Init (&lock);
- ObtainWriteLock(&lock);
- ObtainWriteLock(&lock);
-}
-
-static void
-deadlock_read (void)
-{
- struct Lock lock;
-
- Lock_Init (&lock);
- ObtainWriteLock(&lock);
- ObtainReadLock(&lock);
-}
-
-static void
-deadlock_read2 (void)
-{
- struct Lock lock;
-
- Lock_Init (&lock);
- ObtainReadLock(&lock);
- ObtainWriteLock(&lock);
-}
-
-/*
- * the terms overrun and underrun stack are used somewhat wrong here,
- * in what direction do your stack grow
- */
-
-/*
- * when testing if the stack thingy work, it might not be so smart to
- * use the stack (automatic variables) for storage :)
- */
-
-int stack_i, stack_printed = 0;
-
-static void
-overrun_stack (void *arg)
-{
- char foo[10];
- int stack_i, stack_printed = 0;
-
- for (stack_i = 10; stack_i > -LWPTEST_STACKSIZE * 2; stack_i--) {
- if (stack_i < -LWPTEST_STACKSIZE - 100 && !stack_printed) {
- printf("hum overrun stack now\n");
- stack_printed = 1;
- }
- foo[stack_i] = 0x4e;
- }
-}
-
-
-static void
-underrun_stack (void *arg)
-{
- char foo[10];
-
- for (stack_i = 0; stack_i < LWPTEST_STACKSIZE * 2; stack_i++) {
- if (stack_i > LWPTEST_STACKSIZE + 100&& !stack_printed) {
- printf("hum underrun stack now\n");
- stack_printed = 1;
- }
- foo[stack_i] = 0xe4;
- }
-}
-
-
-/*
- * Usage
- */
-
-static void
-usage(char *progname)
-{
- fprintf(stderr, "usage: %s cmd ...\nWhere cmd is one of:\n", progname);
- fprintf(stderr,
- "pc\t\tProducer Consumer test\n"
- "sleep\t\tSleeptest\n"
- "selectconsumer\tSelect consumer\n"
- "selectproducer\t(special case, just print a string on stdout repeatally)\n"
- "cancel\t\tTest iomgr cancel\n"
- "deadlock-write\tdeadlockdetection\n"
- "deadlock-read\tdeadlockdetection\n"
- "deadlock-read2\tdeadlockdetection\n"
- "overrun-stack\tover run the stack\n"
- "underrun-stack\tunder run the stack\n"
- "version\t\tPrint version\n");
-
- printf("Use several of these tests together to test their interopability\n");
- exit(1);
-}
-
-int main(int argc, char **argv)
-{
- PROCESS pid;
- char *progname = strdup(argv[0]);
-
- if (progname == NULL)
- progname = "foo";
-
- if (argc <= 1 )
- usage(progname);
-
- printf("starting LWP support\n");
- if (LWP_InitializeProcessSupport(LWP_NORMAL_PRIORITY, &pid))
- errx(1, "LWP_InitializeProcessSupport()");
-
- printf("starting IOMGR support\n");
- if (IOMGR_Initialize())
- errx(1, "IOMGR_Initialize()");
-
- while (argv[1]) {
- if (strcasecmp("pc", argv[1]) == 0) {
- startPCtest();
- } else if (strcasecmp("sleep", argv[1]) == 0) {
- putMrSleeptoBed();
- } else if (strcasecmp("selectproducer", argv[1]) == 0) {
- SelectProducer(NULL);
- exit(1); /* Special case */
- } else if (strcasecmp("selectconsumer", argv[1]) == 0) {
- startSelectPC (progname);
- } else if (strcasecmp("cancel", argv[1]) == 0) {
- yaEndlessLoop();
- } else if (strcasecmp("deadlock-write", argv[1]) == 0) {
- deadlock_write();
- } else if (strcasecmp("deadlock-read", argv[1]) == 0) {
- deadlock_read();
- } else if (strcasecmp("deadlock-read2", argv[1]) == 0) {
- deadlock_read2();
- } else if (strcasecmp("overrun-stack", argv[1]) == 0) {
- PROCESS tpid;
- if (LWP_CreateProcess (overrun_stack, LWPTEST_STACKSIZE, 1,
- NULL, "overunner", &tpid))
- errx (1, "Cannot create stack overrunner process");
- } else if (strcasecmp("underrun-stack", argv[1]) == 0) {
- PROCESS tpid;
- if (LWP_CreateProcess (underrun_stack, LWPTEST_STACKSIZE, 1,
- NULL, "underrunner", &tpid))
- errx (1, "Cannot create stack underrunner process");
- } else if (strcasecmp("version", argv[1]) == 0) {
- printf("Version: "
- "$arla: testlwp.c,v 1.9 2002/06/01 17:47:49 lha Exp $\n");
- exit (0);
- } else {
- printf("unknown command %s\n", argv[1]);
- exit (1);
- }
-
- argc--;
- argv++;
- }
- LWP_WaitProcess((char *) main);
- return 0;
-}
-
-
diff --git a/usr.sbin/afs/src/lwp/testprocess.c b/usr.sbin/afs/src/lwp/testprocess.c
deleted file mode 100644
index 8b39a37cf23..00000000000
--- a/usr.sbin/afs/src/lwp/testprocess.c
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <lwp.h>
-
-/*
- * This is no test-program for lwp, this is just to make
- * sure we got a process.o that we can link with.
- * Run it if you want a coredump...
- *
- *
- * Todo: really a test-program
- *
- * $arla: testprocess.c,v 1.1 1998/06/09 11:52:53 lha Exp $
- */
-
-int savecontext();
-int returnto();
-
-int main(void)
-{
- savecontext();
- returnto();
- return 0;
-}
diff --git a/usr.sbin/afs/src/lwp/timer.c b/usr.sbin/afs/src/lwp/timer.c
deleted file mode 100644
index 6a570e4ef41..00000000000
--- a/usr.sbin/afs/src/lwp/timer.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/*******************************************************************\
-* *
-* *
-* Information Technology Center *
-* Carnegie-Mellon University *
-* *
-* *
-* *
-\*******************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: timer.c,v 1.6 2002/06/01 17:47:50 lha Exp $");
-#endif
-
-#include <sys/time.h>
-#define _TIMER_IMPL_
-#include "timer.h"
-#include "q.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#define FALSE 0
-#define TRUE 1
-
-#define NIL 0
-
-#define expiration TotalTime
-
-#define new_elem() ((struct TM_Elem *) malloc(sizeof(struct TM_Elem)))
-
-#define MILLION 1000000
-
-static int globalInitDone = 0;
-
-/* t1 = t2 - t3 */
-
-static void
-subtract(struct timeval *t1,
- struct timeval *t2,
- struct timeval *t3)
-{
- int sec2, usec2, sec3, usec3;
-
- sec2 = t2 -> tv_sec;
- usec2 = t2 -> tv_usec;
- sec3 = t3 -> tv_sec;
- usec3 = t3 -> tv_usec;
-
- /* Take care of the probably non-existent case where the
- * usec field has more than 1 second in it. */
-
- while (usec3 > usec2) {
- usec2 += MILLION;
- sec2--;
- }
-
- /* Check for a negative time and use zero for the answer,
- * since the tv_sec field is unsigned */
-
- if (sec3 > sec2) {
- t1 -> tv_usec = 0;
- t1 -> tv_sec = (unsigned long) 0;
- } else {
- t1 -> tv_usec = usec2 - usec3;
- t1 -> tv_sec = sec2 - sec3;
- }
-}
-
-/* t1 += t2; */
-
-static void
-add(struct timeval *t1, struct timeval *t2)
-{
- t1 -> tv_usec += t2 -> tv_usec;
- t1 -> tv_sec += t2 -> tv_sec;
- if (t1->tv_usec >= MILLION) {
- t1 -> tv_sec ++;
- t1 -> tv_usec -= MILLION;
- }
-}
-
-/* t1 == t2 */
-
-bool
-TM_eql(struct timeval *t1, struct timeval *t2)
-{
- return (t1->tv_usec == t2->tv_usec) && (t1->tv_sec == t2->tv_sec);
-}
-
-/* t1 >= t2 */
-
-/*
-obsolete, commentless procedure, all done by hand expansion now.
-static bool
-geq(struct timeval *t1, struct timeval *t2)
-{
- return (t1->tv_sec > t2->tv_sec) ||
- (t1->tv_sec == t2->tv_sec && t1->tv_usec >= t2->tv_usec);
-}
-*/
-
-static bool
-blocking(struct TM_Elem *t)
-{
- return (t->TotalTime.tv_sec < 0 || t->TotalTime.tv_usec < 0);
-}
-
-
-
-/*
- * Initializes a list -- returns -1 if failure, else 0.
- */
-
-int
-TM_Init(struct TM_Elem **list)
-{
- if (!globalInitDone) {
- FT_Init (0, 0);
- globalInitDone = 1;
- }
- *list = new_elem();
- if (*list == NIL)
- return -1;
- else {
- (*list) -> Next = *list;
- (*list) -> Prev = *list;
- (*list) -> TotalTime.tv_sec = 0;
- (*list) -> TotalTime.tv_usec = 0;
- (*list) -> TimeLeft.tv_sec = 0;
- (*list) -> TimeLeft.tv_usec = 0;
- (*list) -> BackPointer = NIL;
-
- return 0;
- }
-}
-
-int
-TM_Final(struct TM_Elem **list)
-{
- if (list == NIL || *list == NIL)
- return -1;
- else {
- free(*list);
- *list = NIL;
- return 0;
- }
-}
-
-/*
- * Inserts elem into the timer list pointed to by *tlistPtr.
- */
-
-void
-TM_Insert(struct TM_Elem *tlistPtr, struct TM_Elem *elem)
-/* pointer to head pointer of timer list */
-/* element to be inserted */
-{
- struct TM_Elem *next;
-
- /* TimeLeft must be set for function IOMGR with infinite timeouts */
- elem -> TimeLeft = elem -> TotalTime;
-
- /* Special case -- infinite timeout */
- if (blocking(elem)) {
- lwp_insque(elem, tlistPtr->Prev);
- return;
- }
-
- /* Finite timeout, set expiration time */
- FT_AGetTimeOfDay(&elem->expiration, 0);
- add(&elem->expiration, &elem->TimeLeft);
- next = NIL;
- FOR_ALL_ELTS(p, tlistPtr, {
- if (blocking(p) || !(elem->TimeLeft.tv_sec > p->TimeLeft.tv_sec ||
- (elem->TimeLeft.tv_sec == p->TimeLeft.tv_sec && elem->TimeLeft.tv_usec >= p->TimeLeft.tv_usec))
- ) {
- next = p; /* Save ptr to element that will be after this one */
- break;
- }
- })
-
- if (next == NIL) next = tlistPtr;
- lwp_insque(elem, next->Prev);
-}
-
-/*
- * Walks through the specified list and updates the TimeLeft fields in it.
- * Returns number of expired elements in the list.
- */
-
-int
-TM_Rescan(struct TM_Elem *tlist)
-/* head pointer of timer list */
-{
- struct timeval time;
- int expired;
-
- FT_AGetTimeOfDay(&time, 0);
- expired = 0;
- FOR_ALL_ELTS(e, tlist, {
- if (!blocking(e)) {
- subtract(&e->TimeLeft, &e->expiration, &time);
- if (0 > e->TimeLeft.tv_sec || (0 == e->TimeLeft.tv_sec && 0 >=
- e->TimeLeft.tv_usec))
- expired++;
- }
- })
- return expired;
-}
-
-/*
- * RETURNS POINTER TO earliest expired entry from tlist.
- * Returns 0 if no expired entries are present.
- */
-
-struct TM_Elem *
-TM_GetExpired(struct TM_Elem *tlist)
-/* head pointer of timer list */
-{
- FOR_ALL_ELTS(e, tlist, {
- if (!blocking(e) &&
- (0 > e->TimeLeft.tv_sec || (0 == e->TimeLeft.tv_sec
- && 0 >= e->TimeLeft.tv_usec)))
- return e;
- })
- return NIL;
-}
-
-/*
- * Returns a pointer to the earliest unexpired element in tlist.
- * Its TimeLeft field will specify how much time is left.
- * Returns 0 if tlist is empty or if there are no unexpired elements.
- */
-
-struct TM_Elem *
-TM_GetEarliest(struct TM_Elem *tlist)
-{
- struct TM_Elem *e;
-
- e = tlist -> Next;
- return (e == tlist ? NIL : e);
-}
diff --git a/usr.sbin/afs/src/lwp/timer.h b/usr.sbin/afs/src/lwp/timer.h
deleted file mode 100644
index ef4cff58895..00000000000
--- a/usr.sbin/afs/src/lwp/timer.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/*******************************************************************\
-* *
-* Information Technology Center *
-* Carnegie-Mellon University *
-* *
-* *
-\*******************************************************************/
-
-struct TM_Elem {
- struct TM_Elem *Next; /* filled by package */
- struct TM_Elem *Prev; /* filled by package */
- struct timeval TotalTime; /* filled in by caller -- modified by package */
- struct timeval TimeLeft; /* filled by package */
- char *BackPointer; /* filled by caller, not interpreted by package */
-};
-
-#ifndef _TIMER_IMPL_
-extern void Tm_Insert();
-#define TM_Remove(list, elem) lwp_remque(elem)
-extern int TM_Rescan();
-extern struct TM_Elem *TM_GetExpired();
-extern struct TM_Elem *TM_GetEarliest();
-#endif
-
-int TM_Init(struct TM_Elem **list);
-int TM_Rescan(struct TM_Elem *tlist);
-struct TM_Elem *TM_GetExpired(struct TM_Elem *tlist);
-struct TM_Elem *TM_GetEarliest(struct TM_Elem *tlist);
-
-typedef unsigned char bool; /* XXX - this is not the correct place */
-
-bool TM_eql(struct timeval *, struct timeval *);
-int TM_Final(struct TM_Elem **);
-void TM_Insert(struct TM_Elem *, struct TM_Elem *);
-
-#define FOR_ALL_ELTS(var, list, body)\
- {\
- struct TM_Elem *_LIST_, *var, *_NEXT_;\
- _LIST_ = (list);\
- for (var = _LIST_ -> Next; var != _LIST_; var = _NEXT_) {\
- _NEXT_ = var -> Next;\
- body\
- }\
- }
-
-/* ---------------------- */
-
-/*
- * FT - prototypes.
- * This is completly wrong place to place this.
- * But fasttime doesn't have any own prototypes.
- * (fasttime should be shot anyway)
- */
-
-int FT_Init(int, int);
-int FT_GetTimeOfDay(struct timeval * tv, struct timezone * tz);
-int FT_AGetTimeOfDay(struct timeval *, struct timezone *);
-int TM_GetTimeOfDay(struct timeval * tv, struct timezone * tz);
-unsigned int FT_ApproxTime(void);
diff --git a/usr.sbin/afs/src/make-release b/usr.sbin/afs/src/make-release
deleted file mode 100644
index 60afa289f38..00000000000
--- a/usr.sbin/afs/src/make-release
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-# $KTH: make-release,v 1.3 2000/06/05 01:46:35 assar Exp $
-
-if [ ! -f configure.in ]; then
- echo "Must be in top directory"
- exit 1
-fi
-
-if [ $# -ne 1 -a $# -ne 2 ]; then
- echo "make-release version [branch]"
- exit 1
-fi
-
-if [ "$2" != "" ]; then
- rev="-r $2"
-fi
-
-HV="$1" emacs -batch -q -no-site-file -l ./make-release.el || exit
-
-files="configure.in ChangeLog README LIESMICH doc/arla.texi"
-
-echo cvs ci -m \"Release $1\" $files
-cvs ci -m "Release $1" $files || exit 1
-v=`echo $1 | sed 's/\./-/g'`
-echo cvs rtag $rev arla-$v arla
-cvs rtag $rev arla-$v arla || exit 1
diff --git a/usr.sbin/afs/src/make-release.el b/usr.sbin/afs/src/make-release.el
deleted file mode 100644
index 8ba3d99f3bd..00000000000
--- a/usr.sbin/afs/src/make-release.el
+++ /dev/null
@@ -1,25 +0,0 @@
-; $KTH: make-release.el,v 1.3 2000/08/19 19:22:15 assar Exp $
-
-(defun bump-version (filename prefix v-string)
- (save-excursion
- (find-file filename)
- (while (re-search-forward (concat prefix "[0-9\\.]*[0-9]") nil t)
- (replace-match v-string nil nil))
- (save-buffer)))
-
-(let* ((version (getenv "HV"))
- (arla-version (concat "arla-" version))
- (version-string (concat "Release " version)))
- (find-file "configure.in")
- (re-search-forward "VERSION=\\(.*\\)$")
- (replace-match version nil nil nil 1)
- (save-buffer)
- (find-file "ChangeLog")
- (add-change-log-entry nil nil nil nil)
- (insert version-string)
- (save-buffer)
- (mapcar (function (lambda (v) (bump-version v "arla-" arla-version)))
- '("README" "LIESMICH"))
- (mapcar (function (lambda (v) (bump-version v "version " version-string)))
- '("doc/arla.texi"))
- (kill-emacs))
diff --git a/usr.sbin/afs/src/milko/ChangeLog b/usr.sbin/afs/src/milko/ChangeLog
deleted file mode 100644
index 3a3f6ff77c7..00000000000
--- a/usr.sbin/afs/src/milko/ChangeLog
+++ /dev/null
@@ -1,1704 +0,0 @@
-2003-04-09 Love <lha@stacken.kth.se>
-
- * pts/ptserver.c: s/strcpy/strlcpy/
-
-2003-04-08 Love <lha@stacken.kth.se>
-
- * fs/fsprocs.c: s/RXAFS_/SRXAFS_/
- * fs/fsprocs.c: replace sprint with snprintf
-
-2003-02-16 Love <lha@stacken.kth.se>
-
- * lib/mdb/ndbm.c: build if we have HAVE_NEW_DB
-
- * lib/mdb/ndbm.c (mdb_NDBM_create): instead of assert()ing, return
- failure
-
-2003-02-15 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * vldb/Makefile.in: s/arlautil/libarlautil
-
- * vldb/vldbserver.c: s/int32/int32_t
-
- * fs/Makefile.in: Added libvers.la Removed libko.a, we alreday
- have libko.la
-
- * lib/vld/vld.c: spare1-4 in AFSFetchStatus are no more
-
-2002-11-29 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * lib/vld/vld.c (vld_modify_vnode): update ServerModTime in
- correct union
-
-2002-10-31 Love <lha@stacken.kth.se>
-
- * vldb/vldbserver.c: fix prototype for VL_GetAddrs
-
-2002-10-02 Love <lha@stacken.kth.se>
-
- * bos/kconf.c: fix NUL termination of fgets string
-
-2002-09-08 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * fs/volprocs.c (VOLSER_AFSVolForwardMultiple): change to new xdr
- definition
-
- * lib/dpart/Makefile.in: Added @MILKO_ROOT@
-
-2002-07-03 Love <lha@stacken.kth.se>
-
- * milko/appl/perf: move to arla appl tree
-
-2002-06-02 Love <lha@stacken.kth.se>
-
- * Make compile again
-
-2002-03-06 Tomas Olsson <tol@stacken.kth.se>
-
- * lib/vld/mdir.[ch] use fdir_readdir the new way
-
- * lib/vld/salvage.c use fdir_readdir the new way
-
- * appl/sked/sked.c use fdir_readdir the new way
-
- * appl/perf/Makefile.in depend on libarlautil
-
- * appl/sked/Makefile.in depend on libarlautil
-
-2002-01-29 Love <lha@stacken.kth.se>
-
- * fs/dump.c: remove __FUNCTION__, its not portable
-
-2002-01-29 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * fs/volprocs.c (VOLSER_AFSVolDump): call generate_dump()
-
- * fs/dump.h, fs/dump.c: Added dump functionality
-
- * lib/vld/vld.h, lib/vld/vld.c: Added vld_foreach_dir and
- vld_foreach_file
-
-2002-01-23 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * fs/fsprocs.c: Pass volume type to ropa_getcallback
- (check_ss_bits): check super user
- (fs_init_req): don't allow writes to a read-only volume
- (RXAFS_SetVolumeStatus): check super user
-
- * fs/volprocs.c: Changed debugging output
- (VOLSER_AFSVolEndTrans): break callback for volume
-
- * fs/fs_def.h: Define MILKO_ROFS
-
- * fs/dump.c: tag is unsigned char
-
- * fs/connsec.c (fs_connsec_createconn): fill in superuser field
-
- * lib/voldb/vdb_flat.c (vdbflat_rebuild): implement
-
- * lib/vld/vld.c (vld_storestatus_to_dent): remove permission check
- (vld_storestatus_to_dent): remove permission check
- (vld_check_rights): use superuser flag in fs_security_context
-
- * lib/vld/salvage.c: Update to new voldb nextptr behaviour
- (read_nodes_dir): Rewrite permissions check
- (read_nodes_file): Rewrite permissions check
-
- * lib/vld/mnode.h: Added superuser field in struct
- fs_security_context
-
-2002-01-11 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * fs/volprocs.c: Call vld_rebuild
-
- * lib/vld/vld.c: Added vld_rebuild
-
- * lib/vld/vld.h: Added vld_rebuild
-
- * lib/voldb/voldb.c: Added voldb_rebuild
-
- * lib/voldb/vdb_flat.c: Added vdbflat_rebuild
-
- * lib/voldb/voldb.h: Added voldb_rebuild
-
- * lib/voldb/voldb_internal.h: Added voldb_rebuild
-
- * lib/vld/vld.c (delete_all_nodes): nextptr is VOLDB_ENTRY_USED if
- used
- (restore_file): nextptr is VOLDB_ENTRY_USED if used
- (restore_file): if a file exists at the same vnode, remove the old
- file
-
- * fs/fsrv_locl.h: Include roken.h
-
- * fs/fsprocs.c (RXAFS_StoreACL): only get VOLOP_GETSTATUS and
- VOLOP_ADMIN
-
- * fs/dump.c (read_vnodeheader): restore_file changed acl argument
- to int32_t *
-
- * lib/vld/vld.h (restore_file): change acl argument to int32_t *
-
- * lib/vld/vld.c (restore_file): restore ACL and update volsize
-
- * fs/connsec.c (fs_connsec_createconn): Don't free db server
- context before PR_GetCPS
-
-2002-01-05 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * lib/dpart/dpart.c: Use statvfs if present
-
-2001-11-17 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * fs/connsec.c (fs_connsec_nametoid): Use arlalib
- (fs_connsec_idtoname): Use arlalib
- (fs_connsec_createconn): Use arlalib
-
- * vldb/vldbserver.c: Flush database after writing
- (VL_DeleteEntry): rewrite
-
-2001-11-07 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * fs/volprocs.c (volser_fetch_vh): return better error messages
- (VOLSER_AFSVolClone): log more
- (VOLSER_AFSVolTransCreate): check for volume existence
- (VOLSER_AFSVolPartitionInfo): fill in some bogus free value
-
- * fs/Makefile.in: Use arlalib
-
-2001-11-06 Tomas Olsson <tol@stacken.kth.se>
-
- * fs/fsprocs.c (removenode): more proper callback handling
- (RXAFS_Rename): cover more cases, handle callbacks better
-
- * lib/vld/mnode.c (mnode_{find,free,remove}): use flags.removedp
- * lib/vld/mnode.h (struct mnode): added flags.removedp
- * lib/vld/mdir.c (mdir_changefid): added
- * lib/vld/mdir.h: added mdir_changefid()
- * lib/vld/vld.c (vld_adjust_linkcount): always update fetchstatus
- (vld_modify_vnode): update ServerModTime
-
-2001-11-02 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * appl/sked/sked.c (volshow_cmd): partdir is the 3rd argument
-
- * vldb/vldb_locl.h vldb/vl_db.c: Added vldb_flush
-
-2001-11-02 Tomas Olsson <tol@stacken.kth.se>
-
- * lib/voldb/vdb_flat.c: use VOLDB_ENTRY_USED
- * lib/voldb/voldb.h: define VOLDB_ENTRY_USED
- * pts/ptserver.c (read_header): no need to malloc()
- * fs/fileserver.c (main): do usage() on --help
-
-2001-10-14 Love <lha@stacken.kth.se>
-
- * appl/sked/sked.c: replace SL_BADCOMMAND with -1 to make it
- compatible with older libsl
-
-2001-10-14 Tomas Olsson <tol@stacken.kth.se>
-
- * fs/fsprocs.c (RXAFS_Rename): initialize new_n when same dir too
-
- * lib/vld/mdir.h (mdir_lookup): new signature
- (mdir_rename): added
-
- * lib/vld/mdir.c (mdir_lookup): new signature
- (mdir_rename): added
-
- * lib/vld/vld.h (vld_remove_node): use mnode
- (vld_[gs]et_volstats): added
-
- * lib/vld/vld.c
- (vld_{update_volsize,check_quota,{get,set}_volstats}): new functions
- added quota handling, hard links, anonymous gets some rights
-
- * fs/fsprocs.c: added quota handling, hard links
-
- * pts/ptserver.c (read_header): free() buffer
- (conv_name_to_id): free() buffer
-
- * lib/vld/mnode.c (reset_node): close fd
- (mnode_find): try harder when no free nodes
-
- * lib/dpart/dpart.c (dp_getstats): added
- * lib/dpart/dpart.h (dp_getstats): added
-
-2001-10-12 Tomas Olsson <tol@stacken.kth.se>
-
- * fs/connsec.c (fs_connsec_createconn): lowercase realm for ptserver
- * pts/{Makefile.in,pr.c,ptserver.[ch]} use mdb
-
-2001-10-03 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * lib/mdb/mdb.[ch], lib/mdb/ndbm.c: Added flush
-
- * fs/fsprocs.c (RXAFS_FetchStatus): use exit label instead of
- return
- * fs/dump.[ch]: Make it work somewhat
-
- * fs/volprocs.c (VOLSER_AFSVolRestore): Added transaction handling
-
- * lib/vld/vld.h: Added restore_file
- * lib/vld/vld.c: Added restore_file
- (vld_check_rights): Added implicit read, lookup and administer
- rights for system:administrators
-
- * lib/voldb/vdb_flat.c: Added expand
- * lib/voldb/voldb.c: Added expand
- * lib/voldb/voldb.h: Added expand
- * lib/voldb/voldb_internal.h: Added expand
-
- * vldb/Makefile.in: Changed to namecentric database handling
- * vldb/vl_db.c: Changed to namecentric database handling
- * vldb/vldb_locl.h: Changed to namecentric database handling
- * vldb/vldbserver.c: Changed to namecentric database handling
- * vldb/vl_disk.c: Changed to namecentric database handling
-
-2001-10-02 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * lib/vld/vld.[ch]: Added vld_delete_volume
-
- * fs/Makefile.in: Added dump.c
-
- * fs/fsrv_locl.h: Added dump.h
-
- * fs/volprocs.c: Implement DeleteVolume, Restore, GetStatus,
- SetIdsTypes, SetDate
-
- * fs/dump.[ch]: Added bogus dump functionality
-
-2001-09-28 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * fs/volprocs.c (VOLSER_AFSVolListVolumes): implement
-
- * vldb/vldbserver.c: Use vital_vlheader instead of vlheader
-
- * vldb/vl_db.c: Use vital_vlheader instead of vlheader
-
- * lib/mdb/ndbm.c (NDBM_fetch): return ENOENT on error
-
- * lib/vld/vld.[ch]: Added vld_list_volumes
-
- * fs/volprocs.c: Added security checks and logging.
-
-2001-09-04 Tomas Olsson <tol@stacken.kth.se>
-
- * appl/sked/sked.c (volcreate_cmd): avoid using null arg for
- dpart_root
-
- * vldb/vldb_locl.h: update prototypes, cleanup
-
- * vldb/vl_db.c (vldb_{read_entry,id_to_name,write_name}):
- error handling, fixup
- (vldb_name_to_id): added new arg (name), some error handling, fixup
- (vldb_{print_entry,close}): update signature
-
- * vldb/vldbserver.c (VL_{Create,Delete}Entry, VL_GetEntryBy{Name,ID}):
- some error handling & cleanup
-
- * lib/mdb/mdb.c (mdb_delete): added
- * lib/mdb/mdb.h: Added prototypes for mdb_delete() and mdb_close()
- * lib/mdb/ndbm.c (NDBM_delete): added
-
-2001-08-30 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * vldb/Makefile.in: Link with libmdb. Don't build vled.
- * vldb/{vl_bd.c,vldbserver.c,vldb_locl.h}: changed to use mdb
- * lib/Makefile.in: added directory mdb
- * lib/mdb: Database library for vl- and ptserver, added
-
-2001-08-26 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * pts/ptserver.c (main): move prserver_create after mlog_loginit
- * vldb/vldbserver.c (main): call vldb_create after mlog_loginit
-
-2001-07-26 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * vldb/{vl_db.c,vldb_locl.h,vldbserver.c}: Use mlog. Restructure
- program arguments
-
- * pts/{pr.c,ptserver.c,ptserver.h}: Use mlog. Restructure program
- arguments
-
- * lib/vld/Makefile.in: Removed debug.c
-
- * lib/mlog/Makefile.in: Added mdebug.c
-
- * lib/vld/debug.c: Moved to lib/mlod/mdebug.c
-
- * pts/Makefile.in, vldb/Makefile.in: Link with mlog
-
- * include/mdebug.h: Moved to lib/mlog/mdebug.h
-
- * fs/fileserver.c: Make salvage_options a passed variable
- Restructure program arguments
-
-2001-07-07 Magnus Ahltorp <map@stacken.kth.se>
-
- * vldb/vldbserver.c (VL_ReplaceEntryN): argument should be
- nvldbentry
-
- * bos/bosprocs.c (BOZO_SetStatus): Added status argument
-
- * appl/sked/sked.c (volls_cmd): Cast printf arguments.
- mdir_readdir changed argument from VenusFid pointer to VenusFid.
-
- * lib/msecurity/msecurity.c: Include roken.h
-
- * lib/vld/salvage.c (check_content_dir_func): fdir_readdir changed
- argument from VenusFid pointer to VenusFid
-
- * lib/vld/mdir.[ch] (mdir_readdir): change argument from VenusFid
- pointer to VenusFid
-
-2001-02-12 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * lib/dpart/dpart.c: Added parentheses
-
-2001-01-09 Love <lha@stacken.kth.se>
-
- * fs/fileserver.c (arg): too arguments where using short option
- 's' From Nickolai Zeldovich <kolya@MIT.EDU>
-
-2001-01-01 Love <lha@stacken.kth.se>
-
- * fs/fsprocs.c: (RXAFS_FetchACL): add dummy call to i2nlist() to
- return numbers when pts-server is down
- (RXAFS_Link): dummy implement, not enabled
-
- * vldb/vldbserver.c(main): pass realm to network_init().
-
-2000-12-29 Tomas Olsson <tol@stacken.kth.se>
-
- * appl/sked/sked.c ({vol{create,show,ls},salvage}_cmd):
- Handle vicep* in other places than /
- * lib/voldb/voldb_locl.h Makefile.in vol.c:
- Handle vicep* in other places than /
- * lib/dpart/dpart.[ch]: Handle vicep* in other places than /
- * fs/fileserver.c (main): use the given realm, new arg partdir,
- place to look for vicep*
- (sigusr1): look in the right place for vicepa
- * pts/ptserver.c (main): use the given realm
- * fs/fsprocs.c (RXAFS_StoreACL): return correct values
- * lib/vld/vld.c (vld_create_volume): no default rights for
- anonymous
-
-2000-12-10 Love <lha@stacken.kth.se>
-
- * appl/perf/perf.c: return somewhat more sane error-codes in the
- callbackserver
-
-2000-12-05 Love <lha@stacken.kth.se>
-
- * lib/mlog/Makefile.in: added $(srcdir)/../../..
-
-2000-12-04 Love <lha@stacken.kth.se>
-
- * lib/ropa/ropa.c (ropa_getcallback): if we fail to probe the
- client, whine and return a bogus callback
- (update_callback_time): new, update a backback
- (update_callback): use update_callback_time().
-
-2000-12-01 Tomas Olsson <tol@stacken.kth.se>
-
- * fs/fsprocs.c (*): always give a real mnode as arg when calling
- vld_modify_vnode()
- * lib/vld/vld.c (*ent_to_fetchstatus): new format w/ volume_handle
- (*): set fetchstatus more correctly, use new *ent_to_fetchstatus
-
-2000-11-25 Love <lha@stacken.kth.se>
-
- * lib/ropa/ropa.c: first shot at threadsafeness
-
-2000-10-08 Tomas Olsson <tol@stacken.kth.se>
-
- * appl/sked/sked.c (volcreate_cmd): parse partition name correctly
-
-2000-10-03 Love <lha@stacken.kth.se>
-
- * **/*.[chly]: Removed advertising clause.
-
-2000-10-02 Assar Westerlund <assar@sics.se>
-
- * lib/vld/vld.c (vld_check_rights): always look at the node itself
- if it's a directory
- * lib/vld/mnode.h: remove VOLOP_PARENT
-
-2000-09-29 Tomas Olsson <tol@stacken.kth.se>
-
- * pts/ptserver.c (addtogroup): avoid duplicates
- * bos/bosserver.c: check both serverfile and bos.conf
- * appl/sked/sked.c (main): make logging work
- * fs/fsprocs.c
- (RXAFS_{FetchData,FetchStatus,StoreData,CreateFile}): log
- calleraccess on return
- * fs/fileserver.c (main): use ropa_init() the new way
- * lib/ropa/ropa.h: update prototype for ropa_init()
- * lib/ropa/ropa.c: keep connections to clients and reuse,
- added hashtable to keep track of ccpairs
- (ropa_init): new interface w/ htabsizes & #ccpairs
-
-2000-09-29 Love <lha@stacken.kth.se>
-
- * pts/pr.c (PR_NameToID,PR_IDToName): print [in]len
- * pts/*.c: change to log_log, clean up
- * bos/bosserver.c: remove unused variables
-
-2000-09-15 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * pts/ptserver.c (find_first_free): Use deleted entries
- * pts/ptserver.c (listelements): don't include own id when
- PR_ListElements
-
-2000-09-15 Tomas Olsson <tol@stacken.kth.se>
-
- * lib/mlog/mlog.c (mlog_loginit): use the supplied method
-
-2000-09-06 Tomas Olsson <tol@stacken.kth.se>
-
- * fs/fsprocs.c (removenode): return error if dirp doesn't match
- actual node type
- * bos/bosserver.c: somewhat closer to working condition
- * bos.conf: closer to current format
-
-2000-09-04 Love <lha@stacken.kth.se>
-
- * pts/ptserver.c: remove some warnings usr log_log
-
-2000-09-03 Love <lha@stacken.kth.se>
-
- * bos/bosprocs.c (AddSUser, DeleteSUser): add some content
- (*): re-indent
-
-2000-09-02 Love <lha@stacken.kth.se>
-
- * bos/bosprocs.c: added missing functions
-
-2000-08-24 Love <lha@stacken.kth.se>
-
- * fs/fileserver.c: update code to new mlog_log_set_level
- * lib/mlog/mlog.c: new log_log
-
-2000-08-21 Tomas Olsson <tol@stacken.kth.se>
-
- * pts/ptserver.c (localize_name): use strlcpy
- * fs/connsec.c (fs_connsec_anonymous): added - set up anonymous CPS
- (fs_connsec_createconn): use fs_connsec_anonymous() when auth fails
- * lib/vld/vld.c (super_user): check if member of
- system:administrators
- * lib/ropa/ropa.c (client_update_interfaces): ntohl() is no longer
- needed
-
-2000-08-17 Tomas Olsson <tol@stacken.kth.se>
-
- * vldb/vldbserver.c (VL_GetEntryByIDN): local variable to save
- const arg voltype
- * pts/pr.c (PR_{NameToID,NewEntry,INewEntry}): use localize_name()
- to get well formatted name
- (PR_IDToName): check args
- (PR_{ListElements,GetCPS}): use new listelements()
- * pts/ptserver.h: new proto for listelements() added
- localize_name()
- * pts/ptserver.c: add & use debug functions
- (localize_name): added
- (addtogroup,removefromgroup): use prentry.count, make sure no
- holes in entrylists
- (listelements): new bool arg, use prentry.count, add own & if arg
- set default ids
- * lib/vld/vld.c (vld_create_volume): less wild default privileges
- (super_user): always return 0
- (vld_check_rights): check rights, don't make everything up
- * lib/vld/salvage.c: more unsigned
- * lib/vld/vld.h: more unsigned
- * lib/vld/mnode.h: use unsigned instead of long for flags
- * lib/ropa/ropa.c (find_client): fix typo
- (client_update_interfaces): use ntohl() on hidden elements in
- struct from peer
- (ropa_init): get & save debuglevel for later use
- (debug_print_callbacks): don't iterate if MDEBROPA not set i debuglevel
- * fs/fsprocs.c (check_ss_bits): set mask appropriately when
- creating
- * fs/connsec.c (get_conn): use netinit_client_getcred()
- (fs_connsec_nametoid): better handling of connection to ptserver, retry
- (fs_connsec_createconn): send full principal to PR_NameToID
- * lib/msecurity/netinit.c (server_get_cred): rename to
- netinit_client_getcred(), try harder to get ticket
- (network_init): get our own ticket file
- (netinit_getrealm): added
- * lib/msecurity/netinit.h: rename server_get_cred() to
- netinit_client_getcred() add netinit_getrealm()
- * appl/perf/perf.c (do_bulkstat): fix typo
- * README: myhost instead of localhost
-
-2000-08-12 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * pts/pr.c: added body for PR_ListElements, PR_AddToGroup and
- PR_RemoveFromGroup
- * pts/ptserver.c: added update_entry, listelements, addtogroup and
- removefromgroup
- * pts/ptserver.h: added listselements, addtogroup and
- removefromgroup
-
-2000-08-11 Mattias Amnefelt <mattiasa@e.kth.se>
-
- * lib/msecurity/msecurity/msecurity.c: use $prefixed configdir for
- superuserlist
-
-2000-08-10 Love <lha@stacken.kth.se>
-
- * lib/vld/vld.c (vld_storestatus_to_dent): permit s[gu]id binaries
- (vld_modify_vnode): dont assert admin
-
- * fs/fsprocs.c (RXAFS_{MakeDir,CreateFile}): check storestatus
- (RXAFS_Symlink): pass on storestatus from caller after checking it
- (check_ss_bits): check storestatus bit from user.
- (StoreData,StoreStatus): call check_ss_bits
-
-2000-08-10 Tomas Olsson <tol@stacken.kth.se>
-
- * lib/vld/vld.c (vld_modify_vnode): get fetchstatus after
- modifying
-
- * lib/vld/mnode.c (mnode_find): save node in lru
- (mnode_free): better handling of bad nodes, save node in lru
- (mnode_remove): remove node from lru before adding it again
-
- * lib/ropa/ropa.c: more logging, use debug_print_callbacks() and
- print_callback_sub()
- (break_ccpair): check cc->li for NULL before listdel
- (ropa_drop_callback): no error if arg-lists have different lengths
- (heapcleaner): cowardly avoid error, leave list handling to break_ccpair()
-
- * fs/fsprocs.c (RXAFS_FetchData): more logging, return nothing on
- weird offset
- (RXAFS_StoreData): handle strange strange filelength arg more nicely, more logging
- (RXAFS_{CreateFile,GiveUpCallbacks,GetRootVolume,GetTime}): more logging
-
-2000-07-24 Tomas Olsson <tol@stacken.kth.se>
-
- * lib/ropa/ropa.c: improve debug formatting
-
- * fs/fsprocs.c (StoreData): log offset and length
- (removenode): use new vld_adjust_linkcount(), vld_modify_vnode()
- (RXAFS_{CreateFile,Rename,Symlink}): use vld_modify_vnode() to update size
- (RXAFS_MakeDir): use new vld_adjust_linkcount(), vld_modify_vnode()
-
- * lib/vld/mdir.c (mdir_{creat,remove,mkdir}): use mnode_update_size()
-
- * lib/vld/mnode.h: added mnode_update_size(),
- mnode_update_size_cached()
-
- * lib/vld/mnode.c: added mnode_update_size(),
- mnode_update_size_cached() (moved from vld.c)
-
- * lib/vld/vld.h: remove vld_update_size(),
- vld_update_size_cached() vld_adjust_linkcount() now takes an mnode
-
- * lib/vld/vld.c (vld_create_entry): set DataVersion to current
- time
- (vld_adjust_linkcount): take the mnode as arg, update it properly too
- (vld_update_size, vld_update_size_cached): renamed and moved to mnode.c
- (vld_{fent,dent}_to_fetchstatus): use mnode_update_size_cached()
- (vld_modify_vnode): use only non-null arguments, update DataVersion & Length
-
- * lib/msecurity/netinit.c (network_init): don't overwrite cached
- realm
-
-2000-07-24 Love <lha@stacken.kth.se>
-
- * fs/fsprocs.c (RXAFS_StoreACL): break callback
- (RXAFS_Rename): break new parent is needed, don't break child
-
-2000-07-22 Love <lha@stacken.kth.se>
-
- * appl/sked/sked.c: more userfriendly, prime for hash, debug
- example.
-
- * lib/voldb/voldb.c (voldb_del_entry): remove bogus assert
- * lib/voldb/vol.c (vol_create): gc unused variable, don't remove
- the file when failing to store data.
- * lib/voldb/vdb_flat.c (vdbflat_del_entry):L remove bugus assert,
- reset even more values.
-
- * lib/vld/vld.c: use already defined macros, fix some bugs.
- * lib/vld/salvage.c: use already defined macros, fix some bugs.
-
-2000-07-21 Love <lha@stacken.kth.se>
-
- * bos/*: move out bosserver proc
-
- * appl/sked/Makefile.in: include debugging
- * appl/sked/sked.c: Added salvage command, fixed debugging
-
- * include/mdebug.h: more debug stuff
-
- * lib/voldb/voldb.c:(voldb_get_volume): remove bogus assert
-
- * lib/dpart/dpart.[ch]: (dp_parse): new function
- (dp_getpart): new function
- (dp_create): make work for large partitions
-
- * fs/fsrv_locl.h: include <salvage.h>
- * fs/fileserver.c:move logging stuff, salvage rename, unsigned printing
- * fs/Makefile.in: remove salvage.c
- * fs/salvage.c: move to lib/vld
-
- * lib/vld/debug.c: moved mdebug stuff here.
- * lib/vld/salvage.[ch]: move here from fs/, made it work
- * lib/vld/Makefile.in: move salvage.c here from fs/salvage.c
- make it work even more
- * lib/vld/Makefile.in: Added salvage.c
-
-2000-07-16 Love <lha@stacken.kth.se>
-
- * pts/ptserver.c: removed unused stuff, added more static's, redid
- opening of db.
- * lib/voldb/voldb.c (voldb_get_entry): make it work for TYPE_LINK
- (voldb_get_volume): new function to fetch volume-number
- * lib/voldb/voldb.h (voldb_get_volume): new function to fetch
- volume-number
-
-2000-07-15 Tomas Olsson <tol@stacken.kth.se>
-
- * lib/ropa/ropa.h: add ropa_drop_callbacks() new interface for
- ropa_break_callback()
- * lib/ropa/ropa.c: logging stuff
- (break_ccpair): delete from callback´s ccpairs
- (break_callback): new argument break_own, break own callback only if set
- (ropa_break_callback): new arg break_own, don´t return if unknown client
- (ropa_drop_callbacks): added.
- * fs/fsprocs.c (RXAFS_StoreData): don´t check offset/len, more
- logging, break callback
- (RXAFS_StoreStatus): break callback
- (removenode, RXAFS_CreateFile): break callback for directory as well
- (RXAFS_Rename): use afs_dir_p(), break callbacks
- (RXAFS_Symlink): more logging, break callback for directory, set mode bits correctly
- (RXAFS_Makedir): callbacks handling
- (RXAFS_GiveUpCallBacks): use ropa_drop_callbacks()
- * lib/ropa/Makefile.in: -I for mlog, mdebug
- * include/mdebug.h: add MDEBROPA
- * fs/fileserver.c: add --debug=ropa, MDEBROPA
- * appl/sked/sked.c (volls_cmd): make it almost work
-
-2000-07-02 Tomas Olsson <tol@stacken.kth.se>
-
- * README: add some info about -cell
- * lib/dpart/dvol.c: unused, removed
- * lib/ropa/ropa.h: new ropa_break_callback() prototype
- * lib/ropa/ropa.c (*): define & use ROPA_MTU
- (callbacks_cmp): return 0 only when equal
- (client_update_interfaces): also consider host-IP from call
- (client_init): call client_update_interfaces() new way
- (ropa_getcallback): call client_update_interfaces() new way,
- fix callback-list handling
- (ropa_break_callback): reorder arguments
-
-2000-06-24 Love <lha@stacken.kth.se>
-
- * lib/ropa/ropa.c (clear_addr): clear a address
- (client_deref): don't memset client.addr[]
- (client_update_interfaces): use clear_addr
-
-2000-06-24 Harald Barth <haba@pdc.kth.se>
-
- * README: spell
- * lib/ropa/ropa.c: port in ropa_client structure is in network
- byte order and therefore no conversion when calling
- rx_NewConnection.
- * fs/fileserver.c: Added flag for forced salvage
- * README: more info about starting servers
-
-Fri Jun 23 21:06:29 2000 Tomas Olsson <tol@pizza.stacken.kth.se>
-
- * lib/ropa/ropa.c, lib/vld/vld.c: NULL test
- * lib/voldb/voldb.c, lib/voldb/voldb.h: make afs_dir_p work
-
-Thu Jun 22 17:21:06 2000 Tomas Olsson <tol@pizza.stacken.kth.se>
-
- * lib/vld/vld.c (vld_create_entry): clean up on error
- (vld_set_onode, vld_adjust_linkcount, vld_open_vnode,
- vld_modify_vnode, vld_put_acl, vld_remove_node): use afs_dir_p()
- (vld_create_volume): don't close fd again
- (vld_register_vol_type): fix check
-
- * lib/voldb/voldb.c: rewrite conversion routines
- (voldb_init): fix typo
- (voldb_close): don't close fd again
-
- * lib/voldb/voldb.h: added afs_dir_p()
-
- * lib/voldb/vdb_flat.c (vdbflat_init): more sane checks & cleanup
- on error
- (vdbflat_close): close fd.
- (vdbflat_extend_db): fix sanity checks
- (vdbflat_del_entry): fix checks
-
- * vldb/vled.c: include limits.h
-
- * bos/bosserver.c: added BOZO_SetStatus()
-
-2000-06-05 Love <lha@s3.kth.se>
-
- * lib/ropa/ropa.c (client_update_interfaces): don't memset that
- wildly
- (clients_hash_ip): remove somewhat bogus assert
- (client_query): move assert here
- * bos/bosserver.c: update to new ydr code
- * appl/perf/perf.c: update to new cb code
-
-2000-06-04 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * fs/connsec.c: (fs_connsec_idtoname): handle null error strings
-
-2000-06-02 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * fs/salvage.c: volume numbers are unsigned
-
- * lib/voldb/vol.c (vol_create): set inUse and destroyMe
-
- * lib/vld/vld.h: transactions
-
- * lib/vld/vld.c: transactions
-
- * fs/volprocs.c: added transactions
-
- * fs/fsprocs.c (fs_init_req): Check busy
-
- * fs/fileserver.c (main): set progname
-
-2000-05-27 Love <lha@s3.kth.se>
-
- * lib/ropa/ropa.c (heapcleaner): remove the ccpair from the
- callback's list of callbacks
- (struct ropa_ccpair): cb_li, pointer to li on callback
- (add_client): store where the cc is stored in the callbacks list
- of cc's
- (break_ccpairs): remove the ccpair from the callback's list of
- callbacks
-
- * bos/kconf.[ch]: files stolen and changed from ej (that stole
- them from heimdal)
-
- * lib/ropa/ropa.c: removed borken paranoia, new paranoia, extended
- paranoia, fixed bugs, made it almost work.
-
- * include/mdebug.h (MDEBFS): added
-
- * lib/vld/mnode.c (mnode_cmp): made it work
- (mnode_remove): new function, remove a node from the cache
-
- * fs/salvage.c: fix logging, fix multiple parents, fix logging to
- wrong level
-
- * fs/fsprocs.c (*): added some simple debugging, make directory
- operations more paranoid of the input vnode, make removal
- operations clean mnode cache
- (rm,rmdir,mv)
-
- * fs/fileserver.c (milko_deb_units): added fs debuglevel
-
- * appl/perf/perf.c (cmcb_init): made static
-
-2000-05-25 Love <lha@s3.kth.se>
-
- * vldb/vled.c (*): update to new vldb_print_entry
- * vldb/vldb_locl.h (vldb_print_entry): update prototype
- * vldb/vl_db.c (vldb_print_entry): long version with
- server-addresses
-
- * lib/vld/common.c: local_opaque2ino: don't export
-
- * lib/msecurity/netinit.c (server_get_cred): more type
-
- * README: expand even more
-
-2000-05-24 Harald Barth <haba@puffin.pdc.kth.se>
-
- * README: Explain afs@REALM principal better
-
-2000-05-02 Tomas Olsson <tol@fredrika-bremer.stacken.kth.se>
-
- * appl/perf/perf.c (do_createfilecontent): update to new StoreData
-
-2000-05-01 Tomas Olsson <tol@stacken.kth.se>
-
- * arla/milko/fs/fsprocs.c: (RXAFS_FetchACL): return negative ACL:s
- as well
- (RXAFS_BulkStatus): immediate return if vld_check_rights() fails
-
-2000-05-01 Magnus Ahltorp <ahltorp@nada.kth.se>
-
- * vldb/vldbserver.c: Spellfix, (main): call set_progname
-
-2000-04-30 Assar Westerlund <assar@sics.se>
-
- * fs/fsprocs.c (RXAFS_StoreData): update to new StoreData
- * fs/fsprocs.c: update fdir_changefid. adapt.
-
-2000-04-28 Love <lha@s3.kth.se>
-
- * lib/vstatus/vstatus.c (vstatus_print_onode): unconfuse printing
- of o->data
-
-2000-03-20 Love <lha@s3.kth.se>
-
- * lib/ropa/ropa.c (callback_ref): use the right list
-
-2000-03-19 Love <lha@s3.kth.se>
-
- * fs/fileserver.c(usage): print usage in gnu-style too
-
-2000-03-09 Love <lha@s3.kth.se>
-
- * lib/vld/vld.c: (vld_open_vnode): get cached test right.
- (iter_vol): typecast to right struct
-
- * fs/salvage.c: more paranoia
-
-2000-03-06 Love <lha@s3.kth.se>
-
- * lib/vld/vld.c (iter_vol): ref volumes during call to `func'
-
- * fs/salvage.c (tree_connectvity): make volume-db's uptodate,
- don't free volume, since it isn't ref:ed
-
- * lib/vld/vld.c (vld_iter_vol): pass the right argument
-
-2000-03-05 Love <lha@s3.kth.se>
-
- * */*: mlogging and some basic salvager
-
- * include/mdebug.h: debug constants for milko
-
- * lib/mlog/mlog.[ch]: logging subsystem
-
-2000-03-04 Love <lha@s3.kth.se>
-
- * lib/voldb/{voldb.c,vdb_flat.c}: use only mmap, change who is
- resonsible for writing down header to disk.
-
- * lib/vld/vld.c(vld_create_volume): close is done in VOLOP(close)
- (vld_check_right): stop permitting the client to do anything when
- ptserver is down.
-
- * appl/sked/sked.c: restructure due to changes in voldb/vldb
-
-2000-02-27 Love <lha@s3.kth.se>
-
- * vldb/vled.c: some more edlike functionallity, added print,
- backup and search
-
- * vldb/vldbserver.c (*): some cleaning
-
-2000-02-22 Love <lha@s3.kth.se>
-
- * lib/voldb/vdb_flat.c: added prototypes
-
- * lib/vld/vld.h: added prototypes
-
- * lib/vld/vld.c: added prototypes
-
- * lib/vld/glue.c (add_entry): added special handling for files
-
- * lib/vld/fvol.h: added fvol_offset2opaque
-
- * lib/vld/fvol.c: clear out the most obvious bugs
-
- * lib/ropa/ropa.h: update ropa_getcallback added some missing
- prototypes
-
- * lib/ropa/ropa.c: clear out the most obvious bugs
-
- * fs/fsprocs.c (*): fix arguments for ropa_getcallback
-
-2000-02-19 Love <lha@s3.kth.se>
-
- * fs/fileserver.c: init LWP since ropa needs it
-
- * fs/fsprocs.c: remove old traces of ropa, and small bug fixes
-
- * lib/msecurity/netinit.c: Try also afs.realm@REALM
-
- * lib/vld: Moved the [sf]vol stuff here
-
- * lib/vld/vld.[ch]: add vld_set_onode
-
- * dumbclient/*: replaced by perf
-
-1999-11-03 Love <lha@s3.kth.se>
-
- * vldb/vldbserver.c (main): move port initlization later.
- (open_db): added what filed we failed to open.
- (vldbserver_create): add what database we are creating.
-
- * appl/bootstrap/boot-strap.sh.in: Add support for the
- pts, vldb and srvtab creation.
-
- * vldb/vldbserver.c (*): break out the creating of the database
- and opening of it, add a flag to make that you tell the server to
- explicit only create the database.
-
- * pts/ptserver.c (*): break out the creating of the database and
- opening of it, add a flag to make that you tell the server to
- explicit only create the database.
-
- * appl/sked/sked.c (*): create a global varibale interactivep and
- a macro INTER_RETURN() and start to use it. This enables us to
- give a sane exit-code when running in command-line-mode.
-
- * appl/bootstrap: Added shellscript to bootstrap
-
- * fs/fsprocs.c (RXAFS_BulkStatus): first implemtation using mnode
- interface XXX
-
- * lib/vld/vld.c (vld_create_entry): if directory, set acl
- (vld_create_entry): memset acl, add dummy entry for anonymous
-
- * lib/voldb/voldb.c (voldb_pretty_print_dir): more pretty
- printing.
-
- * pts/pr.c (PR_IDToName): when failed to find name in database
- print number instead of the empty string.
-
- * lib/voldb/Makefile.in: added vstatus
-
- * fs/fsprocs.c (RXAFS_{Symlink,MakeDir,CreateFile}): use new
- vld_create_entry()
- * fs/Makefile.in: added vstatus
-
- * lib/vstatus/vstatus.h: Added wrapper #ifdef/#endif
- (vstatus_print_onode): new function.
-
- * lib/vstatus/vstatus.c (vstatus_print_onode): new function.
-
- * lib/voldb/voldb.h: Added <vstatus.h> Removed <vstat.h>
-
- * lib/voldb/voldb.c (voldb_flush): let the lower layer do the
- flush
- (*print_print*): again print the onode_opaque
-
- * lib/voldb/vdb_flat.c (*): changed how we find where to write the
- bits
- (*): removed #if 0 code, and finally fixed some bugs.
-
- * lib/svol/Makefile.in (INCLUDES): add
- -I$(srcdir)/../../lib/vstatus
-
- * appl/sked/sked.c (show_volume): print vnode
-
- * appl/sked/Makefile.in (INCLUDES): add
- -I$(srcdir)/../../lib/vstatus
-
- * lib/vld/vld.h (vld_create_entry): changed signature.
-
- * lib/vld/vld.c (vld_create_entry): changed parent fid to a mnode
- to be able to copy the acl when its a dir.
-
-1999-11-02 Love <lha@s3.kth.se>
-
- * fs/Makefile.in(INCLUDES): Add ../lib/vstatus
-
- * appl/sked/sked.c: don't print inode numbers.
-
- * lib/vld/vld.c(*): converted fully to opaque
-
- * lib/svol/svol.c: random fixes to make it build
-
- * lib/voldb/voldb.h: Add <vstat.h>
-
- * lib/voldb/vdb_flat.c (*): Added length pointers.
-
- * lib/voldb/Makefile.in (INCLUDES): add ../vstatus
-
- * lib/voldb/voldb_internal.h (voldb_type): make del_entry right
- type.
-
- * lib/svol/svol.c: use opaque
-
- * lib/voldb/voldb.c (voldb_get_size): new function. don't print
- the opaque structure.
-
- * lib/voldb/voldb.h: use opaque structure.
-
- * lib/vstatus/vstatus.c: remove comment.
-
-1999-11-02 Magnus Ahltorp <map@stacken.kth.se>
-
- * fs/fsprocs.c (RXAFS_FetchACL): Implement
- (RXAFS_StoreACL): Implement
- (RXAFS_MakeDir): Inherit ACL from parent
-
- * fs/connsec.[ch] (fs_connsec_nametoid): Added
- (fs_connsec_idtoname): Added
-
- * pts/pr.c (PR_GetCPS): Authenticated user is always member of
- system:anyuser and system:authuser
-
- * pts/ptserver.c (prserver_init): Add system:anyuser and
- system:authuser when creating the database
-
- * lib/voldb/voldb.h: Move struct acl_entry out of the
- voldb_dir_entry struct
-
- * lib/vld/vld.[ch] (vld_create_volume): put "system:authuser rl"
- acl entry into root node
- (vld_check_rights): use msec, check negacl, check rights more
- correctly
- (vld_put_acl): Added
-
-1999-10-24 Love <lha@s3.kth.se>
-
- * lib/vld/vld.c (vld_db_uptodate): dont close fd's, any add
- comment why
-
- * lib/vld/vld.c (vld_db_uptodate): close fd's when needed, set
- pointer to NULL when failing, add comment about bringing volume
- offline
-
-1999-10-23 Magnus Ahltorp <map@stacken.kth.se>
-
- * lib/voldb/vdb_flat.c (vdbflat_put_acl): put acl at correct
- position
-
-1999-10-22 Magnus Ahltorp <map@stacken.kth.se>
-
- * fs/connsec.h: Remove fs_connsec_newconn
-
- * fs/connsec.c: Get CPS
-
- * lib/msecurity/msecurity.[ch] (sec_getname): Call with
- rx_connection instead of rx_call
-
- * pts/ptserver.c: Bring ptserver init up-to-date
-
- * pts/Makefile.in: Added MILKO_SYSCONFDIR
-
- * fs/Makefile.in: Added libacl and libptclient
-
- * fs/fsrv_locl.h: Include getarg.h
-
- * fs/fileserver.c (main): Added getarg support, removed connection
- creation routine
-
- * fs/fsprocs.c (RXAFS_Symlink): fd is not closed by fbuf_end
-
- * lib/msecurity/netinit.[ch] (server_get_cred): Added
-
-1999-10-19 Magnus Ahltorp <map@stacken.kth.se>
-
- * fs/fsprocs.c (*): pass around msec instead of prlist
- (fs_init_msec): get security context
- (RXAFS_FetchACL): return bogus acl
- (removenode): adjust correct link count, clear ep
- (RXAFS_*): return correct FetchStatus
- (RXAFS_Rename): handle move to existing files
-
- * fs/fsrv_locl.h: Added connsec.h
-
- * fs/fileserver.c (main): register connection {new, destroy}
- functions
-
- * fs/Makefile.in: Added connsec.o
-
- * lib/vld/mnode.h: Added struct fs_security_context
-
- * lib/vld/mdir.c (mdir_mkdir): update length
-
- * lib/vld/vld.h (vld_create_entry): pass around msec instead of prlist
- (vld_create_directory): remove prototype
-
- * lib/vld/vld.c (*): pass around msec instead of prlist
- (vld_set_author): add function
- (vld_create_entry): optionally return child mnode, set
- various status fields
- (vld_storestatus_to_?ent): don't update ServerModTime
- (vld_check_rights): change from bogus unix bits to correct
- afs access bits
- (vld_modify_vnode): don't assert on admin bits when only
- changing size, force setting of fs
-
- * fs/connsec.h: Added.
- * fs/connsec.c: Added.
-
-1999-10-18 Magnus Ahltorp <map@stacken.kth.se>
-
- * milko/lib/voldb/voldb.c: Updated comments.
-
-1999-10-16 Magnus Ahltorp <map@stacken.kth.se>
-
- * milko/lib/voldb/voldb.[ch]: Added voldb_update_time.
-
-1999-10-15 Love <lha@s3.kth.se>
-
- * lib/vld/vld.c (vld_check_rights): remove over paranoid assert()
-
- * lib/voldb/voldb_internal.h (voldb_put_file): put file and not
- get.
-
- * lib/vld/vld.c (vld_create_entry): set type of e.
-
- * lib/vld/vld.[ch] (vld_check_accces): return errno instead of Bool
-
- * lib/vld/vld.c (vld_open_vnode): get getting data, remember to
- set flag.
-
- * lib/vld/vld.c (vld_update_size_cached,
- vld_{d,f,}ent_to_fetchstatus): assert on right things
-
- * lib/vld/vld.c (vld_open_vnode): use the voldb entry in n.
-
- * lib/vld/mnode.c (mnode_init): fixed common if (foo) bug
-
- * appl/sked/sked.c (main): init mnode support.
-
- * pts/pr.c: move <assert.h> to avoid collision with <rxkad.h>
-
- * lib/voldb/voldb_locl.h: added <fs.h>
-
- * lib/voldb/voldb_internal.h: inline some functions.
-
- * lib/voldb/voldb.h (*): merge voldb_get_{dir,file} to
- voldb_get_entry, added negative acl's
-
- * lib/voldb/voldb.c (*): merge voldb_get_{dir,file} to
- voldb_get_entry
-
- * lib/voldb/vdb_flat.c (*acl*): add negative acl
-
- * lib/vld/vld.c (*): new style mnode
-
- * lib/vld/Makefile.in: no more separate mdir, moved here instead
-
- * lib/svol/svol.c: printf mangleing and newstyle mnode
-
- * lib/msecurity/netinit.[ch] (network_init): request should return a
- int32_t
-
- * lib/msecurity/msecurity.c: move <assert.h> to avoid collition in
- <rxkad.h>
-
- * lib/Makefile.in (SUBDIRS): no more mdir
-
- * fs/fsrv_locl.h: Added <mdir.h>
-
- * fs/fsprocs.c (*): new style mnode
-
- * fs/Makefile.in: mdir have moved
-
- * appl/sked/sked.c: new mdir style, new mnode, disable ls command
- for now.
-
- * README: Random advice
-
-1999-09-26 Love <lha@s3.kth.se>
-
- * lib/vld/vld.h: clearified comment of backstores
-
- * README: we dont know anything about non-kth-krb telnet
-
- * lib/voldb/vdb_flat.c (vdbflat_del_entry): put data on freelist.
-
-1999-09-25 Love <lha@s3.kth.se>
-
- * README: Added comments about vld and voldb
-
- * fs/fsprocs.c (*): fbuf related bugs fixed.
-
- * fs/fileserver.c (sigusr1): exit with 2
-
- * lib/mdir/mdir.c: fix fbuf related bugs
-
- * lib/vstatus/vstat.xg (vstatus): add voldbtype
-
- * **.[ch]: adapt to new voldb structure
-
- * lib/voldb/*.[ch]: break out voldb flat to make possible to
- use diffrent types of voldb:s
-
-1999-09-13 Love <lha@s3.kth.se>
-
- * bos/boserver.c: 'add some more functionality (like (stupid)
- configfile and mailing when things die.
-
-1999-09-10 Assar Westerlund <assar@sics.se>
-
- * vldb/vldbserver.c: add --noauth
-
- * pts/ptserver.c: add --noauth
-
- * bos/bosserver.c: add --noauth
-
- * lib/msecurity/msecurity.h (sec_disable_superuser_check): add
- prototype
-
- * lib/msecurity/msecurity.c (sec_disable_superuser_check): add
- (sec_superuser): check for disabled check
- (sec_add_superuser, sec_del_superuser): ifdef KERBEROS
-
- * lib/msecurity/netinit.c: handle !KERBEROS
-
- * vldb/ubikprocs.c: handle !KERBEROS
-
- * pts/pr.c: handle !KERBEROS
-
-1999-08-08 Assar Westerlund <assar@sics.se>
-
- * fs/fsprocs.c (RXAFS_BulkStatus): allocate StatArray and CBArray
-
-1999-07-15 Assar Westerlund <assar@sics.se>
-
- * pts/Makefile.in (LIBS): add kafs, to get krb_life_to_time :-(
-
- * fs/Makefile.in (LIBS): add kafs, to get krb_life_to_time :-(
-
- * bos/Makefile.in (LIBS): add kafs, to get krb_life_to_time :-(
-
- * dumbclient/Makefile.in (LIBS): add kafs, to get krb_life_to_time
- :-(
-
-1999-07-12 Magnus Ahltorp <map@stacken.kth.se>
-
- * fs/volprocs.c: Added
-
-1999-07-09 Marcus Sundberg <mackan@stacken.kth.se>
-
- * appl/sked/Makefile.in, bos/Makefile.in, fs/Makefile.in,
- pts/Makefile.in, vldb/Makefile.in: Add @PLWP_LIB_FLAGS@ when
- linking with -llwp.
-
-1999-07-04 Love <lha@s3.kth.se>
-
- * lib/voldb/voldb.c (voldb_pretty_print_{dir,file}): print unique
-
- * appl/sked/sked.c (volls_cmd): implement
- (volvnode_cmd): fix off-by-1 error re to voldb
-
- * appl/sked/Makefile.in (INCLUDE): Add mdir
-
-1999-07-04 Magnus Ahltorp <map@it.kth.se>
-
- * fs/fsprocs.c: Update the size of the symlink file
-
-1999-06-23 Love <lha@s3.kth.se>
-
- * fs/fsprocs.c: use new vld_create_*
-
- * lib/voldb/voldb.h(voldb_{file,dir}_entry: reclain spare1
-
- * lib/voldb/voldb.c(voldb_new_entry): Add unique
- (voldb_{put,get}_{dir,file}): use unique
-
- * lib/vld/vld.c:(vld_create_{file,dirctory}: Add unique.
-
- * lib/svol/svol.c: Added <rx/rx.h>
-
-1999-06-23 Assar Westerlund <assar@sics.se>
-
- * fs/fsprocs.c (RXAFS_StoreData): call copyrx2fd correctly
-
-1999-06-20 Assar Westerlund <assar@sics.se>
-
- * fs/fsprocs.c (RXAFS_StoreData): return EINVAL instead of
- asserting if given bad arguments
-
- * fs/fsprocs.c: de-mulify
- (RXAFS_FetchData): handle a_offset correctly
-
-1999-06-10 Love <lha@s3.kth.se>
-
- * appl/sked/sked.c: add <rx/rx.h> and <fbuf.h>, reset some vars
-
- * lib/vld/vld.c: (vld_create_directory): change place of . and
- .. to make it work
-
-1999-06-09 Love <lha@s3.kth.se>
-
- * lib/voldb/voldb.c: (voldb_del_entry): reset ino num,
- (voldb_pretty_print*): print ino in hex
-
- * README: Talk about CellServDB/ThisCell and run-tests
-
- * fs/fsprocs.c: use new vld_update_size_fbuf
-
- * lib/vld/vld.[ch]: vld_update_size -> \1_{fd,fbuf}
-
-1999-06-07 Love <lha@s3.kth.se>
-
- * bos/bosserver.c(main): use new network_kerberos_init.
-
- * vldb/vldbserver.c(main): use new network_kerberos_init.
-
- * lib/msecurity/Makefile.ini(DEFS): Add MILKO_SYSCONFDIR
-
- * lib/msecurity/netinit.c: (network_kerberos_init): use default if
- given a NULL
-
-1999-05-30 Love <lha@s3.kth.se>
-
- * fs/fsprocs.c (RXAFS_BulkStatus): the turn the < the right way,
- and reverse the previos patch
-
- * fs/fsprocs.c (RXAFS_BulkStat): only free volh if set
-
- * appl/sked/sked.c (*): Added new function volvnode that gives
- info about a volume (and the vnodes)
-
- * bos/bosserver.c: Added some comments
-
- * lib/vld/vld.c (*): start to use vol->flags.voldbp
-
- * lib/voldb/voldb.c (voldb_pretty_print_{file,dir}): new function
- (voldb_header_info): new function
-
- * fs/fsprocs.c (RXAFS_StoreData): return sane size
- (RXAFS_BulkStat) : XXX remove paranoid
-
- * bos/Makefile.in (DEFS) += MILKO_LIBEXECDIR
-
- * vldb/Makefile.in (DEFS) += MILKO_SYSCONFDIR
-
- * bos/bosserver.c (args) += added prefix
- (start_server) use prefix
-
- * vldb/vldbserver.c (vldbserver_init): Added arguemnt that tells
- where the vl_database is stored.
- (getargs) += prefix
-
- * Makefile.in(SUBDIRS): Added bos
-
- * bos/*: Added partial nonworking bosserver.
-
-1999-05-29 Love <lha@s3.kth.se>
-
- * fs/fsprocs.c (RXAFSStoreData,RXAFSFetchData): close fd after
- use.
-
-1999-05-28 Love <lha@s3.kth.se>
-
- * vldb/vldbserver.c: add option cell
-
- * fs/fsprocs.c(RXAFS_SymLink): Make it work (check if fil exist etc)
-
- * fs/fsprocs.c (RXAFS_SymLink): First version of symlink
- (RXAFS_CreateFile): Get right size of dir-node, remove child-node
- when failed to add direntry.
- (RXAFS_MakeDir): Get right size of parent-dir-node
-
- * lib/vld/vld.h(vld_create_file): add the type of entry
- (vld_[fd]ent_to_fetchstatus): use vld_update_size
- (vld_update_size): new function
-
- * lib/vld/vld.h (vld_create_file): add the type of entry
- (vld_update_size): new function
-
-1999-05-25 Love <lha@s3.kth.se>
-
- * lib/vld/vld.c (vld_storestatus_to_[fd]ent): use current time if
- SS_MODTIME isn't set
-
- * fs/fsrv_locl.h: <netinit.h> <msecurity.h> <ko.h>
-
- * pts/ptserver.c: remove common code and use network_init instead
-
- * vldb/vldbserver.c: remove common code and use network_init instead
-
- * fs/fileserver.c: remove common code and use network_init instead
-
- * fs/Makefile.in: msecurity
-
- * README: Kerberos comments
-
- * lib/msecurity/Makefile.in: Added netinit.[ch]
-
- * lib/msecurity/netinit.[ch]: Added, to start up a rxserver in a
- simple way.
-
-1999-05-19 Love <lha@s3.kth.se>
-
- * vldb/Makefile.in: gc, add msecurity,acl
-
- * vldb/vldbserver.c: Debugging, add sec_is_superuser()
-
- * lib/vld/vld.c (vld_create_directory,vld_create_file): use ino_t
- instead of int32_t
-
-1999-05-18 Love <lha@s3.kth.se>
-
- * vldb/vldbserver.c: break out of milko, start to use
- lib/ko/ports
-
- * lib/Makefile.in(SUBDIRS): add msecurity
-
- * pts/{pts.c,pr.c}: move to pts/, break out of milko.
-
- * lib/msecurity/msecurity.[ch]:move to milko/lib/msecurity, do
- kerberos patches, break out of milko
-
-1999-05-17 Love <lha@s3.kth.se>
-
- * Milko is dead, long live Milko
-
- * */*: Added filbunke - nnp-server-class fileserver
-
- * */*: FS releated things removed. vldb and pts things moved to
- separate directories.
-
-1998-11-08 Love <lha@s3.kth.se>
-
- * ontop_ff.xg: numacl.
-
- * ontop_subr.c: Dont loop twice in ontop_alloc_vnode if successful.
-
- * ontopfs.c: ontop_{fetch,store}acl
-
- * Makefile.in: added afsacl.
-
-1998-11-05 Love <lha@s3.kth.se>
-
- * ontopfs.c(ontop_init): run ontop_initworker().
-
- * ontop_subr.c: Added a thread that precreate vnodes when
- num(vnodes) of a volume gets low.
-
- * ontop_ff.xg(ontop_vnode): split free to oddfree and evenfree,
- add used
-
- * milko.c(main): Move init network to top.
-
-1998-11-04 Love <lha@s3.kth.se>
-
- * mbuf.c (malloc_create): do paranoid things about creation of a
- malloc_create.
-
- * ontop_subr.c: Breakout the creation of a vnode.
-
- * ontopfs.c (createentry): Update right vnode.
- (update_vnode): UnixModeBits & 0666
- (ontop_vnode2AFSStoreStatus): Add filetypebits by hand.
-
-1998-10-22 Love <lha@s3.kth.se>
-
- * fs.c (RXAFS_Link): Implement.
-
- * ontopfs.c: Use flags for createentry()/delete_entry().
- (ot_lookup): New function.
- (ontop_rename): Implement.
- (ontop_link): Implement.
-
- * ontop_subr.c: Use LinkCount when allocing and freeing vnodes.
-
- * README: Tell what filesystem might work.
-
-1998-10-21 Love <lha@s3.kth.se>
-
- * fileserver.h: Fixed prottypes for *link.
-
- * README: Fixed sentence about romedia.
-
- * ontopfs.c: (delete_entry): New common function for RemoveDir and
- RemoveFile.
- (ontop_removedir): Made use os delete_entry.
- (ontop_removefile): Implemeted using delete_entry().
- (create_entry): Fixed indenting bug.
- (ontop_symlink): Implemented.
-
- * fs.c: (RXAFS_RemoveFile): Implemented.
- (RXAFS_Rename): Implemented.
- (RXAFS_SymLink): Implemented.
-
-1998-10-15 Love <lha@s3.kth.se>
-
- * ontopfs.c: (ontop_putdate): Store file.
- (ontop_createfile): Implemented.
- (update_vnode): New function.
- (createentry): New function.
- (ontop_makedir): use createentry
-
- * ufsmedia.[ch]: Begining of code for FH support.
-
- * mbuf.h: Prototype for mbuf_resize().
-
- * mbuf.c: Implement reallen for malloced mbuf.
-
- * fs.c: Return more sane values for not implemented functions (EPERM).
- (RXAFS_CreateFile): Write downcall to fs-module.
-
- * filesystem.h: link and symlink.
-
- * fhget.[ch]: (fhtonum) and (numtofh): New functions
-
- * README: Added COMMENTS section.
-
- * Makefile.in: Clean out the autogenerated files.
-
-1998-10-12 Love <lha@s3.kth.se>
-
- * ontopfs.c: (ontop2afsrights) more bogus rights.
- (ontop_makedir): Free the right vnode.
- (ontop_removedir): new function (should use mdir_emptyp().
-
- * ontop_subr.c: Added function ontop_free_vnode() to free vnode.
-
- * mdir.[ch]: New function mdir_emptyp() that might work.
-
- * fs.c: Added code for ontop_removedir.
-
- * fileserver.h: Added prototypes/entries in struct filesystem for:
- storeacl, createfile, removefile, and fsrename.
-
- * README: Added note about filesystem.
-
-1998-10-09 Love <lha@s3.kth.se>
-
- * README: Added some text about the thingy.
-
- * ontop_subr.c: (ontop_store_types): add gotfh type.
- (openvnode): Open with fhget() if it exists.
- (ontop_create_vnode): If we have fhget() store the FH too.
-
- * ontop_ff.xg: changed ontop_vnode.storage to OPAQUE from VARRAY.
-
- * milko_locl.h: Add includefiles for fhget(), remove dbi.h forever.
-
- * milko.c: (main) Test if use have fh* with fhprobe().
-
- * fhget.[ch]: Stolen from arlad/fcache.c, and changed to fit milko
-
-1998-10-07 Love <lha@s3.kth.se>
-
- * ontopfs.c: Added support for mkdir.
-
-1998-10-06 Love <lha@s3.kth.se>
-
- * Got ontopfs to list . and .. for the first time.
-
- * Lost a bunch of entries in a disk-crash, maybe I should
- checkin the code a little bit more often.
-
-1998-09-06 Love <lha@s3.kth.se>
-
- * ufsmedia.c(ufs_putdata): - Added filelen and truncated file,
- - added check if fd is a directory.
-
- * fs.c: - Fixed prototype for RXAFS_Symlink.
-
- * fileserver.h: Added filelen to putdata.
-
-1998-09-04 Love <lha@s3.kth.se>
-
- * ontofs.c: Started to write the filesystem that will live
- on top of another.
-
-1998-09-03 Love <lha@s3.kth.se>
-
- * First time RDWR support, but stil lacking all dir-ops.
-
- * libmsys/t.c: Test program for milkosys.
-
- * db/t.c: Testprogram for dbi interface.
-
- * db/dbi.c: a generic db interface.
-
- * db/db.c: db interface to dbi.
-
- * vldbserver.c: New file, broke out of fs.
-
- * volcommon.c: New file, functions common from volser and fs.
-
- * volser.c: New server (to be able to fool vos).
-
- * service.h: Added more services.
-
- * ufsmedia.c: Added writesupport, still no auth.
-
- * fs.c: Added code for StoreStatus, StoreData and GetTime.
-
- * Makefile.in: Added some new files and targets.
-
- * libmsys/msys.c: Added findmilkosyscall() and istatpath().
-
-1998-09-01 Love <lha@s3.kth.se>
-
- * ufsmedia.c: Reworked bake_afsdir.
-
- * sys/modsys.c: Added a new subcall, istatpath.
-
-1998-08-27 Love <lha@s3.kth.se>
-
- * s/vldb.c/vldbserver.c/: Broke out of the generic server.
- Added dbi support.
-
- * db/db.h: A interface for the db interface.
-
- * db/dbi.[ch]: Added, a generic interface to databases.
-
-1998-08-10 Love <lha@s3.kth.se>
-
- * sys/msc.h: Added.
-
- * sys/modsys.c: Added, the FreeBSD milko-syscall.
-
- * libmsys/msys.h: Added, prototype.
-
- * libmsys/msys.c: Added, lib for the milkosyscall.
-
- * libmsys/t.c: Added, testprogram for the lib.
-
- * ufsmedia.c: Added, export your ufs filesystem. ro, no security.
-
- * volser.c: Added ufs_filesystemtest. (really need config-file)
-
- * vldb.c: Moved ipaddress (really need vldb &| config-file)
-
- * romedia.c: Const'ize.
-
- * milko_locl.h: Added a bunch of new headfiles.
-
- * mdir.c(mdir_mkdir): Made sure ret has a sane value.
-
- * mbuf.c(mcopybuf2rx): Fixed bugs.
-
- * fs.c: Cleaned up and fixed warnings.
-
- * fileserver.h: Added some more vop's and const'ized.
-
- * fileserver.c: Added FILESYSTEM_UFS
-
- * Makefile.in: cleaned up and and added FILESYSTEM_UFS
-
-Mon Jul 13 21:37:28 1998 Assar Westerlund <assar@sics.se>
-
- * dumbclient/Makefile.in: compat with stupid makes
-
- * Makefile.in: compat with stupid makes
-
-1998-06-26 Love Hornquist-Astrand <lha@junkyard.stacken.kth.se>
-
- * fs.c(RXAFS_FetchData): Fix NULL check.
-
- * romedia.c(rom_init): Don't open the database rw.
- (romi_getstatus): Parse input w/o sscanf()
-
- * volser.c(volser_init): Added static configation (need conffile soon)
- (volser_addVolume): Fix init
-
- * romedia.c,roindex.c: Added support for dates,
- no more 201450000 dates :(
-
- * mbuf.c: Added support for malloc mbufs.
-
- * Makefile.in: Fixed building and installing.
-
-1998-06-20 Love <lha@s3.kth.se>
-
- * disklayer.h: Dont know if this is enough.
-
-1998-06-08 Love <lha@s3.kth.se>
-
- * Added filserver.c
-
- * *.c: Started to use define FILESYSTEM_READONLY
-
- * volser.c (*): Fixes and bring uptodate.
-
diff --git a/usr.sbin/afs/src/milko/Makefile.in b/usr.sbin/afs/src/milko/Makefile.in
deleted file mode 100644
index 34918ddba61..00000000000
--- a/usr.sbin/afs/src/milko/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-# $KTH: Makefile.in,v 1.49 2000/10/08 06:22:04 lha Exp $
-
-srcdir = @srcdir@
-top_builddir = ..
-VPATH = @srcdir@
-
-SHELL = /bin/sh
-
-SUBDIRS = lib appl fs vldb pts bos
-
-all:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-clean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-realclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-distclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-mostlyclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-install:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-uninstall:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-Makefile: Makefile.in ../config.status
- cd .. ; CONFIG_FILES=milko/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-.PHONY: all clean realclean distclean mostlyclean install uninstall
diff --git a/usr.sbin/afs/src/milko/README b/usr.sbin/afs/src/milko/README
deleted file mode 100644
index 1e4364256ae..00000000000
--- a/usr.sbin/afs/src/milko/README
+++ /dev/null
@@ -1,196 +0,0 @@
- Milko ($arla: README,v 1.29 2001/04/28 12:54:41 lha Exp $)
-=====
-
-Note:
- milko is still highly experimental, and is neither stable nor
- full-featured.
-
-* Parts
-
- fs - FileServer
- vldb - Volume Location DataBase-server
- pts - ProTection-Server
- appl/sked - maintaining volumes the hard way
-
- lib/dpart - partition parsing and handling
- lib/mdir - directory handling (unused ?)
- lib/svol -
- lib/vld - volume,voldb<->afs interfrace.
- This would also be the place where to
- add caching of ``vnodes'', manybe fbuf's too.
- contains the simple (stupid) volume
- and ro-volume.
- lib/voldb - file and directory vnode db.
- There is today one backend of voldb: vdb_flat
- vdb_flat is a flat-db to store inodes. Not very
- smart, but should be efficent enough.
- lib/vstatus - the volume-node
-
-* Installation
-
- 1. Create a /vicepa in whatever way
-
- 2. CellServDB and ThisCell
-
- Add your cell to $PREFIX/etc/CellServDB and make it the default
- cell by adding to to $PREFIX/etc/ThisCell.
-
- 3. If you have Kerberos (you really should have, because it is not
- tested without).
-
- This text assumes kth-krb.
- [If you want support for another kerberos, modify/add apropriate text]
-
- Get a srvtab for afs@YOUR.REALM, or if you want to use a "subcell"
- use afs.your.subcell@YOUR.REALM, where your.subcell is the instance.
- I you don't already have one, ksrvutil will create a principal
- afs@YOUR.REALM for you. Put the srvtab i $PREFIX/etc/srvtab
- (really $sysconfdir). Note the empty string '' when you input the
- Kerberos instance below.
-
- datan:~$ /usr/athena/sbin/ksrvutil -p lha.admin -f /usr/arla/etc/srvtab get
- Name [rcmd]: afs
- Instance [datan]: ''
- Realm [MY.REALM]:
- Is this correct? (y,n) [y]:
- Add more keys (y,n) [n]:
- Password for lha.admin@MY.REALM:
- Added afs@MY.REALM
- Old keyfile in /usr/arla/etc/srvtab.old.
-
- Verify that you got you principal right
-
- datan:~$ ksrvutil -f /usr/arla/etc/srvtab list
- Version Principal
- 2 afs@MY.REALM
-
- Add your "afs admin instance" to the $PREFIX/etc/superuserlist
- file. This can be whatever you like, but has been in most cases
- .admin (or .root depending on local religion).
-
- Get your "afs admin instance".
-
- datan:~$ kauth lha.root
- lha.root@MY.REALM's Password:
-
- Verify that you get an afs token
-
- datan:~$ afslog -c my.cell
- datan:~$ klist -v
- Ticket file: /tmp/tkt0
- Principal: lha@MY.REALM
-
- Issued Expires Principal (kvno)
- May 25 03:07:02 May 25 13:07:02 krbtgt.MY.REALM@MY.REALM (1)
- May 25 03:06:49 May 25 13:06:49 afs@MY.REALM (2)
-
- Note that the ``afs'' key also can be named ``afs.my.cell''.
- Its imperative that the key versions (kvno) match up.
-
- 4. Start vldb-server.
-
- It will NOT create a databasefile (vl_database) if missing.
- The first time you have to run the vldbserver with -create
- as an argument.
-
- datan:~/obj/arla/milko/vldb# gdb -q vldbserver
- (gdb) r
- Starting program: /home/lha/obj/milko/vldb/vldbserver
- Milko vldbserver 0.26 started
-
- The vldbserver can be used with -noauth for testing purposes.
-
- 5. Add root.afs to vldb
-
- You have to use arla's vos.
-
- datan:~$ vos createentry -id root.afs -host myhost \
- -fsserver myhost -part /vicepa -rw 3
-
- If you use afs.my.cell@MY.REALM (not afs@MY.REALM), you
- have to add ``-cell my.cell'' to the above command line.
-
- 6. Create volume root.afs on disk
-
- datan:~obj/milko/appl/sked# ./sked volcreate /vicepa 3 root.afs
- volume 3 created successfully
-
- 7. Start ptserver
-
- datan:~obj/milko/fs# gdb -q ptserver
- (gdb) r
- Starting program: /home/lha/obj/milko/pts/ptserver
-
- If you need to initialize the pts database, use ptserver -create.
-
- 8. Start fileserver
-
- datan:~obj/milko/fs# gdb -q fileserver
- (gdb) r
- Starting program: /home/lha/obj/milko/fs/fileserver
- fileserver booting
- fileserver started, serving data
-
- Handy args which can be given to fileserver (check with
- fileserver --help):
- --noauth (for testing)
- --log=file (instead of logging to syslog)
- --debug=all|errors|warnings|voldb|vld|salvage|fs
- --cell=cellname
-
- 9. bosserver
-
- After running make install you can use $PREFIX/libexec/bosserver
- to start both the vlserver, ptserver and fileserver.
-
- 10. run-tests
-
- Run run-tests in tests/, WORKDIR=/afs ./run-tests -milko -all
-
- 11. Now what ?
-
- Find bugs, and report them to <arla-drinkers@stacken.kth.se>.
-
-* Profiling
-
- If you want profiling information, add -pg (gcc) to CFLAGS, LDFLAGS and
- recompile.
-
- When you feel you're done, send the fileserver a USR1 and look for the
- gprof.out in /vicepa.
-
-* Advice
-
- Documentation how things works is included in the sourcecode.
-
- There should be a notice in the top (after the copyright blub)
- that will give you a general idea what the module (should) do.
-
- Each function should be documented in the comment above the function,
- where each argument is described. Any simple/complex/no-trivial
- locking event should be documented.
-
- If you see any assert()s in the top of the function (just after
- the local variables) they are PART OF the documentation. See
- example [1] below. This makes it easier to find interface
- changes and other brainlossage.
-
- If you find something that is undocumented, write documentation!
- If you find documentation that is invalid, rewrite!
-
- I'm told the documentation in c-code isn't enough. Guess there
- should be a greater plan.
-
-[1]
- Here is an example that the function foo() requires that bar
- is set. It isn't written in the comment field, instead
- its checked runtime.
-
- int
- foo (int *bar)
- {
- int baz;
-
- assert (bar);
- return 0;
- }
diff --git a/usr.sbin/afs/src/milko/appl/Makefile.in b/usr.sbin/afs/src/milko/appl/Makefile.in
deleted file mode 100644
index b6011b9bfb1..00000000000
--- a/usr.sbin/afs/src/milko/appl/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-# $KTH: Makefile.in,v 1.4 2000/10/08 06:22:11 lha Exp $
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-SHELL = /bin/sh
-
-SUBDIRS = sked perf
-
-all:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-clean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-realclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-distclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-mostlyclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-install:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-uninstall:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-Makefile: Makefile.in ../../config.status
- cd ../.. ; CONFIG_FILES=milko/appl/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-.PHONY: all clean realclean distclean mostlyclean install uninstall
diff --git a/usr.sbin/afs/src/milko/appl/bootstrap/Makefile.in b/usr.sbin/afs/src/milko/appl/bootstrap/Makefile.in
deleted file mode 100644
index 565f43fcd91..00000000000
--- a/usr.sbin/afs/src/milko/appl/bootstrap/Makefile.in
+++ /dev/null
@@ -1,59 +0,0 @@
-# $KTH: Makefile.in,v 1.2 2000/10/08 06:22:18 lha Exp $
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_builddir = ../../..
-VPATH = @srcdir@
-
-CC = @CC@
-RM = rm
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-sbindir = @sbindir@
-transform = @program_transform_name@
-
-PROGS = boot-strap.sh anti-boot-strap.sh
-
-all: $(PROGS)
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) -I../../../include -I$(srcdir)/../../../include $<
-
-clean:
- $(RM) -f $(PROGS) startarla *.o *~
-
-boot-strap.sh: boot-strap.sh.in
- cd ../../.. ; CONFIG_FILES=milko/appl/bootstrap/boot-strap.sh CONFIG_HEADERS= $(SHELL) config.status
- chmod +x $@
-anti-boot-strap.sh: anti-boot-strap.sh.in
- cd ../../.. ; CONFIG_FILES=milko/appl/bootstrap/anti-boot-strap.sh CONFIG_HEADERS= $(SHELL) config.status
- chmod +x $@
-
-Makefile: Makefile.in ../../../config.status
- cd ../../.. ; CONFIG_FILES=milko/appl/bootstrap/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(sbindir)
- PROG_SBIN='$(PROGS)'; for x in $$PROG_SBIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(sbindir)/$$f; \
- done
-
-uninstall:
- PROG_SBIN='$(PROGS)'; for x in $$PROG_SBIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(sbindir)/$$f; \
- done
-
-.PHONY: all install uninstall clean
diff --git a/usr.sbin/afs/src/milko/appl/bootstrap/anti-boot-strap.sh.in b/usr.sbin/afs/src/milko/appl/bootstrap/anti-boot-strap.sh.in
deleted file mode 100644
index 1a0a9a01788..00000000000
--- a/usr.sbin/afs/src/milko/appl/bootstrap/anti-boot-strap.sh.in
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-#
-# Shell-script to ANTI bootstrap a cell
-#
-
-# shell stuff
-
-version="$arla: anti-boot-strap.sh.in,v 1.2 1999/11/03 05:57:53 lha Exp $"
-usage="NOT USE IF YOU DONT KNOW _=*KNOW*=_ WHAT YOU ARE DOING"
-
-PATH=/bin:/sbin:/usr/bin:/usr/sbin:$PATH
-
-real_useage="$0 magic4711 /partN sysconfdir"
-
-
-if test $# -ne 3; then
- echo $usage ; exit 1;
-fi
-
-if test $1 != "magic4711"; then
- echo $usage ; exit 1;
-fi
-
-
-if [ ! -d $2 ] ; then
- echo $usage ; exit 1;
-fi
-
-if [ ! -d $3 ] ; then
- echo $usage ; exit 1;
-fi
-
-###
-
-echo -n "Trying to cleanup..."
-
-for a in $2/*; do
- rm -rf $a
-done
-
-rm -f $3/pr_database
-rm -f $3/vl_database
-rm -f $3/srvtab
-rm -f $3/srvtab.old
-
-echo "done."
-
-exit 0; \ No newline at end of file
diff --git a/usr.sbin/afs/src/milko/appl/bootstrap/boot-strap.sh.in b/usr.sbin/afs/src/milko/appl/bootstrap/boot-strap.sh.in
deleted file mode 100644
index 3b6be6cafdc..00000000000
--- a/usr.sbin/afs/src/milko/appl/bootstrap/boot-strap.sh.in
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/bin/sh
-#
-# Shell-script to bootstrap cell
-#
-
-# shell stuff
-
-version="$arla: boot-strap.sh.in,v 1.4 2000/02/19 07:13:02 lha Exp $"
-usage="Usage: $0 [-v] [-p /viceN ]"
-
-#
-# Milko Boot variables
-#
-
-#all zeros are needed on ROOTVOLNUM
-
-ROOTVOL=root.cell
-ROOTVOLNUM=00000003
-ROOTPART=/vicepa
-
-#
-# Autoconf stuff
-#
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-sbindir=@sbindir@
-bindir=@bindir@
-libexecdir=@libexecdir@
-sysconfdir=@sysconfdir@
-
-ksrvutil=/usr/athena/sbin/ksrvutil
-
-while test $# -gt 0
-do
- case $1 in
- -v) echo $version ; shift ; exit 1 ;;
- -p) ROOTPART=$2 ;
- shift 2 2>/dev/null || { echo $usage ; exit 1 }
- ;;
- *) echo $usage ; exit 1; break;;
- esac
-done
-
-#
-# What we do if we fail
-#
-
-antibootstrapbin="${sbindir}/anti-boot-strap.sh"
-antibootstrap="${antibootstrapbin} magic4711 $ROOTPART ${sysconfdir}"
-
-
-PROGRAMS="$sbindir/sked \
- $libexecdir/fileserver \
- $libexecdir/ptserver \
- $libexecdir/bosserver \
- $libexecdir/vldbserver \
- $antibootstrapbin "
-
-for a in $PROGRAMS; do
- if [ ! -x $a ] ; then
- echo "ERROR: missing $a, did you do a make install ?";
- exit 1;
- fi
-done
-
-if [ ! -d $ROOTPART ]; then
- echo "ERROR: You don't have a $ROOTPART katalog/mountpoint."
- echo "Please create.";
- exit 1
-fi
-
-# XXX figure out hostname
-
-if [ -f $ROOTPART/vol$ROOTVOLNUM ] ; then
- echo "WARNING: are you sure you want to overwrite a existing installation"
- echo "There seams to be traces of a installation $ROOTPART"
- echo "Please remove it before retrying if you don't want it"
- exit 1
-fi
-
-if [ -f $sysconfdir/pr_database ] ; then
- echo "WARNING: there is already a pr database"
- echo "Remove it ($sysconfdir/pr_database) it you want to proceed"
- exit 1
-fi
-
-if [ -f $sysconfdir/vl_database ] ; then
- echo "WARNING: there is already a vl database"
- echo "Remove it ($sysconfdir/vl_database) it you want to proceed"
- exit 1
-fi
-
-
-if $sbindir/sked volcreate ${ROOTPART} ${ROOTVOLNUM} ${ROOTVOL}; then
- : ;
-else
- echo "ERROR: failed to created ${ROOTVOL} with sked";
- exec ${antibootstrap}
-fi
-
-# XXX create root srvtab
-
-if $libexecdir/vldbserver -create ; then
- : ;
-else
- echo "ERROR: failed to vl database";
- exec ${antibootstrap}
-fi
-
-# XXX add rootvol
-
-if $libexecdir/ptserver -create ; then
- : ;
-else
- echo "ERROR: failed to pts database";
- exec ${antibootstrap}
-fi
-
-# XXX create a bosserver.conf
-
-# XXX tell how to add users to system:administators (pts cu foo -local)
-
-# XXX tell how to start bosserver
-
-if test -x $ksrvutil ; then
- echo "Now its time to create kerberos tickets for you cell"
- echo " For Name[rcmd]: write: afs"
- echo " For Instance[hostname]: write: you.cell.here"
- echo " For Realm [YOUR.REALM]: write YOUR.REALM.HERE"
- echo ""
- echo " the rest is obvious"
-
- command="$ksrvutil -f $sysconfdir/srvtab -p $USER.admin get"
-
- echo "The command I'm try is \"$command\""
-
- eval $command
-
-else
-
- echo "No kth-krb ksrvutil, create a srvtab with afs.you\.cell\.@YOUR.REALM"
- echo "token in $sysconfdir"
-
-fi
-
-echo "Congratulations, done"
-
-exit 0; \ No newline at end of file
diff --git a/usr.sbin/afs/src/milko/appl/perf/Makefile.in b/usr.sbin/afs/src/milko/appl/perf/Makefile.in
deleted file mode 100644
index 071f4b4b6ca..00000000000
--- a/usr.sbin/afs/src/milko/appl/perf/Makefile.in
+++ /dev/null
@@ -1,113 +0,0 @@
-# $KTH: Makefile.in,v 1.4 2000/10/10 20:56:17 lha Exp $
-
-srcdir = @srcdir@
-top_builddir = ../../..
-VPATH = @srcdir@
-
-CC = @CC@
-LN_S = @LN_S@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-sbindir = @sbindir@
-transform = @program_transform_name@
-EXECSUFFIX = @EXECSUFFIX@
-
-APPL_BIN = perf
-PROGS = $(APPL_BIN)
-
-DEFS = @DEFS@
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-
-ETAGS = etags
-INCLUDES = -I$(srcdir)/../../fs \
- -I$(srcdir)/../../../include \
- -I$(srcdir)/../../../appl/lib \
- -I$(srcdir) \
- -I$(srcdir)/../../.. \
- -I../../../include \
- -I../../../rxdef \
- @KRB4_INC_FLAGS@ \
- @INC_roken@ \
- -I.
-
-DEFINES =
-REALCFLAGS = $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) $(X_CFLAGS)
-RXKAD_LIBS = @RXKAD_LIBS@
-LIB_tgetent = @LIB_tgetent@
-LIBS = -L../../../lib/sl -lsl \
- @LIB_readline@ \
- -L../../../util -lutil \
- -L../../../rx -lrx \
- -L../../../lwp -llwp @PLWP_LIB_FLAGS@ \
- -L../../../appl/lib -larlalib \
- -L../../../lib/ko -lko \
- -L../../../rxdef -lrxdefclient \
- @MILKO_RXKAD_LIBS2@ \
- @KRB4_LIB_FLAGS@ \
- -L../../../util -lutil \
- @LIB_roken@ \
- @LIBS@
-
-LIBDEPENDS = ../../../util/libutil.a ../../../lib/sl/libsl.a
-
-PERF_SRCS = perf.c
-SRCS = $(PERF_SRCS)
-PERF_OBJS = perf.o
-HDRS = perf.h
-
-all: $(PROGS)
-
-.PHONY: all install uninstall depend tags clean
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(sbindir)
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(sbindir)/$$f; \
- done
-
-uninstall:
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(sbindir)/$$f; \
- done
-
-perf: $(PERF_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(PERF_OBJS) $(LIBS)
-
-Makefile: Makefile.in ../../../config.status
- cd ../../..; CONFIG_FILES=milko/appl/perf/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(CFILES)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(PROGS) $(OBJS) *~ *.o core *.core
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile config.status
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/milko/appl/perf/perf.c b/usr.sbin/afs/src/milko/appl/perf/perf.c
deleted file mode 100644
index c9abd1b024e..00000000000
--- a/usr.sbin/afs/src/milko/appl/perf/perf.c
+++ /dev/null
@@ -1,676 +0,0 @@
-/*
- * Copyright (c) 1999, 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-RCSID("$KTH: perf.c,v 1.12 2000/12/10 22:24:37 lha Exp $");
-
-#include <sys/types.h>
-#include <stdio.h>
-#include <assert.h>
-#include <err.h>
-
-#include <service.h>
-
-#include <cb.ss.h>
-#include <fs.cs.h>
-
-#include <des.h>
-#include <krb.h>
-
-#include <rx/rx.h>
-#include <rx/rx_null.h>
-#include <rx/rxgencon.h>
-#include <rxkad/rxkad.h>
-
-#include <atypes.h>
-
-#include <arlalib.h>
-#include <ports.h>
-#include <service.h>
-
-#include <agetarg.h>
-
-static char *arg_cell = NULL;
-
-/*
- * Each client need a callbackserver, here we go...
- */
-
-int
-RXAFSCB_Probe (struct rx_call *a_rxCallP)
-{
- return 0;
-}
-
-int
-RXAFSCB_InitCallBackState (struct rx_call *a_rxCallP)
-{
- return 0;
-}
-
-int
-RXAFSCB_CallBack (struct rx_call *a_rxCallP,
- const AFSCBFids *a_fidArrayP,
- const AFSCBs *a_callBackArrayP)
-{
- return 0;
-}
-
-
-int
-RXAFSCB_GetLock(struct rx_call *a_rxCallP,
- int32_t index,
- AFSDBLock *lock)
-{
- return 1;
-}
-
-int
-RXAFSCB_GetCE(struct rx_call *a_rxCallP,
- int32_t index,
- AFSDBCacheEntry *dbentry)
-{
- return 1;
-}
-
-int
-RXAFSCB_XStatsVersion(struct rx_call *a_rxCallP,
- int32_t *version)
-{
- return RXGEN_OPCODE;
-}
-
-int
-RXAFSCB_GetXStats(struct rx_call *a_rxCallP,
- int32_t client_version_num,
- int32_t collection_number,
- int32_t *server_version_number,
- int32_t *time,
- AFSCB_CollData *stats)
-{
- return RXGEN_OPCODE;
-}
-
-int
-RXAFSCB_InitCallBackState2(struct rx_call *a_rxCallP,
- interfaceAddr *addr)
-{
- return RXGEN_OPCODE;
-}
-
-int
-RXAFSCB_WhoAreYou(struct rx_call *a_rxCallP,
- interfaceAddr *addr)
-{
- return RXGEN_OPCODE;
-}
-
-int
-RXAFSCB_InitCallBackState3(struct rx_call *a_rxCallP,
- const afsUUID *server_uuid)
-{
- return 0;
-}
-
-int
-RXAFSCB_ProbeUUID(struct rx_call *a_rxCallP,
- const afsUUID *uuid)
-{
- return RXGEN_OPCODE;
-}
-
-static void
-cmcb_init (void)
-{
- static struct rx_securityClass *nullSecObjP;
- static struct rx_securityClass *(securityObjects[1]);
-
- nullSecObjP = rxnull_NewClientSecurityObject ();
- if (nullSecObjP == NULL) {
- printf("Cannot create null security object.\n");
- return;
- }
-
- securityObjects[0] = nullSecObjP;
-
- if (rx_NewService (0, CM_SERVICE_ID, "cm", securityObjects,
- sizeof(securityObjects) / sizeof(*securityObjects),
- RXAFSCB_ExecuteRequest) == NULL ) {
- printf("Cannot install service.\n");
- return;
- }
- rx_StartServer (0);
-}
-
-/*
- *
- */
-
-static struct timeval timer_start;
-static struct timeval timer_stop;
-static int timer_check = 0;
-
-static void
-start_timer (void)
-{
- timer_check++;
- gettimeofday (&timer_start, NULL);
-}
-
-/*
- *
- */
-
-static void
-end_and_print_timer (char *str)
-{
- long long start_l, stop_l;
-
- timer_check--;
- assert (timer_check == 0);
- gettimeofday(&timer_stop, NULL);
- start_l = timer_start.tv_sec * 1000000 + timer_start.tv_usec;
- stop_l = timer_stop.tv_sec * 1000000 + timer_stop.tv_usec;
- printf("%s:\t%8llu msec\n", str, (stop_l-start_l)/1000);
-}
-
-
-static void
-do_createfile (struct rx_connection *conn, const AFSFid *parent,
- const char *name, AFSFid *child)
-{
- static AFSStoreStatus InStatus = { 0,0,0,0,0 };
- AFSFetchStatus OutFidStatus, OutDirStatus;
- AFSCallBack CallBack;
- AFSVolSync a_volSyncP;
- int ret;
-
- ret = RXAFS_CreateFile (conn, parent, name, &InStatus,
- child, &OutFidStatus, &OutDirStatus,
- &CallBack, &a_volSyncP);
- if (ret)
- errx (1, "RXAFS_CreateFile returned %d", ret);
-}
-
-static void
-do_createfilecontent (struct rx_connection *conn, const AFSFid *parent,
- const char *name, AFSFid *child, int size,
- int times, char *buffer)
-{
- static AFSStoreStatus InStatus = { 0,0,0,0,0 };
- AFSFetchStatus OutFidStatus, OutDirStatus;
- AFSCallBack CallBack;
- AFSVolSync a_volSyncP;
- int ret;
- struct rx_call *call;
- int i;
-
- ret = RXAFS_CreateFile (conn, parent, name, &InStatus,
- child, &OutFidStatus, &OutDirStatus,
- &CallBack, &a_volSyncP);
- if (ret)
- errx (1, "RXAFS_CreateFile returned %d", ret);
-
- call = rx_NewCall (conn);
-
- if (call == NULL)
- errx (1, "rx_NewCall returned NULL");
-
- ret = StartRXAFS_StoreData (call, child, &InStatus,
- 0, size*times, size*times);
-
- if (ret)
- errx (1, "StartRXAFS_StoreData returned %d", ret);
-
- for (i = 0; i < times; i++) {
- ret = rx_Write(call, buffer, size);
- if (ret != size)
- errx (1, "rx_Write returned %d", ret);
- }
-
- ret = EndRXAFS_StoreData (call, &OutFidStatus, &a_volSyncP);
-
- if (ret)
- errx (1, "StartRXAFS_StoreData returned %d", ret);
-
- ret = rx_EndCall(call, ret);
- if (ret)
- errx (1, "rx_EndCall returned %d", ret);
-}
-
-static void
-do_readfilecontent (struct rx_connection *conn, const AFSFid *fid,
- int size,
- int times, char *buffer)
-{
- AFSFetchStatus OutFidStatus;
- AFSCallBack CallBack;
- AFSVolSync a_volSyncP;
- int ret;
- struct rx_call *call;
- int i;
-
- call = rx_NewCall (conn);
-
- if (call == NULL)
- errx (1, "rx_NewCall returned NULL");
-
- ret = StartRXAFS_FetchData (call, fid, 0, size*times);
-
- if (ret)
- errx (1, "StartRXAFS_FetchData returned %d", ret);
-
- for (i = 0; i < times; i++) {
- ret = rx_Read(call, buffer, size);
- if (ret != size)
- errx (1, "rx_Read returned %d", ret);
- }
-
- ret = EndRXAFS_FetchData (call, &OutFidStatus, &CallBack,
- &a_volSyncP);
- if (ret)
- errx (1, "StartRXAFS_FetchData returned %d", ret);
-
- ret = rx_EndCall(call, ret);
- if (ret)
- errx (1, "rx_EndCall returned %d", ret);
-}
-
-static void
-do_gtod (struct rx_connection *conn)
-{
- int ret;
- int32_t sec, usec;
-
- ret = RXAFS_GetTime (conn, &sec, &usec);
- if (ret)
- errx (1, "RXAFS_GetTime returned %d", ret);
-}
-
-static void
-do_mkdir (struct rx_connection *conn, const AFSFid *parent,
- const char *name, AFSFid *child)
-{
- static AFSStoreStatus InStatus = { 0,0,0,0,0 };
- AFSFetchStatus OutFidStatus, OutDirStatus;
- AFSCallBack CallBack;
- AFSVolSync a_volSyncP;
- int ret;
-
- ret = RXAFS_MakeDir (conn, parent, name, &InStatus,
- child, &OutFidStatus, &OutDirStatus,
- &CallBack, &a_volSyncP);
- if (ret)
- errx (1, "RXAFS_MakeDir returned %d", ret);
-}
-
-
-static void
-do_rmdir (struct rx_connection *conn, const AFSFid *parent,
- const char *name)
-{
- AFSFetchStatus a_newParentDirStatP;
- AFSVolSync a_volSyncP;
- int ret;
-
- ret = RXAFS_RemoveDir (conn, parent, name, &a_newParentDirStatP,
- &a_volSyncP);
- if (ret)
- errx (1, "RXAFS_RemoveDir returned %d", ret);
-}
-
-static void
-do_removefile (struct rx_connection *conn, const AFSFid *parent,
- const char *name)
-{
- AFSFetchStatus a_newParentDirStatP;
- AFSVolSync a_volSyncP;
- int ret;
-
- ret = RXAFS_RemoveFile (conn, parent, name, &a_newParentDirStatP,
- &a_volSyncP);
- if (ret)
- errx (1, "RXAFS_RemoveDir returned %d", ret);
-}
-
-static void __attribute__((__unused__))
-do_bulkstat (struct rx_connection *conn, AFSFid *fids,
- int num)
-{
- AFSCBFids FidsArray;
- AFSBulkStats StatArray;
- AFSCBs CBArray;
- AFSVolSync Sync;
- int ret;
-
- FidsArray.val = fids;
- FidsArray.len = num;
-
- ret = RXAFS_BulkStatus (conn, &FidsArray, &StatArray, &CBArray, &Sync);
- if (ret)
- errx (1, "RXAFS_BulkStatus faile with %d", ret);
-
- free (StatArray.val);
- free (CBArray.val);
-}
-
-/*
- *
- */
-
-typedef void (*create_many_create)(struct rx_connection *conn,
- const AFSFid *parent,
- const char *name,
- AFSFid *child);
-typedef void (*create_many_remove)(struct rx_connection *conn,
- const AFSFid *parent,
- const char *name);
-
-static void
-create_many_entry (struct rx_connection *conn, AFSFid *parentfid, int num,
- create_many_create create,
- create_many_remove remove,
- const char *entry_name)
-{
- char *dir, *stamp;
- AFSFid fid;
- AFSFid *files;
- int i;
- char filename[MAXPATHLEN];
-
- assert (num >= 0);
-
- files = emalloc (num * sizeof (fid));
-
- asprintf (&stamp, "creating %d %ss", num, entry_name);
-
- asprintf (&dir, "create_many_files-%d-time-%d", num, (int)time(NULL));
- do_mkdir (conn, parentfid, dir, &fid);
-
- start_timer();
- for (i = 0; i < num; i++) {
- snprintf (filename, sizeof(filename), "%d", i);
- (create) (conn, &fid, filename, &files[i]);
- }
- end_and_print_timer (stamp);
-
- free (stamp);
- asprintf (&stamp, "removing %d %ss", num, entry_name);
-
- start_timer();
- for (i = 0; i < num; i++) {
- snprintf (filename, sizeof(filename), "%d", i);
- (remove) (conn, &fid, filename);
- }
- end_and_print_timer (stamp);
-
- do_rmdir (conn, parentfid, dir);
-
- free (stamp);
- free (dir);
-}
-
-static void
-create_and_read_content (struct rx_connection *conn, AFSFid *parentfid, int size)
-{
- char *dir, *stamp;
- AFSFid fid;
- AFSFid file;
- char *buffer;
-
- asprintf (&stamp, "writing %dM data", size);
-
- asprintf (&dir, "write_big_files-%d-time-%d", size, (int)time(NULL));
- do_mkdir (conn, parentfid, dir, &fid);
-
- buffer = malloc(1024*1024);
- memset(buffer, 'X', 1024*1024);
-
- start_timer();
- do_createfilecontent (conn, &fid, "foo", &file, 1024*1024,
- size, buffer);
- end_and_print_timer (stamp);
-
- free (stamp);
-
- asprintf (&stamp, "reading %dM data", size);
- start_timer();
- do_readfilecontent (conn, &file, 1024*1024, size, buffer);
- end_and_print_timer (stamp);
-
- free(stamp);
-
- free(buffer);
-
- asprintf (&stamp, "removing %dM data", size);
-
- start_timer();
- do_removefile (conn, &fid, "foo");
- end_and_print_timer (stamp);
-
- do_rmdir (conn, parentfid, dir);
-
- free (stamp);
- free (dir);
-}
-
-static void
-bench_gettime(struct rx_connection *conn, int times)
-{
- char *stamp;
- int i;
-
- asprintf (&stamp, "gettime %d times", times);
-
- start_timer();
- for (i = 0; i < times; i++)
- do_gtod (conn);
- end_and_print_timer (stamp);
-
- free (stamp);
-}
-
-/*
- *
- */
-
-static int
-do_bench (char *host, int volume, arlalib_authflags_t auth)
-{
- struct rx_connection *conn;
- AFSFid root;
-
- conn = arlalib_getconnbyname (arg_cell, host, afsport,
- FS_SERVICE_ID, auth);
- if (conn == NULL)
- errx (1, "arlalib_getconnbyname failed");
-
-
- root.Volume = volume;
- root.Vnode = 1;
- root.Unique = 1;
-
- bench_gettime(conn, 1);
- bench_gettime(conn, 100);
- bench_gettime(conn, 1000);
- bench_gettime(conn, 2000);
- create_and_read_content (conn, &root, 1);
- create_and_read_content (conn, &root, 2);
- create_and_read_content (conn, &root, 10);
- create_and_read_content (conn, &root, 20);
- create_and_read_content (conn, &root, 30);
- create_and_read_content (conn, &root, 40);
- create_and_read_content (conn, &root, 50);
-
- create_many_entry (conn, &root, 1000,do_createfile,do_removefile, "file");
- create_many_entry (conn, &root, 2000,do_createfile,do_removefile, "file");
- create_many_entry (conn, &root, 4000,do_createfile,do_removefile, "file");
- create_many_entry (conn, &root, 8000,do_createfile,do_removefile, "file");
-
- create_many_entry (conn, &root, 1000, do_mkdir, do_rmdir, "dir");
- create_many_entry (conn, &root, 2000, do_mkdir, do_rmdir, "dir");
- create_many_entry (conn, &root, 4000, do_mkdir, do_rmdir, "dir");
- create_many_entry (conn, &root, 8000, do_mkdir, do_rmdir, "dir");
-
- rx_DestroyConnection(conn);
-
- return 0;
-}
-
-static int
-do_readbench(char *host, int volume, int vnode, int uniq, arlalib_authflags_t auth)
-{
- char *stamp;
- char *buffer;
- AFSFid file;
- struct rx_connection *conn;
-
- conn = arlalib_getconnbyname (arg_cell, host, afsport,
- FS_SERVICE_ID, auth);
-
- buffer = malloc(1024*1024);
- asprintf (&stamp, "reading %dM data", 10);
- file.Vnode = vnode;
- file.Volume = volume;
- file.Unique = uniq;
- start_timer();
- do_readfilecontent (conn, &file, 1024*1024, 10, buffer);
- end_and_print_timer (stamp);
-
- free(stamp);
- free(buffer);
- rx_DestroyConnection(conn);
- return 0;
-}
-
-/*
- *
- */
-
-static char *arg_host = NULL;
-static int arg_volume = 0;
-static int arg_authlevel = 2;
-static int arg_help = 0;
-static int arg_vnode = 0;
-static int arg_uniq = 0;
-
-struct agetargs args[] = {
- {"host", 0, aarg_string, &arg_host,
- "what host to use", "host", aarg_mandatory},
- {"volume", 0, aarg_integer, &arg_volume,
- "what volume to use", NULL, aarg_mandatory},
- {"authlevel",0, aarg_integer, &arg_authlevel,
- "authlevel", NULL, aarg_mandatory},
- {"help", 0, aarg_flag, &arg_help,
- "authlevel", NULL, aarg_mandatory},
- {"vnode", 0, aarg_integer, &arg_vnode,
- "what vnode to read from", NULL, aarg_optional},
- {"uniq", 0, aarg_integer, &arg_uniq,
- "what uniq to read from", NULL, aarg_optional},
- {"cell", 0, aarg_string, &arg_cell,
- "cell", NULL, aarg_optional},
- { NULL, 0}
-};
-
-static void
-usage (int eval)
-{
- aarg_printusage(args, "perf", NULL, AARG_AFSSTYLE);
-
- printf ("\nTips:\n"
- " on errors use `fs strerror <errno>' to figure"
- " out what was wrong\n");
-
- exit (eval);
-}
-
-
-int
-main (int argc, char **argv)
-{
- int ret, optind = 0;
- arlalib_authflags_t auth;
- char *auth_string;
-
- printf ("afs low-level performance tester\n");
-
- ret = rx_Init (htons(4712));
- if (ret)
- errx (1, "rx_Init returnd %d", ret);
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage (args, "", NULL, AARG_AFSSTYLE);
- return 0;
- }
-
- if (arg_help)
- usage (0);
-
- ports_init ();
- cmcb_init();
-
- switch (arg_authlevel) {
- case 1:
- auth = AUTHFLAGS_NOAUTH;
- auth_string = "clear";
- break;
- case 2:
- auth = AUTHFLAGS_TICKET;
- auth_string = "auth";
- rxkad_min_level = rxkad_auth;
- break;
- case 3:
- auth = AUTHFLAGS_TICKET;
- auth_string = "crypt";
- rxkad_min_level = rxkad_crypt;
- break;
- default:
- errx (1, "authlevel: only 1, 2 or 3 is valid (clear, auth, crypt)");
- }
-
- printf ("Perf\n");
- printf ("host: %s, volume: %d, auth: %s\n",
- arg_host, arg_volume, auth_string);
-
- if (arg_vnode && arg_uniq)
- do_readbench(arg_host, arg_volume, arg_vnode, arg_uniq, auth);
- else
- do_bench (arg_host, arg_volume, auth);
-
- return 0;
-}
-
-
diff --git a/usr.sbin/afs/src/milko/appl/sked/Makefile.in b/usr.sbin/afs/src/milko/appl/sked/Makefile.in
deleted file mode 100644
index 61038744591..00000000000
--- a/usr.sbin/afs/src/milko/appl/sked/Makefile.in
+++ /dev/null
@@ -1,125 +0,0 @@
-# $KTH: Makefile.in,v 1.14 2000/10/08 06:22:31 lha Exp $
-
-srcdir = @srcdir@
-top_builddir = ../../..
-VPATH = @srcdir@
-
-CC = @CC@
-LN_S = @LN_S@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-sbindir = @sbindir@
-transform = @program_transform_name@
-EXECSUFFIX = @EXECSUFFIX@
-
-APPL_BIN = sked
-PROGS = $(APPL_BIN)
-
-DEFS = @DEFS@
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-
-ETAGS = etags
-INCLUDES = -I$(srcdir)/../../fs \
- -I$(srcdir)/../../../include \
- -I$(srcdir)/../../include \
- -I$(srcdir)/../../lib/mlog \
- -I$(srcdir)/../../lib/voldb \
- -I$(srcdir)/../../lib/dpart \
- -I$(srcdir)/../../lib/vld \
- -I$(srcdir)/../../lib/vstatus \
- -I$(srcdir)/../../../lib/bufdir \
- -I$(srcdir)/../../lib/mdir \
- -I$(srcdir)/../../lib/vstatus \
- -I../../lib/vstatus \
- -I../../../include \
- -I../../../rxdef \
- -I$(srcdir) \
- -I$(srcdir)/../../.. \
- -I.
-
-DEFINES =
-REALCFLAGS = $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) $(X_CFLAGS)
-RXKAD_LIBS = @RXKAD_LIBS@
-LIB_tgetent = @LIB_tgetent@
-LIBS = -L../../../lib/sl -lsl \
- @LIB_readline@ \
- -L../../lib/dpart -ldpart \
- -L../../lib/vld -lvld \
- -L../../lib/voldb -lvoldb \
- -L../../lib/vstatus -lvstatus \
- -L../../lib/mlog -lmlog \
- -L../../../lib/bufdir -lbufdir \
- -L../../../rx -lrx \
- -L../../../lwp -llwp @PLWP_LIB_FLAGS@ \
- -L../../../rxdef -lrxvolserver \
- -L../../../util -lutil \
- -L../../../lib/ko -lko \
- -L../../../lib/roken \
- -lroken @LIBS@
-
-LIBDEPENDS = ../../../util/libutil.a ../../../lib/sl/libsl.a \
- ../../../lib/roken/libroken.a ../../lib/voldb/libvoldb.a \
- ../../lib/dpart/libdpart.a ../../lib/vld/libvld.a \
- ../../lib/mlog/libmlog.a
-
-SKED_SRCS = sked.c
-SRCS = $(SKED_SRCS)
-SKED_OBJS = sked.o
-HDRS = sked.h
-
-all: $(PROGS)
-
-.PHONY: all install uninstall depend tags clean
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(sbindir)
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(sbindir)/$$f; \
- done
-
-uninstall:
- PROG_BIN='$(APPL_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(sbindir)/$$f; \
- done
-
-sked: $(SKED_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(SKED_OBJS) $(LIBS)
-
-Makefile: Makefile.in ../../../config.status
- cd ../../..; CONFIG_FILES=milko/appl/sked/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(CFILES)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(PROGS) $(OBJS) *~ *.o core *.core
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile config.status
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/milko/appl/sked/sked.c b/usr.sbin/afs/src/milko/appl/sked/sked.c
deleted file mode 100644
index 90df1c89e8c..00000000000
--- a/usr.sbin/afs/src/milko/appl/sked/sked.c
+++ /dev/null
@@ -1,807 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <config.h>
-#include "roken.h"
-
-RCSID("$arla: sked.c,v 1.33 2002/04/26 16:11:41 lha Exp $");
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include <err.h>
-#include <assert.h>
-
-#include <sl.h>
-#include <agetarg.h>
-
-#include <atypes.h>
-#include <rx/rx.h>
-#include <fbuf.h>
-#include <fs_def.h>
-#include <pts.h>
-#include <dpart.h>
-#include <vstatus.h>
-#include <voldb.h>
-#include <vld.h>
-#include <mnode.h>
-#include <vldb.h>
-#include <mdir.h>
-#include <salvage.h>
-#include <mlog.h>
-#include <mdebug.h>
-
-static int interactivep = 0;
-
-#define INTER_RETURN(ret) if (interactivep) return 0; else exit (ret);
-
-static int
-create_volume (uint32_t part, uint32_t num, char *name)
-{
- int ret;
- int32_t backstoretype = VLD_SVOL;
- struct dp_part *dp;
-
-
- ret = dp_create (part, &dp);
- if (ret)
- return ret;
-
- ret = vld_create_volume (dp, num, name, backstoretype, RWVOL, 0);
- if (ret)
- return ret;
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-show_volume (uint32_t part, uint32_t num)
-{
- volume_handle *vh = NULL;
- int ret;
- struct dp_part *dp = NULL;
-
- ret = dp_create (part, &dp);
- if (ret) {
- printf ("show_volume: dp_create: %d\n", ret);
- goto out;
- }
-
- ret = vld_open_volume_by_num (dp, num, &vh);
- if (ret) {
- printf ("show_volume: vld_open_volume_ny_num: %d\n", ret);
- goto out;
- }
-
- ret = vld_info_uptodatep (vh);
- if (ret) {
- printf ("show_volume: vld_info_uptodatep: %d\n", ret);
- goto out;
- }
-
- printf ("volume-type:\t%s\n", vld_backstoretype_name(vh->type));
- printf ("------------------------\n");
- vol_pretty_print_info (stdout, &vh->info);
-
- ret = vld_db_uptodate (vh);
- if (ret) {
- printf ("show_volume: vld_db_uptodate: %d\n", ret);
- goto out;
- }
-
- printf ("voldb header:\n dir:\n");
- voldb_pretty_print_header(vh->db[0]);
- printf ("file:\n");
- voldb_pretty_print_header(vh->db[1]);
-
- printf ("info: ");
- vstatus_print_onode (stdout, &vh->sino);
- printf ("dir: ");
- vstatus_print_onode (stdout, &vh->dino);
- printf ("file: ");
- vstatus_print_onode (stdout, &vh->fino);
-
- out:
- if (vh)
- vld_free (vh);
- if (dp)
- dp_free (dp);
-
- INTER_RETURN(ret ? 1 : 0);
-}
-
-/*
- *
- */
-
-static void
-showvols_cb (void *data, int fd)
-{
- struct dp_part *dp = data;
- volume_handle *vh;
- int ret;
-
- assert (dp);
-
- ret = vld_open_volume_by_fd (dp, fd, &vh);
- if (ret) {
- printf ("showvols_cb: vld_open_volume_by_fd: %d\n", ret);
- }
-
- ret = vld_info_uptodatep (vh);
- if (ret) {
- printf ("showvols_cb: vld_info_uptodatep: %d\n", ret);
- vld_free (vh);
- }
-
- if (vh->vol != vh->info.volid)
- printf ("PANIC: vh->vol != vh->info.volid\n");
-
- printf ("%-32s %-4s %-4s %-8u %-8u %-8u %-8u\n",
- vh->info.name, vld_backstoretype_name(vh->type),
- vol_voltype2name(vh->info.type), vh->vol,
- vh->info.backupID, vh->info.parentID,
- vh->info.cloneID);
-
- vld_free (vh);
-}
-
-/*
- * List volumes on partition `part'.
- */
-
-static int
-show_vols (uint32_t part)
-{
- struct dp_part *p;
- int ret;
-
- ret = dp_create (part, &p);
- if (ret)
- errx (1, "dp_create returned %d", ret);
-
- printf ("%-32s %-4s %-4s %-8s %-8s %-8s %-8s\n",
- "Name", "Type", "Type",
- "VolID", "BackupID", "ParentID", "cloneID");
- ret = dp_findvol (p, showvols_cb, p);
- if (ret)
- errx (1, "dp_findvol returned %d", ret);
-
- dp_free (p);
-
- return 0;
-}
-
-/*
- * sl commands
- */
-
-static int
-volcreate_cmd (int argc, char **argv)
-{
- uint32_t num, part;
- int ret;
-
- if (argc < 4 || argc > 5) {
- printf ("usage: volcreate part num name [partdir]\n");
- INTER_RETURN(1);
- }
-
- if (argc == 5)
- dpart_root = argv[4];
-
- ret = dp_parse (argv[1], &part);
- if (ret) {
- printf ("volcreate: `%s' is a invalid argument for partition\n", argv[1]);
- INTER_RETURN(1);
- }
-
- num = atoi (argv[2]);
- if (num == 0) {
- printf ("volcreate: `%s' is a invalid argument for volnum\n", argv[2]);
- INTER_RETURN(1);
- }
-
- ret = create_volume (part, num, argv[3]);
- if (ret) {
- printf ("volcreate: create_volume returned: %d\n", ret);
- INTER_RETURN(ret);
- }
-
- printf ("volume %u created successfully\n", num);
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-volshow_cmd (int argc, char **argv)
-{
- uint32_t num, part;
- int ret;
-
- if (argc < 3 || argc > 4) {
- printf ("usage: volshow part num [partdir]\n");
- INTER_RETURN(1);
- }
-
- part = atoi (argv[1]);
-
- num = atoi (argv[2]);
- if (num == 0) {
- printf ("volcreate: `%s' is a invalid argument for volnum\n", argv[2]);
- INTER_RETURN(1);
- }
-
- dpart_root = argv[3];
-
- ret = show_volume (part, num);
- if (ret) {
- printf ("volshow: show_volume returned: %d\n", ret);
- INTER_RETURN(ret);
- }
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-vollist_cmd (int argc, char **argv)
-{
- uint32_t part;
- int ret;
-
- if (argc != 2) {
- printf ("usage: vollist part\n");
- INTER_RETURN(1);
- }
-
- part = atoi (argv[1]);
-
- ret = show_vols (part);
- if (ret) {
- printf ("vollist: show_vols returned: %d\n", ret);
- INTER_RETURN(ret);
- }
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-volls_dir_cb (VenusFid *fid, const char *name, void *arg)
-{
- printf ("%-60s %d.%d.%d\n",
- name,
- fid->fid.Volume,
- fid->fid.Vnode,
- fid->fid.Unique);
- return 0;
-}
-
-static int
-volls_cmd (int argc, char **argv)
-{
- uint32_t part;
- uint32_t vol;
- uint32_t vnode;
- struct dp_part *dp;
- int ret;
-
- if (argc < 4 || argc > 5) {
- printf ("volls part volume# vnode# [partdir]\n");
- INTER_RETURN(1);
- }
-
- part = atoi(argv[1]);
- vol = atoi(argv[2]);
- if (vol == 0) {
- printf ("erronous volume number\n");
- INTER_RETURN(1);
- }
-
- vnode = atoi(argv[3]);
- if (vnode == 0) {
- printf ("erronous vnode number\n");
- INTER_RETURN(1);
- }
-
- dpart_root = argv[4];
-
- ret = dp_create (part, &dp);
- if (ret) {
- printf ("volls: dp_create: %d\n", ret);
- INTER_RETURN(1);
- }
-
- {
- struct volume_handle *volh;
- struct mnode n;
- struct msec m;
-
- memset (&n, 0, sizeof(n));
-
- ret = vld_open_volume_by_num (dp, vol, &volh);
- if (ret)
- errx (1, "volls: vld_open_volume_by_num: %d", ret);
-
- ret = vld_db_uptodate (volh);
- if (ret)
- errx (1, "volls: vld_db_uptodate: %d", ret);
-
- n.fid.Vnode = vnode;
- m.flags = VOLOP_GETSTATUS;
-
- ret = vld_open_vnode (volh, &n, &m);
- if (ret)
- errx (1, "volls: vld_open_vnode failed with %d", ret);
-
- printf ("mode=%o ino=%x dev=%x rdev=%x\n",
- n.sb.st_mode, (int) n.sb.st_ino,
- (int) n.sb.st_dev, (int) n.sb.st_rdev);
-
- printf ("size: %d\nparent fid: %d.%d\n",
- n.fs.Length, n.fs.ParentVnode, n.fs.ParentUnique);
-
- if (afs_dir_p (vnode)) {
- VenusFid fid;
- fid.Cell = 0;
- fid.fid.Volume = volh->vol;
- fid.fid.Vnode = vnode;
- fid.fid.Unique = 0;
-
- ret = mdir_readdir (&n, volls_dir_cb, NULL, fid);
- if (ret)
- errx (1, "volls: mdir_readdir failed with %d", ret);
-
- } else {
- printf ("this is a file.... XXX\n");
- }
-
- close (n.fd);
-
- vld_free(volh);
-
- }
- return 0;
-}
-
-/*
- *
- */
-
-static int
-volvnode_cmd (int argc, char **argv)
-{
- uint32_t part;
- char *part_str = NULL;
- uint32_t vol;
- char *vol_str = NULL;
- struct dp_part *dp;
- int do_list = 0;
- int ret, optind = 0;
-
- struct agetargs args[] = {
- {"part", 0, aarg_string, NULL,
- "what part to use", NULL, aarg_mandatory},
- {"vol", 0, aarg_string, NULL,
- "what vol to use", NULL, aarg_mandatory},
- {"list", 'l', aarg_flag, NULL,
- "list vnodes" },
- { NULL, 0, aarg_end, NULL }
- }, *arg;
-
- arg = args;
- arg->value = &part_str; arg++;
- arg->value = &vol_str; arg++;
- arg->value = &do_list; arg++;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(args, "volvnode", NULL, AARG_AFSSTYLE);
- INTER_RETURN(1);
- }
- part = atoi(part_str);
- vol = atoi(vol_str);
- if (vol == 0) {
- printf ("erronous volume number\n");
- INTER_RETURN(1);
- }
-
- ret = dp_create (part, &dp);
- if (ret) {
- printf ("volls: dp_create: %d\n", ret);
- INTER_RETURN(1);
- }
-
- {
- struct volume_handle *volh;
- int i;
- uint32_t num, flags;
-
-
- ret = vld_open_volume_by_num (dp, vol, &volh);
- if (ret)
- errx (1, "volvnode: vld_open_volume_by_num: %d", ret);
-
- /*
- * print volume header
- */
-
- ret = vld_info_uptodatep (volh);
- if (ret)
- errx (1, "vld_info_uptodatep: %d", ret);
-
- vol_pretty_print_info (stdout, &volh->info);
-
- /*
- * Print nodes
- */
-
- ret = vld_db_uptodate (volh);
- if (ret)
- errx (1, "vld_db_uptodate: %d", ret);
-
- /*
- * Print dir nodes
- */
-
- ret = voldb_header_info (volh->db[0], &num, &flags);
- if (ret)
- errx (1, "voldb_header_info: %d", ret);
-
- printf ("---------------------------------\n");
- printf ("dir nodes contain:\n");
- printf (" num: %d\tflags 0x%x\n", num, flags);
- printf ("---------------------------------\n");
-
- if (do_list) {
- for (i = 0; i < num; i++) {
- struct voldb_entry e;
-
- printf ("dnode #%d\n", i);
-
- ret = voldb_get_entry (volh->db[0], i, &e);
- if (ret)
- errx (1, "voldb_get_dir (%d) returned: %d", i, ret);
- voldb_pretty_print_dir (&e.u.dir);
- }
- }
-
- /*
- * Print file nodes
- */
-
- ret = voldb_header_info (volh->db[1], &num, &flags);
- if (ret)
- errx (1, "voldb_header_info: %d", ret);
-
- printf ("---------------------------------\n");
- printf ("file nodes contain:\n");
- printf (" num: %d\tflags 0x%x\n", num, flags);
- printf ("---------------------------------\n");
-
- if (do_list) {
- for (i = 0; i < num; i++) {
- struct voldb_entry e;
-
- printf ("fnode #%d\n", i);
-
- ret = voldb_get_entry (volh->db[1], i, &e);
- if (ret)
- errx (1, "voldb_get_dir (%d) returned: %d", i, ret);
- voldb_pretty_print_file (&e.u.file);
- }
- }
-
- vld_free(volh);
-
- }
- return 0;
-}
-
-/*
- *
- */
-
-static int
-fvolcreate_cmd (int argc, char **argv)
-{
- uint32_t part;
- char *part_str = NULL;
- char *path_str = NULL;
- int vol_int = 0;
- struct dp_part *dp;
- int ret, optind = 0;
-
- struct agetargs args[] = {
- {"part", 0, aarg_string, NULL,
- "what part to use", NULL, aarg_mandatory},
- {"vol", 0, aarg_integer, NULL,
- "what vol-number to use", NULL, aarg_mandatory},
- {"path", 0, aarg_string, NULL,
- "what path to volume-ify", NULL, aarg_mandatory},
- { NULL, 0, aarg_end, NULL }
- }, *arg;
-
- arg = args;
- arg->value = &part_str; arg++;
- arg->value = &vol_int; arg++;
- arg->value = &path_str; arg++;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(args, "volvnode", NULL, AARG_AFSSTYLE);
- INTER_RETURN(1);
- }
-
- part = atoi(part_str);
- if (vol_int == 0) {
- printf ("erronous volume number\n");
- INTER_RETURN(1);
- }
-
- ret = dp_create (part, &dp);
- if (ret) {
- printf ("volls: dp_create: %d\n", ret);
- INTER_RETURN(1);
- }
-
- ret = vld_fvol_create_volume_ondisk (dp, vol_int, path_str);
- if (ret) {
- printf ("volls: fvol_create_volume_ondisk: %d\n", ret);
- INTER_RETURN(1);
- }
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-showvolname_cmd (int argc, char **argv)
-{
- int ret;
- uint32_t num;
- uint32_t part;
- char name[MAXPATHLEN];
-
- if (argc != 2 && argc != 3)
- errx (1, "usage: showvolname [part] volnum");
-
- if (argc == 2) {
- num = atoi (argv[1]);
- if (num == 0)
- errx (1, "showvolname: `%s' is a invalid argument", argv[1]);
-
- ret = vol_getname (num, name, sizeof (name));
- if (ret) {
- printf ("vol_getname returned %d", ret);
- INTER_RETURN(ret);
- }
- printf ("volume name is: %s\n", name);
- } else {
- part = atoi (argv[1]); /* XXX 0 is valid volume */
-
- num = atoi (argv[2]);
- if (num == 0)
- errx (1, "showvolname: `%s' is a invalid argument", argv[2]);
-
- ret = vol_getfullname (part, num, name, sizeof (name));
- if (ret)
- errx (1, "vol_getname returned %d", ret);
- printf ("volume full name is: %s\n", name);
- }
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-salvage_cmd (int argc, char **argv)
-{
- char *part_str = NULL;
- int vol = 0;
- struct dp_part *dp;
- int ret, optind = 0;
- struct volume_handle *volh;
-
- struct agetargs args[] = {
- {"part", 0, aarg_string, NULL,
- "what part to use", NULL, aarg_mandatory},
- {"vol", 0, aarg_integer, NULL,
- "what vol-number to use", NULL, aarg_mandatory},
- {"partdir", 0, aarg_string, NULL,
- "where to find vicep*", NULL, aarg_optional},
- { NULL, 0, aarg_end, NULL }
- }, *arg;
-
- arg = args;
- arg->value = &part_str; arg++;
- arg->value = &vol; arg++;
- arg->value = &dpart_root; arg++;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- aarg_printusage(args, "volvnode", NULL, AARG_AFSSTYLE);
- INTER_RETURN(1);
- }
-
- if (part_str == NULL || vol == 0) {
- warnx ("missing argument");
- INTER_RETURN(1);
- }
-
- dp = dp_getpart (part_str);
- if (dp == NULL) {
- warnx ("erronous volume number");
- INTER_RETURN(1);
- }
-
- ret = vld_open_volume_by_num (dp, vol, &volh);
- if (ret) {
- warnx ("salvage: vld_open_volume_by_num: %d", ret);
- INTER_RETURN(1);
- }
-
- ret = salvage_volume (volh);
- if (ret)
- warnx ("salvage returned %d", ret);
- else
- printf ("volume %s (%u) is ok\n", volh->info.name, vol);
-
- vld_free(volh);
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-version_cmd (int argc, char **argv)
-{
- printf ("sked - maintaing volumes the hard way\n");
-
- printf ("Package: %s\n"
- "Version: %s\n", PACKAGE, VERSION);
- return 0;
-}
-
-
-static int help_cmd (int argc, char **argv);
-static int apropos_cmd (int argc, char **argv);
-
-/*
- *
- */
-
-static SL_cmd cmds[] = {
- {"apropos", apropos_cmd, "apropos topic"},
- {"help", help_cmd, "help text"},
- {"volcreate", volcreate_cmd, "create a volume"},
- {"volshow", volshow_cmd, "show a volume"},
- {"vollist", vollist_cmd, "list volumes on part"},
- {"volls", volls_cmd, "list files in volume,vnode pair"},
- {"volvnode", volvnode_cmd, "list all vnodes"},
- {"fvolcreate", fvolcreate_cmd, "create a fvolume"},
- {"name", showvolname_cmd, "name of a volume"},
- {"salvage", salvage_cmd, "salvage a volume"},
- {"version", version_cmd, "show version of sked"},
- { NULL, NULL, NULL}
-};
-
-/*
- * Help command
- */
-
-static int
-help_cmd (int argc, char **argv)
-{
- sl_help (cmds, argc, argv);
- return 0;
-}
-
-/*
- * Apropos command
- */
-
-static int
-apropos_cmd (int argc, char **argv)
-{
- if (argc < 2)
- printf ("apropos <topic>\n");
- else
- sl_apropos (cmds, argv[1]);
- return 0;
-}
-
-/*
- * Main
- */
-
-int
-main (int argc, char **argv)
-{
- int ret;
- Log_method *method;
- char *log_file = "/dev/stderr";
-
- set_progname (argv[0]);
-
- method = log_open (getprogname(), log_file);
- if (method == NULL)
- errx (1, "log_open failed");
-
- /*
- * We only boot, not init since we dont want to read in all volumes
- */
- vld_boot ();
- mnode_init (173);
-
- mlog_loginit (method, milko_deb_units, MDEFAULT_LOG /* MDEBALL */);
-
- /*
- * Command loop or if command, eval.
- */
-
- if (argc < 2) {
- interactivep = 1;
- sl_loop (cmds, "sked (cmd): ");
- } else {
- ret = sl_command(cmds, argc - 1, argv + 1);
- if (ret == -1)
- printf ("%s: Unknown command\n", argv[1]);
- }
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/milko/bos/Makefile.in b/usr.sbin/afs/src/milko/bos/Makefile.in
deleted file mode 100644
index b4f9063705c..00000000000
--- a/usr.sbin/afs/src/milko/bos/Makefile.in
+++ /dev/null
@@ -1,120 +0,0 @@
-# $KTH: Makefile.in,v 1.9 2000/10/10 20:56:20 lha Exp $
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-sysconfdir = @sysconfdir@
-transform = @program_transform_name@
-
-BOSSERVER_BIN = bosserver
-
-DEFS = @DEFS@ -DMILKO_LIBEXECDIR=\"$(libexecdir)\" -DMILKO_SYSCONFDIR=\"$(sysconfdir)\"
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-LDFLAGS = @LDFLAGS@
-
-ETAGS = etags
-MAKEDEPEND = makedepend
-AFSWSROOT = /usr/afsws
-RXKADINC = -I$(srcdir)/../rxkad
-INCLUDES = -I$(srcdir)/../.. \
- -I../../include \
- -I$(srcdir)/../../include \
- -I$(srcdir)/../lib/msecurity \
- -I../../rxdef \
- @INC_roken@ \
- $(RXKADINC)
-DEFINES = -DDEBUG
-REALCFLAGS = $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) -DRXDEBUG
-RXKADLIB = @MILKO_RXKAD_LIBS@
-KAFS_LIBS = @AIX_EXTRA_KAFS@ @KAFS_LIBS@
-LIBS = -L../../rxdef -lrxvlserver \
- -L../lib/msecurity -lmsecurity \
- -L../../lib/acl -lacl \
- -L../../rxdef -lrxvolserver -lrxfsserver -L../../rx -lrx \
- -L../../lib/ko -lko \
- -L../../util -lutil \
- -L../../lwp -llwp @PLWP_LIB_FLAGS@ \
- $(RXKADLIB) \
- $(KAFS_LIBS) \
- -L../../rxdef -lbosserver \
- @LIB_roken@ \
- @LIBS@
-LIBDEPENDS = ../../rxdef/libbosserver.a ../../rx/librx.a \
- ../../lwp/liblwp.a ../../util/libutil.a \
- ../../lib/ko/libko.a \
- ../lib/msecurity/libmsecurity.a \
- ../../rxdef/libbosserver.a
-PROGS = bosserver
-SRCS = \
- kconf.c \
- bosserver.c \
- bosprocs.c
-
-HDRS = \
- kconf.h
-
-bosserver_OBJS = \
- kconf.o \
- bosserver.o \
- bosprocs.o
-
-.PHONY: all install uninstall depend tags clean
-
-all: $(PROGS)
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libexecdir)
- PROG_BIN='$(BOSSERVER_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(libexecdir)/$$f; \
- done
-
-uninstall:
- PROG_BIN='$(BOSSERVER_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(libexecdir)/$$f; \
- done
-
-bosserver: $(bosserver_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(bosserver_OBJS) $(LIBS)
-
-Makefile: Makefile.in ../../config.status
- cd ../..; CONFIG_FILES=milko/bos/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(SRCS)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(PROGS) $(OBJS) *~ *.o core *.core
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile config.status
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/milko/bos/bos_locl.h b/usr.sbin/afs/src/milko/bos/bos_locl.h
deleted file mode 100644
index 916d7be63b0..00000000000
--- a/usr.sbin/afs/src/milko/bos/bos_locl.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 1999, 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <config.h>
-
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <netinet/in.h>
-
-#include <rx/rx.h>
-#include <rx/rx_null.h>
-
-#include <ports.h>
-#include <ko.h>
-
-#include <ctype.h>
-
-#ifdef KERBEROS
-#ifdef HAVE_OPENSSL
-#include <openssl/des.h>
-#else
-#include <des.h>
-#endif
-#include <krb.h>
-#include <rxkad.h>
-#endif
-
-#include <netinit.h>
-#include <msecurity.h>
-
-#include <service.h>
-
-#include <roken.h>
-#include <err.h>
-#include <agetarg.h>
-
-#include <bos.h>
-#include <bos.ss.h>
-
-#include <kconf.h>
-
-void
-bosdebug (char *fmt, ...)
- __attribute__ ((format (printf, 1, 2)));
-
diff --git a/usr.sbin/afs/src/milko/bos/bosprocs.c b/usr.sbin/afs/src/milko/bos/bosprocs.c
deleted file mode 100644
index fb9977dbe07..00000000000
--- a/usr.sbin/afs/src/milko/bos/bosprocs.c
+++ /dev/null
@@ -1,515 +0,0 @@
-/*
- * Copyright (c) 1999, 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "bos_locl.h"
-
-RCSID("$arla: bosprocs.c,v 1.6 2002/06/02 21:12:15 lha Exp $");
-
-/*
- *
- */
-
-int
-BOZO_CreateBnode(struct rx_call *call,
- const char *type,
- const char *instance,
- const char *p1,
- const char *p2,
- const char *p3,
- const char *p4,
- const char *p5,
- const char *p6)
-{
- bosdebug ("BOZO_CreateNode: %s %s\n", type, instance);
-
- if (!sec_is_superuser(call))
- return VL_PERM;
-
- return 0;
-}
-
-/*
- *
- */
-
-int
-BOZO_DeleteBnode(struct rx_call *call,
- const char *instance)
-{
- bosdebug ("BOZO_DeleteBnode: %s\n", instance);
-
- return 0;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_GetStatus(struct rx_call *call,
- const char *instance,
- int32_t *inStat,
- char *statdescr)
-{
- bosdebug ("BOZO_GetStatus: %s\n", instance);
-
- snprintf(statdescr, BOZE_BSSIZE, "foo");
- *inStat = 0;
- return 0;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_SetStatus(struct rx_call *call,
- const char *instance,
- const int32_t status)
-{
- bosdebug ("BOZO_SetStatus: %s\n", instance);
-
- return 0;
-}
-
-/*
- *
- */
-
-int
-BOZO_EnumerateInstance(struct rx_call *call,
- const int32_t instance,
- char *iname)
-{
- bosdebug ("BOZO_EnumerateInstance: %d\n", instance);
-
- return -1;
-}
-
-/*
- *
- */
-
-int
-BOZO_GetInstanceInfo(struct rx_call *call,
- const char *instance,
- char *type,
- struct bozo_status *status)
-{
- bosdebug ("BOZO_GetInstanceInfo: %s\n", instance);
-
- strlcpy (type, "simple", BOZO_BSSIZE);
- memset (status, 0, sizeof(*status));
- return 0;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_GetInstanceParm(struct rx_call *call,
- const char *instance,
- const int32_t num,
- char *param)
-{
- bosdebug ("BOZO_GetInstanceParm: %s %d\n", instance, num);
-
- strlcpy (param, "foo", BOZO_BSSIZE);
- return 0;
-}
-
-/*
- *
- */
-
-int
-BOZO_AddSUser(struct rx_call *call, const char *name)
-{
- char *n;
- int ret;
-
- if (strchr(name, '@'))
- n = strdup (name);
- else
- asprintf (&n, "%s@%s", name, cell_getthiscell());
- if (n == NULL)
- return BZIO;
- if (strlen(n) > BOZO_BSSIZE)
- n[BOZO_BSSIZE - 1] = '\0';
- ret = sec_add_superuser (n);
- free (n);
- if (ret)
- return BZIO;
- return 0;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_DeleteSUser(struct rx_call *call, const char *name)
-{
- char *n;
- int ret;
-
- if (strchr(name, '@'))
- asprintf (&n, "%s", name);
- else
- asprintf (&n, "%s@%s", name, cell_getthiscell());
- if (n == NULL)
- return BZIO;
- if (strlen(n) > BOZO_BSSIZE)
- n[BOZO_BSSIZE - 1] = '\0';
- ret = sec_del_superuser (n);
- free (n);
- if (ret)
- return BZIO;
- return 0;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_ListSUsers(struct rx_call *call, const /*
- *
- */
-
-int32_t an, char *name)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_ListKeys(struct rx_call *call, const int32_t an, int32_t *kvno,
- struct bozo_key *key, struct bozo_keyInfo *keinfo)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_AddKey(struct rx_call *call, const int32_t an,
- const struct bozo_key *key)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_DeleteKey(struct rx_call *call, const /*
- *
- */
-
-int32_t an)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_SetCellName(struct rx_call *call, const char *name)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_GetCellName(struct rx_call *call, char *name)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_GetCellHost(struct rx_call *call, const int32_t awhich, char *name)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_AddCellHost(struct rx_call *call, const char *name)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_DeleteCellHost(struct rx_call *call, const char *name)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_SetTStatus(struct rx_call *call, const char *instance,
- const /*
- *
- */
-
-int32_t status)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_ShutdownAll(struct rx_call *call)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_RestartAll(struct rx_call *call)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_StartupAll(struct rx_call *call)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_SetNoAuthFlag(struct rx_call *call, const /*
- *
- */
-
-int32_t flag)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_ReBozo(struct rx_call *call)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_Restart(struct rx_call *call, const char *instance)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_Install(struct rx_call *call, const char *path, const int32_t size,
- const int32_t flags, const int32_t date)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_UnInstall(struct rx_call *call, const char *path)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_GetDates(struct rx_call *call, const char *path, int32_t *newtime,
- int32_t *baktime, int32_t *oldtime)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_Exec(struct rx_call *call, const char *cmd)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_Prune(struct rx_call *call, const int32_t flags)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_SetRestartTime(struct rx_call *call, const int32_t type,
- const struct bozo_netKTime *restartTime)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_GetRestartTime(struct rx_call *call, const int32_t type,
- struct bozo_netKTime *restartTime)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_GetLog(struct rx_call *call, const char *name)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_WaitAll(struct rx_call *call)
-{
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-BOZO_GetInstanceStrings(struct rx_call *call, const char *instance,
- char *errorname, char *spare1, char *spare2, char *spare3)
-{
- return -1;
-}
-
diff --git a/usr.sbin/afs/src/milko/bos/bosserver.c b/usr.sbin/afs/src/milko/bos/bosserver.c
deleted file mode 100644
index b1343274782..00000000000
--- a/usr.sbin/afs/src/milko/bos/bosserver.c
+++ /dev/null
@@ -1,670 +0,0 @@
-/*
- * Copyright (c) 1999, 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "bos_locl.h"
-
-RCSID("$arla: bosserver.c,v 1.23 2002/04/26 16:11:42 lha Exp $");
-
-static char *email = "root";
-static char *serverfile = MILKO_SYSCONFDIR "/server-file";
-
-
-typedef struct mtype {
- char *name; /* context name */
- char *program; /* program name */
- char *path; /* path to program */
- char *arg; /* string of arguments */
- char *coredir; /* where the corefile is */
- pid_t pid; /* pid of server */
- time_t last_start; /* last started */
- struct {
- unsigned email:1; /* email when event happens */
- unsigned savecore:1; /* try to save the corefile */
- unsigned trydebug:1; /* try to include debugging */
- unsigned restart_p:1; /* needs to be restarted */
- unsigned enablep:1; /* is enabled */
- } flags;
- struct mtype *next; /* next server on linked list */
-} mtype;
-
-struct mtype *servers = NULL;
-
-static int debug = 1;
-static char *bosserverprefix = NULL;
-
-/*
- *
- */
-
-void
-bosdebug (char *fmt, ...)
-{
- va_list args;
- if (!debug)
- return ;
-
- va_start (args, fmt);
- vfprintf (stderr, fmt, args);
- va_end(args);
-}
-
-/*
- * Send mail to irresponsible person
- */
-
-static void
-sendmail (char *person, char *name, char **message)
-{
- FILE *f;
- char *cmd;
- char hostname[400];
- int i;
-
- if (person == NULL) {
- bosdebug ("sendmail: person == NULL");
- return;
- }
-
- hostname[0] = '\0';
- gethostname (hostname, sizeof(hostname));
-
- asprintf (&cmd, "/usr/sbin/sendmail %s", person);
-
- f = popen (cmd, "w");
- if (f == NULL) {
- bosdebug ("sendmail: %s", cmd);
- free (cmd);
- return;
- }
-
- fprintf (f, "From: <bos-watcher@%s>\n", hostname);
- fprintf (f, "Subject: Death %s\n\n", name);
-
- i = 0;
- while (message[i]) {
- fprintf (f, "%s\n", message[i]);
- i++;
- }
-
- fflush (f);
- pclose (f);
-
- free (cmd);
-}
-
-/*
- * find server named `name' in linked list `old_srv'. If found
- * removed the found server from the list and return it.
- * If `name' isn't found, return NULL.
- */
-
-static struct mtype *
-find_and_remove_server (struct mtype **old_srv, const char *name)
-{
- struct mtype *srv = *old_srv;
-
- while (srv) {
- if (srv->name && strcasecmp (name, srv->name) == 0) {
- *old_srv = srv->next;
- return srv;
- }
- old_srv = &srv->next;
- srv = srv->next;
- }
- return NULL;
-}
-
-/*
- * find server named `name' in linked list `old_srv'.
- * If `name' isn't found, return NULL.
- */
-
-static struct mtype *
-find_server (struct mtype **old_srv, const char *name)
-{
- struct mtype *srv = *old_srv;
-
- while (srv) {
- if (srv->name && strcasecmp (name, srv->name) == 0) {
- return srv;
- }
- srv = srv->next;
- }
- return NULL;
-}
-
-
-/*
- *
- */
-
-static void
-kill_server (struct mtype *s)
-{
- if (s->pid)
- kill (s->pid, SIGTERM);
-}
-
-
-/*
- *
- */
-
-static void
-shutdown_servers (struct mtype *old_server)
-{
- while (old_server) {
- struct mtype *s = old_server;
- old_server = s->next;
- kill_server (s);
- if (s->arg)
- free (s->arg);
- free (s);
- }
-}
-
-/*
- *
- */
-
-static struct mtype *
-new_server (char *name)
-{
- struct mtype *s;
-
- s = emalloc (sizeof(*s));
- memset (s, 0, sizeof(*s));
- s->name = estrdup (name);
- return s;
-}
-
-/*
- *
- */
-
-static void
-write_serverfile (struct mtype *s, const char *fn)
-{
- FILE *f;
-
- f = fopen (fn, "w");
- if (f == NULL) {
- errx (1, "failed to open serverfile (%s) for writing",
- serverfile);
- }
- while (s) {
- fprintf (f, "%s %d\n",
- s->name,
- s->flags.enablep);
- s = s->next;
- }
- fclose (f);
-}
-
-/*
- *
- */
-
-static void
-read_config_file (char *filename)
-{
- kconf_context context;
- kconf_config_section *conf, *c;
- struct mtype *old_servers;
- struct mtype *s;
- const char *str;
- FILE *f;
- int ret;
-
- kconf_init (&context);
-
- ret = kconf_config_parse_file (filename, &conf);
- if (ret) {
- shutdown_servers (servers);
- errx (1, "read_config_file");
- }
-
- email =
- estrdup (kconf_config_get_string_default (context, conf,
- email,
- "bos",
- "email",
- NULL));
-
- serverfile =
- estrdup (kconf_config_get_string_default (context, conf,
- serverfile,
- "bos",
- "serverfile",
- NULL));
-
- /*
- * Save the old list of servers
- */
-
- old_servers = servers;
- servers = NULL;
- c = conf;
-
- while (c) {
- char *name;
-
- if (!strcmp (c->name, "bos")) {
- c = c->next;
- continue;
- }
-
- name = c->name;
-
- if (name == NULL) {
- shutdown_servers (servers);
- shutdown_servers (old_servers);
- errx (1, "error in config file (%s)", filename);
- }
-
- str = kconf_config_get_string (context, conf,
- name,
- "arguments",
- NULL);
-
- s = find_and_remove_server (&old_servers, name);
- if (s) {
- if (str && s->arg && strcmp (str, s->arg)) {
- s->flags.restart_p = 1;
- free (s->arg);
- s->arg = estrdup (str);
- }
-
- } else {
- s = new_server (name);
- if (str)
- s->arg = estrdup (str);
-
- s->flags.enablep = 1;
- s->flags.restart_p = 1;
- }
-
- s->flags.email = kconf_config_get_bool_default (context, conf,
- KCONF_FALSE,
- name,
- "email",
- NULL);
- s->program =
- estrdup (kconf_config_get_string_default (context, conf,
- name,
- name,
- "program",
- NULL));
-
- s->coredir =
- estrdup (kconf_config_get_string_default (context, conf,
- MILKO_LIBEXECDIR,
- name,
- "coredir",
- NULL));
- s->flags.savecore =
- kconf_config_get_bool_default (context, conf,
- KCONF_FALSE,
- name,
- "savecore",
- NULL);
-
-
- s->flags.trydebug =
- kconf_config_get_bool_default (context, conf,
- KCONF_FALSE,
- name,
- "trydebug",
- NULL);
-
- s->next = servers;
- servers = s;
- c = c->next;
- }
-
- f = fopen (serverfile, "r");
- if (f == NULL) {
- shutdown_servers (old_servers);
-/* err (1, "tried to open serverfile \"%s\"", serverfile);*/
- } else {
- int lineno = 0;
- while (!feof (f)) {
- char name[100];
- int enablep;
- lineno ++;
- ret = fscanf (f, "%99s %d", name, &enablep);
- if (ret == EOF)
- break;
- if (ret != 2) {
- errx (1, "error scaning line %d of serverfile (%s)",
- lineno, serverfile);
- }
-
- s = find_server (&servers, name);
- if (s && s->flags.enablep != enablep) {
- s->flags.enablep = enablep;
- s->flags.restart_p = enablep;
- }
- }
- fclose (f);
- }
-
-
- /*
- * nuke the old ones and write down a new serverfile
- */
-
- shutdown_servers (old_servers);
- write_serverfile (servers, serverfile);
-}
-
-/*
- * start the server `server'
- */
-
-static int
-start_server (struct mtype *server)
-{
- int i;
- time_t newtime = time(NULL);
-
- bosdebug ("starting server %s (%s)\n", server->name,
- server->program);
-
- if (newtime + 10 < server->last_start
- && server->last_start != 0) {
- /* XXX */
- bosdebug ("server %s looping, will try again in 10 min",
- server->name);
- return 0;
- }
- server->last_start = newtime;
-
- i = fork();
- switch (i) {
- case 0: {
- char *newargv[3];
-
- newargv[0] = server->program;
-#if 1
- newargv[1] = NULL;
-#else
- XXX insert argv parser here
-#endif
-
- if (debug == 0) {
- close (0);
- close (1);
- close (2);
- }
-
- execvp (server->program, newargv);
-
- bosdebug ("server %s failed with %s (%d)\n", server->program,
- strerror (errno), errno);
- exit (1);
- break;
- }
- case -1:
- bosdebug ("failed to fork with server %s with reson %s (%d)\n",
- server->name, strerror (errno), errno);
- server->pid = 0;
- return errno;
- break;
- default:
- server->pid = i;
- bosdebug ("started server %s with pid %d\n",
- server->name, server->pid);
- break;
- }
-
- return 0;
-}
-
-
-/*
- * GC processes, and start new if appropriate.
- */
-
-static int dead_children = 0;
-
-static PROCESS riperprocess;
-
-static void
-theriper (char *no_arg)
-{
- int status;
- char *msg[3] = { NULL, NULL, NULL };
- struct mtype *server = NULL;
- pid_t pid;
-
- while (1) {
- if (dead_children == 0) {
- bosdebug ("theriper: sleeping\n");
- LWP_WaitProcess ((char *)theriper);
- }
-
- bosdebug ("theriper: running\n");
-
- if (dead_children == 0) {
- bosdebug ("theriper: called without a dead child\n");
- continue;
- }
-
- if (dead_children < 0) {
- bosdebug ("theriper: called with negative dead child\n");
- exit(-1);
- }
-
- dead_children--;
-
- pid = wait (&status);
-
- if (WIFEXITED(status)) {
- asprintf (&msg[1],
- "normal exit: exit error %d", WEXITSTATUS(status));
- } else if (WIFSIGNALED(status)) {
- asprintf (&msg[1],
- "terminated by signal num %d %s", WTERMSIG(status),
- WCOREDUMP(status) ? "coredumped\n" : "");
- } else if (WIFSTOPPED(status)) {
- asprintf (&msg[1],
- "process stoped by signal %d", WSTOPSIG(status));
- } else {
- asprintf (&msg[1],
- "by unknown reason");
- }
- bosdebug (msg[1]);
-
- server = servers;
- while (server) {
- if (server->pid == pid) {
- msg[0] = server->name;
- if (server->flags.email)
- sendmail (email, server->name, msg);
- bosdebug ("%s was the killed, starting new", server->name);
- start_server (server);
- break;
- }
- server = server->next;
- }
- free (msg[1]);
- }
-}
-
-/*
- * Signal-handler for SIGCHLD
- */
-
-static void
-sigchild (int foo)
-{
- bosdebug ("child died\n");
-
- dead_children++;
-
- signal (SIGCHLD, sigchild);
- LWP_NoYieldSignal ((char *) theriper);
-}
-
-/*
- * bootstrap bosserver
- * Create riper thread and start all servers.
- */
-
-static int
-bosserver_init (void)
-{
- struct mtype *server;
- int i;
-
- i = LWP_CreateProcess (theriper, 0, 1, NULL, "the-riper", &riperprocess);
- if (i)
- errx (1, "LWP_CreateProcess returned %d", i);
-
- server = servers;
- while (server) {
- if (server->flags.enablep) {
- i = start_server(server);
- if (i)
- bosdebug ("server_server: returned %s (%d)",
- strerror (i), i);
- }
- server = server->next;
- }
-
- return 0;
-}
-
-
-/*
- *
- */
-
-static struct rx_service *bosservice = NULL;
-
-static char *cell = NULL;
-static char *realm = NULL;
-static int do_help = 0;
-static char *srvtab_file = NULL;
-static int no_auth = 0;
-static char *configfile = MILKO_SYSCONFDIR "/bos.conf";
-static char *log_file = "syslog";
-
-static struct agetargs args[] = {
- {"cell", 0, aarg_string, &cell, "what cell to use", NULL},
- {"realm", 0, aarg_string, &realm, "what realm to use"},
- {"prefix",'p', aarg_string, &bosserverprefix,
- "directory where servers is stored", NULL},
- {"noauth", 0, aarg_flag, &no_auth, "disable authentication checks"},
- {"debug", 'd', aarg_flag, &debug, "output debugging"},
- {"log", 'l', aarg_string, &log_file, "where output debugging"},
- {"help", 'h', aarg_flag, &do_help, "help"},
- {"srvtab",'s', aarg_string, &srvtab_file, "what srvtab to use"},
- {"configfile", 'f', aarg_string, &configfile, "configuration file"},
- { NULL, 0, aarg_end, NULL }
-};
-
-static void
-usage(int exit_code)
-{
- aarg_printusage(args, NULL, "", AARG_AFSSTYLE);
- exit (exit_code);
-}
-
-/*
- *
- */
-
-int
-main (int argc, char **argv)
-{
- Log_method *method;
- int optind = 0;
- int ret;
-
- setprogname(argv[0]);
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage (1);
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc) {
- printf("unknown option %s\n", *argv);
- return 1;
- }
-
- if (do_help)
- usage(0);
-
- if (bosserverprefix == NULL)
- bosserverprefix = MILKO_LIBEXECDIR;
-
- method = log_open (getprogname(), log_file);
- if (method == NULL)
- errx (1, "log_open failed");
- cell_init(0, method);
- ports_init();
-
- read_config_file (configfile);
-
- if (no_auth)
- sec_disable_superuser_check ();
-
- if (cell)
- cell_setthiscell (cell);
-
- network_kerberos_init (srvtab_file);
-
- signal (SIGCHLD, sigchild); /* XXX sigaction */
-
- ret = network_init(htons(afsbosport), "bos", BOS_SERVICE_ID,
- BOZO_ExecuteRequest, &bosservice, realm);
- if (ret)
- errx (1, "network_init failed with %d", ret);
-
- ret = bosserver_init();
- if (ret)
- errx(1, "bosserver_init: error %d", ret);
-
- printf("Milko bosserver %s-%s started\n", PACKAGE, VERSION);
-
- rx_SetMaxProcs(bosservice,5) ;
- rx_StartServer(1) ;
-
- /* NOTREACHED */
- return -1;
-}
diff --git a/usr.sbin/afs/src/milko/bos/kconf.c b/usr.sbin/afs/src/milko/bos/kconf.c
deleted file mode 100644
index 2afd76c34bb..00000000000
--- a/usr.sbin/afs/src/milko/bos/kconf.c
+++ /dev/null
@@ -1,800 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, 1999, 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <netinet/in.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <stdarg.h>
-#include <assert.h>
-#include "config.h"
-#include "roken.h"
-#include <err.h>
-#include <parse_time.h>
-#include "kconf.h"
-
-/* $Heimdal: config_file.c,v 1.38 1999/12/02 17:05:08 joda Exp $ */
-
-#ifdef RCSID
-RCSID("$arla: kconf.c,v 1.5 2002/10/01 23:34:57 lha Exp $");
-#endif
-
-static int parse_section(char *p, kconf_config_section **s,
- kconf_config_section **res,
- char **error_message);
-static int parse_binding(FILE *f, unsigned *lineno, char *p,
- kconf_config_binding **b,
- kconf_config_binding **parent,
- char **error_message);
-static int parse_list(FILE *f, unsigned *lineno, kconf_config_binding **parent,
- char **error_message);
-
-/*
- * Parse a section:
- *
- * [section]
- * foo = bar
- * b = {
- * a
- * }
- * ...
- *
- * starting at the line in `p', storing the resulting structure in
- * `s' and hooking it into `parent'.
- * Store the error message in `error_message'.
- */
-
-static int
-parse_section(char *p, kconf_config_section **s, kconf_config_section **parent,
- char **error_message)
-{
- char *p1;
- kconf_config_section *tmp;
-
- p1 = strchr (p + 1, ']');
- if (p1 == NULL) {
- *error_message = "missing ]";
- return -1;
- }
- *p1 = '\0';
- tmp = malloc(sizeof(*tmp));
- if (tmp == NULL) {
- *error_message = "out of memory";
- return -1;
- }
- tmp->name = strdup(p+1);
- if (tmp->name == NULL) {
- *error_message = "out of memory";
- return -1;
- }
- tmp->type = kconf_config_list;
- tmp->u.list = NULL;
- tmp->next = NULL;
- if (*s)
- (*s)->next = tmp;
- else
- *parent = tmp;
- *s = tmp;
- return 0;
-}
-
-/*
- * Parse a brace-enclosed list from `f', hooking in the structure at
- * `parent'.
- * Store the error message in `error_message'.
- */
-
-static int
-parse_list(FILE *f, unsigned *lineno, kconf_config_binding **parent,
- char **error_message)
-{
- char buf[BUFSIZ];
- int ret;
- kconf_config_binding *b = NULL;
- unsigned beg_lineno = *lineno;
-
- while(fgets(buf, sizeof(buf), f) != NULL) {
- char *p;
-
- ++*lineno;
- buf[strcspn(buf, "\n")] = '\0';
- p = buf;
- while(isspace((unsigned char)*p))
- ++p;
- if (*p == '#' || *p == ';' || *p == '\0')
- continue;
- if (*p == '}')
- return 0;
- if (*p == '\0')
- continue;
- ret = parse_binding (f, lineno, p, &b, parent, error_message);
- if (ret)
- return ret;
- }
- *lineno = beg_lineno;
- *error_message = "unclosed {";
- return -1;
-}
-
-/*
- *
- */
-
-static int
-parse_binding(FILE *f, unsigned *lineno, char *p,
- kconf_config_binding **b, kconf_config_binding **parent,
- char **error_message)
-{
- kconf_config_binding *tmp;
- char *p1, *p2;
- int ret = 0;
-
- p1 = p;
- while (*p && *p != '=' && !isspace((unsigned char)*p))
- ++p;
- if (*p == '\0') {
- *error_message = "no =";
- return -1;
- }
- p2 = p;
- while (isspace((unsigned char)*p))
- ++p;
- if (*p != '=') {
- *error_message = "no =";
- return -1;
- }
- ++p;
- while(isspace((unsigned char)*p))
- ++p;
- tmp = malloc(sizeof(*tmp));
- if (tmp == NULL) {
- *error_message = "out of memory";
- return -1;
- }
- *p2 = '\0';
- tmp->name = strdup(p1);
- tmp->next = NULL;
- if (*p == '{') {
- tmp->type = kconf_config_list;
- tmp->u.list = NULL;
- ret = parse_list (f, lineno, &tmp->u.list, error_message);
- } else {
- p1 = p;
- p = p1 + strlen(p1);
- while(p > p1 && isspace((unsigned char)*(p-1)))
- --p;
- *p = '\0';
- tmp->type = kconf_config_string;
- tmp->u.string = strdup(p1);
- }
- if (*b)
- (*b)->next = tmp;
- else
- *parent = tmp;
- *b = tmp;
- return ret;
-}
-
-int
-kconf_init (kconf_context *context)
-{
- *context = emalloc (sizeof(*context));
- if (*context == NULL) return errno;
- (*context)->cf = NULL;
- return 0;
-}
-
-void
-kconf_free (kconf_context context)
-{
- free (context);
-}
-
-/*
- * Parse the config file `fname', generating the structures into `res'
- * returning error messages in `error_message'
- */
-
-int
-kconf_config_parse_file_debug (const char *fname,
- kconf_config_section **res,
- unsigned *lineno,
- char **error_message)
-{
- FILE *f;
- kconf_config_section *s;
- kconf_config_binding *b;
- char buf[BUFSIZ];
- int ret;
-
- s = NULL;
- b = NULL;
- *lineno = 0;
- f = fopen (fname, "r");
- if (f == NULL) {
- *error_message = "cannot open file";
- return -1;
- }
- *res = NULL;
- while (fgets(buf, sizeof(buf), f) != NULL) {
- char *p;
-
- ++*lineno;
- buf[strcspn(buf, "\n")] = '\0';
- p = buf;
- while(isspace((unsigned char)*p))
- ++p;
- if (*p == '#' || *p == ';')
- continue;
- if (*p == '[') {
- ret = parse_section(p, &s, res, error_message);
- if (ret)
- return ret;
- b = NULL;
- } else if (*p == '}') {
- *error_message = "unmatched }";
- return -1;
- } else if(*p != '\0') {
- ret = parse_binding(f, lineno, p, &b, &s->u.list, error_message);
- if (ret)
- return ret;
- }
- }
- fclose (f);
- return 0;
-}
-
-int
-kconf_config_parse_file (const char *fname, kconf_config_section **res)
-{
- char *foo;
- unsigned lineno;
-
- return kconf_config_parse_file_debug (fname, res, &lineno, &foo);
-}
-
-
-static void
-free_binding (kconf_context context, kconf_config_binding *b)
-{
- kconf_config_binding *next_b;
-
- while (b) {
- free (b->name);
- if (b->type == kconf_config_string)
- free (b->u.string);
- else if (b->type == kconf_config_list)
- free_binding (context, b->u.list);
- else
- errx (1, "unknown binding type (%d) in free_binding",
- b->type);
- next_b = b->next;
- free (b);
- b = next_b;
- }
-}
-
-int
-kconf_config_file_free (kconf_context context, kconf_config_section *s)
-{
- free_binding (context, s);
- return 0;
-}
-
-const void *
-kconf_config_get_next (kconf_context context,
- kconf_config_section *c,
- kconf_config_binding **pointer,
- int type,
- ...)
-{
- const char *ret;
- va_list args;
-
- va_start(args, type);
- ret = kconf_config_vget_next (context, c, pointer, type, args);
- va_end(args);
- return ret;
-}
-
-const void *
-kconf_config_vget_next (kconf_context context,
- kconf_config_section *c,
- kconf_config_binding **pointer,
- int type,
- va_list args)
-{
- kconf_config_binding *b;
- const char *p;
-
- if(c == NULL)
- c = context->cf;
-
- if (c == NULL)
- return NULL;
-
- if (*pointer == NULL) {
- b = (c != NULL) ? c : context->cf;
- p = va_arg(args, const char *);
- if (p == NULL)
- return NULL;
- } else {
- b = *pointer;
- p = b->name;
- b = b->next;
- }
-
- while (b) {
- if (strcmp (b->name, p) == 0) {
- if (*pointer == NULL)
- p = va_arg(args, const char *);
- else
- p = NULL;
- if (type == b->type && p == NULL) {
- *pointer = b;
- return b->u.generic;
- } else if(b->type == kconf_config_list && p != NULL) {
- b = b->u.list;
- } else {
- return NULL;
- }
- } else {
- b = b->next;
- }
- }
- return NULL;
-}
-
-const void *
-kconf_config_get (kconf_context context,
- kconf_config_section *c,
- int type,
- ...)
-{
- const void *ret;
- va_list args;
-
- va_start(args, type);
- ret = kconf_config_vget (context, c, type, args);
- va_end(args);
- return ret;
-}
-
-const void *
-kconf_config_vget (kconf_context context,
- kconf_config_section *c,
- int type,
- va_list args)
-{
- kconf_config_binding *foo = NULL;
-
- return kconf_config_vget_next (context, c, &foo, type, args);
-}
-
-const kconf_config_binding *
-kconf_config_get_list (kconf_context context,
- kconf_config_section *c,
- ...)
-{
- const kconf_config_binding *ret;
- va_list args;
-
- va_start(args, c);
- ret = kconf_config_vget_list (context, c, args);
- va_end(args);
- return ret;
-}
-
-const kconf_config_binding *
-kconf_config_vget_list (kconf_context context,
- kconf_config_section *c,
- va_list args)
-{
- return kconf_config_vget (context, c, kconf_config_list, args);
-}
-
-const char *
-kconf_config_get_string (kconf_context context,
- kconf_config_section *c,
- ...)
-{
- const char *ret;
- va_list args;
-
- va_start(args, c);
- ret = kconf_config_vget_string (context, c, args);
- va_end(args);
- return ret;
-}
-
-const char *
-kconf_config_get_string_default (kconf_context context,
- kconf_config_section *c,
- const char *def,
- ...)
-{
- const char *ret;
- va_list args;
-
- va_start(args, def);
- ret = kconf_config_vget_string (context, c, args);
- va_end(args);
- if (ret == NULL)
- return def;
- return ret;
-}
-
-const char *
-kconf_config_vget_string (kconf_context context,
- kconf_config_section *c,
- va_list args)
-{
- return kconf_config_vget (context, c, kconf_config_string, args);
-}
-
-char **
-kconf_config_vget_strings(kconf_context context,
- kconf_config_section *c,
- va_list args)
-{
- char **strings = NULL;
- int nstr = 0;
- kconf_config_binding *b = NULL;
- const char *p;
-
- while((p = kconf_config_vget_next(context, c, &b,
- kconf_config_string, args))) {
- char *tmp = strdup(p);
- char *pos = NULL;
- char *s;
- if(tmp == NULL)
- goto cleanup;
- s = strtok_r(tmp, " \t", &pos);
- while(s){
- char **tmp = realloc(strings, (nstr + 1) * sizeof(*strings));
- if(tmp == NULL)
- goto cleanup;
- strings = tmp;
- strings[nstr] = strdup(s);
- nstr++;
- if(strings[nstr-1] == NULL)
- goto cleanup;
- s = strtok_r(NULL, " \t", &pos);
- }
- free(tmp);
- }
- if(nstr){
- char **tmp = realloc(strings, (nstr + 1) * sizeof(*strings));
- if(strings == NULL)
- goto cleanup;
- strings = tmp;
- strings[nstr] = NULL;
- }
- return strings;
- cleanup:
- while(nstr--)
- free(strings[nstr]);
- free(strings);
- return NULL;
-
-}
-
-char**
-kconf_config_get_strings(kconf_context context,
- kconf_config_section *c,
- ...)
-{
- va_list ap;
- char **ret;
- va_start(ap, c);
- ret = kconf_config_vget_strings(context, c, ap);
- va_end(ap);
- return ret;
-}
-
-void
-kconf_config_free_strings(char **strings)
-{
- char **s = strings;
- while(s && *s){
- free(*s);
- s++;
- }
- free(strings);
-}
-
-kconf_boolean
-kconf_config_vget_bool_default (kconf_context context,
- kconf_config_section *c,
- kconf_boolean def_value,
- va_list args)
-{
- const char *str;
- str = kconf_config_vget_string (context, c, args);
- if(str == NULL)
- return def_value;
- if(strcasecmp(str, "yes") == 0 ||
- strcasecmp(str, "true") == 0 ||
- atoi(str)) return KCONF_TRUE;
- return KCONF_FALSE;
-}
-
-kconf_boolean
-kconf_config_vget_bool (kconf_context context,
- kconf_config_section *c,
- va_list args)
-{
- return kconf_config_vget_bool_default (context, c, KCONF_FALSE, args);
-}
-
-kconf_boolean
-kconf_config_get_bool_default (kconf_context context,
- kconf_config_section *c,
- kconf_boolean def_value,
- ...)
-{
- va_list ap;
- kconf_boolean ret;
- va_start(ap, def_value);
- ret = kconf_config_vget_bool_default(context, c, def_value, ap);
- va_end(ap);
- return ret;
-}
-
-kconf_boolean
-kconf_config_get_bool (kconf_context context,
- kconf_config_section *c,
- ...)
-{
- va_list ap;
- kconf_boolean ret;
- va_start(ap, c);
- ret = kconf_config_vget_bool (context, c, ap);
- va_end(ap);
- return ret;
-}
-
-int
-kconf_config_vget_time_default (kconf_context context,
- kconf_config_section *c,
- int def_value,
- va_list args)
-{
- const char *str;
- str = kconf_config_vget_string (context, c, args);
- if(str == NULL)
- return def_value;
- return parse_time (str, NULL);
-}
-
-int
-kconf_config_vget_time (kconf_context context,
- kconf_config_section *c,
- va_list args)
-{
- return kconf_config_vget_time_default (context, c, -1, args);
-}
-
-int
-kconf_config_get_time_default (kconf_context context,
- kconf_config_section *c,
- int def_value,
- ...)
-{
- va_list ap;
- int ret;
- va_start(ap, def_value);
- ret = kconf_config_vget_time_default(context, c, def_value, ap);
- va_end(ap);
- return ret;
-}
-
-int
-kconf_config_get_time (kconf_context context,
- kconf_config_section *c,
- ...)
-{
- va_list ap;
- int ret;
- va_start(ap, c);
- ret = kconf_config_vget_time (context, c, ap);
- va_end(ap);
- return ret;
-}
-
-
-int
-kconf_config_vget_int_default (kconf_context context,
- kconf_config_section *c,
- int def_value,
- va_list args)
-{
- const char *str;
- str = kconf_config_vget_string (context, c, args);
- if(str == NULL)
- return def_value;
- else {
- char *endptr;
- long l;
- l = strtol(str, &endptr, 0);
- if (endptr == str)
- return def_value;
- else
- return l;
- }
-}
-
-int
-kconf_config_vget_int (kconf_context context,
- kconf_config_section *c,
- va_list args)
-{
- return kconf_config_vget_int_default (context, c, -1, args);
-}
-
-int
-kconf_config_get_int_default (kconf_context context,
- kconf_config_section *c,
- int def_value,
- ...)
-{
- va_list ap;
- int ret;
- va_start(ap, def_value);
- ret = kconf_config_vget_int_default(context, c, def_value, ap);
- va_end(ap);
- return ret;
-}
-
-int
-kconf_config_get_int (kconf_context context,
- kconf_config_section *c,
- ...)
-{
- va_list ap;
- int ret;
- va_start(ap, c);
- ret = kconf_config_vget_int (context, c, ap);
- va_end(ap);
- return ret;
-}
-
-#ifdef TEST
-
-static int print_list (kconf_context context, FILE *f,
- kconf_config_binding *l, unsigned level);
-static int print_binding (kconf_context context, FILE *f,
- kconf_config_binding *b, unsigned level);
-static int print_section (kconf_context context, FILE *f,
- kconf_config_section *s, unsigned level);
-static int print_config (kconf_context context, FILE *f,
- kconf_config_section *c);
-
-static void
-tab (FILE *f, unsigned count)
-{
- while(count--)
- fprintf (f, "\t");
-}
-
-static int
-print_list (kconf_context context,
- FILE *f,
- kconf_config_binding *l,
- unsigned level)
-{
- while(l) {
- print_binding (context, f, l, level);
- l = l->next;
- }
- return 0;
-}
-
-static int
-print_binding (kconf_context context,
- FILE *f,
- kconf_config_binding *b,
- unsigned level)
-{
- tab (f, level);
- fprintf (f, "%s = ", b->name);
- if (b->type == kconf_config_string)
- fprintf (f, "%s\n", b->u.string);
- else if (b->type == kconf_config_list) {
- fprintf (f, "{\n");
- print_list (context, f, b->u.list, level + 1);
- tab (f, level);
- fprintf (f, "}\n");
- } else
- errx (1, "unknown binding type (%d) in print_binding", b->type);
- return 0;
-}
-
-static int
-print_section (kconf_context context, FILE *f, kconf_config_section *s,
- unsigned level)
-{
- fprintf (f, "[%s]\n", s->name);
- print_list (context, f, s->u.list, level + 1);
- return 0;
-}
-
-static int
-print_config (kconf_context context, FILE *f, kconf_config_section *c)
-{
- while (c) {
- print_section (context, f, c, 0);
- c = c->next;
- }
- return 0;
-}
-
-
-int
-main(void)
-{
- kconf_context context;
- kconf_config_section *c;
- int ret;
-
- kconf_init (&context);
-
- ret = kconf_config_parse_file ("/etc/krb5.conf", &c);
- if (ret) errx (1, "kconf_config_parse_file");
-
- print_config (context, stdout, c);
- printf ("[libdefaults]ticket_lifetime = %s\n",
- kconf_config_get_string (context, c,
- "libdefaults",
- "ticket_lifetime",
- NULL));
- printf ("[realms]foo = %s\n",
- kconf_config_get_string (context, c,
- "realms",
- "foo",
- NULL));
- printf ("[realms]ATHENA.MIT.EDU/v4_instance_convert/lithium = %s\n",
- kconf_config_get_string (context, c,
- "realms",
- "ATHENA.MIT.EDU",
- "v4_instance_convert",
- "lithium",
- NULL));
- kconf_free (context);
- return 0;
-}
-
-#endif /* TEST */
diff --git a/usr.sbin/afs/src/milko/bos/kconf.h b/usr.sbin/afs/src/milko/bos/kconf.h
deleted file mode 100644
index 9ca0fc01990..00000000000
--- a/usr.sbin/afs/src/milko/bos/kconf.h
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, 1999, 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef KCONF_H
-#define KCONF_H 1
-
-struct kconf_config_binding {
- enum { kconf_config_string, kconf_config_list } type;
- char *name;
- struct kconf_config_binding *next;
- union {
- char *string;
- struct kconf_config_binding *list;
- void *generic;
- } u;
-};
-
-typedef struct kconf_config_binding kconf_config_binding;
-
-typedef kconf_config_binding kconf_config_section;
-
-struct kconf_context {
- kconf_config_section *cf;
-};
-
-typedef struct kconf_context * kconf_context;
-
-typedef enum { KCONF_FALSE = 0, KCONF_TRUE = 1 } kconf_boolean;
-
-
-int
-kconf_init (kconf_context *context);
-
-void
-kconf_free (kconf_context context);
-
-int
-kconf_config_parse_file_debug (const char *fname,
- kconf_config_section **res,
- unsigned *lineno,
- char **error_message);
-int
-kconf_config_parse_file (const char *fname, kconf_config_section **res);
-
-int
-kconf_config_file_free (kconf_context context, kconf_config_section *s);
-
-const void *
-kconf_config_get_next (kconf_context context,
- kconf_config_section *c,
- kconf_config_binding **pointer,
- int type,
- ...);
-const void *
-kconf_config_vget_next (kconf_context context,
- kconf_config_section *c,
- kconf_config_binding **pointer,
- int type,
- va_list args);
-const void *
-kconf_config_get (kconf_context context,
- kconf_config_section *c,
- int type,
- ...);
-
-const void *
-kconf_config_vget (kconf_context context,
- kconf_config_section *c,
- int type,
- va_list args);
-
-const kconf_config_binding *
-kconf_config_get_list (kconf_context context,
- kconf_config_section *c,
- ...);
-
-const kconf_config_binding *
-kconf_config_vget_list (kconf_context context,
- kconf_config_section *c,
- va_list args);
-
-const char *
-kconf_config_get_string (kconf_context context,
- kconf_config_section *c,
- ...);
-
-const char *
-kconf_config_get_string_default (kconf_context context,
- kconf_config_section *c,
- const char *def,
- ...);
-
-const char *
-kconf_config_vget_string (kconf_context context,
- kconf_config_section *c,
- va_list args);
-
-
-char **
-kconf_config_vget_strings(kconf_context context,
- kconf_config_section *c,
- va_list args);
-
-
-char**
-kconf_config_get_strings(kconf_context context,
- kconf_config_section *c,
- ...);
-
-void
-kconf_config_free_strings(char **strings);
-
-kconf_boolean
-kconf_config_vget_bool_default (kconf_context context,
- kconf_config_section *c,
- kconf_boolean def_value,
- va_list args);
-
-
-kconf_boolean
-kconf_config_vget_bool (kconf_context context,
- kconf_config_section *c,
- va_list args);
-
-kconf_boolean
-kconf_config_get_bool_default (kconf_context context,
- kconf_config_section *c,
- kconf_boolean def_value,
- ...);
-
-kconf_boolean
-kconf_config_get_bool (kconf_context context,
- kconf_config_section *c,
- ...);
-
-int
-kconf_config_vget_time_default (kconf_context context,
- kconf_config_section *c,
- int def_value,
- va_list args);
-
-int
-kconf_config_vget_time (kconf_context context,
- kconf_config_section *c,
- va_list args);
-
-int
-kconf_config_get_time_default (kconf_context context,
- kconf_config_section *c,
- int def_value,
- ...);
-
-int
-kconf_config_get_time (kconf_context context,
- kconf_config_section *c,
- ...);
-
-int
-kconf_config_vget_int_default (kconf_context context,
- kconf_config_section *c,
- int def_value,
- va_list args);
-
-int
-kconf_config_vget_int (kconf_context context,
- kconf_config_section *c,
- va_list args);
-
-int
-kconf_config_get_int_default (kconf_context context,
- kconf_config_section *c,
- int def_value,
- ...);
-
-int
-kconf_config_get_int (kconf_context context,
- kconf_config_section *c,
- ...);
-
-#endif /* KCONF_H */
diff --git a/usr.sbin/afs/src/milko/fs/Makefile.in b/usr.sbin/afs/src/milko/fs/Makefile.in
deleted file mode 100644
index 432be5ae80e..00000000000
--- a/usr.sbin/afs/src/milko/fs/Makefile.in
+++ /dev/null
@@ -1,142 +0,0 @@
-# $KTH: Makefile.in,v 1.19 2000/10/10 20:56:23 lha Exp $
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-sysconfdir = @sysconfdir@
-transform = @program_transform_name@
-
-FSERVER_BIN = fileserver
-
-DEFS = @DEFS@
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-LDFLAGS = @LDFLAGS@
-
-ETAGS = etags
-MAKEDEPEND = makedepend
-AFSWSROOT = /usr/afsws
-RXKADINC = -I$(srcdir)/../rxkad
-INCLUDES = -I$(srcdir)/../.. \
- -I../../include \
- -I$(srcdir)/../../include \
- -I$(srcdir)/../include \
- -I$(srcdir)/../lib/ropa \
- -I$(srcdir)/../../lib/bufdir \
- -I$(srcdir)/../lib/voldb \
- -I$(srcdir)/../lib/mlog \
- -I$(srcdir)/../lib/msecurity \
- -I$(srcdir)/../lib/dpart \
- -I$(srcdir)/../lib/vld \
- -I$(srcdir)/../lib/vstatus \
- -I../lib/vstatus \
- -I../../rxdef \
- @INC_roken@ \
- $(RXKADINC)
-DEFINES = -DDEBUG
-REALCFLAGS = $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) -DRXDEBUG
-RXKADLIB = @MILKO_RXKAD_LIBS@
-KAFS_LIBS = @AIX_EXTRA_KAFS@ @KAFS_LIBS@
-LIBS = -L../lib/mlog -lmlog \
- -L../lib/vld -lvld \
- -L../lib/vstatus -lvstatus \
- -L../lib/voldb -lvoldb \
- -L../lib/dpart -ldpart \
- -L../lib/msecurity -lmsecurity \
- -L../lib/ropa -lropa \
- -L../../lib/acl -lacl \
- -L../../lib/bufdir -lbufdir \
- -L../../rxdef -lrxfsserver \
- -L../../rxdef -lptclient \
- -L../../lib/ko -lko \
- -L../../util -lutil \
- -L../../rxdef -lrxvolserver -lrxfsserver -L../../rx -lrx \
- -L../../lwp -llwp @PLWP_LIB_FLAGS@ \
- $(RXKADLIB) \
- $(KAFS_LIBS) \
- @LIB_roken@ \
- @LIBS@
-LIBDEPENDS = ../../rxdef/librxdefclient.a ../../rx/librx.a \
- ../../lwp/liblwp.a ../../util/libutil.a \
- ../../lib/ko/libko.a \
- ../lib/voldb/libvoldb.a ../lib/vld/libvld.a \
- ../lib/msecurity/libmsecurity.a ../../lib/ko/libko.a \
- ../lib/dpart/libdpart.a ../../rxdef/libptclient.a \
- ../../lib/acl/libacl.a ../lib/ropa/libropa.a \
- ../lib/mlog/libmlog.a
-PROGS = fileserver
-SRCS = \
- fileserver.c \
- fsprocs.c \
- volprocs.c \
- connsec.c
-
-HDRS = \
- fs_def.h \
- fsrv_locl.h
-
-fileserver_OBJS = \
- fileserver.o \
- fsprocs.o \
- volprocs.o \
- connsec.o
-
-.PHONY: all install uninstall depend tags clean
-
-all: $(PROGS)
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libexecdir)
- PROG_BIN='$(FSERVER_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(libexecdir)/$$f; \
- done
-
-uninstall:
- PROG_BIN='$(FSERVER_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(libexecdir)/$$f; \
- done
-
-fileserver: $(fileserver_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(fileserver_OBJS) $(LIBS)
-
-Makefile: Makefile.in ../../config.status
- cd ../..; CONFIG_FILES=milko/fs/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(SRCS)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(PROGS) $(OBJS) *~ *.o core *.core
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile config.status
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/milko/fs/connsec.c b/usr.sbin/afs/src/milko/fs/connsec.c
deleted file mode 100644
index af3213b5e67..00000000000
--- a/usr.sbin/afs/src/milko/fs/connsec.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Copyright (c) 1999 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fsrv_locl.h"
-
-#include "pts.cs.h"
-
-#include "arlalib.h"
-
-RCSID("$arla: connsec.c,v 1.18 2002/02/07 17:59:39 lha Exp $");
-
-int
-fs_connsec_nametoid(namelist *nlist, idlist *ilist)
-{
- int error = ARLA_CALL_DEAD;
- int first = 0;
- struct db_server_context conn_context;
- struct rx_connection *conn;
-
-retry:
-
- for (conn = arlalib_first_db(&conn_context,
- NULL, NULL, afsprport, PR_SERVICE_ID,
- arlalib_getauthflag (0, 1, 0, 0));
- conn != NULL && arlalib_try_next_db(error);
- conn = arlalib_next_db(&conn_context)) {
- error = PR_NameToID(conn, nlist, ilist);
- }
-
- free_db_server_context(&conn_context);
-
- if (error == RXKADEXPIRED && first == 0) {
- ++first;
- goto retry;
- }
-
- if (error) {
- fprintf(stderr, "PR_NameToID error: %s(%d)\n",
- koerr_gettext(error), error);
- return error;
- }
-
- return 0;
-}
-
-int
-fs_connsec_idtoname(idlist *ilist, namelist *nlist)
-{
- int error = ARLA_CALL_DEAD;
- int first = 0;
- struct db_server_context conn_context;
- struct rx_connection *conn;
-
-retry:
-
- for (conn = arlalib_first_db(&conn_context,
- NULL, NULL, afsprport, PR_SERVICE_ID,
- arlalib_getauthflag (0, 1, 0, 0));
- conn != NULL && arlalib_try_next_db(error);
- conn = arlalib_next_db(&conn_context)) {
- error = PR_IDToName(conn, ilist, nlist);
- }
-
- free_db_server_context(&conn_context);
-
- if (error == RXKADEXPIRED && first == 0) {
- ++first;
- goto retry;
- }
-
- if (error) {
- if (koerr_gettext(error))
- fprintf(stderr, "PR_IDToName error: %s(%d)\n",
- koerr_gettext(error), error);
- else
- fprintf(stderr, "PR_IDToName error: %d\n", error);
- return error;
- }
-
- return 0;
-}
-
-static void
-fs_connsec_anonymous(struct fs_security_context *sec)
-{
- sec->uid = PR_ANONYMOUSID;
- sec->cps->len = 2;
- sec->cps->val = malloc(2*sizeof(uint32_t));
- if (sec->cps->val == NULL) {
- sec->cps->len = 0;
- return; /* XXX */
- }
- sec->cps->val[0] = PR_ANYUSERID;
- sec->cps->val[1] = PR_ANONYMOUSID;
-}
-
-static void
-fs_connsec_createconn(struct rx_connection *conn)
-{
- struct fs_security_context *sec;
- namelist nlist;
- idlist ilist;
- char rname[PR_MAXNAMELEN];
- int error = ARLA_CALL_DEAD;
- char aname[ANAME_SZ];
- char inst[INST_SZ];
- char realm[REALM_SZ];
- int32_t over;
- struct db_server_context conn_context;
- struct rx_connection *out_conn;
- int i;
-
- if (conn->rock)
- return;
-
- sec = malloc(sizeof(struct fs_security_context));
- if (sec == NULL)
- return; /* XXX */
-
- sec->superuser = 0;
- sec->ref = 1;
- sec->cps = malloc(sizeof(prlist));
- if (sec->cps == NULL)
- return; /* XXX */
-
-
- conn->rock = sec;
-
- if (sec_getname(conn, aname, inst, realm)) {
- fs_connsec_anonymous(sec);
- return;
- }
-
- /*
- * XXX It is not a good thing to truncate, allows for spoofing?
- * Perhaps we should just deny access if fullname is to long.
- */
-
- if (!strcasecmp(realm, netinit_getrealm()))
- strlcpy(rname,
- krb_unparse_name_long(aname, inst, NULL),
- sizeof(rname));
- else
- strlcpy(rname,
- krb_unparse_name_long(aname, inst, strlwr(realm)),
- sizeof(rname));
-
- nlist.len = 1;
- nlist.val = &rname;
- ilist.val = NULL;
-
- for (out_conn = arlalib_first_db(&conn_context,
- NULL, NULL, afsprport, PR_SERVICE_ID,
- arlalib_getauthflag (0, 1, 0, 0));
- out_conn != NULL && arlalib_try_next_db(error);
- out_conn = arlalib_next_db(&conn_context)) {
- error = PR_NameToID(out_conn, &nlist, &ilist);
- if (error == 0)
- break;
- }
-
- if (error) {
- fprintf(stderr, "PR_NameToID error: %s(%d)\n",
- koerr_gettext(error), error);
- free(ilist.val);
-
- fs_connsec_anonymous(sec);
- free_db_server_context(&conn_context);
- return;
- }
-
- fprintf(stderr, "ID is %d\n", ilist.val[0]);
- sec->uid = ilist.val[0];
- free(ilist.val);
-
- error = PR_GetCPS(out_conn, sec->uid, sec->cps, &over);
-
- free_db_server_context(&conn_context);
-
- if (error) {
- fprintf(stderr, "PR_GetCPS error: %s(%d)\n",
- koerr_gettext(error), error);
- fs_connsec_anonymous(sec);
- return;
- }
-
- for (i = 0; i < sec->cps->len; i++) {
- if (sec->cps->val[i] == PR_SYSADMINID) {
- sec->superuser = 1;
- break;
- }
- }
-}
-
-void
-fs_connsec_destroyconn(struct rx_connection *conn)
-{
- if (conn->rock == NULL)
- return;
-
- fs_connsec_context_put(conn->rock);
- conn->rock = NULL;
-}
-
-struct fs_security_context *
-fs_connsec_context_get(struct rx_connection *conn)
-{
- struct fs_security_context *sec;
-
- fs_connsec_createconn(conn);
-
- sec = conn->rock;
-
- assert(sec);
-
- sec->ref++;
- return sec;
-}
-
-void
-fs_connsec_context_put(struct fs_security_context *sec)
-{
- assert(sec->ref > 0);
-
- sec->ref--;
-
- if (sec->ref == 0) {
- free(sec->cps->val);
- free(sec->cps);
- free(sec);
- }
-}
diff --git a/usr.sbin/afs/src/milko/fs/connsec.h b/usr.sbin/afs/src/milko/fs/connsec.h
deleted file mode 100644
index 93e844086d6..00000000000
--- a/usr.sbin/afs/src/milko/fs/connsec.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-void
-fs_connsec_destroyconn(struct rx_connection *conn);
-
-struct fs_security_context *
-fs_connsec_context_get(struct rx_connection *conn);
-
-void
-fs_connsec_context_put(struct fs_security_context *sec);
-
-int
-fs_connsec_nametoid(namelist *nlist, idlist *ilist);
-
-int
-fs_connsec_idtoname(idlist *ilist, namelist *nlist);
diff --git a/usr.sbin/afs/src/milko/fs/dump.c b/usr.sbin/afs/src/milko/fs/dump.c
deleted file mode 100644
index 4360cff1fd7..00000000000
--- a/usr.sbin/afs/src/milko/fs/dump.c
+++ /dev/null
@@ -1,919 +0,0 @@
-/*
- * Copyright (c) 1999 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fsrv_locl.h"
-
-RCSID("$Id");
-
-static int
-readbyte(struct rx_call *call, unsigned char *b)
-{
- int ret;
-
- ret = rx_Read (call, b, 1);
- if (ret != 1) {
- mlog_log(MDEBVOLDB, "readbyte: read %d wanted %d", ret, 1);
- return VOLSERFAILEDOP;
- }
- return 0;
-}
-
-static int
-readint32(struct rx_call *call, uint32_t *d)
-{
- int ret;
-
- ret = rx_Read (call, d, 4);
- if (ret != 4) {
- mlog_log(MDEBVOLDB, "readint32: read %d wanted %d", ret, 4);
- return VOLSERFAILEDOP;
- }
- *d = ntohl(*d);
- return 0;
-}
-
-static int
-readint16(struct rx_call *call, uint16_t *d)
-{
- int ret;
-
- ret = rx_Read (call, d, 2);
- if (ret != 2) {
- mlog_log(MDEBVOLDB, "readint16: read %d wanted %d", ret, 2);
- return VOLSERFAILEDOP;
- }
- *d = ntohs(*d);
- return 0;
-}
-
-static int
-readstring(struct rx_call *call, char **ret_string)
-{
- int malloc_size = 10;
- int i = 0;
- char *s;
- char *new_s;
- int ret;
-
- s = malloc(malloc_size);
- if (s == NULL)
- return ENOMEM;
- while (1) {
- if (i >= malloc_size) {
- malloc_size *= 2;
- new_s = realloc(s, malloc_size);
- if (new_s == NULL) {
- free(s);
- return ENOMEM;
- }
- s = new_s;
- }
- ret = rx_Read(call, &s[i], sizeof(char));
- if (ret != 1)
- return VOLSERFAILEDOP;
- if (s[i] == 0) {
- *ret_string = s;
- return 0;
- }
- i++;
- }
-}
-
-static int
-writebyte(struct rx_call *call, unsigned char b)
-{
- int ret;
-
- ret = rx_Write (call, &b, 1);
- if (ret != 1) {
- mlog_log(MDEBVOLDB, "writebyte: write %d wanted %d", ret, 1);
- return VOLSERFAILEDOP;
- }
- return 0;
-}
-
-static int
-writeint32(struct rx_call *call, uint32_t d)
-{
- int ret;
-
- d = htonl(d);
- ret = rx_Write (call, &d, 4);
- if (ret != 4) {
- mlog_log(MDEBVOLDB, "writeint32: write %d wanted %d", ret, 4);
- return VOLSERFAILEDOP;
- }
- return 0;
-}
-
-static int
-writeint16(struct rx_call *call, uint16_t d)
-{
- int ret;
-
- d = htons(d);
- ret = rx_Write (call, &d, 2);
- if (ret != 2) {
- mlog_log(MDEBVOLDB, "writeint16: write %d wanted %d", ret, 2);
- return VOLSERFAILEDOP;
- }
- return 0;
-}
-
-static int
-writestring(struct rx_call *call, char *s)
-{
- int len;
- int ret;
-
- len = strlen(s) + 1;
-
- ret = rx_Write(call, s, len);
- if (ret != len) {
- mlog_log(MDEBVOLDB, "writestring: write %d wanted %d", ret, len);
- return VOLSERFAILEDOP;
- }
- return 0;
-}
-
-static int
-writebyte_tag(struct rx_call *call, unsigned char tag, unsigned char b)
-{
- int ret;
-
- ret = writebyte(call, tag);
- if (ret)
- return ret;
-
- ret = writebyte(call, b);
- if (ret)
- return ret;
-}
-
-static int
-writeint16_tag(struct rx_call *call, unsigned char tag, uint16_t b)
-{
- int ret;
-
- ret = writebyte(call, tag);
- if (ret)
- return ret;
-
- ret = writeint16(call, b);
- if (ret)
- return ret;
-}
-
-static int
-writeint32_tag(struct rx_call *call, unsigned char tag, uint32_t b)
-{
- int ret;
-
- ret = writebyte(call, tag);
- if (ret)
- return ret;
-
- ret = writeint32(call, b);
- if (ret)
- return ret;
-}
-
-static int
-writestring_tag(struct rx_call *call, unsigned char tag, char *s)
-{
- int ret;
-
- ret = writebyte(call, tag);
- if (ret)
- return ret;
-
- ret = writestring(call, s);
- if (ret)
- return ret;
-}
-
-static int
-read_dumpheader(struct rx_call *call, unsigned char *tag, volume_handle *vh)
-{
- uint32_t magic;
- uint32_t version;
- char *s;
- uint32_t volid;
- uint16_t count;
- uint32_t fromdate;
- uint32_t todate;
- int ret;
-
- ret = readint32(call, &magic);
- if (ret)
- return ret;
-
- ret = readint32(call, &version);
- if (ret)
- return ret;
-
- if (magic != DUMPBEGINMAGIC)
- return VOLSERFAILEDOP;
-
- if (version != DUMPVERSION)
- return VOLSERFAILEDOP;
-
- while (1) {
- ret = readbyte(call, tag);
- if (ret)
- return ret;
- switch (*tag) {
- case DHTAG_VOLNAME:
- ret = readstring(call, &s);
- if (ret)
- return ret;
- printf("volume: \"%s\"\n", s);
- free(s);
- break;
- case DHTAG_VOLID:
- ret = readint32(call, &volid);
- if (ret)
- return ret;
- printf("volid: %u\n", volid);
- break;
- case DHTAG_DUMPTIMES:
- ret = readint16(call, &count);
- if (ret)
- return ret;
- if (count != 2)
- return VOLSERFAILEDOP;
- ret = readint32(call, &fromdate);
- if (ret)
- return ret;
- ret = readint32(call, &todate);
- if (ret)
- return ret;
- printf("dumptimes: from %d to %d\n", fromdate, todate);
- break;
- default:
- return 0;
- }
- }
-}
-
-static int
-read_volumeheader(struct rx_call *call, unsigned char *tag, volume_handle *vh)
-{
- int ret;
- char *s;
- uint32_t i32;
- unsigned char byte;
- uint16_t count;
- uint32_t *i32_array;
- int i;
-
- while (1) {
- switch (*tag) {
- case VHTAG_VOLID:
- case VHTAG_VERS:
- case VHTAG_VUNIQ:
- case VHTAG_PARENT:
- case VHTAG_CLONE:
- case VHTAG_MAXQUOTA:
- case VHTAG_MINQUOTA:
- case VHTAG_DISKUSED:
- case VHTAG_FILECNT:
- case VHTAG_ACCOUNT:
- case VHTAG_OWNER:
- case VHTAG_DAYUSE:
- case VHTAG_CREAT:
- case VHTAG_ACCESS:
- case VHTAG_UPDATE:
- case VHTAG_EXPIRE:
- case VHTAG_BACKUP:
- case VHTAG_DUDATE:
- ret = readint32(call, &i32);
- break;
- case VHTAG_VOLNAME:
- case VHTAG_OFFLINE:
- case VHTAG_MOTD:
- ret = readstring(call, &s);
- break;
- case VHTAG_INSERV:
- case VHTAG_BLESSED:
- case VHTAG_TYPE:
- ret = readbyte(call, &byte);
- break;
- case VHTAG_WEEKUSE:
- ret = readint16(call, &count);
- if (ret)
- break;
- i32_array = malloc(4 * count);
- if (i32_array == NULL)
- return ENOMEM;
- for (i = 0; i < count; i++) {
- ret = readint32(call, &i32_array[i]);
- if (ret) {
- free(i32_array);
- break;
- }
- }
- break;
- default:
- return 0;
- }
- if (ret)
- return ret;
- switch (*tag) {
- case VHTAG_VOLID:
- mlog_log(MDEBVOLDB, "volid: %d", i32);
- break;
- case VHTAG_VERS:
- mlog_log(MDEBVOLDB, "vers: %d", i32);
- break;
- case VHTAG_VUNIQ:
- break;
- case VHTAG_PARENT:
- vh->info.parentID = i32;
- break;
- case VHTAG_CLONE:
- vh->info.cloneID = i32;
- break;
- case VHTAG_MAXQUOTA:
- vh->info.maxquota = i32;
- break;
- case VHTAG_MINQUOTA:
- break;
- case VHTAG_DISKUSED:
- break;
- case VHTAG_FILECNT:
- break;
- case VHTAG_ACCOUNT:
- break;
- case VHTAG_OWNER:
- break;
- case VHTAG_DAYUSE:
- vh->info.dayUse = i32;
- break;
- case VHTAG_CREAT:
- vh->info.creationDate = i32;
- break;
- case VHTAG_ACCESS:
- vh->info.accessDate = i32;
- break;
- case VHTAG_UPDATE:
- vh->info.updateDate = i32;
- break;
- case VHTAG_EXPIRE:
- mlog_log(MDEBVOLDB, "expire: %d", i32);
- break;
- case VHTAG_BACKUP:
- vh->info.backupDate = i32;
- case VHTAG_DUDATE:
- mlog_log(MDEBVOLDB, "dudate: %d", i32);
- break;
- case VHTAG_VOLNAME:
- strlcpy(vh->info.name, s, VNAMESIZE);
- free(s);
- break;
- case VHTAG_OFFLINE:
- free(s);
- break;
- case VHTAG_MOTD:
- free(s);
- break;
- case VHTAG_INSERV:
- mlog_log(MDEBVOLDB, "inserv: %u", (unsigned int)byte);
- break;
- case VHTAG_BLESSED:
- mlog_log(MDEBVOLDB, "blessed: %u", (unsigned int)byte);
- break;
- case VHTAG_TYPE:
- vh->info.type = byte;
- break;
- case VHTAG_WEEKUSE:
- free(i32_array);
- break;
- default:
- return VOLSERFAILEDOP;
- }
-
- ret = readbyte(call, tag);
- if (ret)
- return ret;
- }
-}
-
-static int
-read_vnodeheader(struct rx_call *call, unsigned char *tag, volume_handle *vh)
-{
- int ret;
- uint32_t i32;
- uint16_t i16;
- unsigned char byte;
- uint32_t vnode;
- uint32_t uniq;
- char *acl = NULL;
- uint32_t length;
-
- uint32_t dataversion = 0;
- uint32_t author = 0;
- uint32_t owner = 0;
- uint32_t group = 0;
- uint32_t parent = 0;
- uint32_t client_date = 0;
- uint32_t server_date = 0;
- uint16_t nlinks = 0;
- uint16_t mode = 0;
- uint8_t type = 0;
-
- int got_tags = 0;
-
- ret = readint32(call, &vnode);
- if (ret)
- return ret;
-
- ret = readint32(call, &uniq);
- if (ret)
- return ret;
-
- ret = readbyte(call, tag);
- if (ret)
- return ret;
-
- while (1) {
- switch (*tag) {
- case VTAG_DVERS:
- case VTAG_AUTHOR:
- case VTAG_OWNER:
- case VTAG_GROUP:
- case VTAG_PARENT:
- case VTAG_CLIENT_DATE:
- case VTAG_SERVER_DATE:
- ret = readint32(call, &i32);
- break;
- case VTAG_NLINKS:
- case VTAG_MODE:
- ret = readint16(call, &i16);
- break;
- case VTAG_TYPE:
- ret = readbyte(call, &byte);
- break;
- case VTAG_ACL:
- acl = malloc(SIZEOF_ACL);
- ret = rx_Read(call, acl, SIZEOF_ACL);
- if (ret != SIZEOF_ACL)
- return VOLSERFAILEDOP;
- ret = 0;
- break;
- case VTAG_DATA:
- ret = readint32(call, &length);
- break;
- default:
- return 0;
- }
- if (ret)
- return ret;
- switch (*tag) {
- case VTAG_DVERS:
- dataversion = i32;
- got_tags |= GOT_VTAG_DVERS;
- break;
- case VTAG_AUTHOR:
- author = i32;
- got_tags |= GOT_VTAG_AUTHOR;
- break;
- case VTAG_OWNER:
- owner = i32;
- got_tags |= GOT_VTAG_OWNER;
- break;
- case VTAG_GROUP:
- group = i32;
- got_tags |= GOT_VTAG_GROUP;
- break;
- case VTAG_PARENT:
- parent = i32;
- got_tags |= GOT_VTAG_PARENT;
- break;
- case VTAG_CLIENT_DATE:
- client_date = i32;
- got_tags |= GOT_VTAG_CLIENT_DATE;
- break;
- case VTAG_SERVER_DATE:
- server_date = i32;
- got_tags |= GOT_VTAG_SERVER_DATE;
- break;
- case VTAG_NLINKS:
- nlinks = i16;
- got_tags |= GOT_VTAG_NLINKS;
- break;
- case VTAG_MODE:
- mode = i16;
- got_tags |= GOT_VTAG_MODE;
- break;
- case VTAG_TYPE:
- type = byte;
- got_tags |= GOT_VTAG_TYPE;
- break;
- case VTAG_ACL:
- got_tags |= GOT_VTAG_ACL;
- break;
- case VTAG_DATA:
- if ((got_tags & GOT_ALL_FILE) == GOT_ALL_FILE) {
- ret = restore_file(call, vnode, uniq, length,
- dataversion, author,
- owner, group, parent,
- client_date, server_date,
- nlinks, mode, type, vh, (int32_t *)acl);
- free(acl);
- if (ret)
- return ret;
- ret = readbyte(call, tag);
- if (ret)
- return ret;
- return ret;
- } else {
- free(acl);
- return VOLSERFAILEDOP;
- }
- printf("data\n");
- break;
- default:
- return VOLSERFAILEDOP;
- }
-
- ret = readbyte(call, tag);
- if (ret)
- return ret;
- }
-}
-
-
-int
-parse_dump(struct rx_call *call, volume_handle *vh)
-{
- unsigned char tag;
- int ret;
- uint32_t dumpendmagic;
- char buffer[2048];
-
- ret = readbyte(call, &tag);
- if (ret)
- return ret;
-
- while (1) {
- switch (tag) {
- case TAG_DUMPHEADER:
- mlog_log(MDEBVOLDB, "parse_dump: dumpheader");
- ret = read_dumpheader(call, &tag, vh);
- if (ret)
- return ret;
- break;
- case TAG_VOLHEADER:
- mlog_log(MDEBVOLDB, "parse_dump: volheader");
- ret = readbyte(call, &tag);
- if (ret)
- return ret;
- ret = read_volumeheader(call, &tag, vh);
- if (ret)
- return ret;
- break;
- case TAG_VNODE:
- mlog_log(MDEBVOLDB, "parse_dump: vnode");
- ret = read_vnodeheader(call, &tag, vh);
- if (ret)
- return ret;
- break;
- case TAG_DUMPEND:
- mlog_log(MDEBVOLDB, "parse_dump: dumpend");
- ret = readint32(call, &dumpendmagic);
- if (ret)
- return ret;
- if (dumpendmagic != DUMPENDMAGIC) {
- mlog_log(MDEBVOLDB, "parse_dump: dumpend: wrong magic: %u",
- dumpendmagic);
- return VOLSERFAILEDOP;
- }
- return 0;
- break;
- default:
- mlog_log(MDEBVOLDB, "parse_dump: unknown tag %d", (int) tag);
- rx_Read(call, buffer, sizeof(buffer));
- return VOLSERFAILEDOP;
- }
- }
-}
-
-static int
-write_dumpheader(struct rx_call *call, volume_handle *vh)
-{
- int ret;
-
- ret = writebyte(call, TAG_DUMPHEADER);
- if (ret)
- return ret;
- ret = writeint32(call, DUMPBEGINMAGIC);
- if (ret)
- return ret;
- ret = writeint32(call, DUMPVERSION);
- if (ret)
- return ret;
-
- ret = writestring_tag(call, DHTAG_VOLNAME, vh->info.name);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, DHTAG_VOLID, vh->info.volid);
- if (ret)
- return ret;
-
- ret = writebyte(call, DHTAG_DUMPTIMES);
- if (ret)
- return ret;
- ret = writeint16(call, 2);
- if (ret)
- return ret;
- ret = writeint32(call, 0); /* fromdate */
- if (ret)
- return ret;
- ret = writeint32(call, 0); /* todate */
- if (ret)
- return ret;
-
- return 0;
-}
-
-static int
-write_volheader(struct rx_call *call, volume_handle *vh)
-{
- int ret;
-
- ret = writebyte(call, TAG_VOLHEADER);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VHTAG_VOLID, vh->info.volid);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VHTAG_VERS, 1);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VHTAG_VUNIQ, 0); /* XXX */
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VHTAG_PARENT, vh->info.parentID);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VHTAG_CLONE, vh->info.cloneID);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VHTAG_MAXQUOTA, vh->info.maxquota);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VHTAG_MINQUOTA, 0); /* XXX */
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VHTAG_DISKUSED, vh->info.size);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VHTAG_FILECNT, 0); /* XXX */
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VHTAG_ACCOUNT, 0);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VHTAG_OWNER, 0);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VHTAG_DAYUSE, vh->info.dayUse);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VHTAG_CREAT, vh->info.creationDate);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VHTAG_ACCESS, vh->info.accessDate);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VHTAG_UPDATE, vh->info.updateDate);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VHTAG_EXPIRE, 0); /* XXX */
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VHTAG_BACKUP, vh->info.backupDate);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VHTAG_DUDATE, 0); /* XXX */
- if (ret)
- return ret;
-
- ret = writestring_tag(call, VHTAG_VOLNAME, vh->info.name);
- if (ret)
- return ret;
-
- ret = writestring_tag(call, VHTAG_OFFLINE, "");
- if (ret)
- return ret;
-
- ret = writestring_tag(call, VHTAG_MOTD, "");
- if (ret)
- return ret;
-
- ret = writebyte_tag(call, VHTAG_INSERV, 0); /* XXX */
- if (ret)
- return ret;
-
- ret = writebyte_tag(call, VHTAG_BLESSED, 0); /* XXX */
- if (ret)
- return ret;
-
- ret = writebyte_tag(call, VHTAG_TYPE, vh->info.type);
- if (ret)
- return ret;
-
- ret = writeint16_tag(call, VHTAG_WEEKUSE, 7);
- if (ret)
- return ret;
-
- {
- int i;
-
- for (i = 0; i < 7; i++) {
- ret = writeint32(call, 0);
- }
- }
-
- return 0;
-}
-
-static int
-write_vnode(int fd,
- uint32_t vnode,
- uint32_t uniq,
- uint32_t length,
- uint32_t dataversion,
- uint32_t author,
- uint32_t owner,
- uint32_t group,
- uint32_t parent,
- uint32_t client_date,
- uint32_t server_date,
- uint16_t nlinks,
- uint16_t mode,
- uint8_t type,
- int32_t *acl,
- void *arg)
-{
- struct rx_call *call = (struct rx_call *) arg;
- int ret;
- struct mnode n;
-
- ret = writebyte(call, TAG_VNODE);
- if (ret)
- return ret;
-
- ret = writeint32(call, vnode);
- if (ret)
- return ret;
-
- ret = writeint32(call, uniq);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VTAG_DVERS, dataversion);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VTAG_AUTHOR, author);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VTAG_OWNER, owner);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VTAG_GROUP, group);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VTAG_PARENT, parent);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VTAG_CLIENT_DATE, client_date);
- if (ret)
- return ret;
-
- ret = writeint32_tag(call, VTAG_SERVER_DATE, server_date);
- if (ret)
- return ret;
-
- ret = writeint16_tag(call, VTAG_NLINKS, nlinks);
- if (ret)
- return ret;
-
- ret = writeint16_tag(call, VTAG_MODE, mode);
- if (ret)
- return ret;
-
- ret = writebyte_tag(call, VTAG_TYPE, type);
- if (ret)
- return ret;
-
- if (acl) {
- ret = writebyte(call, VTAG_ACL);
- if (ret)
- return ret;
- ret = rx_Write(call, acl, SIZEOF_ACL);
- if (ret != SIZEOF_ACL) {
- mlog_log(MDEBVOLDB, "write_vnode: read %d wanted %d",
- ret, SIZEOF_ACL);
- return VOLSERFAILEDOP;
- }
- }
-
- ret = writeint32_tag(call, VTAG_DATA, length);
- if (ret)
- return ret;
-
- ret = copyfd2rx(fd, call, 0, length);
- if (ret)
- return ret;
-
- return 0;
-}
-
-int
-generate_dump(struct rx_call *call, volume_handle *vh)
-{
- int ret;
-
- ret = write_dumpheader(call, vh);
- if (ret)
- return ret;
-
- ret = write_volheader(call, vh);
- if (ret)
- return ret;
-
- ret = vld_foreach_dir(vh, write_vnode, call);
- if (ret)
- return ret;
-
- ret = vld_foreach_file(vh, write_vnode, call);
- if (ret)
- return ret;
-
- ret = writebyte(call, TAG_DUMPEND);
- if (ret)
- return ret;
- ret = writeint32(call, DUMPENDMAGIC);
- if (ret)
- return ret;
-
- return 0;
-}
-
-
diff --git a/usr.sbin/afs/src/milko/fs/dump.h b/usr.sbin/afs/src/milko/fs/dump.h
deleted file mode 100644
index 558a5e61f12..00000000000
--- a/usr.sbin/afs/src/milko/fs/dump.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 1999 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * $arla: dump.h,v 1.4 2002/01/29 03:54:54 lha Exp $
- */
-
-
-#ifndef __FS_DUMP_H
-#define __FS_DUMP_H 1
-
-
-#define DUMPVERSION 1
-#define DUMPBEGINMAGIC 0xb3a11322
-#define DUMPENDMAGIC 0x3a214b6e
-
-#define TAG_DUMPHEADER 1
-#define TAG_VOLHEADER 2
-#define TAG_VNODE 3
-#define TAG_DUMPEND 4
-
-#define DHTAG_VOLNAME 'n'
-#define DHTAG_VOLID 'v'
-#define DHTAG_DUMPTIMES 't'
-
-#define VHTAG_VOLID 'i'
-#define VHTAG_VERS 'v'
-#define VHTAG_VOLNAME 'n'
-#define VHTAG_INSERV 's'
-#define VHTAG_BLESSED 'b'
-#define VHTAG_VUNIQ 'u'
-#define VHTAG_TYPE 't'
-#define VHTAG_PARENT 'p'
-#define VHTAG_CLONE 'c'
-#define VHTAG_MAXQUOTA 'q'
-#define VHTAG_MINQUOTA 'm'
-#define VHTAG_DISKUSED 'd'
-#define VHTAG_FILECNT 'f'
-#define VHTAG_ACCOUNT 'a'
-#define VHTAG_OWNER 'o'
-#define VHTAG_CREAT 'C'
-#define VHTAG_ACCESS 'A'
-#define VHTAG_UPDATE 'U'
-#define VHTAG_EXPIRE 'E'
-#define VHTAG_BACKUP 'B'
-#define VHTAG_OFFLINE 'O'
-#define VHTAG_MOTD 'M'
-#define VHTAG_WEEKUSE 'W'
-#define VHTAG_DUDATE 'D'
-#define VHTAG_DAYUSE 'Z'
-
-#define VTAG_TYPE 't'
-#define VTAG_NLINKS 'l'
-#define VTAG_DVERS 'v'
-#define VTAG_CLIENT_DATE 'm'
-#define VTAG_AUTHOR 'a'
-#define VTAG_OWNER 'o'
-#define VTAG_GROUP 'g'
-#define VTAG_MODE 'b'
-#define VTAG_PARENT 'p'
-#define VTAG_SERVER_DATE 's'
-#define VTAG_ACL 'A'
-#define VTAG_DATA 'f'
-
-#define SIZEOF_LARGEDISKVNODE 256
-#define SIZEOF_SMALLDISKVNODE 64
-#define SIZEOF_ACL (SIZEOF_LARGEDISKVNODE - SIZEOF_SMALLDISKVNODE)
-
-#define GOT_VTAG_DVERS 0x0001
-#define GOT_VTAG_AUTHOR 0x0002
-#define GOT_VTAG_OWNER 0x0004
-#define GOT_VTAG_GROUP 0x0008
-#define GOT_VTAG_PARENT 0x0010
-#define GOT_VTAG_CLIENT_DATE 0x0020
-#define GOT_VTAG_SERVER_DATE 0x0040
-#define GOT_VTAG_NLINKS 0x0080
-#define GOT_VTAG_MODE 0x0100
-#define GOT_VTAG_TYPE 0x0200
-#define GOT_VTAG_ACL 0x0400
-
-#define GOT_ALL_FILE 0x03F7
-
-int
-parse_dump(struct rx_call *call, volume_handle *vh);
-
-int
-generate_dump(struct rx_call *call, volume_handle *vh);
-
-#endif /* __FS_DUMP_H */
diff --git a/usr.sbin/afs/src/milko/fs/fileserver.c b/usr.sbin/afs/src/milko/fs/fileserver.c
deleted file mode 100644
index 96ad8ec1374..00000000000
--- a/usr.sbin/afs/src/milko/fs/fileserver.c
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Copyright (c) 1999 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fsrv_locl.h"
-
-RCSID("$arla: fileserver.c,v 1.30 2002/04/26 16:11:42 lha Exp $");
-
-typedef enum { NO_SALVAGE, NORMAL_SALVAGE, SALVAGE_ALL } salvage_options_e;
-
-/*
- * Local varibles
- */
-
-static struct rx_service *fsservice;
-static struct rx_service *volservice;
-
-/*
- *
- */
-
-static void
-sigusr1 (int foo)
-{
- char *dumpdir;
- printf ("sigusr1\n");
- asprintf (&dumpdir, "%s/vicepa", dpart_root);
- if (dumpdir)
- chdir (dumpdir);
- exit (2); /* XXX profiler */
-}
-
-/*
- *
- */
-
-static void
-mark_clean (volume_handle *vol)
-{
- vol->flags.offlinep = FALSE;
- vol->flags.salvaged = TRUE;
- vol->flags.attacherr = FALSE;
-}
-
-
-static int
-do_salvage (volume_handle *vol)
-{
- int ret;
-
- ret = salvage_volume (vol);
- if (ret == 0) {
- mark_clean (vol);
- } else {
- vol->flags.offlinep = TRUE;
- vol->flags.salvaged = TRUE;
- vol->flags.attacherr = TRUE;
- }
- return 0;
-}
-
-static int
-salvage_and_attach (volume_handle *vol, void *arg)
-{
- int salvage_options = *(int *)arg;
-
- mlog_log (MDEBMISC, "salvaging and attatching to volume: %u",
- (uint32_t)vol->vol);
-
- switch (salvage_options) {
- case NORMAL_SALVAGE:
- if (vol->flags.cleanp == FALSE)
- do_salvage (vol);
- break;
- case NO_SALVAGE:
- mark_clean (vol);
- break;
- case SALVAGE_ALL:
- do_salvage (vol);
- break;
- default:
- errx(-1, "unknown salvage options %d\n", salvage_options);
- /* NOTREACHED */
- }
- return 0;
-}
-
-
-/*
- *
- */
-
-static void
-attach_volumes(int salvage_options)
-{
- mlog_log (MDEBMISC, "fileserver starting to attach to volumes");
- vld_iter_vol (salvage_and_attach, &salvage_options);
- mlog_log (MDEBMISC, "fileserver done attaching to volumes");
-}
-
-/*
- * Main
- */
-
-static char *cell = NULL;
-static char *realm = NULL;
-static char *debug_levels = NULL;
-static char *log_file = "syslog";
-static char *srvtab_file = NULL;
-static int no_auth = 0;
-static int do_help = 0;
-static int force_salvage = 0;
-
-static struct agetargs args[] = {
- {"cell", 0, aarg_string, &cell, "what cell to use"},
- {"realm", 0, aarg_string, &realm, "what realm to use"},
- {"debug", 'd', aarg_string, &debug_levels, "debug level"},
- {"log", 'l', aarg_string, &log_file,
- "where to write log (stderr, syslog (default), or path to file)"},
- {"srvtab", 0, aarg_string, &srvtab_file, "what srvtab to use"},
- {"noauth", 0, aarg_flag, &no_auth, "disable authentication checks"},
- {"help", 'h', aarg_flag, &do_help, "help"},
- {"partdir", 0, aarg_string, &dpart_root, "where to find vicep*"},
- {"salvage", 0, aarg_flag, &force_salvage, "Force a salvage for all vols"},
- { NULL, 0, aarg_end, NULL }
-};
-
-static void
-usage(int exit_code)
-{
- aarg_printusage (args, NULL, "", AARG_GNUSTYLE);
- exit (exit_code);
-}
-
-int
-main(int argc, char **argv)
-{
- int ret;
- int optind = 0;
- PROCESS pid;
- Log_method *method;
- int salvage_options = NORMAL_SALVAGE;
-
- set_progname (argv[0]);
-
- if (agetarg (args, argc, argv, &optind, AARG_GNUSTYLE)) {
- usage (1);
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc) {
- printf("unknown option %s\n", *argv);
- return 1;
- }
-
- if (do_help)
- usage(0);
-
- method = log_open (getprogname(), log_file);
- if (method == NULL)
- errx (1, "log_open failed");
- cell_init(0, method);
- ports_init();
-
- printf ("fileserver booting\n");
-
- LWP_InitializeProcessSupport (LWP_NORMAL_PRIORITY, &pid);
-
- mlog_loginit (method, milko_deb_units, MDEFAULT_LOG);
- if (debug_levels)
- mlog_log_set_level (debug_levels);
-
- if (no_auth)
- sec_disable_superuser_check ();
-
- if (cell)
- cell_setthiscell (cell);
-
- if (force_salvage)
- salvage_options = SALVAGE_ALL;
-
- ropa_init(30000, 100, 40000, 40000, 150, 50000);
-
- network_kerberos_init (srvtab_file);
-
- ret = network_init(htons(afsport), "fs", FS_SERVICE_ID,
- RXAFS_ExecuteRequest, &fsservice, realm);
- if (ret)
- errx (1, "network_init failed with %d", ret);
-
- fsservice->destroyConnProc = fs_connsec_destroyconn;
-
- ret = network_init(htons(afsvolport), "volser", VOLSER_SERVICE_ID,
- VOLSER_ExecuteRequest, &volservice, realm);
- if (ret)
- errx (1, "network_init failed with %d", ret);
-
- signal (SIGUSR1, sigusr1);
- umask (S_IRWXG|S_IRWXO); /* 077 */
-
- vld_boot();
- vld_init();
-
- mnode_init (4711); /* XXX */
- attach_volumes(salvage_options);
-
- rx_SetMaxProcs(fsservice,5) ;
- rx_SetMaxProcs(volservice,5) ;
-
- printf ("fileserver started, serving data\n");
-
- rx_StartServer(1) ;
-
- /* NOTREACHED */
- return -1;
-}
diff --git a/usr.sbin/afs/src/milko/fs/fs_def.h b/usr.sbin/afs/src/milko/fs/fs_def.h
deleted file mode 100644
index b076094f62a..00000000000
--- a/usr.sbin/afs/src/milko/fs/fs_def.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1999, 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Fileserver global defines
- */
-
-/* $arla: fs_def.h,v 1.6 2002/01/29 03:54:54 lha Exp $ */
-
-#ifndef __FILBUNKE__FS_DEF_H
-#define __FILBUNKE__FS_DEF_H 1
-
-#define FS_MAX_ACL 8
-
-/* XXX */
-#define AFS_SERVER_SRVTAB_DIR "/usr/arla/etc"
-
-#define N_SECURITY_OBJECTS 3
-
-#define MAX_TRANSACTIONS 100
-
-#define MILKO_ROFS EROFS
-
-#endif /* __FILBUNKE__FS_DEF_H */
diff --git a/usr.sbin/afs/src/milko/fs/fsprocs.c b/usr.sbin/afs/src/milko/fs/fsprocs.c
deleted file mode 100644
index 823bd3d274a..00000000000
--- a/usr.sbin/afs/src/milko/fs/fsprocs.c
+++ /dev/null
@@ -1,1758 +0,0 @@
-/*
- * Copyright (c) 1999 - 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fsrv_locl.h"
-
-RCSID("$arla: fsprocs.c,v 1.68 2003/04/08 00:13:35 lha Exp $");
-
-#define GETHOST(call) rx_HostOf(rx_PeerOf(rx_ConnectionOf((call))))
-#define GETPORT(call) rx_PortOf(rx_PeerOf(rx_ConnectionOf((call))))
-
-int
-createentry(struct rx_call *call,
- const struct AFSFid *DirFid,
- const char *Name,
- const char *Contents,
- const struct AFSStoreStatus *InStatus,
- const struct AFSFid *ExistingFid,
- struct AFSFid *EntryFid,
- struct AFSFetchStatus *OutFidStatus,
- struct AFSFetchStatus *OutDirStatus,
- struct AFSCallBack *CallBack,
- struct AFSVolSync *VolSync);
-
-/*
- * Initlize all fields of `m' except `m->flags'.
- */
-
-static int
-fs_init_msec (struct rx_call *call, struct msec *m)
-{
- volop_flags flags;
- assert (call && m);
- flags = m->flags;
-
- memset (m, 0, sizeof (*m));
- m->flags = flags;
- if (call) {
- m->sec = fs_connsec_context_get(call->conn);
- } else {
- m->sec = NULL;
- }
-
- m->loop = 0;
- return 0;
-}
-
-/*
- * Update FetchStatus `fs' to reflect `n' and `m'.
- */
-
-static void
-fs_update_fs (const struct mnode *n, const struct msec *m,
- AFSFetchStatus *fs)
-{
- *fs = n->fs;
- fs->CallerAccess = m->caller_access;
- fs->AnonymousAccess = m->anonymous_access;
-}
-
-/*
- * return a non zero value if the user is the superuser.
- */
-
-static int
-super_user (const struct msec *m)
-{
- return m->sec->superuser;
-}
-
-/*
- * If check if the user have the rights to change `status' the way the
- * user want to with the right `sec'. If the entry is about to be
- * created, set owner if that isn't set.
- */
-
-static int
-check_ss_bits (const struct msec *m, const AFSStoreStatus *status,
- Bool createp)
-{
- /* check if member of system:administrators
- */
-
- if ((status->Mask & SS_OWNER) != 0) {
- if (status->Owner != m->sec->uid && !super_user(m))
- return EPERM;
- } else if (createp) {
- ((AFSStoreStatus *)status)->Mask |= SS_OWNER; /* XXX */
- ((AFSStoreStatus *)status)->Owner = m->sec->uid; /* XXX */
- }
-
- if ((status->Mask & SS_MODEBITS) != 0) {
- if ((07000 & status->UnixModeBits) != 0 && !super_user(m))
- return EPERM;
- }
- return 0;
-}
-
-/*
- * Given `fid', `volh' and `m' open node `n', check rights.
- */
-
-static int
-fs_open_node (const AFSFid *fid, struct volume_handle *volh,
- struct msec *m, struct mnode **n)
-{
- int ret;
-
- ret = mnode_find (fid, n);
- if (ret)
- return ret;
-
- ret = vld_open_vnode (volh, *n, m);
- if (ret == 0)
- ret = vld_check_rights (volh, *n, m);
-
- if (ret)
- mnode_free (*n, FALSE);
-
- return ret;
-}
-
-/*
- * Given `fid' and `call', init `m', `volh' and `n'.
- *
- * If function returns with 0, `volh' and `n' needs to be free:ed when
- * no longer needed.
- */
-
-
-static int
-fs_init_req (const AFSFid *fid, struct msec *m, struct volume_handle **volh,
- struct rx_call *call, struct mnode **n)
-{
- int ret;
-
- ret = vld_check_busy(fid->Volume, -1);
- if (ret)
- return ret;
-
- ret = fs_init_msec (call, m);
- if (ret)
- return ret;
-
- ret = vld_find_vol (fid->Volume, volh);
- if (ret)
- return ret;
-
- if (n != NULL && (*volh)->flags.offlinep == TRUE) {
- int ret;
- if ((*volh)->flags.attacherr)
- ret = VOFFLINE;
- else if ((*volh)->flags.salvaged)
- ret = VSALVAGE;
- else
- ret = VOFFLINE;
- vld_free (*volh);
- return ret;
- }
-
-#define VOLOP_MODIFY (VOLOP_ADMIN|VOLOP_DELETE|VOLOP_WRITE|\
- VOLOP_INSERT|VOLOP_LOCK)
-
- ret = vld_info_uptodatep (*volh);
- if (ret) {
- vld_free (*volh);
- return ret;
- }
-
- if ((*volh)->info.type != RWVOL &&
- (m->flags & VOLOP_MODIFY))
- {
- vld_free (*volh);
- return MILKO_ROFS;
- }
-
- ret = vld_db_uptodate (*volh);
- if (ret) {
- vld_free (*volh);
- return ret;
- }
-
- if (n != NULL) {
- ret = fs_open_node (fid, *volh, m, n);
- if (ret) {
- vld_free (*volh);
- return ret;
- }
- }
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_FetchData(struct rx_call *call,
- const struct AFSFid *a_fidToFetchP,
- const int32_t a_offset,
- const int32_t a_lenInBytes,
- struct AFSFetchStatus *a_fidStatP,
- struct AFSCallBack *a_callBackP,
- struct AFSVolSync *a_volSyncP)
-{
- struct volume_handle *volh;
-
- int32_t len, net_len;
- struct mnode *n;
- struct msec m;
- int ret;
- int haveData = 1;
-
- mlog_log (MDEBFS, "FetchData: fid: %d.%d.%d, len = %d, offset = %d",
- a_fidToFetchP->Volume, a_fidToFetchP->Vnode,
- a_fidToFetchP->Unique, a_lenInBytes, a_offset);
-
- m.flags = VOLOP_GETSTATUS | VOLOP_READ;
-
- ret = fs_init_req (a_fidToFetchP, &m, &volh, call, &n);
- if (ret) {
- mlog_log (MDEBFS, "FetchData: fs_init_req returned %d", ret);
- return ret;
- }
-
- if (n->fs.Length < a_offset) {
-/* ret = EINVAL; */
- mlog_log (MDEBFS, "FetchData: invalid offset (%d < %d)",
- n->fs.Length, a_offset);
- haveData = 0;
- len = 0;
-/* goto out; */
- } else
- len = min(a_lenInBytes, n->fs.Length - a_offset);
-
- net_len = ntohl(len);
-
- if (rx_Write (call, &net_len, sizeof(net_len)) != sizeof(net_len)) {
- ret = errno;
- mlog_log (MDEBFS, "FetchData: rx_Write returned %d", ret);
- goto out;
- }
-
- if (haveData) {
- ret = copyfd2rx (n->fd, call, a_offset, len);
- if (ret) {
- mlog_log (MDEBFS, "FetchData: copyfd2rx returned %d", ret);
- goto out;
- }
- }
-
- fs_update_fs (n, &m, a_fidStatP);
-
- ret = vld_info_uptodatep (volh);
- if (ret)
- goto out;
-
- ropa_getcallback (GETHOST(call), GETPORT(call),
- a_fidToFetchP, a_callBackP, volh->info.type);
- vld_vld2volsync (volh, a_volSyncP);
-
- out:
- mnode_free (n, FALSE);
- vld_free (volh);
-
- mlog_log (MDEBFS, "FetchData: ret = %d (at end), calleraccess = %x\n",
- ret, a_fidStatP->CallerAccess);
-
- return ret;
-}
-
-/*
- *
- */
-
-static int
-i2nlist (idlist *ilist, namelist *nlist)
-{
- int i;
- /* XXX convert the number is the ilist to name-as-numbers */
-
- nlist->val = malloc(sizeof(nlist->val[0]) * ilist->len);
- if (nlist->val == NULL)
- return ENOMEM;
-
- for (i = 0; i < ilist->len; i++)
- snprintf(nlist->val[i], sizeof(nlist->val[i]), "%d", ilist->val[i]);
-
- nlist->len = ilist->len;
-
- return 0;
-}
-
-
-/*
- *
- */
-
-int
-SRXAFS_FetchACL(struct rx_call *call,
- const struct AFSFid *a_dirFidP,
- AFSOpaque *a_ACLP,
- struct AFSFetchStatus *a_dirNewStatP,
- struct AFSVolSync *a_volSyncP)
-{
- struct volume_handle *volh;
- struct mnode *n;
- struct msec m;
- int ret;
- int i, j;
- char *tempacl, *tempacl_old;
- int num_negacl, num_posacl;
- namelist nlist;
- idlist ilist;
-
- mlog_log (MDEBFS, "FetchACL: fid: %d.%d.%d",
- a_dirFidP->Volume, a_dirFidP->Vnode,
- a_dirFidP->Unique);
-
- m.flags = VOLOP_GETSTATUS;
-
- ret = fs_init_req (a_dirFidP, &m, &volh, call, &n);
- if (ret)
- return ret;
-
- fs_update_fs (n, &m, a_dirNewStatP);
-
- assert (n->flags.ep);
- assert (n->flags.fsp);
-
- if (n->fs.FileType != TYPE_DIR) {
- mnode_free (n, FALSE);
- return EPERM;
- }
-
- j = 0;
- num_negacl = 0;
- num_posacl = 0;
- nlist.len = 0;
- nlist.val = NULL;
- ilist.val = malloc(2*FS_MAX_ACL*sizeof(int32_t));
-
- for (i = 0; i < FS_MAX_ACL && n->e.u.dir.acl[i].owner != 0; i++, j++)
- ilist.val[j] = n->e.u.dir.acl[i].owner;
- num_posacl = j;
-
- for (i = 0; i < FS_MAX_ACL && n->e.u.dir.negacl[i].owner != 0; i++, j++)
- ilist.val[j] = n->e.u.dir.negacl[i].owner;
- num_negacl = j - num_posacl;
-
- ilist.len = j;
-
- ret = fs_connsec_idtoname(&ilist, &nlist);
- switch (ret) {
- case ENETDOWN :
- case RX_CALL_DEAD :
-
- ret = i2nlist (&ilist, &nlist);
- if (ret)
- goto err_out;
-
- break;
- case 0:
- break;
- default:
- goto err_out;
- }
-
- tempacl = NULL;
- tempacl_old = strdup("");
-
- /* Make string with all positive ACL:s */
- for (i = 0; i < num_posacl; i++) {
- if (asprintf(&tempacl, "%s%s %d\n",
- tempacl_old,
- nlist.val[i],
- n->e.u.dir.acl[i].flags) == -1) {
- ret = EINVAL /* XXX what is the error code? */;
- free(tempacl_old);
- goto err_out;
- }
- free(tempacl_old);
- tempacl_old = tempacl;
- tempacl = NULL;
- }
-
- /* Add negative ACL:s to string */
- for (i = 0; i < num_negacl; i++) {
- if (asprintf(&tempacl, "%s%s %d\n",
- tempacl_old,
- nlist.val[i+num_posacl],
- n->e.u.dir.negacl[i].flags) == -1) {
- ret = EINVAL /* XXX what is the error code? */;
- free(tempacl_old);
- goto err_out;
- }
- free(tempacl_old);
- tempacl_old = tempacl;
- tempacl = NULL;
- }
-
- asprintf(&tempacl, "%d\n%d\n%s",
- num_posacl, num_negacl, tempacl_old);
- free(tempacl_old);
- tempacl_old = NULL;
-
- a_ACLP->len = max(strlen(tempacl), AFSOPAQUEMAX);
- a_ACLP->val = tempacl;
- tempacl[a_ACLP->len - 1] = '\0';
-
- err_out:
- free(ilist.val);
- free(nlist.val);
-
- vld_vld2volsync (volh, a_volSyncP);
-
- mnode_free (n, FALSE);
- vld_free (volh);
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_FetchStatus(struct rx_call *call,
- const struct AFSFid *a_fidToStatP,
- struct AFSFetchStatus *a_currStatP,
- struct AFSCallBack *a_callBackP,
- struct AFSVolSync *a_volSyncP)
-{
- struct volume_handle *volh;
- struct mnode *n;
- struct msec m;
- int ret;
-
- mlog_log (MDEBFS, "FetchStatus: fid: %u.%u.%u",
- (uint32_t)a_fidToStatP->Volume, (uint32_t)a_fidToStatP->Vnode,
- (uint32_t)a_fidToStatP->Unique);
-
- m.flags = VOLOP_GETSTATUS;
-
- ret = fs_init_req (a_fidToStatP, &m, &volh, call, &n);
- if (ret)
- goto out;
-
- fs_update_fs (n, &m, a_currStatP);
-
- ret = vld_info_uptodatep (volh);
- if (ret)
- goto out_free;
-
- ropa_getcallback (GETHOST(call), GETPORT(call),
- a_fidToStatP, a_callBackP, volh->info.type);
- vld_vld2volsync (volh, a_volSyncP);
-
-
- out_free:
- mnode_free (n, FALSE);
- vld_free (volh);
-
- out:
- mlog_log (MDEBFS, "FetchStatus: ret = %d (at end), calleraccess = %x\n",
- ret, a_currStatP->CallerAccess);
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_StoreData(struct rx_call *call,
- const struct AFSFid *a_fidToStoreP,
- const struct AFSStoreStatus *a_fidStatusP,
- const int32_t a_offset,
- const int32_t a_lenInBytes,
- const int32_t a_fileLenInBytes,
- struct AFSFetchStatus *a_fidStatP,
- struct AFSVolSync *a_volSyncP)
-{
- struct volume_handle *volh;
- struct mnode *n;
- struct msec m;
- int32_t len;
- int32_t *len_p;
- int ret;
-
- mlog_log (MDEBFS, "StoreData: fid: %d.%d.%d",
- a_fidToStoreP->Volume, a_fidToStoreP->Vnode,
- a_fidToStoreP->Unique);
- mlog_log (MDEBFS, "StoreData: offset=%d, len=%d, total=%d",
- a_offset, a_lenInBytes, a_fileLenInBytes);
-
-#if 0
-/* XXX what if offset > previous file length? */
- if(a_offset + a_lenInBytes > a_fileLenInBytes) {
- mlog_log (MDEBFS, "StoreData: ret = %d (wrong len)", EINVAL);
- mlog_log (MDEBFS, "StoreData: offset=%d, len=%d, total=%d",
- a_offset, a_lenInBytes, a_fileLenInBytes);
- return EINVAL;
- }
-#endif
-
- m.flags = VOLOP_WRITE | VOLOP_GETSTATUS;
-
- ret = fs_init_req (a_fidToStoreP, &m, &volh, call, &n);
- if (ret) {
- mlog_log (MDEBFS, "StoreData: ret = %d (fs_init_req)", ret);
- return ret;
- }
-
- if (n->fs.FileType == TYPE_DIR) {
- mnode_free (n, FALSE);
- mlog_log (MDEBFS, "StoreData: ret = %d", EPERM);
- return EPERM;
- }
-
- /*
- * newlen = max(offset+length, min(afilelength, oldlen))?
- */
-
-
- len = min(a_fileLenInBytes, n->fs.Length);
-
- if (a_offset + a_lenInBytes > len)
- len = a_offset + a_lenInBytes;
-
- if (len != n->fs.Length)
- len_p = &len;
- else
- len_p = NULL;
-
- ret = check_ss_bits (&m, a_fidStatusP, FALSE);
- if (ret)
- goto out;
- ret = vld_modify_vnode (volh, n, &m, a_fidStatusP, len_p);
-
- if (ret == 0 && a_lenInBytes != 0)
- ret = copyrx2fd (call, n->fd, a_offset, a_lenInBytes);
-
- if (ret == 0) {
- fs_update_fs (n, &m, a_fidStatP);
- vld_vld2volsync (volh, a_volSyncP);
- }
-
- ropa_break_callback (GETHOST(call), GETPORT(call), a_fidToStoreP, FALSE);
-
- out:
- mnode_free (n, FALSE);
- vld_free (volh);
-
- mlog_log (MDEBFS, "StoreData: ret = %d (at end), len = %d, calleraccess = %x",
- ret, a_fidStatP->Length, a_fidStatP->CallerAccess);
- return ret;
-}
-
-static void
-skipline(char **curptr)
-{
- while(**curptr!='\n') (*curptr)++;
- (*curptr)++;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_StoreACL(struct rx_call *call,
- const struct AFSFid *a_dirFidP,
- const AFSOpaque *a_ACLToStoreP,
- struct AFSFetchStatus *a_dirNewStatP,
- struct AFSVolSync *a_volSyncP)
-{
- struct volume_handle *volh;
- struct mnode *n;
- struct msec m;
- int ret;
- namelist nlist;
- idlist ilist;
- char *curptr;
- struct acl_entry negacl[FS_MAX_ACL];
- struct acl_entry acl[FS_MAX_ACL];
- int num_posacl;
- int num_negacl;
- int i;
-
- mlog_log (MDEBFS, "StoreACL: fid: %d.%d.%d",
- a_dirFidP->Volume, a_dirFidP->Vnode,
- a_dirFidP->Unique);
-
- m.flags = VOLOP_GETSTATUS | VOLOP_ADMIN;
-
- ret = fs_init_req (a_dirFidP, &m, &volh, call, &n);
- if (ret)
- return ret;
-
- assert (n->flags.ep);
- if (n->e.type != TYPE_DIR) {
- ret = EINVAL /* XXX */;
- goto err_out;
- }
-
-#if 0
- fprintf(stderr, "%.*s",
- a_ACLToStoreP->len,
- a_ACLToStoreP->val);
-#endif
-
- /* parse acl into nlist, acl */
-
- memset(acl, 0, sizeof(acl));
- memset(negacl, 0, sizeof(negacl));
-
- curptr = a_ACLToStoreP->val;
- curptr[a_ACLToStoreP->len - 1] = '\0';
-
- if (sscanf(curptr, "%d\n%d\n", &num_posacl, &num_negacl) != 2)
- goto err_out;
- skipline(&curptr);
- skipline(&curptr);
- ilist.len = 0;
- ilist.val = NULL;
- nlist.len = num_posacl + num_negacl;
- nlist.val = malloc(PR_MAXNAMELEN * nlist.len);
- for (i = 0; i < num_posacl; i++) {
- sscanf(curptr, "%63s %d", nlist.val[i], &acl[i].flags);
- skipline(&curptr);
- }
- for (i = 0; i < num_negacl; i++) {
- sscanf(curptr, "%63s %d", nlist.val[i+num_posacl], &negacl[i].flags);
- skipline(&curptr);
- }
-
- ret = fs_connsec_nametoid(&nlist, &ilist);
- if (ret)
- goto err_out;
-
- assert(nlist.len == ilist.len);
-
- for (i = 0; i < ilist.len; i++) {
- if (ilist.val[i] == PR_ANONYMOUSID) {
- ret = ENOENT;
- goto err_out;
- }
- fprintf(stderr, "%d\n", ilist.val[i]);
- }
-
- for (i = 0; i < num_posacl; i++)
- acl[i].owner = ilist.val[i];
-
- for (i = 0; i < num_negacl; i++)
- negacl[i].owner = ilist.val[i+num_posacl];
-
- memcpy(&n->e.u.dir.acl, acl, sizeof(acl));
- memcpy(&n->e.u.dir.negacl, negacl, sizeof(negacl));
-
- ret = vld_put_acl(volh, n, &m);
- if (ret)
- goto err_out;
-
- fs_update_fs (n, &m, a_dirNewStatP);
- ropa_break_callback (GETHOST(call), GETPORT(call), a_dirFidP, FALSE);
-
- vld_vld2volsync (volh, a_volSyncP);
-
- err_out:
- mnode_free (n, FALSE);
- vld_free (volh);
- return ret;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_StoreStatus(struct rx_call *call,
- const struct AFSFid *a_fidP,
- const struct AFSStoreStatus *a_currStatusP,
- struct AFSFetchStatus *a_srStatusP,
- struct AFSVolSync *a_volSyncP)
-{
- struct volume_handle *volh;
- struct mnode *n;
- struct msec m;
- int ret;
-
- mlog_log (MDEBFS, "StoreStatus: fid: %d.%d.%d",
- a_fidP->Volume, a_fidP->Vnode,
- a_fidP->Unique);
-
- m.flags = VOLOP_GETSTATUS;
-
- ret = fs_init_req (a_fidP, &m, &volh, call, &n);
- if (ret)
- return ret;
-
- ret = check_ss_bits (&m, a_currStatusP, TRUE);
- if (ret)
- goto out;
- ret = vld_modify_vnode (volh, n, &m, a_currStatusP, NULL);
-
- if (ret == 0) {
- fs_update_fs (n, &m, a_srStatusP);
- vld_vld2volsync (volh, a_volSyncP);
- }
-
- ropa_break_callback (GETHOST(call), GETPORT(call), a_fidP, FALSE);
- out:
- mnode_free (n, FALSE);
- vld_free (volh);
-
- return ret;
-}
-
-
-/*
- *
- */
-
-static int
-removenode (struct rx_call *call,
- const struct AFSFid *a_dirFidP,
- const char *a_name,
- struct AFSFetchStatus *a_srvStatusP,
- struct AFSVolSync *a_volSyncP,
- int dirp)
-{
- struct volume_handle *volh;
- struct mnode *n;
- struct mnode *child_n;
- struct msec m, pm;
- AFSFid fid;
- int ret;
- int32_t new_len;
- unsigned long child_linkcount;
-
- m.flags = VOLOP_GETSTATUS|VOLOP_DELETE;
-
- ret = fs_init_req (a_dirFidP, &m, &volh, call, &n);
- if (ret)
- return ret;
-
- assert (n->flags.fdp);
- assert (n->flags.fsp);
-
- if (n->fs.FileType != TYPE_DIR) {
- mnode_free (n, FALSE);
- return ENOTDIR;
- }
-
- pm.flags = VOLOP_GETSTATUS|VOLOP_READ|VOLOP_NOCHECK;
- fs_init_msec (call, &pm);
- pm.loop = m.loop + 1;
-
- ret = mdir_lookup(n, a_name, &fid);
- if (ret) {
- mnode_free (n, FALSE);
- vld_free (volh);
- return ret;
- }
-
- if (afs_dir_p (fid.Vnode) != dirp) {
- mnode_free (n, FALSE);
- vld_free (volh);
- return dirp ? ENOTDIR : EISDIR;
- }
-
- ret = fs_open_node (&fid, volh, &pm, &child_n);
- if (ret) {
- mnode_free (n, FALSE);
- vld_free (volh);
- return ret;
- }
-
- if (dirp) {
- ret = mdir_emptyp (child_n);
- if (!ret) {
- mnode_free (n, FALSE);
- mnode_free (child_n, FALSE);
- vld_free (volh);
- return EEXIST;
- }
- }
-
- ret = mdir_remove(n, a_name);
- if (ret) {
- mnode_free (n, FALSE);
- mnode_free (child_n, FALSE);
- vld_free (volh);
- return ret;
- }
-
- /* removes node if necessary */
- ret = vld_adjust_linkcount (volh, child_n, dirp ? -2 : -1);
- if (ret) {
- mnode_free (n, FALSE);
- mnode_free (child_n, FALSE);
- vld_free (volh);
- return ret;
- }
-
- child_linkcount = n->fs.LinkCount;
-
- mnode_free (child_n, FALSE);
-
- if (dirp) {
- ret = vld_adjust_linkcount (volh, n, -1);
- if (ret) {
- mnode_free (n, FALSE);
- vld_free (volh);
- return ret;
- }
- }
-
- new_len = n->sb.st_size;
- ret = vld_modify_vnode (volh, n, &m, NULL, &new_len);
-
- fs_update_fs (n, &m, a_srvStatusP);
-
- fid.Volume = a_dirFidP->Volume;
-
- if (ret == 0) {
- if (child_linkcount)
- ropa_break_callback (GETHOST(call), GETPORT(call), &fid, TRUE);
- else {
- AFSCBFids cbfids;
- AFSCBs cbs;
-
- cbfids.len = 1;
- cbfids.val = &fid;
- cbs.len = 0;
-
- ropa_drop_callbacks(GETHOST(call), GETPORT(call), &cbfids, &cbs);
- }
- ropa_break_callback (GETHOST(call), GETPORT(call), a_dirFidP, FALSE);
- }
-
- mnode_free (n, FALSE);
- vld_vld2volsync (volh, a_volSyncP);
- vld_free (volh);
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_RemoveFile(struct rx_call *call,
- const struct AFSFid *a_dirFidP,
- const char *a_name,
- struct AFSFetchStatus *a_srvStatusP,
- struct AFSVolSync *a_volSyncP)
-{
- mlog_log (MDEBFS, "RemoveFile: fid: %d.%d.%d name: %s",
- a_dirFidP->Volume, a_dirFidP->Vnode,
- a_dirFidP->Unique, a_name);
-
- return removenode (call, a_dirFidP, a_name, a_srvStatusP,
- a_volSyncP, FALSE);
-}
-
-/*
- *
- */
-
-int
-createentry(struct rx_call *call,
- const struct AFSFid *DirFid,
- const char *Name,
- const char *Contents,
- const struct AFSStoreStatus *InStatus,
- const struct AFSFid *ExistingFid,
- struct AFSFid *EntryFid,
- struct AFSFetchStatus *OutFidStatus,
- struct AFSFetchStatus *OutDirStatus,
- struct AFSCallBack *CallBack,
- struct AFSVolSync *VolSync)
-{
- struct volume_handle *volh;
- struct mnode *n;
- struct mnode *child_n;
- struct msec m;
- struct msec child_m;
- AFSFid child;
- int32_t len;
- int ret;
-
- m.flags = VOLOP_GETSTATUS|VOLOP_INSERT;
-
- ret = fs_init_req (DirFid, &m, &volh, call, &n);
- if (ret)
- return ret;
-
- assert (n->flags.fdp);
- assert (n->flags.fsp);
-
- if (n->fs.FileType != TYPE_DIR) {
- mnode_free (n, FALSE);
- vld_free (volh);
- return EPERM;
- }
-
- child.Volume = volh->vol;
-
- child_m.flags = VOLOP_GETSTATUS;
- fs_init_msec (call, &child_m);
- child_m.caller_access = m.caller_access;
- child_m.anonymous_access = m.anonymous_access;
-
- if (InStatus) {
- ret = check_ss_bits (&m, InStatus, TRUE);
- if (ret == 0) {
- AFSFid existing;
- ret = mdir_lookup (n, Name, &existing);
- if (ret == 0)
- ret = EEXIST;
- else if (ret == ENOENT)
- ret = 0;
- }
-
- if (ret == 0)
- ret = vld_create_entry (volh, n, &child,
- Contents ? TYPE_LINK : TYPE_FILE,
- InStatus, &child_n, &child_m);
-
- if (ret)
- goto out_parent;
- } else {
- ret = fs_open_node (ExistingFid, volh, &child_m, &child_n);
- if (ret) {
- mlog_log(MDEBFS,
- "createentry: Failed to open existing fid, ret = %d", ret);
- goto out_parent;
- }
-
- if (child_n->fs.ParentVnode != DirFid->Vnode
- || child_n->fs.ParentUnique != DirFid->Unique) {
- ret = EXDEV;
- mlog_log (MDEBFS, "createentry: ret = %d (EXDEV)", EXDEV);
- goto out_child;
- }
- ret = vld_adjust_linkcount (volh, child_n, 1);
- if (ret)
- goto out_child;
-
- child = *ExistingFid;
- }
-
- /* XXX check name ! */
- ret = mdir_creat (n, Name, child);
-
- if (ret == 0) {
- len = n->sb.st_size;
- ret = vld_modify_vnode (volh, n, &m, NULL, &len);
- }
-
- if (Contents && ret == 0) {
- assert (child_n->flags.fdp);
-
- len = strlen (Contents);
- ret = write (child_n->fd, Contents, len);
- if (ret != len) {
- ret = errno;
- mlog_log (MDEBFS, "createentry: ret = %d (write)", ret);
- } else {
- ret = vld_modify_vnode (volh, child_n, &child_m, NULL, &len);
- }
- }
-
- if (ret) {
- mdir_remove (n, Name);
- vld_adjust_linkcount (volh, child_n, -1);
- mnode_free (n, TRUE);
- mnode_free (child_n, TRUE);
- vld_free (volh);
- return ret;
- }
-
- if (EntryFid)
- *EntryFid = child;
-
- fs_update_fs (child_n, &child_m, OutFidStatus);
- fs_update_fs (n, &m, OutDirStatus);
-
- ret = vld_info_uptodatep (volh);
- if (ret)
- goto out_child;
-
- if (CallBack)
- ropa_getcallback (GETHOST(call), GETPORT(call), EntryFid, CallBack,
- volh->info.type);
- ropa_break_callback (GETHOST(call), GETPORT(call), DirFid, FALSE);
-
- vld_vld2volsync (volh, VolSync);
- out_child:
- mnode_free (child_n, FALSE);
- out_parent:
- mnode_free (n, FALSE);
- vld_free (volh);
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_CreateFile(struct rx_call *call,
- const struct AFSFid *DirFid,
- const char *Name,
- const struct AFSStoreStatus *InStatus,
- struct AFSFid *OutFid,
- struct AFSFetchStatus *OutFidStatus,
- struct AFSFetchStatus *OutDirStatus,
- struct AFSCallBack *CallBack,
- struct AFSVolSync *a_volSyncP)
-{
- int ret;
-
- mlog_log (MDEBFS, "CreateFile: fid: %d.%d.%d name: %s",
- DirFid->Volume, DirFid->Vnode,
- DirFid->Unique, Name);
-
- ret = createentry(call, DirFid, Name, NULL, InStatus, NULL, OutFid,
- OutFidStatus, OutDirStatus, CallBack, a_volSyncP);
-
- if (ret)
- mlog_log (MDEBFS, "CreateFile: failed with ret = %d", ret);
- else
- mlog_log (MDEBFS, "CreateFile: created fid: %d.%d.%d calleraccess: %x",
- OutFid->Volume, OutFid->Vnode,
- OutFid->Unique, OutFidStatus->CallerAccess);
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_Rename(struct rx_call *call,
- const struct AFSFid *a_origDirFidP,
- const char *a_origNameP,
- const struct AFSFid *a_newDirFidP,
- const char *a_newNameP,
- struct AFSFetchStatus *a_origDirStatusP,
- struct AFSFetchStatus *a_newDirStatusP,
- struct AFSVolSync *a_volSyncP)
-{
- struct volume_handle *volh;
- AFSFid victim, child;
- struct mnode *orig_n, *new_n = NULL;
- struct mnode *child_n = NULL, *victim_n = NULL;
- struct msec m1, m2;
- struct msec *orig_m = &m1, *new_m = &m2;
- int32_t len1, len2;
- int ret;
- int dirp;
- int same_dir = FALSE;
- int delete_dest = FALSE;
- int victim_deleted = FALSE;
-
- mlog_log (MDEBFS, "Rename: orig_fid: %d.%d.%d orig_name: %s "
- "new_fid: %d.%d.%d new_name: %s",
- a_origDirFidP->Volume, a_origDirFidP->Vnode,
- a_origDirFidP->Unique, a_origNameP,
- a_newDirFidP->Volume, a_newDirFidP->Vnode,
- a_newDirFidP->Unique, a_newNameP);
-
- if (a_origDirFidP->Volume != a_newDirFidP->Volume)
- return EXDEV;
-
- if (!(afs_dir_p(a_origDirFidP->Vnode))
- || !(afs_dir_p(a_newDirFidP->Vnode)))
- return EPERM;
-
- if (a_origDirFidP->Vnode == a_newDirFidP->Vnode &&
- a_origDirFidP->Unique == a_newDirFidP->Unique) {
- same_dir = TRUE;
- orig_m->flags = VOLOP_GETSTATUS|VOLOP_INSERT|VOLOP_DELETE;
- } else {
- orig_m->flags = VOLOP_GETSTATUS|VOLOP_DELETE;
- }
-
- ret = fs_init_req (a_origDirFidP, orig_m, &volh, call, &orig_n);
- if (ret)
- return ret;
-
- assert (orig_n->flags.fdp);
- assert (orig_n->flags.fsp);
-
- ret = mdir_lookup(orig_n, a_origNameP, &child);
- if (ret == 0)
- ret = fs_open_node (&child, volh, orig_m, &child_n);
- if (ret) {
- mnode_free (orig_n, FALSE);
- return ret;
- }
-
- assert(child_n->flags.fsp);
-
- dirp = afs_dir_p(child.Vnode);
- if (same_dir == FALSE && child_n->fs.LinkCount != (dirp ? 2 : 1)) {
- ret = EXDEV;
- goto out1;
- }
-
- if (same_dir == TRUE) {
- new_n = orig_n;
- new_m = orig_m;
- } else {
-
- new_m->flags = VOLOP_GETSTATUS|VOLOP_INSERT|VOLOP_DELETE;
-
- /* XXX */
- ret = fs_init_msec(call, new_m);
- ret = fs_open_node (a_newDirFidP, volh, new_m, &new_n);
- if (ret) {
- new_m->flags = VOLOP_GETSTATUS|VOLOP_INSERT;
-
- /* XXX */
- ret = fs_open_node (a_newDirFidP, volh, new_m, &new_n);
- if (ret) {
- mnode_free (orig_n, FALSE);
- vld_free (volh);
- return ret;
- }
- }
- }
-
- ret = mdir_lookup(new_n, a_newNameP, &victim);
- if (!ret) {
- if (!(new_m->flags & VOLOP_DELETE)
- || afs_dir_p(victim.Vnode) != dirp) {
- ret = EPERM;
- goto out1;
- }
- delete_dest = TRUE;
- ret = fs_open_node (&victim, volh, new_m, &victim_n);
- if (ret)
- goto out1;
-
- assert(victim_n->flags.fsp);
-
- if (child_n->fs.LinkCount != (dirp ? 2 : 1)) {
- ret = EPERM;
- mnode_free(victim_n, FALSE);
- goto out1;
- }
- }
-
- ret = mdir_rename(orig_n, a_origNameP, &len1,
- new_n, a_newNameP, &len2);
-
- if (ret) {
- if (delete_dest == TRUE)
- mnode_free(victim_n, FALSE);
- goto out1;
- }
-
- if (!ret && dirp) {
- ret = mdir_changefid(child_n, "..", *a_newDirFidP);
- if (ret) {
- /* XXX recover */
- }
- }
-
- if (delete_dest == TRUE) {
- /* remove the node if necessary */
- ret = vld_adjust_linkcount (volh, victim_n,
- -(afs_dir_p(victim.Vnode) ? 2 : 1));
- if (victim_n->fs.LinkCount == 0)
- victim_deleted = TRUE;
-
- mnode_free(victim_n, FALSE);
- if (ret) {
- /*
- * XXX Remove failed, try to recover.
- * Do not check for error, things are bad anyway.
- * Maybe this should cause a shutdown + salvage?
- */
- goto out1;
- }
- }
-
- /* Update linkcount on parents if directory move */
- if (dirp && !same_dir) {
- ret = vld_adjust_linkcount (volh, orig_n, -1);
- ret = vld_adjust_linkcount (volh, new_n, 1);
- }
-
- /* XXX update st_ctime and st_mtime of both parents */
-
- vld_modify_vnode (volh, orig_n, orig_m, NULL, &len1);
- if (!same_dir)
- vld_modify_vnode (volh, new_n, new_m, NULL, &len2);
-
- fs_update_fs (orig_n, orig_m, a_origDirStatusP);
- fs_update_fs (new_n, new_m, a_newDirStatusP);
-
- ropa_break_callback (GETHOST(call), GETPORT(call), a_origDirFidP, FALSE);
- if (!same_dir) {
- ropa_break_callback (GETHOST(call),GETPORT(call), a_newDirFidP, FALSE);
- if (dirp)
- ropa_break_callback (GETHOST(call), GETPORT(call), &child, FALSE);
- }
-
- if (victim_deleted == TRUE) {
- AFSCBFids cbfids;
- AFSCBs cbs;
-
- cbfids.len = 1;
- cbfids.val = &victim;
- cbs.len = 0;
-
- ropa_drop_callbacks(GETHOST(call), GETPORT(call), &cbfids, &cbs);
- } else
- ropa_break_callback(GETHOST(call), GETPORT(call), &victim, TRUE);
-
- out1:
- mnode_free (orig_n, FALSE);
- if (child_n)
- mnode_free (child_n, FALSE);
- if (!same_dir && new_n)
- mnode_free (new_n, FALSE);
-
- if (ret == 0)
- vld_vld2volsync (volh, a_volSyncP);
-
- vld_free (volh);
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_Symlink(struct rx_call *call,
- const struct AFSFid *a_dirFidP,
- const char *a_nameP,
- const char *a_linkContentsP,
- const struct AFSStoreStatus *a_origDirStatP,
- struct AFSFid *a_newFidP,
- struct AFSFetchStatus *a_newFidStatP,
- struct AFSFetchStatus *a_newDirStatP,
- struct AFSVolSync *a_volSyncP)
-{
- int ret;
-
- mlog_log (MDEBFS, "Symlink: fid: %d.%d.%d name: %s content: %s",
- a_dirFidP->Volume, a_dirFidP->Vnode,
- a_dirFidP->Unique, a_nameP, a_linkContentsP);
-
- ret = createentry(call, a_dirFidP, a_nameP, a_linkContentsP,
- a_origDirStatP, NULL, a_newFidP, a_newFidStatP,
- a_newDirStatP, NULL, a_volSyncP);
-
- if (ret)
- mlog_log (MDEBFS, "Symlink: failed with ret = %d", ret);
- else
- mlog_log (MDEBFS, "Symlink: created fid: %d.%d.%d calleraccess: %x",
- a_newFidP->Volume, a_newFidP->Vnode,
- a_newFidP->Unique, a_newFidStatP->CallerAccess);
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_Link(struct rx_call *call,
- const struct AFSFid *a_dirFidP,
- const char *a_nameP,
- const struct AFSFid *a_existingFidP,
- struct AFSFetchStatus *a_newFidStatP,
- struct AFSFetchStatus *a_newDirStatP,
- struct AFSVolSync *a_volSyncP)
-{
- int ret;
-
- mlog_log (MDEBFS, "Link: fid: %d.%d.%d name: %s existing",
- a_dirFidP->Volume, a_dirFidP->Vnode,
- a_dirFidP->Unique, a_nameP);
-
- if (afs_dir_p(a_existingFidP->Vnode))
- return EISDIR;
-
- ret = createentry(call, a_dirFidP, a_nameP, NULL, NULL, a_existingFidP,
- NULL, a_newFidStatP, a_newDirStatP, NULL, a_volSyncP);
-
- if (ret)
- mlog_log (MDEBFS, "Link: failed with ret = %d", ret);
- else
- mlog_log (MDEBFS, "Link: created name: %s calleraccess: %x",
- a_nameP, a_newFidStatP->CallerAccess);
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_MakeDir(struct rx_call *call,
- const struct AFSFid *a_parentDirFidP,
- const char *a_newDirNameP,
- const struct AFSStoreStatus *a_currStatP,
- struct AFSFid *a_newDirFidP,
- struct AFSFetchStatus *a_dirFidStatP,
- struct AFSFetchStatus *a_parentDirStatP,
- struct AFSCallBack *a_newDirCallBackP,
- struct AFSVolSync *a_volSyncP)
-{
- struct volume_handle *volh;
- struct mnode *n;
- struct mnode *child_n;
- struct msec m;
- struct msec child_m;
- int ret;
- AFSFid child;
-
- mlog_log (MDEBFS, "MakeDir: fid: %d.%d.%d name: %s",
- a_parentDirFidP->Volume, a_parentDirFidP->Vnode,
- a_parentDirFidP->Unique, a_newDirNameP);
-
- m.flags = VOLOP_WRITE | VOLOP_INSERT | VOLOP_GETSTATUS;
-
- ret = fs_init_req (a_parentDirFidP, &m, &volh, call, &n);
- if (ret)
- return ret;
-
- if (n->fs.FileType != TYPE_DIR) {
- mnode_free (n, FALSE);
- return EPERM;
- }
-
- child.Volume = volh->vol;
-
- ret = check_ss_bits (&m, a_currStatP, TRUE);
- if (ret)
- goto out_parent;
-
- child_m.flags = VOLOP_GETSTATUS;
- fs_init_msec(call, &child_m);
- ret = vld_create_entry (volh, n, &child, TYPE_DIR,
- a_currStatP, &child_n, &child_m);
- if (ret)
- goto out_parent;
-
- ret = vld_adjust_linkcount (volh, n, 1);
- if (ret) {
- mnode_free (n, FALSE);
- mnode_free (child_n, FALSE);
- vld_free (volh);
- return ret;
- }
-
- /* XXX check name ! */
- ret = mdir_creat (n, a_newDirNameP, child);
-
- if (ret == 0) {
- int32_t len = n->sb.st_size;
- ret = vld_modify_vnode (volh, n, &m, NULL, &len);
- }
-
- if (ret) {
- /* XXX adjust directory size? */
- vld_adjust_linkcount (volh, n, -1);
- vld_adjust_linkcount (volh, child_n, -1); /* removes node if necessary */
- mnode_free (n, FALSE);
- mnode_free (child_n, TRUE);
- vld_free (volh);
- return ret;
- }
-
- *a_newDirFidP = child;
- fs_update_fs (n, &m, a_parentDirStatP);
- fs_update_fs (child_n, &m, a_dirFidStatP);
- vld_vld2volsync (volh, a_volSyncP);
-
- memcpy(&child_n->e.u.dir.acl, &n->e.u.dir.acl,
- sizeof(n->e.u.dir.acl));
- memcpy(&child_n->e.u.dir.negacl, &n->e.u.dir.negacl,
- sizeof(n->e.u.dir.negacl));
-
- ret = vld_put_acl(volh, child_n, &child_m);
- if (ret) {
- /* XXX adjust directory size? */
- vld_adjust_linkcount (volh, n, -1);
- vld_adjust_linkcount (volh, child_n, -1); /* removes node if necessary */
- mnode_free (n, FALSE);
- mnode_free (child_n, TRUE);
- vld_free (volh);
- return ret;
- }
- ropa_break_callback (GETHOST(call), GETPORT(call), a_parentDirFidP, FALSE);
-
- ret = vld_info_uptodatep (volh);
- if (ret)
- goto out_child;
-
- ropa_getcallback (GETHOST(call), GETPORT(call),
- a_newDirFidP, a_newDirCallBackP,
- volh->info.type);
-
- mlog_log (MDEBFS, "MakeDir: created child fid: %d.%d.%d",
- a_newDirFidP->Volume, a_newDirFidP->Vnode,
- a_newDirFidP->Unique);
-
- out_child:
- mnode_free (child_n, FALSE);
- out_parent:
- mnode_free (n, FALSE);
- vld_free (volh);
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_RemoveDir(struct rx_call *call,
- const struct AFSFid *a_parentDirP,
- const char *a_dirNameP,
- struct AFSFetchStatus *a_newParentDirStatP,
- struct AFSVolSync *a_volSyncP)
-{
- mlog_log (MDEBFS, "RemoveDir: fid: %d.%d.%d name: %s",
- a_parentDirP->Volume, a_parentDirP->Vnode,
- a_parentDirP->Unique, a_dirNameP);
-
- return removenode (call, a_parentDirP, a_dirNameP,
- a_newParentDirStatP, a_volSyncP, TRUE);
-}
-
-/*
- *
- */
-
-int
-SRXAFS_GiveUpCallBacks(struct rx_call *call,
- const AFSCBFids *a_fidArrayP,
- const AFSCBs *a_callBackArrayP)
-{
- int ret;
-
- mlog_log (MDEBFS, "GiveUpCallBacks");
-
- ret = ropa_drop_callbacks (GETHOST(call), GETPORT(call),
- a_fidArrayP, a_callBackArrayP);
- if (ret)
- mlog_log (MDEBFS, "GiveUpCallBacks: returning %d", ret);
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_GetVolumeStatus(struct rx_call *call,
- const int32_t a_volIDP,
- struct AFSFetchVolumeStatus *a_volFetchStatP,
- char *a_volNameP,
- char *a_offLineMsgP,
- char *a_motdP)
-{
- struct volume_handle *volh;
- AFSFid fid;
- struct msec m;
- int ret;
-
- mlog_log (MDEBFS, "GetVolumeStats: vol: %d", a_volIDP);
-
- m.flags = VOLOP_GETSTATUS;
- fid.Volume = a_volIDP;
-
- ret = fs_init_req (&fid, &m, &volh, call, NULL);
- if (ret) {
- mlog_log (MDEBFS, "GetVolumeStatus: fs_init_req returned %d", ret);
- return ret;
- }
-
- ret = vld_get_volstats (volh, a_volFetchStatP, a_volNameP,
- a_offLineMsgP, a_motdP);
- return ret;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_SetVolumeStatus(struct rx_call *call,
- const int32_t a_volIDP,
- const struct AFSStoreVolumeStatus *a_volStoreStatP,
- const char *a_volNameP,
- const char *a_offLineMsgP,
- const char *a_motdP)
-{
- struct volume_handle *volh;
- AFSFid fid;
- struct msec m;
- int ret;
-
- mlog_log (MDEBFS, "SRXAFS_SetVolumeStatus: vol: %d", a_volIDP);
-
- m.flags = 0;
- fid.Volume = a_volIDP;
- fid.Vnode = 1;
- fid.Unique = 1;
-
- ret = fs_init_req (&fid, &m, &volh, call, NULL);
- if (ret) {
- goto out;
- }
-
- if (!super_user(&m)) {
- ret = EPERM;
- goto out;
- }
-
- ret = vld_set_volstats (volh, a_volStoreStatP, a_volNameP,
- a_offLineMsgP, a_motdP);
-
- out:
- vld_free (volh);
- mlog_log (MDEBFS, "SRXAFS_SetVolumeStatus: fs_init_req returned %d", ret);
- return ret;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_GetRootVolume(struct rx_call *call,
- char *a_rootVolNameP)
-{
- mlog_log (MDEBFS, "GetRootVolume");
-
- strlcpy (a_rootVolNameP, "root.cell", AFSNAMEMAX);
- a_rootVolNameP[AFSNAMEMAX-1] = '\0';
- return 0;
-}
-
-/*
- * Get time, the poor mans ntp, used as probe by some clients
- */
-
-int
-SRXAFS_GetTime(struct rx_call *call,
- uint32_t *a_secondsP,
- uint32_t *a_uSecondsP)
-{
- struct timeval tv;
-
- mlog_log (MDEBFS, "GetTime");
-
- gettimeofday (&tv, NULL);
-
- *a_secondsP = tv.tv_sec;
- *a_uSecondsP = tv.tv_usec;
-
- return 0;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_NGetVolumeInfo(struct rx_call *call,
- const char *VolumeName,
- struct AFSVolumeInfo *stuff)
-{
- return EPERM;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_BulkStatus(struct rx_call *call,
- const AFSCBFids *FidsArray,
- AFSBulkStats *StatArray,
- AFSCBs *CBArray,
- struct AFSVolSync *Sync)
-{
- struct volume_handle *volh = NULL;
- struct mnode *n;
- struct msec m;
- int ret, i = 0;
- int32_t oldvolume = -1;
-
- mlog_log (MDEBFS, "BulkStatus");
-
- CBArray->val = NULL;
- CBArray->len = 0;
- StatArray->val = NULL;
- StatArray->len = 0;
-
- if (FidsArray->len == 0)
- return 0;
-
- m.flags = VOLOP_GETSTATUS;
-
- ret = fs_init_msec (call, &m);
- if (ret)
- return ret;
-
- StatArray->len = FidsArray->len;
- StatArray->val = malloc(StatArray->len * sizeof(StatArray->val[0]));
- if (StatArray->val == NULL)
- return ENOMEM;
-
- CBArray->len = FidsArray->len;
- CBArray->val = malloc(CBArray->len * sizeof(CBArray->val[0]));
- if(CBArray->val == NULL) {
- free(StatArray->val);
- return ENOMEM;
- }
-
- for (i = 0; FidsArray->len > i ; i++) {
-
- if (FidsArray->val[i].Volume != oldvolume) {
- if (volh)
- vld_free (volh);
-
- ret = vld_find_vol (FidsArray->val[i].Volume, &volh);
- if (ret)
- return ret;
-
- if (volh->flags.offlinep) {
- vld_free (volh);
- return VOFFLINE;
- }
-
- ret = vld_db_uptodate (volh);
- if (ret) {
- vld_free (volh);
- return ret;
- }
- oldvolume = FidsArray->val[i].Volume;
- }
-
- ret = fs_open_node (&FidsArray->val[i], volh, &m, &n);
- if (ret) {
- vld_free (volh);
- return ret;
- }
-
- fs_update_fs (n, &m, &StatArray->val[i]);
-
- mnode_free (n, FALSE);
- n = NULL;
-
- ret = vld_info_uptodatep (volh);
- if (ret)
- goto out;
-
- ropa_getcallback (GETHOST(call), GETPORT(call),
- &FidsArray->val[i], &CBArray->val[i],
- volh->info.type);
- }
-
- out:
- vld_free (volh);
-
- return 0;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_SetLock(struct rx_call *call,
- const struct AFSFid *Fid,
- const ViceLockType Type,
- struct AFSVolSync *Sync)
-{
- return EPERM;
-}
-
-/*
- *
- */
-
-int
-SRXAFS_ExtendLock(struct rx_call *call,
- const struct AFSFid *Fid,
- struct AFSVolSync *Sync)
-{
- return EPERM;
-}
-
-
-/*
- *
- */
-
-int
-SRXAFS_ReleaseLock(struct rx_call *call,
- const struct AFSFid *Fid,
- struct AFSVolSync *Sync)
-{
- return EPERM;
-}
diff --git a/usr.sbin/afs/src/milko/fs/fsrv_locl.h b/usr.sbin/afs/src/milko/fs/fsrv_locl.h
deleted file mode 100644
index 012c759a643..00000000000
--- a/usr.sbin/afs/src/milko/fs/fsrv_locl.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 1999 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * $arla: fsrv_locl.h,v 1.15 2002/04/20 15:57:17 lha Exp $
- */
-
-
-#ifndef __FILBUNKE_FSRV_H
-#define __FILBUNKE_FSRV_H 1
-
-#include <config.h>
-
-#include <roken.h>
-
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <err.h>
-#include <assert.h>
-
-#include <rx/rx.h>
-#include <rx/rx_null.h>
-
-#ifdef KERBEROS
-#ifdef HAVE_OPENSSL
-#include <openssl/des.h>
-#else
-#include <des.h>
-#endif
-#include <krb.h>
-#include <rxkad.h>
-#endif
-
-#include <ports.h>
-#include <msecurity.h>
-#include <netinit.h>
-#include <ko.h>
-#include <service.h>
-#include <part.h>
-
-#include <agetarg.h>
-
-#include <fs.ss.h>
-#include <volumeserver.ss.h>
-
-#include "fs_def.h"
-
-#include <pts.h>
-#include "connsec.h"
-
-#include <dpart.h>
-#include <voldb.h>
-#include <vld.h>
-
-#include <fbuf.h>
-#include <fdir.h>
-#include <mdir.h>
-
-#include <ropa.h>
-
-#include <mlog.h>
-#include <mdebug.h>
-
-#include <salvage.h>
-
-#include <dump.h>
-
-#endif /* __FILBUNKE_FSRV_H */
diff --git a/usr.sbin/afs/src/milko/fs/volprocs.c b/usr.sbin/afs/src/milko/fs/volprocs.c
deleted file mode 100644
index 95ca210fb54..00000000000
--- a/usr.sbin/afs/src/milko/fs/volprocs.c
+++ /dev/null
@@ -1,1304 +0,0 @@
-/*
- * Copyright (c) 1999 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "fsrv_locl.h"
-
-RCSID("$arla: volprocs.c,v 1.19 2002/09/08 04:56:15 ahltorp Exp $");
-
-/*
- * exit debug logging
- */
-
-#define VOLSER_EXIT mlog_log(MDEBVOLDB, __FUNCTION__ " error: %s(%d)", koerr_gettext(ret), ret)
-
-/*
- * Helper function
- */
-
-static int
-volser_fetch_vh (int32_t partition, int32_t volid,
- struct dp_part **dp, volume_handle **vh)
-{
- int ret;
-
- ret = dp_create (partition, dp);
- if (ret) {
- fprintf (stderr, "volser_fetch_vh: dp_create: %d\n", ret);
- return VOLSERILLEGAL_PARTITION;
- }
-
- ret = vld_open_volume_by_num (*dp, volid, vh);
- if (ret) {
- fprintf (stderr, "volser_fetch_vh: vld_open_volume_by_num: %d\n", ret);
- dp_free (*dp);
- if (ret == ENOENT)
- return VNOVOL;
- return ret;
- }
-
- ret = vld_info_uptodatep (*vh);
- if (ret) {
- printf ("volser_fetch_vh: vld_info_uptodatep: %d\n", ret);
- vld_free (*vh);
- dp_free (*dp);
- return VOLSERFAILEDOP; /* XXX */
- }
- return 0;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolCreateVolume(struct rx_call *call,
- const int32_t partition,
- const char *name,
- const int32_t type,
- const int32_t parent,
- int32_t *volid,
- int32_t *trans)
-{
- int ret = 0;
- int32_t backstoretype = VLD_SVOL;
- struct dp_part *dp;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolCreateVolume"
- " part %d name %s type %d parent %d volid %u",
- partition, name, type, parent, *volid);
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- /* XXX parent should be used */
-
- ret = vld_create_trans (partition, *volid, trans);
-
- if (ret)
- goto out;
-
- ret = vld_trans_set_iflags (*trans, ITCreate);
- if (ret)
- goto out;
-
- ret = dp_create (partition, &dp);
- if (ret) {
- vld_end_trans (*trans, NULL);
- goto out;
- }
-
- ret = vld_create_volume (dp, *volid, name, backstoretype, type, 0);
- if (ret) {
- vld_end_trans (*trans, NULL);
- goto out;
- }
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolDeleteVolume(struct rx_call *call,
- const int32_t transid)
-{
- int ret = 0;
- int32_t backstoretype = VLD_SVOL;
- struct trans *trans;
- struct dp_part *dp;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolDeleteVolume");
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = vld_verify_trans(transid);
- if (ret)
- goto out;
-
- ret = vld_get_trans(transid, &trans);
- if (ret)
- goto out;
-
- ret = dp_create (trans->partition, &dp);
- if (ret) {
- vld_put_trans (trans);
- goto out;
- }
-
- ret = vld_delete_volume (dp, trans->volid, backstoretype, 0);
-
- vld_put_trans(trans);
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolNukeVolume(struct rx_call *call,
- const int32_t partID,
- const int32_t volID)
-{
- int ret = 0;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolNukeVolume");
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = VOLSERFAILEDOP;
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolDump(struct rx_call *call,
- const int32_t fromTrans,
- const int32_t fromDate)
-{
- int ret = 0;
- struct trans *trans;
- struct dp_part *dp;
- volume_handle *vh;
-
- mlog_log (MDEBVOLDB,
- "VOLSER_AFSVolDump: trans %d fromdate %d",
- fromTrans, fromDate);
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = vld_verify_trans (fromTrans);
- if (ret)
- goto out;
-
- ret = vld_get_trans (fromTrans, &trans);
- if (ret)
- goto out;
-
- ret = volser_fetch_vh (trans->partition, trans->volid, &dp, &vh);
- if (ret) {
- vld_put_trans(trans);
- goto out;
- }
-
- if (fromDate != 0) {
- vld_put_trans(trans);
- ret = VOLSERFAILEDOP;
- goto out;
- }
-
- ret = generate_dump(call, vh);
-
- vld_put_trans (trans);
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolSignalRestore(struct rx_call *call,
- const char *name,
- const int32_t type,
- const int32_t pid,
- const int32_t cloneid)
-{
- int ret = 0;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolSignalRestore");
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = VOLSERFAILEDOP;
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolRestore(struct rx_call *call,
- const int32_t transid,
- const int32_t flags,
- const struct restoreCookie *cookie)
-{
- int ret = 0;
- struct trans *trans;
- struct dp_part *dp;
- volume_handle *vh;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolRestore");
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = vld_verify_trans(transid);
- if (ret)
- goto out;
-
- ret = vld_get_trans(transid, &trans);
- if (ret)
- goto out;
-
- ret = volser_fetch_vh (trans->partition, trans->volid, &dp, &vh);
- if (ret) {
- vld_put_trans(trans);
- goto out;
- }
-
- ret = parse_dump(call, vh);
- if (ret) {
- vld_free (vh);
- dp_free (dp);
- vld_put_trans(trans);
- goto out;
- }
-
- ret = vld_rebuild(vh);
-
- vld_info_write(vh);
-
- vld_free (vh);
- dp_free (dp);
-
- vld_put_trans(trans);
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolForward(struct rx_call *call,
- const int32_t fromTrans,
- const int32_t fromData,
- const struct destServer *destination,
- const int32_t destTrans,
- const struct restoreCookie *cookie)
-{
- int ret = 0;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolForward");
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = VOLSERFAILEDOP;
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolClone(struct rx_call *call,
- const int32_t trans,
- const int32_t purgeVol,
- const int32_t newType,
- const char *newName,
- int32_t *newVol)
-{
- int ret = 0;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolClone"
- " trans %d purgevol %d newtype %d newname %d",
- trans, purgeVol, newType, newName);
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = VOLSERFAILEDOP;
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolReClone(struct rx_call *call,
- const int32_t tid,
- const int32_t cloneID)
-{
- int ret = 0;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolReClone");
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = VOLSERFAILEDOP;
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolSetForwarding(struct rx_call *call,
- const int32_t tid,
- const int32_t newsite)
-{
- int ret = 0;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolSetForwarding");
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = VOLSERFAILEDOP;
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolTransCreate(struct rx_call *call,
- const int32_t volume,
- const int32_t partition,
- const int32_t flags,
- int32_t *trans)
-{
- int ret = 0;
- struct dp_part *dp;
- volume_handle *vh;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolTransCreate");
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = volser_fetch_vh (partition, volume, &dp, &vh);
- if (ret)
- goto out;
-
- vld_free (vh);
- dp_free (dp);
-
- ret = vld_create_trans(partition, volume, trans);
- if (ret)
- goto out;
-
- ret = vld_trans_set_iflags(*trans, flags);
- if (ret) {
- vld_end_trans (*trans, NULL);
- goto out;
- }
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolEndTrans(struct rx_call *call,
- const int32_t transid,
- int32_t *rcode)
-{
- struct trans *trans;
- int ret = 0;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolEndTrans trans %d", transid);
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = vld_verify_trans(transid);
- if (ret)
- goto out;
-
- ret = vld_get_trans(transid, &trans);
- if (ret)
- goto out;
-
- ropa_break_volume_callback(trans->volid); /* XXX */
-
- vld_put_trans(trans);
-
- ret = vld_end_trans(transid, rcode);
- if (ret)
- goto out;
-
- out:
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolEndTrans returns %d", ret);
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolGetFlags(struct rx_call *call,
- const int32_t trans,
- int32_t *flags)
-{
- int ret = 0;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolGetFlags");
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = vld_verify_trans(trans);
- if (ret)
- goto out;
-
- ret = vld_trans_get_vflags(trans, flags);
- if (ret)
- goto out;
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolSetFlags(struct rx_call *call,
- const int32_t transid,
- const int32_t flags)
-{
- int ret = 0;
- struct trans *trans;
- struct dp_part *dp;
- volume_handle *vh;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolSetFlags"
- " trans %d flags %d", transid, flags);
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = vld_verify_trans(transid);
- if (ret)
- goto out;
-
- ret = vld_get_trans(transid, &trans);
- if (ret)
- goto out;
-
- ret = volser_fetch_vh (trans->partition, trans->volid, &dp, &vh);
- if (ret) {
- vld_put_trans(trans);
- goto out;
- }
-
- if (flags & VTDeleteOnSalvage)
- vh->info.destroyMe = 's';
- else
- vh->info.destroyMe = 0;
-
-#if 0
- assert ((flags & VTOutOfService) == 0); /* XXX */
-#endif
-
- vld_info_write(vh);
-
- vld_free (vh);
- dp_free (dp);
-
- vld_put_trans(trans);
-
- ret = vld_trans_set_vflags(transid, flags);
- if (ret)
- goto out;
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolGetName(struct rx_call *call,
- const int32_t tid,
- char tname[256])
-{
- int ret = 0;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolGetName");
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = VOLSERFAILEDOP;
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolGetStatus(struct rx_call *call,
- const int32_t transid,
- struct volser_status *status)
-{
- int ret = 0;
- struct trans *trans;
- struct dp_part *dp;
- volume_handle *vh;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolGetStatus");
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = vld_verify_trans(transid);
- if (ret)
- goto out;
-
- ret = vld_get_trans(transid, &trans);
- if (ret)
- goto out;
-
- ret = volser_fetch_vh (trans->partition, trans->volid, &dp, &vh);
- if (ret) {
- vld_put_trans(trans);
- goto out;
- }
-
- status->volID = vh->info.volid;
- status->nextUnique = 0 /* XXX */;
- status->type = vh->info.type;
- status->parentID = vh->info.parentID;
- status->cloneID = vh->info.cloneID;
- status->backupID = vh->info.backupID;
- status->restoredFromID = 0 /* XXX */;
- status->maxQuota = vh->info.maxquota;
- status->minQuota = 0 /* XXX */;
- status->owner = 0 /* XXX */;
- status->creationDate = vh->info.creationDate;
- status->accessDate = vh->info.accessDate;
- status->updateDate = vh->info.updateDate;
- status->exprirationDate = 0 /* XXX */;
- status->backupDate = vh->info.backupDate;
- status->copyDate = 0 /* XXX */;
-
- vld_free (vh);
- dp_free (dp);
-
- vld_put_trans(trans);
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolSetIdsTypes(struct rx_call *call,
- const int32_t transid,
- const char *name,
- const int32_t type,
- const int32_t parentID,
- const int32_t cloneID,
- const int32_t backupID)
-{
- int ret = 0;
- struct trans *trans;
- struct dp_part *dp;
- volume_handle *vh;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolSetIdsTypes: type %d parentID %d "
- "cloneID %d backupID %d", type, parentID, cloneID, backupID);
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = vld_verify_trans(transid);
- if (ret)
- goto out;
-
- ret = vld_get_trans(transid, &trans);
- if (ret)
- goto out;
-
- ret = volser_fetch_vh (trans->partition, trans->volid, &dp, &vh);
- if (ret) {
- vld_put_trans(trans);
- goto out;
- }
-
- strlcpy(vh->info.name, name, VNAMESIZE);
- vh->info.type = type;
- vh->info.parentID = parentID;
- vh->info.cloneID = cloneID;
- vh->info.backupID = backupID;
-
- vld_info_write(vh);
-
- vld_free (vh);
- dp_free (dp);
-
- vld_put_trans(trans);
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolSetDate(struct rx_call *call,
- const int32_t transid,
- const int32_t newDate)
-{
- int ret = 0;
- struct trans *trans;
- struct dp_part *dp;
- volume_handle *vh;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolSetDate");
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = vld_verify_trans(transid);
- if (ret)
- goto out;
-
- ret = vld_get_trans(transid, &trans);
- if (ret)
- goto out;
-
- ret = volser_fetch_vh (trans->partition, trans->volid, &dp, &vh);
- if (ret) {
- vld_put_trans(trans);
- goto out;
- }
-
- vh->info.creationDate = newDate;
-
- vld_info_write(vh);
-
- vld_free (vh);
- dp_free (dp);
-
- vld_put_trans(trans);
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolListPartitions(struct rx_call *call,
- struct pIDs *partIDs)
-{
- int i;
- struct dp_part *dp = NULL;
- int ret = 0;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolListPartitions");
-
- i = 0;
- do {
- ret = dp_find(&dp);
- if (dp == NULL)
- break;
- if (ret)
- goto out;
- partIDs->partIds[i] = dp->num;
- i++;
- } while (i < 26);
-
- for (; i < 26; i++)
- partIDs->partIds[i] = -1;
-
- ret = 0;
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolPartitionInfo(struct rx_call *call,
- const char *name,
- struct diskPartition *partition)
-{
- int num;
- struct dp_part *dp;
- int ret = 0;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolPartitionInfo");
-
- num = partition_name2num (name);
- if (num == -1) {
- ret = VOLSERILLEGAL_PARTITION;
- goto out;
- }
-
- ret = dp_create (num, &dp);
- if (ret)
- goto out;
-
- memset(partition, 0, sizeof(*partition));
- strlcpy(partition->name, dp->part, 32);
- partition->free = 1000;
-
- dp_free(dp);
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-
-static void
-copy_volumeinfo(struct volintInfo *volinfo,
- volume_handle *vh,
- const int32_t partID)
-{
- strlcpy(volinfo->name, vh->info.name, VNAMESIZE);
- volinfo->volid = vh->info.volid;
- volinfo->type = vh->info.type;
- volinfo->backupID = vh->info.backupID;
- volinfo->parentID = vh->info.parentID;
- volinfo->cloneID = vh->info.cloneID;
- if (vld_check_busy(volinfo->volid, partID))
- volinfo->status = VBUSY;
- else
- volinfo->status = VOK;
- volinfo->copyDate = vh->info.copyDate;
- volinfo->inUse = vh->info.inUse;
- volinfo->creationDate = vh->info.creationDate;
- volinfo->accessDate = vh->info.accessDate;
- volinfo->updateDate = vh->info.updateDate;
- volinfo->backupDate = vh->info.backupDate;
- volinfo->dayUse = vh->info.dayUse;
- volinfo->filecount = vh->info.filecount;
- volinfo->maxquota = vh->info.maxquota;
- volinfo->size = vh->info.size;
- volinfo->needsSalvaged = 0;
- volinfo->destroyMe = 0;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolListVolumes(struct rx_call *call,
- const int32_t partID,
- const int32_t flags,
- volEntries *resultEntries)
-{
- int ret = 0;
- List *vollist;
- Listitem *item;
- volume_handle *vh;
- struct dp_part *dp;
- int numvol;
- int i;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolListVolumes");
-
- ret = dp_create (partID, &dp);
- if (ret)
- goto out;
-
- ret = vld_list_volumes(dp, &vollist);
- if (ret)
- goto free_part;
-
- numvol = 0;
-
- item = listhead(vollist);
- while (item) {
- numvol++;
- item = listnext(vollist, item);
- }
-
- resultEntries->len = numvol;
-
- resultEntries->val = calloc(sizeof(struct volintInfo) * resultEntries->len, 1);
-
- i = 0;
- while (!listemptyp(vollist)) {
- vh = (volume_handle *) listdelhead(vollist);
- assert(vh);
- ret = vld_info_uptodatep (vh);
- assert(ret == 0);
- copy_volumeinfo(&resultEntries->val[i], vh, partID);
- vld_free (vh);
- i++;
- }
-
- free(vollist);
-
- free_part:
- dp_free (dp);
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolListOneVolume(struct rx_call *call,
- const int32_t partID,
- const int32_t volid,
- volEntries *resultEntries)
-{
- volume_handle *vh;
- int ret = 0;
- struct dp_part *dp;
- struct volintInfo *volinfo;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolListOneVolume partid: %d volid: %u\n",
- partID, volid);
-
- ret = volser_fetch_vh (partID, volid, &dp, &vh);
- if (ret)
- goto out;
-
- resultEntries->len = 1;
-
- volinfo = calloc(sizeof(struct volintInfo) * resultEntries->len, 1);
- resultEntries->val = volinfo;
- copy_volumeinfo(volinfo, vh, partID);
-
- vld_free (vh);
- dp_free (dp);
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolGetNthVolume(struct rx_call *call,
- const int32_t index,
- int32_t *volume,
- int32_t *partition)
-{
- int ret = 0;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolGetNthVolume");
-
- ret = VOLSERFAILEDOP;
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolMonitor(struct rx_call *call,
- transDebugEntries *result)
-{
- int ret = 0;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolMonitor");
-
- ret = VOLSERFAILEDOP;
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolXListVolumes(struct rx_call *call,
- const int32_t partID,
- const int32_t flags,
- xvolEntries *resultEntries)
-{
- int ret = 0;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolXListVolumes");
-
- ret = VOLSERFAILEDOP;
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolXListOneVolume(struct rx_call *call,
- const int32_t partID,
- const int32_t volid,
- xvolEntries *resultEntries)
-{
- volume_handle *vh;
- struct dp_part *dp;
- struct xvolintInfo *volinfo;
- int ret = 0;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolXListOneVolume partid: %d volid: %u\n",
- partID, volid);
-
- ret = volser_fetch_vh (partID, volid, &dp, &vh);
- if (ret)
- return ret;
-
- resultEntries->len = 1;
-
- volinfo = calloc(sizeof(struct xvolintInfo) * resultEntries->len, 1);
- resultEntries->val = volinfo;
- strlcpy(volinfo->name, vh->info.name, VNAMESIZE);
- volinfo->volid = vh->info.volid;
- volinfo->type = vh->info.type;
- volinfo->backupID = vh->info.backupID;
- volinfo->parentID = vh->info.parentID;
- volinfo->cloneID = vh->info.cloneID;
- if (vld_check_busy(volid, partID))
- volinfo->status = VBUSY;
- else
- volinfo->status = VOK;
- volinfo->copyDate = vh->info.copyDate;
- volinfo->inUse = vh->info.inUse;
- volinfo->creationDate = vh->info.creationDate;
- volinfo->accessDate = vh->info.accessDate;
- volinfo->updateDate = vh->info.updateDate;
- volinfo->backupDate = vh->info.backupDate;
- volinfo->dayUse = vh->info.dayUse;
- volinfo->filecount = vh->info.filecount;
- volinfo->maxquota = vh->info.maxquota;
- volinfo->size = vh->info.size;
-
- vld_free (vh);
- dp_free (dp);
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolSetInfo(struct rx_call *call,
- const int32_t transid,
- const struct volintInfo *volinfo)
-{
- volume_handle *vh;
- int ret = 0;
- struct dp_part *dp;
- struct trans *trans;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolSetInfo"
- " trans %d name %s type %d parent %d volid %d backup %d",
- transid, volinfo->name, volinfo->type, volinfo->parentID,
- volinfo->volid, volinfo->backupID);
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = vld_verify_trans(transid);
- if (ret)
- goto out;
-
- ret = vld_get_trans(transid, &trans);
- if (ret)
- goto out;
-
- ret = volser_fetch_vh (trans->partition, trans->volid, &dp, &vh);
- if (ret) {
- vld_put_trans(trans);
- goto out;
- }
-
- if (volinfo->name[0])
- strlcpy(vh->info.name, volinfo->name, VNAMESIZE);
-
- if (volinfo->volid)
- vh->info.volid = volinfo->volid;
- if (volinfo->type)
- vh->info.type = volinfo->type;
- if (volinfo->backupID)
- vh->info.backupID = volinfo->backupID;
- if (volinfo->parentID)
- vh->info.parentID = volinfo->parentID;
- if (volinfo->cloneID)
- vh->info.cloneID = volinfo->cloneID;
- if (volinfo->status)
- vh->info.status = volinfo->status;
- if (volinfo->copyDate)
- vh->info.copyDate = volinfo->copyDate;
- if (volinfo->inUse)
- vh->info.inUse = volinfo->inUse;
- if (volinfo->creationDate)
- vh->info.creationDate = volinfo->creationDate;
- if (volinfo->backupDate)
- vh->info.backupDate = volinfo->backupDate;
- if (volinfo->dayUse != -1)
- vh->info.dayUse = volinfo->dayUse;
- if (volinfo->filecount)
- vh->info.filecount = volinfo->filecount;
- if (volinfo->maxquota != -1)
- vh->info.maxquota = volinfo->maxquota;
- if (volinfo->size)
- vh->info.size = volinfo->size;
-
- vld_info_write(vh);
-
- vld_free (vh);
- dp_free (dp);
- vld_put_trans(trans);
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolXListPartitions(struct rx_call *call,
- part_entries *ent)
-{
- int i;
- struct dp_part *dp = NULL;
- int ret = 0;
- int32_t partIDs[26]; /* XXX */
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolXListPartitions");
-
- i = 0;
- do {
- ret = dp_find(&dp);
- if (dp == NULL)
- break;
- if (ret)
- goto out;
- partIDs[i] = dp->num;
- i++;
- } while (i < 26);
-
- ent->len = i;
- ent->val = malloc(sizeof(int32_t) * ent->len);
- memcpy(ent->val, partIDs, sizeof(int32_t) * ent->len);
-
- ret = 0;
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VOLSER_AFSVolForwardMultiple(struct rx_call *call,
- const int32_t fromTrans,
- const int32_t fromData,
- const manyDests *destinations,
- const int32_t spare0,
- const struct restoreCookie *cookie,
- multi_results *results)
-{
- int ret = 0;
-
- mlog_log(MDEBVOLDB, "VOLSER_AFSVolForwardMultiple");
-
- if (!sec_is_superuser(call)) {
- ret = VOLSERBAD_ACCESS;
- goto out;
- }
-
- ret = VOLSERFAILEDOP;
-
- out:
- VOLSER_EXIT;
-
- return ret;
-}
-
-
diff --git a/usr.sbin/afs/src/milko/include/mdebug.h b/usr.sbin/afs/src/milko/include/mdebug.h
deleted file mode 100644
index 1a385df3703..00000000000
--- a/usr.sbin/afs/src/milko/include/mdebug.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * $KTH: mdebug.h,v 1.5 2000/10/03 00:17:42 lha Exp $
- */
-
-#ifndef _mdebug_h
-#define _mdebug_h
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <log.h>
-
-#include <roken.h>
-
-/*
- * Remeber to add any new logging class to fs/fileserver.c
- */
-
-/* masks */
-#define MDEBANY 0xffffffff
-#define MDEBMISC 0x00000001 /* misc debugging */
-#define MDEBVOLDB 0x00000002 /* voldb debugging */
-#define MDEBVLD 0x00000004 /* vld debugging */
-#define MDEBSALVAGE 0x00000008 /* salvager debugging */
-#define MDEBFS 0x00000010 /* fs debugging */
-#define MDEBROPA 0x00000020 /* ropa debugging */
-
-#define MDEBWARN 0x08000000 /* don't ignore warning */
-#define MDEBERROR 0x10000000 /* don't ignore error */
-
-#define MDEBALL (MDEBMISC|MDEBVOLDB|MDEBVLD|MDEBWARN|MDEBERROR|MDEBSALVAGE|MDEBFS|MDEBROPA)
-
-extern struct units milko_deb_units[];
-
-#define MDEFAULT_LOG (MDEBERROR|MDEBWARN)
-
-
-#endif /* _mdebug_h */
diff --git a/usr.sbin/afs/src/milko/lib/Makefile.in b/usr.sbin/afs/src/milko/lib/Makefile.in
deleted file mode 100644
index b19c3731f6d..00000000000
--- a/usr.sbin/afs/src/milko/lib/Makefile.in
+++ /dev/null
@@ -1,49 +0,0 @@
-# $KTH: Makefile.in,v 1.8 2000/10/08 06:22:51 lha Exp $
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-SHELL = /bin/sh
-
-SUBDIRS = mlog vstatus dpart voldb vld msecurity ropa
-
-all:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-clean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-realclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-distclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-mostlyclean:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-install:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-uninstall:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) $@) || exit 1; done
-
-Makefile: Makefile.in ../../config.status
- cd ../.. ; CONFIG_FILES=milko/lib/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-.PHONY: all clean realclean distclean mostlyclean install uninstall
diff --git a/usr.sbin/afs/src/milko/lib/dpart/Makefile.in b/usr.sbin/afs/src/milko/lib/dpart/Makefile.in
deleted file mode 100644
index 83c1aba5cfb..00000000000
--- a/usr.sbin/afs/src/milko/lib/dpart/Makefile.in
+++ /dev/null
@@ -1,104 +0,0 @@
-#
-# $KTH: Makefile.in,v 1.4 2000/10/08 06:22:58 lha Exp $
-#
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_builddir = ../../..
-VPATH = @srcdir@
-
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-INCLUDES = -I. \
- -I$(srcdir) \
- -I$(srcdir)/../../fs \
- -I$(srcdir)/../../.. \
- -I../../../rxdef \
- -I../../../include \
- $(KRB4_INC_FLAGS) \
- -I$(srcdir)/../../../include
-
-CFLAGS = @CFLAGS@
-KRB4_INC_FLAGS= @KRB4_INC_FLAGS@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-sysconfdir = @sysconfdir@
-ARLACACHEDIR = @ARLACACHEDIR@
-ARLACONFFILE = @ARLACONFFILE@
-
-#PICFLAGS = @PICFLAGS@
-
-LIBNAME = $(LIBPREFIX)dpart
-#LIBEXT = @LIBEXT@
-LIBEXT = a
-#SHLIBEXT = @SHLIBEXT@
-#LIBPREFIX = @LIBPREFIX@
-LIBPREFIX = lib
-#LDSHARED = @LDSHARED@
-LIB = $(LIBNAME).$(LIBEXT)
-
-DEFS = @DEFS@
-
-LIB_SOURCES = dpart.c
-
-SOURCES = $(LIB_SOURCES)
-
-LIB_OBJECTS = dpart.o
-
-OBJECTS = $(LIB_OBJECTS)
-
-all: $(LIB)
-
-Wall:
- make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS) $(PICFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
- $(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/$(LIB)
-
-uninstall:
- rm -f $(DESTDIR)$(libdir)/$(LIB)
-
-TAGS: $(SOURCES)
- etags $(SOURCES)
-
-check:
-
-clean:
- rm -f $(LIB) $(PROGS) *.o *.a
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *~
-
-realclean: distclean
- rm -f TAGS
-
-$(LIBNAME).a: $(LIB_OBJECTS)
- rm -f $@
- $(AR) cr $@ $(LIB_OBJECTS)
- -$(RANLIB) $@
-
-#$(LIBNAME).$(SHLIBEXT): $(LIB_OBJECTS)
-# rm -f $@
-# $(LDSHARED) -o $@ $(LIB_OBJECTS)
-
-$(OBJECTS): ../../../include/config.h
-
-Makefile: Makefile.in ../../../config.status
- cd ../../..; CONFIG_FILES=milko/lib/dpart/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-
-.PHONY: all install uninstall check clean mostlyclean distclean realclean
diff --git a/usr.sbin/afs/src/milko/lib/dpart/dpart.c b/usr.sbin/afs/src/milko/lib/dpart/dpart.c
deleted file mode 100644
index f66ccdd1d42..00000000000
--- a/usr.sbin/afs/src/milko/lib/dpart/dpart.c
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <config.h>
-
-#include <roken.h>
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/fcntl.h>
-#ifdef HAVE_STATVFS
-#include <sys/statvfs.h>
-#endif
-#ifdef HAVE_STATFS_H
-#include <sys/statfs.h>
-#endif
-#include <sys/mount.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <assert.h>
-
-#include <unistd.h>
-
-#include <atypes.h>
-
-#include <err.h>
-
-#include <dpart.h>
-
-RCSID("$arla: dpart.c,v 1.11 2002/06/02 21:12:16 lha Exp $");
-
-#ifdef MILKO_ROOT
-char *dpart_root = MILKO_ROOT;
-#else
-char *dpart_root = "";
-#endif
-
-/*
- * Allocate a dp_part structure for partition `num' and
- * return it in `dp'.
- */
-
-int
-dp_create (uint32_t num, struct dp_part **dp)
-{
- struct dp_part *d;
- int ret;
- char str[3], *ptr = str;
-
- assert (dp);
-
- *dp = NULL;
-
- if (num > (('z' - 'a') * ('z' - 'a')))
- return EINVAL;
-
- d = malloc (sizeof (*d));
- if (d == NULL)
- return ENOMEM;
- memset (d, 0, sizeof(*d));
-
- if (num > 'z' - 'a') {
- ret = num / ('z' - 'a');
- num -= ret * ('z' - 'a');
- *ptr = ret + 'a';
- ptr++;
- }
- ptr[0] = num + 'a';
- ptr[1] = '\0';
-
- ret = asprintf (&d->part, "%s/vicep%s", dpart_root, str);
- if (ret < 0) {
- free (d);
- return EINVAL;
- }
-
- d->num = num;
- d->ref = 1;
-
- *dp = d;
- return 0;
-}
-
-void
-dp_ref (struct dp_part *dp)
-{
- if (dp)
- ++dp->ref;
-}
-
-/*
- * free the dpart structure in `dp'.
- */
-
-void
-dp_free (struct dp_part *dp)
-{
- if (dp) {
- if (--dp->ref)
- return;
- if (dp->part)
- free (dp->part);
- free (dp);
- }
-}
-
-/*
- * Iterate over all local partition and returns when one found.
- * `*dp' should one the first call be set to NULL. For each
- * call next dpart is returned. When last entry is found `*dp' is
- * set to NULL. On error != 0 is returned.
- */
-
-int
-dp_find (struct dp_part **dp)
-{
- uint32_t num;
- int found = 0, ret;
- struct stat sb;
-
- assert (dp);
-
- if (*dp == NULL) {
- num = -1;
- } else {
- num = (*dp)->num;
- dp_free (*dp);
- *dp = NULL;
- }
- do {
- ++num;
-
- if (*dp != NULL)
- dp_free (*dp);
-
- ret = dp_create (num, dp);
- if (ret)
- return ret;
-
- if (stat ((*dp)->part, &sb) == 0 && S_ISDIR(sb.st_mode))
- found = 1;
-
- } while (!found);
-
- return 0;
-}
-
-
-/*
- *
- */
-
-int
-dp_findvol (struct dp_part *d, void (*cb)(void *, int), void *data)
-{
- DIR *dir;
- struct dirent *e;
- int fd, ret;
-
- assert (d);
-
- ret = chdir (d->part);
- if (ret)
- return 0;
-
- dir = opendir (d->part);
- if (dir == NULL)
- return 0;
-
- while ((e = readdir (dir)) != NULL) {
- if (strncmp (e->d_name, "vol", 3))
- continue;
-
- fd = open (e->d_name, O_RDWR, 0600);
- if (fd < 0)
- errx (1, "can't open %s/%s", d->part, e->d_name);
-
- (cb) (data, fd);
- close (fd);
- }
- closedir (dir);
- return 0;
-}
-
-/*
- *
- */
-
-int
-dp_parse (const char *str, uint32_t *num)
-{
- int len;
- uint32_t part = 0;
-
- assert (str && num);
-
- len = strlen (str);
- if (len == 0)
- return EINVAL;
- if (len > 6 && strncmp (str, "/vicep", 6) == 0) {
- str += 6;
- len -= 6;
- }
- if (len > 2)
- return EINVAL;
- if (len == 2) {
- if (*str < 'a' || *str > 'z')
- return EINVAL;
- part += ('z' - 'a') * (*str - 'a' + 1);
- str++;
- len--;
- }
- if (*str < 'a' || *str > 'z')
- return EINVAL;
- part += *str - 'a';
-
- *num = part;
- return 0;
-}
-
-/*
- *
- */
-
-struct dp_part *
-dp_getpart (const char *str)
-{
- int ret;
- struct dp_part *dp;
- uint32_t part;
-
- ret = dp_parse (str, &part);
- if (ret)
- return NULL;
-
- ret = dp_create (part, &dp);
- if (ret)
- return NULL;
-
- return dp;
-}
-
-/*
- * get available and total number of 1k blocks on partition
- */
-
-int
-dp_getstats (struct dp_part *dp, long *availblocks, long *totalblocks)
-{
-#ifdef HAVE_STATVFS
- struct statvfs sb;
-#else
- struct statfs sb;
-#endif
- int reservedblocks;
- int ret;
-
-#ifdef HAVE_STATVFS
- ret = statvfs (dp->part, &sb);
-#else
- ret = statfs (dp->part, &sb);
-#endif
- if (ret)
- return errno;
-
- reservedblocks = sb.f_bfree - sb.f_bavail;
- if (sb.f_bsize <= 1024) {
- *availblocks = sb.f_bavail * (1024/sb.f_bsize);
- *totalblocks = (sb.f_blocks - reservedblocks) * (1024/sb.f_bsize);
- } else {
- *availblocks = sb.f_bavail / (sb.f_bsize/1024);
- *totalblocks = (sb.f_blocks - reservedblocks) / (sb.f_bsize/1024);
- }
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/milko/lib/dpart/dpart.h b/usr.sbin/afs/src/milko/lib/dpart/dpart.h
deleted file mode 100644
index 5349e70d0e6..00000000000
--- a/usr.sbin/afs/src/milko/lib/dpart/dpart.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: dpart.h,v 1.8 2002/02/07 17:59:45 lha Exp $ */
-
-#ifndef __FILBULKE_DPART_H
-#define __FILBULKE_DPART_H 1
-
-struct dp_part {
- char *part;
- int num;
- int ref;
-};
-
-extern char *dpart_root;
-
-#define DP_NUMBER(dp) ((dp)->num)
-#define DP_NAME(dp) ((dp)->part)
-
-int
-dp_create (uint32_t num, struct dp_part **dp);
-
-void
-dp_ref (struct dp_part *dp);
-
-void
-dp_free (struct dp_part *dp);
-
-int
-dp_find (struct dp_part **dp);
-
-int
-dp_findvol (struct dp_part *d, void (*cb)(void *, int), void *data);
-
-int
-dp_parse (const char *str, uint32_t *num);
-
-struct dp_part *
-dp_getpart (const char *str);
-
-int
-dp_getstats (struct dp_part *dp, long *availblocks, long *totalblocks);
-
-#endif /* __FILBULKE_DPART_H */
diff --git a/usr.sbin/afs/src/milko/lib/mdb/mdb.c b/usr.sbin/afs/src/milko/lib/mdb/mdb.c
deleted file mode 100644
index 51b24377868..00000000000
--- a/usr.sbin/afs/src/milko/lib/mdb/mdb.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "mdb_locl.h"
-
-int
-mdb_fetch(MDB *db, struct mdb_datum *key, struct mdb_datum *value)
-{
- assert (value);
-
- return db->fetch(db, key, value);
-}
-
-int
-mdb_store(MDB *db, struct mdb_datum *key, struct mdb_datum *value)
-{
- return db->store(db, key, value);
-}
-
-int
-mdb_delete(MDB *db, struct mdb_datum *key)
-{
- return db->delete(db, key);
-}
-
-MDB *
-mdb_open(char *filename, int flags, mode_t mode)
-{
- int code;
- MDB *db;
-
- code = mdb_NDBM_create(&db, filename, flags, mode);
- if (code)
- return NULL; /* XXX */
-
- code = db->open(db);
- if(code != 0)
- return NULL;
-
- return db;
-}
-
-int
-mdb_close(MDB *db)
-{
- return db->close(db);
-}
-
-int
-mdb_flush(MDB *db)
-{
- return db->flush(db);
-}
diff --git a/usr.sbin/afs/src/milko/lib/mdb/mdb.h b/usr.sbin/afs/src/milko/lib/mdb/mdb.h
deleted file mode 100644
index c3ce3b94067..00000000000
--- a/usr.sbin/afs/src/milko/lib/mdb/mdb.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-struct mdb_datum {
- void *data;
- int length;
-};
-
-typedef struct MDB {
- void *db;
- char *name;
- int openp;
- int flags;
- mode_t mode;
-
- int (*open)(struct MDB*);
- int (*close)(struct MDB*);
- int (*store)(struct MDB*, struct mdb_datum *key, struct mdb_datum *value);
- int (*fetch)(struct MDB*, struct mdb_datum *key, struct mdb_datum *value);
- int (*delete)(struct MDB*, struct mdb_datum *key);
- int (*flush)(struct MDB*);
-} MDB;
-
-int mdb_NDBM_create(MDB **db, const char * filename, int flags, mode_t mode);
-
-int mdb_store(MDB *db, struct mdb_datum *key, struct mdb_datum *value);
-int mdb_fetch(MDB *db, struct mdb_datum *key, struct mdb_datum *value);
-int mdb_delete(MDB *db, struct mdb_datum *key);
-MDB *mdb_open(char *filename, int flags, mode_t mode);
-int mdb_close(MDB *db);
-int mdb_flush(MDB *db);
diff --git a/usr.sbin/afs/src/milko/lib/mdb/mdb_locl.h b/usr.sbin/afs/src/milko/lib/mdb/mdb_locl.h
deleted file mode 100644
index e989f96af32..00000000000
--- a/usr.sbin/afs/src/milko/lib/mdb/mdb_locl.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <roken.h>
-
-#include <mdb.h>
-
-#include <assert.h>
-
diff --git a/usr.sbin/afs/src/milko/lib/mdb/ndbm.c b/usr.sbin/afs/src/milko/lib/mdb/ndbm.c
deleted file mode 100644
index ee8a52f3f84..00000000000
--- a/usr.sbin/afs/src/milko/lib/mdb/ndbm.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "mdb_locl.h"
-
-RCSID("$arla: ndbm.c,v 1.6 2003/02/15 23:51:53 lha Exp $");
-
-#if defined(NDBM) || defined(HAVE_NEW_DB)
-
-#if defined(HAVE_GDBM_NDBM_H)
-#include <gdbm/ndbm.h>
-#elif defined(HAVE_DBM_H)
-#include <dbm.h>
-#elif defined(HAVE_NDBM_H)
-#include <ndbm.h>
-#endif
-
-struct ndbm_db {
- DBM *db;
- int lock_fd;
-};
-
-static int
-NDBM_close(MDB *db)
-{
- struct ndbm_db *d = db->db;
- dbm_close(d->db);
- free(d);
- return 0;
-}
-
-static int
-NDBM_open(MDB *db)
-{
- struct ndbm_db *d = malloc(sizeof(*d));
-
- assert(db);
-
- d->db = dbm_open((char *)db->name, db->flags, db->mode);
- if(d->db == NULL)
- return errno;
-
- db->db = d;
- assert(db->db);
-
- return 0;
-}
-
-static int
-NDBM_store(MDB *db, struct mdb_datum *key, struct mdb_datum *value)
-{
- struct ndbm_db *d = (struct ndbm_db *)db->db;
- datum k, v;
-
- k.dptr = key->data;
- k.dsize = key->length;
- v.dptr = value->data;
- v.dsize = value->length;
-
- return dbm_store(d->db, k, v, DBM_REPLACE);
-}
-
-static int
-NDBM_fetch(MDB *db, struct mdb_datum *key, struct mdb_datum *value)
-{
- struct ndbm_db *d = (struct ndbm_db *)db->db;
- datum k;
- datum v;
-
- k.dptr = key->data;
- k.dsize = key->length;
-
- v = dbm_fetch(d->db, k);
-
- if (v.dptr == NULL)
- return ENOENT;
-
- value->data = v.dptr;
- value->length = v.dsize;
-
- return 0;
-}
-
-static int
-NDBM_delete(MDB *db, struct mdb_datum *key)
-{
- struct ndbm_db *d = (struct ndbm_db *)db->db;
- datum k;
-
- k.dptr = key->data;
- k.dsize = key->length;
-
- return dbm_delete(d->db, k);
-}
-
-static int
-NDBM_flush(MDB *db)
-{
- int ret;
-
- ret = NDBM_close(db);
- if (ret)
- return ret;
-
- ret = NDBM_open(db);
- if (ret)
- return ret;
-
- return 0;
-}
-
-int
-mdb_NDBM_create(MDB **db, const char * filename, int flags, mode_t mode)
-{
- *db = malloc(sizeof(**db));
- if (*db == NULL)
- return ENOMEM;
-
- memset(*db, 0, sizeof(**db));
-
- (*db)->db = NULL;
- (*db)->name = strdup(filename);
- if ((*db)->name == NULL) {
- free(*db);
- return ENOMEM;
- }
- (*db)->flags = flags;
- (*db)->mode = mode;
-
- (*db)->open = NDBM_open;
- (*db)->close = NDBM_close;
- (*db)->store = NDBM_store;
- (*db)->fetch = NDBM_fetch;
- (*db)->delete = NDBM_delete;
- (*db)->flush = NDBM_flush;
-
- return 0;
-}
-
-#endif /* HAVE_NDBM */
diff --git a/usr.sbin/afs/src/milko/lib/mlog/Makefile.in b/usr.sbin/afs/src/milko/lib/mlog/Makefile.in
deleted file mode 100644
index 711870be45f..00000000000
--- a/usr.sbin/afs/src/milko/lib/mlog/Makefile.in
+++ /dev/null
@@ -1,105 +0,0 @@
-#
-# $KTH: Makefile.in,v 1.4 2000/12/04 23:06:19 lha Exp $
-#
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-top_builddir = ../../..
-VPATH = @srcdir@
-
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-INCLUDES = -I. \
- -I$(srcdir) \
- -I../../../rxdef \
- -I$(srcdir) \
- -I$(top_srcdir) \
- -I../../../include \
- $(KRB4_INC_FLAGS) \
- -I$(srcdir)/../../../include
-
-CFLAGS = @CFLAGS@
-KRB4_INC_FLAGS= @KRB4_INC_FLAGS@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-sysconfdir = @sysconfdir@
-ARLACACHEDIR = @ARLACACHEDIR@
-ARLACONFFILE = @ARLACONFFILE@
-
-#PICFLAGS = @PICFLAGS@
-
-LIBNAME = $(LIBPREFIX)mlog
-#LIBEXT = @LIBEXT@
-LIBEXT = a
-#SHLIBEXT = @SHLIBEXT@
-#LIBPREFIX = @LIBPREFIX@
-LIBPREFIX = lib
-#LDSHARED = @LDSHARED@
-LIB = $(LIBNAME).$(LIBEXT)
-
-DEFS = @DEFS@
-
-LIB_SOURCES = mlog.c
-
-SOURCES = $(LIB_SOURCES)
-
-LIB_OBJECTS = mlog.o
-
-OBJECTS = $(LIB_OBJECTS)
-
-all: $(LIB)
-
-Wall:
- make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS) $(PICFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
- $(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/$(LIB)
-
-uninstall:
- rm -f $(DESTDIR)$(libdir)/$(LIB)
-
-TAGS: $(SOURCES)
- etags $(SOURCES)
-
-check:
-
-clean:
- rm -f $(LIB) $(PROGS) *.o *.a
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *~
-
-realclean: distclean
- rm -f TAGS
-
-$(LIBNAME).a: $(LIB_OBJECTS)
- rm -f $@
- $(AR) cr $@ $(LIB_OBJECTS)
- -$(RANLIB) $@
-
-#$(LIBNAME).$(SHLIBEXT): $(LIB_OBJECTS)
-# rm -f $@
-# $(LDSHARED) -o $@ $(LIB_OBJECTS)
-
-$(OBJECTS): ../../../include/config.h
-
-Makefile: Makefile.in ../../../config.status
- cd ../../..; CONFIG_FILES=milko/lib/mlog/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-
-.PHONY: all install uninstall check clean mostlyclean distclean realclean
diff --git a/usr.sbin/afs/src/milko/lib/mlog/mdebug.c b/usr.sbin/afs/src/milko/lib/mlog/mdebug.c
deleted file mode 100644
index 22903600858..00000000000
--- a/usr.sbin/afs/src/milko/lib/mlog/mdebug.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <config.h>
-
-RCSID("$arla: mdebug.c,v 1.1 2001/07/25 23:04:14 ahltorp Exp $");
-
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <fs.h>
-
-#include <mlog.h>
-#include <mdebug.h>
-
-/*
- * Logging
- */
-
-struct units milko_deb_units[] = {
- { "all", MDEBALL },
- { "almost-all", MDEBALL },
- { "errors", MDEBERROR },
- { "warnings", MDEBWARN },
- { "voldb", MDEBVOLDB },
- { "vld", MDEBVLD },
- { "salvage", MDEBSALVAGE },
- { "fs", MDEBFS },
- { "default", MDEFAULT_LOG },
- { "ropa", MDEBROPA },
- { "pr", MDEBPR },
- { "prdb", MDEBPRDB },
- { "vl", MDEBVL },
- { "none", 0 },
- { NULL }
-};
diff --git a/usr.sbin/afs/src/milko/lib/mlog/mdebug.h b/usr.sbin/afs/src/milko/lib/mlog/mdebug.h
deleted file mode 100644
index 81353789a1a..00000000000
--- a/usr.sbin/afs/src/milko/lib/mlog/mdebug.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * $arla: mdebug.h,v 1.1 2001/07/25 22:57:49 ahltorp Exp $
- */
-
-#ifndef _mdebug_h
-#define _mdebug_h
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <log.h>
-
-#include <roken.h>
-
-/*
- * Remeber to add any new logging class to fs/fileserver.c
- */
-
-/* masks */
-#define MDEBANY 0xffffffff
-#define MDEBMISC 0x00000001 /* misc debugging */
-#define MDEBVOLDB 0x00000002 /* voldb debugging */
-#define MDEBVLD 0x00000004 /* vld debugging */
-#define MDEBSALVAGE 0x00000008 /* salvager debugging */
-#define MDEBFS 0x00000010 /* fs debugging */
-#define MDEBROPA 0x00000020 /* ropa debugging */
-#define MDEBPR 0x00000040 /* pr debugging */
-#define MDEBPRDB 0x00000080 /* pr db debugging */
-#define MDEBVL 0x00000100 /* vl debugging */
-
-#define MDEBWARN 0x08000000 /* don't ignore warning */
-#define MDEBERROR 0x10000000 /* don't ignore error */
-
-#define MDEBALL (MDEBMISC|MDEBVOLDB|MDEBVLD|MDEBWARN|MDEBERROR|MDEBSALVAGE|MDEBFS|MDEBROPA|MDEBPR|MDEBPRDB|MDEBVL)
-
-extern struct units milko_deb_units[];
-
-#define MDEFAULT_LOG (MDEBERROR|MDEBWARN)
-
-
-#endif /* _mdebug_h */
diff --git a/usr.sbin/afs/src/milko/lib/mlog/mlog.c b/usr.sbin/afs/src/milko/lib/mlog/mlog.c
deleted file mode 100644
index fe939378127..00000000000
--- a/usr.sbin/afs/src/milko/lib/mlog/mlog.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <assert.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <parse_units.h>
-#include <roken.h>
-#include <err.h>
-#include "ko.h"
-
-#include "mlog.h"
-
-RCSID("$arla: mlog.c,v 1.8 2000/10/03 00:17:58 lha Exp $");
-
-static Log_method* mlog_log_method = NULL;
-static Log_unit* mlog_log_unit = NULL;
-static struct units *mlog_deb_units = NULL;
-
-void
-mlog_log(unsigned level, char *fmt, ...)
-{
- va_list args;
-
- assert (mlog_log_unit);
-
- va_start(args, fmt);
- log_vlog(mlog_log_unit, level, fmt, args);
- va_end(args);
-}
-
-void
-mlog_loginit(Log_method *method,
- struct units *deb_units,
- unsigned default_level)
-{
- assert (deb_units && method && mlog_deb_units == NULL);
-
- mlog_deb_units = deb_units;
- mlog_log_method = method;
- mlog_log_unit = log_unit_init (mlog_log_method, "milko",
- mlog_deb_units, default_level);
- if (mlog_log_unit == NULL)
- errx (1, "mlog_loginit: log_unit_init failed");
-}
-
-void
-mlog_log_set_level (const char *s)
-{
- log_set_mask_str (mlog_log_method, NULL, s);
-}
-
-void
-mlog_log_set_level_num (unsigned level)
-{
- log_set_mask (mlog_log_unit, level);
-}
-
-void
-mlog_log_get_level (char *s, size_t len)
-{
- log_mask2str (mlog_log_method, NULL, s, len);
-}
-
-unsigned
-mlog_log_get_level_num (void)
-{
- return log_get_mask (mlog_log_unit);
-}
-
-void
-mlog_log_print_levels (FILE *f)
-{
- print_flags_table (mlog_deb_units, f);
-}
-
-/*
- *
- */
-
-void
-mlog_err (int eval, unsigned level, int error, const char *fmt, ...)
-{
- va_list args;
-
- va_start (args, fmt);
- mlog_verr (eval, level, error, fmt, args);
- va_end (args);
-}
-
-void
-mlog_verr (int eval, unsigned level, int error, const char *fmt, va_list args)
-{
- char *s;
-
- vasprintf (&s, fmt, args);
- if (s == NULL) {
- log_log (mlog_log_unit, level,
- "Sorry, no memory to print `%s'...", fmt);
- exit (eval);
- }
- log_log (mlog_log_unit, level, "%s: %s", s, koerr_gettext (error));
- free (s);
- exit (eval);
-}
-
-void
-mlog_errx (int eval, unsigned level, const char *fmt, ...)
-{
- va_list args;
-
- va_start (args, fmt);
- mlog_verrx (eval, level, fmt, args);
- va_end (args);
-}
-
-void
-mlog_verrx (int eval, unsigned level, const char *fmt, va_list args)
-{
- log_vlog (mlog_log_unit, level, fmt, args);
- exit (eval);
-}
-
-void
-mlog_warn (unsigned level, int error, const char *fmt, ...)
-{
- va_list args;
-
- va_start (args, fmt);
- mlog_vwarn (level, error, fmt, args);
- va_end (args);
-}
-
-void
-mlog_vwarn (unsigned level, int error, const char *fmt, va_list args)
-{
- char *s;
-
- vasprintf (&s, fmt, args);
- if (s == NULL) {
- log_log (mlog_log_unit, level,
- "Sorry, no memory to print `%s'...", fmt);
- return;
- }
- log_log (mlog_log_unit, level, "%s: %s", s, koerr_gettext (error));
- free (s);
-}
-
-void
-mlog_warnx (unsigned level, const char *fmt, ...)
-{
- va_list args;
-
- va_start (args, fmt);
- mlog_vwarnx (level, fmt, args);
- va_end (args);
-}
-
-void
-mlog_vwarnx (unsigned level, const char *fmt, va_list args)
-{
- log_vlog (mlog_log_unit, level, fmt, args);
-}
diff --git a/usr.sbin/afs/src/milko/lib/mlog/mlog.h b/usr.sbin/afs/src/milko/lib/mlog/mlog.h
deleted file mode 100644
index 0c188fd7d4d..00000000000
--- a/usr.sbin/afs/src/milko/lib/mlog/mlog.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * $arla: mlog.h,v 1.4 2000/10/03 00:18:03 lha Exp $
- */
-
-#ifndef _arladeb_h
-#define _arladeb_h
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <log.h>
-
-#include <roken.h>
-#include <parse_units.h>
-
-void mlog_log(unsigned level, char *fmt, ...);
-void mlog_loginit(Log_method *method, struct units *deb_units,
- unsigned default_level);
-void mlog_log_set_level (const char *s);
-void mlog_log_set_level_num (unsigned level);
-void mlog_log_get_level (char *s, size_t len);
-unsigned mlog_log_get_level_num (void);
-void mlog_log_print_levels (FILE *f);
-
-void
-mlog_err (int eval, unsigned level, int error, const char *fmt, ...)
-__attribute__ ((noreturn))
-__attribute__ ((format (printf, 4, 5)))
-;
-
-void
-mlog_verr (int eval, unsigned level, int error, const char *fmt, va_list args)
-__attribute__ ((noreturn))
-__attribute__ ((format (printf, 4, 0)))
-;
-
-void
-mlog_errx (int eval, unsigned level, const char *fmt, ...)
-__attribute__ ((noreturn))
-__attribute__ ((format (printf, 3, 4)))
-;
-
-void
-mlog_verrx (int eval, unsigned level, const char *fmt, va_list args)
-__attribute__ ((noreturn))
-__attribute__ ((format (printf, 3, 0)))
-;
-
-void
-mlog_warn (unsigned level, int error, const char *fmt, ...)
-__attribute__ ((format (printf, 3, 4)))
-;
-
-void
-mlog_vwarn (unsigned level, int error, const char *fmt, va_list args)
-__attribute__ ((format (printf, 3, 0)))
-;
-
-void
-mlog_warnx (unsigned level, const char *fmt, ...)
-__attribute__ ((format (printf, 2, 3)))
-;
-
-void
-mlog_vwarnx (unsigned level, const char *fmt, va_list args)
-__attribute__ ((format (printf, 2, 0)))
-;
-
-void
-mlog_warnx_with_fid (unsigned level, const VenusFid *fid, const char *fmt, ...)
-__attribute__ ((format (printf, 3, 4)));
-
-void
-mlog_vwarnx_with_fid (unsigned level, const VenusFid *fid, const char *fmt,
- va_list args)
-__attribute__ ((format (printf, 3, 0)));
-
-#endif /* _arladeb_h */
diff --git a/usr.sbin/afs/src/milko/lib/msecurity/Makefile.in b/usr.sbin/afs/src/milko/lib/msecurity/Makefile.in
deleted file mode 100644
index 01796b19d3f..00000000000
--- a/usr.sbin/afs/src/milko/lib/msecurity/Makefile.in
+++ /dev/null
@@ -1,104 +0,0 @@
-#
-# $KTH: Makefile.in,v 1.5 2000/10/08 06:23:11 lha Exp $
-#
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_builddir = ../../..
-VPATH = @srcdir@
-
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-INCLUDES = -I. \
- -I$(srcdir) \
- -I$(srcdir)/../../../rxkad \
- -I$(srcdir)/../../.. \
- -I../../../rxdef \
- -I../../../include \
- $(KRB4_INC_FLAGS) \
- -I$(srcdir)/../../../include
-
-CFLAGS = @CFLAGS@
-KRB4_INC_FLAGS= @KRB4_INC_FLAGS@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-sysconfdir = @sysconfdir@
-ARLACACHEDIR = @ARLACACHEDIR@
-ARLACONFFILE = @ARLACONFFILE@
-
-#PICFLAGS = @PICFLAGS@
-
-LIBNAME = $(LIBPREFIX)msecurity
-#LIBEXT = @LIBEXT@
-LIBEXT = a
-#SHLIBEXT = @SHLIBEXT@
-#LIBPREFIX = @LIBPREFIX@
-LIBPREFIX = lib
-#LDSHARED = @LDSHARED@
-LIB = $(LIBNAME).$(LIBEXT)
-
-DEFS = @DEFS@ -DMILKO_SYSCONFDIR=\"$(sysconfdir)\"
-
-LIB_SOURCES = msecurity.c netinit.c
-
-SOURCES = $(LIB_SOURCES)
-
-LIB_OBJECTS = msecurity.o netinit.o
-
-OBJECTS = $(LIB_OBJECTS)
-
-all: $(LIB)
-
-Wall:
- make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS) $(PICFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
- $(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/$(LIB)
-
-uninstall:
- rm -f $(DESTDIR)$(libdir)/$(LIB)
-
-TAGS: $(SOURCES)
- etags $(SOURCES)
-
-check:
-
-clean:
- rm -f $(LIB) $(PROGS) *.o *.a
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *~
-
-realclean: distclean
- rm -f TAGS
-
-$(LIBNAME).a: $(LIB_OBJECTS)
- rm -f $@
- $(AR) cr $@ $(LIB_OBJECTS)
- -$(RANLIB) $@
-
-#$(LIBNAME).$(SHLIBEXT): $(LIB_OBJECTS)
-# rm -f $@
-# $(LDSHARED) -o $@ $(LIB_OBJECTS)
-
-$(OBJECTS): ../../../include/config.h
-
-Makefile: Makefile.in ../../../config.status
- cd ../../..; CONFIG_FILES=milko/lib/msecurity/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-
-.PHONY: all install uninstall check clean mostlyclean distclean realclean
diff --git a/usr.sbin/afs/src/milko/lib/msecurity/msecurity.c b/usr.sbin/afs/src/milko/lib/msecurity/msecurity.c
deleted file mode 100644
index 3e9e8b413bd..00000000000
--- a/usr.sbin/afs/src/milko/lib/msecurity/msecurity.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <roken.h>
-
-#include <sys/types.h>
-#include <rx/rx.h>
-#include <rx/rx_null.h>
-
-#include <assert.h>
-
-#ifdef KERBEROS
-#ifdef HAVE_OPENSSL
-#include <openssl/des.h>
-#else
-#include <des.h>
-#endif
-#include <krb.h>
-#include <rxkad.h>
-#include <rxkad_locl.h>
-#else
-#define ANAME_SZ 40
-#define INST_SZ 40
-#define REALM_SZ 40
-#define MAX_K_NAME_SZ (2*ANAME_SZ + 2*INST_SZ + 2*REALM_SZ - 3)
-#endif
-
-#include <err.h>
-#include <ctype.h>
-
-#ifndef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include <service.h>
-
-#include "rx/rxgencon.h"
-
-#include "msecurity.h"
-#include "acl.h"
-
-RCSID("$arla: msecurity.c,v 1.11 2002/04/20 15:57:17 lha Exp $");
-
-static char acl_file[] = MILKO_SYSCONFDIR "/superuserlist"; /* XXX */
-
-/*
- * Don't test for superuser if set
- */
-
-static int superuser_check_disabled = FALSE;
-
-void
-sec_disable_superuser_check (void)
-{
- superuser_check_disabled = TRUE;
-}
-
-/*
- * Return 0 if the user is not a superuser
- * 1 if the user is a superuser
- */
-
-int
-sec_is_superuser(struct rx_call *call)
-{
- char aname[ANAME_SZ];
- char inst[INST_SZ];
- char realm[REALM_SZ];
- char fullname[MAX_K_NAME_SZ];
-
- if (superuser_check_disabled)
- return 1;
-
- if (sec_getname(call->conn, aname, inst, realm))
- return 0;
-#ifdef KERBEROS
- if (call->conn->securityIndex == 2) {
- krb_unparse_name_long_r(aname, inst, realm, fullname);
- return acl_check(acl_file, fullname);
- }
-#endif
- return 0;
-}
-
-int
-sec_add_superuser(char *user)
-{
-#ifdef KERBEROS
- return acl_add(acl_file, user);
-#else
- return -1;
-#endif
-}
-
-int
-sec_del_superuser(char *user)
-{
-#ifdef KERBEROS
- return acl_delete(acl_file, user);
-#else
- return -1;
-#endif
-}
-
-/*
- * Get the parsed name of a connection.
- * name, instance and realm should be properly allocated
- * Returns zero on success
- */
-
-int
-sec_getname(struct rx_connection *conn,
- char *name, char *instance, char *realm)
-{
-#ifdef KERBEROS
- if (conn->securityIndex == 2) {
- serv_con_data *cdat;
-
- cdat = conn->securityData;
- strlcpy(name, cdat->user->name, ANAME_SZ);
- strlcpy(instance, cdat->user->instance, INST_SZ);
- strlcpy(realm, cdat->user->realm, REALM_SZ);
- return 0;
- }
-#endif
- return -1;
-}
-
diff --git a/usr.sbin/afs/src/milko/lib/msecurity/msecurity.h b/usr.sbin/afs/src/milko/lib/msecurity/msecurity.h
deleted file mode 100644
index 6b1cbb58b64..00000000000
--- a/usr.sbin/afs/src/milko/lib/msecurity/msecurity.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: msecurity.h,v 1.5 2000/10/03 00:18:14 lha Exp $ */
-
-void
-sec_disable_superuser_check (void);
-
-int
-sec_is_superuser(struct rx_call *call);
-
-int
-sec_add_superuser(char *user);
-
-int
-sec_del_superuser(char *user);
-
-int
-sec_getname(struct rx_connection *conn,
- char *name, char *instance, char *realm);
diff --git a/usr.sbin/afs/src/milko/lib/msecurity/netinit.c b/usr.sbin/afs/src/milko/lib/msecurity/netinit.c
deleted file mode 100644
index 434d9cac72e..00000000000
--- a/usr.sbin/afs/src/milko/lib/msecurity/netinit.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <config.h>
-
-#include <sys/types.h>
-#include <rx/rx.h>
-#include <rx/rx_null.h>
-
-#ifdef KERBEROS
-#ifdef HAVE_OPENSSL
-#include <openssl/des.h>
-#else
-#include <des.h>
-#endif
-#include <krb.h>
-#include <rxkad.h>
-#endif
-
-#include <ko.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#include <string.h>
-#include <assert.h>
-#include <err.h>
-#include <netinit.h>
-
-#ifndef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-RCSID("$arla: netinit.c,v 1.16 2002/06/02 21:12:17 lha Exp $");
-
-/*
- * Network functions
- */
-
-static char *srvtab_filename = NULL;
-
-/*
- * If srvtab == NULL, then default is used.
- */
-
-void
-network_kerberos_init (char *srvtab)
-{
- if (srvtab) {
- srvtab_filename = strdup(srvtab);
- } else {
- srvtab_filename = MILKO_SYSCONFDIR "/srvtab";
- }
-}
-
-#ifdef KERBEROS
-
-static char cell_name[REALM_SZ] = "";
-static char realm_name[REALM_SZ] = "";
-static des_cblock afskey;
-
-static int
-server_get_key(void *appl, int kvno, des_cblock *key)
-{
- static int read_key = 0;
- int ret;
-
- assert (srvtab_filename != NULL);
-
- if (!read_key) {
- ret = read_service_key("afs", cell_name, realm_name,
- 0, srvtab_filename,
- (char *)&afskey);
- if (ret) {
- /*
- * Try also afs.realm@REALM
- */
-
- strlcpy(cell_name, realm_name, sizeof(cell_name));
- strlwr (cell_name);
- ret = read_service_key("afs", cell_name, realm_name,
- 0, srvtab_filename,
- (char *)&afskey);
- if (ret)
- return ret;
- }
- read_key = 1;
- }
-
- memcpy (key, &afskey, sizeof (afskey));
- return 0;
-}
-
-struct rx_securityClass *
-netinit_client_getcred(void)
-{
- int k_errno;
- CREDENTIALS c;
- struct rx_securityClass *sec;
- struct timeval tv;
-
- gettimeofday (&tv, NULL);
-
- k_errno = krb_get_cred("afs", cell_name, realm_name, &c);
- if (krb_life_to_time (c.issue_date, c.lifetime) < tv.tv_sec - 100) {
- dest_tkt();
- k_errno = 4711;
- }
- if(k_errno != KSUCCESS) {
- k_errno = krb_get_svc_in_tkt("afs", cell_name, realm_name,
- "afs", cell_name, 0xFF /* XXX */,
- srvtab_filename);
- if (k_errno == KSUCCESS)
- k_errno = krb_get_cred("afs", cell_name, realm_name, &c);
- }
-
- if (k_errno != KSUCCESS)
- return NULL;
-
- sec = rxkad_NewClientSecurityObject(rxkad_auth,
- &c.session,
- c.kvno,
- c.ticket_st.length,
- c.ticket_st.dat);
-
- return sec;
-}
-#endif
-
-#define N_SECURITY_OBJECTS 3
-
-int
-network_init (int serviceport,
- char *servicename,
- int serviceid,
- int32_t (*request) (struct rx_call *),
- struct rx_service **service,
- const char *realm)
-{
- struct rx_service *serv;
- int maxsec = 1;
- struct rx_securityClass **secObjs;
- static char krbtkfile[MaxPathLen];
-
- secObjs = malloc(sizeof(*secObjs) * N_SECURITY_OBJECTS);
- if (secObjs == NULL)
- return errno;
-
- if (rx_Init(0) != 0)
- errx(1, "Cant open serverport port") ;
-
- secObjs[0] = rxnull_NewServerSecurityObject(); /* XXX 0 */
- if (secObjs[0] == NULL )
- errx(1, "cant create security object") ;
-
-#ifdef KERBEROS
- strlcpy (cell_name, cell_getthiscell(), sizeof (cell_name));
-
- if (krbtkfile[0] == '\0') {
- snprintf (krbtkfile, sizeof(krbtkfile),
- "%sfileserver_%d", TKT_ROOT, (unsigned int)(getpid()*time(0)));
- krb_set_tkt_string (krbtkfile);
- }
-
- if (realm) {
- strlcpy(realm_name, realm, sizeof(realm_name));
- } else if (*realm_name == '\0') {
- int ret;
-
- ret = krb_get_lrealm(realm_name, 1);
- if (ret)
- return ret;
- }
-
- /*
- * if there is no diffrence between cell and realm name the afskey
- * is named afs.''@REALM. in the other case afs.CELL@REALM is used
- */
-
- if (strcasecmp (realm_name, cell_name) == 0)
- cell_name[0] = '\0';
-
- maxsec = 3;
- secObjs[1] = NULL;
- secObjs[2] = rxkad_NewServerSecurityObject(rxkad_clear,
- NULL,
- server_get_key,
- NULL);
- if (secObjs[2] == NULL)
- errx(1, "init_network: can't init rxkad server-security-object");
-#endif
-
- serv = rx_NewService (serviceport, serviceid, servicename,
- secObjs, maxsec,
- request);
-
- if (serv == NULL)
- errx(1, "Cant create %s service", servicename);
-
- if (service)
- *service = serv;
-
- return 0;
-}
-
-char *
-netinit_getrealm(void) {
- return realm_name;
-}
diff --git a/usr.sbin/afs/src/milko/lib/msecurity/netinit.h b/usr.sbin/afs/src/milko/lib/msecurity/netinit.h
deleted file mode 100644
index 8e062480571..00000000000
--- a/usr.sbin/afs/src/milko/lib/msecurity/netinit.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: netinit.h,v 1.8 2000/10/03 00:18:24 lha Exp $ */
-
-void network_kerberos_init (char *srvtab);
-
-int
-network_init (int serviceport,
- char *servicename,
- int serviceid,
- int32_t (*request) (struct rx_call *),
- struct rx_service **service,
- const char *realm);
-
-struct rx_securityClass *
-netinit_client_getcred(void);
-char *netinit_getrealm(void);
-
diff --git a/usr.sbin/afs/src/milko/lib/ropa/Makefile.in b/usr.sbin/afs/src/milko/lib/ropa/Makefile.in
deleted file mode 100644
index 6eb10f61178..00000000000
--- a/usr.sbin/afs/src/milko/lib/ropa/Makefile.in
+++ /dev/null
@@ -1,109 +0,0 @@
-#
-# $KTH: Makefile.in,v 1.4 2000/10/08 06:23:18 lha Exp $
-#
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_builddir = ../../..
-VPATH = @srcdir@
-
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-INCLUDES = -I. \
- -I$(srcdir) \
- -I$(srcdir)/../dpart \
- -I$(srcdir)/../vld \
- -I$(srcdir)/../voldb \
- -I$(srcdir)/../mlog \
- -I$(srcdir)/../../fs \
- -I$(srcdir)/../../include \
- -I$(srcdir)/../../.. \
- -I../../../rxdef \
- -I../../../include \
- $(KRB4_INC_FLAGS) \
- -I$(srcdir)/../../../include
-
-CFLAGS = @CFLAGS@
-KRB4_INC_FLAGS= @KRB4_INC_FLAGS@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-sysconfdir = @sysconfdir@
-ARLACACHEDIR = @ARLACACHEDIR@
-ARLACONFFILE = @ARLACONFFILE@
-
-#PICFLAGS = @PICFLAGS@
-
-LIBNAME = $(LIBPREFIX)ropa
-#LIBEXT = @LIBEXT@
-LIBEXT = a
-#SHLIBEXT = @SHLIBEXT@
-#LIBPREFIX = @LIBPREFIX@
-LIBPREFIX = lib
-#LDSHARED = @LDSHARED@
-LIB = $(LIBNAME).$(LIBEXT)
-
-DEFS = @DEFS@
-
-LIB_SOURCES = ropa.c
-
-SOURCES = $(LIB_SOURCES)
-
-LIB_OBJECTS = ropa.o
-
-OBJECTS = $(LIB_OBJECTS)
-
-all: $(LIB)
-
-Wall:
- make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS) $(PICFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
- $(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/$(LIB)
-
-uninstall:
- rm -f $(DESTDIR)$(libdir)/$(LIB)
-
-TAGS: $(SOURCES)
- etags $(SOURCES)
-
-check:
-
-clean:
- rm -f $(LIB) $(PROGS) *.o *.a
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *~
-
-realclean: distclean
- rm -f TAGS
-
-$(LIBNAME).a: $(LIB_OBJECTS)
- rm -f $@
- $(AR) cr $@ $(LIB_OBJECTS)
- -$(RANLIB) $@
-
-#$(LIBNAME).$(SHLIBEXT): $(LIB_OBJECTS)
-# rm -f $@
-# $(LDSHARED) -o $@ $(LIB_OBJECTS)
-
-$(OBJECTS): ../../../include/config.h
-
-Makefile: Makefile.in ../../../config.status
- cd ../../..; CONFIG_FILES=milko/lib/ropa/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-
-.PHONY: all install uninstall check clean mostlyclean distclean realclean
diff --git a/usr.sbin/afs/src/milko/lib/ropa/README b/usr.sbin/afs/src/milko/lib/ropa/README
deleted file mode 100644
index de321c74673..00000000000
--- a/usr.sbin/afs/src/milko/lib/ropa/README
+++ /dev/null
@@ -1,79 +0,0 @@
-Ropa - callbacks
-================
-
-Thoughts by Love <lha@stacken.kth.se>
-
-$arla: README,v 1.3 2002/05/16 22:09:45 hin Exp $
-
-Design
-======
-
-Think before doing. This isn't that simple. Figure out a way to do
-everything in O(1) but with minimum memory requirement.
-
-What sizes should we optimize for ? Linked list might be used for
-small datasets. W/o knowing anything, it seams many fids will have
-few clients, and few fids will have many clients.
-
-We need to have statistics. Guess we need to do it the simple way to get
-statistics, and then do it the right way. KISS!
-
-Data-storage
-============
-
-name = { contain } [ index1, index2, ... ]
-
-client = { uuid, port, interfaceAddr, callbacks[] }
- [ interfaceAddr, uuid ( & port) ]
-callback = { fid, client[] (, times[], heapptr[]) }
- [ fid ]
-
-LRU(clients);
-HEAP(callbacks);
-
-Resolve
-=======
-
-fid -> { RW -> time(#clients), RO -> time(history) }
- [1]
-
-fid -> clients[] \ sender-client [2]
-
-{callback (* time) * client} (heap) --> clients [3]
-
-client -> fids[] [4]
-
-Comments
-========
-
-Use UUID for all clients ? Cook and mark cooked for pre 3.5 clients.
-
-[1] From a given fid we need to figure out a suitable time.
-
- Without thinking:
-
- * Callbacks on WR volumes should give
- back callback-times based on number of clients using this fid.
-
- * Callbacks on RO volumes should be based on how often volumes
- are released (average - (timenow() - lasttime())) * rand(10).
- The rand is to avoid fetch-storms.
-
-[2] When breaking callbacks we need to get all clients.
- This need to be storted on UUID so we can avoid sending cb
- to the client.
-
-[3] Should callbacks be given all to the same time, or should different
- clients have different callbacks ? Will we get fetch-storms when
- callbacks expire for wellused files (or RO volumes).
-
-[4] We need to query the client when i contacts us the first time
- There is also need to break fids when clients fall out of the lru.
-
-Lock order and expiration
-=========================
-
-The easy way out might be to globallock the whole module except a
-expirationthread. In this module all enterence function must enter
-with complete data. There must also be a way to function to match
-(addr,port) -> uuid.
diff --git a/usr.sbin/afs/src/milko/lib/ropa/ropa.c b/usr.sbin/afs/src/milko/lib/ropa/ropa.c
deleted file mode 100644
index dc819406348..00000000000
--- a/usr.sbin/afs/src/milko/lib/ropa/ropa.c
+++ /dev/null
@@ -1,1422 +0,0 @@
-/*
- * Copyright (c) 1999, 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Callback module
- *
- * This module has no way for the rx module to get out stuff like
- * netmasks and MTU, that should be very interesting to know
- * performance-wise.
- */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <assert.h>
-
-#include <atypes.h>
-#include <fs.h>
-#include <cb.h>
-
-#include <hash.h>
-#include <heap.h>
-#include <list.h>
-
-#include <ports.h>
-#include <service.h>
-
-#include <rx/rx.h>
-#include <rx/rx_null.h>
-#include <rx/rxgencon.h>
-
-#include <cb.cs.h>
-#include <fs.ss.h>
-
-#include <err.h>
-
-#include <mlog.h>
-#include <mdebug.h>
-
-#include <ropa.h>
-
-RCSID("$arla: ropa.c,v 1.30 2002/02/07 17:59:47 lha Exp $");
-
-#ifdef DIAGNOSTIC
-#define DIAGNOSTIC 1
-#define DIAGNOSTIC_CLIENT 471114
-#define DIAGNOSTIC_CHECK_CLIENT(c) assert((c)->magic == DIAGNOSTIC_CLIENT)
-#define DIAGNOSTIC_ADDR 471197
-#define DIAGNOSTIC_CHECK_ADDR(a) assert((a)->magic == DIAGNOSTIC_ADDR)
-#define DIAGNOSTIC_CALLBACK 471134
-#define DIAGNOSTIC_CHECK_CALLBACK(c) assert((c)->magic == DIAGNOSTIC_CALLBACK)
-#define DIAGNOSTIC_CCPAIR 471110
-#define DIAGNOSTIC_CHECK_CCPAIR(c) assert((c)->magic == DIAGNOSTIC_CCPAIR)
-#else
-#define DIAGNOSTIC_CHECK_CLIENT(c)
-#define DIAGNOSTIC_CHECK_ADDR(a)
-#define DIAGNOSTIC_CHECK_CALLBACK(c)
-#define DIAGNOSTIC_CHECK_CCPAIR(c)
-#endif
-
-#undef NO_CALLBACKS
-
-/*
- * Declarations
- */
-
-#define ROPA_STACKSIZE (16*1024)
-#define DEFAULT_TIMEOUT 600
-
-struct ropa_client;
-
-struct ropa_addr {
-#ifdef DIAGNOSTIC
- int magic; /* magic */
-#endif
- struct ropa_client *c; /* pointer to head */
- uint32_t addr_in; /* */
- uint32_t subnetmask; /* */
- int mtu; /* */
-};
-
-typedef enum { ROPAC_FREE, /* this entry is free for use */
- ROPAC_LOOKUP_U, /* pending RXAFSCB_WhoAreYou */
- ROPAC_LOOKUP, /* pending RXAFSCB_InitCallBackState */
- ROPAC_DEAD, /* is client doesn't respond */
- ROPAC_PLAIN, /* is a client w/o a UUID*/
- ROPAC_UUID /* is a client w/ a UUID */
-} ropa_state_t;
-
-enum {
- ROPAF_LOOKUP = 0x1, /* pending a lookup => set WAITING, wait on addr(c) */
- ROPAF_WAITING = 0x2 /* wait on lookup to finish */
-};
-
-struct ropa_client {
-#ifdef DIAGNOSTIC
- int magic; /* magic */
-#endif
- ropa_state_t state;
- unsigned flags;
- int numberOfInterfaces;
- afsUUID uuid;
- struct ropa_addr addr[AFS_MAX_INTERFACE_ADDR];
- uint16_t port; /* port of client in network byte order */
- struct rx_connection *conn; /* connection to client */
- time_t lastseen; /* last got a message */
- List *callbacks; /* list of ccpairs */
- int ref; /* refence counter */
- Listitem *li; /* where on lru */
-};
-
-struct ropa_ccpair { /* heap object */
-#ifdef DIAGNOSTIC
- int magic; /* magic */
-#endif
- struct ropa_client *client; /* pointer to client */
- struct ropa_cb *cb; /* pointer to callback */
- Listitem *cb_li; /* pointer to li on callback */
- time_t expire; /* when this cb expire */
- heap_ptr heap; /* heap pointer */
- Listitem *li; /* where on lru */
-};
-
-struct ropa_cb {
-#ifdef DIAGNOSTIC
- int magic; /* magic */
-#endif
- AFSFid fid; /* what fid this callback is on */
- List *ccpairs; /* list of clients holding this cb */
- int ref; /* refence counter */
- Listitem *li; /* where on lru */
-};
-
-static void break_callback (struct ropa_cb *cb,struct ropa_client *caller,
- Bool break_own);
-static void break_ccpair (struct ropa_ccpair *cc, Bool notify_clientp);
-static void break_client (struct ropa_client *c, Bool notify_clientp);
-static void create_callbacks (unsigned n);
-static void create_ccpairs (unsigned n);
-static void create_clients (unsigned n);
-static int uuid_magic_eq (afsUUID *uuid1, afsUUID *uuid2);
-static void debug_print_callbacks(void);
-
-/*
- * Module variables
- */
-
-#define ROPA_MTU 1500
-
-/*
- *
- */
-
-static Hashtab *ht_clients_ip = NULL;
-static Hashtab *ht_clients_uuid = NULL;
-static Hashtab *ht_callbacks = NULL;
-static Hashtab *ht_ccpairs = NULL;
-/* least recently used on tail */
-static List *lru_clients = NULL;
-static List *lru_ccpair = NULL;
-static List *lru_callback = NULL;
-static unsigned num_clients = 0;
-static unsigned num_callbacks = 0;
-static unsigned num_ccpair = 0;
-
-static Heap *heap_ccpairs = NULL;
-static PROCESS cleaner_pid;
-
-static unsigned debuglevel;
-
-afsUUID server_uuid;
-
-/*
- *
- */
-
-static int
-uuid_magic_eq (afsUUID *uuid1, afsUUID *uuid2)
-{
- return memcmp (&uuid1->node,
- &uuid2->node,
- sizeof (uuid1->node));
-}
-
-/*
- * help functions for the hashtab
- */
-
-/*
- * We compare using addresses
- */
-
-static int
-clients_cmp_ip (void *p1, void *p2)
-{
- struct ropa_client *c1 = ((struct ropa_addr *) p1)->c;
- struct ropa_client *c2 = ((struct ropa_addr *) p2)->c;
- int i,j;
-
- for (i = 0; i < c1->numberOfInterfaces; i++) {
- for (j = 0; j < c2->numberOfInterfaces; j++) {
- if (c1->addr[i].addr_in == c2->addr[j].addr_in
- && c1->port == c2->port) {
- return 0;
- }
- }
- }
- return 1;
-}
-
-/*
- *
- */
-
-static unsigned
-clients_hash_ip (void *p)
-{
- struct ropa_addr *a = (struct ropa_addr *)p;
-
- return a->addr_in + a->c->port;
-}
-
-/*
- * We compare using uuid
- */
-
-static int
-clients_cmp_uuid (void *p1, void *p2)
-{
- return uuid_magic_eq (&((struct ropa_client *) p1)->uuid,
- &((struct ropa_client *) p2)->uuid);
-}
-
-static unsigned
-clients_hash_uuid (void *p)
-{
- struct ropa_client *c = (struct ropa_client *) p;
-
- return
- c->uuid.node[0] +
- (c->uuid.node[1] << 6) +
- (c->uuid.node[2] << 12) +
- (c->uuid.node[3] << 18) +
- (c->uuid.node[4] << 24) +
- ((c->uuid.node[5] << 30) & 0x3);
-}
-
-/*
- *
- */
-
-static int
-callbacks_cmp (void *p1, void *p2)
-{
- struct ropa_cb *c1 = (struct ropa_cb *) p1;
- struct ropa_cb *c2 = (struct ropa_cb *) p2;
-
- return c1->fid.Volume - c2->fid.Volume
- || c1->fid.Vnode - c2->fid.Vnode
- || c1->fid.Unique - c2->fid.Unique;
-}
-
-/*
- *
- */
-
-static unsigned
-callbacks_hash (void *p)
-{
- struct ropa_cb *c = (struct ropa_cb *)p;
-
- return c->fid.Volume + c->fid.Vnode +
- c->fid.Unique;
-}
-
-
-/*
- *
- */
-
-static int
-ccpairs_cmp (void *p1, void *p2)
-{
- struct ropa_ccpair *c1 = (struct ropa_ccpair *) p1;
- struct ropa_ccpair *c2 = (struct ropa_ccpair *) p2;
-
- return c1->cb - c2->cb
- || c1->client - c2->client;
-}
-
-/*
- *
- */
-
-static unsigned
-ccpairs_hash (void *p)
-{
- struct ropa_ccpair *c = (struct ropa_ccpair *) p;
-
- return (unsigned) c->client + callbacks_hash (c->cb);
-}
-
-/*
- *
- */
-
-static int
-ccpair_cmp_time (const void *p1, const void *p2)
-{
- struct ropa_ccpair *c1 = (struct ropa_ccpair *) p1;
- struct ropa_ccpair *c2 = (struct ropa_ccpair *) p2;
-
- return c1->expire - c2->expire;
-}
-
-/*
- *
- */
-
-static Bool
-client_inuse_p (struct ropa_client *c)
-{
- assert (c);
- if (c->state == ROPAC_FREE)
- return FALSE;
- if (c->state == ROPAC_DEAD && listemptyp(c->callbacks))
- return FALSE;
- return TRUE;
-}
-
-/*
- *
- */
-
-static Bool
-callback_inuse_p (struct ropa_cb *cb)
-{
- assert (cb);
- return !listemptyp (cb->ccpairs) ;
-}
-
-/*
- *
- */
-
-static Bool
-ccpairs_inuse_p (struct ropa_ccpair *cc)
-{
- assert (cc);
- return cc->client == NULL ? FALSE : TRUE ;
-}
-
-/*
- *
- */
-
-static void
-create_clients (unsigned n)
-{
- struct ropa_client *c;
- unsigned long i;
-
- c = calloc (n, sizeof (*c));
- if (c == NULL)
- err (1, "create_clients: calloc");
-
- for (i = 0 ; i < n; i++) {
-#ifdef DIAGNOSTIC
- c[i].magic = DIAGNOSTIC_CLIENT;
- {
- int j;
- for (j = 0; j < sizeof(c->addr)/sizeof(c->addr[0]); j++)
- c[i].addr[j].magic = DIAGNOSTIC_ADDR;
- }
-#endif
-
- c[i].port = 0;
- c[i].lastseen = 0;
- c[i].callbacks = listnew();
- if (c[i].callbacks == NULL)
- err (1, "create_clients: listnew");
- c[i].ref = 0;
- c[i].state = ROPAC_FREE;
- c[i].li = listaddtail (lru_clients, &c[i]);
- }
- num_clients += n;
-}
-
-/*
- *
- */
-
-static void
-create_callbacks (unsigned n)
-{
- struct ropa_cb *c;
- int i;
-
- c = malloc (n * sizeof (*c));
- if (c == NULL)
- err (1, "create_callbacks: malloc");
- memset (c, 0, n * sizeof (*c));
-
- for (i = 0; i < n ; i++) {
-#ifdef DIAGNOSTIC
- c[i].magic = DIAGNOSTIC_CALLBACK;
-#endif
- c[i].ccpairs = listnew();
- if (c[i].ccpairs == NULL)
- err (1, "create_callbacks: listnew");
- c[i].li = listaddtail (lru_callback, &c[i]);
- }
- num_callbacks += n;
-}
-
-/*
- *
- */
-
-static void
-create_ccpairs (unsigned n)
-{
- struct ropa_ccpair *c;
- int i;
-
- c = malloc (n * sizeof (*c));
- if (c == NULL)
- err (1, "create_ccpairs: malloc");
- memset (c, 0, n * sizeof (*c));
-
- for (i = 0; i < n ; i++) {
-#ifdef DIAGNOSTIC
- c[i].magic = DIAGNOSTIC_CCPAIR;
-#endif
- c[i].li = listaddtail (lru_ccpair, &c[i]);
- }
- num_ccpair += n;
-}
-
-/*
- *
- */
-
-static void
-client_ref (struct ropa_client *c)
-{
- assert (c->ref >= 0);
- if (c->li)
- listdel (lru_clients, c->li);
- c->ref++;
- if (c->li)
- c->li = listaddhead (lru_clients, c);
-}
-
-/*
- *
- */
-
-static void
-callback_ref (struct ropa_cb *cb)
-{
- assert (cb->ref >= 0);
- if (cb->li)
- listdel (lru_callback, cb->li);
- cb->ref++;
-
- mlog_log (MDEBROPA, "cb_ref: %x.%x.%x (%d)",
- cb->fid.Volume, cb->fid.Vnode, cb->fid.Unique, cb->ref);
-
- if (cb->li)
- cb->li = listaddhead (lru_callback, cb);
-}
-
-/*
- *
- */
-
-static void
-clear_addr (struct ropa_addr *addr)
-{
- DIAGNOSTIC_CHECK_ADDR(addr);
- addr->c = NULL;
- addr->addr_in = 0;
- addr->subnetmask = 0;
- addr->mtu = 0;
-}
-
-/*
- * Update `c' with new host information.
- */
-
-static void
-client_update_interfaces (struct ropa_client *c, uint32_t host,
- uint16_t port, interfaceAddr *addr)
-{
- int i;
- int found_addr = 0;
-
- if (addr->numberOfInterfaces > AFS_MAX_INTERFACE_ADDR)
- addr->numberOfInterfaces = AFS_MAX_INTERFACE_ADDR;
-
- for (i = 0; i < c->numberOfInterfaces; i++) {
- hashtabdel (ht_clients_ip, &c->addr[i]);
- DIAGNOSTIC_CHECK_ADDR(&c->addr[i]);
- }
-
- for (i = 0; i < addr->numberOfInterfaces; i++) {
- DIAGNOSTIC_CHECK_ADDR(&c->addr[i]);
- c->addr[i].c = c;
- c->addr[i].addr_in = addr->addr_in[i];
- c->addr[i].subnetmask = addr->subnetmask[i];
- c->addr[i].mtu = addr->mtu[i];
- hashtabadd (ht_clients_ip, &c->addr[i]);
- if (host == addr->addr_in[i])
- found_addr = 1;
- }
- if (!found_addr && i < AFS_MAX_INTERFACE_ADDR) {
- DIAGNOSTIC_CHECK_ADDR(&c->addr[i]);
- c->addr[i].c = c;
- c->addr[i].addr_in = host;
- c->addr[i].subnetmask = 0xffffff00;
- c->addr[i].mtu = ROPA_MTU;
- hashtabadd (ht_clients_ip, &c->addr[i]);
- i++;
- }
- c->numberOfInterfaces = i;
- for (; i < AFS_MAX_INTERFACE_ADDR; i++)
- clear_addr (&c->addr[i]);
-}
-
-/*
- * Initialize the client `c' with `host'/`port' (or use `addr' if that
- * is available). Add the client to hashtables.
- *
- * Note that this function can be called more then one time on the
- * same client to update the address/uuid information.
- */
-
-static void
-client_init (struct ropa_client *c, uint32_t host, uint16_t port,
- afsUUID *uuid, interfaceAddr *addr)
-{
- c->port = port;
- if (addr) {
- client_update_interfaces (c, host, port, addr);
- } else {
- int i;
-
- for (i = 0; i < c->numberOfInterfaces; i++) {
- hashtabdel (ht_clients_ip, &c->addr[i]);
- DIAGNOSTIC_CHECK_ADDR(&c->addr[i]);
- }
-
- c->numberOfInterfaces = 1;
- DIAGNOSTIC_CHECK_ADDR(&c->addr[0]);
- c->addr[0].c = c;
- c->addr[0].addr_in = host;
- c->addr[0].subnetmask = 0xffffff00;
- c->addr[0].mtu = ROPA_MTU;
- hashtabadd (ht_clients_ip, &c->addr[0]);
- }
- if (uuid) {
- c->uuid = *uuid;
- hashtabadd (ht_clients_uuid, c);
- }
-}
-
-/*
- * Free client `c' and remove from alla data-structures.
- */
-
-static void
-disconnect_client (struct ropa_client *c)
-{
- int ret;
- int i;
-
- assert (c->ref == 0);
-
- if (c->li) {
- listdel (lru_clients, c->li);
- c->li = NULL;
- }
-
- for (i = 0 ; i < c->numberOfInterfaces ; i++) {
- int ret = hashtabdel (ht_clients_ip, &c->addr[i]);
- assert (ret == 0);
- clear_addr (&c->addr[i]);
- }
- c->numberOfInterfaces = 0;
- c->port = 0;
- c->state = ROPAC_FREE;
-
- ret = hashtabdel (ht_clients_uuid, c);
- assert (ret == 0);
- c->li = listaddtail (lru_clients, c);
-}
-
-/*
- *
- */
-
-static void
-client_deref (struct ropa_client *c)
-{
- c->ref--;
-
- if (c->ref == 0)
- disconnect_client (c);
-}
-
-/*
- *
- */
-
-static void
-callback_deref (struct ropa_cb *cb)
-{
- cb->ref--;
-
- mlog_log (MDEBROPA, "cb_deref: %x.%x.%x (%d)",
- cb->fid.Volume, cb->fid.Vnode, cb->fid.Unique, cb->ref);
-
- if (cb->ref == 0) {
- int ret = hashtabdel (ht_callbacks, cb);
-
- mlog_log (MDEBROPA, "cb_deref: removing %x.%x.%x",
- cb->fid.Volume, cb->fid.Vnode, cb->fid.Unique);
-
- assert (ret == 0);
-
- if (cb->li)
- listdel (lru_callback, cb->li);
-
- assert (listemptyp (cb->ccpairs));
- memset (&cb->fid, 0, sizeof(cb->fid));
- cb->li = listaddtail (lru_callback, cb);
- }
-}
-
-/*
- *
- */
-
-static struct ropa_ccpair *
-add_client (struct ropa_cb *cb, struct ropa_client *c)
-{
- struct timeval tv;
- struct ropa_ccpair cckey, *cc;
-
- assert (cb && c);
-
- cckey.client = c;
- cckey.cb = cb;
-
- cc = hashtabsearch (ht_ccpairs, &cckey);
-
- if (cc) {
- listdel (lru_ccpair, cc->li);
- cc->li = listaddhead (lru_ccpair, cc);
- return cc;
- }
-
- /* The reverse of these are in break_ccpair */
- callback_ref (cb);
- client_ref (c);
-
- cc = listdeltail (lru_ccpair);
- DIAGNOSTIC_CHECK_CCPAIR(cc);
- cc->li = NULL;
-
- if (ccpairs_inuse_p (cc))
- break_ccpair (cc, TRUE);
-
- /* XXX do it for real */
- gettimeofday(&tv, NULL);
- cc->expire = tv.tv_sec + 3600;
-
- heap_insert (heap_ccpairs, cc, &cc->heap);
- LWP_NoYieldSignal (heap_ccpairs);
- cc->cb_li = listaddtail (cb->ccpairs, cc);
-
- cc->client = c;
- cc->cb = cb;
- cc->li = listaddhead (lru_ccpair, cc);
- hashtabadd (ht_ccpairs, cc);
-
- mlog_log (MDEBROPA, "add_client: added %x to callback %x.%x.%x",
- c->addr[0].addr_in, cb->fid.Volume, cb->fid.Vnode, cb->fid.Unique);
-
- return cc;
-}
-
-/*
- *
- */
-
-static void
-uuid_init_simple (afsUUID *uuid, uint32_t host)
-{
- uuid->node[0] = 0xff & host;
- uuid->node[1] = 0xff & (host >> 8);
- uuid->node[2] = 0xff & (host >> 16);
- uuid->node[3] = 0xff & (host >> 24);
- uuid->node[4] = 0xaa;
- uuid->node[5] = 0x77;
-}
-
-/*
- *
- */
-
-static struct ropa_client *
-client_query_notalkback (uint32_t host, uint16_t port)
-{
- struct ropa_client ckey;
- struct ropa_addr *addr;
- ckey.numberOfInterfaces = 1;
- ckey.addr[0].c= &ckey;
- ckey.addr[0].addr_in = host;
- ckey.port = port;
- addr = hashtabsearch (ht_clients_ip, &ckey.addr[0]);
- if (addr) {
- assert (addr->c->numberOfInterfaces);
- return addr->c;
- }
- return NULL;
-}
-
-/*
- *
- */
-
-static struct ropa_client *
-obtain_client (void)
-{
- struct ropa_client *c;
-
- c = listdeltail (lru_clients);
- DIAGNOSTIC_CHECK_CLIENT(c);
- c->li = NULL;
- if (client_inuse_p (c))
- break_client (c, TRUE);
-
- if (c->li) {
- listdel(lru_clients, c->li);
- c->li = NULL;
- }
- return c;
-}
-
-/*
- *
- */
-
-static struct ropa_client *
-client_query (uint32_t host, uint16_t port)
-{
- struct ropa_client *c, *c_new;
- int ret;
-
- c = client_query_notalkback(host, port);
- if (c == NULL) {
- interfaceAddr remote;
- struct rx_connection *conn = NULL;
-
- c = obtain_client();
- assert (c->state == ROPAC_FREE && c->li == NULL);
- c->state = ROPAC_LOOKUP_U;
- c->flags |= ROPAF_LOOKUP;
- client_init (c, host, port, NULL, NULL);
-
- conn = rx_NewConnection (host, port, CM_SERVICE_ID,
- rxnull_NewClientSecurityObject(),
- 0);
- if (conn == NULL) {
- free(c);
- return NULL;
- }
- retry:
- switch (c->state) {
- case ROPAC_DEAD:
- c->li = listaddtail (lru_clients, c);
- ret = ENETDOWN;
- break;
- case ROPAC_LOOKUP_U:
- ret = RXAFSCB_WhoAreYou (conn, &remote);
- if (ret == RXGEN_OPCODE) {
- c->state = ROPAC_LOOKUP;
- goto retry;
- } else if (ret == RX_CALL_DEAD) {
- c->state = ROPAC_DEAD;
- goto retry;
- } else {
- struct ropa_client ckey;
-
- ckey.uuid = remote.uuid;
- c_new = hashtabsearch (ht_clients_uuid, &ckey);
- if (c_new == NULL) {
- client_init (c, host, port, &remote.uuid, NULL);
- ret = RXAFSCB_InitCallBackState3(conn, &server_uuid);
- } else {
- client_update_interfaces (c_new, host, port, &remote);
- disconnect_client (c);
- c = c_new;
- listdel(lru_clients, c->li);
- c->li = NULL;
- }
- }
- break;
- case ROPAC_LOOKUP: {
- afsUUID uuid;
- ret = RXAFSCB_InitCallBackState(conn);
- if (ret == RX_CALL_DEAD) {
- c->state = ROPAC_DEAD;
- goto retry;
- }
- uuid_init_simple (&uuid, host);
- client_init (c, host, port, &uuid, NULL);
- break;
- }
- default:
- exit(-1);
- }
-
- rx_DestroyConnection (conn);
-
- if ((c->flags & ROPAF_WAITING) != 0)
- LWP_NoYieldSignal (c);
- c->flags &= ~(ROPAF_LOOKUP|ROPAF_WAITING);
-
- if (ret) {
- assert (c->li != NULL);
- return NULL;
- }
-
- assert (c->li == NULL);
- c->li = listaddhead (lru_clients, c);
-
- } else { /* c != NULL */
- if ((c->flags & ROPAF_LOOKUP) != 0) {
- c->flags |= ROPAF_WAITING;
- LWP_WaitProcess (c);
- }
- assert (c->li != NULL);
- }
-
- return c;
-}
-
-/*
- *
- */
-
-#if 0
-static struct ropa_client *
-uuid_query_simple (uint32_t host)
-{
- struct ropa_client ckey;
- uuid_init_simple (&ckey.uuid, host);
- return hashtabsearch (ht_clients_uuid, &ckey);
-}
-#endif
-
-/*
- * Update `callback' of `type' to expire at `time'.
- */
-
-static void
-update_callback_time (int32_t time, AFSCallBack *callback, int32_t type)
-{
- callback->CallBackVersion = CALLBACK_VERSION;
- callback->ExpirationTime = time;
- callback->CallBackType = type;
-}
-
-/*
- * Update the `callback' of `type' from `cc'.
- */
-
-static void
-update_callback (struct ropa_ccpair *cc, AFSCallBack *callback, int32_t type)
-{
- struct timeval tv;
- gettimeofday(&tv, NULL);
- update_callback_time (cc->expire - tv.tv_sec, callback, type);
-}
-
-
-/*
- * ropa_getcallback will obtain a callback for the socketpair
- * `host'/`port' and `fid', then result is returned in `callback'.
- */
-
-int
-ropa_getcallback (uint32_t host, uint16_t port, const struct AFSFid *fid,
- AFSCallBack *callback, int32_t voltype)
-{
- struct ropa_client *c;
- struct ropa_cb cbkey, *cb;
- struct ropa_ccpair *cc ;
- struct AFSFid callback_fid;
-
- debug_print_callbacks();
-
- c = client_query (host, port);
- if (c == NULL) {
- mlog_log (MDEBROPA, "ropa_getcallback: didn't find client %x/%d",
- host, port);
- update_callback_time (DEFAULT_TIMEOUT, callback, CBSHARED);
- return 0;
- }
-
- /*
- * At this point the client should be firmly set
- * in the ropa client database.
- */
-
-#if 0
- if (c->have_outstanding_callbacks)
- break_outstanding_callbacks (c);
-#endif
-
- if (voltype == RWVOL) {
- callback_fid = *fid;
- } else {
- callback_fid.Volume = fid->Volume;
- callback_fid.Vnode = 0;
- callback_fid.Unique = 0;
- }
-
- cbkey.fid = callback_fid;
-
- cb = hashtabsearch (ht_callbacks, &cbkey);
- if (cb == NULL) {
- cb = listdeltail (lru_callback);
- DIAGNOSTIC_CHECK_CALLBACK(cb);
- cb->li = NULL;
- if (callback_inuse_p (cb)) {
- break_callback (cb, NULL, FALSE);
- callback_ref(cb);
- } else {
- callback_ref(cb);
- cb->li = listaddhead (lru_callback, cb);
- }
- cb->fid = callback_fid;
- hashtabadd (ht_callbacks, cb);
-
- mlog_log (MDEBROPA, "ropa_getcallback: added callback %x.%x.%x:%x",
- callback_fid.Volume, callback_fid.Vnode,
- callback_fid.Unique, host);
- } else {
- mlog_log (MDEBROPA, "ropa_getcallback: found callback %x.%x.%x:%x",
- callback_fid.Volume, callback_fid.Vnode,
- callback_fid.Unique, host);
- callback_ref(cb);
- }
-
- cc = add_client (cb, c);
-
- callback_deref (cb);
-
- update_callback (cc, callback, CBSHARED);
-
- debug_print_callbacks();
-
- return 0;
-}
-
-/*
- * Notify client
- */
-
-static int
-notify_client (struct ropa_client *c, AFSCBFids *fids, AFSCBs *cbs)
-{
-#ifdef NO_CALLBACKS
- return 0;
-#else
- int i, ret;
- if (c->conn) {
- ret = RXAFSCB_CallBack (c->conn, fids, cbs);
- if (ret == 0)
- return ret;
- }
- for (i = 0; i < c->numberOfInterfaces ; i++) {
- uint16_t port = c->port;
- DIAGNOSTIC_CHECK_ADDR(&c->addr[i]);
-
- c->conn = rx_NewConnection (c->addr[i].addr_in,
- port,
- CM_SERVICE_ID,
- rxnull_NewClientSecurityObject(),
- 0);
- mlog_log (MDEBROPA, "notify_client: notifying %x", c->addr[i].addr_in);
-
- ret = RXAFSCB_CallBack (c->conn, fids, cbs);
- if (ret)
- rx_DestroyConnection (c->conn);
- else
- break;
-
- /* XXX warn */
- }
-
- return ret;
-#endif
-}
-
-/*
- * Break the callback `cc' that that clients holds. The client doesn't
- * need to be removed from the callbacks list of ccpairs before this
- * function is called.
- */
-
-static void
-break_ccpair (struct ropa_ccpair *cc, Bool notify_clientp)
-{
- AFSCBFids fids;
- AFSCBs cbs;
- int ret;
-
- debug_print_callbacks();
-
- cc->expire = 0;
-
- if (cc->li)
- listdel (lru_ccpair, cc->li);
-
- if (notify_clientp) {
- fids.len = 1;
- fids.val = &cc->cb->fid;
- cbs.len = 0;
- notify_client (cc->client, &fids, &cbs);
- }
-
- if (cc->cb_li) {
- listdel (cc->cb->ccpairs, cc->cb_li);
- cc->cb_li = NULL;
- }
-
- /* The reverse of these are in add_client */
- ret = hashtabdel (ht_ccpairs, cc);
- assert (ret == 0);
- client_deref (cc->client);
- cc->client = NULL;
- callback_deref (cc->cb);
- cc->cb = NULL;
-
- heap_remove (heap_ccpairs, cc->heap);
-
- cc->li = listaddtail (lru_ccpair, cc);
-
- debug_print_callbacks();
-}
-
-static int
-add_to_cb (AFSFid *fid, AFSCallBack *cb, AFSCBFids *fids, AFSCBs *cbs)
-{
- AFSFid *n_fid;
- AFSCallBack *n_cb;
-
- n_fid = realloc (fids->val, fids->len + 1);
- if (n_fid == NULL)
- return ENOMEM;
- fids->val = n_fid;
- n_cb = realloc (cbs->val, cbs->len + 1);
- if (n_cb == NULL)
- return ENOMEM;
- cbs->val = n_cb;
- fids->val[fids->len] = *fid;
- cbs->val[cbs->len] = *cb;
- ++fids->len;
- ++cbs->len;
- return 0;
-}
-
-static void
-break_ccpairs (struct ropa_client *c, Bool notify_clientp)
-{
- AFSCBFids fids;
- AFSCBs cbs;
- struct ropa_ccpair *cc;
- AFSCallBack callback;
-
- DIAGNOSTIC_CHECK_CLIENT(c);
-
- fids.val = NULL;
- fids.len = 0;
-
- cbs.val = NULL;
- cbs.len = 0;
-
- while ((cc = listdeltail (c->callbacks)) != NULL) {
- DIAGNOSTIC_CHECK_CCPAIR(cc);
- update_callback (cc, &callback, CBDROPPED);
- add_to_cb (&cc->cb->fid, &callback, &fids, &cbs);
- break_ccpair (cc, FALSE);
- }
-
- if (notify_clientp)
- notify_client (c, &fids, &cbs);
-}
-
-
-/*
- * break the callback and remove it from the chain of clients.
- * it the clients responsible for the callback is the caller
- * don't break the callback.
- */
-
-static void
-break_callback (struct ropa_cb *cb, struct ropa_client *caller, Bool break_own)
-{
- struct ropa_ccpair *cc;
- struct ropa_ccpair *own_cc = NULL;
-
- assert (cb);
- assert (cb->ccpairs);
-
- mlog_log (MDEBROPA, "break_callback: breaking callback %x.%x.%x (%d)",
- cb->fid.Volume, cb->fid.Vnode, cb->fid.Unique, break_own);
-
- callback_ref (cb);
- if (caller)
- client_ref (caller);
-
- while ((cc = listdelhead (cb->ccpairs)) != 0) {
- assert (cc->cb == cb);
- cc->cb_li = NULL;
- if (break_own)
- break_ccpair (cc, cc->client != caller);
- else
- if (cc->client == caller)
- own_cc = cc;
- else
- break_ccpair (cc, TRUE);
- }
-
- if (own_cc)
- own_cc->cb_li = listaddhead (cb->ccpairs, own_cc);
-
- callback_deref (cb);
- if (caller)
- client_deref (caller);
-}
-
-static int
-break_fid (const struct AFSFid *fid, struct ropa_client *c,
- Bool break_own)
-{
- struct ropa_cb cbkey, *cb;
-
- cbkey.fid = *fid;
-
- cb = hashtabsearch (ht_callbacks, &cbkey);
- if (cb == NULL) {
- return -1;
- }
-
- break_callback (cb, c, break_own);
-
- return 0;
-}
-
-/*
- *
- */
-
-void
-ropa_break_callback (uint32_t addr, uint16_t port,
- const struct AFSFid *fid, Bool break_own)
-{
- struct ropa_client *c = NULL;
-
- debug_print_callbacks();
-
- c = client_query_notalkback (addr, port);
- if (c == NULL) {
- mlog_log (MDEBROPA, "ropa_break_callback: didn't find client %x/%d",
- addr, addr);
- return; /* XXX */
- }
-
- if (break_fid(fid, c, break_own)) {
- mlog_log (MDEBROPA, "ropa_break_callback: "
- "didn't find callback %x.%x.%x:%x/%d",
- fid->Volume, fid->Vnode, fid->Unique, addr, port);
- }
-
- debug_print_callbacks();
-}
-
-void
-ropa_break_volume_callback(int32_t volume)
-{
- struct AFSFid fid;
-
- fid.Volume = volume;
- fid.Vnode = 0;
- fid.Unique = 0;
-
- break_fid(&fid, NULL, FALSE);
-}
-
-/*
- * ropa_drop_callbacks
- */
-
-int
-ropa_drop_callbacks (uint32_t addr, uint16_t port,
- const AFSCBFids *a_cbfids_p, const AFSCBs *a_cbs_p)
-{
- struct ropa_client *c;
- struct ropa_cb cbkey, *cb;
- struct ropa_ccpair cckey, *cc;
- int i;
-
- debug_print_callbacks();
-
- if (a_cbfids_p->len > AFSCBMAX)
- return EINVAL;
-
- c = client_query (addr, port);
- if (c == NULL) {
- mlog_log (MDEBROPA, "ropa_drop_callbacks: didn't find client %x/%d",
- addr, port);
- return 0;
- }
-
- for (i = 0; i < a_cbfids_p->len; i++) {
- cbkey.fid = a_cbfids_p->val[i];
-
- cb = hashtabsearch (ht_callbacks, &cbkey);
- if (cb != NULL) {
- cckey.client = c;
- cckey.cb = cb;
-
- cc = hashtabsearch (ht_ccpairs, &cckey);
- if (cc != NULL) {
- mlog_log (MDEBROPA, "ropa_drop: dropping %x.%x.%x:%x/%d",
- cb->fid.Volume, cb->fid.Vnode, cb->fid.Unique,
- addr, port);
- break_ccpair (cc, FALSE);
- }
- }
- }
-
- debug_print_callbacks();
-
- return 0;
-}
-
-
-/*
- *
- */
-
-static void
-break_client (struct ropa_client *c, Bool notify_clientp)
-{
- assert (c);
-
- client_ref (c);
- break_ccpairs (c, notify_clientp);
- client_deref (c);
-}
-
-void
-ropa_break_client (uint32_t host, uint16_t port)
-{
- struct ropa_client *c;
-
- c = client_query (host, port);
- if (c == NULL) {
- /* XXX warn */
- return;
- }
-
- break_client (c, TRUE);
-}
-
-/*
- *
- */
-
-static void
-heapcleaner (char *arg)
-{
- const void *head;
- struct timeval tv;
-
- while (1) {
-
- while ((head = heap_head (heap_ccpairs)) == NULL)
- LWP_WaitProcess (heap_ccpairs);
-
- while ((head = heap_head (heap_ccpairs)) != NULL) {
- struct ropa_ccpair *cc = (struct ropa_ccpair *)head;
-
- gettimeofday (&tv, NULL);
-
- if (tv.tv_sec < cc->expire) {
- unsigned long t = cc->expire - tv.tv_sec;
- IOMGR_Sleep (t);
- } else {
-/* XXX should this be fixed?
- listdel (cc->cb->ccpairs, cc->cb_li);
- cc->cb_li = NULL; */
- break_ccpair (cc, TRUE); /* will remove it from the heap */
- }
- }
- }
-}
-
-
-/*
- * init the ropa-module
- */
-
-int
-ropa_init (unsigned num_cb, unsigned num_cli, unsigned num_cc,
- unsigned hashsz_cb, unsigned hashsz_cli, unsigned hashsz_cc)
-{
- ht_callbacks = hashtabnew (hashsz_cb, callbacks_cmp, callbacks_hash);
- if (ht_callbacks == NULL)
- errx (1, "ropa_init: failed to create hashtable for callbacks");
-
- ht_clients_ip = hashtabnew (hashsz_cli, clients_cmp_ip, clients_hash_ip);
- if (ht_clients_ip == NULL)
- errx (1, "ropa_init: failed to create hashtable for clients_ip");
-
- ht_clients_uuid = hashtabnew (hashsz_cli, clients_cmp_uuid,
- clients_hash_uuid);
- if (ht_clients_uuid == NULL)
- errx (1, "ropa_init: failed to create hashtable for clients_uuid");
-
- ht_ccpairs = hashtabnew (hashsz_cc, ccpairs_cmp,
- ccpairs_hash);
- if (ht_ccpairs == NULL)
- errx (1, "ropa_init: failed to create hashtable for ccpairs");
-
- lru_clients = listnew ();
- if (lru_clients == NULL)
- errx (1, "ropa_init: failed to create lru for clients");
-
- lru_ccpair = listnew ();
- if (lru_ccpair == NULL)
- errx (1, "ropa_init: failed to create list for ccpairs");
-
- lru_callback = listnew ();
- if (lru_callback == NULL)
- errx (1, "ropa_init: failed to create list for callback");
-
- heap_ccpairs = heap_new (num_cc, ccpair_cmp_time);
- if (heap_ccpairs == NULL)
- errx (1, "ropa_init: failed to create heap for ccpairs");
-
- create_clients(num_cli);
- create_callbacks(num_cb);
- create_ccpairs(num_cc);
-
- uuid_init_simple (&server_uuid, 0x82ED305E);
-
- if (LWP_CreateProcess (heapcleaner, ROPA_STACKSIZE, 1,
- NULL, "heap-invalidator", &cleaner_pid))
- errx (1, "ropa_init: LWP_CreateProcess failed");
-
- debuglevel = mlog_log_get_level_num(); /* XXX */
-
- return 0;
-}
-
-static Bool
-print_callback_sub (void *ptr, void *arg)
-{
- struct ropa_cb *cb = (struct ropa_cb *)ptr;
- mlog_log (MDEBROPA, "\tfound %x.%x.%x (ref=%d)",
- cb->fid.Volume, cb->fid.Vnode, cb->fid.Unique, cb->ref);
- return FALSE;
-}
-
-static void
-debug_print_callbacks (void)
-{
- if (debuglevel & MDEBROPA) {
- mlog_log (MDEBROPA, "---callbacks left are---");
-
- hashtabforeach (ht_callbacks, print_callback_sub, NULL);
- }
-}
diff --git a/usr.sbin/afs/src/milko/lib/ropa/ropa.h b/usr.sbin/afs/src/milko/lib/ropa/ropa.h
deleted file mode 100644
index d9adbe5070d..00000000000
--- a/usr.sbin/afs/src/milko/lib/ropa/ropa.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: ropa.h,v 1.10 2002/02/07 17:59:48 lha Exp $ */
-
-int
-ropa_init (unsigned num_cb, unsigned num_cli, unsigned num_cc,
- unsigned hashsz_cb, unsigned hashsz_cli, unsigned hashsz_cc);
-
-int
-ropa_getcallback (uint32_t host, uint16_t port, const struct AFSFid *fid,
- AFSCallBack *callback, int32_t voltype);
-
-int
-ropa_drop_callbacks (uint32_t host, uint16_t port,
- const AFSCBFids *a_cbfids_p, const AFSCBs *a_cbs_p);
-
-void
-ropa_break_callback (uint32_t addr, uint16_t port,
- const struct AFSFid *fid, Bool break_own);
-
-void
-ropa_break_client (uint32_t addr, uint16_t port);
-
-void
-ropa_break_volume_callback(int32_t volume);
diff --git a/usr.sbin/afs/src/milko/lib/vld/Makefile.in b/usr.sbin/afs/src/milko/lib/vld/Makefile.in
deleted file mode 100644
index f02ff4e9710..00000000000
--- a/usr.sbin/afs/src/milko/lib/vld/Makefile.in
+++ /dev/null
@@ -1,111 +0,0 @@
-#
-# $KTH: Makefile.in,v 1.10 2000/10/08 06:23:25 lha Exp $
-#
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_builddir = ../../..
-VPATH = @srcdir@
-
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-INCLUDES = -I. \
- -I$(srcdir) \
- -I$(srcdir)/../mlog \
- -I$(srcdir)/../dpart \
- -I$(srcdir)/../voldb \
- -I$(srcdir)/../vstatus \
- -I$(srcdir)/../../../lib/bufdir \
- -I../vstatus \
- -I$(srcdir)/../../fs \
- -I$(srcdir)/../../.. \
- -I../../../rxdef \
- -I../../../include \
- $(KRB4_INC_FLAGS) \
- -I$(srcdir)/../../include \
- -I$(srcdir)/../../../include
-
-CFLAGS = @CFLAGS@
-KRB4_INC_FLAGS= @KRB4_INC_FLAGS@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-sysconfdir = @sysconfdir@
-ARLACACHEDIR = @ARLACACHEDIR@
-ARLACONFFILE = @ARLACONFFILE@
-
-#PICFLAGS = @PICFLAGS@
-
-LIBNAME = $(LIBPREFIX)vld
-#LIBEXT = @LIBEXT@
-LIBEXT = a
-#SHLIBEXT = @SHLIBEXT@
-#LIBPREFIX = @LIBPREFIX@
-LIBPREFIX = lib
-#LDSHARED = @LDSHARED@
-LIB = $(LIBNAME).$(LIBEXT)
-
-DEFS = @DEFS@
-
-LIB_SOURCES = mnode.c vld.c mdir.c glue.c svol.c fvol.c common.c salvage.c debug.c
-
-SOURCES = $(LIB_SOURCES)
-
-LIB_OBJECTS = mnode.o vld.o mdir.o glue.o svol.o fvol.o common.o salvage.o debug.o
-
-OBJECTS = $(LIB_OBJECTS)
-
-all: $(LIB)
-
-Wall:
- make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS) $(PICFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
- $(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/$(LIB)
-
-uninstall:
- rm -f $(DESTDIR)$(libdir)/$(LIB)
-
-TAGS: $(SOURCES)
- etags $(SOURCES)
-
-check:
-
-clean:
- rm -f $(LIB) $(PROGS) *.o *.a
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *~
-
-realclean: distclean
- rm -f TAGS
-
-$(LIBNAME).a: $(LIB_OBJECTS)
- rm -f $@
- $(AR) cr $@ $(LIB_OBJECTS)
- -$(RANLIB) $@
-
-#$(LIBNAME).$(SHLIBEXT): $(LIB_OBJECTS)
-# rm -f $@
-# $(LDSHARED) -o $@ $(LIB_OBJECTS)
-
-$(OBJECTS): ../../../include/config.h
-
-Makefile: Makefile.in ../../../config.status
- cd ../../..; CONFIG_FILES=milko/lib/vld/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-
-.PHONY: all install uninstall check clean mostlyclean distclean realclean
diff --git a/usr.sbin/afs/src/milko/lib/vld/common.c b/usr.sbin/afs/src/milko/lib/vld/common.c
deleted file mode 100644
index 58fadadc548..00000000000
--- a/usr.sbin/afs/src/milko/lib/vld/common.c
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sfvol_private.h>
-
-RCSID("$arla: common.c,v 1.3 2000/10/03 00:18:41 lha Exp $");
-
-/*
- * Translate the `opaque' to the `ino'.
- */
-
-static int
-local_ino2opaque (ino_t *ino, onode_opaque *opaque)
-{
- unsigned char *ptr = opaque->data;
-
- opaque->size = sizeof(ino_t) + 1;
-
- *ptr = 'L';
- ptr++;
-
- memcpy (ptr, ino, sizeof (*ino));
- return 0;
-}
-
-/*
- * The reverse
- */
-
-static int
-local_opaque2ino (onode_opaque *opaque, ino_t *ino)
-{
- unsigned char *ptr = opaque->data;
-
- if (*ptr != 'L')
- return EINVAL;
-
- ptr++;
-
- memcpy (ino, ptr, sizeof (*ino));
- opaque->size = sizeof(ino_t) + 1;
- return 0;
-}
-
-/*
- *
- */
-
-Bool
-local_opaquep (onode_opaque *opaque)
-{
- unsigned char *ptr = opaque->data;
-
- if (opaque->size < 1) return FALSE;
- if (*ptr == 'L') return TRUE;
- return FALSE;
-}
-
-/*
- *
- */
-
-int
-local_unlink_file (struct dp_part *dp, onode_opaque *o)
-{
- char name[MAXPATHLEN];
- int ret;
- ino_t ino;
-
- ret = local_opaque2ino (o, &ino);
- if (ret)
- return ret;
-
- ret = local_create_name (dp, ino, name, sizeof (name));
- if (ret)
- return ret;
-
- ret = unlink (name);
- if (ret)
- return errno;
-
- return 0;
-
-}
-
-/*
- *
- */
-
-int
-local_open_file (struct dp_part *dp, onode_opaque *o,
- int flags, int *fd)
-{
- char p[MAXPATHLEN];
- ino_t ino;
- int ret;
-
- ret = local_opaque2ino (o, &ino);
- if (ret) return ret;
-
- ret = local_create_name (dp, ino, p, sizeof(p));
- if (ret) return ret;
-
- ret = open (p, flags, 0600);
- if (ret < 0) return errno;
-
- *fd = ret;
- return 0;
-}
-
-/*
- *
- */
-
-int
-local_create_name (struct dp_part *dp, int32_t num, char *name, size_t sz)
-{
- size_t i;
-
- assert (name);
-
- i = snprintf (name, sz, "%s/%02x/%02x/%02x/%02x",
- DP_NAME(dp),
- (unsigned int) (num >> 24) & 0xff,
- (unsigned int) (num >> 16) & 0xff,
- (unsigned int) (num >> 8) & 0xff,
- (unsigned int) num & 0xff);
-
- if (i == -1 || i >= sz)
- return(-1);
- return 0;
-}
-
-int
-local_create_file (struct dp_part *dp, onode_opaque *o,
- struct mnode *n)
-{
- char name[MAXPATHLEN];
- char nodename[MAXPATHLEN];
- int fd, ret, i;
- struct stat sb;
-
- i = snprintf(nodename, sizeof(nodename), "%s/inodeXXXXXXXXXX",
- DP_NAME(dp));
- if (i == -1 || i >= sizeof(nodename))
- return(ENOMEM);
-
- fd = mkstemp(nodename);
- if (fd == -1)
- return errno;
- ret = fstat(fd, &sb);
- if (ret == -1) {
- close(fd);
- unlink(nodename);
- return errno;
- }
-
- if (n) {
- n->fd = fd;
- n->sb = sb;
- n->flags.fdp = TRUE;
- n->flags.sbp = TRUE;
- } else {
- close(fd);
- }
-
-
-
- i = snprintf(name, sizeof(name), "%s/%02x", DP_NAME(dp),
- (unsigned int) (sb.st_ino >> 24) & 0xff);
- if (i == -1 || i >= sizeof(name)) {
- ret = ENOMEM
- goto bad;
- }
- mkdir(name, 0700);
- i = snprintf(name, sizeof(name), "%s/%02x/%02x", DP_NAME(dp),
- (unsigned int) (sb.st_ino >> 24) & 0xff,
- (unsigned int) (sb.st_ino >> 16) & 0xff);
- if (i == -1 || i >= sizeof(name)) {
- ret = ENOMEM
- goto bad;
- }
-
- mkdir(name, 0700);
- i = snprintf(name, sizeof(name), "%s/%02x/%02x/%02x", DP_NAME(dp),
- (unsigned int) (sb.st_ino >> 24) & 0xff,
- (unsigned int) (sb.st_ino >> 16) & 0xff,
- (unsigned int) (sb.st_ino >> 8) & 0xff);
- if (i == -1 || i >= sizeof(name)) {
- ret = ENOMEM
- goto bad;
- }
- if (mkdir(name, 0700) == -1) {
- ret = errno;
- goto bad;
- }
- if (local_create_name (dp, sb.st_ino, name, sizeof(name)) == -1) {
- ret = ENOMEM;
- goto bad;
- }
-
- ret = rename(nodename, name);
- if (ret < 0) {
- ret = errno;
- goto bad;
- }
-
- ret = local_ino2opaque (&sb.st_ino, o);
- if (ret) {
- ret = errno;
- unlink (name);
- return ret;
- }
- return 0;
- bad:
- unlink(nodename);
- return(ret);
-
-}
-
diff --git a/usr.sbin/afs/src/milko/lib/vld/debug.c b/usr.sbin/afs/src/milko/lib/vld/debug.c
deleted file mode 100644
index f0fde365146..00000000000
--- a/usr.sbin/afs/src/milko/lib/vld/debug.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <config.h>
-
-RCSID("$KTH: debug.c,v 1.2 2000/10/03 00:18:46 lha Exp $");
-
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <fs.h>
-
-#include <mlog.h>
-#include <mdebug.h>
-
-/*
- * Logging
- */
-
-struct units milko_deb_units[] = {
- { "all", MDEBALL },
- { "almost-all", MDEBALL },
- { "errors", MDEBERROR },
- { "warnings", MDEBWARN },
- { "voldb", MDEBVOLDB },
- { "vld", MDEBVLD },
- { "salvage", MDEBSALVAGE },
- { "fs", MDEBFS },
- { "default", MDEFAULT_LOG },
- { "ropa", MDEBROPA },
- { "none", 0 },
- { NULL }
-};
diff --git a/usr.sbin/afs/src/milko/lib/vld/fvol.c b/usr.sbin/afs/src/milko/lib/vld/fvol.c
deleted file mode 100644
index d7285a4dbde..00000000000
--- a/usr.sbin/afs/src/milko/lib/vld/fvol.c
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * Copyright (c) 1999, 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sfvol_private.h>
-
-RCSID("$arla: fvol.c,v 1.3 2000/10/03 00:18:51 lha Exp $");
-
-/*
- * Description:
- * fvol is a simple volume to read-only files.
- * It stores the complete filenames in a flat database.
- */
-
-struct fvol {
- int fd;
- fbuf the_fbuf;
-};
-
-static int
-getfilename (struct fvol *f, int32_t off, char **name);
-
-static int
-opaque2num (onode_opaque *opaque, int32_t *num)
-{
- char *c;
-
- if (opaque->size < sizeof(*num) + 1)
- return EINVAL;
-
- c = (char *)opaque->data;
- if (*c != 'F')
- return EINVAL;
-
- c++;
- memcpy (num, c, sizeof (*num));
- *num = ntohl(*num);
- return 0;
-}
-
-static int
-num2opaque (int32_t num, onode_opaque *opaque)
-{
- unsigned char *ptr = opaque->data;
- num = htonl(num);
-
- opaque->size = sizeof (int32_t) + 1;
-
- *ptr = 'F';
- ptr++;
-
- memcpy (ptr, &num, sizeof (num));
- return 0;
-}
-
-/*
- *
- */
-
-
-int
-fvol_offset2opaque (int32_t offset, onode_opaque *opaque)
-{
- return num2opaque (offset, opaque);
-}
-
-
-/*
- *
- */
-
-static int
-getfilename (struct fvol *f, int32_t off, char **name)
-{
- unsigned char *buf;
-
- assert (f && name);
-
- buf = (unsigned char *) fbuf_buf (&f->the_fbuf);
-
- if (off > fbuf_len(&f->the_fbuf) - 1)
- return ENOENT;
-
- *name = buf + off;
- return 0;
-}
-/*
- *
- */
-
-int
-fvol_addfile (struct fvol *f, const char *name, int32_t *off)
-{
- size_t len = strlen(name);
- char *ptr;
- int ret;
-
- *off = fbuf_len(&f->the_fbuf);
- ptr = ((unsigned char *)fbuf_buf((&f->the_fbuf))) + *off;
-
- ret = fbuf_truncate (&f->the_fbuf, *off + len + 1);
- assert (ret == 0);
-
- strcpy (ptr, name);
-
- return 0;
-}
-
-static void
-create_fvol_name (struct dp_part *dp, int32_t volid, char *name, size_t len)
-{
- snprintf (name, len, "%s/fvol-db-%d",
- DP_NAME(dp),
- volid);
-
-}
-
-/*
- * Create a fvol and return it in `vol' that is generic volume.
- * ignore the flags.
- */
-
-static int
-fvol_open (struct dp_part *part, int32_t volid, int flags,
- void **data)
-{
- char p[MAXPATHLEN];
- struct fvol *f;
- int ret, openf;
- int32_t magic;
- struct stat sb;
- fbuf_flags fflags;
-
- *data = NULL;
-
- create_fvol_name (part, volid, p, sizeof(p));
-
- f = malloc (sizeof(*f));
- if (f == NULL)
- return EINVAL;
-
- if ((VOLOP_CREATE & flags) == VOLOP_CREATE) {
- fflags = FBUF_READ|FBUF_WRITE|FBUF_PRIVATE;
- openf = O_RDWR|O_CREAT;
- } else {
- fflags = FBUF_READ|FBUF_WRITE|FBUF_SHARED;
- openf = O_RDWR;
- }
-
- f->fd = open (p, openf, 0600);
- if (f->fd < 0) {
- ret = errno;
- free (f);
- return ret;
- }
-
- if ((VOLOP_CREATE & flags) == VOLOP_CREATE) {
- magic = htonl(FVOL_MAGIC1);
- ret = write (f->fd, &magic, sizeof (magic));
- if (ret != sizeof (magic)) {
- ret = errno;
- close (f->fd);
- free (f);
- }
- sb.st_size = sizeof (magic);
- } else {
- ret = read (f->fd, &magic, sizeof (magic));
- if (ret != sizeof (magic)) {
- ret = errno;
- close (f->fd);
- free (f);
- return ret;
- }
-
- if (htonl(magic) != FVOL_MAGIC1) {
- close (f->fd);
- free (f);
- return EINVAL;
- }
-
- ret = fstat (f->fd, &sb);
- assert (ret == 0);
- }
- ret = fbuf_create (&f->the_fbuf, f->fd, sb.st_size, fflags);
- assert (ret == 0);
-
- *data = f;
- return 0;
-}
-
-/*
- * free all fvol related to the volume `vol'.
- */
-
-void
-fvol_free_i (struct fvol *f)
-{
- fbuf_end (&f->the_fbuf);
- close (f->fd);
- free (f);
-}
-
-/*
- * create a inode on `vol', return onode_opaque in `o'.
- */
-
-static int
-fvol_icreate (volume_handle *vol, onode_opaque *o, node_type type,
- struct mnode *n)
-{
- int ret;
-
- switch (type) {
- case NODE_VOL:
- case NODE_META:
- case NODE_DIR:
- ret = local_create_file (vol->dp, o, n);
- break;
- case NODE_REG:
- o->size= 0;
- memset (o->data, 0, sizeof (o->data));
- ret = 0;
- break;
- default:
- err(-1, "fvol_icreate: bad type %d\n", type);
- }
- return ret;
-}
-
-/*
- * open `o' in `vol' with open(2) `flags', return filedescriptor in `fd'
- */
-
-static int
-fvol_iopen (volume_handle *vol, onode_opaque *o, int flags, int *fd)
-{
- char *name;
- int32_t num;
- int ret;
-
- if (local_opaquep (o))
- return local_open_file (vol->dp, o, flags, fd);
-
- ret = opaque2num (o, &num);
- if (ret) return ret;
-
- ret = getfilename ((struct fvol *) vol->data, num, &name);
- if (ret) return ret;
-
- ret = open (name, O_RDONLY, 0600);
- if (ret < 0)
- return errno;
-
- *fd = ret;
- return 0;
-}
-
-static int
-fvol_unlink (volume_handle *vol, onode_opaque *o)
-{
- return EROFS;
-}
-
-/*
- *
- */
-
-static void
-fvol_free (volume_handle *vol)
-{
- if (vol->data)
- fvol_free_i ((struct fvol *)vol->data);
-}
-
-/*
- *
- */
-
-int
-fvol_create_volume (struct dp_part *dp, int32_t volid, struct fvol **f)
-{
- return fvol_open (dp, volid, VOLOP_CREATE, (void **) f);
-}
-
-/*
- *
- */
-
-static int
-fvol_remove (volume_handle *vol)
-{
- char p[MAXPATHLEN];
- int ret;
-
- create_fvol_name (vol->dp, vol->vol, p, sizeof(p));
- ret = unlink(p);
- if (ret) return ret;
-
- if (vol->data)
- fvol_free_i ((struct fvol *)vol->data);
- return 0;
-}
-
-
-/*
- *
- */
-
-vol_op fvol_volume_ops = {
- "fvol",
- fvol_open,
- fvol_free,
- fvol_icreate,
- fvol_iopen,
- fvol_unlink,
- fvol_remove
-};
-
diff --git a/usr.sbin/afs/src/milko/lib/vld/fvol.h b/usr.sbin/afs/src/milko/lib/vld/fvol.h
deleted file mode 100644
index 0b7d5e63b5b..00000000000
--- a/usr.sbin/afs/src/milko/lib/vld/fvol.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * $arla: fvol.h,v 1.3 2000/10/03 00:18:56 lha Exp $
- */
-
-#define FVOL_MAGIC1 0x1132
-
-struct fvol;
-
-int fvol_create_volume (struct dp_part *dp, int32_t volid,
- struct fvol **f);
-int fvol_addfile (struct fvol *f, const char *name, int32_t *off);
-void fvol_free_i (struct fvol *vol);
-int fvol_offset2opaque (int32_t offset, onode_opaque *opaque);
-
-extern vol_op fvol_volume_ops;
-
diff --git a/usr.sbin/afs/src/milko/lib/vld/glue.c b/usr.sbin/afs/src/milko/lib/vld/glue.c
deleted file mode 100644
index c85f4334ac0..00000000000
--- a/usr.sbin/afs/src/milko/lib/vld/glue.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Copyright (c) 1999, 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * This is glue between voldb and some vol-layer parts when there
- * isn't a clean way to create them.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <stdio.h>
-
-#include <assert.h>
-#include <dirent.h>
-
-#include <vldb.h>
-
-#include <voldb.h>
-#include <vld.h>
-#include <vld_ops.h>
-
-#include <vstatus.h>
-#include <voldb.h>
-#include <fvol.h>
-
-#include <mdir.h>
-#include <err.h>
-#include <errno.h>
-
-RCSID("$arla: glue.c,v 1.4 2000/10/03 00:19:01 lha Exp $");
-
-/*
- *
- */
-
-static int
-add_entry (volume_handle *vol, const char *path, int32_t offset,
- struct mnode *parent, AFSFid *fid,
- struct stat *sb, int type, const char *name)
-{
- int ret;
- AFSStoreStatus ss;
- struct mnode *child;
-
- memset (&ss, 0, sizeof(ss));
- ss.Mask = SS_MODTIME|SS_OWNER|SS_GROUP|SS_MODEBITS;
- ss.ClientModTime = sb->st_mtime;
- ss.UnixModeBits = sb->st_mode;
- ss.Owner = sb->st_uid;
- ss.Group = sb->st_gid;
-
- ret = vld_create_entry (vol, parent, fid, type, &ss, &child, NULL);
- assert (ret == 0);
-
- if (type == TYPE_FILE || type == TYPE_LINK) {
- onode_opaque opaque;
-
- fvol_offset2opaque (offset, &opaque);
-
- ret = vld_set_onode (vol, fid->Vnode, &opaque, NULL);
- assert (ret == 0);
- }
-
- ret = mdir_creat (parent, name, *fid);
- assert (ret == 0);
-
- return 0;
-}
-
-static int
-add_file (volume_handle *vol, const char *path,
- struct mnode *parent, AFSFid *fid, struct stat *sb,
- int type, const char *name)
-{
- int ret;
- int32_t offset;
-
- ret = fvol_addfile ((struct fvol *)vol->data, path, &offset);
- if (ret) return ret;
-
- ret = add_entry (vol, path, offset, parent, fid, sb, type, name);
- if (ret)
- return ret;
-
- return 0;
-}
-
-/*
- *
- */
-
-#if 0
-#ifndef S_ISLNK
-#ifdef S_IFLNK
-#define S_ISLNK(mode) (((mode) & S_IFLNK) == S_IFLNK)
-#endif /* S_IFLNK */
-#define S_ISLNK(mode) 0
-#endif /* I_ISLNK */
-#endif
-
-static int
-add_tree (volume_handle *vol, struct mnode *parent, const char *name)
-{
- struct voldb_entry e;
- char p[MAXPATHLEN];
- struct dirent *dp;
- struct stat sb;
- int ret, fd;
- AFSFid fid;
- DIR *dir;
-
- if (parent->flags.fdp == FALSE) {
- ret = voldb_get_entry (vol->db[0],
- dir_afs2local (parent->fid.Vnode),
- &e);
- if (ret) return ret;
- parent->flags.fdp = TRUE;
-
- ret = VOLOP_IOPEN(vol,&e.u.dir.ino, O_RDWR, &fd);
- if (ret)
- return ret;
- }
-
- dir = opendir (name);
- if (dir == NULL) {
- mnode_free (parent, FALSE);
- return errno;
- }
-
- while ((dp = readdir (dir)) != NULL) {
-
- if (strcmp (dp->d_name, ".") == 0
- || strcmp (dp->d_name, "..") == 0)
- continue;
-
- snprintf (p, sizeof(p), "%s/%s", name, dp->d_name);
-
- ret = stat (p, &sb);
- if (ret < 0) {
- mnode_free (parent, FALSE);
- return errno;
- }
-
- if (S_ISDIR(sb.st_mode)) {
- struct mnode *child_m;
-
- add_file (vol, p, parent, &fid, &sb, TYPE_DIR,
- dp->d_name);
- ret = mnode_find (&fid, &child_m);
- assert (ret == 0);
-
- ret = add_tree (vol, child_m, p);
- assert (ret == 0);
- } else if (S_ISREG(sb.st_mode)) {
- ret = add_file (vol, p, parent, &fid, &sb, TYPE_FILE,
- dp->d_name);
- assert (ret == 0);
- } else if (S_ISLNK(sb.st_mode)) {
- ret = add_file (vol, p, parent, &fid, &sb, TYPE_LINK,
- dp->d_name);
- assert (ret == 0);
- } else {
- printf ("ignoring %s\n", p);
- }
- }
- closedir (dir);
- mnode_free (parent, FALSE);
- return 0;
-}
-
-int
-vld_fvol_create_volume_ondisk (struct dp_part *dp, int32_t volid,
- const char *path)
-{
- volume_handle *vol;
- AFSFid fid;
- struct mnode *m;
- int ret;
-
- ret = vld_create_volume (dp, volid, "foo", VLD_FVOL, ROVOL, 0);
- if (ret)
- return ret;
-
- ret = vld_open_volume_by_num (dp, volid, &vol);
- if (ret)
- return ret;
-
- ret = vld_db_uptodate (vol);
- assert (ret == 0);
-
- fid.Volume = volid;
- fid.Vnode = fid.Unique = 1;
-
- ret = mnode_find (&fid, &m);
- assert (ret == 0);
- ret = add_tree (vol, m, path);
- assert (ret == 0);
-
- vld_free (vol);
-
- return ret;
-}
diff --git a/usr.sbin/afs/src/milko/lib/vld/mdir.c b/usr.sbin/afs/src/milko/lib/vld/mdir.c
deleted file mode 100644
index 4f63c8c9c99..00000000000
--- a/usr.sbin/afs/src/milko/lib/vld/mdir.c
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Interface to fdir directory handling routines
- */
-
-#include <config.h>
-
-RCSID("$arla: mdir.c,v 1.14 2002/03/06 22:43:01 tol Exp $");
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/errno.h>
-#include <assert.h>
-#include <unistd.h>
-
-#include <fs.h>
-#include <rx/rx.h>
-#include <fbuf.h>
-#include <fdir.h>
-
-#include <mdir.h>
-
-
-int
-mdir_lookup (struct mnode *node, const char *name, AFSFid *file)
-{
- fbuf the_fbuf;
- VenusFid dir, fid;
- int ret, saved_ret;
-
- assert (node->flags.sbp);
- assert (node->flags.fdp);
-
- dir.Cell = 0;
- dir.fid = node->fid;
-
- ret = fbuf_create (&the_fbuf, node->fd, node->sb.st_size,
- FBUF_READ|FBUF_PRIVATE);
- if (ret)
- return ret;
-
- saved_ret = fdir_lookup (&the_fbuf, &dir, name, &fid);
-
- ret = fbuf_end (&the_fbuf);
- if (ret)
- return ret;
-
- *file = fid.fid;
-
- return saved_ret;
-}
-
-int
-mdir_emptyp (struct mnode *node)
-{
- fbuf the_fbuf;
- int ret, saved_ret;
-
- assert (node->flags.sbp);
- assert (node->flags.fdp);
-
- ret = fbuf_create (&the_fbuf, node->fd, node->sb.st_size,
- FBUF_READ|FBUF_PRIVATE);
- if (ret)
- return ret;
-
- saved_ret = fdir_emptyp (&the_fbuf);
-
- ret = fbuf_end (&the_fbuf);
- if (ret)
- return ret;
-
- return saved_ret;
-}
-
-int
-mdir_readdir (struct mnode *node,
- int (*func)(VenusFid *, const char *, void *),
- void *arg,
- VenusFid dir)
-{
- fbuf the_fbuf;
- int ret, saved_ret;
-
- assert (node->flags.sbp);
- assert (node->flags.fdp);
-
- ret = fbuf_create (&the_fbuf, node->fd, node->sb.st_size,
- FBUF_READ|FBUF_PRIVATE);
- if (ret)
- return ret;
-
- saved_ret = fdir_readdir (&the_fbuf, func, arg, dir, NULL);
-
- ret = fbuf_end (&the_fbuf);
- if (ret)
- return ret;
-
- return saved_ret;
-}
-
-
-int
-mdir_creat (struct mnode *node,
- const char *filename,
- AFSFid fid)
-{
- fbuf the_fbuf;
- int ret, saved_ret;
- int32_t len;
-
- assert (node->flags.sbp);
- assert (node->flags.fdp);
-
- ret = fbuf_create (&the_fbuf, node->fd, node->sb.st_size,
- FBUF_READ|FBUF_WRITE|FBUF_SHARED);
- if (ret)
- return ret;
-
- saved_ret = fdir_creat (&the_fbuf, filename, fid);
-
- if (ret == 0) {
- len = fbuf_len (&the_fbuf);
- mnode_update_size (node, &len);
- }
-
- ret = fbuf_end (&the_fbuf);
- if (ret)
- return ret;
-
- return saved_ret;
-}
-
-
-int
-mdir_remove (struct mnode *node,
- const char *name)
-{
- fbuf the_fbuf;
- int ret, saved_ret;
- int32_t len;
-
- assert (node->flags.sbp);
- assert (node->flags.fdp);
-
- ret = fbuf_create (&the_fbuf, node->fd, node->sb.st_size,
- FBUF_READ|FBUF_WRITE|FBUF_SHARED);
- if (ret)
- return ret;
-
- saved_ret = fdir_remove (&the_fbuf, name, NULL);
-
- if (ret == 0) {
- len = fbuf_len (&the_fbuf);
- mnode_update_size (node, &len);
- }
-
- ret = fbuf_end (&the_fbuf);
- if (ret)
- return ret;
-
- return saved_ret;
-}
-
-int
-mdir_mkdir (struct mnode *node,
- AFSFid dot,
- AFSFid dot_dot)
-{
- fbuf the_fbuf;
- int ret, saved_ret;
- int32_t len;
-
- assert (node->flags.sbp);
- assert (node->flags.fdp);
-
- ret = fbuf_create (&the_fbuf, node->fd, node->sb.st_size,
- FBUF_READ|FBUF_WRITE|FBUF_SHARED);
- if (ret)
- return ret;
-
- saved_ret = fdir_mkdir (&the_fbuf, dot, dot_dot);
-
- if (ret == 0) {
- len = fbuf_len (&the_fbuf);
- mnode_update_size (node, &len);
- }
-
- ret = fbuf_end (&the_fbuf);
- if (ret)
- return ret;
-
- return saved_ret;
-}
-
-int
-mdir_rename(struct mnode *dir1, const char *name1, int32_t *len1,
- struct mnode *dir2, const char *name2, int32_t *len2)
-{
- fbuf origfbuf;
- fbuf newfbuf;
- fbuf *newfbufP = &newfbuf;
- VenusFid child, origVFid;
- int ret, dirp;
- int same_dir = FALSE;
-
- origVFid.Cell = 0;
- origVFid.fid = dir1->fid;
-
- ret = fbuf_create (&origfbuf, dir1->fd, dir1->sb.st_size,
- FBUF_READ|FBUF_WRITE|FBUF_SHARED);
- if (ret)
- return ret;
-
- ret = fdir_lookup(&origfbuf, &origVFid, name1, &child);
- if (ret) {
- fbuf_end (&origfbuf);
- return ret;
- }
-
- dirp = afs_dir_p (child.fid.Vnode);
-
- if (dir1 == dir2) {
- newfbufP = &origfbuf;
- same_dir = TRUE;
- } else {
- ret = fbuf_create (&newfbuf, dir2->fd,
- dir2->sb.st_size,
- FBUF_READ|FBUF_WRITE|FBUF_SHARED);
- if (ret) {
- fbuf_end (&origfbuf);
- return ret;
- }
- }
-
- {
- VenusFid sentenced_file;
- VenusFid dir;
-
- dir.fid = dir2->fid;
- dir.Cell = 0;
-
- if (fdir_lookup(newfbufP, &dir, name2, &sentenced_file) == ENOENT) {
- ret = fdir_creat (newfbufP, name2, child.fid);
- if (ret)
- goto out1;
-
- } else {
- if (afs_dir_p (sentenced_file.fid.Vnode) != dirp) { /* XXX check properly */
- ret = EISDIR;
- goto out1;
- }
-
- if (dirp && fdir_emptyp(newfbufP) != TRUE) {
- ret = ENOTEMPTY;
- goto out1;
- }
-
- ret = fdir_changefid(newfbufP, name2, &child);
- if (ret)
- goto out1;
- }
- }
-
- ret = fdir_remove (&origfbuf, name1, NULL);
- if (ret == 0) {
- *len1 = fbuf_len (&origfbuf);
- if (!same_dir)
- *len2 = fbuf_len (newfbufP);
- }
-
- out1:
- fbuf_end (&origfbuf);
- if (!same_dir) {
- fbuf_end (&newfbuf);
- }
-
- return ret;
-}
-
-int
-mdir_changefid(struct mnode *dir, const char *name, AFSFid fid) {
- fbuf the_fbuf;
- VenusFid vfid;
- int ret, saved_ret;
- int32_t len;
-
- assert (dir->flags.sbp);
- assert (dir->flags.fdp);
-
- vfid.Cell = 0;
- vfid.fid = fid;
-
- ret = fbuf_create (&the_fbuf, dir->fd, dir->sb.st_size,
- FBUF_READ|FBUF_WRITE|FBUF_SHARED);
- if (ret)
- return ret;
-
- saved_ret = fdir_changefid (&the_fbuf, name, &vfid);
-
- if (ret == 0) {
- len = fbuf_len (&the_fbuf);
- mnode_update_size (dir, &len);
- }
-
- ret = fbuf_end (&the_fbuf);
- if (ret)
- return ret;
-
- return saved_ret;
-}
diff --git a/usr.sbin/afs/src/milko/lib/vld/mdir.h b/usr.sbin/afs/src/milko/lib/vld/mdir.h
deleted file mode 100644
index 3f69f367430..00000000000
--- a/usr.sbin/afs/src/milko/lib/vld/mdir.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: mdir.h,v 1.8 2002/03/06 22:43:02 tol Exp $ */
-
-/*
- * Interface to fdir directory handling routines
- */
-
-/* $arla: mdir.h,v 1.8 2002/03/06 22:43:02 tol Exp $ */
-
-#ifndef _MDIR_H_
-#define _MDIR_H_
-
-#include <fs.h>
-#include <mnode.h>
-
-int
-mdir_lookup (struct mnode *node, const char *name, AFSFid *file);
-
-int
-mdir_emptyp (struct mnode *node);
-
-int
-mdir_readdir (struct mnode *node,
- int (*func)(VenusFid *, const char *, void *),
- void *arg,
- VenusFid dir);
-
-int
-mdir_creat (struct mnode *node,
- const char *filename,
- AFSFid fid);
-
-int
-mdir_remove (struct mnode *node,
- const char *name);
-
-int
-mdir_mkdir (struct mnode *node,
- AFSFid dot,
- AFSFid dot_dot);
-
-int
-mdir_rename(struct mnode *dir1, const char *name1, int32_t *len1,
- struct mnode *dir2, const char *name2, int32_t *len2);
-
-int
-mdir_changefid(struct mnode *dir, const char *name, AFSFid fid);
-
-#endif /* _MDIR_H_ */
diff --git a/usr.sbin/afs/src/milko/lib/vld/mnode.c b/usr.sbin/afs/src/milko/lib/vld/mnode.c
deleted file mode 100644
index f37761e02f8..00000000000
--- a/usr.sbin/afs/src/milko/lib/vld/mnode.c
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * Copyright (c) 1999 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * A module for caching of mnodes.
- *
- * Mnodes contain unix and afs structs to to aid in the conversion
- * inbeteen. It also has the feature that data is never allocated.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-RCSID("$arla: mnode.c,v 1.11 2001/11/06 16:03:19 tol Exp $");
-
-#include <sys/types.h>
-#include <stdio.h>
-
-#include <assert.h>
-
-#include <roken.h>
-#include <err.h>
-
-#include <list.h>
-#include <hash.h>
-
-#include <mnode.h>
-
-#include <mdebug.h>
-#include <mlog.h>
-
-
-List *mnode_lru; /* least recently used on tail, ref == 0 */
-
-Hashtab *mnode_htab; /* hash of all valid nodes */
-
-unsigned long mnode_nodes; /* number of nodes in system */
-unsigned long mnode_numfree; /* number of free nodes in system */
-
-/*
- * find out if two nodes `n1' and `n2' are the same
- */
-
-static int
-mnode_cmp (void *n1, void *n2)
-{
- struct mnode *rn1 = (struct mnode *)n1;
- struct mnode *rn2 = (struct mnode *)n2;
-
- return rn1->fid.Volume != rn1->fid.Volume
- || rn1->fid.Vnode != rn2->fid.Vnode
- || rn1->fid.Unique != rn2->fid.Unique;
-}
-
-/*
- * calculate a uniq hashvalue for `node'
- */
-
-static unsigned
-mnode_hash(void *node)
-{
- struct mnode *n = (struct mnode *)node;
- return n->fid.Volume + n->fid.Vnode;
-}
-
-/*
- * The init function for the mnode cache
- */
-
-void
-mnode_init (unsigned num)
-{
- struct mnode *nodes = calloc (sizeof(struct mnode), num);
- int i;
-
- mnode_numfree = mnode_nodes = num;
-
- if (nodes == NULL)
- errx (1, "mnode_init: calloc failed");
-
- mnode_lru = listnew();
- if (mnode_lru == NULL)
- errx (1, "mnode_init: listnew returned NULL");
-
- for (i = 0; i < num ;i++) {
- nodes[i].li = listaddhead (mnode_lru, &nodes[i]);
- assert(nodes[i].li);
- }
- mnode_htab = hashtabnew (num * 2, /* XXX */
- mnode_cmp,
- mnode_hash);
- if (mnode_htab == NULL)
- errx (1, "mnode_init: hashtabnew returned NULL");
-}
-
-/*
- * reset a mnode `res' to a new `fid'
- */
-
-static void
-reset_node (struct mnode *n, const AFSFid *fid)
-{
- assert (n->ref == 0);
- if (n->flags.fdp) {
- close (n->fd);
- n->flags.fdp = FALSE;
- }
- memset (n, 0, sizeof (*n));
- n->fid = *fid;
-}
-
-/*
- * find the `fid' the the hashtable, if it isn't
- * there use an entry on the lru.
- *
- *
- * XXX fix end of nodes problem.
- */
-
-int
-mnode_find (const AFSFid *fid, struct mnode **node)
-{
- struct mnode ptr, *res = NULL;
-
- ptr.fid = *fid;
-
- while (res == NULL) {
- res = hashtabsearch (mnode_htab, &ptr);
-
- if (res) {
- if (res->flags.removedp == TRUE)
- return ENOENT;
-
- if (res->li)
- listdel (mnode_lru, res->li);
- if (res->ref == 0)
- mnode_numfree--;
- res->ref++;
- } else if (mnode_numfree != 0) {
- res = listdeltail (mnode_lru); assert (res);
- assert (res->ref == 0);
- hashtabdel (mnode_htab, res);
- reset_node (res, fid);
- hashtabadd (mnode_htab, res);
- res->ref++;
- } else {
- /* XXX */
- mlog_log (MDEBWARN,
- "mnode_find: no free nodes, had to malloc()");
-
- res = malloc(sizeof(struct mnode));
- if (res == NULL) {
- mlog_log (MDEBWARN,
- "mnode_find: malloc() failed");
- LWP_DispatchProcess(); /* Yield */
- continue;
- }
-
- reset_node (res, fid);
- hashtabadd (mnode_htab, res);
- res->ref++;
- }
- }
-
- assert(res->flags.removedp == FALSE);
-
- *node = res;
- res->li = listaddhead (mnode_lru, *node);
- return 0;
-}
-
-/*
- * Free the `node'. If the node has gone bad (something has failed
- * that shouldn't) its marked bad and things are uncached.
- */
-
-void
-mnode_free (struct mnode *node, Bool bad)
-{
- if (node->li)
- listdel (mnode_lru, node->li);
- /*
- bad -> reread
- 0 -> close
- */
-
- if (bad) {
- if (node->flags.fdp)
- close (node->fd);
- memset (&node->flags, 0, sizeof (node->flags));
- }
- if (--node->ref == 0) {
- if (node->flags.fdp) {
- close (node->fd);
- node->flags.fdp = FALSE;
- }
-
- if (node->flags.removedp == TRUE) {
- hashtabdel (mnode_htab, node);
- node->flags.removedp = FALSE;
- }
- mnode_numfree++;
- node->li = listaddtail (mnode_lru, node);
- } else
- node->li = listaddhead (mnode_lru, node);
-}
-
-/*
- *
- */
-
-void
-mnode_remove (const AFSFid *fid)
-{
- struct mnode ptr, *res;
-
- ptr.fid = *fid;
-
- res = hashtabsearch (mnode_htab, &ptr);
- if (res) {
- if (res->ref == 0 && res->flags.fdp) {
- close (res->fd);
- res->flags.fdp = FALSE;
- }
- if (res->li)
- listdel (mnode_lru, res->li);
- res->li = listaddhead (mnode_lru, res);
- res->flags.removedp = TRUE;
- }
-}
-
-/*
- * always update the node `n' to reflect the size `len' or
- * if `len' isn't given use the fd in `n'.
- */
-
-int
-mnode_update_size (struct mnode *n, int32_t *len)
-{
- int ret;
-
- if (len) {
- n->fs.Length = n->sb.st_size = *len;
- } else {
- assert (n->flags.fdp);
-
- ret = fstat (n->fd, &n->sb);
- if (ret)
- return errno;
- n->flags.sbp = TRUE;
- n->fs.Length = n->sb.st_size;
- }
-
- return 0;
-}
-
-/*
- * Update the size in `n' if the stat information in `n->sb' has
- * changed. If there is no stat information call ``vld_update_size''.
- */
-
-int
-mnode_update_size_cached (struct mnode *n)
-{
- if (n->flags.sbp == FALSE) {
- assert (n->flags.fdp);
- return mnode_update_size (n, NULL);
- }
-
- n->fs.Length = n->sb.st_size;
- return 0;
-}
-
diff --git a/usr.sbin/afs/src/milko/lib/vld/mnode.h b/usr.sbin/afs/src/milko/lib/vld/mnode.h
deleted file mode 100644
index 544a93646d9..00000000000
--- a/usr.sbin/afs/src/milko/lib/vld/mnode.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: mnode.h,v 1.9 2002/01/23 00:50:08 d95_mah Exp $ */
-
-#ifndef MILKO_MNODE_H
-#define MILKO_MNODE_H 1
-
-#include <sys/types.h>
-
-#include <fs.h>
-#include <pts.h>
-#include <voldb.h>
-
-#include <list.h>
-
-typedef enum { VOLOP_READ = 0x001, /* read file */
- VOLOP_WRITE = 0x002, /* write file */
- VOLOP_INSERT = 0x004, /* insert file */
- VOLOP_LOOKUP = 0x008, /* lookup fileentry */
- VOLOP_DELETE = 0x010, /* delete entry */
- VOLOP_LOCK = 0x020, /* lock file */
- VOLOP_ADMIN = 0x040, /* modify bits */
- VOLOP_GETSTATUS = 0x080, /* get status */
- VOLOP_NOCHECK = 0x100 /* do no check */
-} volop_flags ;
-
-struct mnode {
- int fd;
- int ref; /* reference counter */
- struct stat sb; /* the status of the node */
- AFSFetchStatus fs; /* fetchstatus */
- AFSFid fid; /* only valid if on hashtable */
- struct voldb_entry e; /* entry information */
- struct {
- unsigned usedp:1; /* if node is used */
- unsigned removedp:1; /* if node has been removed */
- unsigned fdp:1; /* if fd is open */
- unsigned sbp:1; /* if stat sb is valid */
- unsigned fsp:1; /* if afsfetchstatus fs is valid */
- unsigned ep:1; /* if voldb entry is valid */
- } flags;
- Listitem *li; /* where we are placed in the mnode_lru */
-};
-
-struct msec {
- struct fs_security_context *sec; /* security context */
- int32_t caller_access; /* access of caller */
- int32_t anonymous_access; /* anonymous access */
- volop_flags flags; /* what we want to do with the node */
- int loop; /* to detect loop */
-};
-
-struct fs_security_context {
- prlist *cps; /* current proctection set */
- int32_t uid; /* user id of caller */
- int superuser; /* is super user */
- int ref; /* reference counter */
-};
-
-void
-mnode_init (unsigned num);
-
-int
-mnode_find (const AFSFid *fid, struct mnode **node);
-
-void
-mnode_free (struct mnode *node, Bool bad);
-
-void
-mnode_remove (const AFSFid *fid);
-
-int
-mnode_update_size_cached (struct mnode *);
-
-int
-mnode_update_size (struct mnode *, int32_t *len);
-
-#endif /* MILKO_MNODE_H */
-
diff --git a/usr.sbin/afs/src/milko/lib/vld/salvage.c b/usr.sbin/afs/src/milko/lib/vld/salvage.c
deleted file mode 100644
index ce9bd5d2f7e..00000000000
--- a/usr.sbin/afs/src/milko/lib/vld/salvage.c
+++ /dev/null
@@ -1,801 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <config.h>
-
-RCSID("$arla: salvage.c,v 1.15 2002/03/06 22:43:02 tol Exp $");
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/errno.h>
-#include <assert.h>
-#include <unistd.h>
-
-#include <fs.h>
-#include <rx/rx.h>
-#include <fbuf.h>
-#include <fdir.h>
-
-#include <vld.h>
-#include <afs_dir.h>
-
-#include <mlog.h>
-#include <mdebug.h>
-
-#include <salvage.h>
-
-
-struct inodeinfo {
- struct inodeinfo *parentp, *childp, *siblingp;
- struct inodeinfo *lfnodes;
- int32_t inode_num;
- int32_t parent_num;
- int32_t parent_unique;
- int32_t filetype;
- int32_t num_indir;
- struct { /* misc dir related flags */
- unsigned dot:1; /* have a "." */
- unsigned dotdot:1; /* have a ".." */
- unsigned invalid_dot:1; /* . doesn't point to this node */
- unsigned invalid_dotdot:1; /* .. doesn't point to this node */
- unsigned no_data:1; /* this node doesn't have data */
- } flags;
- enum { IUNUSED = 0, /* not used */
- IFOUND, /* is used */
- ITREE, /* node-tree correct */
- IDIR, /* exists in a directory tree */
- IFREE } status;
-};
-
-enum { SALVAGE_RN_WRITE = 1, SALVAGE_RN_UNUSED = 2 };
-
-struct vinfo {
- unsigned nnodes; /* number of nodes in array */
- unsigned fsize; /* # of allocated file nodes */
- unsigned dsize; /* # of allocated dir nodes */
- struct inodeinfo **nodes; /* XXX add a hash */
-};
-
-/*
- *
- */
-
-static struct inodeinfo *
-find_node (struct vinfo *info, int32_t inode)
-{
- uint32_t i;
- assert (info);
-
- for (i = 0; i < info->nnodes; i++) {
- if (info->nodes[i]->inode_num == inode)
- return info->nodes[i];
- }
- return NULL;
-}
-
-/*
- * Allocate a new node, if there isn't room the the table make room
- * for it.
- */
-
-static struct inodeinfo *
-allocate_node (struct vinfo *info, int32_t ino, int type)
-{
- struct inodeinfo *n;
- unsigned oldsize, i;
-
- n = find_node (info, ino);
- assert (n == NULL);
- assert (info->nnodes >= info->fsize + info->dsize);
-
- if (info->nnodes == info->fsize + info->dsize) {
- oldsize = info->nnodes;
- if (info->nnodes == 0)
- info->nnodes = 1;
- info->nodes = erealloc (info->nodes,
- info->nnodes * 2 * sizeof(struct inodeinfo *));
- info->nnodes = info->nnodes * 2;
-
- for (i = oldsize; i < info->nnodes; i++) {
- n = emalloc (sizeof(struct inodeinfo));
- memset (n, 0, sizeof(struct inodeinfo));
- info->nodes[i] = n;
- }
- }
- n = info->nodes[info->fsize + info->dsize];
- switch (type) {
- case TYPE_FILE:
- ++info->fsize;
- break;
- case TYPE_DIR:
- ++info->dsize;
- break;
- default:
- abort();
- }
- return n;
-}
-
-/*
- *
- */
-
-static void
-free_vinfo (struct vinfo *info)
-{
- unsigned i;
-
- for (i = 0; i < info->nnodes; i++)
- free (info->nodes[i]);
- free (info->nodes);
-}
-
-
-/*
- *
- */
-
-static int
-opennode (volume_handle *vol, struct vinfo *info, struct inodeinfo *node,
- int (*func) (volume_handle *, struct vinfo *,
- struct inodeinfo *, int, size_t))
-{
- struct mnode *n;
- struct msec m;
- VenusFid fid;
- int ret;
-
- fid.Cell = 0;
- fid.fid.Volume = VLD_VOLH_NUM(vol);
- fid.fid.Vnode = node->inode_num;
- fid.fid.Unique = 0;
-
- mlog_log (MDEBSALVAGE, "opennode %u.%u",
- fid.fid.Volume, fid.fid.Vnode);
-
- memset (&n, 0, sizeof(n));
-
- mnode_find (&fid.fid, &n);
-
- m.flags = VOLOP_WRITE|VOLOP_GETSTATUS|VOLOP_NOCHECK;
-
- ret = vld_open_vnode (vol, n, &m);
- if (ret) {
- mlog_log (MDEBSALVAGE, "opennode %u.%u: failed to open node",
- fid.fid.Volume, fid.fid.Vnode);
- node->flags.no_data = 1;
- mnode_free (n, FALSE);
- return 1;
- }
-
- if (func) {
- ret = (*func) (vol, info, node, n->fd, n->sb.st_size);
- }
-
- mnode_free (n, FALSE);
- return ret;
-}
-
-/*
- *
- */
-
-#define CHECK_VALUE_EQ(check_val,val,string,modified) \
-do { \
- if ((val) != (check_val)) { \
- (check_val) = (val); \
- (modified) = 1; \
- mlog_log (MDEBSALVAGE, "%s had a errorous value resetting", string); \
- } \
-} while (0)
-
-/*
- *
- */
-
-static int
-check_value_bitmask(uint32_t *checkval, uint32_t val, uint32_t mask,
- const char *string)
-{
- int32_t newval;
-
- if ((mask & (*checkval)) & ~val) {
- newval = (*checkval) & (val | (~mask & (*checkval)));
- mlog_log (MDEBSALVAGE, "%s had a errorous value 0%o resetting to 0%o",
- string, *checkval, newval);
- *checkval = newval;
- return 1;
- }
- return 0;
-}
-
-/*
- *
- */
-
-static int
-read_nodes_dir (uint32_t num, struct voldb_entry *entry,
- struct vinfo *info, struct inodeinfo **ret_node)
-{
- struct inodeinfo *node;
- int mod = 0;
-
- assert (entry->type == TYPE_DIR);
-
- if (entry->u.dir.FileType == 0 ||
- entry->u.file.nextptr != VOLDB_ENTRY_USED)
- {
- mlog_log (MDEBSALVAGE, "%d is a unused node (dir)", num);
- return SALVAGE_RN_UNUSED;
- }
-
-
- CHECK_VALUE_EQ(entry->u.dir.InterfaceVersion,1, "InterfaceVersion",mod);
- mod |= check_value_bitmask(&entry->u.dir.UnixModeBits, 04777, 07777,
- "Unix dir rights");
-
- CHECK_VALUE_EQ(entry->u.dir.FileType,TYPE_DIR,"FileType",mod);
-
- node = allocate_node (info, dir_local2afs(num), TYPE_DIR);
- node->inode_num = dir_local2afs (num);
- node->parent_num = entry->u.dir.ParentVnode;
- node->parent_unique = entry->u.dir.ParentUnique;
- if (entry->u.dir.nextptr != VOLDB_ENTRY_USED)
- node->status = IUNUSED;
- else
- node->status = IFOUND;
- node->filetype = TYPE_DIR;
-
- *ret_node = node;
-
- if (mod)
- return SALVAGE_RN_WRITE;
- return 0;
-}
-
-/*
- *
- */
-
-static int
-read_nodes_file (uint32_t num, struct voldb_entry *entry,
- struct vinfo *info, struct inodeinfo **ret_node)
-{
- struct inodeinfo *node;
- int mod = 0;
-
- if (entry->u.file.FileType == 0 ||
- entry->u.file.nextptr != VOLDB_ENTRY_USED)
- {
- mlog_log (MDEBSALVAGE, "%d is a unused node (file)", num);
- return 0; /* XXX ? */
- }
-
- CHECK_VALUE_EQ(entry->u.file.InterfaceVersion,1, "InterfaceVersion",mod);
- /* Remove sgid and sticky bit */
- mod |= check_value_bitmask(&entry->u.file.UnixModeBits, 04777, 07777,
- "Unix file rights");
-
- switch (entry->u.file.FileType) {
- case TYPE_FILE:
- case TYPE_LINK:
- break;
- default:
- mlog_log (MDEBSALVAGE, "File type incorrect, resetting");
- entry->u.file.FileType = TYPE_FILE;
- mod |= 1;
- }
-
- node = allocate_node (info, file_local2afs(num), TYPE_FILE);
- node->inode_num = file_local2afs(num);
- node->parent_num = entry->u.file.ParentVnode;
- node->parent_unique = entry->u.file.ParentUnique;
- if (entry->u.file.nextptr != VOLDB_ENTRY_USED)
- node->status = IUNUSED;
- else
- node->status = IFOUND;
- node->filetype = entry->u.file.FileType;
-
- if (mod)
- return SALVAGE_RN_WRITE;
- return 0;
-}
-
-/*
- *
- */
-
-static int
-read_nodes (struct volume_handle *volh, struct voldb *db,
- uint32_t size, struct vinfo *info,
- int (*func) (uint32_t, struct voldb_entry *, struct vinfo *,
- struct inodeinfo **))
-{
- uint32_t i;
- int ret;
- int changed = 0;
- int check_data;
- struct inodeinfo *node;
-
- for (i = 0; i < size; i++) {
- struct voldb_entry entry;
-
- ret = voldb_get_entry (db, i, &entry);
- if (ret) {
- mlog_warn (MDEBSALVAGE, ret, "tree_connectivity: "
- "read_nodes: get_entry failed: %d.%d",
- voldb_get_volume(db), i);
- continue;
- }
-
- check_data = 0;
- node = NULL;
- ret = (*func) (i, &entry, info, &node);
- switch (ret) {
- case 0:
- check_data = 1;
- break;
- case SALVAGE_RN_UNUSED:
- break;
- case SALVAGE_RN_WRITE:
- ret = voldb_put_entry (db, i, &entry);
- if (ret) {
- mlog_warn (MDEBSALVAGE, ret, "tree_connectivity: "
- "read_nodes: put_entry failed %d.%d",
- voldb_get_volume(db), i);
- }
- changed = 1;
- check_data = 1;
- break;
- default:
- abort();
- }
- if (check_data && node) {
- ret = opennode (volh, info, node, NULL);
- if (ret) {
- mlog_log (MDEBSALVAGE,
- "reading node %u.%u: failed to open node",
- VLD_VOLH_NUM(volh), node->inode_num);
- node->flags.no_data = 1;
- }
- }
- }
- if (changed)
- voldb_flush (db);
- return 0;
-}
-
-/*
- *
- */
-
-static int
-remove_node (struct volume_handle *volh, struct inodeinfo *node)
-{
- uint32_t ino;
- struct voldb *db;
-
- if (afs_dir_p (node->inode_num)) {
- ino = dir_afs2local(node->inode_num);
- db = VLD_VOLH_DIR(volh);
- } else {
- ino = file_afs2local(node->inode_num);
- db = VLD_VOLH_FILE(volh);
- }
- return voldb_del_entry (db, ino, NULL);
-}
-
-/*
- *
- */
-
-struct dir_func_s {
- struct inodeinfo *parent;
- struct vinfo *info;
- fbuf *parent_fbuf;
- struct volume_handle *volh;
-};
-
-static int
-check_dir_func (VenusFid *fid, const char *name, void *arg)
-{
- struct dir_func_s *f = (struct dir_func_s *)arg;
- int ret;
-
- /*
- * XXX to make sure that the list node->childp and the content of
- * the directory is right
- */
-
- mlog_warnx (MDEBSALVAGE, "check_dir_func: %s %u", name, fid->fid.Vnode);
-
- if (strcmp (name, ".") == 0) {
- f->parent->flags.dot = 1;
- if (f->parent->inode_num != fid->fid.Vnode)
- f->parent->flags.invalid_dot = 1;
- } else if (strcmp (name, "..") == 0) {
- f->parent->flags.dotdot = 1;
- if (f->parent->parent_num != fid->fid.Vnode
- || f->parent->parent_unique != fid->fid.Unique)
- f->parent->flags.invalid_dotdot = 1;
- } else if (strncmp (name, ".__afs", 6) == 0) {
- struct inodeinfo *child;
- ret = fdir_remove (f->parent_fbuf, name, NULL);
- assert (ret == 0);
- child = find_node (f->info, fid->fid.Vnode);
- if (child)
- remove_node (f->volh, child);
- } else {
- struct inodeinfo *child;
-
- child = find_node (f->info, fid->fid.Vnode);
- if (child == NULL || child->flags.no_data) {
- mlog_log (MDEBSALVAGE,
- "name `%s' found in %d.%d w/o node, removing",
- name, fid->fid.Volume, f->parent->inode_num);
- ret = fdir_remove (f->parent_fbuf, name, NULL);
- if (ret != 0)
- mlog_log (MDEBSALVAGE,
- "removal of lost name `%s' failed in %d.%d with %d",
- name, fid->fid.Volume, f->parent->inode_num, ret);
- if (child)
- remove_node (f->volh, child);
- } else {
- child->status = IDIR;
-
- ++child->num_indir;
-
- if (strchr (name, '/')) {
- abort(); /* XXX check name better */
- }
- }
- }
- return 0;
-}
-
-/*
- *
- */
-
-static int
-check_content_dir_func (volume_handle *vol,
- struct vinfo *info,
- struct inodeinfo *node,
- int fd,
- size_t size)
-{
- VenusFid fid;
- fbuf the_fbuf;
- struct dir_func_s f;
- int ret;
-
- if ((size % AFSDIR_PAGESIZE) != 0) {
- mlog_log (MDEBSALVAGE, "check_content_dir_func: dir has wrong size");
- ret = ftruncate (fd, size / AFSDIR_PAGESIZE);
- if (ret != 0) {
- mlog_log (MDEBSALVAGE,
- "check_content_dir_func: ftruncate: %d",
- errno);
- return 1;
- }
- }
-
- if (node->inode_num == 1)
- node->status = IDIR;
-
- fid.Cell = 0;
- fid.fid.Volume = VLD_VOLH_NUM(vol);
-
- f.info = info;
- f.parent = node;
- f.parent_fbuf = &the_fbuf;
- f.volh = vol;
-
- ret = fbuf_create (&the_fbuf, fd, size,
- FBUF_READ|FBUF_WRITE|FBUF_SHARED);
-
- ret = fdir_readdir (&the_fbuf, check_dir_func, &f, fid, NULL);
- if (ret)
- mlog_log (MDEBSALVAGE, "check_content_dir_func: fbuf_readdir failed");
-
- fbuf_end (&the_fbuf);
- return ret;
-}
-
-/*
- * Check that the `node' in `volume' have a sane content.
- */
-
-static int
-check_dir (volume_handle *vol, struct vinfo *info, struct inodeinfo *node)
-{
- int ret;
-
- ret = opennode (vol, info, node, check_content_dir_func);
- if (ret) {
- mlog_log (MDEBSALVAGE, "check_dir failed with %d", ret);
- return 1;
- }
- return 0;
-}
-
-/*
- *
- */
-
-static int
-add_node_lf (struct volume_handle *volh,
- struct inodeinfo *node)
-{
- mlog_log (MDEBSALVAGE, "XXX add node to lost and found %u.%u",
- voldb_get_volume (VLD_VOLH_DIR(volh)), node->inode_num);
-#if 0
- /* XXX */
- abort();
-#endif
- return 0;
-}
-
-/*
- *
- */
-
-static int
-readd_node (struct volume_handle *volh,
- struct inodeinfo *node)
-{
- mlog_log (MDEBSALVAGE, "XXX add node to tree again %u.%u",
- voldb_get_volume (VLD_VOLH_DIR(volh)), node->inode_num);
-#if 0
- /* XXX */
- abort();
-#endif
- return 0;
-}
-
-/*
- *
- */
-
-static void
-find_and_readd_node (struct volume_handle *volh,
- struct vinfo *info,
- int foundnodes)
-{
- int i;
-
- for (i = 0; i < foundnodes; i++) {
- switch (info->nodes[i]->status) {
- case IDIR:
- if (info->nodes[i]->filetype == TYPE_DIR)
- /* XXX check tree consistency */
- ;
- /* XXX check linkcount */
- break;
- case ITREE:
- if (readd_node (volh, info->nodes[i]))
- add_node_lf (volh, info->nodes[i]);
- break;
- case IUNUSED:
- break;
- case IFOUND:
- default:
- abort();
- }
- }
-}
-
-/*
- *
- */
-
-static void
-mark_dir_node (struct volume_handle *volh,
- struct vinfo *info,
- int foundnodes)
-{
- int i;
-
- for (i = 0; i < foundnodes; i++) {
- switch (info->nodes[i]->status) {
- case IDIR:
- case ITREE:
- if (info->nodes[i]->filetype == TYPE_DIR)
- check_dir (volh, info, info->nodes[i]);
- break;
- case IUNUSED:
- break;
- case IFOUND:
- default:
- abort();
- }
- }
-}
-
-/*
- *
- */
-
-static void
-find_list_tree_nodes (struct volume_handle *volh,
- struct vinfo *info,
- int foundnodes)
-{
- int i;
- int db_flush = 0;
-
- for (i = 0; i < foundnodes; i++) {
- switch (info->nodes[i]->status) {
- case ITREE:
- if (info->nodes[i]->flags.no_data) {
- remove_node (volh, info->nodes[i]);
- db_flush = 1;
- }
- break;
- case IFOUND:
- /*
- * this is a lost node
- * XXX attach it to the lost+found directory
- */
-
- mlog_log (MDEBSALVAGE, "lost inode found");
-
- /* XXX make sure is on the lfnodes list */
-
- if (info->nodes[i]->flags.no_data) {
- remove_node (volh, info->nodes[i]);
- db_flush = 1;
- } else if (readd_node (volh, info->nodes[i])) {
- add_node_lf (volh, info->nodes[i]);
- }
-
- break;
- case IUNUSED:
- break;
- case IDIR:
- default:
- abort();
- }
- }
- if (db_flush)
- vld_db_flush (volh);
-}
-
-/*
- *
- */
-
-int
-salvage_volume (struct volume_handle *volh)
-{
- uint32_t dsize, fsize;
- uint32_t foundnodes;
- int ret, i;
- struct vinfo info;
- struct inodeinfo *lfnodes;
-
- memset (&info, 0, sizeof(info));
-
- /* XXX check volintInfo */
-
- ret = vld_db_uptodate (volh);
- if (ret) {
- mlog_warnx (MDEBERROR, "tree_connectity: vld_db_uptodate"
- "failed with %d on volume %u",
- ret, VLD_VOLH_NUM(volh));
- return ret;
- }
-
- ret = voldb_header_info(VLD_VOLH_DIR(volh), &dsize, NULL);
- if (ret) {
- mlog_warnx (MDEBERROR, "tree_connectity: voldb_header_info "
- "failed with %d on volume %u (dir)",
- ret, VLD_VOLH_NUM(volh));
- return ret;
- }
-
- ret = voldb_header_info(VLD_VOLH_FILE(volh), &fsize, NULL);
- if (ret) {
- mlog_warnx (MDEBERROR, "tree_connectity: voldb_header_info "
- "failed with %d on volume %u (file)",
- ret, VLD_VOLH_NUM(volh));
- return ret;
- }
-
- ret = read_nodes (volh,
- VLD_VOLH_DIR(volh),
- dsize,
- &info,
- read_nodes_dir);
- if (ret)
- abort(); /* XXX */
- ret = read_nodes (volh,
- VLD_VOLH_FILE(volh),
- fsize,
- &info,
- read_nodes_file);
- if (ret)
- abort(); /* XXX */
-
- mlog_log (MDEBSALVAGE,
- "tree_connectvity: status: found %d dirs, %d files",
- info.dsize, info.fsize);
-
- foundnodes = info.dsize + info.fsize;
-
- for (i = 0; i < foundnodes; i++) {
- struct inodeinfo *p, *n = info.nodes[i] ;
-
- /* Skip root node */
- if (i == 0) {
- n->status = ITREE;
- continue;
- }
-
- p = find_node (&info, n->parent_num);
- if (p == NULL) {
- mlog_log (MDEBSALVAGE, "tree_connectivity: lost node %u.%u",
- VLD_VOLH_NUM(volh), i);
- info.nodes[i]->lfnodes = lfnodes;
- lfnodes = info.nodes[i];
- } else {
- if (n->parentp) {
- struct inodeinfo **old_p = &n->parentp->childp;
-
- /*
- * Old parent, obviois something wrong. Let's remove
- * the node from the old parent.
- */
-
- mlog_log (MDEBSALVAGE, "tree_connectivity: have a old parent");
- while (*old_p != NULL || *old_p != n)
- old_p = &(*old_p)->siblingp;
- if (*old_p == NULL) /* Not on old parent\s child list, wrong */
- abort();
- *old_p = (*old_p)->siblingp;
- }
- n->status = ITREE;
- n->siblingp = p->childp;
- p->childp = n;
- n->parentp = p;
- }
- }
-
- find_list_tree_nodes (volh, &info, foundnodes);
- mark_dir_node (volh, &info, foundnodes);
- find_and_readd_node (volh, &info, foundnodes);
-
- free_vinfo (&info);
- return 0;
-}
-
diff --git a/usr.sbin/afs/src/milko/lib/vld/salvage.h b/usr.sbin/afs/src/milko/lib/vld/salvage.h
deleted file mode 100644
index f894d2586d7..00000000000
--- a/usr.sbin/afs/src/milko/lib/vld/salvage.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: salvage.h,v 1.2 2000/10/03 00:19:33 lha Exp $ */
-
-#ifndef MILKO_SALVAGE_H
-#define MILKO_SALVAGE_H 1
-
-int
-salvage_volume (struct volume_handle *volh);
-
-#endif /* MILKO_SALVAGE_H */
-
diff --git a/usr.sbin/afs/src/milko/lib/vld/sfvol_private.h b/usr.sbin/afs/src/milko/lib/vld/sfvol_private.h
deleted file mode 100644
index f6b7433a676..00000000000
--- a/usr.sbin/afs/src/milko/lib/vld/sfvol_private.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <atypes.h>
-
-#include <rx/rx.h>
-
-#include <pts.h>
-#include <dpart.h>
-#include <vld.h>
-
-#include <assert.h>
-
-#include <fvol.h>
-#include <svol.h>
-
-/*
- * Prototypes
- */
-
-int local_create_name (struct dp_part *dp, int32_t num,
- char *name, size_t sz);
-int local_create_file (struct dp_part *dp, onode_opaque *o,
- struct mnode *n);
-int local_open_file (struct dp_part *dp, onode_opaque *opaque,
- int flags, int *fd);
-int local_unlink_file (struct dp_part *dp, onode_opaque *o);
-Bool local_opaquep (onode_opaque *opaque);
-
diff --git a/usr.sbin/afs/src/milko/lib/vld/svol.c b/usr.sbin/afs/src/milko/lib/vld/svol.c
deleted file mode 100644
index 38ec9862f18..00000000000
--- a/usr.sbin/afs/src/milko/lib/vld/svol.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sfvol_private.h>
-
-RCSID("$arla: svol.c,v 1.3 2000/10/03 00:19:44 lha Exp $");
-
-/*
- * Description:
- * svol is a simple (and dumb (and slow)) implementation of volume-
- * operations. It store the files in a tree-structure where
- * inode-number is used as ``key'' to where the node is stored in
- * the tree.
- */
-
-/*
- * Create a svol and return it in `vol' that is generic volume.
- * ignore the flags.
- */
-
-static int
-svol_open (struct dp_part *part, int32_t volid, int flags,
- void **data)
-{
- *data = NULL;
-
- return 0;
-}
-
-/*
- * free all svol related to the volume `vol'.
- */
-
-static void
-svol_free (volume_handle *vol)
-{
- assert (vol->data == NULL);
-}
-
-/*
- * create a inode on `vol', return onode_opaque in `o'.
- */
-
-static int
-svol_icreate (volume_handle *vol, onode_opaque *o, node_type type,
- struct mnode *n)
-{
- return local_create_file (vol->dp, o, n);
-}
-
-/*
- * open `o' in `vol' with open(2) `flags', return filedescriptor in `fd'
- */
-
-static int
-svol_iopen (volume_handle *vol, onode_opaque *o, int flags, int *fd)
-{
- return local_open_file (vol->dp, o, flags, fd);
-}
-
-static int
-svol_unlink (volume_handle *vol, onode_opaque *o)
-{
- return local_unlink_file (vol->dp, o);
-}
-
-/*
- *
- */
-
-static int
-svol_remove (volume_handle *vol)
-{
- /*
- * We don't need to remove anything since we never created anything.
- * There might be reson to try and keed track of all nodes to be able
- * to remove lost nodes. But then, this wouldn't be the simple volume.
- */
-
- svol_free (vol);
- return 0;
-}
-
-/*
- *
- */
-
-vol_op svol_volume_ops = {
- "svol",
- svol_open,
- svol_free,
- svol_icreate,
- svol_iopen,
- svol_unlink,
- svol_remove
-};
diff --git a/usr.sbin/afs/src/milko/lib/vld/svol.h b/usr.sbin/afs/src/milko/lib/vld/svol.h
deleted file mode 100644
index f58f4100b38..00000000000
--- a/usr.sbin/afs/src/milko/lib/vld/svol.h
+++ /dev/null
@@ -1 +0,0 @@
-extern vol_op svol_volume_ops;
diff --git a/usr.sbin/afs/src/milko/lib/vld/vld.c b/usr.sbin/afs/src/milko/lib/vld/vld.c
deleted file mode 100644
index 93c75d69ce5..00000000000
--- a/usr.sbin/afs/src/milko/lib/vld/vld.c
+++ /dev/null
@@ -1,2526 +0,0 @@
-/*
- * Copyright (c) 1999 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: vld.c,v 1.63 2003/02/15 14:57:32 map Exp $ */
-
-#include <sys/types.h>
-#include <stdio.h>
-
-#include <assert.h>
-
-#include <rx/rx.h>
-
-#include <vldb.h>
-#include <pts.h>
-
-#include <voldb.h>
-#include <vld.h>
-#include <vld_ops.h>
-
-#include <vstatus.h>
-
-#include <svol.h>
-#include <fvol.h>
-
-#include <mdir.h>
-
-#include <err.h>
-
-#include <hash.h>
-#include <list.h>
-
-#include <mlog.h>
-#include <mdebug.h>
-
-#include <errno.h>
-
-/*
- * Local define and limitations
- */
-
-int vld_storestatus_to_ent (struct voldb_entry *e, const AFSStoreStatus *ss,
- struct msec *sec);
-static int vld_ent_to_fetchstatus (struct volume_handle *vol,
- struct voldb_entry *e,
- struct mnode *n);
-static void vld_set_author(struct voldb_entry *e, struct msec *m);
-static int vld_update_volsize (volume_handle *vol, int diff);
-static int vld_check_quota (volume_handle *vol, int diff);
-
-/*
- * Local variables
- */
-
-/* hashtable of volumes */
-static Hashtab *volume_htab = NULL;
-static int volume_htab_sz = 1024;
-
-/* lru for db in use */
-static List *db_lru = NULL;
-
-/* list of volumes to be able to do sysbackup and salvage */
-static List *vol_list = NULL;
-
-/* volume types */
-vol_op *backstoretypes[VLD_MAX_BACKSTORE_TYPES];
-
-/*
- * Useful macro's and short functions
- */
-
-#define VLD_VALID_BACKSTORETYPE(backstoretype) (!(backstoretype >= 0 && backstoretype < VLD_MAX_BACKSTORE_TYPES && backstoretypes[backstoretype] != NULL))
-
-#define ENTRY_DISK_SIZE 1
-#define DIR_DISK_SIZE 2
-
-static int
-VLD_VALID_VOLNAME(const char *volname)
-{
- while (volname && *volname) {
- if (!((*volname >= 'a' && *volname <= 'z') ||
- (*volname >= 'A' && *volname <= 'Z') ||
- (*volname >= '0' && *volname <= '9') ||
- *volname == '.'))
- return *volname;
- volname++;
- }
- return 0;
-}
-
-
-/*
- * Translate to real-name
- */
-
-const char *
-vld_backstoretype_name (int32_t backstoretype)
-{
- if (VLD_VALID_BACKSTORETYPE(backstoretype))
- return "UKWN";
-
- return backstoretypes[backstoretype]->name;
-}
-
-/*
- * Bootstrap
- */
-
-int
-vld_boot (void)
-{
- memset(backstoretypes, 0, sizeof (backstoretypes));
- backstoretypes[VLD_SVOL] = &svol_volume_ops;
- backstoretypes[VLD_FVOL] = &fvol_volume_ops;
- return 0;
-}
-
-/*
- * Free volume `vol'
- */
-
-void
-vld_free (volume_handle *vol)
-{
- if (--vol->ref == 0) {
- VOLOP_FREE(vol);
- if (vol->flags.voldbp) {
- voldb_close (VLD_VOLH_DIR(vol));
- voldb_close (VLD_VOLH_FILE(vol));
- vol->flags.voldbp = FALSE;
- } else {
- assert (VLD_VOLH_DIR(vol) == NULL);
- assert (VLD_VOLH_FILE(vol) == NULL);
- }
- dp_free (vol->dp);
- free (vol);
- }
-}
-
-/*
- * Ref `vol'
- */
-
-void
-vld_ref (volume_handle *vol)
-{
- assert (vol->ref);
- vol->ref++;
-}
-
-/*
- * create a `vol' from the bootstrap infomation in `vs'.
- */
-
-static int
-vstatus2volume_handle (vstatus *vs, struct dp_part *dp, volume_handle **vol)
-{
- volume_handle *v;
-
- assert (vs && dp && vol);
-
- v = malloc (sizeof(*v));
- if (v == NULL)
- return ENOMEM;
-
- memset (v, 0, sizeof(*v));
- v->ref = 1;
- v->vol = vs->volid;
- dp_ref (dp);
- v->dp = dp;
- memcpy (&v->sino, &vs->volinfoinode, sizeof(vs->volinfoinode));
- memcpy (&v->dino, &vs->dirinode, sizeof(vs->dirinode));
- memcpy (&v->fino, &vs->fileinode, sizeof(vs->fileinode));
- v->flags.infop = FALSE;
- v->flags.voldbp = FALSE;
- v->flags.offlinep = FALSE;
- v->voldbtype = vs->voldbtype;
- v->type = vs->bstype;
-
- *vol = v;
-
- return 0;
-}
-
-/*
- * Read in all partitions and register all volumes.
- */
-
-static void
-register_vols_cb (void *data, int fd)
-{
- struct dp_part *dp = (struct dp_part *)data;
- vstatus vs;
- int ret;
- volume_handle *vol;
-
- ret = vstatus_read (fd, &vs);
- if (ret)
- return;
-
- ret = vstatus2volume_handle (&vs, dp, &vol);
- if (ret) {
- mlog_log (MDEBERROR,
- "register_vols_cb: failed to convert vstatus");
- return;
- }
-
- ret = VOLOP_OPEN(vol->type, dp, vol->vol,
- VOLOP_NOFLAGS, &vol->data);
- if (ret) {
- mlog_log (MDEBERROR,
- "register_vols_cb: failed to open volume");
- vol->flags.attacherr = TRUE;
- } else {
- vol->flags.attacherr = FALSE;
- }
- vol->flags.offlinep = TRUE;
- vol->flags.salvaged = FALSE;
- vol->li = listaddtail (vol_list, vol);
- if (vol->li == NULL)
- errx (1, "register_vols_cb: listaddtail failed");
-
- hashtabadd (volume_htab, vol);
-
- return;
-}
-
-/*
- *
- */
-
-static int
-volume_cmp (void *ptr1, void *ptr2)
-{
- volume_handle *v1 = (volume_handle *) ptr1;
- volume_handle *v2 = (volume_handle *) ptr2;
-
- return v1->vol - v2->vol;
-}
-
-/*
- *
- */
-
-static unsigned
-volume_hash (void *ptr)
-{
- volume_handle *v = (volume_handle *) ptr;
-
- return v->vol;
-}
-
-/*
- *
- */
-
-int
-vld_init (void)
-{
- struct dp_part *dp;
- int ret, partnum, i;
-
-
- db_lru = listnew();
- if (db_lru == NULL)
- errx (1, "vld_init: db_lru == NULL");
-
- for (i = 0; i < 100 /* XXX */ ; i++)
- listaddhead (db_lru, NULL);
-
- vol_list = listnew();
- if (vol_list == NULL)
- errx (1, "vld_init: vol_list == NULL");
-
- volume_htab = hashtabnew(volume_htab_sz, volume_cmp, volume_hash);
- if (volume_htab == NULL)
- errx (1, "vld_init: volume_htab == NULL");
-
- for (partnum = 0; partnum < 'z'-'a'; partnum++) {
-
- ret = dp_create (partnum , &dp);
- if (ret) {
- warnx ("vld_init: dp_create(%d) returned %d", partnum, ret);
- continue;
- }
-
- ret = dp_findvol (dp, register_vols_cb, dp);
- if (ret)
- warnx ("vld_init: dp_findvol returned: %d", ret);
-
- dp_free (dp);
- }
- return 0;
-}
-
-struct iter_vol_s {
- int (*func) (volume_handle *vol, void *arg);
- void *arg;
-};
-
-static int
-iter_vol (List *list, Listitem *li, void *arg)
-{
- struct iter_vol_s *vof = (struct iter_vol_s *)arg;
- volume_handle *vol = listdata (li);
- int ret;
-
- vld_ref (vol);
- ret = (vof->func) (vol, vof->arg);
- vld_free (vol);
- return ret;
-}
-
-void
-vld_iter_vol (int (*func)(volume_handle *vol, void *arg), void *arg)
-{
- struct iter_vol_s vof;
-
- vof.func = func;
- vof.arg = arg;
-
- listiter (vol_list, iter_vol, &vof);
-}
-
-/*
- *
- */
-
-int
-vld_create_entry (volume_handle *vol, struct mnode *parent, AFSFid *child,
- int type, const AFSStoreStatus *ss, struct mnode **ret_n,
- struct msec *m)
-{
- struct voldb_entry e;
- onode_opaque child_ino;
- onode_opaque dummy; /* used when removing when failed */
- int ret;
- struct mnode *n;
- uint32_t real_mnode, unique;
- struct voldb *db;
- int (*convert_local2afs)(int32_t);
- node_type ntype;
- int space_needed = ENTRY_DISK_SIZE;
-
- switch (type) {
- case TYPE_DIR:
- db = VLD_VOLH_DIR(vol);
- convert_local2afs = dir_local2afs;
- ntype = NODE_DIR;
- space_needed += DIR_DISK_SIZE;
- break;
- case TYPE_FILE:
- case TYPE_LINK:
- db = VLD_VOLH_FILE(vol);
- convert_local2afs = file_local2afs;
- ntype = NODE_REG;
- break;
- default:
- errx(-1, "vld_create_entry, bad type\n");
- }
-
- ret = vld_check_quota (vol, space_needed);
- if (ret)
- return ret;
-
- ret = voldb_new_entry (db, &real_mnode, &unique);
- if (ret)
- return ret;
-
- ret = voldb_get_entry (db, real_mnode, &e);
- if (ret)
- goto out_bad_icreate;
-
- e.type = type;
-
- child->Volume = parent->fid.Volume;
- child->Vnode = (convert_local2afs)(real_mnode);
- child->Unique = unique;
-
- ret = mnode_find (child, &n);
- if (ret)
- goto out_bad_icreate;
-
- ret = VOLOP_ICREATE(vol, &child_ino, ntype, n);
- if (ret) {
- mnode_free (n, FALSE);
- goto out_bad_icreate;
- }
-
- if (type == TYPE_DIR) {
- AFSFid dot, dot_dot;
-
- dot_dot.Volume = dot.Volume = vol->vol;
- dot_dot.Vnode = parent->fid.Vnode;
- dot_dot.Unique = parent->fid.Unique;
- dot.Vnode = child->Vnode;
- dot.Unique = child->Unique;
-
- ret = mdir_mkdir (n, dot, dot_dot);
- if (ret) {
- ret = EIO;
- goto out_bad_put;
- }
- }
-
- if (type == TYPE_DIR) {
- e.u.dir.ino = child_ino;
- e.u.dir.FileType = type;
- e.u.dir.LinkCount = 2;
- e.u.dir.DataVersion = 0;
- e.u.dir.ParentVnode = parent->fid.Vnode;
- e.u.dir.ParentUnique = parent->fid.Unique;
- memcpy (&e.u.dir.negacl, &parent->e.u.dir.negacl,
- sizeof(parent->e.u.dir.negacl));
- memcpy (&e.u.dir.acl, &parent->e.u.dir.acl,
- sizeof(parent->e.u.dir.acl));
- } else {
- e.u.file.ino = child_ino;
- e.u.file.FileType = type;
- e.u.file.LinkCount = 1;
- e.u.file.DataVersion = 0;
- e.u.file.ParentVnode = parent->fid.Vnode;
- e.u.file.ParentUnique = parent->fid.Unique;
- }
-
- voldb_update_time(&e, time(NULL));
- vld_set_author(&e, m);
-
- ret = vld_storestatus_to_ent (&e, ss, m);
- if (ret)
- goto out_bad_put;
-
- ret = voldb_put_entry (db, real_mnode, &e);
- if (ret) {
- ret = EIO;
- goto out_bad_put;
- }
-
- if (type == TYPE_DIR) {
- ret = voldb_put_acl (db, real_mnode, &e.u.dir);
- if (ret)
- goto out_bad_put;
- }
-
-
- if (ret_n) {
- if (n->flags.ep == FALSE) {
- ret = voldb_get_entry (db, real_mnode, &n->e);
- if (ret)
- goto out_bad_put;
- n->flags.ep = TRUE;
- }
-
- if (m && (m->flags & VOLOP_GETSTATUS) == VOLOP_GETSTATUS) {
- assert(n->flags.fdp);
-
- ret = vld_ent_to_fetchstatus(vol, &e, n);
- if (ret)
- goto out_bad_put;
- }
-
- ret = vld_update_volsize (vol, ENTRY_DISK_SIZE + n->e.u.dir.Length/1024);
- if (ret)
- goto out_bad_put;
-
- *ret_n = n;
- } else
- mnode_free (n, FALSE);
-
- return 0;
-
- out_bad_put:
- mnode_free (n, TRUE);
- VOLOP_IUNLINK(vol, &child_ino);
- out_bad_icreate:
- voldb_del_entry (db, real_mnode, &dummy);
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-vld_set_onode (volume_handle *vol, int32_t vno, onode_opaque *new,
- onode_opaque *old)
-{
- int32_t real_mnode;
- struct voldb_entry e;
- struct voldb *db;
- onode_opaque *onode;
- int ret;
-
- assert (vol && new);
-
- if (afs_dir_p (vno)) {
- real_mnode = dir_afs2local(vno);
- db = VLD_VOLH_DIR(vol);
- onode = &e.u.dir.ino;
- } else {
- real_mnode = file_afs2local(vno);
- db = VLD_VOLH_FILE(vol);
- onode = &e.u.file.ino;
- }
-
- ret = voldb_get_entry (db, real_mnode, &e);
- if (ret)
- return ret;
-
- if (old)
- *old = *onode;
-
- *onode = *new;
-
- ret = voldb_put_entry (db, real_mnode, &e);
- if (ret)
- return ret;
-
- return 0;
-}
-
-/*
- *
- */
-
-int
-vld_adjust_linkcount (volume_handle *vol, struct mnode *n, int adjust)
-{
- int32_t real_mnode;
- struct voldb *db;
- int32_t *LinkCount;
- int32_t vno;
- int ret;
-
- assert (vol && n);
-
- vno = n->fid.Vnode;
- if (afs_dir_p (vno)) {
- real_mnode = dir_afs2local(vno);
- db = VLD_VOLH_DIR(vol);
- LinkCount = &n->e.u.dir.LinkCount;
- } else {
- real_mnode = file_afs2local(vno);
- db = VLD_VOLH_FILE(vol);
- LinkCount = &n->e.u.file.LinkCount;
- }
-
- if (n->flags.ep == FALSE) {
- ret = voldb_get_entry (db, real_mnode, &n->e);
- if (ret)
- return ret;
- }
-
- *LinkCount += adjust;
- n->fs.LinkCount += adjust;
-
- assert(*LinkCount >= 0);
-
- if (*LinkCount == 0) {
- ret = vld_remove_node(vol, n);
- } else {
- /* XXX is this necessary? */
- ret = voldb_put_entry (db, real_mnode, &n->e);
- if (ret)
- return ret;
-
- n->flags.ep = TRUE;
- }
-
- return ret;
-}
-
-static struct trans *transactions[MAX_TRANSACTIONS] = {NULL};
-static int32_t perm_tid = 1;
-
-
-int
-vld_create_trans(int32_t partition, int32_t volume, int32_t *trans)
-{
- time_t now = time(NULL);
- int i;
- int ret;
-
- ret = vld_check_busy(volume, partition);
- if (ret)
- return ret;
-
- for (i = 0; i < MAX_TRANSACTIONS; i++) {
- if (transactions[i] == NULL)
- break;
- }
- if (transactions[i] == NULL) {
- transactions[i] = malloc(sizeof(struct trans));
- if (transactions[i] == NULL)
- return ENOMEM;
- *trans = perm_tid++;
- transactions[i]->tid = *trans; /* XXX */
- transactions[i]->time = now;
- transactions[i]->creationTime = now;
- transactions[i]->returnCode = 0;
- transactions[i]->volume = NULL;
- transactions[i]->volid = volume;
- transactions[i]->partition = partition;
- transactions[i]->refCount = 1;
- transactions[i]->iflags = 0;
- transactions[i]->vflags = 0;
- transactions[i]->tflags = 0;
- transactions[i]->incremental = 0;
- return 0;
- } else
- return ENOMEM;
-}
-
-int
-vld_get_trans(int32_t transid, struct trans **trans)
-{
- int i;
-
- for (i = 0; i < MAX_TRANSACTIONS; i++) {
- if (transactions[i] && transactions[i]->tid == transid) {
- *trans = transactions[i];
- transactions[i]->refCount++;
- return 0;
- }
- }
- return EINVAL;
-}
-
-int
-vld_put_trans(struct trans *trans)
-{
- trans->refCount--;
- if (trans->refCount < 1)
- free(trans);
- return 0;
-}
-
-int
-vld_verify_trans(int32_t trans)
-{
- int i;
-
- for (i = 0; i < MAX_TRANSACTIONS; i++) {
- if (transactions[i] && transactions[i]->tid == trans)
- return 0;
- }
- return ENOENT;
-}
-
-int
-vld_end_trans(int32_t trans, int32_t *rcode)
-{
- int i;
-
- for (i = 0; i < MAX_TRANSACTIONS; i++) {
- if (transactions[i] && transactions[i]->tid == trans) {
- if (rcode)
- *rcode = transactions[i]->returnCode;
- vld_put_trans(transactions[i]);
- transactions[i] = NULL;
- return 0;
- }
- }
- return ENOENT;
-}
-
-int
-vld_trans_set_iflags(int32_t trans, int32_t iflags)
-{
- int i;
-
- for (i = 0; i < MAX_TRANSACTIONS; i++) {
- if (transactions[i] && transactions[i]->tid == trans) {
- transactions[i]->iflags = iflags;
- return 0;
- }
- }
- return EINVAL;
-}
-
-int
-vld_trans_set_vflags(int32_t trans, int32_t vflags)
-{
- int i;
-
- for (i = 0; i < MAX_TRANSACTIONS; i++) {
- if (transactions[i] && transactions[i]->tid == trans) {
- transactions[i]->vflags = vflags;
- return 0;
- }
- }
- return EINVAL;
-}
-
-int
-vld_trans_get_vflags(int32_t trans, int32_t *vflags)
-{
- int i;
-
- for (i = 0; i < MAX_TRANSACTIONS; i++) {
- if (transactions[i] && transactions[i]->tid == trans) {
- *vflags = transactions[i]->vflags;
- return 0;
- }
- }
- return EINVAL;
-}
-
-/*
- * Check if the {volume, partition} pair is busy. If it is, return the
- * appropriate error code. Otherwise, return 0. If the partition
- * argument is -1, any partition will do (this is for fsprocs).
- */
-
-int
-vld_check_busy(int32_t volid, int32_t partition)
-{
- int i;
-
- for (i = 0; i < MAX_TRANSACTIONS; i++) {
- if (transactions[i]
- && (partition == -1 || transactions[i]->partition == partition)
- && transactions[i]->volid == volid) {
- if (transactions[i]->iflags & ITOffline)
- return VOFFLINE;
- if (transactions[i]->iflags & ITBusy)
- return VBUSY;
- return EINVAL;
- }
- }
- return 0;
-}
-
-/*
- * create a new volume on partition `part' with volume id `volid' and name
- * `name' of type `backstoretype'
- */
-
-int
-vld_create_volume (struct dp_part *dp, int32_t volid,
- const char *name, int32_t backstoretype, int32_t voltype,
- int flags)
-{
- volume_handle *vol;
- int ret;
-
- if (VLD_VALID_BACKSTORETYPE(backstoretype) ||
- VLD_VALID_VOLNAME(name))
- return EINVAL;
-
- if (volume_htab) {
- ret = vld_find_vol (volid, &vol);
- if (ret == 0) {
- vld_free (vol);
- return EEXIST;
- } else if (ret != ENOENT)
- return ret;
- } else {
- ret = vld_open_volume_by_num (dp, volid, &vol);
- if (ret == 0) {
- vld_free (vol);
- return EEXIST;
- } else if (ret != ENOENT)
- return ret;
- }
-
- vol = malloc (sizeof(*vol));
- if (vol == NULL)
- return ENOMEM;
-
- memset (vol, 0, sizeof (*vol));
- vol->vol = volid;
- dp_ref (dp);
- vol->dp = dp;
-
- vol->ref = 1;
-
- ret = VOLOP_OPEN(backstoretype, dp, volid, VOLOP_CREATE, &vol->data);
- if (ret) {
- dp_free (dp);
- return ret;
- }
-
- ret = VOLOP_ICREATE(vol, &vol->fino, NODE_VOL, NULL);
- if (ret) {
- VOLOP_REMOVE (vol);
- dp_free (dp);
- return ret;
- }
-
- ret = VOLOP_ICREATE(vol, &vol->dino, NODE_VOL, NULL);
- if (ret) {
- VOLOP_IUNLINK(vol, &vol->fino);
- VOLOP_REMOVE(vol);
- dp_free (dp);
- return ret;
- }
-
- ret = VOLOP_ICREATE(vol, &vol->sino, NODE_VOL, NULL);
- if (ret) {
- VOLOP_IUNLINK(vol, &vol->fino);
- VOLOP_IUNLINK(vol, &vol->dino);
- VOLOP_REMOVE(vol);
- dp_free (dp);
- return ret;
- }
-
- {
- int fd;
-
- ret = VOLOP_IOPEN(vol,&vol->sino,O_RDWR,&fd);
- if (ret)
- VOLOP_IUNLINK(vol, &vol->fino);
- VOLOP_IUNLINK(vol, &vol->dino);
- VOLOP_IUNLINK(vol, &vol->sino);
- VOLOP_REMOVE (vol);
- dp_free (dp);
- return ret;
- }
-
- ret = vol_create (fd, volid, name, voltype, 0);
- if (ret) {
- VOLOP_IUNLINK(vol, &vol->fino);
- VOLOP_IUNLINK(vol, &vol->dino);
- VOLOP_IUNLINK(vol, &vol->sino);
- VOLOP_REMOVE (vol);
- close (fd);
- dp_free (dp);
- return ret;
- }
- close (fd);
- }
-
- {
- char path[MAXPATHLEN];
- int fd = -1;
- vstatus vs;
-
-#define ERR_OUT_VSTATUS(ret) \
- do { \
- VOLOP_IUNLINK(vol, &vol->fino); \
- VOLOP_IUNLINK(vol, &vol->dino); \
- VOLOP_IUNLINK(vol, &vol->sino); \
- VOLOP_REMOVE (vol); \
- dp_free (dp); \
- if (fd != -1) \
- close (fd); \
- return ret; \
- } while (0)
-
- ret = vol_getfullname (DP_NUMBER(dp), volid, path, sizeof(path));
- if (ret)
- ERR_OUT_VSTATUS(ret);
-
- fd = open (path, O_RDWR|O_CREAT, 0600);
- if (fd < 0)
- ERR_OUT_VSTATUS(errno);
-
- vol->type = backstoretype;
- vol->vol = volid;
- vol->voldbtype = VOLDB_DEFAULT_TYPE;
-
- memset (&vs, 0, sizeof(vs));
- vs.volid = volid;
- vs.type = voltype;
- vs.bstype = backstoretype;
- vs.voldbtype = VOLDB_DEFAULT_TYPE;
- memcpy (&vs.volinfoinode, &vol->sino, sizeof(vol->sino));
- memcpy (&vs.dirinode, &vol->dino, sizeof(vol->dino));
- memcpy (&vs.fileinode, &vol->fino, sizeof(vol->fino));
-
- ret = vstatus_write (fd, &vs);
- if (ret)
- ERR_OUT_VSTATUS(ret);
-
- close (fd);
-#undef ERR_OUT_VSTATUS
- }
-
- {
- int fd;
- ret = VOLOP_IOPEN(vol,&vol->fino,O_RDWR,&fd);
- if (ret)
- abort();
-
- ret = voldb_create_header (fd, VOLDB_DEFAULT_TYPE, VOLDB_FILE);
- if (ret)
- abort();
-
- ret = VOLOP_IOPEN(vol,&vol->dino,O_RDWR,&fd);
- if (ret)
- abort();
-
- ret = voldb_create_header (fd, VOLDB_DEFAULT_TYPE, VOLDB_DIR);
- if (ret)
- abort();
-
- /* voldb_create_header will close `fd' */
- }
- {
- AFSFid child;
- AFSStoreStatus ss;
- struct mnode *n;
- struct mnode parent_n;
-
- memset (&ss, 0, sizeof (ss));
- ss.Mask = SS_MODEBITS;
- ss.UnixModeBits = 0755;
-
- ret = vld_db_uptodate (vol);
- if (ret)
- abort();
-
- parent_n.fid.Volume = vol->vol;
- parent_n.fid.Vnode = 1;
- parent_n.fid.Unique = 1;
-
-
- memset (parent_n.e.u.dir.acl, 0,
- sizeof (parent_n.e.u.dir.acl));
- memset (parent_n.e.u.dir.negacl, 0,
- sizeof (parent_n.e.u.dir.negacl));
- parent_n.e.u.dir.acl[0].owner = PR_SYSADMINID;
- parent_n.e.u.dir.acl[0].flags =
- PRSFS_LOOKUP |
- PRSFS_READ |
- PRSFS_WRITE |
- PRSFS_INSERT |
- PRSFS_DELETE |
- PRSFS_LOCK |
- PRSFS_ADMINISTER;
- parent_n.e.u.dir.acl[1].owner = PR_ANYUSERID;
- parent_n.e.u.dir.acl[1].flags = PRSFS_LOOKUP | PRSFS_READ;
-
- ret = vld_create_entry (vol, &parent_n, &child,
- TYPE_DIR, &ss, &n, NULL);
- if (ret)
- abort();
-
- mnode_free(n, FALSE);
-
- assert (child.Vnode == 1 && child.Unique == 1);
-
- ret = vld_db_flush (vol);
- if (ret)
- abort();
- }
-
- if (volume_htab)
- hashtabadd (volume_htab, vol);
- else
- vld_free(vol);
-
- return 0;
-}
-
-static int
-delete_all_nodes (struct volume_handle *volh)
-{
- uint32_t dsize, fsize;
- int ret, i;
-
- /* XXX check volintInfo */
-
- ret = vld_db_uptodate (volh);
- if (ret)
- return ret;
-
- ret = voldb_header_info(VLD_VOLH_FILE(volh), &fsize, NULL);
- if (ret)
- return ret;
-
- for (i = 0; i < fsize; i++) {
- struct voldb_entry entry;
- onode_opaque o;
-
- ret = voldb_get_entry (VLD_VOLH_FILE(volh), i, &entry);
- if (ret)
- continue;
-
- if (entry.u.file.FileType != 0 &&
- entry.u.file.nextptr == VOLDB_ENTRY_USED) {
- mlog_log (MDEBVLD, "removing file %d\n", i);
- ret = voldb_del_entry(VLD_VOLH_FILE(volh), i, &o);
- if (ret)
- return ret;
- VOLOP_IUNLINK(volh, &o);
- }
- }
-
- ret = voldb_header_info(VLD_VOLH_DIR(volh), &dsize, NULL);
- if (ret)
- return ret;
-
- for (i = 0; i < dsize; i++) {
- struct voldb_entry entry;
- onode_opaque o;
-
- ret = voldb_get_entry (VLD_VOLH_DIR(volh), i, &entry);
- if (ret)
- continue;
-
- if (entry.u.file.FileType != 0 &&
- entry.u.file.nextptr == VOLDB_ENTRY_USED) {
- mlog_log (MDEBVLD, "removing dir %d\n", i);
- ret = voldb_del_entry(VLD_VOLH_DIR(volh), i, &o);
- if (ret)
- return ret;
- VOLOP_IUNLINK(volh, &o);
- }
- }
-
- VOLOP_IUNLINK(volh, &volh->fino);
- VOLOP_IUNLINK(volh, &volh->dino);
- VOLOP_IUNLINK(volh, &volh->sino);
- VOLOP_REMOVE (volh);
-
- return 0;
-}
-
-int
-vld_foreach_dir (struct volume_handle *volh,
- int (*func)(int fd,
- uint32_t vnode,
- uint32_t uniq,
- uint32_t length,
- uint32_t dataversion,
- uint32_t author,
- uint32_t owner,
- uint32_t group,
- uint32_t parent,
- uint32_t client_date,
- uint32_t server_date,
- uint16_t nlinks,
- uint16_t mode,
- uint8_t type,
- int32_t *acl,
- void *arg),
- void *arg)
-{
- struct voldb_entry entry;
- onode_opaque *o;
- uint32_t size;
- int ret, i;
- int num;
- int fd;
- int32_t acl[48]; /* XXX */
-
- ret = vld_db_uptodate (volh);
- if (ret)
- return ret;
-
- ret = voldb_header_info(VLD_VOLH_DIR(volh), &size, NULL);
- if (ret)
- return ret;
-
- for (num = 0; num < size; num++) {
-
- ret = voldb_get_entry (VLD_VOLH_DIR(volh), num, &entry);
- if (ret)
- continue;
-
- {
- int32_t size;
- int32_t version;
- int32_t total;
- int32_t positive;
- int32_t negative;
-
- memset(acl, 0, sizeof(acl));
- for (i = 0; entry.u.dir.acl[i].owner; i++) {
- acl[i*2+5] = htonl(entry.u.dir.acl[i].owner);
- acl[i*2+6] = htonl(entry.u.dir.acl[i].flags);
- }
- positive = i;
- for (i = 0; entry.u.dir.negacl[i].owner; i++) {
- acl[(i+positive)*2+5] = htonl(entry.u.dir.negacl[i].owner);
- acl[(i+positive)*2+6] = htonl(entry.u.dir.negacl[i].flags);
- }
- negative = i;
- total = positive + negative;
- version = 1;
- size = sizeof(acl);
- acl[0] = htonl(size);
- acl[1] = htonl(version);
- acl[2] = htonl(total);
- acl[3] = htonl(positive);
- acl[4] = htonl(negative);
- }
-
- o = &entry.u.dir.ino;
-
- if (entry.u.dir.FileType != 0 &&
- entry.u.dir.nextptr == VOLDB_ENTRY_USED) {
- ret = VOLOP_IOPEN(volh, o, O_RDONLY, &fd);
- if (ret)
- return ret;
-
- mlog_log(MDEBVOLDB, "vnode %i length %d",
- dir_local2afs(num), entry.u.dir.Length);
-
- ret = func(fd,
- dir_local2afs(num),
- entry.u.dir.unique,
- entry.u.dir.Length,
- entry.u.dir.DataVersion,
- entry.u.dir.Author,
- entry.u.dir.Owner,
- entry.u.dir.Group,
- entry.u.dir.ParentVnode,
- entry.u.dir.ServerModTime, /* XXX */
- entry.u.dir.ServerModTime,
- entry.u.dir.LinkCount,
- entry.u.dir.UnixModeBits,
- entry.u.dir.FileType,
- acl,
- arg);
- close(fd);
- if (ret)
- return ret;
- }
- }
-
- return 0;
-}
-
-int
-vld_foreach_file (struct volume_handle *volh,
- int (*func)(int fd,
- uint32_t vnode,
- uint32_t uniq,
- uint32_t length,
- uint32_t dataversion,
- uint32_t author,
- uint32_t owner,
- uint32_t group,
- uint32_t parent,
- uint32_t client_date,
- uint32_t server_date,
- uint16_t nlinks,
- uint16_t mode,
- uint8_t type,
- int32_t *acl,
- void *arg),
- void *arg)
-{
- struct voldb_entry entry;
- onode_opaque *o;
- uint32_t size;
- int ret;
- int num;
- int fd;
-
- ret = vld_db_uptodate (volh);
- if (ret)
- return ret;
-
- ret = voldb_header_info(VLD_VOLH_FILE(volh), &size, NULL);
- if (ret)
- return ret;
-
- for (num = 0; num < size; num++) {
-
- ret = voldb_get_entry (VLD_VOLH_FILE(volh), num, &entry);
- if (ret)
- continue;
-
- o = &entry.u.dir.ino;
-
- if (entry.u.dir.FileType != 0 &&
- entry.u.dir.nextptr == VOLDB_ENTRY_USED) {
- ret = VOLOP_IOPEN(volh, o, O_RDONLY, &fd);
- if (ret)
- return ret;
-
- mlog_log(MDEBVOLDB, "vnode %i length %d",
- file_local2afs(num), entry.u.file.Length);
-
- ret = func(fd,
- file_local2afs(num),
- entry.u.file.unique,
- entry.u.file.Length,
- entry.u.file.DataVersion,
- entry.u.file.Author,
- entry.u.file.Owner,
- entry.u.file.Group,
- entry.u.file.ParentVnode,
- entry.u.file.ServerModTime, /* XXX */
- entry.u.file.ServerModTime,
- entry.u.file.LinkCount,
- entry.u.file.UnixModeBits,
- entry.u.file.FileType,
- NULL,
- arg);
- close(fd);
- if (ret)
- return ret;
- }
- }
-
- return 0;
-}
-
-
-int
-vld_delete_volume (struct dp_part *dp, int32_t volid,
- int32_t backstoretype,
- int flags)
-{
- int ret;
- volume_handle *vol;
- char path[MAXPATHLEN];
-
- ret = vld_open_volume_by_num (dp, volid, &vol);
- if (ret)
- return ret;
-
- ret = delete_all_nodes (vol);
- if (ret) {
- vld_free (vol);
- return ret;
- }
-
- hashtabdel (volume_htab, vol);
-
- ret = vol_getfullname (DP_NUMBER(dp), volid, path, sizeof(path));
- if (ret) {
- vld_free (vol);
- return ret;
- }
-
- ret = unlink(path);
- if (ret) {
- vld_free (vol);
- return ret;
- }
-
- vld_free (vol);
-
- return 0;
-}
-
-/*
- * Register a new volume type
- */
-
-int
-vld_register_vol_type (const int32_t backstoretype, vol_op *ops)
-{
- if (backstoretype < 0 || backstoretype >= VLD_MAX_BACKSTORE_TYPES)
- return EINVAL;
-
- assert (ops);
-
- backstoretypes[backstoretype] = ops;
-
- return 0;
-}
-
-/*
- * Find volume in incore db
- */
-
-int
-vld_find_vol (const int32_t volid, struct volume_handle **vol)
-{
- volume_handle key, *r;
-
- key.vol = volid;
-
- r = hashtabsearch (volume_htab, &key);
- if (r == NULL) {
- *vol = NULL;
- return ENOENT;
- } else {
- vld_ref (r);
- *vol = r;
- }
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-vld_storestatus_to_dent (struct voldb_dir_entry *e,
- const AFSStoreStatus *ss,
- struct msec *m)
-{
- if (ss->Mask & SS_OWNER)
- e->Owner = ss->Owner;
-
- if (ss->Mask & SS_MODTIME) {
- e->ServerModTime = ss->ClientModTime; /* XXX should modify
- ClientModTime */
- }
- if (ss->Mask & SS_GROUP)
- e->Group = ss->Group;
- if (ss->Mask & SS_MODEBITS)
- e->UnixModeBits = 07777 & ss->UnixModeBits;
- if (ss->Mask & SS_SEGSIZE)
- e->SegSize = ss->SegSize;
- return 0;
-}
-
-/*
- *
- */
-
-static int
-vld_storestatus_to_fent (struct voldb_file_entry *e,
- const AFSStoreStatus *ss,
- struct msec *m)
-{
- if (ss->Mask & SS_OWNER)
- e->Owner = ss->Owner;
-
- if (ss->Mask & SS_MODTIME) {
- e->ServerModTime = ss->ClientModTime; /* XXX should modify
- ClientModTime */
- }
- if (ss->Mask & SS_GROUP)
- e->Group = ss->Group;
- if (ss->Mask & SS_MODEBITS)
- e->UnixModeBits = 0777 & ss->UnixModeBits;
- if (ss->Mask & SS_SEGSIZE)
- e->SegSize = ss->SegSize;
-
- return 0;
-}
-
-/*
- *
- */
-
-int
-vld_storestatus_to_ent (struct voldb_entry *e,
- const AFSStoreStatus *ss,
- struct msec *m)
-{
- switch (e->type) {
- case TYPE_DIR:
- return vld_storestatus_to_dent (&e->u.dir, ss, m);
- case TYPE_FILE:
- case TYPE_LINK:
- return vld_storestatus_to_fent (&e->u.file, ss, m);
- }
- abort();
-}
-
-/*
- *
- */
-
-static int
-vld_dent_to_fetchstatus (struct volume_handle *vol,
- struct voldb_dir_entry *e,
- struct mnode *n)
-{
- int ret;
- AFSFetchStatus *fs;
-
- ret = mnode_update_size_cached (n);
- if (ret)
- return ret;
-
- fs = &n->fs;
-
- fs->InterfaceVersion = 1;
- fs->FileType = e->FileType;
- fs->LinkCount = e->LinkCount;
- fs->DataVersion = e->DataVersion;
-
- fs->ParentVnode = e->ParentVnode;
- fs->ParentUnique = e->ParentUnique;
-
- fs->SegSize = e->SegSize;
- fs->ClientModTime = e->ServerModTime;
- fs->ServerModTime = e->ServerModTime;
- fs->SyncCount = 0;
- fs->DataVersionHigh = vol->info.creationDate;
- fs->LockCount = 0;
- fs->LengthHigh = 0;
- fs->ErrorCode = 0;
- fs->Author = e->Author;
- fs->Owner = e->Owner;
- fs->Group = e->Group;
- fs->UnixModeBits = e->UnixModeBits;
-
- /*
- * Dummy
- */
-
- fs->CallerAccess = 0;
- fs->AnonymousAccess = 0;
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-vld_fent_to_fetchstatus (struct volume_handle *vol,
- struct voldb_file_entry *e,
- struct mnode *n)
-{
- int ret;
- AFSFetchStatus *fs;
-
- ret = mnode_update_size_cached (n);
- if (ret)
- return ret;
-
- fs = &n->fs;
-
- fs->InterfaceVersion = 1;
- fs->FileType = e->FileType;
- fs->LinkCount = e->LinkCount;
- fs->DataVersion = e->DataVersion;
-
- fs->ParentVnode = e->ParentVnode;
- fs->ParentUnique = e->ParentUnique;
-
- fs->SegSize = e->SegSize;
- fs->ClientModTime = e->ServerModTime;
- fs->ServerModTime = e->ServerModTime;
- fs->SyncCount = 0;
- fs->DataVersionHigh = vol->info.creationDate;
- fs->LockCount = 0;
- fs->LengthHigh = 0;
- fs->ErrorCode = 0;
- fs->Author = e->Author;
- fs->Owner = e->Owner;
- fs->Group = e->Group;
- fs->UnixModeBits = e->UnixModeBits;
-
- /*
- * Dummy
- */
-
- fs->CallerAccess = 0;
- fs->AnonymousAccess = 0;
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-vld_ent_to_fetchstatus (struct volume_handle *vol,
- struct voldb_entry *e,
- struct mnode *n)
-{
- int ret;
-
- if (n->flags.fsp)
- return 0;
-
- assert (n->flags.ep);
-
- switch (e->type) {
- case TYPE_DIR:
- ret = vld_dent_to_fetchstatus (vol, &e->u.dir, n);
- break;
- case TYPE_FILE:
- case TYPE_LINK:
- ret = vld_fent_to_fetchstatus (vol, &e->u.file, n);
- break;
- default:
- abort();
- break;
- }
- if (ret == 0)
- n->flags.fsp = TRUE;
- return ret;
-}
-
-/*
- *
- */
-
-static void
-vld_set_author(struct voldb_entry *e, struct msec *m)
-{
- if (m == NULL)
- return;
- assert (m->sec);
- switch (e->type) {
- case TYPE_DIR:
- e->u.dir.Author = m->sec->uid;
- break;
- case TYPE_FILE:
- case TYPE_LINK:
- e->u.file.Author = m->sec->uid;
- break;
- default:
- abort();
- break;
- }
-}
-
-/*
- *
- */
-
-int
-volop_iopen (volume_handle *vol, onode_opaque *o, struct mnode *n)
-{
- int ret;
-
- if (n->flags.fdp)
- return 0;
-
- ret = VOLOP_IOPEN(vol, o, O_RDWR, &n->fd);
- if (ret)
- return ret;
- n->flags.fdp = TRUE;
- return 0;
-}
-
-/*
- *
- */
-
-#if 0
-int
-foo(void)
-{
- *callers_right = 0;
- *anonymous_right = 0;
-
- foreach (parent_n->e.positive_acl) {
- if (member ($_.uid, anonymous))
- *anonymous_right = $_.rights;
- if (member ($_.uid, m->cps)) {
- *callers_right |= $_.rights:
- }
- }
- foreach (parent_n->e.negative_acl) {
- if (member ($_.uid, anonymous))
- *anonymous_right &= ~ $_.rights;
- if (member ($_.uid, m->cps)
- *callers_rights &= ~ $_.rights;
- }
- }
- if (validop_p(*callers_rights, operation))
- return TRUE;
- return FALSE;
-}
-#endif
-
-/*
- * check the right to use `n'
- *
- * We also need to take care of the special case (1,1) since it
- * doesn't have a parent directory.
- */
-
-struct {
- volop_flags op;
- int32_t afsprivs;
-} check_flags[] = {
- { VOLOP_READ, PRSFS_READ },
- { VOLOP_WRITE, PRSFS_WRITE },
- { VOLOP_INSERT, PRSFS_INSERT },
- { VOLOP_DELETE, PRSFS_DELETE },
- { VOLOP_LOOKUP, PRSFS_LOOKUP},
- { VOLOP_LOCK, PRSFS_LOCK },
- { VOLOP_ADMIN, PRSFS_ADMINISTER },
- { VOLOP_GETSTATUS, PRSFS_READ }
-};
-
-
-
-int
-vld_check_rights (volume_handle *vol, struct mnode *n,
- struct msec *m)
-{
- struct mnode *parent_n;
- AFSFid parent_fid;
- struct msec pm;
- int ret, i, j;
- int right_ret = 0;
-
- assert (n->flags.fsp);
- assert (n->flags.ep);
-
- if (m->loop > 1)
- abort();
-
-#if 0
- if ((m->flags & VOLOP_NOCHECK) == VOLOP_NOCHECK)
- return 0;
-#endif
-
- assert(m->sec);
-
- if (m->sec->cps == NULL)
- return EPERM;
-
- if (n->e.type == TYPE_DIR) {
- parent_n = n;
- } else {
- memset (&pm, 0, sizeof (pm));
- pm.sec = m->sec;
- pm.caller_access = 0;
- pm.anonymous_access = 0;
- pm.flags = VOLOP_GETSTATUS;
- pm.loop = m->loop + 1;
-
- parent_fid.Volume = n->fid.Volume;
- parent_fid.Vnode = n->fs.ParentVnode;
- parent_fid.Unique = n->fs.ParentUnique;
-
- ret = mnode_find (&parent_fid, &parent_n);
- if (ret)
- return EACCES;
-
- ret = vld_open_vnode (vol, parent_n, &pm);
- if (ret) {
- mnode_free (parent_n, FALSE);
- return EACCES;
- }
- assert (parent_n->flags.ep);
-
- }
-
- m->caller_access = m->anonymous_access = 0;
-
- for (i = 0; i < FS_MAX_ACL; i++) {
- for (j = 0; j < m->sec->cps->len; j++)
- if (parent_n->e.u.dir.acl[i].owner == m->sec->cps->val[j])
- m->caller_access |= parent_n->e.u.dir.acl[i].flags;
- if (parent_n->e.u.dir.acl[i].owner == PR_ANYUSERID)
- m->anonymous_access |= parent_n->e.u.dir.acl[i].flags;
- }
-
- for (i = 0; i < FS_MAX_ACL; i++) {
- for (j = 0; j < m->sec->cps->len; j++)
- if (parent_n->e.u.dir.negacl[i].owner == m->sec->cps->val[j])
- m->caller_access &= ~parent_n->e.u.dir.negacl[i].flags;
- if (parent_n->e.u.dir.negacl[i].owner == PR_ANYUSERID)
- m->anonymous_access &= ~parent_n->e.u.dir.negacl[i].flags;
- }
-
- if (m->sec->superuser)
- m->caller_access |= PRSFS_LOOKUP | PRSFS_ADMINISTER;
-
- for (i = 0;
- i < sizeof(check_flags)/sizeof(*check_flags)
- && right_ret == 0;
- i++)
- {
- if ((m->flags &
- check_flags[i].op) == check_flags[i].op
- && (check_flags[i].afsprivs &
- m->caller_access) != check_flags[i].afsprivs)
- right_ret = EACCES;
- }
-
- if (parent_n != n)
- mnode_free (parent_n, FALSE);
-
- return right_ret;
-}
-
-/*
- * open an mnode `n' in volume `vol' with `flags' in `m' as specifed above.
- */
-
-int
-vld_open_vnode (volume_handle *vol, struct mnode *n, struct msec *m)
-{
- int ret = 0;
- int32_t real_mnode;
- struct voldb *db;
- onode_opaque *o;
-
- assert (vol);
-
- /*
- * is everything cached ?
- */
-
- if ((m->flags & VOLOP_GETSTATUS) == 0 /* XXX why? */
- && n->flags.fsp == TRUE
- && n->flags.ep == TRUE)
- return 0;
-
- if (afs_dir_p (n->fid.Vnode)) {
- real_mnode = dir_afs2local (n->fid.Vnode);
- db = VLD_VOLH_DIR(vol);
- o = &n->e.u.dir.ino;
- } else {
- real_mnode = file_afs2local (n->fid.Vnode);
- db = VLD_VOLH_FILE(vol);
- o = &n->e.u.file.ino;
- }
-
- if (n->flags.ep == FALSE) {
- ret = voldb_get_entry (db, real_mnode, &n->e);
- if (ret)
- return ret;
- n->flags.ep = TRUE;
- }
-
- if (n->flags.fdp == FALSE) {
- ret = volop_iopen (vol, o, n);
- if (ret)
- return ret;
- }
-
- n->flags.fdp = TRUE;
-
- if ((m->flags & VOLOP_GETSTATUS) == VOLOP_GETSTATUS)
- ret = vld_ent_to_fetchstatus (vol, &n->e, n);
-
- return ret;
-}
-
-
-/*
- * Modify node `n' in volume `vol' with context bits `m'
- * with StoreStatus bits `ss' and length `len'.
- */
-
-int
-vld_modify_vnode (volume_handle *vol, struct mnode *n, struct msec *m,
- const AFSStoreStatus *ss, int32_t *len)
-{
- int ret;
- int32_t real_mnode;
- struct voldb *db;
-
- assert (vol);
- assert (n->flags.fdp);
- assert (n->flags.ep);
-
- if (afs_dir_p (n->fid.Vnode)) {
- real_mnode = dir_afs2local (n->fid.Vnode);
- db = VLD_VOLH_DIR(vol);
- } else {
- real_mnode = file_afs2local (n->fid.Vnode);
- db = VLD_VOLH_FILE(vol);
- }
-
- if (ss && ss->Mask) {
- ret = vld_storestatus_to_ent (&n->e, ss, m);
- if (ret)
- return ret;
- }
-
- if (len) {
- int diff;
- uint32_t *Length;
-
- assert (vol->flags.infop);
-
- if (afs_dir_p (n->fid.Vnode))
- Length = &n->e.u.dir.Length;
- else
- Length = &n->e.u.file.Length;
-
- diff = *len / 1024 - *Length / 1024;
-
- mlog_log (MDEBFS,
- "vld_modify_vnode: olen=%d, nlen=%d, diff=%d", *Length, *len, diff);
-
- ret = vld_update_volsize (vol, diff);
- if (ret)
- return ret;
-
- ret = ftruncate (n->fd, *len);
- if (ret) {
- vld_update_volsize (vol, -diff);
- return ret;
- }
-
- *Length = *len;
-
- n->sb.st_size = *len;
- }
-
- if (m->flags & (VOLOP_WRITE|VOLOP_INSERT|VOLOP_DELETE)) {
- if (n->e.type == TYPE_DIR) {
- n->e.u.dir.DataVersion++;
- n->e.u.dir.ServerModTime = time(0);
- } else {
- n->e.u.file.DataVersion++;
- n->e.u.file.ServerModTime = time(0);
- }
- }
-
- ret = voldb_put_entry (db, real_mnode, &n->e);
- if (ret)
- return ret;
-
- n->flags.fsp = FALSE; /* Force vld_ent_to_fetchstatus
- to fill in the field */
- ret = vld_ent_to_fetchstatus (vol, &n->e, n);
-
- return ret;
-}
-
-/*
- * Put acl for node `n' in volume `vol' with context bits `m'.
- */
-
-int
-vld_put_acl (volume_handle *vol, struct mnode *n, struct msec *m)
-{
- int ret;
- int32_t real_mnode;
- struct voldb *db;
-
- assert (vol);
- assert (n->flags.fdp);
- assert (n->flags.ep);
-
- if (afs_dir_p (n->fid.Vnode)) {
- real_mnode = dir_afs2local (n->fid.Vnode);
- db = VLD_VOLH_DIR(vol);
- } else {
- return EINVAL;
- }
-
- ret = voldb_put_acl (db, real_mnode, &n->e.u.dir);
- if (ret)
- return ret;
-
- n->flags.fsp = FALSE; /* Force vld_ent_to_fetchstatus
- to fill in the field */
-
- if ((m->flags & VOLOP_GETSTATUS) == VOLOP_GETSTATUS)
- ret = vld_ent_to_fetchstatus (vol, &n->e, n);
-
- return ret;
-}
-
-
-/*
- * Convert a volume handle to AFS volsync
- */
-
-int
-vld_vld2volsync (const struct volume_handle *vld, AFSVolSync *volsync)
-{
- if (volsync)
- memset (volsync, 0, sizeof (*volsync));
- return 0;
-}
-
-/*
- * Make sure the db is stored to disk
- */
-
-int
-vld_db_flush (volume_handle *vol)
-{
- int ret;
- if (vol->flags.voldbp) {
- assert (VLD_VOLH_DIR(vol) != NULL && VLD_VOLH_FILE(vol) != NULL);
-
- ret = voldb_flush (VLD_VOLH_DIR(vol));
- assert (ret == 0);
- ret = voldb_flush (VLD_VOLH_FILE(vol));
- assert (ret == 0);
- } else {
- assert (VLD_VOLH_DIR(vol) == NULL && VLD_VOLH_FILE(vol) == NULL);
- }
- return 0;
-}
-
-/*
- * Bring db in volume uptodate
- *
- * XXX when failing bring volume offline
- */
-
-int
-vld_db_uptodate (volume_handle *vol)
-{
- int ret, fd;
-
- if (vol->flags.voldbp) {
- if (db_lru) {
- listdel (db_lru, vol->db_li);
- vol->db_li = listaddhead (db_lru, vol);
- if (vol->db_li == NULL)
- abort (); /* XXX */
- } else {
- assert (vol->db_li == NULL);
- }
- return 0;
- }
- assert (VLD_VOLH_DIR(vol) == NULL && VLD_VOLH_FILE(vol) == NULL);
-
- if (db_lru && !listemptyp(db_lru)) {
- volume_handle *old_vol;
-
- old_vol = listdeltail (db_lru);
- if (old_vol) {
- assert (VLD_VOLH_DIR(old_vol) && VLD_VOLH_FILE(old_vol));
-
- voldb_close (VLD_VOLH_DIR(old_vol));
- voldb_close (VLD_VOLH_FILE(old_vol));
- VLD_VOLH_DIR(old_vol) = VLD_VOLH_FILE(old_vol) = NULL;
- old_vol->db_li = NULL;
- }
- }
-
- /*
- * Note there isn't a fd-leek here, they are picked up
- * by voldb_init, and closed at will by voldb.
- */
-
- ret = VOLOP_IOPEN(vol, &vol->dino, O_RDWR, &fd);
- if (ret)
- return ret;
-
- ret = voldb_init (fd, vol->voldbtype, vol->vol, &VLD_VOLH_DIR(vol));
- if (ret) {
- close (fd);
- VLD_VOLH_DIR(vol) = NULL;
- return ret;
- }
-
- ret = VOLOP_IOPEN(vol, &vol->fino, O_RDWR, &fd);
- if (ret) {
- voldb_close (VLD_VOLH_DIR(vol));
- VLD_VOLH_DIR(vol) = NULL;
- return ret;
- }
-
- ret = voldb_init (fd, vol->voldbtype, vol->vol, &VLD_VOLH_FILE(vol));
- if (ret) {
- close (fd);
- voldb_close (VLD_VOLH_DIR(vol));
- VLD_VOLH_DIR(vol) = NULL;
- VLD_VOLH_FILE(vol) = NULL;
- return ret;
- }
-
- vol->flags.voldbp = TRUE;
-
- if (db_lru)
- vol->db_li = listaddhead (db_lru, vol);
-
- return 0;
-}
-
-static int
-vld_open_volume_by_handle (struct dp_part *dp, volume_handle *vol)
-{
- int ret, fd;
- char path[MAXPATHLEN];
- vstatus vs;
-
- vld_ref(vol);
-
- ret = vol_getfullname (DP_NUMBER(dp), vol->vol, path, sizeof (path));
- if (ret)
- return ret;
-
- fd = open (path, O_RDONLY, 0600);
- if (fd < 0)
- return errno;
-
- ret = vstatus_read (fd, &vs);
- if (ret) {
- close (fd);
- return ret;
- }
- close (fd);
-
- ret = vstatus2volume_handle (&vs, dp, &vol);
- if (ret)
- return ret;
-
- ret = VOLOP_OPEN(vol->type, vol->dp, vol->vol,
- VOLOP_NOFLAGS, &vol->data);
-
- return ret;
-}
-
-
-/*
- * Open volume on partition `dp' with volume id `volid'
- * and return it ref:ed in `vol'.
- */
-
-int
-vld_open_volume_by_num (struct dp_part *dp, int32_t volid,
- volume_handle **vol)
-{
- int ret, fd;
- char path[MAXPATHLEN];
- vstatus vs;
-
- if (volume_htab) {
- volume_handle *r, key;
- key.vol = volid;
-
- r = hashtabsearch (volume_htab, &key);
- if (r == NULL)
- return ENOENT;
- else
- vld_ref (r);
- *vol = r;
- return 0;
- }
-
- ret = vol_getfullname (DP_NUMBER(dp), volid, path, sizeof (path));
- if (ret)
- return ret;
-
- fd = open (path, O_RDONLY, 0600);
- if (fd < 0)
- return errno;
-
- ret = vstatus_read (fd, &vs);
- if (ret) {
- close (fd);
- return ret;
- }
- close (fd);
-
- ret = vstatus2volume_handle (&vs, dp, vol);
- if (ret)
- return ret;
-
- ret = VOLOP_OPEN((*vol)->type, (*vol)->dp, (*vol)->vol,
- VOLOP_NOFLAGS, &(*vol)->data);
- if (ret)
- vld_free (*vol);
-
- return ret;
-}
-
-int
-vld_remove_node (volume_handle *vol, struct mnode *n)
-{
- int ret;
- onode_opaque o;
- int32_t node = n->fid.Vnode;
- int diff;
-
- assert (vol->flags.infop);
-
- mnode_remove(&n->fid);
-
- if (afs_dir_p (node)) {
- ret = voldb_del_entry (VLD_VOLH_DIR(vol), dir_afs2local(node), &o);
- if (ret)
- return ret;
-
- diff = n->e.u.dir.Length;
- } else {
- ret = voldb_del_entry (VLD_VOLH_FILE(vol), file_afs2local(node), &o);
- if (ret)
- return ret;
-
- diff = n->e.u.file.Length;
- }
-
- mlog_log (MDEBFS,
- "vld_remove_node: olen=%d, diff=%d", diff, -(ENTRY_DISK_SIZE + diff/1024));
-
- vld_update_volsize (vol, -(ENTRY_DISK_SIZE + diff/1024));
-
- return VOLOP_IUNLINK (vol, &o);
-}
-
-
-/*
- * Open volume that `fd' points to, if volume_hash is loaded try to
- * find the volume in the hash.
- */
-
-int
-vld_open_volume_by_fd (struct dp_part *dp, int fd,
- volume_handle **vol)
-{
- int ret;
- vstatus vs;
-
- ret = vstatus_read (fd, &vs);
- if (ret)
- return ret;
-
- if (volume_htab) {
- volume_handle *r, key;
- key.vol = vs.volid;
-
- r = hashtabsearch (volume_htab, &key);
- if (r == NULL)
- return ENOENT;
- else
- vld_ref (r);
- *vol = r;
- return 0;
- }
-
- ret = vstatus2volume_handle (&vs, dp, vol);
- if (ret)
- return ret;
-
- ret = VOLOP_OPEN((*vol)->type, (*vol)->dp, (*vol)->vol,
- VOLOP_NOFLAGS, &(*vol)->data);
- if (ret)
- vld_free (*vol);
-
- return ret;
-}
-
-/*
- * Make sure info is uptodate
- */
-
-int
-vld_info_uptodatep (volume_handle *vol)
-{
- int ret, fd;
-
- assert (vol);
-
- if (vol->flags.infop)
- return 0;
-
- ret = VOLOP_IOPEN(vol, &vol->sino, O_RDONLY, &fd);
- if (ret)
- return ret;
-
- ret = vol_read_header (fd, &vol->info);
-
- close (fd);
- if (ret == 0)
- vol->flags.infop = TRUE;
- return ret;
-}
-
-int
-vld_info_write (volume_handle *vol)
-{
- int ret, fd;
-
- assert (vol);
-
- ret = VOLOP_IOPEN(vol, &vol->sino, O_WRONLY, &fd);
- if (ret)
- return ret;
-
- ret = vol_write_header (fd, &vol->info);
-
- close (fd);
-
- return ret;
-}
-
-/*
- * check quota and update volume size
- */
-
-int
-vld_update_volsize (volume_handle *vol, int diff) {
- int ret = vld_info_uptodatep(vol);
- if (ret)
- return ret;
-
- if (vol->info.maxquota < vol->info.size + diff)
- return VOVERQUOTA;
-
- vol->info.size += diff;
-
- assert (vol->info.size >= 0);
- ret = vld_info_write (vol);
-
- return ret;
-}
-
-int
-vld_get_volstats (volume_handle *vol,
- struct AFSFetchVolumeStatus *volstat,
- char *volName,
- char *offLineMsg,
- char *motd)
-{
- int ret;
- long availblocks, totalblocks;
-
- ret = vld_info_uptodatep(vol);
- if (ret)
- return ret;
-
- ret = dp_getstats(vol->dp, &availblocks, &totalblocks);
- if (ret)
- return ret;
-
- volstat->Vid = vol->vol;
- volstat->ParentId = vol->info.parentID;
- volstat->Online = !vol->flags.offlinep;
- volstat->InService = vol->info.inUse;
- volstat->Blessed = vol->info.inUse;
- volstat->NeedsSalvage = vol->info.needsSalvaged;
- volstat->Type = vol->type;
- volstat->MinQuota = 0;
- volstat->MaxQuota = vol->info.maxquota;
- volstat->BlocksInUse = vol->info.size;
- volstat->PartBlocksAvail = availblocks;
- volstat->PartMaxBlocks = totalblocks;
-
- strlcpy(volName, vol->info.name, VNAMESIZE);
-
- *offLineMsg = '\0';
- *motd = '\0';
-
- return 0;
-}
-
-int
-vld_set_volstats (volume_handle *vol,
- const struct AFSStoreVolumeStatus *volstat,
- const char *volName,
- const char *offLineMsg,
- const char *motd)
-{
- int ret;
-
- ret = vld_info_uptodatep(vol);
- if (ret)
- return ret;
-
- if ((volstat->Mask & AFS_SETMAXQUOTA)== AFS_SETMAXQUOTA)
- vol->info.maxquota = volstat->MaxQuota;
-
- /* XXX store minquota, volName, offLineMsg, motd */
-
- return 0;
-}
-
-struct collect_volumes_args {
- struct dp_part *dp;
- List *vollist;
-};
-
-static Bool
-vld_collect_volumes (void *ptr, void *arg)
-{
- volume_handle *vol = (volume_handle *) ptr;
- struct collect_volumes_args *args = (struct collect_volumes_args *) arg;
- List *vollist = args->vollist;
- struct dp_part *dp = args->dp;
-
- vld_open_volume_by_handle (dp, vol);
-
- listaddtail(vollist, vol);
-
- return 0;
-}
-
-int
-vld_list_volumes(struct dp_part *dp, List **retlist)
-{
- struct collect_volumes_args args;
- List *vollist;
-
- vollist = listnew();
-
- if (vollist == NULL)
- return ENOMEM;
-
- args.vollist = vollist;
- args.dp = dp;
-
- hashtabforeach(volume_htab, vld_collect_volumes, &args);
- *retlist = vollist;
-
- return 0;
-}
-
-/*
- * Shutdown time
- */
-
-void
-vld_end (void)
-{
- /* XXX flush volume_htab to disk */
-
- return;
-}
-
-int
-restore_file(struct rx_call *call,
- uint32_t vnode,
- uint32_t uniq,
- uint32_t length,
- uint32_t dataversion,
- uint32_t author,
- uint32_t owner,
- uint32_t group,
- uint32_t parent,
- uint32_t client_date,
- uint32_t server_date,
- uint16_t nlinks,
- uint16_t mode,
- uint8_t type,
- volume_handle *vol,
- int32_t *acl)
-{
- int ret;
- struct voldb *db;
- int (*convert_afs2local)(int32_t);
- struct voldb_entry e;
- AFSFid node;
- onode_opaque ino;
- node_type ntype;
- struct mnode *n;
- int i;
- int exists;
-
- switch (type) {
- case TYPE_DIR:
- db = VLD_VOLH_DIR(vol);
- convert_afs2local = dir_afs2local;
- ntype = NODE_DIR;
- break;
- case TYPE_FILE:
- case TYPE_LINK:
- db = VLD_VOLH_FILE(vol);
- convert_afs2local = file_afs2local;
- ntype = NODE_REG;
- break;
- default:
- abort();
- }
-
- node.Volume = vol->vol;
- node.Vnode = vnode;
- node.Unique = uniq;
-
-#if 0
- printf("create_file: %u %u %u %u %u %u %u %u %u %u %u %u %u\n",
- vnode, uniq, length,
- dataversion, author, owner, group, parent, client_date,
- server_date, (uint32_t) nlinks, (uint32_t) mode,
- (uint32_t) type);
-#endif
-
- ret = voldb_expand(db, convert_afs2local(vnode));
- if (ret)
- return ret;
-
- ret = voldb_get_entry(db, convert_afs2local(vnode), &e);
- if (ret)
- return ret;
-
- if (type == TYPE_DIR)
- exists = (e.u.dir.nextptr == VOLDB_ENTRY_USED);
- else
- exists = (e.u.file.nextptr == VOLDB_ENTRY_USED);
-
- if (exists) {
- onode_opaque o;
-
- ret = voldb_del_entry(db, convert_afs2local(vnode), &o);
- if (ret)
- return ret;
- VOLOP_IUNLINK(vol, &o);
- }
-
- e.type = type;
-
- ret = mnode_find(&node, &n);
- if (ret)
- return ret;
-
- ret = VOLOP_ICREATE(vol, &ino, ntype, n);
- if (ret)
- return ret;
-
- if (type == TYPE_DIR) {
- e.u.dir.nextptr = VOLDB_ENTRY_USED;
- e.u.dir.ino = ino;
- e.u.dir.FileType = type;
- e.u.dir.LinkCount = nlinks;
- e.u.dir.DataVersion = dataversion;
- e.u.dir.Length = length;
- e.u.dir.Author = author;
- e.u.dir.Owner = owner;
- e.u.dir.Group = group;
- e.u.dir.ParentVnode = parent;
- e.u.dir.ParentUnique = 0 /* XXX */;
- e.u.dir.ServerModTime = server_date;
- e.u.dir.UnixModeBits = 0x40000 | mode;
- e.u.dir.InterfaceVersion = 1;
- memset (e.u.dir.acl, 0,
- sizeof (e.u.dir.acl));
- memset (e.u.dir.negacl, 0,
- sizeof (e.u.dir.negacl));
- {
-#if 0
- int32_t size = ntohl(acl[0]);
- int32_t version = ntohl(acl[1]);
- int32_t total = ntohl(acl[2]);
-#endif
- int32_t positive = ntohl(acl[3]);
- int32_t negative = ntohl(acl[4]);
- if (positive <= FS_MAX_ACL && negative <= FS_MAX_ACL) {
- for (i = 0; i < positive; i++) {
- e.u.dir.acl[i].owner = ntohl(acl[i*2+5]);
- e.u.dir.acl[i].flags = ntohl(acl[i*2+6]);
- }
- for (i = 0; i < negative; i++) {
- e.u.dir.negacl[i].owner = ntohl(acl[(i+positive)*2+5]);
- e.u.dir.negacl[i].flags = ntohl(acl[(i+positive)*2+6]);
- }
- }
- }
- ret = voldb_put_acl (db, convert_afs2local(vnode), &e.u.dir);
- if (ret)
- return ret;
- } else {
- e.u.file.nextptr = VOLDB_ENTRY_USED;
- e.u.file.ino = ino;
- e.u.file.FileType = type;
- e.u.file.LinkCount = nlinks;
- e.u.file.DataVersion = dataversion;
- e.u.file.Length = length;
- e.u.file.Author = author;
- e.u.file.Owner = owner;
- e.u.file.Group = group;
- e.u.file.ParentVnode = parent;
- e.u.file.ParentUnique = 0 /* XXX */;
- e.u.file.ServerModTime = server_date;
- e.u.file.UnixModeBits = mode;
- e.u.dir.InterfaceVersion = 1;
- }
-
- ret = voldb_put_entry(db, convert_afs2local(vnode), &e);
- if (ret)
- return ret;
-
- ret = vld_update_volsize (vol, ENTRY_DISK_SIZE + length/1024);
- if (ret)
- return ret;
-
- ret = ftruncate(n->fd, length);
- if (ret)
- return errno;
-
- ret = copyrx2fd (call, n->fd, 0, length);
- if (ret)
- return ret;
-
- mnode_free (n, FALSE);
-
- return 0;
-}
-
-int
-vld_rebuild (struct volume_handle *vol)
-{
- int ret;
-
- assert (vol->flags.voldbp);
-
- ret = voldb_rebuild (VLD_VOLH_DIR(vol));
-
- if (ret)
- return ret;
-
- ret = voldb_rebuild (VLD_VOLH_FILE(vol));
-
- return ret;
-}
-
-static int vld_check_quota (volume_handle *vol, int diff)
-{
- int ret;
-
- ret = vld_info_uptodatep(vol);
- if (ret)
- return ret;
-
- if (vol->info.maxquota < vol->info.size + diff)
- return VOVERQUOTA;
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/milko/lib/vld/vld.h b/usr.sbin/afs/src/milko/lib/vld/vld.h
deleted file mode 100644
index d68d8672a6b..00000000000
--- a/usr.sbin/afs/src/milko/lib/vld/vld.h
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: vld.h,v 1.32 2002/02/07 17:59:52 lha Exp $ */
-
-#ifndef MILKO_VLD_H
-#define MILKO_VLD_H 1
-
-#include <dpart.h>
-#include <voldb.h>
-
-#include <fs.h>
-#include <volumeserver.h>
-
-#include <fbuf.h>
-#include <list.h>
-
-#include <mnode.h>
-
-/*
- * Type of volumes
- */
-
-#define VLD_SVOL 0
-#define VLD_FVOL 1
-
-/*
- * structures
- */
-
-#define VLD_VOLH_DIR(volh) ((volh)->db[0])
-#define VLD_VOLH_FILE(volh) ((volh)->db[1])
-
-#define VLD_VOLH_NUM(volh) ((volh)->vol)
-
-typedef struct volume_handle {
- int type; /* type of volume backstore */
- int voldbtype; /* type of voldb structures */
- uint32_t vol; /* volume number */
- int ref; /* refcount */
- struct dp_part *dp; /* on what partition the volume resides */
- void *data; /* data blob for volume type */
- volintInfo info; /* info struct */
- struct {
- unsigned infop:1; /* if there is valid info in node */
- unsigned voldbp:1; /* if voldb has been read in */
- unsigned offlinep:1; /* if volume is offline */
- unsigned salvaged:1; /* if volume is salvaged */
- unsigned attacherr:1; /* volume had an error when attaching */
- unsigned cleanp:1; /* volume was cleanly mounted */
- } flags ;
- onode_opaque sino; /* inode number of volume entry */
- onode_opaque dino; /* inode number of db of dirs */
- onode_opaque fino; /* inode number of db of files */
- struct voldb *db[2]; /* large and small mnode tables */
- Listitem *db_li; /* position in db_lru */
- Listitem *li; /* position on the vol_list */
-} volume_handle;
-
-struct trans {
- int32_t tid;
- int32_t time; /* last active */
- int32_t creationTime;
- int32_t returnCode;
- volume_handle *volume;
- int32_t volid;
- int32_t partition;
- int16_t refCount;
- int16_t iflags;
- int8_t vflags;
- int8_t tflags;
- int8_t incremental;
-};
-
-typedef enum { NODE_REG = 1, NODE_DIR = 2,
- NODE_META = 3, NODE_VOL = 4 } node_type;
-
-typedef struct volume_operations {
- char *name;
- int (*open)(struct dp_part *part, int32_t volid,
- int flags, void **vol);
-#define VOLOP_NOFLAGS 0x0
-#define VOLOP_CREATE 0x1
- void (*free)(volume_handle *vol);
- int (*icreate)(volume_handle *vol, onode_opaque *o, node_type type,
- struct mnode *node);
- int (*iopen)(volume_handle *vol, onode_opaque *o, int flags, int *fd);
- int (*iunlink)(volume_handle *vol, onode_opaque *o);
- int (*remove)(volume_handle *vol);
-} vol_op;
-
-enum { VOLCREAT_NOOP = 0, /* noop */
- VOLCREAT_CREATE_ROOT = 1 /* create rootnode */
-};
-
-
-int
-vld_boot (void);
-
-int
-vld_init (void);
-
-void
-vld_iter_vol (int (*func)(volume_handle *vol, void *arg), void *arg);
-
-void
-vld_free (volume_handle *vol);
-
-void
-vld_ref (volume_handle *vol);
-
-int
-vld_register_backstore_type (const int32_t backstoretype, vol_op *ops);
-
-int
-vld_create_trans(int32_t partition, int32_t volume, int32_t *trans);
-
-int
-vld_get_trans(int32_t transid, struct trans **trans);
-
-int
-vld_put_trans(struct trans *trans);
-
-int
-vld_verify_trans(int32_t trans);
-
-int
-vld_check_busy(int32_t volid, int32_t partition);
-
-int
-vld_trans_set_iflags(int32_t trans, int32_t iflags);
-
-int
-vld_trans_set_vflags(int32_t trans, int32_t vflags);
-
-int
-vld_trans_get_vflags(int32_t trans, int32_t *vflags);
-
-int
-vld_register_vol_type (const int32_t backstoretype, vol_op *ops);
-
-int
-vld_end_trans(int32_t trans, int32_t *rcode);
-
-int
-vld_find_vol (const int32_t volid, struct volume_handle **vld);
-
-int
-vld_create_volume (struct dp_part *dp, int32_t volid,
- const char *name, int32_t backstoretype, int32_t voltype,
- int flags);
-
-const char *
-vld_backstoretype_name (int32_t backstoretype);
-
-int
-vld_vld2volsync (const struct volume_handle *vld, AFSVolSync *volsync);
-
-int
-vld_open_volume_by_num (struct dp_part *dp, int32_t volid,
- volume_handle **vol);
-
-int
-vld_open_volume_by_fd (struct dp_part *dp, int fd,
- volume_handle **vol);
-
-int
-vld_open_inode (volume_handle *vol, onode_opaque *o, int flags, int *fd);
-
-int
-vld_info_uptodatep (volume_handle *vol);
-
-int
-vld_info_write (volume_handle *vol);
-
-int
-vld_db_uptodate (volume_handle *vol);
-
-int
-vld_open_vnode (volume_handle *vol, struct mnode *n, struct msec *m);
-
-int
-vld_modify_vnode (volume_handle *vol, struct mnode *n, struct msec *m,
- const AFSStoreStatus *ss, int32_t *len);
-
-int
-vld_put_acl (volume_handle *vol, struct mnode *n, struct msec *m);
-
-int
-vld_check_rights (volume_handle *vol, struct mnode *n,
- struct msec *m);
-
-int
-vld_adjust_linkcount (volume_handle *vol, struct mnode *n, int adjust);
-
-int
-vld_set_onode (volume_handle *vol, int32_t vno, onode_opaque *new,
- onode_opaque *old);
-
-int
-vld_create_entry (volume_handle *vol, struct mnode *parent, AFSFid *child,
- int type, const AFSStoreStatus *ss, struct mnode **ret_n,
- struct msec *m);
-
-int
-vld_remove_node (volume_handle *vol, struct mnode *n);
-
-int
-vld_db_flush (volume_handle *vol);
-
-int
-vld_list_volumes(struct dp_part *dp, List **retlist);
-
-int
-vld_delete_volume (struct dp_part *dp, int32_t volid,
- int32_t backstoretype,
- int flags);
-
-void
-vld_end (void);
-
-int
-vld_fvol_create_volume_ondisk (struct dp_part *dp, int32_t volid,
- const char *path);
-
-int
-vld_get_volstats (volume_handle *vol,
- struct AFSFetchVolumeStatus *volstat,
- char *volName,
- char *offLineMsg,
- char *motd);
-
-int
-vld_set_volstats (volume_handle *vol,
- const struct AFSStoreVolumeStatus *volstat,
- const char *volName,
- const char *offLineMsg,
- const char *motd);
-
-int
-restore_file(struct rx_call *call,
- uint32_t vnode,
- uint32_t uniq,
- uint32_t length,
- uint32_t dataversion,
- uint32_t author,
- uint32_t owner,
- uint32_t group,
- uint32_t parent,
- uint32_t client_date,
- uint32_t server_date,
- uint16_t nlinks,
- uint16_t mode,
- uint8_t type,
- volume_handle *vol,
- int32_t *acl);
-
-int
-vld_rebuild (struct volume_handle *vol);
-
-int
-vld_foreach_dir (struct volume_handle *volh,
- int (*func)(int fd,
- uint32_t vnode,
- uint32_t uniq,
- uint32_t length,
- uint32_t dataversion,
- uint32_t author,
- uint32_t owner,
- uint32_t group,
- uint32_t parent,
- uint32_t client_date,
- uint32_t server_date,
- uint16_t nlinks,
- uint16_t mode,
- uint8_t type,
- int32_t *acl,
- void *arg),
- void *arg);
-
-int
-vld_foreach_file (struct volume_handle *volh,
- int (*func)(int fd,
- uint32_t vnode,
- uint32_t uniq,
- uint32_t length,
- uint32_t dataversion,
- uint32_t author,
- uint32_t owner,
- uint32_t group,
- uint32_t parent,
- uint32_t client_date,
- uint32_t server_date,
- uint16_t nlinks,
- uint16_t mode,
- uint8_t type,
- int32_t *acl,
- void *arg),
- void *arg);
-
-/*
- * This function is internal to vld and vol modules.
- *
- * Use otherwise and die.
- */
-
-int
-volop_iopen (volume_handle *vol, onode_opaque *o, struct mnode *n);
-
-#endif /* MILKO_VLD_H */
-
diff --git a/usr.sbin/afs/src/milko/lib/vld/vld_ops.h b/usr.sbin/afs/src/milko/lib/vld/vld_ops.h
deleted file mode 100644
index 97ae56a630e..00000000000
--- a/usr.sbin/afs/src/milko/lib/vld/vld_ops.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#define VOLOP_OPEN(type,part,volid,flags,vol) \
- ((backstoretypes[(type)]->open)((part),(volid),(flags),(vol)))
-#define VOLOP_FREE(vol) \
- ((backstoretypes[(vol)->type]->free)(vol))
-#define VOLOP_ICREATE(vol,ino,ntype,node) \
- ((backstoretypes[(vol)->type]->icreate)((vol),(ino),(ntype),(node)))
-#define VOLOP_IOPEN(vol,ino,flags,fd) \
- ((backstoretypes[(vol)->type]->iopen)((vol),(ino),(flags),(fd)))
-#define VOLOP_IUNLINK(vol,ino) \
- ((backstoretypes[(vol)->type]->iunlink)(vol,ino))
-#define VOLOP_REMOVE(vol) \
- ((backstoretypes[(vol)->type]->remove)(vol))
-#define VOLOP_TRUNCATE(vol,len) \
- ((backstoretypes[(vol)->type]->truncate)(vol,len))
-
-
-#define VLD_MAX_BACKSTORE_TYPES 10
-
-extern vol_op *backstoretypes[VLD_MAX_BACKSTORE_TYPES];
-
-int32_t dir_afs2local (int32_t vno);
-int32_t dir_local2afs (int32_t vno);
-int32_t file_afs2local (int32_t vno);
-int32_t file_local2afs (int32_t vno);
diff --git a/usr.sbin/afs/src/milko/lib/voldb/Makefile.in b/usr.sbin/afs/src/milko/lib/voldb/Makefile.in
deleted file mode 100644
index 39d937269c3..00000000000
--- a/usr.sbin/afs/src/milko/lib/voldb/Makefile.in
+++ /dev/null
@@ -1,107 +0,0 @@
-#
-# $KTH: Makefile.in,v 1.8 2000/12/29 20:16:00 tol Exp $
-#
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_builddir = ../../..
-VPATH = @srcdir@
-
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-INCLUDES = -I. \
- -I$(srcdir) \
- -I$(srcdir)/../../fs \
- -I$(srcdir)/../../.. \
- -I../../../rxdef \
- -I../../../include \
- -I$(srcdir)/../dpart \
- -I../vstatus \
- -I$(srcdir)/../vstatus \
- $(KRB4_INC_FLAGS) \
- -I$(srcdir)/../../../include
-
-CFLAGS = @CFLAGS@
-KRB4_INC_FLAGS= @KRB4_INC_FLAGS@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-sysconfdir = @sysconfdir@
-ARLACACHEDIR = @ARLACACHEDIR@
-ARLACONFFILE = @ARLACONFFILE@
-
-#PICFLAGS = @PICFLAGS@
-
-LIBNAME = $(LIBPREFIX)voldb
-#LIBEXT = @LIBEXT@
-LIBEXT = a
-#SHLIBEXT = @SHLIBEXT@
-#LIBPREFIX = @LIBPREFIX@
-LIBPREFIX = lib
-#LDSHARED = @LDSHARED@
-LIB = $(LIBNAME).$(LIBEXT)
-
-DEFS = @DEFS@
-
-LIB_SOURCES = voldb.c vdb_flat.c vol.c
-
-SOURCES = $(LIB_SOURCES)
-
-LIB_OBJECTS = voldb.o vdb_flat.o vol.o
-
-OBJECTS = $(LIB_OBJECTS)
-
-all: $(LIB)
-
-Wall:
- make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS) $(PICFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
- $(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/$(LIB)
-
-uninstall:
- rm -f $(DESTDIR)$(libdir)/$(LIB)
-
-TAGS: $(SOURCES)
- etags $(SOURCES)
-
-check:
-
-clean:
- rm -f $(LIB) $(PROGS) *.o *.a
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *~
-
-realclean: distclean
- rm -f TAGS
-
-$(LIBNAME).a: $(LIB_OBJECTS)
- rm -f $@
- $(AR) cr $@ $(LIB_OBJECTS)
- -$(RANLIB) $@
-
-#$(LIBNAME).$(SHLIBEXT): $(LIB_OBJECTS)
-# rm -f $@
-# $(LDSHARED) -o $@ $(LIB_OBJECTS)
-
-$(OBJECTS): ../../../include/config.h
-
-Makefile: Makefile.in ../../../config.status
- cd ../../..; CONFIG_FILES=milko/lib/voldb/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-
-.PHONY: all install uninstall check clean mostlyclean distclean realclean
diff --git a/usr.sbin/afs/src/milko/lib/voldb/vdb_flat.c b/usr.sbin/afs/src/milko/lib/voldb/vdb_flat.c
deleted file mode 100644
index d35d647c20a..00000000000
--- a/usr.sbin/afs/src/milko/lib/voldb/vdb_flat.c
+++ /dev/null
@@ -1,1010 +0,0 @@
-/*
- * Copyright (c) 1999 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-
-/*
- * simple flat db for the vnodes
- */
-
-#include "voldb_locl.h"
-#include "voldb_internal.h"
-
-RCSID("$arla: vdb_flat.c,v 1.19 2002/02/07 17:59:54 lha Exp $");
-
-
-static int vdbflat_init (int fd, struct voldb *db, int createp);
-static int vdbflat_close (struct voldb *db);
-static int vdbflat_get_dir (struct voldb *db, const uint32_t num,
- struct voldb_dir_entry *e);
-static int vdbflat_put_dir (struct voldb *db, const uint32_t num,
- struct voldb_dir_entry *e);
-static int vdbflat_put_acl (struct voldb *db, uint32_t num,
- struct voldb_dir_entry *e);
-static int vdbflat_get_file (struct voldb *db, const uint32_t num,
- struct voldb_file_entry *e);
-static int vdbflat_put_file (struct voldb *db, const uint32_t num,
- struct voldb_file_entry *e);
-static int vdbflat_extend_db (struct voldb *db, unsigned int num);
-static int vdbflat_flush (struct voldb *db);
-static int vdbflat_new_entry (struct voldb *db, uint32_t *num,
- uint32_t *unique);
-static int vdbflat_del_entry (struct voldb *db, const uint32_t num,
- onode_opaque *ino);
-static int vdbflat_write_header (struct voldb *db, void *d, size_t sz);
-
-/*
- * Various internal data definitions
- */
-
-#define VOLDB_FILE_SIZE (19*4+404)
-#define VOLDB_DIR_SIZE (VOLDB_FILE_SIZE+(FS_MAX_ACL*2*2*4))
-/* (negative + positive) * 2 entries * int32_t */
-
-/*
- * Various internal data structures
- */
-
-typedef struct vdbflat {
- int32_t freeptr;
- void *ptr;
- union {
- struct voldb_file_entry *file;
- struct voldb_dir_entry *dir;
- } u;
-} vdbflat;
-
-static void
-set_volhdr_union_ptr (struct voldb *db)
-{
- vdbflat *vdb = (vdbflat *) db->ptr;
-
- if (db->hdr.flags & VOLDB_DIR)
- vdb->u.dir = (struct voldb_dir_entry *)
- ((unsigned char *) ((vdbflat *)db->ptr)->ptr + VOLDB_HEADER_SIZE);
- else if (db->hdr.flags & VOLDB_FILE)
- vdb->u.file = (struct voldb_file_entry *)
- ((unsigned char *) ((vdbflat *)db->ptr)->ptr + VOLDB_HEADER_SIZE);
- else
- abort();
-}
-
-/*
- * boot up the db
- * `fd' is a file descriptor to a db that is returned in `db'.
- * `fd' is saved if everythings works out ok, otherwise its
- * up to the caller to close it.
- */
-
-static int
-vdbflat_init (int fd, struct voldb *db, int createp)
-{
- vdbflat *vdb;
- uint32_t i;
- int size;
- int ret;
- unsigned char *data;
-
- assert (db);
- assert (db->size >= VOLDB_HEADER_SIZE);
-
- vdb = calloc (1, sizeof(*vdb));
- if (vdb == NULL)
- return ENOMEM; /* XXX */
-
- vdb->ptr = mmap (NULL, db->size, PROT_READ|PROT_WRITE,
- MAP_SHARED, fd, 0);
- if (vdb->ptr == (void *)MAP_FAILED) {
- free (vdb);
- return (errno);
- }
-
- /* If we are being created, there is no sane data on disk */
- if (createp) {
- vdb->freeptr = VOLDB_FREELIST_END;
- } else {
- /* Let the above layer parse the header */
- voldb_parse_header (db, vdb->ptr, VOLDB_HEADER_HALF);
-
- /* Now parse the second half */
- data = ((unsigned char *)vdb->ptr) + VOLDB_HEADER_HALF;
- memcpy (&i, data, sizeof(i));
- vdb->freeptr = ntohl (i);
- }
-
- /* Do some sanity checking */
- if ((db->hdr.flags & (VOLDB_FILE|VOLDB_DIR)) == VOLDB_FILE)
- size = VOLDB_FILE_SIZE;
- else if ((db->hdr.flags & (VOLDB_FILE|VOLDB_DIR)) == VOLDB_DIR)
- size = VOLDB_DIR_SIZE;
- else {
- ret = munmap (vdb->ptr, db->size);
- assert (ret == 0);
- free (vdb);
- return EIO;
- }
-
- if ((db->size - VOLDB_HEADER_SIZE) % size != 0) {
- ret = munmap (vdb->ptr, db->size);
- assert (ret == 0);
- free(vdb);
- return EIO;
- }
-
- if (db->hdr.num != (db->size - VOLDB_HEADER_SIZE) / size) {
- ret = munmap (vdb->ptr, db->size);
- assert (ret == 0);
- free(vdb);
- return EINVAL;
- }
-
- /* All done setup pointers */
-
- db->ptr = vdb;
-
- set_volhdr_union_ptr (db);
-
- return 0;
-}
-
-/*
- * closes the db
- * The saved `fd' is also closed.
- */
-
-static int
-vdbflat_close (struct voldb *db)
-{
- vdbflat *vdb;
- int ret;
-
- assert (db);
-
- assert (db->hdr.magic = VOLDB_MAGIC_HEADER);
-
- vdb = (vdbflat *) db->ptr;
- db->ptr = NULL;
-
- ret = msync (vdb->ptr, db->size, MS_SYNC);
- assert (ret == 0);
- ret = munmap (vdb->ptr, db->size);
-
- free (vdb);
- if (ret)
- return errno;
-
- close (db->fd);
-
- return 0;
-}
-
-
-/*
- * fetch num'th dir entry (n is 0 based), convert it
- * to hostorder and store it in `e'.
- */
-
-static int
-vdbflat_get_dir (struct voldb *db,
- const uint32_t num,
- struct voldb_dir_entry *e)
-{
- vdbflat *vdb = (vdbflat *) db->ptr;
- size_t len;
-
- assert (db && e);
-
- if ((db->hdr.flags & VOLDB_DIR) == 0)
- return EINVAL; /* XXX */
-
- if (db->hdr.num < num)
- return EINVAL; /* XXX */
-
-#if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN && 0
- memcpy (e, &vdb->u.dir[num], sizeof (*e));
-#else
- {
- uint32_t tmp;
- int i;
- unsigned char *ptr =
- ((unsigned char *)vdb->u.dir) +
- VOLDB_DIR_SIZE * num;
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->nextptr = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->unique = ntohl(tmp); ptr += sizeof(tmp);
-
- len = ONODE_OPAQUE_SIZE;
- ydr_decode_onode_opaque (&e->ino, ptr, &len);
- ptr += ONODE_OPAQUE_SIZE - len;
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->spare2 = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->InterfaceVersion = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->FileType = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->LinkCount = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->Length = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->spare3 = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->DataVersion = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->Author = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->Owner = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->UnixModeBits = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->ParentVnode = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->ParentUnique = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->SegSize = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->ServerModTime = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->spare4 = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->Group = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->spare5 = ntohl(tmp); ptr += sizeof(tmp);
-
- for (i = 0 ; i < FS_MAX_ACL; i++) {
- memcpy (&tmp, ptr, sizeof(tmp));
- e->negacl[i].owner = ntohl(tmp); ptr += sizeof(tmp);
- memcpy (&tmp, ptr, sizeof(tmp));
- e->negacl[i].flags = ntohl(tmp); ptr += sizeof(tmp);
- }
- for (i = 0 ; i < FS_MAX_ACL; i++) {
- memcpy (&tmp, ptr, sizeof(tmp));
- e->acl[i].owner = ntohl(tmp); ptr += sizeof(tmp);
- memcpy (&tmp, ptr, sizeof(tmp));
- e->acl[i].flags = ntohl(tmp); ptr += sizeof(tmp);
- }
- }
-#endif
- return 0;
-}
-
-/*
- * store e as num'th dir entry (n is 0 based), convert it to
- * network order. DO NOT STORE the ACL.
- */
-
-int
-vdbflat_put_dir (struct voldb *db,
- const uint32_t num,
- struct voldb_dir_entry *e)
-{
- vdbflat *vdb = (vdbflat *) db->ptr;
-
- assert (db && e);
-
- if ((db->hdr.flags & VOLDB_DIR) == 0)
- return EINVAL; /* XXX */
-
- if (db->hdr.num < num)
- return EINVAL; /* XXX */
-
-#if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN && 0
- memcpy (&vdb->u.dir[num], e, sizeof (*e));
-#else
- {
- uint32_t tmp;
- size_t len;
- unsigned char *ptr =
- ((unsigned char *)vdb->u.dir) +
- VOLDB_DIR_SIZE * num;
-
- tmp = htonl(e->nextptr);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->unique);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- len = ONODE_OPAQUE_SIZE;
- ydr_encode_onode_opaque (&e->ino, ptr, &len);
- ptr += ONODE_OPAQUE_SIZE - len;
-
- tmp = htonl(e->spare2);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->InterfaceVersion);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->FileType);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->LinkCount);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->Length);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->spare3);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->DataVersion);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->Author);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->Owner);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->UnixModeBits);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->ParentVnode);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->ParentUnique);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->SegSize);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->ServerModTime);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->spare4);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->Group);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->spare5);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
- }
-#endif
- return 0;
-}
-
-/*
- * store e as num'th acl entry (n is 0 based), convert it to
- * network order.
- */
-
-static int
-vdbflat_put_acl (struct voldb *db, uint32_t num, struct voldb_dir_entry *e)
-{
- vdbflat *vdb = (vdbflat *) db->ptr;
-
- assert (db && e);
-
- if ((db->hdr.flags & VOLDB_DIR) == 0)
- return EINVAL; /* XXX */
-
- if (db->hdr.num < num)
- return EINVAL; /* XXX */
-
-#if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN && 0
- memcpy ((char *)&vdb->u.dir[num] + VOLDB_FILE_SIZE, &e->acl,
- sizeof (*e->negacl) + sizeof (*e->acl));
-#else
- {
- uint32_t tmp;
- unsigned char *ptr =
- ((unsigned char *)vdb->u.dir) +
- VOLDB_DIR_SIZE * num;
- int i;
-
- ptr += VOLDB_FILE_SIZE;
-
- for (i = 0 ; i < FS_MAX_ACL; i++) {
- tmp = htonl(e->negacl[i].owner);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
- tmp = htonl(e->negacl[i].flags);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
- }
- for (i = 0 ; i < FS_MAX_ACL; i++) {
- tmp = htonl(e->acl[i].owner);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
- tmp = htonl(e->acl[i].flags);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
- }
- }
-#endif
- return 0;
-}
-
-
-/*
- * fetch num'th file entry (n is 0 based), convert it
- * to hostorder and store it in `e'.
- */
-
-static int
-vdbflat_get_file (struct voldb *db, uint32_t num, struct voldb_file_entry *e)
-{
- vdbflat *vdb = (vdbflat *) db->ptr;
-
- assert (db && e);
-
- if ((db->hdr.flags & VOLDB_FILE) == 0)
- return EINVAL; /* XXX */
-
- if (db->hdr.num < num)
- return EINVAL; /* XXX */
-
-#if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN && 0
- memcpy (e, &vdb->u.file[num], sizeof (*e));
-#else
- {
- uint32_t tmp;
- size_t len;
- unsigned char *ptr =
- ((unsigned char *)vdb->u.file) +
- VOLDB_FILE_SIZE * num;
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->nextptr = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->unique = ntohl(tmp); ptr += sizeof(tmp);
-
- len = ONODE_OPAQUE_SIZE;
- ydr_decode_onode_opaque (&e->ino, ptr, &len);
- ptr += ONODE_OPAQUE_SIZE - len;
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->spare2 = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->InterfaceVersion = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->FileType = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->LinkCount = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->Length = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->spare3 = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->DataVersion = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->Author = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->Owner = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->UnixModeBits = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->ParentVnode = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->ParentUnique = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->SegSize = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->ServerModTime = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->spare4 = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->Group = ntohl(tmp); ptr += sizeof(tmp);
-
- memcpy (&tmp, ptr, sizeof(tmp));
- e->spare5 = ntohl(tmp); ptr += sizeof(tmp);
- }
-#endif
- return 0;
-}
-
-/*
- * store e as num'th file entry (n is 0 based), convert it to
- * network order.
- */
-
-int
-vdbflat_put_file (struct voldb *db, uint32_t num, struct voldb_file_entry *e)
-{
- vdbflat *vdb = (vdbflat *) db->ptr;
-
- assert (db && e);
-
- if ((db->hdr.flags & VOLDB_FILE) == 0)
- return EINVAL; /* XXX */
-
- if (db->hdr.num < num)
- return EINVAL; /* XXX */
-
-#if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN && 0
- memcpy (&vdb->u.file[num], e, sizeof (*e));
-#else
- {
- uint32_t tmp;
- size_t len;
- unsigned char *ptr =
- ((unsigned char *)vdb->u.file) +
- VOLDB_FILE_SIZE * num;
-
- tmp = htonl(e->nextptr);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->unique);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- len = ONODE_OPAQUE_SIZE;
- ydr_encode_onode_opaque (&e->ino, ptr, &len);
- ptr += ONODE_OPAQUE_SIZE - len;
-
- tmp = htonl(e->spare2);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->InterfaceVersion);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->FileType);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->LinkCount);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->Length);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->spare3);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->DataVersion);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->Author);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->Owner);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->UnixModeBits);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->ParentVnode);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->ParentUnique);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->SegSize);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->ServerModTime);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->spare4);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->Group);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
-
- tmp = htonl(e->spare5);
- memcpy (ptr, &tmp, sizeof(tmp)); ptr += sizeof(tmp);
- }
-#endif
- return 0;
-}
-
-/*
- * Extend the db and add more entries.
- */
-
-static int
-vdbflat_extend_db (struct voldb *db, unsigned int num)
-{
- int dirp = 0, ret;
- size_t newsize;
- uint32_t oldnum = db->hdr.num;
- vdbflat *vdb = db->ptr;
-
- if (db->hdr.magic != VOLDB_MAGIC_HEADER)
- return EINVAL; /* XXX */
-
- if ((db->hdr.flags & (VOLDB_FILE|VOLDB_DIR)) == VOLDB_DIR) {
- dirp = 1;
- newsize = db->size + num * VOLDB_DIR_SIZE;
- } else if ((db->hdr.flags & (VOLDB_FILE|VOLDB_DIR)) == VOLDB_FILE)
- newsize = db->size + num * VOLDB_FILE_SIZE;
- else
- return EINVAL; /* XXX */
-
- ret = munmap (vdb->ptr, db->size);
- if (ret)
- return errno;
-
- ret = ftruncate (db->fd, newsize);
- if (ret)
- return errno;
-
- db->size = newsize;
- db->hdr.num += num;
-
- vdb->ptr = mmap (NULL, db->size, PROT_READ|PROT_WRITE,
- MAP_SHARED, db->fd, 0);
- if (vdb->ptr == (void *)MAP_FAILED)
- return errno; /* XXX */
-
- set_volhdr_union_ptr (db);
-
- if (dirp) {
- uint32_t i = oldnum;
- struct voldb_dir_entry e;
-
- memset (&e, 0, sizeof (e));
- e.FileType = 0;
-
- while (i < db->hdr.num) {
- if (i < db->hdr.num - 1)
- e.nextptr = i + 1;
- else
- e.nextptr = vdb->freeptr;
- ret = voldb_put_dir (db, i, &e);
- i++;
- if (ret) {
- abort(); /* XXX need ftruncate and remap */
- return ret;
- }
- }
- } else {
- uint32_t i = oldnum;
- struct voldb_file_entry e;
-
- memset (&e, 0, sizeof (e));
- e.FileType = 0;
-
- while (i < db->hdr.num) {
- if (i < db->hdr.num - 1)
- e.nextptr = i + 1;
- else
- e.nextptr = vdb->freeptr;
- ret = voldb_put_file (db, i, &e);
- i++;
- if (ret) {
- abort(); /* XXX need ftruncate and remap */
- return ret;
- }
- }
- }
-
- vdb->freeptr = oldnum;
-
- ret = voldb_write_hdr (db->fd, db);
- if (ret)
- return errno;
-
- return 0;
-}
-
-int
-vdbflat_new_entry (struct voldb *db, uint32_t *num, uint32_t *unique)
-{
- uint32_t oldfreeptr, newfreeptr, newunique;
- vdbflat *vdb = db->ptr;
- int ret;
-
- if (vdb->freeptr == VOLDB_FREELIST_END) {
- ret = vdbflat_extend_db (db, VOLDB_ENTEND_NUM);
- if (ret)
- return ret;
- }
-
- oldfreeptr = vdb->freeptr;
-
- if ((db->hdr.flags & VOLDB_DIR) == VOLDB_DIR) {
- struct voldb_dir_entry e;
-
- ret = voldb_get_dir (db, oldfreeptr, &e);
- if (ret)
- return ret;
-
- assert(e.nextptr != VOLDB_ENTRY_USED);
- newfreeptr = e.nextptr;
- newunique = ++e.unique;
- e.nextptr = VOLDB_ENTRY_USED;
- e.FileType = TYPE_DIR;
-
- ret = voldb_put_dir (db, oldfreeptr, &e);
- if (ret)
- return ret;
-
- } else if ((db->hdr.flags & VOLDB_FILE) == VOLDB_FILE) {
- struct voldb_file_entry e;
-
- ret = voldb_get_file (db, oldfreeptr, &e);
- if (ret)
- return ret;
-
- assert(e.nextptr != VOLDB_ENTRY_USED);
- newfreeptr = e.nextptr;
- newunique = ++e.unique;
- e.nextptr = VOLDB_ENTRY_USED;
- e.FileType = TYPE_FILE;
-
- ret = voldb_put_file (db, oldfreeptr, &e);
- if (ret)
- return ret;
- } else
- abort();
-
- vdb->freeptr = newfreeptr;
-
- ret = voldb_write_hdr (db->fd, db);
- if (ret)
- return ret;
-
- *num = oldfreeptr;
- *unique = newunique;
-
- return 0;
-}
-
-/*
- * In database `db' add entry `num' to the freelist,
- * return the allocated inode `ino' that was associated
- * with `num'.
- */
-
-static int
-vdbflat_del_entry (struct voldb *db,
- const uint32_t num,
- onode_opaque *ino)
-{
- vdbflat *vdb = db->ptr;
- int ret;
-
- if ((db->hdr.flags & (VOLDB_DIR|VOLDB_FILE)) == VOLDB_DIR) {
- struct voldb_dir_entry e;
-
- ret = voldb_get_dir (db, num, &e);
- if (ret)
- return ret;
-
- e.FileType = 0;
- e.ParentVnode = e.ParentUnique = 0;
- e.LinkCount = 0;
- assert (e.nextptr == VOLDB_ENTRY_USED);
- e.nextptr = vdb->freeptr;
- if (ino)
- memcpy (ino, &e.ino, sizeof (e.ino));
- memset (&e.ino, 0, sizeof(e.ino));
-
- ret = voldb_put_dir (db, num, &e);
- if (ret)
- return ret;
-
- } else if ((db->hdr.flags & (VOLDB_DIR|VOLDB_FILE)) == VOLDB_FILE) {
- struct voldb_file_entry e;
-
- ret = voldb_get_file (db, num, &e);
- if (ret)
- return ret;
-
- e.FileType = 0;
- e.ParentVnode = e.ParentUnique = 0;
- e.LinkCount = 0;
- assert (e.nextptr == VOLDB_ENTRY_USED);
- e.nextptr = vdb->freeptr;
- if (ino)
- memcpy (ino, &e.ino, sizeof (e.ino));
- memset (&e.ino, 0, sizeof(e.ino));
-
- ret = voldb_put_file (db, num, &e);
- if (ret)
- return ret;
- } else
- return EINVAL; /* XXX */
-
- vdb->freeptr = num;
-
- ret = voldb_write_hdr (db->fd, db);
- if (ret)
- return ret;
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-vdbflat_flush (struct voldb *db)
-{
- vdbflat *vdb = db->ptr;
-
- if (msync (vdb->ptr, db->size, MS_SYNC) < 0)
- return errno;
- return 0;
-}
-
-/*
- *
- */
-
-int
-vdbflat_write_header (struct voldb *db,
- void *d,
- size_t sz)
-{
- vdbflat *vdb = (vdbflat *) db->ptr;
- unsigned char *data = d;
- size_t size = sz;
- uint32_t i;
- int ret;
-
- assert (sz == VOLDB_HEADER_SIZE);
-
- /*
- * Make sure we don't overwrite the voldb header
- */
-
- data += VOLDB_HEADER_HALF;
- size -= VOLDB_HEADER_HALF;
-
- assert (size >= sizeof (i));
-
- if (vdb == NULL) {
- i = htonl (VOLDB_FREELIST_END);
- } else {
- i = htonl(vdb->freeptr);
- }
- memcpy (data, &i, sizeof (i));
-
- /* Now store it to the mmap file */
- memcpy (vdb->ptr, d, sz);
-
- ret = msync (vdb->ptr, sz, MS_SYNC);
- if (ret)
- return errno;
-
- return 0;
-}
-
-static int
-vdbflat_expand (struct voldb *db,
- uint32_t num)
-{
- int entriesneeded;
- int ret = 0;
-
- entriesneeded = num - db->hdr.num + 1;
- if (entriesneeded > 0)
- ret = vdbflat_extend_db(db, entriesneeded + VOLDB_ENTEND_NUM);
-
- if (ret)
- return ret;
-
- return 0;
-}
-
-static int
-vdbflat_rebuild (struct voldb *db)
-{
- uint32_t freeptr;
- vdbflat *vdb = db->ptr;
- int ret;
- int i;
-
- freeptr = VOLDB_FREELIST_END;
-
- for (i = db->hdr.num - 1; i >= 0; i--) {
- if ((db->hdr.flags & VOLDB_DIR) == VOLDB_DIR) {
- struct voldb_dir_entry e;
-
- ret = voldb_get_dir(db, i, &e);
- if (ret)
- return ret;
-
- if (e.nextptr == VOLDB_ENTRY_USED) {
- assert (e.FileType == TYPE_DIR);
- } else {
- e.nextptr = VOLDB_FREELIST_END;
- freeptr = i;
- ret = voldb_put_dir(db, i, &e);
- if (ret)
- return ret;
- }
- } else {
- struct voldb_file_entry e;
-
- ret = voldb_get_file(db, i, &e);
- if (ret)
- return ret;
-
- if (e.nextptr == VOLDB_ENTRY_USED) {
- assert (e.FileType == TYPE_FILE);
- } else {
- e.nextptr = VOLDB_FREELIST_END;
- freeptr = i;
- ret = voldb_put_file(db, i, &e);
- if (ret)
- return ret;
- }
- }
- }
-
- vdb->freeptr = freeptr;
- return 0;
-}
-
-/*
- *
- */
-
-struct voldb_type vdb_flat = {
- vdbflat_init,
- vdbflat_close,
- vdbflat_get_dir,
- vdbflat_put_dir,
- vdbflat_put_acl,
- vdbflat_get_file,
- vdbflat_put_file,
- vdbflat_flush,
- vdbflat_new_entry,
- vdbflat_del_entry,
- vdbflat_write_header,
- vdbflat_expand,
- vdbflat_rebuild,
-};
diff --git a/usr.sbin/afs/src/milko/lib/voldb/vol.c b/usr.sbin/afs/src/milko/lib/voldb/vol.c
deleted file mode 100644
index 70ef4f2a283..00000000000
--- a/usr.sbin/afs/src/milko/lib/voldb/vol.c
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * the volume data file
- */
-
-#include "voldb_locl.h"
-
-RCSID("$arla: vol.c,v 1.7 2002/02/07 17:59:55 lha Exp $");
-
-/*
- * get the partial name of the volume
- * `num' points out the volume and the name is passed back in the
- * string `str' that has size `sz'.
- */
-
-int
-vol_getname (uint32_t num, char *str, size_t sz)
-{
- int i;
- i = snprintf (str, sz, "vol%08u", num);
- assert (i > 0 && i < sz);
- return 0;
-}
-
-/*
- * get the full name of the volume.
- * `part' and `num' points out the volume, the named of passed back in
- * `str' that has the size of `sz'.
- */
-
-int
-vol_getfullname (uint32_t part, uint32_t num, char *str, size_t sz)
-{
- int ret;
- char volname[VOLSER_MAXVOLNAME];
-
- ret = vol_getname (num, volname, sizeof (volname));
- if (ret)
- return ret;
-
- if (part <= 'z' - 'a')
- ret = snprintf (str, sz, "%s/vicep%c/%s",
- dpart_root, 'a' + part, volname);
-#if 0
- else if (part <= ('z' - 'a') * ('z' - 'a'))
- ret = snprintf (str, sz, "%s/vicep%c%c/%s", dpart_root,
- 'a' + part / ('z' - 'a'),
- 'a' + part % ('z' - 'a'),
- volname);
-#endif
- else
- return EINVAL; /* XXX */
-
- assert (ret > 0 && ret < siz);
- return 0;
-}
-
-/*
- * read header from stable storage
- */
-
-int
-vol_read_header (int fd, volintInfo *info)
-{
- struct stat sb;
- char *buf, *ptr;
- size_t size;
- int ret;
-
- assert (info);
-
- ret = fstat (fd, &sb);
- if (ret)
- return errno; /* XXX */
-
- if (sb.st_size != VOLINTINFO_SIZE)
- return EINVAL;
-
- ret = lseek (fd, 0, SEEK_SET);
- if (ret)
- return errno; /* XXX */
-
- buf = malloc (VOLINTINFO_SIZE);
- if (buf == NULL)
- return ENOMEM; /* XXX */
-
- ret = read (fd, buf, VOLINTINFO_SIZE);
- if (ret <= 0) {
- free (buf);
- return ret;
- }
-
- size = VOLINTINFO_SIZE;
- ptr = ydr_decode_volintInfo(info, buf, &size);
- if (ptr == NULL) {
- free (buf);
- return errno; /* XXX */
- }
-
- free (buf);
-
- return 0;
-}
-
-/*
- * write header to stable storage
- */
-
-int
-vol_write_header (int fd, volintInfo *info)
-{
- char *buf, *ptr;
- size_t size;
- int ret;
-
- assert (info);
-
- ret = lseek (fd, 0, SEEK_SET);
- if (ret)
- return errno; /* XXX */
-
- size = VOLINTINFO_SIZE;
- buf = malloc (size);
- if (buf == NULL)
- return ENOMEM; /* XXX */
-
- ptr = ydr_encode_volintInfo(info, buf, &size);
- if (ptr == NULL) {
- free (buf);
- return errno; /* XXX */
- }
-
- size = ptr - buf;
- ret = write (fd, buf, size);
- if (ret != size)
- ret = errno;
- else
- ret = 0;
-
- free (buf);
-
- return ret;
-
-}
-
-/*
- * create a partition `part' with number `num', name `name'
- * of type `type' that has `parent' as parent.
- */
-
-int
-vol_create (int fd, uint32_t num, const char *name,
- uint32_t type, uint32_t parent)
-{
- int ret;
- struct timeval tv;
- volintInfo info;
-
- gettimeofday (&tv, NULL);
-
- strlcpy (info.name, name, sizeof (info.name));
- info.name[sizeof (info.name)-1] = '\0';
- info.type = type;
- info.volid = num;
- info.backupID = 0;
- info.parentID = parent;
- info.cloneID = 0;
- info.status = 0;
- info.copyDate = 0;
- info.inUse = 1;
- info.needsSalvaged = 0;
- info.destroyMe = 'c';
- info.creationDate = tv.tv_sec;
- info.accessDate = tv.tv_sec;
- info.updateDate = tv.tv_sec;
- info.backupDate = tv.tv_sec;
- info.dayUse = 0;
- info.filecount = 1;
- info.maxquota = 5000; /* XXX */
- info.size = 0;
- info.flags = 0;
- info.spare0 = 0;
- info.spare1 = 0;
- info.spare2 = 0;
- info.spare3 = 0;
-
- ret = vol_write_header (fd, &info);
- close (fd);
- return ret;
-}
-
-
-/*
- * Pretty print the volintInfo structure
- */
-
-void
-vol_pretty_print_info (FILE *out, volintInfo *info)
-{
- assert (info);
-
- fprintf (out, "name:\t\t%-32s\n", info->name);
- fprintf (out, "type:\t\t%d\n", info->type);
- fprintf (out, "volid: %d backupID: %d parentID: %d cloneID: %d\n",
- info->volid, info->backupID, info->parentID, info->cloneID);
- fprintf (out, "status:\t\t0x%x\n", info->status);
- fprintf (out, "copyDate:\t%d\n", info->copyDate);
- fprintf (out, "inUse:\t\t%d\n", info->inUse);
- fprintf (out, "needsSalvaged:\t%d\n", info->needsSalvaged);
- fprintf (out, "destroyMe:\t%d\n", info->destroyMe);
-
- fprintf (out, " XXX \n");
-}
-
-/*
- *
- */
-
-static char *type_array[] = {
- "RW",
- "RO",
- "BACK",
-};
-
-const char *
-vol_voltype2name (int32_t type)
-{
- if (type < 0 || type > 2)
- return "UNKN";
- return type_array[type];
-}
-
diff --git a/usr.sbin/afs/src/milko/lib/voldb/voldb.c b/usr.sbin/afs/src/milko/lib/voldb/voldb.c
deleted file mode 100644
index 6980e996ae9..00000000000
--- a/usr.sbin/afs/src/milko/lib/voldb/voldb.c
+++ /dev/null
@@ -1,522 +0,0 @@
-/*
- * Copyright (c) 1999, 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-
-/*
- * simple flat db for the vnodes
- */
-
-#include "voldb_locl.h"
-#include "voldb_internal.h"
-
-RCSID("$arla: voldb.c,v 1.24 2002/02/07 17:59:56 lha Exp $");
-
-struct voldb_type *voltypes[] = {
- &vdb_flat,
-};
-
-
-/*
- * afs_dir_p: returns true if vno is for a dir
- */
-
-int
-afs_dir_p (int32_t vno) {
- return vno & 1;
-}
-
-/*
- * Conversion
- */
-
-int32_t
-dir_afs2local (int32_t vno)
-{
- assert (vno);
- return (vno - 1) >> 1;
-}
-
-int32_t
-dir_local2afs (int32_t vno)
-{
- return (vno << 1 ) + 1;
-}
-
-int32_t
-file_afs2local (int32_t vno)
-{
- assert (vno);
- return (vno >> 1) - 1;
-}
-
-int32_t
-file_local2afs (int32_t vno)
-{
- return (vno + 1) << 1 ;
-}
-
-/*
- *
- */
-
-int
-voldb_parse_header (struct voldb *db, void *d, size_t sz)
-{
- uint32_t i;
- unsigned char *data = d;
-
- assert (sz >= VOLDB_HEADER_HALF);
-
- memcpy (&i, data, sizeof (i));
- db->hdr.magic = ntohl (i);
- data += sizeof (uint32_t);
-
- memcpy (&i, data, sizeof (i));
- db->hdr.num = ntohl (i);
- data += sizeof (uint32_t);
-
- memcpy (&i, data, sizeof (i));
- db->hdr.flags = ntohl (i);
- data += sizeof (uint32_t);
-
- return 0;
-}
-
-/*
- * boot up the db
- * `fd' is a file descriptor to a db that is returned in `db'.
- * `fd' is saved if everythings works out ok, otherwise its
- * up to the caller to close it.
- */
-
-int
-voldb_init (int fd, int32_t type, int32_t volume, struct voldb **db)
-{
- struct stat sb;
- int ret;
-
- assert (db);
- *db = NULL;
-
- if (type < 0 ||
- type >= sizeof (**voltypes)/ sizeof(*voltypes))
- return EINVAL;
-
- ret = fstat (fd, &sb);
- if (ret)
- return errno; /* XXX */
-
- if (!S_ISREG(sb.st_mode))
- return EINVAL; /* XXX */
-
- *db = calloc (1, sizeof (**db));
- if (*db == NULL)
- return ENOMEM; /* XXX */
-
- (*db)->size = sb.st_size;
-
- (*db)->fd = fd;
- (*db)->volume = volume;
-
- ret = VOLDB_FUNC((*db),init)(fd, *db, 0);
- if (ret) {
- free (*db);
- return ret;
- }
-
- return 0;
-}
-
-/*
- * closes the db
- * The saved `fd' is also closed.
- */
-
-int
-voldb_close (struct voldb *db)
-{
- int ret;
-
- assert (db);
-
- ret = VOLDB_FUNC(db,close)(db);
-
- free (db);
- return 0;
-}
-
-
-/*
- * store e as num'th acl entry (n is 0 based), convert it to
- * network order.
- *
- * This one is special, where is where we should add acl's on file.
- * Guess it's will be a configuration option.
- */
-
-int
-voldb_put_acl (struct voldb *db, uint32_t num, struct voldb_dir_entry *e)
-{
- assert (db && e);
- assert ((db->hdr.flags & VOLDB_DIR) == VOLDB_DIR);
-
- return VOLDB_FUNC(db,put_acl)(db, num, e);
-}
-
-/*
- * store a entry `e' in aproproate database `db'
- */
-
-int
-voldb_put_entry (struct voldb *db, int32_t num, struct voldb_entry *e)
-{
- assert (db && e);
-
- switch (e->type) {
- case TYPE_DIR:
- assert ((db->hdr.flags & VOLDB_DIR) == VOLDB_DIR);
- assert (e->u.dir.FileType == e->type);
- return voldb_put_dir (db, num, &e->u.dir);
- case TYPE_FILE:
- case TYPE_LINK:
- assert ((db->hdr.flags & VOLDB_FILE) == VOLDB_FILE);
- assert (e->u.file.FileType == e->type);
- return voldb_put_file (db, num, &e->u.file);
- default:
- abort();
- }
-}
-
-/*
- *
- */
-
-int
-voldb_get_size (struct voldb *db, int32_t *total_size, int32_t *num_entries)
-{
- assert (db);
-
- *total_size = db->size;
- *num_entries = db->hdr.num;
-
- return 0;
-}
-
-/*
- * Retrive a entry `e' from the database `db'
- *
- * We use the db to figure out what type e might have. In the case of
- * a FILE/LINK we have to look at the content of `e' after the fetch.
- */
-
-int
-voldb_get_entry (struct voldb *db, int32_t num, struct voldb_entry *e)
-{
- assert (db && e);
-
- if ((db->hdr.flags & VOLDB_DIR) == VOLDB_DIR) {
- e->type = TYPE_DIR;
- return voldb_get_dir (db, num, &e->u.dir);
- }
- if ((db->hdr.flags & VOLDB_FILE) == VOLDB_FILE) {
- int ret;
- ret = voldb_get_file (db, num, &e->u.file);
- if (ret == 0)
- e->type = e->u.file.FileType;
- return ret;
- } else
- abort();
-}
-
-/* Expand the table to num size */
-
-int
-voldb_expand (struct voldb *db, int32_t num)
-{
- assert (db);
-
- return VOLDB_FUNC(db, expand)(db, num);
-}
-
-/* Rebuild the table */
-
-int
-voldb_rebuild (struct voldb *db)
-{
- assert (db);
-
- return VOLDB_FUNC(db, rebuild)(db);
-}
-
-/*
- * Fill out the data we need to have stored and the
- * let the lower layer store it.
- */
-
-int
-voldb_write_hdr (int fd, struct voldb *db)
-{
- int ret;
- uint32_t i;
- unsigned char data[VOLDB_HEADER_SIZE], *ptr;
-
- ptr = data;
-
- i = htonl (db->hdr.magic);
- memcpy (ptr, &i, sizeof (i));
- ptr += sizeof (uint32_t);
-
- i = htonl (db->hdr.num);
- memcpy (ptr, &i, sizeof (i));
- ptr += sizeof (uint32_t);
-
- i = htonl (db->hdr.flags);
- memcpy (ptr, &i, sizeof (i));
- ptr += sizeof (uint32_t);
-
- /* Here is space for yet other 2 int32_t */
-
- ret = VOLDB_FUNC(db,write_header)(db, data, VOLDB_HEADER_SIZE);
-
- return ret;
-}
-
-
-/*
- * create a db header in a empty existing file pointed by `fd'
- * with flags set to `flags'.
- */
-
-int
-voldb_create_header (int fd, int type, int flags)
-{
- struct stat sb;
- struct voldb db;
- int ret;
-
- ret = fstat (fd, &sb);
- if (ret)
- return errno; /* XXX */
-
- if (sb.st_size != 0)
- return EINVAL; /* XXX */
-
- ret = ftruncate (fd, VOLDB_HEADER_SIZE);
- if (ret)
- return errno; /* XXX */
-
- db.type = type;
- db.hdr.magic = VOLDB_MAGIC_HEADER;
- db.hdr.num = 0;
- db.hdr.flags = flags;
- db.ptr = NULL;
- db.size = VOLDB_HEADER_SIZE;
-
- ret = VOLDB_FUNC(&db,init)(fd, &db, 1);
- if (ret) abort();
-
- ret = voldb_write_hdr (fd, &db);
- if (ret) abort();
-
- ret = VOLDB_FUNC(&db,close)(&db);
- if (ret) abort();
- return ret;
-}
-
-/*
- * Assure `db' is stored to disk.
- */
-
-int
-voldb_flush (struct voldb *db)
-{
- int ret;
- assert (db);
- ret = voldb_write_hdr (db->fd, db);
- if (ret) return ret;
- return VOLDB_FUNC(db,flush)(db);
-}
-
-
-int
-voldb_new_entry (struct voldb *db, uint32_t *num, uint32_t *unique)
-{
- assert (db && unique);
-
- assert ((db->hdr.flags & (VOLDB_FILE|VOLDB_DIR)) !=
- (VOLDB_FILE|VOLDB_DIR));
- assert ((db->hdr.flags & (VOLDB_FILE|VOLDB_DIR)) != 0);
-
- return VOLDB_FUNC(db,new_entry)(db, num, unique);
-}
-
-/*
- *
- */
-
-int
-voldb_del_entry (struct voldb *db, uint32_t num, onode_opaque *ino)
-{
- assert (db);
-
- return VOLDB_FUNC(db,del_entry)(db, num, ino);
-}
-
-
-/*
- *
- */
-
-int
-voldb_header_info (struct voldb *db,
- uint32_t *num,
- uint32_t *flags)
-{
- if (num)
- *num = db->hdr.num;
- if (flags)
- *flags = db->hdr.flags;
-
- return 0;
-}
-
-/*
- *
- */
-
-uint32_t
-voldb_get_volume (struct voldb *db)
-{
- return db->volume;
-}
-
-/*
- *
- */
-
-int
-voldb_pretty_print_file (struct voldb_file_entry *e)
-{
- printf (" nextptr = %d\n", e->nextptr);
- printf (" unique = %d\n", e->unique);
- printf (" ino = ");
- vstatus_print_onode (stdout, &e->ino);
- printf (" InterfaceVersion = %d\n", e->InterfaceVersion);
- printf (" FileType = %d\n", e->FileType);
- printf (" LinkCount = %d\n", e->LinkCount);
- printf (" Length = %d\n", e->Length);
- printf (" DataVersion = %d\n", e->DataVersion);
- printf (" Author = %d\n", e->Author);
- printf (" Owner = %d\n", e->Owner);
- printf (" UnixModeBits = 0%o\n", e->UnixModeBits);
- printf (" ParentVnode = %d\n", e->ParentVnode);
- printf (" ParentUnique = %d\n", e->ParentUnique);
- printf (" SegSize = %d\n", e->SegSize);
- printf (" ServerModTime = %d\n", e->ServerModTime);
- printf (" Group = %d\n", e->Group);
-
- return 0;
-}
-
-int
-voldb_pretty_print_dir (struct voldb_dir_entry *e)
-{
- int i;
-
- printf (" nextptr = %d\n", e->nextptr);
- printf (" unique = %d\n", e->unique);
- printf (" ino = ");
- vstatus_print_onode (stdout, &e->ino);
- printf (" InterfaceVersion = %d\n", e->InterfaceVersion);
- printf (" FileType = %d\n", e->FileType);
- printf (" LinkCount = %d\n", e->LinkCount);
- printf (" Length = %d\n", e->Length);
- printf (" DataVersion = %d\n", e->DataVersion);
- printf (" Author = %d\n", e->Author);
- printf (" Owner = %d\n", e->Owner);
- printf (" UnixModeBits = 0%o\n", e->UnixModeBits);
- printf (" ParentVnode = %d\n", e->ParentVnode);
- printf (" ParentUnique = %d\n", e->ParentUnique);
- printf (" SegSize = %d\n", e->SegSize);
- printf (" ServerModTime = %d\n", e->ServerModTime);
- printf (" Group = %d\n", e->Group);
-
- printf (" ACL:");
- printf (" negative:\n");
- for (i = 0; i < FS_MAX_ACL; i++)
- printf (" owner %d flags 0x%x\n",
- e->negacl[i].owner, e->negacl[i].flags);
- printf (" positive:\n");
- for (i = 0; i < FS_MAX_ACL; i++)
- printf (" owner %d flags 0x%x\n",
- e->acl[i].owner, e->acl[i].flags);
-
- return 0;
-}
-
-int
-voldb_pretty_print_header (struct voldb *db)
-{
- printf ("type:\t%d", db->type);
- printf ("size:\t%d", db->size);
- printf ("magic:\t0x%x (should be 0x%x)\n",
- db->hdr.magic, VOLDB_MAGIC_HEADER);
- printf ("num:\t%d\n", db->hdr.num);
- printf ("flags:\t0x%x", db->hdr.flags);
- return 0;
-}
-
-/*
- * voldb_update_time
- *
- * Should be called upon creation and when data is modified.
- * Should be called before any call to vld_storestatus_to_ent().
- * Should _not_ be called when metadata is changed.
- */
-
-void
-voldb_update_time(struct voldb_entry *e, time_t t)
-{
- switch (e->type) {
- case TYPE_DIR:
- e->u.dir.ServerModTime = t; /* XXX update ClientModTime also */
- break;
- case TYPE_FILE:
- case TYPE_LINK:
- e->u.file.ServerModTime = t; /* XXX update ClientModTime also */
- break;
- default:
- abort();
- break;
- }
-}
diff --git a/usr.sbin/afs/src/milko/lib/voldb/voldb.h b/usr.sbin/afs/src/milko/lib/voldb/voldb.h
deleted file mode 100644
index 5719e557679..00000000000
--- a/usr.sbin/afs/src/milko/lib/voldb/voldb.h
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: voldb.h,v 1.21 2002/02/07 17:59:58 lha Exp $ */
-
-#ifndef FILBUNKE_VOLDB_H
-#define FILBUNKE_VOLDB_H 1
-
-#include <volumeserver.h>
-#include <fs_def.h>
-#include <vstatus.h>
-
-/*
- * Of this space half is shared of the voldb and the underlaying
- * layer.
- */
-
-#define VOLDB_HEADER_SIZE (10*4)
-#define VOLDB_HEADER_HALF (VOLDB_HEADER_SIZE/2)
-
-/*
- * Data structure for a file (link is same)
- */
-
-struct voldb_file_entry {
- uint32_t nextptr;
- uint32_t unique;
- onode_opaque ino;
- uint32_t spare2; /* Must be zero */
- uint32_t InterfaceVersion;
- uint32_t FileType;
- uint32_t LinkCount;
- uint32_t Length;
- uint32_t spare3; /* Must be zero */
- uint32_t DataVersion;
- uint32_t Author;
- uint32_t Owner;
- uint32_t UnixModeBits;
- uint32_t ParentVnode;
- uint32_t ParentUnique;
- uint32_t SegSize;
- uint32_t ServerModTime;
- uint32_t spare4; /* Must be zero */
- uint32_t Group;
- uint32_t spare5; /* Must be zero */
-};
-
-/*
- * Data structure for an acl_entry
- */
-
-struct acl_entry {
- uint32_t owner;
- uint32_t flags;
-};
-
-/*
- * Data structure for a dir
- */
-
-struct voldb_dir_entry {
- uint32_t nextptr;
- uint32_t unique;
- onode_opaque ino;
- uint32_t spare2; /* Must be zero */
- uint32_t InterfaceVersion;
- uint32_t FileType;
- uint32_t LinkCount;
- uint32_t Length;
- uint32_t spare3; /* Must be zero */
- uint32_t DataVersion;
- uint32_t Author;
- uint32_t Owner;
- uint32_t UnixModeBits;
- uint32_t ParentVnode;
- uint32_t ParentUnique;
- uint32_t SegSize;
- uint32_t ServerModTime;
- uint32_t spare4; /* Must be zero */
- uint32_t Group;
- uint32_t spare5; /* Must be zero */
- struct acl_entry negacl[FS_MAX_ACL];
- struct acl_entry acl[FS_MAX_ACL];
-};
-
-struct voldb_entry {
- int32_t type;
- union {
- struct voldb_dir_entry dir;
- struct voldb_file_entry file;
- } u;
-};
-
-/* defines */
-
-#define VOLDB_FILE 0x1
-#define VOLDB_DIR 0x2
-
-#define VOLDB_DEFAULT_TYPE 0
-
-#define VOLDB_FREELIST_END 0xffffffff
-#define VOLDB_ENTRY_USED 0xfffffffe
-
-/* forward declarations */
-
-struct voldb;
-
-/* prototypes */
-
-int
-voldb_init (int fd, int32_t type, int32_t volume, struct voldb **db);
-
-int
-voldb_close (struct voldb *db);
-
-int
-voldb_put_entry (struct voldb *db, int32_t num, struct voldb_entry *e);
-
-int
-voldb_get_size (struct voldb *db, int32_t *total_size, int32_t *num_entries);
-
-int
-voldb_get_entry (struct voldb *db, int32_t num, struct voldb_entry *e);
-
-int
-voldb_put_acl (struct voldb *db, uint32_t num, struct voldb_dir_entry *e);
-
-int
-voldb_pretty_print_file (struct voldb_file_entry *e);
-
-int
-voldb_pretty_print_dir (struct voldb_dir_entry *e);
-
-int
-voldb_pretty_print_header (struct voldb *db);
-
-int
-voldb_create_header (int fd, int type, int flags);
-
-int
-voldb_flush (struct voldb *db);
-
-int
-voldb_new_entry (struct voldb *db, uint32_t *num, uint32_t *unique);
-
-int
-voldb_del_entry (struct voldb *db, uint32_t num, onode_opaque *ino);
-
-int
-voldb_header_info (struct voldb *db,
- uint32_t *num,
- uint32_t *flags);
-
-uint32_t
-voldb_get_volume (struct voldb *db);
-
-int
-voldb_write_hdr (int fd, struct voldb *db);
-
-void
-voldb_update_time(struct voldb_entry *e, time_t t);
-
-/* vol.c */
-
-int
-vol_getname (uint32_t num, char *str, size_t sz);
-
-int
-vol_getfullname (uint32_t part, uint32_t num, char *str, size_t sz);
-
-int
-vol_read_header (int fd, volintInfo *info);
-
-int
-vol_write_header (int fd, volintInfo *info);
-
-int
-vol_create (int fd, uint32_t num, const char *name,
- uint32_t type, uint32_t parent);
-
-void
-vol_pretty_print_info (FILE *out, volintInfo *info);
-
-int
-voldb_expand (struct voldb *db, int32_t num);
-
-int
-voldb_rebuild (struct voldb *db);
-
-enum voldb_newnum_sizes { VOLDB_ENTEND_NUM = 10 } ;
-
-const char *
-vol_voltype2name (int32_t type);
-
-
-int
-afs_dir_p (int32_t vno);
-
-int32_t
-dir_afs2local (int32_t vno);
-
-int32_t
-dir_local2afs (int32_t vno);
-
-int32_t
-file_afs2local (int32_t vno);
-
-int32_t
-file_local2afs (int32_t vno);
-
-#endif /* FILBUNKE_VOLDB_H 1 */
diff --git a/usr.sbin/afs/src/milko/lib/voldb/voldb_internal.h b/usr.sbin/afs/src/milko/lib/voldb/voldb_internal.h
deleted file mode 100644
index 85c3a5429bf..00000000000
--- a/usr.sbin/afs/src/milko/lib/voldb/voldb_internal.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-
-#ifndef _VOLDB_INTERNAL_H
-#define _VOLDB_INTERNAL_H
-
-/*
- * Various internal data structures
- */
-
-struct voldb_header {
- uint32_t magic; /* network order */
-#define VOLDB_MAGIC_HEADER 0x47111147
- uint32_t num; /* Number of entries in the db */
- uint32_t flags; /* flags */
-};
-
-struct voldb {
- struct voldb_header hdr; /* header of voldb */
- int32_t type; /* type of voldb */
- size_t size; /* Size of file */
- int fd; /* fd to volume */
- int32_t volume; /* volume */
- void *ptr; /* type owned data */
-};
-
-struct voldb_type {
- int (*init) (int fd, struct voldb *db, int createp);
- int (*close) (struct voldb *db);
- int (*get_dir) (struct voldb *db,
- const uint32_t num,
- struct voldb_dir_entry *e);
- int (*put_dir) (struct voldb *db,
- const uint32_t num,
- struct voldb_dir_entry *e);
- int (*put_acl) (struct voldb *db,
- uint32_t num,
- struct voldb_dir_entry *e);
- int (*get_file) (struct voldb *db,
- uint32_t num,
- struct voldb_file_entry *e);
- int (*put_file) (struct voldb *db,
- uint32_t num,
- struct voldb_file_entry *e);
- int (*flush) (struct voldb *db);
- int (*new_entry) (struct voldb *db,
- uint32_t *num,
- uint32_t *unique);
- int (*del_entry) (struct voldb *db,
- const uint32_t num,
- onode_opaque *ino);
- int (*write_header) (struct voldb *db,
- void *data,
- size_t sz);
- int (*expand) (struct voldb *db,
- uint32_t num);
- int (*rebuild) (struct voldb *db);
-};
-
-
-#define VOLDB_FUNC(db,name) (voltypes[(db)->type])->name
-
-extern struct voldb_type *voltypes[];
-
-static inline int __attribute__ ((unused))
-voldb_get_dir (struct voldb *db, uint32_t num, struct voldb_dir_entry *e)
-{
- return VOLDB_FUNC(db,get_dir)(db, num, e);
-}
-
-static inline int __attribute__ ((unused))
-voldb_get_file (struct voldb *db, uint32_t num, struct voldb_file_entry *e)
-{
- return VOLDB_FUNC(db,get_file)(db, num, e);
-}
-
-static inline int __attribute__ ((unused))
-voldb_put_dir (struct voldb *db, uint32_t num, struct voldb_dir_entry *e)
-{
- return VOLDB_FUNC(db,put_dir)(db, num, e);
-}
-
-static inline int __attribute__ ((unused))
-voldb_put_file (struct voldb *db, uint32_t num, struct voldb_file_entry *e)
-{
- return VOLDB_FUNC(db,put_file)(db, num, e);
-}
-
-int
-voldb_parse_header (struct voldb *db, void *d, size_t sz);
-
-/*
- * Diffrent types of db's
- */
-
-extern struct voldb_type vdb_flat;
-
-#endif /* _VOLDB_INTERNAL_H */
-
diff --git a/usr.sbin/afs/src/milko/lib/voldb/voldb_locl.h b/usr.sbin/afs/src/milko/lib/voldb/voldb_locl.h
deleted file mode 100644
index ae7839bade4..00000000000
--- a/usr.sbin/afs/src/milko/lib/voldb/voldb_locl.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * $arla: voldb_locl.h,v 1.4 2000/12/29 20:16:01 tol Exp $
- */
-
-#include <config.h>
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <sys/errno.h>
-#include <sys/uio.h>
-#include <sys/time.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-
-#include <unistd.h>
-
-#include <atypes.h>
-
-#include <err.h>
-
-#include <fs_def.h>
-#include <fs.h>
-#include <voldb.h>
-#include <dpart.h>
-
-#include <volumeserver.h>
-
-#if !defined(MAP_FAILED)
-#define MAP_FAILED ((void *)(-1))
-#endif
-
diff --git a/usr.sbin/afs/src/milko/lib/vstatus/Makefile.in b/usr.sbin/afs/src/milko/lib/vstatus/Makefile.in
deleted file mode 100644
index 53bd7fad20f..00000000000
--- a/usr.sbin/afs/src/milko/lib/vstatus/Makefile.in
+++ /dev/null
@@ -1,106 +0,0 @@
-#
-# $KTH: Makefile.in,v 1.5 2000/10/08 06:23:39 lha Exp $
-#
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_builddir = ../../..
-VPATH = @srcdir@
-
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-INCLUDES = -I. \
- -I../../../include \
- -I$(srcdir) \
- $(KRB4_INC_FLAGS) \
- -I$(srcdir)/../../../include
-
-CFLAGS = @CFLAGS@
-KRB4_INC_FLAGS= @KRB4_INC_FLAGS@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-YDR = ../../../ydr/ydr
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-sysconfdir = @sysconfdir@
-
-
-#PICFLAGS = @PICFLAGS@
-
-LIBNAME = $(LIBPREFIX)vstatus
-#LIBEXT = @LIBEXT@
-LIBEXT = a
-#SHLIBEXT = @SHLIBEXT@
-#LIBPREFIX = @LIBPREFIX@
-LIBPREFIX = lib
-#LDSHARED = @LDSHARED@
-LIB = $(LIBNAME).$(LIBEXT)
-
-DEFS = @DEFS@
-
-LIB_SOURCES = vstatus.c vstat.ydr.o
-
-SOURCES = $(LIB_SOURCES)
-
-LIB_OBJECTS = vstatus.o vstat.ydr.o
-
-OBJECTS = $(LIB_OBJECTS)
-
-all: $(LIB)
-
-vstat.ydr.c vstat.cs.c vstat.ss.c vstat.h vstat.ss.h vstat.cs.h: vstat.xg
- $(YDR) $(srcdir)/vstat.xg
-
-vstatus.o: vstatus.h
-vstatus.h: vstat.h
-
-Wall:
- make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS) $(PICFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
- $(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/$(LIB)
-
-uninstall:
- rm -f $(DESTDIR)$(libdir)/$(LIB)
-
-TAGS: $(SOURCES)
- etags $(SOURCES)
-
-check:
-
-clean:
- rm -f $(LIB) $(PROGS) *.o *.a vstat.h vstat.ydr.c vstat.ss.h vstat.ss.c vstat.cs.h vstat.cs.c
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *~
-
-realclean: distclean
- rm -f TAGS
-
-$(LIBNAME).a: $(LIB_OBJECTS)
- rm -f $@
- $(AR) cr $@ $(LIB_OBJECTS)
- -$(RANLIB) $@
-
-#$(LIBNAME).$(SHLIBEXT): $(LIB_OBJECTS)
-# rm -f $@
-# $(LDSHARED) -o $@ $(LIB_OBJECTS)
-
-$(OBJECTS): ../../../include/config.h
-
-Makefile: Makefile.in ../../../config.status
- cd ../../..; CONFIG_FILES=milko/lib/vstatus/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-.PHONY: all install uninstall check clean mostlyclean distclean realclean
diff --git a/usr.sbin/afs/src/milko/lib/vstatus/vstat.xg b/usr.sbin/afs/src/milko/lib/vstatus/vstat.xg
deleted file mode 100644
index 7acdb30082c..00000000000
--- a/usr.sbin/afs/src/milko/lib/vstatus/vstat.xg
+++ /dev/null
@@ -1,62 +0,0 @@
-/* hej emacs, det h}r }r en -*-c-*- fil */
-
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 4. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-package VSTATUS_
-
-%#include <config.h>
-%#include <roken.h>
-
-const ONODE_OPAQUE_SZ = 100;
-
-struct onode_opaque {
- int32_t size; /* sizeof(content(data)) */
- char data[100]; /* opaque */
-};
-
-const VSTATUS_MAGIC = 0xCAFE4711;
-
-const VSTATUS_VERSION = 4;
-
-struct vstatus {
- uint32_t version; /* version */
- uint32_t magic; /* must be VSTATUS_MAGIC */
- int32_t volid; /* The AFS-volume id */
- int32_t type; /* Type of volume */
- int32_t bstype; /* Type of backstore */
- int32_t voldbtype; /* Type of voldb */
- onode_opaque volinfoinode; /* The inode to volinfo */
- onode_opaque dirinode; /* The inode to dirlist */
- onode_opaque fileinode; /* The inode to filelist */
-};
diff --git a/usr.sbin/afs/src/milko/lib/vstatus/vstatus.c b/usr.sbin/afs/src/milko/lib/vstatus/vstatus.c
deleted file mode 100644
index 6f04ca777d2..00000000000
--- a/usr.sbin/afs/src/milko/lib/vstatus/vstatus.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * This module contains the code that parse the file /vice.+/vol\d{8}
- * file. The file is have the following fields:
- * see vstat.xg file.
- */
-
-#include <config.h>
-
-RCSID("$arla: vstatus.c,v 1.6 2002/07/16 20:38:57 lha Exp $");
-
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#include <assert.h>
-
-#include <err.h>
-
-#include <vstatus.h>
-
-/*
- * Read in the volume status from `fd' and return it in `vs'
- */
-
-int
-vstatus_read (int fd, vstatus *v)
-{
- char *ptr = NULL;
- char *ret_ptr;
- size_t len;
- int ret;
-
- assert (v);
-
- ptr = malloc (VSTATUS_SIZE);
- if (ptr == NULL) {
- ret = errno;
- goto err_out;
- }
- len = VSTATUS_SIZE;
-
- ret = lseek (fd, 0, SEEK_SET);
- if (ret) {
- ret = errno;
- goto err_out;
- }
-
- ret = read (fd, ptr, VSTATUS_SIZE);
- if (ret != VSTATUS_SIZE) {
- ret = errno;
- goto err_out;
- }
-
- ret_ptr = ydr_decode_vstatus (v, ptr, &len);
- if (len != 0) {
- ret = errno;
- goto err_out;
- }
- free (ptr);
-
- if (v->magic != VSTATUS_MAGIC ||
- v->version != VSTATUS_VERSION)
- return EINVAL;
-
- return 0;
-
- err_out:
- if (ptr)
- free (ptr);
-
- return ret;
-}
-
-/*
- * Write `vs' to `fd'
- */
-
-int
-vstatus_write (int fd, vstatus *v)
-{
- char *ptr = NULL;
- char *ret_ptr;
- size_t len;
- int ret;
-
- assert (v);
-
- v->magic = VSTATUS_MAGIC;
- v->version = VSTATUS_VERSION;
-
- ptr = malloc (VSTATUS_SIZE);
- if (ptr == NULL) {
- ret = errno;
- goto err_out;
- }
- len = VSTATUS_SIZE;
-
- ret = lseek (fd, 0, SEEK_SET);
- if (ret) {
- ret = errno;
- goto err_out;
- }
-
- ret_ptr = ydr_encode_vstatus (v, ptr, &len);
- if (len != 0 || ret_ptr == NULL) {
- ret = errno;
- goto err_out;
- }
-
- ret = write (fd, ptr, VSTATUS_SIZE);
- if (ret != VSTATUS_SIZE) {
- ret = errno;
- goto err_out;
- }
- free (ptr);
-
- return 0;
-
- err_out:
- if (ptr)
- free (ptr);
-
- return ret;
-}
-
-void
-vstatus_print_onode (FILE *out, onode_opaque *o)
-{
- int i;
- assert (o);
-
- fprintf (out, "%d:0x", o->size);
- for (i = 0; i < o->size; i++) {
- fprintf (out, "%02x", (int) o->data[i] & 0xff);
- }
- fprintf (out, "\n");
-
-}
diff --git a/usr.sbin/afs/src/milko/lib/vstatus/vstatus.h b/usr.sbin/afs/src/milko/lib/vstatus/vstatus.h
deleted file mode 100644
index f3f5aa4142f..00000000000
--- a/usr.sbin/afs/src/milko/lib/vstatus/vstatus.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: vstatus.h,v 1.3 2000/10/03 00:20:40 lha Exp $ */
-
-#ifndef __FILBUNKE_VSTATUS_H
-#define __FILBUNKE_VSTATUS_H 1
-
-#include <vstat.h>
-
-int vstatus_init (void) ;
-int vstatus_read (int fd, vstatus *v);
-int vstatus_write (int fd, vstatus *v);
-void vstatus_print_onode (FILE *out, onode_opaque *o);
-
-#endif /* __FILBUNKE_VSTATUS_H */
diff --git a/usr.sbin/afs/src/milko/pts/Makefile.in b/usr.sbin/afs/src/milko/pts/Makefile.in
deleted file mode 100644
index a54a5fda6fc..00000000000
--- a/usr.sbin/afs/src/milko/pts/Makefile.in
+++ /dev/null
@@ -1,118 +0,0 @@
-# $KTH: Makefile.in,v 1.10 2000/10/10 20:56:26 lha Exp $
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-sysconfdir = @sysconfdir@
-transform = @program_transform_name@
-
-PTSERVER_BIN = ptserver
-
-DEFS = @DEFS@ -DMILKO_SYSCONFDIR=\"$(sysconfdir)\"
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-LDFLAGS = @LDFLAGS@
-
-ETAGS = etags
-MAKEDEPEND = makedepend
-AFSWSROOT = /usr/afsws
-RXKADINC = -I$(srcdir)/../rxkad
-INCLUDES = -I$(srcdir)/../.. \
- -I../../include \
- -I$(srcdir)/../../include \
- -I$(srcdir)/../../rxkad \
- -I$(srcdir)/../../lib/acl \
- -I$(srcdir)/../lib/msecurity \
- -I../../rxdef \
- @INC_roken@ \
- $(RXKADINC)
-DEFINES = -DDEBUG
-REALCFLAGS = $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) -DRXDEBUG
-RXKADLIB = @MILKO_RXKAD_LIBS@
-KAFS_LIBS = @AIX_EXTRA_KAFS@ @KAFS_LIBS@
-LIBS = -L../lib/msecurity -lmsecurity \
- -L../../rxdef -lrxfsserver \
- -L../../lib/acl -lacl \
- -L../../lib/ko -lko \
- -L../../util -lutil \
- -L../../rxdef -lptserver -L../../rx -lrx \
- -L../../lwp -llwp @PLWP_LIB_FLAGS@ \
- $(RXKADLIB) \
- $(KAFS_LIBS) \
- @LIB_roken@ \
- @LIBS@
-LIBDEPENDS = ../../rxdef/librxdefclient.a ../../rx/librx.a \
- ../../lwp/liblwp.a ../../util/libutil.a \
- ../../lib/ko/libko.a \
- ../lib/voldb/libvoldb.a ../lib/vld/libvld.a \
- ../lib/msecurity/libmsecurity.a
-PROGS = ptserver
-SRCS = \
- ptserver.c \
- pr.c
-
-HDRS =
-
-ptserver_OBJS = \
- ptserver.o \
- pr.o
-
-.PHONY: all install uninstall depend tags clean
-
-all: $(PROGS)
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libexecdir)
- PROG_BIN='$(PTSERVER_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(libexecdir)/$$f; \
- done
-
-uninstall:
- PROG_BIN='$(PTSERVER_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(libexecdir)/$$f; \
- done
-
-ptserver: $(ptserver_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(ptserver_OBJS) $(LIBS)
-
-Makefile: Makefile.in ../../config.status
- cd ../..; CONFIG_FILES=milko/pts/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(SRCS)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(PROGS) $(OBJS) *~ *.o core *.core
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile config.status
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/milko/pts/pr.c b/usr.sbin/afs/src/milko/pts/pr.c
deleted file mode 100644
index 2b99238ad13..00000000000
--- a/usr.sbin/afs/src/milko/pts/pr.c
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <ctype.h>
-#include <assert.h>
-
-#include <rx/rx.h>
-#include <rx/rx_null.h>
-
-#include <ports.h>
-#include <ko.h>
-#include <bool.h>
-
-#ifdef KERBEROS
-#ifdef HAVE_OPENSSL
-#include <openssl/des.h>
-#else
-#include <des.h>
-#endif
-#include <krb.h>
-#include <rxkad.h>
-#include "rxkad_locl.h"
-#endif
-
-#include <err.h>
-
-#ifndef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include <service.h>
-
-#include "pts.h"
-#include "pts.ss.h"
-#include "ptserver.h"
-#include "pts.ss.h"
-
-#include "msecurity.h"
-
-#include <mlog.h>
-#include <mdebug.h>
-
-RCSID("$arla: pr.c,v 1.24 2002/04/20 15:57:17 lha Exp $");
-
-/*
- *
- */
-
-int
-PR_NameToID(struct rx_call *call, const namelist *nlist, idlist *ilist)
-{
- int i;
- int status;
-
- mlog_log (MDEBPR, "PR_NameToID: securityIndex: %d ilen: %d",
- call->conn->securityIndex, nlist->len);
-
-#ifdef KERBEROS
- if (call->conn->securityIndex == 2) {
- serv_con_data *cdat = call->conn->securityData;
- mlog_log (MDEBPR, " user: %s.%s@%s",
- cdat->user->name,
- cdat->user->instance,
- cdat->user->realm);
- }
-#endif
-
- ilist->len = nlist->len;
- ilist->val = malloc(sizeof(int) * ilist->len);
- if (ilist->val == NULL)
- return PRDBBAD;
-
- for (i = 0; i < nlist->len; i++) {
- mlog_log (MDEBPR, " name: %s", nlist->val[i]);
-
- status = conv_name_to_id(nlist->val[i], &ilist->val[i]);
- if (status == PRNOENT)
- ilist->val[i] = PR_ANONYMOUSID;
- else if (status)
- return status;
- }
- return 0;
-}
-
-/*
- *
- */
-
-int
-PR_IDToName(struct rx_call *call, const idlist *ilist, namelist *nlist)
-{
- int i;
- int status;
-
- mlog_log (MDEBPR, "PR_IDToName: securityIndex: %d ilen %d",
- call->conn->securityIndex, ilist->len);
-
-
- if (ilist->len < 0 || ilist->len >= PR_MAXLIST)
- return PRTOOMANY;
-
- nlist->len = ilist->len;
-
- if (ilist->len == 0) {
- nlist->val = NULL;
- return 0;
- }
-
- nlist->val = calloc(nlist->len, sizeof(prname));
- if (nlist->val == NULL)
- return PRDBBAD;
-
- for (i = 0; i < ilist->len; i++) {
- mlog_log (MDEBPR, " id: %d", ilist->val[i]);
- status = conv_id_to_name(ilist->val[i], nlist->val[i]);
- if (status == PRNOENT)
- snprintf (nlist->val[i], PR_MAXNAMELEN, "%d", ilist->val[i]);
- else if (status)
- return status;
- }
- return 0;
-}
-
-/*
- *
- */
-
-int
-PR_NewEntry(struct rx_call *call, const char *name,
- const int32_t flag, const int32_t oid, int32_t *id)
-{
- int error;
- int32_t owner;
- char *localname;
- Bool localp;
-
- mlog_log (MDEBPR, "PR_NewEntry: securityIndex: %d name: %s oid: %d",
- call->conn->securityIndex, name, oid);
-
-
- /* XXX should be authuser? */
- if (!sec_is_superuser(call))
- return PRPERM;
-
- localname = localize_name(name, &localp);
-
- /* XXX do it properly! */
- if (localp == FALSE)
- owner = PR_SYSADMINID;
- else
- owner = oid;
-
- if ((flag & PRTYPE) == PRUSER) {
- error = next_free_user_id(id);
- if (!error)
- error = create_user(localname, *id, owner, PR_SYSADMINID); /* XXX */
- } else if ((flag & PRTYPE) == PRGRP) {
- error = next_free_group_id(id);
- if (!error)
- error = create_group(localname, *id, owner, PR_SYSADMINID); /* XXX */
- } else {
- error = PRPERM;
- }
-
- return error;
-}
-
-/*
- *
- */
-
-int
-PR_INewEntry(struct rx_call *call, const char *name,
- const int32_t id, const int32_t oid)
-{
- int error;
- char *localname;
- Bool localp;
- int32_t owner = PR_SYSADMINID;
- int32_t creator = PR_SYSADMINID;
-
- /* XXX should be authuser? */
- if (!sec_is_superuser(call))
- return PRPERM;
-
- mlog_log (MDEBPR, "PR_INewEntry securityIndex: %d name: %s oid: %d",
- call->conn->securityIndex, name, oid);
-
- localname = localize_name(name, &localp);
-
- /* XXX do it properly! */
- if (localp == TRUE)
- owner = oid;
-
- if (id > 0)
- error = create_user(localname, id, owner, creator); /* XXX */
- else if (id < 0)
- error = create_group(localname, id, owner, creator); /* XXX */
- else
- error = PRPERM;
-
- return error;
-}
-
-/*
- *
- */
-
-int
-PR_ListEntry(struct rx_call *call, const int32_t id,
- struct prcheckentry *entry)
-{
- prentry pr_entry;
- int status;
-
- mlog_log (MDEBPR, "PR_ListEntry securityIndex: %d id: %d",
- call->conn->securityIndex, id);
-#ifdef KERBEROS
- if (call->conn->securityIndex == 2) {
- serv_con_data *cdat = call->conn->securityData;
- mlog_log (MDEBPR, "PR_ListEntry user: %s.%s@%s",
- cdat->user->name,
- cdat->user->instance,
- cdat->user->realm);
- }
-#endif
-
- memset(&pr_entry, 0, sizeof(pr_entry));
- status = read_prentry(id, &pr_entry);
- if (status)
- return status;
- entry->flags = pr_entry.flags;
- entry->id = pr_entry.id;
- entry->owner = pr_entry.owner;
- entry->creator = pr_entry.creator;
- entry->ngroups = pr_entry.ngroups;
- entry->nusers = pr_entry.nusers;
- entry->count = pr_entry.count;
- memcpy(entry->reserved, pr_entry.reserved, sizeof(pr_entry.reserved));
- strlcpy(entry->name, pr_entry.name, PR_MAXNAMELEN);
-
- return 0;
-}
-
-/*
- *
- */
-
-int
-PR_DumpEntry(struct rx_call *call, const int32_t pos,
- struct prdebugentry *entry)
-{
- mlog_log (MDEBPR, "PR_DumpEntry");
- return -1;
-}
-
-/*
- *
- */
-
-int
-PR_ChangeEntry(struct rx_call *call, const int32_t id, const char *name,
- const int32_t oid, const int32_t newid)
-{
- mlog_log (MDEBPR, "PR_ChangeEntry");
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-PR_SetFieldsEntry(struct rx_call *call, const int32_t id, const int32_t mask,
- const int32_t flags, const int32_t ngroups,
- const int32_t nusers,
- const int32_t spare1, const int32_t spare2)
-{
- mlog_log (MDEBPR, "PR_SetFieldsEntry");
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-PR_Delete(struct rx_call *call, const int32_t id)
-{
- mlog_log (MDEBPR, "PR_Delete");
-
- if (!sec_is_superuser(call))
- return PRPERM;
-
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-PR_WhereIsIt(struct rx_call *call, const int32_t id, int32_t *ps)
-{
- mlog_log (MDEBPR, "PR_WhereIsIt");
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-PR_AddToGroup(struct rx_call *call, const int32_t uid, const int32_t gid)
-{
- mlog_log (MDEBPR, "PR_AddToGroup");
-
- if (!sec_is_superuser(call))
- return PRPERM;
-
- return addtogroup(uid,gid);
-}
-
-
-/*
- *
- */
-
-int
-PR_RemoveFromGroup(struct rx_call *call, const int32_t id, const int32_t gid)
-{
- mlog_log (MDEBPR, "PR_RemoveFromGroup");
-
- if (!sec_is_superuser(call))
- return PRPERM;
-
- return removefromgroup(id, gid);
-}
-
-
-/*
- *
- */
-
-int
-PR_ListMax(struct rx_call *call, int32_t *uid, int32_t *gid)
-{
- mlog_log (MDEBPR, "PR_ListMax");
- *uid = pr_header.maxID;
- *gid = pr_header.maxGroup;
- return 0;
-}
-
-
-/*
- *
- */
-
-int
-PR_SetMax(struct rx_call *call, const int32_t uid, const int32_t gflag)
-{
- mlog_log (MDEBPR, "PR_SetMax");
-
- if(gflag) {
- pr_header.maxGroup = uid;
- } else {
- pr_header.maxID = uid;
- }
-
- return 0;
-}
-
-
-/*
- *
- */
-
-int
-PR_ListElements(struct rx_call *call, const int32_t id,
- prlist *elist, int32_t *over)
-{
- mlog_log (MDEBPR, "PR_ListElements");
-
- return listelements(id, elist, FALSE);
-}
-
-
-/*
- *
- */
-
-int
-PR_GetCPS(struct rx_call *call, const int32_t id,
- prlist *elist, int32_t *over)
-{
- mlog_log (MDEBPR, "PR_GetCPS");
-
- return listelements(id, elist, TRUE);
-}
-
-
-/*
- *
- */
-
-int
-PR_ListOwned(struct rx_call *call, const int32_t id,
- prlist *elist, int32_t *over)
-{
- mlog_log (MDEBPR, "PR_ListOwned");
- return -1;
-}
-
-
-/*
- *
- */
-
-int
-PR_IsAMemberOf(struct rx_call *call, const int32_t uid, const int32_t gid,
- int32_t *flag)
-{
-
- /* XXX Check authorization */
-
- prlist elist;
- int ret=0;
- int i=0;
-
- mlog_log (MDEBPR, "PR_IsAMemberOf");
-
- if((ret = listelements(uid, &elist, TRUE)) !=0) {
- free(elist.val);
- return ret;
- }
-
- for(i=0; i < elist.len ; i++) {
- if(elist.val[i] == gid) {
- *flag=1;
- free(elist.val);
- return 0;
- }
- }
-
- free(elist.val);
- return 0;
-}
diff --git a/usr.sbin/afs/src/milko/pts/ptserver.c b/usr.sbin/afs/src/milko/pts/ptserver.c
deleted file mode 100644
index 5132f1aa95b..00000000000
--- a/usr.sbin/afs/src/milko/pts/ptserver.c
+++ /dev/null
@@ -1,870 +0,0 @@
-/*
- * Copyright (c) 1998, 1999, 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <rx/rx.h>
-#include <rx/rx_null.h>
-
-#include <ports.h>
-#include <ko.h>
-#include <netinit.h>
-#include <msecurity.h>
-
-#ifdef KERBEROS
-#ifdef HAVE_OPENSSL
-#include <openssl/des.h>
-#else
-#include <des.h>
-#endif
-#include <krb.h>
-#include <rxkad.h>
-#endif
-
-#include <err.h>
-#include <assert.h>
-#include <ctype.h>
-#include <agetarg.h>
-
-#ifndef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include <service.h>
-
-#include <mlog.h>
-#include <mdebug.h>
-#include <mdb.h>
-
-#include "pts.h"
-#include "pts.ss.h"
-#include "ptserver.h"
-#include "pts.ss.h"
-
-RCSID("$arla: ptserver.c,v 1.46 2003/04/09 02:41:28 lha Exp $");
-
-static struct rx_service *prservice;
-
-prheader_disk pr_header;
-
-#define HEADERID PR_BADID
-#define ILLEGAL_ID 0x40000000
-#define ILLEGAL_GROUP 0x40000000
-
-#define PRENTRY_DISK_SIZE (sizeof(prentry_disk) + PR_MAXGROUPS * sizeof(int32_t) + 16)
-#define PRHEADER_DISK_SIZE (sizeof(prheader_disk) + 4 * PR_MAXGROUPS * sizeof(int32_t) + 16)
-
-static void open_db (char *databaseprefix, int flags);
-void prserver_close(void);
-
-MDB *nametoid, *idtodata;
-
-
-/*
- *
- */
-
-void
-write_header(void)
-{
- int length = PRHEADER_DISK_SIZE;
- struct mdb_datum key, value;
- char pr_header_ydr[PRHEADER_DISK_SIZE];
- int code;
-
- char headerid = htonl(HEADERID);
-
- if (ydr_encode_prheader_disk(&pr_header, pr_header_ydr, &length) == NULL)
- err(1, "write_header");
-
- key.data = &headerid;
- key.length = sizeof(headerid);
-
- value.data = pr_header_ydr;
- value.length = PRHEADER_DISK_SIZE - length;
-
- code = mdb_store(idtodata, &key, &value);
- assert(code == 0);
-}
-
-/*
- *
- */
-
-void
-read_header(void)
-{
- int length = PRHEADER_DISK_SIZE;
- struct mdb_datum key, value;
- char headerid = htonl(HEADERID);
- int code;
-
- key.data = &headerid;
- key.length = sizeof(headerid);
-
- code = mdb_fetch(idtodata, &key, &value);
- assert(code == 0);
-
- if (ydr_decode_prheader_disk(&pr_header, value.data, &length) == NULL)
- err(1, "read_header");
-}
-
-/*
- *
- */
-
-char *
-localize_name(const char *name, Bool *localp)
-{
- static prname localname;
- char *tmp;
-
- *localp = FALSE;
-
- strlcpy(localname, name, sizeof(localname));
- strlwr(localname);
-
- tmp = strchr(localname, '@');
- if (tmp)
- if (!strcasecmp(tmp + 1, netinit_getrealm())) {
- *tmp = '\0';
- *localp = TRUE;
- }
-
- return localname;
-}
-
-/*
- *
- */
-
-static void
-create_database(void)
-{
- pr_header.version = 0;
- pr_header.headerSize = PRHEADER_DISK_SIZE;
- pr_header.maxGroup = -210; /* XXX */
- pr_header.maxID = 0;
-/*XXX pr_header.orphan = 0;*/
- pr_header.usercount = 0;
- pr_header.groupcount = 0;
- write_header();
-}
-
-/*
- * read_prentry(): Fetch data from db, return a classic pr_entry
- */
-
-int
-read_prentry(int id, prentry *pr_entry)
-{
- prentry_disk disk_entry;
- int status, i;
-
- status = get_disk_entry(id, &disk_entry);
- if (status)
- return status;
-
- memset(pr_entry, 0, sizeof(prentry));
-
- pr_entry->flags = disk_entry.flags;
- pr_entry->id = disk_entry.id;
- pr_entry->cellid = disk_entry.cellid;
- pr_entry->owner = disk_entry.owner;
- pr_entry->creator = disk_entry.creator;
- pr_entry->ngroups = disk_entry.ngroups;
- strlcpy(pr_entry->name, disk_entry.name, sizeof(pr_entry->name));
-
- if (disk_entry.owned.len > 0)
- pr_entry->owned = disk_entry.owned.val[0];
-
- for (i = 0; i < PRSIZE && i < disk_entry.entries.len; i++)
- pr_entry->entries[i] = disk_entry.entries.val[i];
-
- mlog_log (MDEBPRDB, "read_prentry id: %d owner: %d creator: %d name: %s",
- pr_entry->id, pr_entry->owner,
- pr_entry->creator, pr_entry->name);
-
- return 0;
-}
-
-/*
- * store_disk_entry(): marshal prentry_disk and store in db
- */
-
-int
-store_disk_entry(prentry_disk *entry)
-{
- char pr_entry_disk_ydr[PRENTRY_DISK_SIZE];
- int length = PRENTRY_DISK_SIZE;
- struct mdb_datum key, value;
- int id;
-
- mlog_log (MDEBPRDB, "store_disk_entry id: %d owner: %d creator: %d name: %s",
- entry->id, entry->owner,
- entry->creator, entry->name);
-
- if (ydr_encode_prentry_disk((prentry_disk *) entry, pr_entry_disk_ydr, &length) == NULL)
- err(1, "store_disk_entry");
-
- id = htonl(entry->id);
- key.data = &id;
- key.length = sizeof(id);
-
- value.data = pr_entry_disk_ydr;
- value.length = PRENTRY_DISK_SIZE - length;
-
- return mdb_store(idtodata, &key, &value);
-}
-
-/*
- * write_prentry(): update db with classic prentry
- */
-
-int
-write_prentry(prentry *pr_entry)
-{
- prentry_disk disk_entry;
- int i;
-
- memset(&disk_entry, 0, sizeof(prentry_disk));
-
- disk_entry.flags = pr_entry->flags;
- disk_entry.id = pr_entry->id;
- disk_entry.cellid = pr_entry->cellid;
- disk_entry.owner = pr_entry->owner;
- disk_entry.creator = pr_entry->creator;
- disk_entry.ngroups = pr_entry->ngroups;
-/* disk_entry.owned = pr_entry->owned; XXX */
- strlcpy(disk_entry.name, pr_entry->name, sizeof(disk_entry.name));
-
- for (i = 0; i < PRSIZE && i < pr_entry->count; i++)
- disk_entry.entries.val[i] = pr_entry->entries[i];
-
- disk_entry.entries.len = i;
-
- return store_disk_entry(&disk_entry);
-}
-
-/*
- *
- */
-
-static int
-write_name(prentry *pr_entry)
-{
- struct mdb_datum key, value;
- int32_t id = htonl(pr_entry->id);
-
- key.data = pr_entry->name;
- key.length = strlen(pr_entry->name);
-
- value.data = &id;
- value.length = sizeof(id);
-
- return mdb_store(nametoid, &key, &value);
-}
-
-/*
- *
- */
-
-static int
-insert_entry(prentry *pr_entry)
-{
- char *pr_entry_disk_ydr;
- int status;
- int id;
-
- char *name = pr_entry->name;
-
- status = get_ydr_disk_entry(pr_entry->id, &pr_entry_disk_ydr);
- if (status == 0)
- return PREXIST;
- if (status != PRNOENT)
- return status;
-
- status = conv_name_to_id(name, &id);
- if (status == 0)
- return PREXIST;
- if (status != PRNOENT)
- return status;
-
- status = write_name(pr_entry);
- if (status)
- return status;
-
- return write_prentry(pr_entry);
-
- /* XXX: update owned and nextOwned */
- /* XXX update header */
- /* write_header(); */
-}
-
-/*
- *
- */
-
-int
-create_group(const char *name,
- int32_t id,
- int32_t owner,
- int32_t creator)
-{
- int status;
- prentry pr_entry;
-
- memset(&pr_entry, 0, sizeof(pr_entry));
- pr_entry.flags = PRGRP;
- pr_entry.id = id;
- pr_entry.owner = owner;
- pr_entry.creator = creator;
- strlcpy(pr_entry.name, name, PR_MAXNAMELEN);
-
- status = insert_entry(&pr_entry);
- if (status)
- return status;
-
- return 0;
-}
-
-/*
- *
- */
-
-int
-create_user(const char *name,
- int32_t id,
- int32_t owner,
- int32_t creator)
-{
- int status;
- prentry pr_entry;
-
- memset(&pr_entry, 0, sizeof(pr_entry));
- pr_entry.flags = 0;
- pr_entry.id = id;
- pr_entry.owner = owner;
- pr_entry.creator = creator;
- strlcpy(pr_entry.name, name, PR_MAXNAMELEN);
-
- status = insert_entry(&pr_entry);
- if (status)
- return status;
-
- return 0;
-}
-
-/*
- *
- */
-
-int
-addtogroup (int32_t uid, int32_t gid)
-{
- prentry_disk uid_entry;
- prentry_disk gid_entry;
- int error, i, tmp1, tmp2;
-
- mlog_log (MDEBPRDB, "addtogroup");
-
- error = get_disk_entry(uid, &uid_entry);
- if (error)
- return error;
-
- error = get_disk_entry(gid, &gid_entry);
- if (error)
- return error;
-
- if (uid_entry.entries.len >= (PR_MAXGROUPS - 1)
- || gid_entry.entries.len >= (PR_MAXLIST - 1))
- return PRNOENT;
-
- i = 0;
- while (uid_entry.entries.val[i] < gid && i < uid_entry.entries.len)
- i++;
-
- tmp1 = gid;
- for (; i < uid_entry.entries.len; i++) {
- tmp2 = uid_entry.entries.val[i];
- uid_entry.entries.val[i] = tmp1;
- tmp1 = tmp2;
- }
- uid_entry.entries.val[uid_entry.entries.len] = tmp1;
- uid_entry.entries.len++;
-
- i = 0;
- while (gid_entry.entries.val[i] < uid && i < gid_entry.entries.len)
- i++;
-
- tmp1 = uid;
- for (; i < gid_entry.entries.len; i++) {
- tmp2 = gid_entry.entries.val[i];
- gid_entry.entries.val[i] = tmp1;
- tmp1 = tmp2;
- }
- gid_entry.entries.val[gid_entry.entries.len] = tmp1;
- gid_entry.entries.len++;
-
- if ((error = store_disk_entry(&uid_entry)) != 0)
- return error;
-
- if ((error = store_disk_entry(&gid_entry)) != 0)
- return error;
-
- return 0;
-}
-
-/*
- *
- */
-
-int
-removefromgroup (int32_t uid, int32_t gid)
-{
- prentry_disk uid_entry;
- prentry_disk gid_entry;
- int error, i;
-
- mlog_log (MDEBPRDB, "removefromgroup");
-
- error = get_disk_entry(uid, &uid_entry);
- if (error)
- return error;
-
- error = get_disk_entry(gid, &gid_entry);
- if (error)
- return error;
-
-
- i = 0;
- while (uid_entry.entries.val[i] < gid && i < uid_entry.entries.len)
- i++;
-
- if (uid_entry.entries.val[i] != gid)
- return PRNOENT;
-
- for (i++; i < uid_entry.entries.len; i++)
- uid_entry.entries.val[i - 1] = uid_entry.entries.val[i];
-
- uid_entry.entries.len--;
-
- i = 0;
- while (gid_entry.entries.val[i] < uid && i < gid_entry.entries.len)
- i++;
-
- if (gid_entry.entries.val[i] != uid)
- return PRNOENT;
-
- for (i++; i < gid_entry.entries.len; i++)
- gid_entry.entries.val[i - 1] = gid_entry.entries.val[i];
-
- gid_entry.entries.len--;
-
- /* XXX may leave database inconsistent ?? */
-
- if ((error = store_disk_entry(&uid_entry)) != 0)
- return error;
-
- if ((error = store_disk_entry(&gid_entry)) != 0)
- return error;
-
- return 0;
-
-}
-
-/*
- *
- */
-
-int
-listelements (int32_t id, prlist *elist, Bool default_id_p)
-{
- prentry_disk disk_entry;
- int i = 0, error;
-
- error = get_disk_entry(id, &disk_entry);
- if (error)
- return error;
-
- if (default_id_p)
- elist->len = disk_entry.entries.len + 3;
- else
- elist->len = disk_entry.entries.len;
-
- elist->val = malloc(sizeof(*elist->val) * elist->len);
- if (elist->val == NULL)
- return ENOMEM; /* XXX */
-
-
- /* XXX should be sorted */
-
- for (i = 0; i < disk_entry.entries.len; i++)
- elist->val[i] = disk_entry.entries.val[i];
-
- if (default_id_p) {
- elist->val[i] = id;
- elist->val[++i] = PR_ANYUSERID;
- elist->val[++i] = PR_AUTHUSERID;
- }
-
- return 0;
-}
-
-/*
- *
- */
-
-int
-get_ydr_disk_entry(int id, char **buf)
-{
- struct mdb_datum key, value;
- int status;
-
- id = htonl(id);
-
- key.data = &id;
- key.length = sizeof(id);
-
- status = mdb_fetch(idtodata, &key, &value);
- if (status == ENOENT)
- return PRNOENT;
-
- *buf = value.data;
-
- return status;
-}
-
-/*
- *
- */
-
-int
-get_disk_entry(int id, prentry_disk *entry)
-{
- char *pr_entry_disk_ydr;
- int length = PRENTRY_DISK_SIZE; /* XXX maxsize in mdb??? */
- int status;
-
- status = get_ydr_disk_entry(id, &pr_entry_disk_ydr);
- if (status)
- return status;
-
- if (ydr_decode_prentry_disk(entry, pr_entry_disk_ydr, &length) == NULL)
- err(1, "get_disk_entry");
-
- return status;
-}
-
-/*
- *
- */
-
-int
-conv_name_to_id(const char *name, int *id)
-{
- struct mdb_datum key, value;
- int status;
-
- key.data = strdup(name); /*XXX*/
- key.length = strlen(name);
-
- status = mdb_fetch(nametoid, &key, &value);
- if (status == ENOENT)
- status = PRNOENT;
- else
- *id = ntohl(*((int *)value.data));
-
- free(key.data);
-
- return status;
-}
-
-/*
- *
- */
-
-int
-conv_id_to_name(int id, char *name)
-{
- prentry pr_entry;
- int status;
-
- status = read_prentry(id, &pr_entry);
- if (status)
- return status;
- strlcpy(name, pr_entry.name, PR_MAXNAMELEN);
- return 0;
-}
-
-/*
- *
- */
-
-int
-next_free_group_id(int *id)
-{
- pr_header.maxGroup--; /* XXX */
- if (pr_header.maxGroup == ILLEGAL_GROUP) {
- pr_header.maxGroup++;
- return -1;
- }
-
- write_header();
-
- *id = pr_header.maxGroup;
- return 0;
-}
-
-/*
- *
- */
-
-int
-next_free_user_id(int *id)
-{
- pr_header.maxID++; /* XXX */
- if (pr_header.maxID == ILLEGAL_ID) {
- pr_header.maxID--;
- return -1;
- }
-
- write_header();
-
- *id = pr_header.maxID;
- return 0;
-}
-
-/*
- *
- */
-
-static void
-open_db (char *databaseprefix, int flags)
-{
- char database[MAXPATHLEN];
-
- if (databaseprefix == NULL)
- databaseprefix = MILKO_SYSCONFDIR;
-
- snprintf (database, sizeof(database), "%s/pr_idtodata",
- databaseprefix);
-
- mlog_log (MDEBPR, "Loading db from file %s\n", database);
-
- idtodata = mdb_open(database, flags, 0600);
- if (idtodata == NULL)
- err(1, "failed open (%s)", database);
-
-
- snprintf (database, sizeof(database), "%s/pr_nametoid",
- databaseprefix);
-
- mlog_log (MDEBPR, "Loading db from file %s\n", database);
-
- nametoid = mdb_open(database, flags, 0600);
- if (nametoid == NULL)
- err(1, "failed open (%s)", database);
-}
-
-void
-prserver_close(void)
-{
- mdb_close(idtodata);
- mdb_close(nametoid);
-}
-
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
-/*
- *
- */
-
-static int
-prserver_create (char *databaseprefix)
-{
- int status;
-
- open_db (databaseprefix, O_RDWR|O_CREAT|O_EXCL|O_BINARY);
-
- printf ("Creating a new pr-database.\n");
- create_database();
-
-#define M(N,I,O,G) \
- do { \
- status = create_group((N), (I), (O), (G)); \
- if (status) \
- errx (1, "failed when creating %s with error %d", \
- (N), status); \
- } while (0)
-
- M("system:administrators", PR_SYSADMINID, PR_SYSADMINID, PR_SYSADMINID);
- M("system:anyuser", PR_ANYUSERID, PR_SYSADMINID, PR_SYSADMINID);
- M("system:authuser", PR_AUTHUSERID, PR_SYSADMINID, PR_SYSADMINID);
- M("anonymous", PR_ANONYMOUSID, PR_SYSADMINID, PR_SYSADMINID);
-
-#undef M
-
- prserver_close();
-
- return 0;
-}
-
-/*
- *
- */
-
-static int
-prserver_init(char *databaseprefix)
-{
- open_db(databaseprefix, O_RDWR|O_BINARY);
- read_header();
-
- return 0;
-}
-
-/*
- *
- */
-
-static char *cell = NULL;
-static char *realm = NULL;
-static char *srvtab_file = NULL;
-static char *log_file = "syslog";
-static char *debug_levels = NULL;
-static int no_auth = 0;
-static int do_help = 0;
-static char *databasedir = NULL;
-static int do_create = 0;
-
-static struct agetargs args[] = {
- {"cell", 0, aarg_string, &cell, "what cell to use"},
- {"realm", 0, aarg_string, &realm, "what realm to use"},
- {"debug", 'd', aarg_string, &debug_levels, "debug level"},
- {"log", 'l', aarg_string, &log_file,
- "where to write log (stderr, syslog (default), or path to file)"},
- {"srvtab", 0, aarg_string, &srvtab_file, "what srvtab to use"},
- {"noauth", 0, aarg_flag, &no_auth, "disable authentication checks"},
- {"help", 'h', aarg_flag, &do_help, "help"},
- {"dbdir", 0, aarg_string, &databasedir, "where to store the db"},
- {"create", 0, aarg_flag, &do_create, "create new database"},
- { NULL, 0, aarg_end, NULL }
-};
-
-/*
- *
- */
-
-static void
-usage(int exit_code)
-{
- aarg_printusage (args, NULL, "", AARG_GNUSTYLE);
- exit (exit_code);
-}
-
-/*
- *
- */
-
-int
-main(int argc, char **argv)
-{
- int optind = 0;
- int ret;
- Log_method *method;
-
- set_progname (argv[0]);
-
- if (agetarg (args, argc, argv, &optind, AARG_GNUSTYLE)) {
- usage (1);
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc) {
- printf("unknown option %s", *argv);
- return 1;
- }
-
- if (do_help)
- usage(0);
-
- if (no_auth)
- sec_disable_superuser_check ();
-
- method = log_open (getprogname(), log_file);
- if (method == NULL)
- errx (1, "log_open failed");
- cell_init(0, method);
- ports_init();
-
- printf ("ptserver booting");
-
- mlog_loginit (method, milko_deb_units, MDEFAULT_LOG);
-
- if (debug_levels)
- mlog_log_set_level (debug_levels);
-
- if (cell)
- cell_setthiscell (cell);
-
- network_kerberos_init (srvtab_file);
-
- if (do_create) {
- prserver_create (databasedir);
- return 0;
- }
-
- ret = prserver_init(databasedir);
- if (ret)
- errx (1, "prserver_init: error %d", ret);
-
- ret = network_init(htons(afsprport), "pr", PR_SERVICE_ID,
- PR_ExecuteRequest, &prservice, realm);
- if (ret)
- errx (1, "network_init returned %d", ret);
-
- mlog_log (MDEBWARN, "started");
-
- rx_SetMaxProcs(prservice,5) ;
- rx_StartServer(1) ;
-
- abort();
- return 0;
-}
diff --git a/usr.sbin/afs/src/milko/pts/ptserver.h b/usr.sbin/afs/src/milko/pts/ptserver.h
deleted file mode 100644
index c77965c0eb1..00000000000
--- a/usr.sbin/afs/src/milko/pts/ptserver.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 1998 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: ptserver.h,v 1.10 2001/10/12 15:25:50 tol Exp $ */
-
-void
-write_header(void);
-
-void
-read_header(void);
-
-int
-read_prentry(int id, prentry *pr_entry);
-
-int
-write_prentry(prentry *pr_entry);
-
-int
-store_disk_entry(prentry_disk *entry);
-
-int
-get_disk_entry(int id, prentry_disk *disk_entry);
-
-int
-get_ydr_disk_entry(int id, char **buf);
-
-int
-conv_name_to_id(const char *name, int *id);
-
-int
-conv_id_to_name(int id, char *name);
-
-int
-next_free_group_id(int *id);
-
-int
-next_free_user_id(int *id);
-
-int
-create_user(const char *name, int32_t id, int32_t owner, int32_t creator);
-int
-create_group(const char *name, int32_t id, int32_t owner, int32_t creator);
-
-int
-addtogroup(int32_t uid, int32_t gid);
-
-int
-removefromgroup(int32_t uid, int32_t gid);
-
-int
-listelements(int32_t id, prlist *elist, Bool default_id_p);
-
-char *
-localize_name(const char *name, Bool *localp);
-
-extern prheader_disk pr_header;
-
-
diff --git a/usr.sbin/afs/src/milko/vldb/Makefile.in b/usr.sbin/afs/src/milko/vldb/Makefile.in
deleted file mode 100644
index 9da4c3a44b5..00000000000
--- a/usr.sbin/afs/src/milko/vldb/Makefile.in
+++ /dev/null
@@ -1,126 +0,0 @@
-# $KTH: Makefile.in,v 1.12 2000/10/10 20:56:29 lha Exp $
-
-srcdir = @srcdir@
-top_builddir = ../..
-VPATH = @srcdir@
-
-CC = @CC@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-libexecdir = @libexecdir@
-bindir = @bindir@
-sysconfdir = @sysconfdir@
-transform = @program_transform_name@
-
-VLDBSERVER_BIN = vldbserver
-
-DEFS = @DEFS@ -DMILKO_SYSCONFDIR=\"$(sysconfdir)\"
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-LDFLAGS = @LDFLAGS@
-
-ETAGS = etags
-MAKEDEPEND = makedepend
-AFSWSROOT = /usr/afsws
-RXKADINC = -I$(srcdir)/../rxkad
-INCLUDES = -I$(srcdir)/../.. \
- -I../../include \
- -I$(srcdir)/../../include \
- -I$(srcdir)/../lib/msecurity \
- -I../../rxdef \
- @INC_roken@ \
- $(RXKADINC)
-DEFINES = -DDEBUG
-REALCFLAGS = $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS) -DRXDEBUG
-RXKADLIB = @MILKO_RXKAD_LIBS@
-LIBS = -L../../rxdef -lrxvlserver \
- -L../lib/msecurity -lmsecurity \
- -L../../lib/acl -lacl \
- -L../../rxdef -lrxvolserver -lrxfsserver -L../../rx -lrx \
- -L../../lib/ko -lko \
- -L../../util -lutil \
- -L../../lwp -llwp @PLWP_LIB_FLAGS@ \
- $(RXKADLIB) \
- @LIB_roken@ \
- @LIBS@
-LIBDEPENDS = ../../rxdef/librxdefclient.a ../../rx/librx.a \
- ../../lwp/liblwp.a ../../util/libutil.a \
- ../../lib/ko/libko.a \
- ../lib/voldb/libvoldb.a ../lib/vld/libvld.a \
- ../lib/msecurity/libmsecurity.a
-PROGS = vldbserver vled
-
-SRCS = \
- vled.c \
- vld_db.c \
- vldbserver.c \
- ubikprocs.c
-
-HDRS =
-
-vldbserver_OBJS = \
- vl_db.o \
- vldbserver.o \
- ubikprocs.o
-
-vled_OBJS = \
- vled.o \
- vl_db.o
-
-
-.PHONY: all install uninstall depend tags clean
-
-all: $(PROGS)
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libexecdir)
- PROG_BIN='$(VLDBSERVER_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(libexecdir)/$$f; \
- done
-
-uninstall:
- PROG_BIN='$(VLDBSERVER_BIN)'; for x in $$PROG_BIN; do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(libexecdir)/$$f; \
- done
-
-vldbserver: $(vldbserver_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(vldbserver_OBJS) $(LIBS)
-
-vled: $(vled_OBJS) $(LIBDEPENDS)
- $(CC) $(LDFLAGS) -o $@ $(vled_OBJS) $(LIBS)
-
-Makefile: Makefile.in ../../config.status
- cd ../..; CONFIG_FILES=milko/vldb/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(SRCS)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(PROGS) $(OBJS) *~ *.o core *.core
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile config.status
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/milko/vldb/ubikprocs.c b/usr.sbin/afs/src/milko/vldb/ubikprocs.c
deleted file mode 100644
index 84742999990..00000000000
--- a/usr.sbin/afs/src/milko/vldb/ubikprocs.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "ubik.ss.h"
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#ifdef KERBEROS
-#include <krb.h>
-#endif
-
-RCSID("$arla: ubikprocs.c,v 1.3 2000/10/03 00:21:02 lha Exp $");
-
-int Ubik_Beacon(struct rx_call *call,
- const int32_t state,
- const int32_t voteStart,
- const net_version *Version,
- const struct net_tid *tid)
-{
- return -1;
-}
-
-int Ubik_Debug(struct rx_call *call,
- struct ubik_debug *db)
-{
-#ifdef KERBEROS
- {
- struct in_addr *ina;
- int ret;
-
- ret = k_get_all_addrs(&ina);
- if (ret < 1)
- return -1;
- db->syncHost = ntohl(ina[0].s_addr); /* XXX */
- }
-#else
- {
- char name[MAXHOSTNAMELEN];
- struct hostent *he;
- struct in_addr tmp;
-
- if (gethostname (name, sizeof(name)) < 0)
- return -1;
- he = gethostbyname (name);
- if (he == NULL)
- return -1;
- memcpy (&tmp, he->h_addr_list[0], sizeof(struct in_addr));
- db->syncHost = ntohl(tmp.s_addr);
- }
-#endif
-
- return 0;
-}
-
-int Ubik_SDebug(struct rx_call *call,
- const int32_t which,
- struct ubik_sdebug *db)
-{
- return -1;
-}
-
-int Ubik_GetSyncSite(struct rx_call *call,
- int32_t *site)
-{
- return -1;
-}
diff --git a/usr.sbin/afs/src/milko/vldb/vl_db.c b/usr.sbin/afs/src/milko/vldb/vl_db.c
deleted file mode 100644
index 685e207c52a..00000000000
--- a/usr.sbin/afs/src/milko/vldb/vl_db.c
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "vldb_locl.h"
-
-RCSID("$arla: vl_db.c,v 1.10 2002/06/02 21:12:20 lha Exp $");
-
-#define DISK_VLENTRY_MAX 10000
-
-static void open_db (char *databaseprefix, int flags);
-
-int vl_database;
-vital_vlheader vl_header;
-
-MDB *idtoname, *nametodata;
-
-void
-vldb_write_header(void)
-{
- int length = VITAL_VLHEADER_SIZE;
- struct mdb_datum key, value;
- char vl_header_ydr[VITAL_VLHEADER_SIZE];
- int code;
- char headerid[] = "\0\0\0\0";
-
- if (ydr_encode_vital_vlheader(&vl_header, vl_header_ydr, &length) == NULL)
- err(1, "write_header");
-
- assert (length == 0);
-
- key.data = headerid;
- key.length = sizeof(headerid);
-
- value.data = vl_header_ydr;
- value.length = VITAL_VLHEADER_SIZE;
-
- code = mdb_store(nametodata, &key, &value);
- assert(code == 0);
-
-}
-
-void
-vldb_read_header(void)
-{
- int length = VITAL_VLHEADER_SIZE;
- struct mdb_datum key, value;
- char headerid[] = "\0\0\0\0";
- int ret;
-
- key.data = headerid;
- key.length = sizeof(headerid);
-
- value.data = malloc(length);
- value.length = length;
-
- ret = mdb_fetch(nametodata, &key, &value);
-
- if (ret) {
- errx(1, "read_header: mdb_fetch failed");
- }
-
- assert(value.length == VITAL_VLHEADER_SIZE);
-
- if (ydr_decode_vital_vlheader(&vl_header, value.data, &length) == NULL)
- err(1, "read_header");
-}
-
-static void
-create_database(void)
-{
- int i;
-
- vl_header.vldbversion = 0;
- vl_header.headersize = VITAL_VLHEADER_SIZE;
- vl_header.freePtr = 0;
- vl_header.eofPtr = VITAL_VLHEADER_SIZE;
- vl_header.allocs = 0;
- vl_header.frees = 0;
- vl_header.MaxVolumeId = 0x20000000;
- for (i = 0; i < MAXTYPES; i++)
- vl_header.totalEntries[i] = 0;
-
- vldb_write_header();
-}
-
-int
-vldb_write_entry(const disk_vlentry *vldb_entry)
-{
- struct mdb_datum datum;
- struct mdb_datum key;
- char *disk_vlentry_ydr;
- int length = DISK_VLENTRY_MAX;
- int ret;
-
- disk_vlentry_ydr = malloc(length);
-
- if (ydr_encode_disk_vlentry(vldb_entry, disk_vlentry_ydr, &length) == NULL)
- err(1, "write_entry");
-
- datum.data = disk_vlentry_ydr;
- datum.length = DISK_VLENTRY_MAX - length;
-
- length = datum.length;
-
- key.data = (char *) vldb_entry->name;
- key.length = strlen(vldb_entry->name);
-
- ret = mdb_store(nametodata, &key, &datum);
- free(disk_vlentry_ydr);
- return ret;
-}
-
-int
-vldb_read_entry(const char *name, disk_vlentry *entry)
-{
- struct mdb_datum key, value;
- int length;
- int ret;
-
- key.data = (char *) name;
- key.length = strlen(name);
-
- ret = mdb_fetch(nametodata, &key, &value);
-
- if (ret)
- return ret;
-
- length = value.length;
-
- if (ydr_decode_disk_vlentry(entry, value.data, &length) == NULL)
- err(1, "read_entry");
-
- return 0;
-}
-
-int
-vldb_delete_entry(const char *name)
-{
- struct mdb_datum key;
- int ret;
-
- key.data = (char *) name;
- key.length = strlen(name);
-
- ret = mdb_delete(nametodata, &key);
-
- if (ret)
- return ret;
-
- return 0;
-}
-
-int
-vldb_id_to_name(const int32_t volid, char **name)
-{
- struct mdb_datum key, value;
- int ret;
-
- key.data = (char *)&volid;
- key.length = sizeof(volid);
-
- ret = mdb_fetch(idtoname, &key, &value);
-
- if (ret)
- return ret;
-
- *name = malloc(value.length+1);
-
- if (*name == 0)
- return ENOMEM;
-
- memcpy(*name, value.data, value.length);
- (*name)[value.length] = '\0';
-
- return 0;
-}
-
-int
-vldb_write_id (const char *name, const uint32_t volid)
-{
- struct mdb_datum datum, key;
- char *name_copy;
- uint32_t volid_copy = volid;
-
- if (volid == 0)
- return 0;
-
- name_copy = strdup(name);
-
- datum.data = name_copy;
- datum.length = strlen(name_copy);
-
- key.data=&volid_copy;
- key.length = sizeof(volid);
-
- mdb_store(idtoname, &key, &datum);
-
- free(name_copy);
- return 0;
-}
-
-int
-vldb_delete_id (const char *name, const uint32_t volid)
-{
- struct mdb_datum named, vold;
- char *name_copy;
- uint32_t volid_copy = volid;
- int ret;
-
- if (volid == 0)
- return 0;
-
- name_copy = strdup(name);
-
- named.data = name_copy;
- named.length = strlen(name_copy);
-
- vold.data=&volid_copy;
- vold.length = sizeof(volid);
-
- ret = mdb_delete(idtoname, &vold);
- if (ret)
- return ret;
-
- free(name_copy);
- return 0;
-}
-
-int
-vldb_print_entry (vldbentry *entry, int long_print)
-{
- int i;
- printf ("name: %s\n"
- "\tid: rw: %u ro: %u bu: %u\n",
- entry->name,
- entry->volumeId[RWVOL],
- entry->volumeId[ROVOL],
- entry->volumeId[BACKVOL]);
- if (!long_print)
- return 0;
- printf ("\tservers:\n");
- for (i = 0; i < MAXNSERVERS; i++) {
- struct in_addr in;
- in.s_addr = ntohl(entry->serverNumber[i]);
- if (entry->serverFlags[i])
- printf ("\t\t%2d: %-16s %d %s %s %s %s\n",
- i,
- inet_ntoa (in),
- entry->serverPartition[i],
- entry->serverFlags[i] & VLSF_RWVOL ? "RW" : " ",
- entry->serverFlags[i] & VLSF_ROVOL ? "RO" : " ",
- entry->serverFlags[i] & VLSF_BACKVOL ? "BU" : " ",
- entry->serverFlags[i] & VLSF_NEWREPSITE ? "New site" : "");
- }
-
- return 0;
-}
-
-static void
-open_db (char *databaseprefix, int flags)
-{
-
- char database[MAXPATHLEN];
-
- if (databaseprefix == NULL)
- databaseprefix = MILKO_SYSCONFDIR;
-
- snprintf (database, sizeof(database), "%s/vl_idtoname",
- databaseprefix);
-
- mlog_log (MDEBVL, "Loading db from file %s\n", database);
-
- idtoname = mdb_open(database, flags, 0600);
-
- if (idtoname == NULL)
- err(1, "failed open (%s)", database);
-
- snprintf (database, sizeof(database), "%s/vl_nametodata",
- databaseprefix);
-
- mlog_log (MDEBVL, "Loading db from file %s\n", database);
-
- nametodata = mdb_open(database, flags, 0600);
-
- if (nametodata == NULL)
- err(1, "failed open (%s)", database);
-}
-
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
-void
-vldb_create (char *databaseprefix)
-{
- open_db (databaseprefix, O_RDWR|O_CREAT|O_EXCL|O_BINARY);
-
- printf ("Creating a new vl-database.\n");
- create_database();
-}
-
-void
-vldb_init(char *databaseprefix)
-{
- open_db (databaseprefix, O_RDWR|O_BINARY);
- vldb_read_header();
-}
-
-void
-vldb_close(void)
-{
- mdb_close(nametodata);
- mdb_close(idtoname);
-}
-
-void
-vldb_flush(void)
-{
- mdb_flush(nametodata);
- mdb_flush(idtoname);
-}
diff --git a/usr.sbin/afs/src/milko/vldb/vl_disk.c b/usr.sbin/afs/src/milko/vldb/vl_disk.c
deleted file mode 100644
index eaabec35734..00000000000
--- a/usr.sbin/afs/src/milko/vldb/vl_disk.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "vldb_locl.h"
-
-RCSID("$arla: vl_disk.c,v 1.1 2001/10/03 00:47:54 map Exp $");
-
-void
-vldb_entry_to_disk(const struct vldbentry *entry,
- struct disk_vlentry *diskentry)
-{
- int i;
- int nservers;
-
- memset(diskentry, 0, sizeof(*diskentry));
- diskentry->volumeId[RWVOL] = entry->volumeId[RWVOL];
- diskentry->volumeId[ROVOL] = entry->volumeId[ROVOL];
- diskentry->volumeId[BACKVOL] = entry->volumeId[BACKVOL];
- diskentry->flags = entry->flags;
- diskentry->cloneId = entry->cloneId;
- diskentry->name = strdup(entry->name);
-
- nservers = min(entry->nServers, NMAXNSERVERS);
-
- diskentry->serverNumber.len = nservers;
- diskentry->serverPartition.len = nservers;
- diskentry->serverFlags.len = nservers;
-
- diskentry->serverNumber.val = malloc(sizeof(int32_t) * nservers);
- diskentry->serverPartition.val = malloc(sizeof(int32_t) * nservers);
- diskentry->serverFlags.val = malloc(sizeof(int32_t) * nservers);
-
- for (i = 0; i < nservers; i++) {
- diskentry->serverNumber.val[i] = entry->serverNumber[i];
- diskentry->serverPartition.val[i] = entry->serverPartition[i];
- diskentry->serverFlags.val[i] = entry->serverFlags[i];
- }
-}
-
-void
-vldb_nentry_to_disk(const struct nvldbentry *entry,
- struct disk_vlentry *diskentry)
-{
- int i;
- int nservers;
-
- memset(diskentry, 0, sizeof(*diskentry));
- diskentry->volumeId[RWVOL] = entry->volumeId[RWVOL];
- diskentry->volumeId[ROVOL] = entry->volumeId[ROVOL];
- diskentry->volumeId[BACKVOL] = entry->volumeId[BACKVOL];
- diskentry->flags = entry->flags;
- diskentry->cloneId = entry->cloneId;
- diskentry->name = strdup(entry->name);
-
- nservers = min(entry->nServers, NMAXNSERVERS);
-
- diskentry->serverNumber.len = nservers;
- diskentry->serverPartition.len = nservers;
- diskentry->serverFlags.len = nservers;
-
- diskentry->serverNumber.val = malloc(sizeof(int32_t) * nservers);
- diskentry->serverPartition.val = malloc(sizeof(int32_t) * nservers);
- diskentry->serverFlags.val = malloc(sizeof(int32_t) * nservers);
-
- for (i = 0; i < nservers; i++) {
- diskentry->serverNumber.val[i] = entry->serverNumber[i];
- diskentry->serverPartition.val[i] = entry->serverPartition[i];
- diskentry->serverFlags.val[i] = entry->serverFlags[i];
- }
-}
-
-
-void
-vldb_disk_to_entry(const struct disk_vlentry *diskentry,
- struct vldbentry *entry)
-{
- int i;
-
- memset(entry, 0, sizeof(*entry));
- entry->volumeId[RWVOL] = diskentry->volumeId[RWVOL];
- entry->volumeId[ROVOL] = diskentry->volumeId[ROVOL];
- entry->volumeId[BACKVOL] = diskentry->volumeId[BACKVOL];
- entry->flags = diskentry->flags;
- entry->cloneId = diskentry->cloneId;
-
- strncpy(entry->name, diskentry->name, VLDB_MAXNAMELEN);
-
- entry->nServers = min(MAXNSERVERS, diskentry->serverNumber.len);
-
- for (i = 0; i < entry->nServers; i++) {
- entry->serverNumber[i] = diskentry->serverNumber.val[i];
- entry->serverPartition[i] = diskentry->serverPartition.val[i];
- entry->serverFlags[i] = diskentry->serverFlags.val[i];
- }
-}
-
-void
-vldb_disk_to_nentry(const struct disk_vlentry *diskentry,
- struct nvldbentry *entry)
-{
- int i;
-
- memset(entry, 0, sizeof(*entry));
- entry->volumeId[RWVOL] = diskentry->volumeId[RWVOL];
- entry->volumeId[ROVOL] = diskentry->volumeId[ROVOL];
- entry->volumeId[BACKVOL] = diskentry->volumeId[BACKVOL];
- entry->flags = diskentry->flags;
- entry->cloneId = diskentry->cloneId;
-
- strncpy(entry->name, diskentry->name, VLDB_MAXNAMELEN);
-
- entry->nServers = min(NMAXNSERVERS, diskentry->serverNumber.len);
-
- for (i = 0; i < entry->nServers; i++) {
- entry->serverNumber[i] = diskentry->serverNumber.val[i];
- entry->serverPartition[i] = diskentry->serverPartition.val[i];
- entry->serverFlags[i] = diskentry->serverFlags.val[i];
- }
-}
-
-
-void
-vldb_free_diskentry(struct disk_vlentry *diskentry)
-{
- free(diskentry->name);
- free(diskentry->serverNumber.val);
- free(diskentry->serverPartition.val);
- free(diskentry->serverFlags.val);
-}
diff --git a/usr.sbin/afs/src/milko/vldb/vldb_locl.h b/usr.sbin/afs/src/milko/vldb/vldb_locl.h
deleted file mode 100644
index 233f37b408d..00000000000
--- a/usr.sbin/afs/src/milko/vldb/vldb_locl.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <rx/rx.h>
-#include <rx/rx_null.h>
-
-#include <ports.h>
-#include <ko.h>
-
-#ifdef KERBEROS
-#ifdef HAVE_OPENSSL
-#include <openssl/des.h>
-#else
-#include <des.h>
-#endif
-#include <krb.h>
-#include <rxkad.h>
-#endif
-
-#include <err.h>
-#include <assert.h>
-#include <ctype.h>
-
-#ifndef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include <service.h>
-#include <msecurity.h>
-#include <netinit.h>
-
-#include <agetarg.h>
-
-#include <mlog.h>
-#include <mdebug.h>
-#include <mdb.h>
-
-#include "rx/rxgencon.h"
-#include "vldb.h"
-#include "vldb.ss.h"
-#include "ubik.ss.h"
-
-
-extern int vl_database;
-extern vital_vlheader vl_header;
-
-void vldb_write_header (void);
-void vldb_read_header (void);
-int vldb_write_entry(const disk_vlentry *vldb_entry);
-int vldb_read_entry (const char *name, disk_vlentry *entry);
-int vldb_delete_entry (const char *name);
-int vldb_id_to_name (const int32_t volid, char **name);
-int vldb_write_id (const char *name, const uint32_t volid);
-int vldb_delete_id (const char *name, const uint32_t volid);
-void vldb_close(void);
-void vldb_flush(void);
-
-
-unsigned long vldb_get_id_hash (long id);
-unsigned long vldb_get_name_hash (const char *name);
-void vldb_create (char *databaseprefix);
-void vldb_init (char *databaseprefix);
-int vldb_print_entry (vldbentry *entry, int long_print);
-
-void vldb_entry_to_disk(const struct vldbentry *newentry,
- struct disk_vlentry *diskentry);
-void vldb_nentry_to_disk(const struct nvldbentry *entry,
- struct disk_vlentry *diskentry);
-void vldb_disk_to_entry(const struct disk_vlentry *diskentry,
- struct vldbentry *entry);
-void vldb_disk_to_nentry(const struct disk_vlentry *diskentry,
- struct nvldbentry *entry);
-
-void vldb_free_diskentry(struct disk_vlentry *diskentry);
diff --git a/usr.sbin/afs/src/milko/vldb/vldbserver.c b/usr.sbin/afs/src/milko/vldb/vldbserver.c
deleted file mode 100644
index 40b58e93c91..00000000000
--- a/usr.sbin/afs/src/milko/vldb/vldbserver.c
+++ /dev/null
@@ -1,889 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "vldb_locl.h"
-
-RCSID("$arla: vldbserver.c,v 1.46 2003/02/15 16:03:35 map Exp $");
-
-/*
- * The rpc - calls
- */
-
-int
-VL_CreateEntry(struct rx_call *call,
- const vldbentry *newentry)
-{
- char *name;
- disk_vlentry diskentry;
- disk_vlentry tempentry;
-
- mlog_log (MDEBVL, "VL_CreateEntry (name=%s, ids=%d,%d,%d flags=%d)\n",
- newentry->name,
- newentry->volumeId[RWVOL],
- newentry->volumeId[ROVOL],
- newentry->volumeId[BACKVOL],
- newentry->flags);
-
-
- if (!sec_is_superuser(call))
- return VL_PERM;
-
- if ((vldb_id_to_name(newentry->volumeId[RWVOL], &name) == 0) ||
- (vldb_id_to_name(newentry->volumeId[ROVOL], &name) == 0) ||
- (vldb_id_to_name(newentry->volumeId[BACKVOL], &name) == 0)) {
- free(name);
- mlog_log (MDEBVL, "VL_CreateEntry: id exists\n");
- return VL_NAMEEXIST;
- }
-
- if (vldb_read_entry(newentry->name, &tempentry) == 0) {
- mlog_log (MDEBVL, "VL_CreateEntry: name exists\n");
- return VL_NAMEEXIST;
- }
-
- vldb_entry_to_disk(newentry, &diskentry);
-
- if (vldb_write_entry(&diskentry) != 0)
- return VL_IO;
-
- if (vldb_write_id(newentry->name,
- newentry->volumeId[RWVOL]) != 0)
- return VL_IO; /* XXX rollback */
-
- if (vldb_write_id(newentry->name,
- newentry->volumeId[ROVOL]) != 0)
- return VL_IO; /* XXX rollback */
-
- if (vldb_write_id(newentry->name,
- newentry->volumeId[BACKVOL]) != 0)
- return VL_IO; /* XXX rollback */
-
- vldb_flush();
-
- vldb_free_diskentry(&diskentry);
-
- return 0;
-}
-
-int
-VL_DeleteEntry(struct rx_call *call,
- const int32_t Volid,
- const int32_t voltype)
-{
- disk_vlentry entry;
- char *name;
- int ret;
-
- mlog_log (MDEBVL, "VL_DeleteEntry (Volid=%d,Voltype=%d)\n",
- Volid, voltype);
-
- if (!sec_is_superuser(call)) {
- ret = VL_PERM;
- goto out;
- }
-
- if (voltype != RWVOL &&
- voltype != ROVOL &&
- voltype != BACKVOL) {
- ret = VL_BADVOLTYPE;
- goto out;
- }
-
- if (vldb_id_to_name(Volid, &name)) {
- ret = VL_NOENT;
- goto out;
- }
-
- if (vldb_read_entry(name, &entry) != 0) {
- ret = VL_NOENT;
- goto out;
- }
-
- if (entry.volumeId[voltype] != Volid) {
- ret = VL_NOENT;
- goto out;
- }
-
- if (vldb_delete_id(name, entry.volumeId[RWVOL])) {
- mlog_log (MDEBVL, "VL_DeleteEntry failed to remove RW id %d\n",
- entry.volumeId[RWVOL]);
- ret = VL_IO;
- goto out;
- }
- if (vldb_delete_id(name, entry.volumeId[ROVOL])) {
- mlog_log (MDEBVL, "VL_DeleteEntry failed to remove RO id %d\n",
- entry.volumeId[ROVOL]);
- ret = VL_IO;
- goto out;
- }
- if (vldb_delete_id(name, entry.volumeId[BACKVOL])) {
- mlog_log (MDEBVL, "VL_DeleteEntry failed to remove BK id %d\n",
- entry.volumeId[BACKVOL]);
- ret = VL_IO;
- goto out;
- }
- if (vldb_delete_entry(name)) {
- mlog_log (MDEBVL, "VL_DeleteEntry failed to remove data\n");
- ret = VL_IO;
- goto out;
- }
-
- free(name);
-
- vldb_flush();
-
- ret = 0;
-
- out:
- mlog_log (MDEBVL, "VL_DeleteEntry returns %d\n", ret);
-
- return ret;
-}
-
-/*
- *
- */
-
-int
-VL_GetEntryByID(struct rx_call *call,
- const int32_t Volid,
- const int32_t voltype,
- vldbentry *entry)
-{
- disk_vlentry diskentry;
- char *name;
- mlog_log (MDEBVL, "VL_GetEntryByID (Volid=%d,Voltype=%d)\n",
- Volid, voltype);
-
- if (vldb_id_to_name(Volid, &name))
- return VL_NOENT;
-
- if (vldb_read_entry(name, &diskentry) != 0)
- return VL_NOENT;
-
- vldb_disk_to_entry(&diskentry, entry);
-
- free(name);
-
- return 0;
-}
-
-/*
- *
- */
-
-int
-VL_GetEntryByName(struct rx_call *call,
- const char *volumename,
- vldbentry *entry)
-{
- disk_vlentry diskentry;
-
- mlog_log (MDEBVL, "VL_GetEntryByName (volumename = %s)\n",
- volumename);
-
- if (isdigit(volumename[0])) {
- return VL_GetEntryByID(call, atol(volumename), 0 /* XXX */, entry);
- }
-
- if (vldb_read_entry(volumename, &diskentry) != 0)
- return VL_NOENT;
-
- vldb_disk_to_entry(&diskentry, entry);
-
- return 0;
-}
-
-/*
- *
- */
-
-int
-VL_GetNewVolumeId (struct rx_call *call,
- const int32_t bumpcount,
- int32_t *newvolumid)
-{
- mlog_log (MDEBVL, "VL_GetNewVolumeId(bumpcount=%d)\n", bumpcount) ;
-
- if (!sec_is_superuser(call))
- return VL_PERM;
-
- *newvolumid = vl_header.MaxVolumeId;
- mlog_log (MDEBVL, " returning low volume id = %d\n", *newvolumid);
- vl_header.MaxVolumeId += bumpcount;
- vldb_write_header();
-
- vldb_flush();
-
- return 0;
-}
-
-/*
- *
- */
-
-int
-VL_ReplaceEntry (struct rx_call *call,
- const int32_t Volid,
- const int32_t voltype,
- const vldbentry *newentry,
- const int32_t ReleaseType)
-{
- mlog_log (MDEBVL, "VL_ReplaceEntry\n") ;
-
- if (!sec_is_superuser(call))
- return VL_PERM;
-
- return VL_PERM ;
-}
-
-/*
- *
- */
-
-int
-VL_UpdateEntry (struct rx_call *call,
- const int32_t Volid,
- const int32_t voltype,
- const VldbUpdateEntry *UpdateEntry,
- const int32_t ReleaseType)
-{
- mlog_log (MDEBVL, "VL_UpdateEntry\n") ;
-
- if (!sec_is_superuser(call))
- return VL_PERM;
-
- return VL_PERM ;
-}
-
-/*
- *
- */
-
-int
-VL_SetLock (struct rx_call *call,
- const int32_t Volid,
- const int32_t voltype,
- const int32_t voloper)
-{
- mlog_log (MDEBVL, "VL_SetLock\n") ;
-
- if (!sec_is_superuser(call))
- return VL_PERM;
-
- return 0;
-}
-
-/*
- *
- */
-
-int
-VL_ReleaseLock (struct rx_call *call,
- const int32_t volid,
- const int32_t voltype,
- const int32_t ReleaseType)
-{
- mlog_log (MDEBVL, "VL_ReleaseLock\n") ;
-
- if (!sec_is_superuser(call))
- return VL_PERM;
-
-
- return 0;
-}
-
-/*
- *
- */
-
-int
-VL_ListEntry (struct rx_call *call,
- const int32_t previous_index,
- int32_t *count,
- int32_t *next_index,
- vldbentry *entry)
-{
- mlog_log (MDEBVL, "VL_ListEntry\n") ;
- return VL_PERM ;
-}
-
-/*
- *
- */
-
-int
-VL_ListAttributes (struct rx_call *call,
- const VldbListByAttributes *attributes,
- int32_t *nentries,
- bulkentries *blkentries)
-{
- mlog_log (MDEBVL, "VL_ListAttributes\n") ;
- return VL_PERM ;
-}
-
-/*
- *
- */
-
-int
-VL_GetStats (struct rx_call *call,
- vldstats *stats,
- vital_vlheader *vital_header)
-{
- mlog_log (MDEBVL, "VL_GetStats") ;
- return VL_PERM ;
-}
-
-/*
- *
- */
-
-int
-VL_Probe(struct rx_call *call)
-{
- mlog_log (MDEBVL, "VL_Probe\n") ;
- return 0;
-}
-
-/*
- *
- */
-
-int
-VL_CreateEntryN(struct rx_call *call,
- const nvldbentry *entry)
-{
- char *name;
- disk_vlentry diskentry;
- disk_vlentry tempentry;
-
- mlog_log (MDEBVL, "VL_CreateEntryN (name=%s, ids=%d,%d,%d flags=%d)\n",
- entry->name,
- entry->volumeId[RWVOL],
- entry->volumeId[ROVOL],
- entry->volumeId[BACKVOL],
- entry->flags);
-
- if (!sec_is_superuser(call))
- return VL_PERM;
-
-
- if ((vldb_id_to_name(entry->volumeId[RWVOL], &name) == 0) ||
- (vldb_id_to_name(entry->volumeId[ROVOL], &name) == 0) ||
- (vldb_id_to_name(entry->volumeId[BACKVOL], &name) == 0)) {
- free(name);
- mlog_log (MDEBVL, "VL_CreateEntryN: id exists\n");
- return VL_NAMEEXIST;
- }
-
- if (vldb_read_entry(entry->name, &tempentry) == 0) {
- mlog_log (MDEBVL, "VL_CreateEntryN: name exists\n");
- return VL_NAMEEXIST;
- }
-
- vldb_nentry_to_disk(entry, &diskentry);
-
- if (vldb_write_entry(&diskentry) != 0)
- return VL_IO;
-
- if (vldb_write_id(entry->name,
- entry->volumeId[RWVOL]) != 0)
- return VL_IO; /* XXX rollback */
-
- if (vldb_write_id(entry->name,
- entry->volumeId[ROVOL]) != 0)
- return VL_IO; /* XXX rollback */
-
- if (vldb_write_id(entry->name,
- entry->volumeId[BACKVOL]) != 0)
- return VL_IO; /* XXX rollback */
-
- vldb_free_diskentry(&diskentry);
-
- vldb_flush();
-
- return 0;
-}
-
-/*
- *
- */
-
-int
-VL_GetEntryByIDN(struct rx_call *call,
- const int32_t Volid,
- const int32_t voltype,
- nvldbentry *entry)
-{
- disk_vlentry diskentry;
- char *name;
- mlog_log (MDEBVL, "VL_GetEntryByIDN (Volid=%d,Voltype=%d)\n",
- Volid, voltype);
-
- if (vldb_id_to_name(Volid, &name))
- return VL_NOENT;
-
- if (vldb_read_entry(name, &diskentry) != 0)
- return VL_NOENT;
-
- vldb_disk_to_nentry(&diskentry, entry);
-
- free(name);
-
- return 0;
-}
-
-/*
- *
- */
-
-int
-VL_GetEntryByNameN(struct rx_call *call,
- const char *volumename,
- nvldbentry *entry)
-{
- disk_vlentry diskentry;
-
- mlog_log (MDEBVL, "VL_GetEntryByNameN (volumename = %s)\n",
- volumename);
-
- if (isdigit(volumename[0])) {
- return VL_GetEntryByIDN(call, atol(volumename), 0 /* XXX */, entry);
- }
-
- if (vldb_read_entry(volumename, &diskentry) != 0)
- return VL_NOENT;
-
- vldb_disk_to_nentry(&diskentry, entry);
-
- return 0;
-}
-
-#ifdef notyet
-/*
- *
- */
-
-int
-VL_GetEntryByNameU(struct rx_call *call,
- const char *volumename,
- uvldbentry *entry)
-{
- mlog_log (MDEBVL, "VL_GetEntryByNameU %s\n", volumename);
- memset(entry, 0, sizeof(*entry));
-
- return RXGEN_OPCODE;
-}
-#endif
-
-/*
- *
- */
-
-int
-VL_ListAttributesN (struct rx_call *call,
- const VldbListByAttributes *attributes,
- int32_t *nentries,
- nbulkentries *blkentries)
-{
- mlog_log (MDEBVL, "VL_ListAttributesN\n");
- mlog_log (MDEBVL, " attributes: Mask=(%d=", attributes->Mask);
-
- if (attributes->Mask & VLLIST_SERVER)
- mlog_log (MDEBVL, "SERVER ");
- if (attributes->Mask & VLLIST_PARTITION)
- mlog_log (MDEBVL, "PARTITION ");
- if (attributes->Mask & VLLIST_VOLUMEID)
- mlog_log (MDEBVL, "VOLUMEID ");
- if (attributes->Mask & VLLIST_FLAG)
- mlog_log (MDEBVL, "FLAG");
-
- mlog_log (MDEBVL, ") server=%d partition=%d volumetype=%d volumeid=%d flag=%d\n",
- attributes->server,
- attributes->partition,
- attributes->volumetype,
- attributes->volumeid,
- attributes->flag);
-
- *nentries = 1;
-
- blkentries->len = 0;
- blkentries->val = NULL;
-
- return VL_PERM;
-}
-
-#ifdef notyet
-/*
- *
- */
-
-int
-VL_ListAttributesU(struct rx_call *call,
- const VldbListByAttributes *attributes,
- int32_t *nentries,
- ubulkentries *blkentries)
-{
- mlog_log (MDEBVL, "VL_ListAttributesU\n") ;
- *nentries = 0;
- blkentries->len = 0;
- blkentries->val = NULL;
- return 0;
-}
-#endif
-
-/*
- *
- */
-
-int
-VL_UpdateEntryByName(struct rx_call *call,
- const char volname[65],
- const struct VldbUpdateEntry *UpdateEntry,
- const int32_t ReleaseType)
-{
- mlog_log (MDEBVL, "VL_UpdateEntryByName (not implemented)\n");
-
- if (!sec_is_superuser(call))
- return VL_PERM;
-
- return VL_PERM;
-}
-
-/*
- *
- */
-
-int
-VL_GetAddrsU(struct rx_call *call,
- const struct ListAddrByAttributes *inaddr,
- struct afsUUID *uuid,
- int32_t *uniq,
- int32_t *nentries,
- bulkaddrs *addrs)
-{
- mlog_log (MDEBVL, "VL_GetAddrsU (not implemented)\n");
- return RXGEN_OPCODE;
-}
-
-/*
- *
- */
-
-int
-VL_RegisterAddrs(struct rx_call *call,
- const struct afsUUID *uid,
- const int32_t spare,
- const bulkaddrs *addrs)
-{
- mlog_log (MDEBVL, "VL_RegistersAddrs (not implemented)\n");
-
- if (!sec_is_superuser(call))
- return VL_PERM;
-
- return 0;
-}
-
-#ifdef notyet
-/*
- *
- */
-
-int
-VL_CreateEntryU(struct rx_call *call,
- const struct uvldbentry *newentry)
-{
- mlog_log (MDEBVL, "VL_CreateEntryU (not implemented)\n");
-
- if (!sec_is_superuser(call))
- return VL_PERM;
-
- return VL_PERM;
-}
-#endif
-
-#ifdef notyet
-/*
- *
- */
-
-int
-VL_ReplaceEntryU(struct rx_call *call)
-{
- mlog_log (MDEBVL, "VL_ReplaceEntryU (not implemented)\n");
-
- if (!sec_is_superuser(call))
- return VL_PERM;
-
- return VL_PERM;
-}
-#endif
-
-/*
- *
- */
-
-int
-VL_ReplaceEntryN(struct rx_call *call,
- const int32_t Volid,
- const int32_t voltype,
- const struct nvldbentry *newentry,
- const int32_t ReleaseType)
-{
- mlog_log (MDEBVL, "VL_ReplaceEntryN (not implemented)\n");
-
- if (!sec_is_superuser(call))
- return VL_PERM;
-
- return VL_PERM;
-}
-
-/*
- *
- */
-
-int
-VL_ChangeAddrs(struct rx_call *call,
- const int32_t old_ip,
- const int32_t new_ip)
-{
- mlog_log (MDEBVL, "VL_ChangeAddrs (not implemented)\n");
-
- if (!sec_is_superuser(call))
- return VL_PERM;
-
- return VL_PERM;
-}
-
-#ifdef notyet
-/*
- *
- */
-
-int
-VL_GetEntryByIDU(struct rx_call *call)
-{
- mlog_log (MDEBVL, "VL_GetEntryByIDU (not implemented)\n");
- return VL_PERM;
-}
-#endif
-
-/*
- *
- */
-
-int
-VL_ListEntryN(struct rx_call *call,
- int32_t previous_index,
- int32_t *count,
- int32_t *next_index,
- nvldbentry *entry)
-{
- mlog_log (MDEBVL, "VL_ListEntryN (not implemented)\n");
- return VL_PERM;
-}
-
-#ifdef notyet
-/*
- *
- */
-
-int
-VL_ListEntryU(struct rx_call *call)
-{
- mlog_log (MDEBVL, "VL_ListEntryU (not implemented)\n");
- return VL_PERM;
-}
-#endif
-
-/*
- *
- */
-
-int
-VL_GetAddrs(struct rx_call *call,
- const int32_t handle,
- const int32_t spare,
- struct VL_Callback *spare3,
- int32_t *nentries,
- bulkaddrs *blkaddr)
-{
- mlog_log (MDEBVL, "VL_GetAddrs (not implemented)\n");
- return VL_PERM;
-}
-
-#ifdef notyet
-/*
- *
- */
-
-int
-VL_LinkedListN(struct rx_call *call)
-{
- mlog_log (MDEBVL, "VL_LinkedListN (not implemented)\n");
- return VL_PERM;
-}
-
-/*
- *
- */
-
-int
-VL_LinkedListU(struct rx_call *call)
-{
- mlog_log (MDEBVL, "VL_LinkedListU (not implemented)\n");
- return VL_PERM;
-}
-#endif
-
-int
-VL_ListAttributesN2(struct rx_call *call,
- const struct VldbListByAttributes *attributes,
- const char *volumename,
- const int32_t startindex,
- int32_t *nentries,
- nbulkentries *blkentries,
- int32_t *nextstartindex)
-{
- mlog_log (MDEBVL, "VL_ListAttributesN2 (not implemented)\n");
- return VL_PERM;
-}
-/*
- *
- */
-
-static struct rx_service *vldbservice = NULL;
-static struct rx_service *ubikservice = NULL;
-
-static char *cell = NULL;
-static char *realm = NULL;
-static char *srvtab_file = NULL;
-static char *log_file = "syslog";
-static char *debug_levels = NULL;
-static int no_auth = 0;
-static int do_help = 0;
-static char *databasedir = NULL;
-static int do_create = 0;
-
-static struct agetargs args[] = {
- {"cell", 0, aarg_string, &cell, "what cell to use"},
- {"realm", 0, aarg_string, &realm, "what realm to use"},
- {"debug", 'd', aarg_string, &debug_levels, "debug level"},
- {"log", 'l', aarg_string, &log_file,
- "where to write log (stderr, syslog (default), or path to file)"},
- {"srvtab", 0, aarg_string, &srvtab_file, "what srvtab to use"},
- {"noauth", 0, aarg_flag, &no_auth, "disable authentication checks"},
- {"help", 'h', aarg_flag, &do_help, "help"},
- {"dbdir", 0, aarg_string, &databasedir, "where to store the db"},
- {"create", 0, aarg_flag, &do_create, "create new database"},
- { NULL, 0, aarg_end, NULL }
-};
-
-static void
-usage(int exit_code)
-{
- aarg_printusage (args, NULL, "", AARG_GNUSTYLE);
- exit (exit_code);
-}
-
-int
-main(int argc, char **argv)
-{
- Log_method *method;
- int optind = 0;
- int ret;
-
- set_progname (argv[0]);
-
- if (agetarg (args, argc, argv, &optind, AARG_GNUSTYLE)) {
- usage (1);
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc) {
- printf("unknown option %s\n", *argv);
- return 1;
- }
-
- if (do_help)
- usage(0);
-
- if (no_auth)
- sec_disable_superuser_check ();
-
- method = log_open (getprogname(), log_file);
- if (method == NULL)
- errx (1, "log_open failed");
- cell_init(0, method);
- ports_init();
-
- mlog_loginit (method, milko_deb_units, MDEFAULT_LOG);
-
- if (debug_levels)
- mlog_log_set_level (debug_levels);
-
- if (cell)
- cell_setthiscell (cell);
-
- network_kerberos_init (srvtab_file);
-
- if (do_create) {
- vldb_create (databasedir);
- vldb_close();
- return 0;
- }
-
- vldb_init(databasedir);
-
- ret = network_init(htons(afsvldbport), "vl", VLDB_SERVICE_ID,
- VL_ExecuteRequest, &vldbservice, realm);
- if (ret)
- errx (1, "network_init failed with %d", ret);
-
- ret = network_init(htons(afsvldbport), "ubik", VOTE_SERVICE_ID,
- Ubik_ExecuteRequest, &ubikservice, realm);
- if (ret)
- errx (1, "network_init failed with %d", ret);
-
- printf("Milko vldbserver %s-%s started\n", PACKAGE, VERSION);
-
- rx_SetMaxProcs(vldbservice,5) ;
- rx_SetMaxProcs(ubikservice,5) ;
- rx_StartServer(1) ;
-
- abort() ; /* should not get here */
- return 0;
-}
diff --git a/usr.sbin/afs/src/milko/vldb/vled.c b/usr.sbin/afs/src/milko/vldb/vled.c
deleted file mode 100644
index 3012e23a95e..00000000000
--- a/usr.sbin/afs/src/milko/vldb/vled.c
+++ /dev/null
@@ -1,449 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "vldb_locl.h"
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <limits.h>
-
-RCSID("$arla: vled.c,v 1.7 2002/10/01 23:35:35 lha Exp $");
-
-struct ed_context {
- long begin;
- long end;
- long current;
- struct ed_command *cmds;
-};
-
-typedef int (*ed_pcmd)(struct ed_context *context,
- const char *str, size_t len);
-
-
-struct ed_command {
- char ed_c;
- ed_pcmd ed_cmd;
- char *ed_help;
-};
-
-typedef enum { ED_NOERR = 0, ED_SYNTAX, ED_NOCMD, ED_FATAL, ED_EOF,
- ED_EXIT } ed_ret;
-typedef enum { ED_RANGE_END = -1 } ed_val;
-
-static ed_ret get_string (FILE *f, char *buf, size_t len);
-static ed_ret findexec_cmd (struct ed_command *cmds, const char *buf,
- size_t len, struct ed_context *context);
-static ed_ret parse_addr (struct ed_context *context, char **p, size_t *len);
-
-
-int ed_loop (struct ed_command *cmds);
-int ed_help (struct ed_context *context, const char *str, size_t len);
-
-/*
- *
- */
-
-static int
-local_common (struct ed_context *context,
- const char *str, size_t len,
- int (*func) (disk_vlentry *, long num, const char *,
- size_t, void *),
- void *ptr)
-{
- disk_vlentry vlentry;
- int ret;
- long i;
-
- if (context->begin == ED_RANGE_END || context->begin > HASHSIZE)
- context->begin = HASHSIZE;
- if (context->end == ED_RANGE_END || context->end > HASHSIZE-1)
- context->end = HASHSIZE;
- else
- context->end++;
-
- for (i = context->begin ; i < context->end ; i++) {
- ret = vldb_get_first_id_entry(i, 0, &vlentry);
- if (ret == 0) {
- context->current = i;
- if ((*func) (&vlentry, i, str, len, ptr))
- return 0;
- } else if (ret == VL_NOENT)
- continue;
- else
- err (1, "got strange return-code from "
- "vldb_get_first_id_entry: %d\n", ret);
- }
-
- return 0;
-}
-
-static int
-print_func (disk_vlentry *entry, long num,
- const char *str, size_t len, void *ptr)
-{
- printf ("pos: %ld\n ", num);
- vldb_print_entry (entry, 1);
- return 0;
-}
-
-static int
-local_print (struct ed_context *context,
- const char *str, size_t len)
-{
- return local_common (context, str, len, print_func, NULL);
-}
-
-static int
-search_func (disk_vlentry *entry, long num,
- const char *str, size_t len, void *ptr)
-{
- if (strstr (entry->name, str) == NULL)
- return 0;
- printf ("pos: %ld\n ", num);
- vldb_print_entry (entry, 0);
- return 0;
-}
-
-static int
-local_search (struct ed_context *context,
- const char *str, size_t len)
-{
- if (len == 0) {
- context->begin = context->current;
- } else {
- context->begin = 0;
- context->end = ED_RANGE_END;
- }
- return local_common (context, str, len, search_func, NULL);
-}
-
-static int
-local_add (struct ed_context *context, const char *str, size_t len)
-{
- printf ("not implemented yet\n");
- return ED_NOERR;
-}
-
-static int
-local_addserver (struct ed_context *context, const char *str, size_t len)
-{
- disk_vlentry vlentry;
- int ret;
-
- if (len == 0)
- return ED_SYNTAX;
-
- ret = vldb_get_first_id_entry(context->begin, 0, &vlentry);
- if (ret) {
- printf ("addserver: vldb_get_first_id_entry failed %d\n", ret);
- return ED_NOERR;
- }
-
-#if 0
- vldb_print_entry (&vlentry, 1);
-#endif
-
- printf ("not implemented yet\n");
- return ED_NOERR;
-}
-
-static int
-backup_func (disk_vlentry *entry, long num,
- const char *str, size_t len, void *ptr)
-{
- int i;
-
- printf ("%dd\n%dd\n%dd\n",
- entry->volumeId[RWVOL],
- entry->volumeId[ROVOL],
- entry->volumeId[BACKVOL]);
-
- printf ("a %s %d %d %d 0x0\n",
- entry->name,
- entry->volumeId[RWVOL],
- entry->volumeId[ROVOL],
- entry->volumeId[BACKVOL]);
- for (i = 0; i < MAXNSERVERS; i++) {
- struct in_addr in;
- if (entry->serverNumber[i] == 0)
- break;
- in.s_addr = entry->serverNumber[i];
- printf ("A %s %d 0x%x\n",
- inet_ntoa(in),
- entry->serverPartition[i],
- entry->serverFlags[i]);
- }
- printf ("f 0x%d\n", entry->flags);
- return 0;
-}
-
-static int
-local_backup (struct ed_context *context, const char *str, size_t len)
-{
- return local_common (context, str, len, backup_func, NULL);
-}
-
-static int
-local_delete (struct ed_context *context, const char *str, size_t len)
-{
- printf ("not implemented yet\n");
- return ED_NOERR;
-}
-
-static int
-local_deleteserver (struct ed_context *context, const char *str, size_t len)
-{
- printf ("not implemented yet\n");
- return ED_NOERR;
-}
-
-static int
-local_modify (struct ed_context *context, const char *str, size_t len)
-{
- printf ("not implemented yet\n");
- return ED_NOERR;
-}
-
-static int
-local_rename (struct ed_context *context, const char *str, size_t len)
-{
- printf ("not implemented yet\n");
- return ED_NOERR;
-}
-
-static int
-quit (struct ed_context *context, const char *str, size_t len)
-{
- return ED_EXIT;
-}
-
-struct ed_command vled[] = {
- { 'p', local_print, "print vldb entry" },
- { '/', local_search, "search vldb entry" },
- { 'a', local_add, "add new entry"},
- { 'A', local_addserver, "add new server to entry"},
- { 'b', local_backup, "backup/dump a entry"},
- { 'd', local_delete, "delete entry"},
- { 'D', local_deleteserver, "delete server from entry"},
- { 'm', local_modify, "modify entry"},
- { 'n', local_rename, "rename entry"},
- { '?', ed_help, "help" },
- { 'q', quit, "exit" },
- { 0, NULL, NULL }
-};
-
-/*
- *
- */
-
-static ed_ret
-get_string (FILE *f, char *buf, size_t len)
-{
- char *str;
-
- str = fgets (buf, len, f);
- if (str == NULL) {
- if (feof(f))
- return ED_EOF;
- return ED_FATAL;
- }
- buf[strcspn(buf, "\n")] = '\0';
- return ED_NOERR;
-}
-
-static ed_ret
-parse_element (char **p, size_t *len, long *raddr, long current, int first)
-{
- long addr;
- char *old = *p;
-
- while (1) {
- if (*len < 1)
- return ED_SYNTAX;
-
- switch (**p) {
- case '^':
- *raddr = 0;
- (*p)++;
- *len -= 1;
- return ED_NOERR;
- case '$':
- *raddr = ED_RANGE_END;
- (*p)++;
- *len -= 1;
- return ED_NOERR;
- case ',':
- if (first) {
- *raddr = 0;
- return ED_NOERR;
- }
- (*p)++;
- *len -= 1;
- break;
- case '1': case '2': case '3' :case '4': case '5':
- case '6': case '7': case '8': case '9' :case '0':
- addr = strtol (*p, p, 0);
- if ((addr == LONG_MAX || addr == LONG_MIN) && errno == ERANGE) {
- *len -= *p - old;
- return ED_SYNTAX;
- }
- *raddr = addr;
- return ED_NOERR;
- default:
- if (!first)
- *raddr = ED_RANGE_END;
- else
- *raddr = current;
- return ED_NOERR;
- }
- }
- return ED_NOERR;
-}
-
-
-static ed_ret
-parse_addr (struct ed_context *context, char **p, size_t *len)
-{
- long addr;
- int num_el = 0;
- ed_ret ret;
-
- context->begin = context->end = context->current;
-
- if (*len < 1)
- return ED_SYNTAX;
-
- while (num_el < 2) {
- ret = parse_element (p, len, &addr, context->current, !num_el);
- if (ret != ED_NOERR)
- break;
- num_el++;
-
- context->begin = context->end;
- context->end = addr;
-
- if (**p != ',' && **p != ';')
- break;
- else if (**p == ';') {
- (*p)++;
- context->current = addr;
- }
- }
- if (num_el == 1 || context->end != addr)
- context->begin = context->end;
- return ED_NOERR;
-}
-
-static ed_ret
-findexec_cmd (struct ed_command *cmds, const char *buf, size_t len,
- struct ed_context *context)
-{
- struct ed_command *c;
-
- if (len == 0)
- return ED_SYNTAX;
-
- for (c = cmds; c->ed_cmd; c++) {
- if (c->ed_c == *buf)
- return (c->ed_cmd) (context, (buf+1), (len-1));
- }
- return ED_NOCMD;
-}
-
-#define HANDLE_ERROR(ret) \
- switch (ret) { \
- case ED_NOERR: \
- break; \
- case ED_EOF: \
- case ED_EXIT: \
- return ED_NOERR; \
- case ED_FATAL: \
- return ret; \
- default: \
- printf ("?\n"); \
- break; \
- } \
- if (ret != ED_NOERR) continue
-
-
-int
-ed_help (struct ed_context *context, const char *str, size_t len)
-{
- struct ed_command *c;
-
- printf ("help:\n");
- for (c = context->cmds; c->ed_cmd; c++)
- printf (" %c\t%s\n", c->ed_c, c->ed_help);
- return ED_NOERR;
-}
-
-int
-ed_loop (struct ed_command *cmds)
-{
- struct ed_context context = {0, 0, 0, NULL};
- size_t len;
- char buf[4*1024];
- char *str;
- char **p;
- ed_ret ret;
-
- if (cmds == NULL)
- return EINVAL;
-
- context.cmds = cmds;
-
- while (1) {
- ret = get_string (stdin, buf, sizeof(buf));
- HANDLE_ERROR(ret);
-
- str = buf;
- p = &str;
- len = sizeof(buf);
- ret = parse_addr (&context, p, &len);
- HANDLE_ERROR(ret);
- ret = findexec_cmd (cmds, *p, len, &context);
- HANDLE_ERROR(ret);
- }
-}
-
-
-int
-main(int argc, char **argv)
-{
- char *databasedir = NULL;
- vldb_init(databasedir);
-
- ed_loop (vled);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/mkinstalldirs b/usr.sbin/afs/src/mkinstalldirs
deleted file mode 100644
index caab3e5fa9d..00000000000
--- a/usr.sbin/afs/src/mkinstalldirs
+++ /dev/null
@@ -1,40 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
-# Created: 1993-05-16
-# Public domain
-
-# $KTH: mkinstalldirs,v 1.1 1998/01/18 03:13:46 lha Exp $
-
-errstatus=0
-
-for file
-do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
- shift
-
- pathcomp=
- for d
- do
- pathcomp="$pathcomp$d"
- case "$pathcomp" in
- -* ) pathcomp=./$pathcomp ;;
- esac
-
- if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp" 1>&2
-
- mkdir "$pathcomp" || lasterr=$?
-
- if test ! -d "$pathcomp"; then
- errstatus=$lasterr
- fi
- fi
-
- pathcomp="$pathcomp/"
- done
-done
-
-exit $errstatus
-
-# mkinstalldirs ends here
diff --git a/usr.sbin/afs/src/nnpfs/bsd/Info.plist.in b/usr.sbin/afs/src/nnpfs/bsd/Info.plist.in
deleted file mode 100644
index 871a82fcbab..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/Info.plist.in
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>nnpfs</string>
- <key>CFBundleIdentifier</key>
- <string>se.kth.stacken.arla.nnpfs</string>
- <key>CFBundleGetInfoString</key>
- <string>@VERSION@</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>nnpfs</string>
- <key>CFBundlePackageType</key>
- <string>KEXT</string>
- <key>CFBundleShortVersionString</key>
- <string>@VERSION@</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
- <key>OSBundleLibraries</key>
- <dict>
- <key>com.apple.kernel.bsd</key>
- <string>@COM_APPLE_KERNEL_BSD@</string>
- </dict>
-</dict>
-</plist>
diff --git a/usr.sbin/afs/src/nnpfs/bsd/bin/getmntopts.c b/usr.sbin/afs/src/nnpfs/bsd/bin/getmntopts.c
deleted file mode 100644
index 25f6344b181..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/bin/getmntopts.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/* $OpenBSD: getmntopts.c,v 1.1.1.1 2003/08/05 08:21:03 hin Exp $ */
-/* $NetBSD: getmntopts.c,v 1.3 1995/03/18 14:56:58 cgd Exp $ */
-/* $arla: getmntopts.c,v 1.4 1998/02/23 05:38:59 art Exp $ */
-
-/*-
- * Copyright (c) 1994
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/mount.h>
-
-#include <err.h>
-#include <errno.h>
-#include <fstab.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "mntopts.h"
-
-void
-getmntopts(options, m0, flagp)
- const char *options;
- const struct mntopt *m0;
- int *flagp;
-{
- const struct mntopt *m;
- int negative;
- char *opt, *optbuf, *p;
-
- /* Copy option string, since it is about to be torn asunder... */
- if ((optbuf = strdup(options)) == NULL)
- err(1, " ");
-
- for (opt = optbuf; (opt = strtok(opt, ",")) != NULL; opt = NULL) {
- /* Check for "no" prefix. */
- if (opt[0] == 'n' && opt[1] == 'o') {
- negative = 1;
- opt += 2;
- } else
- negative = 0;
-
- /*
- * for options with assignments in them (ie. quotas)
- * ignore the assignment as it's handled elsewhere
- */
- p = strchr(opt, '=');
- if (p)
- *p = '\0';
-
- /* Scan option table. */
- for (m = m0; m->m_option != NULL; ++m)
- if (strcasecmp(opt, m->m_option) == 0)
- break;
-
- /* Save flag, or fail if option is not recognised. */
- if (m->m_option) {
- if (negative == m->m_inverse)
- *flagp |= m->m_flag;
- else
- *flagp &= ~m->m_flag;
- } else
- errx(1, "-o %s: option not supported", opt);
- }
-
- free(optbuf);
-}
diff --git a/usr.sbin/afs/src/nnpfs/bsd/bin/mntopts.h b/usr.sbin/afs/src/nnpfs/bsd/bin/mntopts.h
deleted file mode 100644
index af2909b1f60..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/bin/mntopts.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/* $OpenBSD: mntopts.h,v 1.2 2005/05/26 03:52:06 pedro Exp $ */
-/* $NetBSD: mntopts.h,v 1.3 1995/03/18 14:56:59 cgd Exp $ */
-
-/*-
- * Copyright (c) 1994
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)mntopts.h 8.3 (Berkeley) 3/27/94
- */
-
-struct mntopt {
- const char *m_option; /* option name */
- int m_inverse; /* if a negative option, eg "dev" */
- int m_flag; /* bit to set, eg. MNT_RDONLY */
-};
-
-/* User-visible MNT_ flags. */
-#define MOPT_ASYNC { "async", 0, MNT_ASYNC }
-#ifdef MNT_NOATIME
-#define MOPT_NOACCESSTIME { "accesstime", 1, MNT_NOATIME }
-#define MOPT_NOATIME { "atime", 1, MNT_NOATIME }
-#endif
-#define MOPT_NODEV { "dev", 1, MNT_NODEV }
-#define MOPT_NOEXEC { "exec", 1, MNT_NOEXEC }
-#define MOPT_NOSUID { "suid", 1, MNT_NOSUID }
-#define MOPT_RDONLY { "rdonly", 0, MNT_RDONLY }
-#define MOPT_SYNC { "sync", 0, MNT_SYNCHRONOUS }
-#define MOPT_USERQUOTA { "userquota", 0, 0 }
-#define MOPT_GROUPQUOTA { "groupquota", 0, 0 }
-
-/* Control flags. */
-#define MOPT_FORCE { "force", 1, MNT_FORCE }
-#define MOPT_UPDATE { "update", 0, MNT_UPDATE }
-#define MOPT_RELOAD { "reload", 0, MNT_RELOAD }
-
-/* Support for old-style "ro", "rw" flags. */
-#define MOPT_RO { "ro", 0, MNT_RDONLY }
-#define MOPT_RW { "rw", 1, MNT_RDONLY }
-
-/* This is parse by mount(8), but is ignored by specific mount_*(8)s. */
-#define MOPT_AUTO { "auto", 0, 0 }
-
-#define MOPT_FSTAB_COMPAT \
- MOPT_RO, \
- MOPT_RW, \
- MOPT_AUTO
-
-/* Standard options which all mounts can understand. */
-
-#ifdef MNT_NOATIME
-
-#define MOPT_STDOPTS \
- MOPT_USERQUOTA, \
- MOPT_GROUPQUOTA, \
- MOPT_FSTAB_COMPAT, \
- MOPT_NOACCESSTIME, \
- MOPT_NOATIME, \
- MOPT_NODEV, \
- MOPT_NOEXEC, \
- MOPT_NOSUID, \
- MOPT_RDONLY
-
-#else
-
-#define MOPT_STDOPTS \
- MOPT_USERQUOTA, \
- MOPT_GROUPQUOTA, \
- MOPT_FSTAB_COMPAT, \
- MOPT_NODEV, \
- MOPT_NOEXEC, \
- MOPT_NOSUID, \
- MOPT_RDONLY
-
-#endif
-
-void getmntopts (const char *, const struct mntopt *, int *);
diff --git a/usr.sbin/afs/src/nnpfs/bsd/bin/mount_locl.h b/usr.sbin/afs/src/nnpfs/bsd/bin/mount_locl.h
deleted file mode 100644
index b51a33df529..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/bin/mount_locl.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: mount_locl.h,v 1.10 2002/09/17 18:54:51 lha Exp $ */
-
-#ifndef __mount_locl_h__
-#define __mount_locl_h__
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-#include <errno.h>
-#include <err.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "mntopts.h"
-
-#if defined(__osf__)
-
-/* rename macros */
-#define MNT_RDONLY M_RDONLY
-#define MNT_EXRDONLY M_EXRDONLY
-#define MNT_EXPORTED M_EXPORTED
-#define MNT_UPDATE M_UPDATE
-#define MNT_NOEXEC M_NOEXEC
-#define MNT_NOSUID M_NOSUID
-#define MNT_NODEV M_NODEV
-#define MNT_SYNCHRONOUS M_SYNCHRONOUS
-#define MNT_QUOTA M_QUOTA
-#define MNT_LOCAL M_LOCAL
-#define MNT_VISFLAGMASK M_VISFLAGMASK
-#define MNT_FMOUNT M_FMOUNT
-/* these are not defined */
-#define MNT_NOACCESSTIME 0
-#define MNT_NOATIME 0
-#define MNT_UNION 0
-#define MNT_ASYNC 0
-#define MNT_RELOAD 0
-
-#define unmount umount
-
-#define MOUNT_NNPFS MOUNT_PC
-
-#endif
-
-#if defined(HAVE_OPTRESET) && !defined(HAVE_OPTRESET_DECLARATION)
-extern int optreset;
-#endif
-
-#endif /* __mount_locl_h__ */
diff --git a/usr.sbin/afs/src/nnpfs/bsd/bin/mount_nnpfs.8 b/usr.sbin/afs/src/nnpfs/bsd/bin/mount_nnpfs.8
deleted file mode 100644
index fc3eefb04cb..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/bin/mount_nnpfs.8
+++ /dev/null
@@ -1,42 +0,0 @@
-.\" Copyright (c) 2001 Kungliga Tekniska Högskolan
-.\" $arla: mount_nnpfs.8,v 1.6 2002/09/07 10:45:46 lha Exp $
-.Dd January 8, 2000
-.Dt MOUNT_NNPFS 8
-.Os "The Arla Project"
-.Sh NAME
-.Nm mount_nnpfs
-.Nd mount a nnpfs filesystem
-.Sh SYNOPSIS
-.Nm
-.Op Fl o Ar options
-.Op Fl F Ar mount-flags
-.Ar device path
-.Sh DESCRIPTION
-The
-.Nm
-command attaches the nnpfs filesystem on the
-.Ar special
-device on to the file system tree at point
-.Ar path .
-.Pp
-The options are as follows:
-.Bl -tag -width Ds
-.It Fl o
-Options are specified with a
-.Fl o
-flag followed by a comma separated string of options.
-See the
-.Xr mount 8
-man page for possible options and their meanings.
-.It Fl F
-mount-flags is the same as
-.Ar options
-but expressed i decimal form.
-.El
-.Sh SEE ALSO
-.Xr mount 2 ,
-.Xr unmount 2 ,
-.Xr fstab 5 ,
-.Xr mount 8 ,
-.Xr umount 8 ,
-.Xr umount_nnpfs 8
diff --git a/usr.sbin/afs/src/nnpfs/bsd/bin/mount_nnpfs.c b/usr.sbin/afs/src/nnpfs/bsd/bin/mount_nnpfs.c
deleted file mode 100644
index 12896ce2093..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/bin/mount_nnpfs.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000, 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "mount_locl.h"
-
-#ifdef RCSID
-RCSID("$arla: mount_nnpfs.c,v 1.18 2002/09/17 18:54:52 lha Exp $");
-#endif
-
-static const struct mntopt mopts[] = {
- MOPT_STDOPTS,
- MOPT_ASYNC,
- MOPT_SYNC,
- MOPT_UPDATE,
- MOPT_RELOAD,
- {NULL}
-};
-
-static void
-usage(const char *name)
-{
- fprintf(stderr, "Usage: %s [-o options] [-F flags] device path\n",
- name);
- exit(1);
-}
-
-int
-main(int argc, char **argv)
-{
- int error;
- int ch, mntflags = 0;
- char *name;
-
- name = strrchr(argv[0], '/');
- if (name)
- name++;
- else
- name = argv[0];
-
- optind = 1;
-#ifdef HAVE_OPTRESET
- optreset = 1;
-#endif
-
- while ((ch = getopt(argc, argv, "o:F:")) != -1)
- switch (ch) {
- case 'o':
- getmntopts(optarg, mopts, &mntflags);
- break;
- case 'F':
- mntflags = atoi(optarg);
- break;
- case '?':
- default:
- usage(name);
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc != 2)
- usage(name);
-
-#ifdef __osf__
- error = mount(MOUNT_NNPFS, argv[1], mntflags, argv[0]);
-#else
- error = mount("nnpfs", argv[1], mntflags, argv[0]);
-#endif
-
- if (error != 0)
- err(1, "mount");
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/nnpfs/bsd/bin/nnpfs.4 b/usr.sbin/afs/src/nnpfs/bsd/bin/nnpfs.4
deleted file mode 100644
index 29f1c1fbf85..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/bin/nnpfs.4
+++ /dev/null
@@ -1,26 +0,0 @@
-.\" Copyright (c) 2001 Kungliga Tekniska Högskolan
-.\" $arla: nnpfs.4,v 1.3 2002/09/07 10:45:49 lha Exp $
-.Dd January 8, 2001
-.Dt NNPFS 4
-.Os "The Arla Project"
-.Sh NAME
-.Nm nnpfs
-.Nd nnpfs filesystem device
-.\" .Sh SYNOPSIS
-.\" .Cd "file-system NNPFS"
-.\" .Cd "pseudo-device nnpfs"
-.Sh DESCRIPTION
-.Nm
-is a cache filesystem enable a fast userland filesystem
-implementation.
-.Nm
-sits between the VFS-layer and a userland daemon
-and relays requests thru a character-device.
-.Nm
-cache all requests to increase performance.
-.Pp
-.Sh FILES
-.Pa /dev/nnpfsN
-.Sh SEE ALSO
-.Xr arlad 8 ,
-.Xr mount_nnpfs 8
diff --git a/usr.sbin/afs/src/nnpfs/bsd/bin/nnpfs_kld_makedev b/usr.sbin/afs/src/nnpfs/bsd/bin/nnpfs_kld_makedev
deleted file mode 100644
index 96427059bc5..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/bin/nnpfs_kld_makedev
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-# $arla: nnpfs_kld_makedev,v 1.4 2002/09/07 10:45:51 lha Exp $
-# this is called with <cdev-major> <syscall-number> <vfs-number: 0>
-rm -f /dev/nnpfs0
-mknod /dev/nnpfs0 c $1 0
diff --git a/usr.sbin/afs/src/nnpfs/bsd/bin/nnpfs_makedev b/usr.sbin/afs/src/nnpfs/bsd/bin/nnpfs_makedev
deleted file mode 100644
index 15f2d0e6151..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/bin/nnpfs_makedev
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-# $arla: nnpfs_makedev,v 1.3 2002/09/17 16:16:35 lha Exp $
-# this is called with <module-id> <module-type> <cdev-num> [<bdev-num>]
-rm -f /dev/nnpfs0
-mknod /dev/nnpfs0 c $3 0
diff --git a/usr.sbin/afs/src/nnpfs/bsd/bin/startarla.in b/usr.sbin/afs/src/nnpfs/bsd/bin/startarla.in
deleted file mode 100644
index 6191c96562c..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/bin/startarla.in
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/sh
-#
-# A simple startupscript to start arla for *BSD.
-#
-# You must have a path that includes, modload, ld,
-# mount_nnpfs, and arlad.
-#
-# $arla: startarla.in,v 1.25 2002/12/20 12:43:11 lha Exp $
-#
-
-
-PATH=/sbin:/usr/sbin:/usr/bin:/bin
-SBINDIR=%sbindir%
-LKMDIR=%lkmdir%
-CACHEDIR=%ARLACACHEDIR%
-LIBEXECDIR=%libexecdir%
-VARDB=/var/db
-
-if [ ! -e $CACHEDIR ] ; then
- mkdir $CACHEDIR
- chmod 700 $CACHEDIR
- chown root $CACHEDIR
-fi
-
-if test -f $LKMDIR/nnpfs.ko; then
- kldload $LKMDIR/nnpfs.ko
- if test ! -c /dev/nnpfs0; then
- mknod /dev/nnpfs0 c 128 0
- fi
-elif test -x /sbin/kextload; then
- rm -f $VARDB/nnpfs_sym
- kextload -s $VARDB $LKMDIR/nnpfs.kext
- kextstat > $VARDB/nnpfs_modstat 2>&1
-elif test -x /sbin/sysconfig; then
- /sbin/sysconfig -c nnpfs
- if test ! -c /dev/nnpfs0; then
- SYSCALL=`/sbin/sysconfig -q nnpfs major | awk '{print $3}'`
- mknod /dev/nnpfs0 c ${SYSCALL} 0
- fi
-elif test -x /sbin/modload; then
- rm -f $VARDB/nnpfs_sym
- modload -o $VARDB/nnpfs_sym -e nnpfs_mod -p $SBINDIR/nnpfs_makedev \
- $LKMDIR/nnpfs_mod.o
- modstat > $VARDB/nnpfs_modstat 2>&1
-else
- echo "Couldn't figure out how to load your kernel module"
- exit 1
-fi
-test -d /afs || mkdir /afs
-${SBINDIR}/mount_nnpfs /dev/nnpfs0 /afs
-${LIBEXECDIR}/arlad -z /dev/nnpfs0
diff --git a/usr.sbin/afs/src/nnpfs/bsd/bin/umount_nnpfs.8 b/usr.sbin/afs/src/nnpfs/bsd/bin/umount_nnpfs.8
deleted file mode 100644
index bbd5e3cdea9..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/bin/umount_nnpfs.8
+++ /dev/null
@@ -1,30 +0,0 @@
-.\" Copyright (c) 2001 Kungliga Tekniska Högskolan
-.\" $arla: umount_nnpfs.8,v 1.5 2002/09/07 10:45:55 lha Exp $
-.Dd January 8, 2001
-.Dt UMOUNT_NNPFS 8
-.Os "The Arla Project"
-.Sh NAME
-.Nm umount_nnpfs
-.Nd unmount a nnpfs filesystem
-.Sh SYNOPSIS
-.Nm
-.Op Fl f
-.Ar path
-.Sh DESCRIPTION
-The
-.Nm
-command detaches the nnpfs filesystem on the tree at point
-.Ar path .
-.Pp
-The options are as follows:
-.Bl -tag -width Ds
-.It Fl f
-forcefully unmount the filesystem.
-.El
-.Sh SEE ALSO
-.Xr mount 2 ,
-.Xr unmount 2 ,
-.Xr fstab 5 ,
-.Xr mount 8 ,
-.Xr mount_nnpfs 8 ,
-.Xr umount 8
diff --git a/usr.sbin/afs/src/nnpfs/bsd/bin/umount_nnpfs.c b/usr.sbin/afs/src/nnpfs/bsd/bin/umount_nnpfs.c
deleted file mode 100644
index 69b2675bd4c..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/bin/umount_nnpfs.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "mount_locl.h"
-
-#ifdef RCSID
-RCSID("$arla: umount_nnpfs.c,v 1.8 2002/09/17 18:54:53 lha Exp $");
-#endif
-
-static void
-usage(const char *progname)
-{
- fprintf(stderr, "Usage: %s [-f] path\n", "unmount_nnpfs");
- exit(1);
-}
-
-int
-main(int argc, char **argv)
-{
- int force = 0;
- char *name;
-
- name = strrchr(argv[0], '/');
- if (name)
- name++;
- else
- name = argv[0];
-
- if (argc != 2 && argc != 3)
- usage(name);
-
- if (strcmp(argv[1], "-f") == 0) {
- force = 1;
- if (argc != 3)
- usage(name);
- }
- if (argv[1 + force][0] == '-')
- usage(name);
-
- if (unmount(argv[1 + force], (force ? 0 : MNT_FORCE)) != 0)
- perror("unmount");
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_common.h b/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_common.h
deleted file mode 100644
index af04dd740c7..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_common.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: nnpfs_common.h,v 1.19 2002/12/18 12:32:10 lha Exp $ */
-
-#ifndef _nnpfs_common_h
-#define _nnpfs_common_h
-
-#if defined(MALLOC_DECLARE)
-MALLOC_DECLARE(M_NNPFS);
-MALLOC_DECLARE(M_NNPFS_NODE);
-MALLOC_DECLARE(M_NNPFS_LINK);
-MALLOC_DECLARE(M_NNPFS_MSG);
-#elif !defined(M_NNPFS)
-#define M_NNPFS M_TEMP
-#define M_NNPFS_NODE M_TEMP
-#define M_NNPFS_LINK M_TEMP
-#define M_NNPFS_MSG M_TEMP
-#endif
-
-
-#ifdef NNPFS_DEBUG
-void *nnpfs_alloc(u_int size, nnpfs_malloc_type type);
-void nnpfs_free(void *, u_int size, nnpfs_malloc_type type);
-#else
-#ifdef __osf__
-#define nnpfs_alloc(a,t) malloc((a), BUCKETINDEX(a), t, M_WAITOK)
-#else
-#define nnpfs_alloc(a,t) malloc((a), t, M_WAITOK)
-#endif
-#define nnpfs_free(a, size,t) free(a, t)
-#endif /* NNPFS_DEBUG */
-
-int nnpfs_suser(d_thread_t *p);
-
-#ifndef HAVE_KERNEL_MEMCPY
-void *
-memcpy (void *s1, const void *s2, size_t n);
-#endif
-
-const char *
-nnpfs_devtoname_r (dev_t dev, char *buf, size_t sz);
-
-#ifndef HAVE_KERNEL_STRLCPY
-size_t
-strlcpy (char *dst, const char *src, size_t dst_sz);
-#endif
-
-#endif /* _nnpfs_common_h */
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_deb.h b/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_deb.h
deleted file mode 100644
index ecffe9e99f6..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_deb.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: nnpfs_deb.h,v 1.11 2002/09/07 10:45:59 lha Exp $ */
-
-#ifndef _nnpfs_deb_h
-#define _nnpfs_deb_h
-
-#include <nnpfs/nnpfs_debug.h>
-
-#define HAVE_XDEBDEV
-#define HAVE_XDEBMSG
-#define HAVE_XDEBDNLC
-#define HAVE_XDEBNODE
-#define HAVE_XDEBVNOPS
-#define HAVE_XDEBVFOPS
-#define HAVE_XDEBLKM
-#define HAVE_XDEBSYS
-#define HAVE_XDEBMEM
-#define HAVE_XDEBSYS
-
-extern unsigned int nnpfsdeb;
-
-#ifdef NNPFS_DEBUG
-#define NNPFSDEB(mask, args) do { if (mask&nnpfsdeb) printf args; } while (0)
-#else
-#define NNPFSDEB(mask, args) do { ; } while (0)
-#endif
-
-#endif /* _nnpfs_deb_h */
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_dev.h b/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_dev.h
deleted file mode 100644
index a8c67c7aa32..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_dev.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: nnpfs_dev.h,v 1.19 2003/01/19 20:53:52 lha Exp $ */
-
-#ifndef _nnpfs_dev_h
-#define _nnpfs_dev_h
-
-/*
- * Queues of nnpfs_links hold outbound messages and processes sleeping
- * for replies. The last field is used to return error to sleepers and
- * to keep record of memory to be deallocated when messages have been
- * delivered or dropped.
- */
-
-struct nnpfs_link {
- struct nnpfs_link *prev, *next;
- struct nnpfs_message_header *message;
- u_int error_or_size; /* error on sleepq and size on
- * messageq */
-};
-
-struct nnpfs_channel {
- struct nnpfs_link messageq; /* Messages not yet read */
- struct nnpfs_link sleepq; /* Waiting for reply message */
- u_int nsequence;
-#ifdef __osf__
- sel_queue_t sel_q;
-#else
- struct selinfo selinfo;
-#endif
- struct nnpfs_message_header *message_buffer;
- int status;
-#define CHANNEL_OPENED 0x1
-#define CHANNEL_WAITING 0x2
- d_thread_t *proc;
-};
-
-extern struct nnpfs_channel nnpfs_channel[NNNPFS];
-
-/*
- * These are variant dependent
- */
-
-void nnpfs_select_wakeup(struct nnpfs_channel *);
-
-int nnpfs_install_device(void);
-int nnpfs_uninstall_device(void);
-
-int nnpfs_install_filesys(void);
-int nnpfs_may_uninstall_filesys(void);
-int nnpfs_uninstall_filesys(void);
-
-int nnpfs_stat_filesys(void);
-int nnpfs_stat_device(void);
-
-/*
- * And these should be generic
- */
-
-void
-nnpfs_initq(struct nnpfs_link *q);
-
-int
-nnpfs_emptyq(const struct nnpfs_link *q);
-
-int
-nnpfs_onq(const struct nnpfs_link *link);
-
-void
-nnpfs_appendq(struct nnpfs_link *q, struct nnpfs_link *p);
-
-void
-nnpfs_outq(struct nnpfs_link *p);
-
-int
-nnpfs_devopen_common(dev_t dev);
-
-#ifndef __osf__ /* XXX - we should do the same for osf */
-int nnpfs_devopen(dev_t dev, int flag, int devtype, d_thread_t *proc);
-int nnpfs_devclose(dev_t dev, int flag, int devtype, d_thread_t *proc);
-int nnpfs_devioctl(dev_t dev, u_long cmd, caddr_t data, int flags,
- d_thread_t *p);
-#ifdef HAVE_THREE_ARGUMENT_SELRECORD
-int nnpfs_devselect(dev_t dev, int which, void *wql, d_thread_t *p);
-#else
-int nnpfs_devselect(dev_t dev, int which, d_thread_t *p);
-#endif
-#endif /* ! __osf__ */
-
-int
-nnpfs_devclose_common(dev_t dev, d_thread_t *p);
-
-int
-nnpfs_devread(dev_t dev, struct uio * uiop, int ioflag);
-
-int
-nnpfs_devwrite(dev_t dev, struct uio *uiop, int ioflag);
-
-int
-nnpfs_message_send(int fd, struct nnpfs_message_header * message, u_int size);
-
-int
-nnpfs_message_rpc(int fd, struct nnpfs_message_header * message, u_int size,
- d_thread_t *p);
-
-int
-nnpfs_message_receive(int fd,
- struct nnpfs_message_header *message,
- u_int size,
- d_thread_t *p);
-
-int
-nnpfs_message_wakeup(int fd,
- struct nnpfs_message_wakeup *message,
- u_int size,
- d_thread_t *p);
-
-int
-nnpfs_message_wakeup_data(int fd,
- struct nnpfs_message_wakeup_data * message,
- u_int size,
- d_thread_t *p);
-
-int
-nnpfs_uprintf_device(void);
-
-int
-nnpfs_is_nnpfs_dev (dev_t dev);
-
-#endif /* _nnpfs_dev_h */
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_fs.h b/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_fs.h
deleted file mode 100644
index ae7dffb2509..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_fs.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: nnpfs_fs.h,v 1.22 2002/12/19 09:49:19 lha Exp $ */
-
-#ifndef _nnpfs_h
-#define _nnpfs_h
-
-#include <sys/types.h>
-
-#include <nnpfs/nnpfs_common.h>
-#include <nnpfs/nnpfs_node.h>
-#include <nnpfs/nnpfs_attr.h>
-
-#define NNNPFS 2 /* maximal number of filesystems on a single device */
-
-/*
- * Filesystem struct.
- */
-
-struct nnpfs {
- u_int status; /* Inited, opened or mounted */
-#define NNPFS_MOUNTED 0x1
- struct mount *mp;
- struct nnpfs_node *root;
- u_int nnodes;
- int fd;
- struct nnpfs_nodelist_head nodehead;
-};
-
-#ifdef __osf__
-#ifdef HAVE_STRUCT_MOUNT_M_INFO
-#define VFS_TO_NNPFS(v) ((struct nnpfs *) ((v)->m_info))
-#else
-#define VFS_TO_NNPFS(v) ((struct nnpfs *) ((v)->m_data))
-#endif
-#else
-#define VFS_TO_NNPFS(v) ((struct nnpfs *) ((v)->mnt_data))
-#endif
-#define NNPFS_TO_VFS(x) ((x)->mp)
-
-#define NNPFS_FROM_VNODE(vp) VFS_TO_NNPFS((vp)->v_mount)
-#define NNPFS_FROM_XNODE(xp) NNPFS_FROM_VNODE(XNODE_TO_VNODE(xp))
-
-extern struct nnpfs nnpfs[];
-
-extern struct vnodeops nnpfs_vnodeops;
-
-int new_nnpfs_node(struct nnpfs *, struct nnpfs_msg_node *, struct nnpfs_node **,
- d_thread_t *);
-void free_nnpfs_node(struct nnpfs_node *);
-int free_all_nnpfs_nodes(struct nnpfs *, int, int);
-
-int nnpfs_dnlc_enter(struct vnode *, nnpfs_componentname *, struct vnode *);
-int nnpfs_dnlc_enter_name(struct vnode *, const char *, struct vnode *);
-void nnpfs_dnlc_purge_mp(struct mount *);
-void nnpfs_dnlc_purge(struct vnode *);
-int nnpfs_dnlc_lookup(struct vnode *, nnpfs_componentname *, struct vnode **);
-int nnpfs_dnlc_lookup_name(struct vnode *, const char *, struct vnode **);
-
-void vattr2nnpfs_attr(const struct vattr *, struct nnpfs_attr *);
-void nnpfs_attr2vattr(const struct nnpfs_attr *, struct vattr *, int);
-
-int nnpfs_has_pag(const struct nnpfs_node *, nnpfs_pag_t);
-
-#endif /* _nnpfs_h */
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_locl.h b/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_locl.h
deleted file mode 100644
index 5144bfc7a8b..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_locl.h
+++ /dev/null
@@ -1,422 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: nnpfs_locl.h,v 1.72 2003/02/15 16:40:00 lha Exp $ */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef RCSID
-#define RCSID(x)
-#endif
-
-#ifdef __osf__
-
-#ifdef __GNUC__
-#define asm __foo_asm
-#endif
-#include <sys/types.h>
-#include <sys/errno.h>
-#include <sys/uio.h>
-#include <machine/cpu.h>
-#include <sys/conf.h>
-#include <sys/sysconfig.h>
-#include <sys/file.h>
-#include <sys/malloc.h>
-#include <sys/poll.h>
-#include <sys/ioctl.h>
-#include <sys/fcntl.h>
-#include <sys/vfs_proto.h>
-#include <io/common/devdriver.h>
-#include <vm/vm_page.h>
-#include <vm/vm_vppage.h>
-#include <vm/vm_ubc.h>
-
-typedef short int16_t;
-typedef unsigned short uint16_t;
-typedef int int32_t;
-typedef unsigned int uint32_t;
-
-#define VT_AFS VT_ADDON
-#define MOUNT_NNPFS MOUNT_PC
-
-typedef struct nameidata nnpfs_componentname;
-
-/* XXX this is gross, but makes the code considerably more readable */
-#if 0
-#define componentname nameidata
-#endif
-
-#define cn_nameptr ni_ptr
-#define cn_namelen ni_namelen
-#define cn_hash ni_hash
-#define cn_cred ni_cred
-#define cn_nameiop ni_nameiop
-#define cn_flags ni_flags
-
-#define mnt_stat m_stat
-#define mnt_flag m_flag
-
-#define NDINIT(ndp, op, flags, segflg, namep, p) \
- (ndp)->ni_nameiop = (op) | (flags); \
- (ndp)->ni_segflg = segflg; \
- (ndp)->ni_dirp = namep;
-
-#define LOCKLEAF 0
-
-#define FFLAGS(mode) ((mode) - FOPEN)
-
-/* 4.4BSD vput does VOP_UNLOCK + vrele, but it seems as if we only
- should do a vrele here */
-#define vput(VP) vrele(VP)
-
-#define nnpfs_uio_to_proc(uiop) (u.u_procp)
-#define nnpfs_cnp_to_proc(cnp) (u.u_procp)
-#define nnpfs_proc_to_cred(p) ((p)->p_rcred)
-#define nnpfs_proc_to_euid(p) ((p)->p_rcred->cr_uid)
-
-#define nnpfs_curproc() (u.u_procp)
-
-#define nnpfs_vop_read VOP_READ
-#define nnpfs_vop_write VOP_WRITE
-#define nnpfs_vop_getattr(t, attr, cred, proc, error) VOP_GETATTR((t), (attr), (cred), (error))
-#define nnpfs_vop_access(dvp, mode, cred, proc, error) VOP_ACCESS((dvp), (mode), (cred), (error))
-
-struct vop_generic_args;
-
-typedef u_long va_size_t;
-
-#else /* !__osf__ */
-
-typedef struct componentname nnpfs_componentname;
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/proc.h>
-#include <sys/filedesc.h>
-#include <sys/kernel.h>
-#ifdef HAVE_SYS_MODULE_H
-#include <sys/module.h>
-#endif
-#include <sys/systm.h>
-#include <sys/fcntl.h>
-#ifdef HAVE_SYS_SYSPROTO_H
-#include <sys/sysproto.h>
-#endif
-#include <sys/conf.h>
-#include <sys/mount.h>
-#include <sys/exec.h>
-#ifdef HAVE_SYS_SYSENT_H
-#include <sys/sysent.h>
-#endif
-#ifdef HAVE_SYS_LKM_H
-#include <sys/lkm.h>
-#endif
-#ifdef HAVE_SYS_LOCK_H
-#include <sys/lock.h>
-#endif
-#ifdef HAVE_SYS_MUTEX_H
-#include <sys/mutex.h>
-#endif
-#include <sys/vnode.h>
-#include <sys/errno.h>
-#include <sys/file.h>
-#include <sys/namei.h>
-#include <sys/dirent.h>
-#include <sys/ucred.h>
-#include <sys/select.h>
-#include <sys/uio.h>
-#ifdef HAVE_SYS_POLL_H
-#include <sys/poll.h>
-#endif
-#ifdef HAVE_SYS_SIGNALVAR_H
-#include <sys/signalvar.h>
-#endif
-#ifdef HAVE_SYS_INTTYPES_H
-#include <sys/inttypes.h>
-#endif
-#include <sys/syscall.h>
-#include <sys/queue.h>
-#include <sys/malloc.h>
-#ifdef HAVE_SYS_SYSCALLARGS_H
-#include <sys/syscallargs.h>
-#endif
-#ifdef HAVE_SYS_ATTR_H
-#include <sys/attr.h>
-#endif
-
-#ifdef HAVE_MISCFS_GENFS_GENFS_H
-#include <miscfs/genfs/genfs.h>
-#endif
-#ifdef HAVE_MISCFS_SYNCFS_SYNCFS_H
-#include <miscfs/syncfs/syncfs.h>
-#endif
-#ifndef HAVE_KERNEL_UVM_ONLY
-#ifdef HAVE_VM_VM_H
-#include <vm/vm.h>
-#endif
-#ifdef HAVE_VM_VM_EXTERN_H
-#include <vm/vm_extern.h>
-#endif
-#ifdef HAVE_VM_VM_ZONE_H
-#include <vm/vm_zone.h>
-#endif
-#ifdef HAVE_VM_VM_OBJECT_H
-#include <vm/vm_object.h>
-#endif
-#endif
-#ifdef HAVE_UVM_UVM_EXTERN_H
-#include <uvm/uvm_extern.h>
-#endif
-#ifdef HAVE_VM_UMA_H
-#include <vm/uma.h>
-#endif
-
-#if defined(__APPLE__)
-#include <machine/machine_routines.h>
-#include <mach/machine/vm_types.h>
-#include <sys/ubc.h>
-void cache_purge(struct vnode *);
-int cache_lookup(struct vnode *, struct vnode **, struct componentname *);
-void cache_enter(struct vnode *, struct vnode *, struct componentname *);
-void cache_purgevfs(struct mount *);
-#endif
-
-#define nnpfs_vop_read(t, uio, ioflag, cred, error) (error) = VOP_READ((t), (uio), (ioflag), (cred))
-#define nnpfs_vop_write(t, uio, ioflag, cred, error) (error) = VOP_WRITE((t), (uio), (ioflag), (cred))
-#define nnpfs_vop_getattr(t, attr, cred, proc, error) (error) = VOP_GETATTR((t), (attr), (cred), (proc))
-#define nnpfs_vop_access(dvp, mode, cred, proc, error) (error) = VOP_ACCESS((dvp), (mode), (cred), (proc))
-
-typedef u_quad_t va_size_t;
-
-#endif /* !__osf__ */
-
-#ifdef __FreeBSD_version
-#if __FreeBSD_version < 400000
-# error This version is unsupported
-#elif __FreeBSD_version < 440001 || (__FreeBSD_version >= 500000 && __FreeBSD_version < 500023)
-typedef struct proc d_thread_t;
-#elif __FreeBSD_version == 500023
-# define HAVE_FREEBSD_THREAD
-typedef struct thread d_thread_t;
-#elif __FreeBSD_version >= 500024
-# define HAVE_FREEBSD_THREAD
-#endif
-typedef d_thread_t syscall_d_thread_t;
-#define syscall_thread_to_thread(x) (x)
-#else /* !__FreeBSD_version */
-#if defined(__NetBSD__) && __NetBSD_Version__ >= 106130000
-typedef struct lwp syscall_d_thread_t;
-#define syscall_thread_to_thread(x) ((x)->l_proc)
-#else
-typedef struct proc syscall_d_thread_t;
-#define syscall_thread_to_thread(x) (x)
-#endif
-typedef struct proc d_thread_t;
-#endif /* !__FreeBSD_version */
-
-#ifdef VV_ROOT
-#define NNPFS_MAKE_VROOT(v) ((v)->v_vflag |= VV_ROOT) /* FreeBSD 5 */
-#else
-#define NNPFS_MAKE_VROOT(v) ((v)->v_flag |= VROOT)
-#endif
-
-#if defined(__NetBSD__) && __NetBSD_Version__ >= 105280000
-#include <miscfs/genfs/genfs.h>
-#include <miscfs/genfs/genfs_node.h>
-
-struct genfs_ops nnpfs_genfsops;
-#endif
-
-
-#if defined(HAVE_FREEBSD_THREAD)
-#define nnpfs_uio_to_thread(uiop) ((uiop)->uio_td)
-#define nnpfs_cnp_to_thread(cnp) ((cnp)->cn_thread)
-#define nnpfs_thread_to_cred(td) ((td)->td_proc->p_ucred)
-#define nnpfs_thread_to_euid(td) ((td)->td_proc->p_ucred->cr_uid)
-#else
-#define nnpfs_uio_to_proc(uiop) ((uiop)->uio_procp)
-#define nnpfs_cnp_to_proc(cnp) ((cnp)->cn_proc)
-#define nnpfs_proc_to_cred(p) ((p)->p_ucred)
-#define nnpfs_proc_to_euid(p) ((p)->p_ucred->cr_uid)
-#endif
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 500043
-extern const char *VT_AFS;
-#endif
-
-#if defined(__FreeBSD__)
-typedef void * nnpfs_malloc_type;
-#elif defined(__NetBSD__) && __NetBSD_Version__ >= 106140000 /* 1.6N */
-typedef struct malloc_type * nnpfs_malloc_type;
-#else
-typedef int nnpfs_malloc_type;
-#endif
-
-#ifdef __APPLE__
-#define nnpfs_curproc() (current_proc())
-#else
-#if defined(HAVE_FREEBSD_THREAD)
-#define nnpfs_curthread() (curthread)
-#else
-#define nnpfs_curproc() (curproc)
-#endif
-#endif
-
-#ifdef __osf__
-#define nnpfs_pushdirty(vp, cred, p)
-#else
-void nnpfs_pushdirty(struct vnode *, struct ucred *, d_thread_t *);
-#endif
-
-
-#if defined(HAVE_UINTPTR_T) /* c99 enviroment */
-#define nnpfs_uintptr_t uintptr_t
-#else
-#if defined(_LP64) || defined(alpha) || defined(__alpha__) || defined(__sparc64__) || defined(__sparcv9__)
-#define nnpfs_uintptr_t unsigned long long
-#else /* !LP64 */
-#define nnpfs_uintptr_t unsigned long
-#endif /* LP64 */
-#endif
-
-/*
- * XXX
- */
-
-#ifndef SCARG
-#if defined(__FreeBSD_version) && __FreeBSD_version > 500042
-#define SCARG(a, b) ((a)->b)
-#define syscallarg(x) x
-#else
-#define SCARG(a, b) ((a)->b.datum)
-#define syscallarg(x) union { x datum; register_t pad; }
-#endif /* __FreeBSD_version */
-#endif /* SCARG */
-
-#ifndef syscallarg
-#define syscallarg(x) x
-#endif
-
-#ifndef HAVE_REGISTER_T
-typedef int register_t;
-#endif
-
-/* malloc(9) waits by default, freebsd post 5.0 choose to remove the flag */
-#ifndef M_WAITOK
-#define M_WAITOK 0
-#endif
-
-#if defined(HAVE_DEF_STRUCT_SETGROUPS_ARGS)
-#define nnpfs_setgroups_args setgroups_args
-#elif defined(HAVE_DEF_STRUCT_SYS_SETGROUPS_ARGS)
-#define nnpfs_setgroups_args sys_setgroups_args
-#elif __osf__
-struct nnpfs_setgroups_args {
- syscallarg(int) gidsetsize;
- syscallarg(gid_t) *gidset;
-};
-#elif defined(__APPLE__)
-struct nnpfs_setgroups_args{
- syscallarg(u_int) gidsetsize;
- syscallarg(gid_t) *gidset;
-};
-#else
-#error what is you setgroups named ?
-#endif
-
-
-#ifdef HAVE_KERNEL_VFS_GETVFS
-#define nnpfs_vfs_getvfs vfs_getvfs
-#else
-#define nnpfs_vfs_getvfs getvfs
-#endif
-
-#ifdef HAVE_FOUR_ARGUMENT_VFS_OBJECT_CREATE
-#define nnpfs_vfs_object_create(vp,proc,ucred) vfs_object_create(vp,proc,ucred,TRUE)
-#else
-#define nnpfs_vfs_object_create(vp,proc,ucred) vfs_object_create(vp,proc,ucred)
-#endif
-
-#if defined(UVM) || (defined(__NetBSD__) && __NetBSD_Version__ >= 105280000)
-#define nnpfs_set_vp_size(vp, sz) uvm_vnp_setsize(vp, sz)
-#elif HAVE_KERNEL_VNODE_PAGER_SETSIZE
-#define nnpfs_set_vp_size(vp, sz) vnode_pager_setsize(vp, sz)
-#elif defined(__APPLE__)
-#define nnpfs_set_vp_size(vp, sz) ubc_setsize(vp, sz)
-#else
-#define nnpfs_set_vp_size(vp, sz)
-#endif
-
-/* namei flag */
-#ifdef LOCKLEAF
-#define NNPFS_LOCKLEAF LOCKLEAF
-#else
-#define NNPFS_LOCKLEAF 0
-#endif
-
-#ifdef NEED_VGONEL_PROTO
-void vgonel (struct vnode *vp, d_thread_t *p);
-#endif
-
-#ifdef NEED_ISSIGNAL_PROTO
-int issignal (d_thread_t *);
-#endif
-
-#ifdef NEED_STRNCMP_PROTO
-int strncmp (const char *, const char *, size_t);
-#endif
-
-#ifdef NEED_VN_WRITECHK_PROTO
-int vn_writechk (struct vnode *);
-#endif
-
-#ifdef NEED_UBC_PUSHDIRTY_PROTO
-int ubc_pushdirty (struct vnode *);
-#endif
-
-#include <nnpfs/nnpfs_syscalls.h>
-
-/*
- * The VOP table
- *
- * What VOPs do we have today ?
- */
-
-#define NNPFS_VOP_DEF(n) \
- struct vop_##n##_args; \
- int nnpfs_##n(struct vop_##n##_args *);
-
-#include "nnpfs/nnpfs_vopdefs.h"
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_msg_locl.h b/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_msg_locl.h
deleted file mode 100644
index d3be0f9548f..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_msg_locl.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: nnpfs_msg_locl.h,v 1.6 2002/09/07 10:46:05 lha Exp $ */
-
-#ifndef _nnpfs_msg_locl_h
-#define _nnpfs_msg_locl_h
-
-int
-nnpfs_message_installroot(int fd,
- struct nnpfs_message_installroot * message,
- u_int size,
- d_thread_t *p);
-
-int
-nnpfs_message_installnode(int fd,
- struct nnpfs_message_installnode * message,
- u_int size,
- d_thread_t *p);
-
-int
-nnpfs_message_installattr(int fd,
- struct nnpfs_message_installattr * message,
- u_int size,
- d_thread_t *p);
-
-int
-nnpfs_message_installdata(int fd,
- struct nnpfs_message_installdata * message,
- u_int size,
- d_thread_t *p);
-
-int
-nnpfs_message_invalidnode(int fd,
- struct nnpfs_message_invalidnode * message,
- u_int size,
- d_thread_t *p);
-
-int
-nnpfs_message_updatefid(int fd,
- struct nnpfs_message_updatefid * message,
- u_int size,
- d_thread_t *p);
-
-int
-nnpfs_message_gc_nodes(int fd,
- struct nnpfs_message_gc_nodes * message,
- u_int size,
- d_thread_t *p);
-
-int
-nnpfs_message_version(int fd,
- struct nnpfs_message_version *message,
- u_int size,
- d_thread_t *p);
-
-#endif /* _nnpfs_msg_locl_h */
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_node.h b/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_node.h
deleted file mode 100644
index 573bc89dfe1..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_node.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: nnpfs_node.h,v 1.33 2003/01/25 18:48:28 lha Exp $ */
-
-#ifndef _nnpfs_xnode_h
-#define _nnpfs_xnode_h
-
-#include <sys/types.h>
-#include <sys/time.h>
-#ifdef HAVE_KERNEL_LF_ADVLOCK
-#include <sys/lockf.h>
-#endif
-
-#include <nnpfs/nnpfs_attr.h>
-#include <nnpfs/nnpfs_message.h>
-#include <nnpfs/nnpfs_queue.h>
-
-#ifdef __APPLE__
-typedef struct lock__bsd__ nnpfs_vnode_lock;
-#else
-typedef struct lock nnpfs_vnode_lock;
-#endif
-
-struct nnpfs_node {
-#if defined(__NetBSD_Version__) && __NetBSD_Version__ >= 105280000
- struct genfs_node gnode;
-#endif
- struct vnode *vn;
- struct vnode *data;
- struct vattr attr;
- uint32_t offset;
- u_int flags;
- u_int tokens;
- nnpfs_handle handle;
- nnpfs_pag_t id[MAXRIGHTS];
- u_char rights[MAXRIGHTS];
- u_char anonrights;
-#if defined(HAVE_KERNEL_LOCKMGR) || defined(HAVE_KERNEL_DEBUGLOCKMGR)
- nnpfs_vnode_lock lock;
-#else
- int vnlocks;
-#endif
-#ifdef HAVE_KERNEL_LF_ADVLOCK
- struct lockf *lockf;
-#endif
- struct ucred *rd_cred;
- struct ucred *wr_cred;
- NNPQUEUE_ENTRY(nnpfs_node) nn_hash;
-};
-
-#define XN_HASHSIZE 101
-
-NNPQUEUE_HEAD(nh_node_list, nnpfs_node);
-
-struct nnpfs_nodelist_head {
- struct nh_node_list nh_nodelist[XN_HASHSIZE];
-};
-
-void nnfs_init_head(struct nnpfs_nodelist_head *);
-void nnpfs_node_purge(struct nnpfs_nodelist_head *,
- void (*func)(struct nnpfs_node *));
-struct nnpfs_node *
- nnpfs_node_find(struct nnpfs_nodelist_head *, nnpfs_handle *);
-void nnpfs_remove_node(struct nnpfs_nodelist_head *, struct nnpfs_node *);
-void nnpfs_insert(struct nnpfs_nodelist_head *, struct nnpfs_node *);
-int nnpfs_update_handle(struct nnpfs_nodelist_head *, nnpfs_handle *,
- nnpfs_handle *);
-
-
-struct nnpfs;
-
-int nnpfs_getnewvnode(struct nnpfs *nnpfsp, struct vnode **vpp,
- struct nnpfs_handle *handle);
-
-
-#define DATA_FROM_VNODE(vp) DATA_FROM_XNODE(VNODE_TO_XNODE(vp))
-
-#define DATA_FROM_XNODE(xp) ((xp)->data)
-
-#define XNODE_TO_VNODE(xp) ((xp)->vn)
-#define VNODE_TO_XNODE(vp) ((struct nnpfs_node *) (vp)->v_data)
-
-#if defined(HAVE_ONE_ARGUMENT_VGET)
-#define nnpfs_do_vget(vp, lockflag, proc) vget((vp))
-#elif defined(HAVE_TWO_ARGUMENT_VGET)
-#define nnpfs_do_vget(vp, lockflag, proc) vget((vp), (lockflag))
-#elif defined(HAVE_THREE_ARGUMENT_VGET)
-#define nnpfs_do_vget(vp, lockflag, proc) vget((vp), (lockflag), (proc))
-#else
-#error what kind of vget
-#endif
-
-#ifndef HAVE_VOP_T
-typedef int vop_t (void *);
-#endif
-
-#ifdef LK_INTERLOCK
-#define HAVE_LK_INTERLOCK
-#else
-#define LK_INTERLOCK 0
-#endif
-
-#ifdef LK_RETRY
-#define HAVE_LK_RETRY
-#else
-#define LK_RETRY 0
-#endif
-
-/*
- * This is compat code for older vfs that have a
- * vget that only take a integer (really boolean) argument
- * that the the returned vnode will be returned locked
- */
-
-#ifdef LK_EXCLUSIVE
-#define HAVE_LK_EXCLUSIVE 1
-#else
-#define LK_EXCLUSIVE 1
-#endif
-
-#ifdef LK_SHARED
-#define HAVE_LK_SHARED 1
-#else
-#define LK_SHARED 1
-#endif
-
-void nnpfs_update_write_cred(struct nnpfs_node *, struct ucred *);
-void nnpfs_update_read_cred(struct nnpfs_node *, struct ucred *);
-
-#endif /* _nnpfs_xnode_h */
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_syscalls.h b/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_syscalls.h
deleted file mode 100644
index c81e8e4c2d0..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_syscalls.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: nnpfs_syscalls.h,v 1.29 2003/01/19 20:53:54 lha Exp $ */
-
-#ifndef __nnpfs_syscalls
-#define __nnpfs_syscalls
-
-#include <nnpfs/nnpfs_common.h>
-#include <nnpfs/nnpfs_message.h>
-
-#include <afssysdefs.h>
-
-struct sys_pioctl_args {
- syscallarg(int) operation;
- syscallarg(char *) a_pathP;
- syscallarg(int) a_opcode;
- syscallarg(struct ViceIoctl *) a_paramsP;
- syscallarg(int) a_followSymlinks;
-};
-
-#define NNPFS_FHMAXDATA 40
-
-struct nnpfs_fhandle_t {
- u_short len;
- u_short pad;
- char fhdata[NNPFS_FHMAXDATA];
-};
-
-struct nnpfs_fh_args {
- syscallarg(fsid_t) fsid;
- syscallarg(long) fileid;
- syscallarg(long) gen;
-};
-
-int nnpfs_install_syscalls(void);
-int nnpfs_uninstall_syscalls(void);
-int nnpfs_stat_syscalls(void);
-nnpfs_pag_t nnpfs_get_pag(struct ucred *);
-
-int nnpfs_setpag_call(struct ucred **ret_cred);
-int nnpfs_pioctl_call(d_thread_t *proc,
- struct sys_pioctl_args *args,
- register_t *return_value);
-
-int nnpfspioctl(syscall_d_thread_t *proc, void *varg, register_t *retval);
-
-int nnpfs_setgroups(syscall_d_thread_t *p, void *varg, register_t *retval);
-
-extern int (*old_setgroups_func)(syscall_d_thread_t *, void *, register_t *);
-extern int nnpfs_syscall_num; /* The old syscall number */
-
-
-#ifndef HAVE_KERNEL_SYS_LKMNOSYS
-#define sys_lkmnosys nosys
-#endif
-
-#ifndef SYS_MAXSYSCALL
-#define SYS_MAXSYSCALL nsysent
-#endif
-
-#endif /* __nnpfs_syscalls */
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_vfsops-bsd.h b/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_vfsops-bsd.h
deleted file mode 100644
index 1d67f3d764b..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_vfsops-bsd.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: nnpfs_vfsops-bsd.h,v 1.14 2002/09/07 10:46:09 lha Exp $ */
-
-#ifndef _nnpfs_vfsops_bsd_h
-#define _nnpfs_vfsops_bsd_h
-
-int
-nnpfs_mount_caddr(struct mount *mp, const char *user_path, caddr_t user_data,
- struct nameidata *ndp, d_thread_t *p);
-
-int
-nnpfs_start(struct mount * mp, int flags, d_thread_t * p);
-
-int
-nnpfs_unmount(struct mount * mp, int mntflags, d_thread_t *p);
-
-int
-nnpfs_root(struct mount *mp, struct vnode **vpp);
-
-int
-nnpfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg, d_thread_t *p);
-
-int
-nnpfs_statfs(struct mount *mp, struct statfs *sbp, d_thread_t *p);
-
-int
-nnpfs_sync(struct mount *mp, int waitfor, struct ucred *cred, d_thread_t *p);
-
-int
-nnpfs_vget(struct mount * mp,
-#ifdef __APPLE__
- void *ino,
-#else
- ino_t ino,
-#endif
- struct vnode ** vpp);
-
-#ifdef HAVE_STRUCT_VFSOPS_VFS_CHECKEXP
-int
-nnpfs_fhtovp(struct mount * mp,
- struct fid * fhp,
- struct vnode ** vpp);
-#else
-int
-nnpfs_fhtovp(struct mount * mp,
- struct fid * fhp,
- struct mbuf * nam,
- struct vnode ** vpp,
- int *exflagsp,
- struct ucred ** credanonp);
-#endif
-
-struct mbuf;
-int
-nnpfs_checkexp (struct mount *mp,
-#ifdef __FreeBSD__
- struct sockaddr *nam,
-#else
- struct mbuf *nam,
-#endif
- int *exflagsp,
- struct ucred **credanonp);
-
-int
-nnpfs_vptofh(struct vnode * vp,
- struct fid * fhp);
-
-int
-nnpfs_dead_lookup(struct vop_lookup_args * ap);
-
-#endif /* _nnpfs_vfsops_bsd_h */
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_vfsops.h b/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_vfsops.h
deleted file mode 100644
index 717745bb98d..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_vfsops.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: nnpfs_vfsops.h,v 1.17 2003/06/02 18:27:10 lha Exp $ */
-
-#ifndef _nnpfs_vfsops_h
-#define _nnpfs_vfsops_h
-
-int
-nnpfs_mount_common(struct mount *mp,
- const char *user_path,
- void *user_data,
- struct nameidata *ndp,
- d_thread_t *p);
-
-int
-nnpfs_mount_common_sys(struct mount *mp,
- const char *path,
- void *data,
- struct nameidata *ndp,
- d_thread_t *p);
-
-int
-nnpfs_unmount_common(struct mount *mp, int mntflags);
-
-int
-nnpfs_root_common(struct mount *mp,
- struct vnode **vpp,
- d_thread_t *proc,
- struct ucred *cred);
-
-int
-nnpfs_fhlookup (d_thread_t *proc,
- struct nnpfs_fhandle_t *fhp,
- struct vnode **vpp);
-
-int
-nnpfs_fhopen (d_thread_t *proc,
- struct nnpfs_fhandle_t *fhp,
- int flags,
- register_t *retval);
-
-int nnpfs_make_dead_vnode(struct mount *mp, struct vnode **vpp);
-
-#endif /* _nnpfs_vfsops_h */
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_vnodeops.h b/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_vnodeops.h
deleted file mode 100644
index 552734db621..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_vnodeops.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: nnpfs_vnodeops.h,v 1.25 2002/09/07 10:46:12 lha Exp $ */
-
-#ifndef _nnpfs_vnodeops_h
-#define _nnpfs_vnodeops_h
-
-/*
- * nnpfs_vfs_readlock
- * nnpfs_vfs_writelock
- * nnpfs_vfs_unlock
- */
-
-#ifdef __osf__ /* XXX - what about VN_LOCK? */
-
-#define nnpfs_vfs_readlock(vp, proc) VREF((vp))
-#define nnpfs_vfs_writelock(vp, proc) VREF((vp))
-#define nnpfs_vfs_unlock(vp, proc) vrele((vp))
-
-/* XXX - should this do anything? */
-
-#define nnpfs_vfs_vn_lock(vp, flags, proc) (0)
-
-#elif defined(HAVE_TWO_ARGUMENT_VOP_LOCK)
-
-#define nnpfs_vfs_readlock(vp, proc) vn_lock((vp), LK_SHARED | LK_RETRY)
-#define nnpfs_vfs_writelock(vp, proc) vn_lock((vp), LK_EXCLUSIVE | LK_RETRY)
-#define nnpfs_vfs_unlock(vp, proc) VOP_UNLOCK((vp), 0)
-#define nnpfs_vfs_vn_lock(vp, flags, proc) vn_lock((vp), (flags))
-
-#elif defined(HAVE_THREE_ARGUMENT_VOP_LOCK)
-
-#define nnpfs_vfs_readlock(vp, proc) vn_lock((vp), LK_SHARED | LK_RETRY, (proc))
-#define nnpfs_vfs_writelock(vp, proc) vn_lock((vp), LK_EXCLUSIVE | LK_RETRY, (proc))
-#define nnpfs_vfs_unlock(vp, proc) VOP_UNLOCK((vp), 0, (proc))
-#define nnpfs_vfs_vn_lock(vp, flags, proc) vn_lock((vp), (flags), (proc))
-
-#elif defined(HAVE_ONE_ARGUMENT_VOP_LOCK)
-
-#define nnpfs_vfs_readlock(vp, proc) VOP_LOCK((vp))
-#define nnpfs_vfs_writelock(vp, proc) VOP_LOCK((vp))
-#define nnpfs_vfs_unlock(vp, proc) VOP_UNLOCK((vp))
-
-/* XXX - should this do anything? */
-
-#define nnpfs_vfs_vn_lock(vp, flags, proc) (0)
-
-#else
-
-#error what kind of VOP_LOCK?
-
-#endif
-
-int
-nnpfs_open_valid(struct vnode *vp, struct ucred *cred, d_thread_t *p,
- u_int tok);
-
-int
-nnpfs_attr_valid(struct vnode *vp, struct ucred *cred, d_thread_t *p,
- u_int tok);
-
-int
-nnpfs_fetch_rights(struct vnode *vp, struct ucred *cred, d_thread_t *p);
-
-int
-nnpfs_data_valid(struct vnode *vp, struct ucred *cred, d_thread_t *p,
- u_int tok, uint32_t offset);
-
-int
-nnpfs_open_common(struct vnode *vp,
- int mode,
- struct ucred *cred,
- d_thread_t *p);
-
-int
-nnpfs_fsync_common(struct vnode *vp, struct ucred *cred,
- int waitfor, d_thread_t *proc);
-
-int
-nnpfs_close_common(struct vnode *vp, int fflag,
- d_thread_t *proc, struct ucred *cred);
-
-int
-nnpfs_read_common(struct vnode *vp, struct uio *uio, int ioflag,
- struct ucred *cred);
-
-int
-nnpfs_write_common(struct vnode *vp, struct uio *uiop, int ioflag,
- struct ucred *cred);
-
-int
-nnpfs_getattr_common(struct vnode *vp, struct vattr *vap,
- struct ucred *cred, d_thread_t *p);
-
-int
-nnpfs_setattr_common(struct vnode *vp, struct vattr *vap,
- struct ucred *cred, d_thread_t *p);
-
-int
-nnpfs_access_common(struct vnode *vp, int mode,
- struct ucred *cred, d_thread_t *p);
-
-int
-nnpfs_lookup_common(struct vnode *dvp,
- nnpfs_componentname *cnp,
- struct vnode **vpp);
-
-int
-nnpfs_create_common(struct vnode *dvp,
- const char *name,
- struct vattr *vap,
- struct ucred *cred,
- d_thread_t *p);
-
-int
-nnpfs_remove_common(struct vnode *dvp,
- struct vnode *vp,
- const char *name,
- struct ucred *cred,
- d_thread_t *p);
-
-int
-nnpfs_rename_common(struct vnode *fdvp,
- struct vnode *fvp,
- const char *fname,
- struct vnode *tdvp,
- struct vnode *tvp,
- const char *tname,
- struct ucred *cred,
- d_thread_t *p);
-
-int
-nnpfs_mkdir_common(struct vnode *dvp,
- const char *name,
- struct vattr *vap,
- struct ucred *cred,
- d_thread_t *p);
-
-int
-nnpfs_rmdir_common(struct vnode *dvp,
- struct vnode *vp,
- const char *name,
- struct ucred *cred,
- d_thread_t *p);
-
-int
-nnpfs_readdir_common(struct vnode *vp,
- struct uio *uiop,
- struct ucred *cred,
- d_thread_t *p,
- int *eofflag);
-
-int
-nnpfs_link_common(struct vnode *dvp,
- struct vnode *vp,
- const char *name,
- struct ucred *cred,
- d_thread_t *p);
-
-int
-nnpfs_symlink_common(struct vnode *dvp,
- struct vnode **vpp,
- nnpfs_componentname *cnp,
- struct vattr *vap,
- char *target);
-
-int
-nnpfs_readlink_common(struct vnode *vp, struct uio *uiop, struct ucred *cred);
-
-int
-nnpfs_inactive_common(struct vnode *vp, d_thread_t *p);
-
-int
-nnpfs_reclaim_common(struct vnode *vp);
-
-int
-nnpfs_eopnotsupp (struct vop_generic_args *ap);
-
-int
-nnpfs_returnzero (struct vop_generic_args *ap);
-
-void
-nnpfs_printnode_common (struct vnode *vp);
-
-size_t
-nnpfs_uio_end_length (struct uio *uio);
-
-
-#endif /* _nnpfs_vnodeops_h */
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_wrap.h b/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_wrap.h
deleted file mode 100644
index 2dc0f7133d4..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs/nnpfs_wrap.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: nnpfs_wrap.h,v 1.4 2002/09/07 10:46:13 lha Exp $ */
-
-#ifdef __APPLE__
-__private_extern__ kern_return_t
-nnpfs_modload(kmod_info_t *ki, void *data);
-__private_extern__ kern_return_t
-nnpfs_modunload(kmod_info_t *ki, void *data);
-#endif
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_common-bsd.c b/usr.sbin/afs/src/nnpfs/bsd/nnpfs_common-bsd.c
deleted file mode 100644
index 70835881880..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_common-bsd.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <nnpfs/nnpfs_locl.h>
-#include <nnpfs/nnpfs_common.h>
-#include <nnpfs/nnpfs_deb.h>
-
-RCSID("$arla: nnpfs_common-bsd.c,v 1.25 2002/12/18 16:32:03 lha Exp $");
-
-#ifdef MALLOC_DEFINE
-MALLOC_DEFINE(M_NNPFS, "nnpfs-misc", "nnpfs misc");
-MALLOC_DEFINE(M_NNPFS_NODE, "nnpfs-node", "nnpfs node");
-MALLOC_DEFINE(M_NNPFS_LINK, "nnpfs-link", "nnpfs link");
-MALLOC_DEFINE(M_NNPFS_MSG, "nnpfs-msg", "nnpfs msg");
-#endif
-
-#ifdef NNPFS_DEBUG
-static u_int nnpfs_allocs;
-static u_int nnpfs_frees;
-
-void *
-nnpfs_alloc(u_int size, nnpfs_malloc_type type)
-{
- void *ret;
-
- nnpfs_allocs++;
- NNPFSDEB(XDEBMEM, ("nnpfs_alloc: nnpfs_allocs - nnpfs_frees %d\n",
- nnpfs_allocs - nnpfs_frees));
-
- MALLOC(ret, void *, size, type, M_WAITOK);
- return ret;
-}
-
-void
-nnpfs_free(void *ptr, u_int size, nnpfs_malloc_type type)
-{
- nnpfs_frees++;
- FREE(ptr, type);
-}
-
-#endif /* NNPFS_DEBUG */
-
-int
-nnpfs_suser(d_thread_t *p)
-{
-#if defined(HAVE_TWO_ARGUMENT_SUSER)
- return suser (nnpfs_proc_to_cred(p), NULL);
-#else
- return suser (p);
-#endif
-}
-
-/*
- * Print a `dev_t' in some readable format
- */
-
-#ifdef HAVE_KERNEL_DEVTONAME
-
-const char *
-nnpfs_devtoname_r (dev_t dev, char *buf, size_t sz)
-{
- return devtoname (dev);
-}
-
-#else /* !HAVE_KERNEL_DEVTONAME */
-
-const char *
-nnpfs_devtoname_r (dev_t dev, char *buf, size_t sz)
-{
-#ifdef HAVE_KERNEL_SNPRINTF
- snprintf (buf, sz, "%u/%u", major(dev), minor(dev));
- return buf;
-#else
- return "<unknown device>";
-#endif
-}
-
-#endif /* HAVE_KERNEL_DEVTONAME */
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_common.c b/usr.sbin/afs/src/nnpfs/bsd/nnpfs_common.c
deleted file mode 100644
index 23fe1465576..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_common.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000, 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <nnpfs/nnpfs_locl.h>
-#include <nnpfs/nnpfs_common.h>
-#include <nnpfs/nnpfs_deb.h>
-
-RCSID("$arla: nnpfs_common.c,v 1.8 2002/12/19 10:30:15 lha Exp $");
-
-#ifndef HAVE_KERNEL_STRLCPY
-
-size_t
-strlcpy (char *dst, const char *src, size_t dst_sz)
-{
- size_t n;
- char *p;
-
- for (p = dst, n = 0;
- n + 1 < dst_sz && *src != '\0';
- ++p, ++src, ++n)
- *p = *src;
- *p = '\0';
- if (*src == '\0')
- return n;
- else
- return n + strlen (src);
-}
-
-#endif
-
-#ifndef HAVE_KERNEL_MEMCPY
-void *
-memcpy (void *s1, const void *s2, size_t n)
-{
- bcopy (s2, s1, n);
- return s1;
-}
-#endif
-
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_deb.c b/usr.sbin/afs/src/nnpfs/bsd/nnpfs_deb.c
deleted file mode 100644
index af9f33102ff..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_deb.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <nnpfs/nnpfs_deb.h>
-#include <nnpfs/nnpfs_debug.h>
-
-/* $arla: nnpfs_deb.c,v 1.15 2002/09/07 10:45:03 lha Exp $ */
-
-/* X is on */
-#define X(y) y
-/* and x is off */
-#define x(y) 0
-
-unsigned int nnpfsdeb = (0 |
- x(XDEBDEV) |
- x(XDEBMSG) |
- x(XDEBDNLC) |
- x(XDEBNODE) |
- x(XDEBVNOPS) |
- x(XDEBVFOPS) |
- x(XDEBLKM) |
- x(XDEBSYS) |
- x(XDEBMEM) |
- 0
-);
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_dev-bsd.c b/usr.sbin/afs/src/nnpfs/bsd/nnpfs_dev-bsd.c
deleted file mode 100644
index bed8a5f466d..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_dev-bsd.c
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Copyright (c) 1995 - 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <nnpfs/nnpfs_locl.h>
-#include <nnpfs/nnpfs_message.h>
-#include <nnpfs/nnpfs_msg_locl.h>
-#include <nnpfs/nnpfs_fs.h>
-#include <nnpfs/nnpfs_dev.h>
-#include <nnpfs/nnpfs_deb.h>
-
-RCSID("$arla: nnpfs_dev-bsd.c,v 1.35 2003/04/01 14:04:11 lha Exp $");
-
-int
-nnpfs_devopen(dev_t dev, int flag, int devtype, d_thread_t *proc)
-{
- NNPFSDEB(XDEBDEV, ("nnpfsopen dev = %d.%d, flag = %d, devtype = %d\n",
- major(dev), minor(dev), flag, devtype));
- return nnpfs_devopen_common(dev);
-}
-
-int
-nnpfs_devclose(dev_t dev, int flag, int devtype, d_thread_t *p)
-{
-#ifdef NNPFS_DEBUG
- char devname[64];
-#endif
-
- NNPFSDEB(XDEBDEV, ("nnpfs_devclose dev = %s, flag = 0x%x\n",
- nnpfs_devtoname_r(dev, devname, sizeof(devname)),
- flag));
- return nnpfs_devclose_common(dev, p);
-}
-
-/*
- * Not used.
- */
-
-int
-nnpfs_devioctl(dev_t dev,
- u_long cmd,
- caddr_t data,
- int flags,
- d_thread_t *p)
-{
- NNPFSDEB(XDEBDEV, ("nnpfs_devioctl dev = %d.%d, cmd = %lu, "
- "data = %lx, flags = %x\n",
- major(dev), minor(dev), (unsigned long)cmd,
- (unsigned long)data, flags));
- return ENOTTY;
-}
-
-static int
-nnpfs_realselect(dev_t dev, d_thread_t *p, void *wql)
-{
- struct nnpfs_channel *chan = &nnpfs_channel[minor(dev)];
-
- if (!nnpfs_emptyq(&chan->messageq))
- return 1; /* Something to read */
-
-#ifdef HAVE_THREE_ARGUMENT_SELRECORD
- selrecord (p, &chan->selinfo, wql);
-#else
- selrecord (p, &chan->selinfo);
-#endif
- return 0;
-}
-
-
-#ifdef HAVE_VOP_POLL
-static int
-nnpfs_devpoll(dev_t dev, int events, d_thread_t * p)
-{
-#ifdef NNPFS_DEBUG
- char devname[64];
-#endif
-
- NNPFSDEB(XDEBDEV, ("nnpfs_devpoll dev = %s, events = 0x%x\n",
- nnpfs_devtoname_r (dev, devname, sizeof(devname)),
- events));
-
- if (!(events & POLLRDNORM))
- return 0;
-
- return nnpfs_realselect(dev, p, NULL);
-}
-
-#endif
-
-#ifdef HAVE_VOP_SELECT
-#ifdef HAVE_THREE_ARGUMENT_SELRECORD
-int
-nnpfs_devselect(dev_t dev, int which, void *wql, struct proc * p)
-{
- NNPFSDEB(XDEBDEV, ("nnpfs_devselect dev = %d, which = %d\n", dev, which));
-
- if (which != FREAD)
- return 0;
-
- return nnpfs_realselect(dev, p, wql);
-}
-#else
-int
-nnpfs_devselect(dev_t dev, int which, d_thread_t * p)
-{
- NNPFSDEB(XDEBDEV, ("nnpfs_devselect dev = %d, which = %d\n", dev, which));
-
- if (which != FREAD)
- return 0;
-
- return nnpfs_realselect(dev, p, NULL);
-}
-#endif
-#endif
-
-void
-nnpfs_select_wakeup(struct nnpfs_channel *chan)
-{
- selwakeup (&chan->selinfo);
-}
-
-/*
- * Install and uninstall device.
- */
-
-#if defined(__NetBSD__)
-struct cdevsw nnpfs_dev = {
- nnpfs_devopen,
- nnpfs_devclose,
- nnpfs_devread,
- nnpfs_devwrite,
- nnpfs_devioctl,
- (dev_type_stop((*))) enodev,
- 0,
- nnpfs_devpoll,
- (dev_type_mmap((*))) enodev,
- 0
-};
-
-#elif defined(__OpenBSD__)
-struct cdevsw nnpfs_dev = {
- nnpfs_devopen,
- nnpfs_devclose,
- nnpfs_devread,
- nnpfs_devwrite,
- nnpfs_devioctl,
- (dev_type_stop((*))) enodev,
- 0,
- nnpfs_devselect,
- (dev_type_mmap((*))) enodev,
- 0
-};
-
-#elif defined(__FreeBSD__)
-struct cdevsw nnpfs_dev = {
- d_name: "nnpfs",
- d_open: nnpfs_devopen,
- d_close: nnpfs_devclose,
- d_read: nnpfs_devread,
- d_write: nnpfs_devwrite,
- d_ioctl: nnpfs_devioctl,
- d_mmap: nommap,
- d_strategy: nostrategy,
- d_flags: 0,
-#ifdef HAVE_STRUCT_CDEVSW_D_STOP
- d_stop: nostop,
-#endif
-#ifdef HAVE_STRUCT_CDEVSW_D_RESET
- d_reset: noreset,
-#endif
-#ifdef HAVE_STRUCT_CDEVSW_D_BOGORESET
- d_bogoreset: noreset,
-#endif
-#ifdef HAVE_STRUCT_CDEVSW_D_DEVTOTTY
- d_devtotty: nodevtotty,
-#endif
-#if defined(HAVE_VOP_SELECT)
- d_select: nnpfs_devselect,
-#elif defined(HAVE_VOP_POLL)
- d_poll: nnpfs_devpoll,
-#else
-#error select or poll: that is the question
-#endif
-#ifdef HAVE_STRUCT_CDEVSW_D_BOGOPARMS
- d_bogoparms: noparms,
-#endif
-#ifdef HAVE_STRUCT_CDEVSW_D_SPARE
- d_spare: NULL,
-#endif
- d_maj: 128, /* XXX */
- d_dump: nodump,
-#ifdef HAVE_STRUCT_CDEVSW_D_PSIZE
- d_psize: nopsize,
-#endif
-#ifdef HAVE_STRUCT_CDEVSW_D_MAXIO
- d_maxio: 0,
-#endif
-#ifdef HAVE_STRUCT_CDEVSW_D_BMAJ
-#ifdef NOUDEV
- d_bmaj: NOUDEV
-#else
- d_bmaj: NODEV
-#endif
-#endif /* HAVE_STRUCT_CDEVSW_D_BMAJ */
-};
-
-#elif defined(__APPLE__)
-static struct cdevsw nnpfs_dev = {
- nnpfs_devopen,
- nnpfs_devclose,
- nnpfs_devread,
- nnpfs_devwrite,
- nnpfs_devioctl,
- eno_stop,
- eno_reset,
- 0,
- nnpfs_devselect,
- eno_mmap,
- eno_strat,
- eno_getc,
- eno_putc,
- 0
-};
-#endif /* __APPLE__ */
-
-#if defined(__APPLE__)
-extern int nnpfs_dev_major;
-#include <miscfs/devfs/devfs.h>
-
-static void *devfs_handles[NNNPFS];
-
-#endif
-
-int
-nnpfs_install_device(void)
-{
- int i;
-
-#if defined(__APPLE__)
- nnpfs_dev_major = cdevsw_add(-1, &nnpfs_dev);
- if (nnpfs_dev_major == -1) {
- NNPFSDEB(XDEBDEV, ("failed installing cdev\n"));
- return ENFILE;
- }
-
- for (i = 0; i < NNNPFS; ++i)
- devfs_handles[i] = devfs_make_node(makedev(nnpfs_dev_major, i),
- DEVFS_CHAR,
- UID_ROOT, GID_WHEEL, 0600,
- "nnpfs%d", i);
-
- NNPFSDEB(XDEBDEV, ("done installing cdev !\n"));
- NNPFSDEB(XDEBDEV, ("Char device number %d\n", nnpfs_dev_major));
-#endif
-
- for (i = 0; i < NNNPFS; i++) {
- NNPFSDEB(XDEBDEV, ("before initq(messageq and sleepq)\n"));
- nnpfs_initq(&nnpfs_channel[i].messageq);
- nnpfs_initq(&nnpfs_channel[i].sleepq);
- nnpfs_channel[i].status = 0;
- }
- return 0;
-}
-
-int
-nnpfs_uninstall_device(void)
-{
- int i;
- struct nnpfs_channel *chan;
- int ret = 0;
-
- for (i = 0; i < NNNPFS; i++) {
- chan = &nnpfs_channel[i];
- if (chan->status & CHANNEL_OPENED)
- nnpfs_devclose(makedev(0, i), 0, 0, NULL);
- }
-
-#if defined(__APPLE__)
- for (i = 0; i < NNNPFS; ++i)
- devfs_remove (devfs_handles[i]);
-
- ret = cdevsw_remove(nnpfs_dev_major, &nnpfs_dev);
- if (ret == -1) {
- NNPFSDEB(XDEBLKM, ("nnpfs_uninstall_device error %d\n", ret));
- } else if (ret == nnpfs_dev_major) {
- ret = 0;
- } else {
- NNPFSDEB(XDEBLKM, ("nnpfs_uninstall_device unexpected error error %d\n",
- ret));
- }
-#endif
- NNPFSDEB(XDEBLKM, ("nnpfs_uninstall_device error %d\n", ret));
- return ret;
-}
-
-int
-nnpfs_stat_device(void)
-{
- return nnpfs_uprintf_device();
-}
-
-#if !defined(_LKM) && !defined(KLD_MODULE) && !defined(__APPLE__)
-int
-nnpfs_is_nnpfs_dev(dev_t dev)
-{
- return major(dev) <= nchrdev &&
- cdevsw[major(dev)].d_open == nnpfs_devopen &&
- minor(dev) >= 0 && minor(dev) < NNNPFS;
-}
-#endif
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_dev-common.c b/usr.sbin/afs/src/nnpfs/bsd/nnpfs_dev-common.c
deleted file mode 100644
index e1d90bf1cd1..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_dev-common.c
+++ /dev/null
@@ -1,736 +0,0 @@
-/*
- * Copyright (c) 1995 - 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-
-#include <nnpfs/nnpfs_locl.h>
-#include <nnpfs/nnpfs_message.h>
-#include <nnpfs/nnpfs_msg_locl.h>
-#include <nnpfs/nnpfs_fs.h>
-#include <nnpfs/nnpfs_dev.h>
-#include <nnpfs/nnpfs_deb.h>
-
-RCSID("$arla: nnpfs_dev-common.c,v 1.61 2003/07/15 16:25:42 lha Exp $");
-
-struct nnpfs_channel nnpfs_channel[NNNPFS];
-
-void
-nnpfs_initq(struct nnpfs_link *q)
-{
- q->next = q;
- q->prev = q;
-}
-
-/* Is this queue empty? */
-int
-nnpfs_emptyq(const struct nnpfs_link *q)
-{
- return q->next == q;
-}
-
-/* Is this link on any queue? Link *must* be inited! */
-int
-nnpfs_onq(const struct nnpfs_link *link)
-{
- return link->next != NULL || link->prev != NULL;
-}
-
-/* Append q with p */
-void
-nnpfs_appendq(struct nnpfs_link *q, struct nnpfs_link *p)
-{
- p->next = q;
- p->prev = q->prev;
- p->prev->next = p;
- q->prev = p;
-}
-
-/* remove `p' from its queue */
-void
-nnpfs_outq(struct nnpfs_link *p)
-{
- p->next->prev = p->prev;
- p->prev->next = p->next;
- p->next = p->prev = NULL;
-}
-
-/*
- * Only allow one open.
- */
-int
-nnpfs_devopen_common(dev_t dev)
-{
- struct nnpfs_channel *chan;
-
- if (minor(dev) < 0 || minor(dev) >= NNNPFS)
- return ENXIO;
-
- chan = &nnpfs_channel[minor(dev)];
-
- /* Only allow one reader/writer */
- if (chan->status & CHANNEL_OPENED) {
- NNPFSDEB(XDEBDEV, ("nnpfs_devopen: already open\n"));
- return EBUSY;
- } else {
- chan->status |= CHANNEL_OPENED;
- }
-
- chan->message_buffer = nnpfs_alloc(MAX_XMSG_SIZE, M_NNPFS_MSG);
-
- /* initalize the queues if they have not been initialized before */
- nnpfs_initq(&chan->sleepq);
- nnpfs_initq(&chan->messageq);
-
- return 0;
-}
-
-#if defined(HAVE_TWO_ARGUMENT_VFS_BUSY)
-#define nnpfs_vfs_busy(mp, flags, lock, proc) vfs_busy((mp), (flags))
-#define nnpfs_vfs_unbusy(mp, proc) vfs_unbusy((mp))
-#elif defined(HAVE_THREE_ARGUMENT_VFS_BUSY)
-#define nnpfs_vfs_busy(mp, flags, lock, proc) vfs_busy((mp), (flags), (lock))
-#define nnpfs_vfs_unbusy(mp, proc) vfs_unbusy((mp))
-#elif defined(HAVE_FOUR_ARGUMENT_VFS_BUSY)
-#define nnpfs_vfs_busy(mp, flags, lock, proc) vfs_busy((mp), (flags), (lock), (proc))
-#define nnpfs_vfs_unbusy(mp, proc) vfs_unbusy((mp), (proc))
-#elif defined(__osf__)
-#define nnpfs_vfs_busy(mp, flags, lock, proc) (0)
-#define nnpfs_vfs_unbusy(mp, proc) (0)
-#else
-#define nnpfs_vfs_busy(mp, flags, lock, proc) vfs_busy((mp))
-#define nnpfs_vfs_unbusy(mp, proc) vfs_unbusy((mp))
-#endif
-
-/*
- * Wakeup all sleepers and cleanup.
- */
-int
-nnpfs_devclose_common(dev_t dev, d_thread_t *proc)
-{
- struct nnpfs_channel *chan = &nnpfs_channel[minor(dev)];
- struct nnpfs_link *first;
-
- /* Sanity check, paranoia? */
- if (!(chan->status & CHANNEL_OPENED))
- panic("nnpfs_devclose never opened?");
-
- chan->status &= ~CHANNEL_OPENED;
-
- /* No one is going to read those messages so empty queue! */
- while (!nnpfs_emptyq(&chan->messageq)) {
- NNPFSDEB(XDEBDEV, ("before outq(messageq)\n"));
-
- first = chan->messageq.next;
- nnpfs_outq(first);
- if (first->error_or_size != 0)
- nnpfs_free(first, first->error_or_size, M_NNPFS_LINK);
-
- NNPFSDEB(XDEBDEV, ("after outq(messageq)\n"));
- }
-
- /* Wakeup those waiting for replies that will never arrive. */
- while (!nnpfs_emptyq(&chan->sleepq)) {
- NNPFSDEB(XDEBDEV, ("before outq(sleepq)\n"));
- first = chan->sleepq.next;
- nnpfs_outq(first);
- first->error_or_size = ENODEV;
- wakeup((caddr_t) first);
- NNPFSDEB(XDEBDEV, ("after outq(sleepq)\n"));
- }
-
- if (chan->status & CHANNEL_WAITING)
- wakeup((caddr_t) chan);
-
- if (chan->message_buffer) {
- nnpfs_free(chan->message_buffer, MAX_XMSG_SIZE, M_NNPFS_MSG);
- chan->message_buffer = NULL;
- }
-
- /*
- * Free all nnpfs nodes.
- */
-
- if (nnpfs[minor(dev)].mp != NULL) {
- if (nnpfs_vfs_busy(nnpfs[minor(dev)].mp, 0, NULL, proc)) {
- NNPFSDEB(XDEBNODE, ("nnpfs_dev_close: vfs_busy() --> BUSY\n"));
- return EBUSY;
- }
- free_all_nnpfs_nodes(&nnpfs[minor(dev)], FORCECLOSE, 0);
-
- nnpfs_vfs_unbusy(nnpfs[minor(dev)].mp, proc);
- }
-
- return 0;
-}
-
-#ifdef NNPFS_DEBUG
-/*
- * debugging glue for CURSIG
- */
-
-static long
-nnpfs_cursig (d_thread_t *p)
-{
-#if defined(__osf__)
- thread_t th = current_thread();
- struct np_uthread *npu = thread_to_np_uthread(th);
- return CURSIG(p,npu);
-#elif defined(HAVE_FREEBSD_THREAD)
-#ifndef CURSIG
- return 0; /* XXX we would like to use sig_ffs, but that isn't
- * exported */
-#else
- return CURSIG(p->td_proc);
-#endif
-#else
-#if defined(__NetBSD__) && __NetBSD_Version__ >= 106130000
- return 0; /* XXX CURSIG operates on a struct lwp */
-#else
- return CURSIG(p);
-#endif
-#endif
-}
-#endif
-
-/*
- * Move messages from kernel to user space.
- */
-
-int
-nnpfs_devread(dev_t dev, struct uio * uiop, int ioflag)
-{
- struct nnpfs_channel *chan = &nnpfs_channel[minor(dev)];
- struct nnpfs_link *first;
- int error = 0;
-#ifdef NNPFS_DEBUG
- char devname[64];
-#endif
-
- NNPFSDEB(XDEBDEV, ("nnpfs_devread dev = %s\n",
- nnpfs_devtoname_r(dev, devname, sizeof(devname))));
-
- NNPFSDEB(XDEBDEV, ("nnpfs_devread: m = %lx, m->prev = %lx, m->next = %lx\n",
- (unsigned long)&chan->messageq,
- (unsigned long)chan->messageq.prev,
- (unsigned long)chan->messageq.next));
-
-#ifdef HAVE_FREEBSD_THREAD
- chan->proc = nnpfs_uio_to_thread(uiop);
-#else
- chan->proc = nnpfs_uio_to_proc(uiop);
-#endif
-
- again:
-
- if (!nnpfs_emptyq (&chan->messageq)) {
- while (!nnpfs_emptyq (&chan->messageq)) {
- /* Remove message */
- first = chan->messageq.next;
- NNPFSDEB(XDEBDEV, ("nnpfs_devread: first = %lx, "
- "first->prev = %lx, first->next = %lx\n",
- (unsigned long)first,
- (unsigned long)first->prev,
- (unsigned long)first->next));
-
- NNPFSDEB(XDEBDEV, ("nnpfs_devread: message->size = %u\n",
- first->message->size));
-
- if (first->message->size > uiop->uio_resid)
- break;
-
- error = uiomove((caddr_t) first->message, first->message->size,
- uiop);
- if (error)
- break;
-
- nnpfs_outq(first);
-
- if (first->error_or_size != 0)
- nnpfs_free(first, first->error_or_size, M_NNPFS_LINK);
- }
- } else {
- chan->status |= CHANNEL_WAITING;
- if (tsleep((caddr_t) chan, (PZERO + 1) | PCATCH, "nnpfsread", 0)) {
-#ifdef HAVE_FREEBSD_THREAD
- NNPFSDEB(XDEBMSG,
- ("caught signal nnpfs_devread: %ld\n",
- nnpfs_cursig(nnpfs_uio_to_thread(uiop))));
-#else
- NNPFSDEB(XDEBMSG,
- ("caught signal nnpfs_devread: %ld\n",
- nnpfs_cursig(nnpfs_uio_to_proc(uiop))));
-#endif
- error = EINTR;
- } else if ((chan->status & CHANNEL_WAITING) == 0) {
- goto again;
- } else
- error = EIO;
- }
-
- NNPFSDEB(XDEBDEV, ("nnpfs_devread done error = %d\n", error));
-
- return error;
-}
-
-/*
- * Move messages from user space to kernel space,
- * wakeup sleepers, insert new data in VFS.
- */
-int
-nnpfs_devwrite(dev_t dev, struct uio *uiop, int ioflag)
-{
- struct nnpfs_channel *chan = &nnpfs_channel[minor(dev)];
- char *p;
- int error;
- u_int cnt;
- struct nnpfs_message_header *msg_buf;
-#ifdef NNPFS_DEBUG
- char devname[64];
-#endif
-
- NNPFSDEB(XDEBDEV, ("nnpfs_devwrite dev = %s\n",
- nnpfs_devtoname_r (dev, devname, sizeof(devname))));
-
-#ifdef HAVE_FREEBSD_THREAD
- chan->proc = nnpfs_uio_to_thread(uiop);
-#else
- chan->proc = nnpfs_uio_to_proc(uiop);
-#endif
- cnt = uiop->uio_resid;
- error = uiomove((caddr_t) chan->message_buffer, MAX_XMSG_SIZE, uiop);
- if (error != 0)
- return error;
-
- cnt -= uiop->uio_resid;
-
- /*
- * This thread handles the received message.
- */
- for (p = (char *)chan->message_buffer;
- cnt > 0;
- p += msg_buf->size, cnt -= msg_buf->size) {
-#ifdef HAVE_FREEBSD_THREAD
- d_thread_t *pp = nnpfs_uio_to_thread(uiop);
-#else
- d_thread_t *pp = nnpfs_uio_to_proc(uiop);
-#endif
-
- msg_buf = (struct nnpfs_message_header *)p;
- error = nnpfs_message_receive (minor(dev),
- msg_buf,
- msg_buf->size,
- pp);
- }
- NNPFSDEB(XDEBDEV, ("nnpfs_devwrite error = %d\n", error));
- return error;
-}
-
-/*
- * Send a message to user space.
- */
-int
-nnpfs_message_send(int fd, struct nnpfs_message_header * message, u_int size)
-{
- struct nnpfs_channel *chan = &nnpfs_channel[fd];
- struct {
- struct nnpfs_link this_message;
- struct nnpfs_message_header msg;
- } *t;
-
- NNPFSDEB(XDEBMSG, ("nnpfs_message_send opcode = %d\n", message->opcode));
-
- if (!(chan->status & CHANNEL_OPENED)) /* No receiver? */
- return ENODEV;
-
- /* Prepare message and copy it later */
- message->size = size;
- message->sequence_num = chan->nsequence++;
-
- t = nnpfs_alloc(sizeof(t->this_message) + size, M_NNPFS);
- t->this_message.error_or_size = sizeof(t->this_message) + size;
- bcopy(message, &t->msg, size);
-
- t->this_message.message = &t->msg;
- nnpfs_appendq(&chan->messageq, &t->this_message);
- if (chan->status & CHANNEL_WAITING) {
- chan->status &= ~CHANNEL_WAITING;
- wakeup((caddr_t) chan);
- }
- nnpfs_select_wakeup(chan);
-
- return 0;
-}
-
-#if defined(SWEXIT)
-#define NNPFS_P_EXIT SWEXIT
-#elif defined(P_WEXIT)
-#define NNPFS_P_EXIT P_WEXIT
-#else
-#error what is your exit named ?
-#endif
-
-#if defined(HAVE_STRUCT_PROC_P_SIGMASK) || defined(HAVE_STRUCT_PROC_P_SIGCTX) || defined(HAVE_STRUCT_PROC_P_SIGWAITMASK) || defined(__osf__) || defined(HAVE_FREEBSD_THREAD)
-static void
-nnpfs_block_sigset (sigset_t *sigset)
-{
-
-#if defined(__sigaddset)
-#define nnpfs_sig_block(ss,signo) __sigaddset((ss), (signo))
-#elif defined(SIGADDSET)
-#define nnpfs_sig_block(ss,signo) SIGADDSET(*(ss), (signo))
-#else
-#define nnpfs_sig_block(ss,signo) *(ss) |= sigmask(signo)
-#endif
-
- nnpfs_sig_block(sigset, SIGIO);
- nnpfs_sig_block(sigset, SIGALRM);
- nnpfs_sig_block(sigset, SIGVTALRM);
- nnpfs_sig_block(sigset, SIGCHLD);
-#ifdef SIGINFO
- nnpfs_sig_block(sigset, SIGINFO);
-#endif
-#undef nnpfs_sig_block
-}
-#endif
-
-/*
- * Send a message to user space and wait for reply.
- */
-
-int
-nnpfs_message_rpc(int fd, struct nnpfs_message_header * message, u_int size,
- d_thread_t *proc)
-{
- int ret;
- struct nnpfs_channel *chan = &nnpfs_channel[fd];
- struct nnpfs_link *this_message;
- struct nnpfs_link *this_process;
- struct nnpfs_message_header *msg;
-#if defined(HAVE_STRUCT_PROC_P_SIGMASK) || defined(HAVE_STRUCT_PROC_P_SIGCTX) || defined(__osf__) || defined(HAVE_FREEBSD_THREAD)
- sigset_t oldsigmask;
-#endif
- int catch;
-
- NNPFSDEB(XDEBMSG, ("nnpfs_message_rpc opcode = %d\n", message->opcode));
-
- if (proc == NULL) {
-#ifdef HAVE_FREEBSD_THREAD
- proc = nnpfs_curthread();
-#else
- proc = nnpfs_curproc();
-#endif
- }
- if (!(chan->status & CHANNEL_OPENED)) /* No receiver? */
- return ENODEV;
-
-#ifdef HAVE_FREEBSD_THREAD
- if (chan->proc != NULL && chan->proc->td_proc != NULL &&
- proc->td_proc->p_pid == chan->proc->td_proc->p_pid) {
- printf("nnpfs_message_rpc: deadlock avoided "
- "pid = %u == %u\n", proc->td_proc->p_pid, chan->proc->td_proc->p_pid);
-#else
- if (chan->proc != NULL && proc->p_pid == chan->proc->p_pid) {
- printf("nnpfs_message_rpc: deadlock avoided "
- "pid = %u == %u\n", proc->p_pid, chan->proc->p_pid);
-#endif
-#if 0
- psignal (proc, SIGABRT);
-#endif
- return EDEADLK;
- }
-
- if (size < sizeof(struct nnpfs_message_wakeup)) {
- printf("NNPFS PANIC Error: Message to small to receive wakeup, opcode = %d\n", message->opcode);
- return ENOMEM;
- }
- this_message = nnpfs_alloc(sizeof(struct nnpfs_link), M_NNPFS_LINK);
- this_process = nnpfs_alloc(sizeof(struct nnpfs_link), M_NNPFS_LINK);
- msg = nnpfs_alloc(size, M_NNPFS_MSG);
- bcopy(message, msg, size);
-
- msg->size = size;
- msg->sequence_num = chan->nsequence++;
- this_message->error_or_size = 0;
- this_message->message = msg;
- this_process->message = msg;
- nnpfs_appendq(&chan->messageq, this_message);
- nnpfs_appendq(&chan->sleepq, this_process);
- nnpfs_select_wakeup(chan);
- this_process->error_or_size = 0;
-
- if (chan->status & CHANNEL_WAITING) {
- chan->status &= ~CHANNEL_WAITING;
- wakeup((caddr_t) chan);
- }
-
- /*
- * Remove signals from the sigmask so no IO will wake us up from
- * tsleep(). We don't want to wake up from since program (emacs,
- * bash & co can't handle them.
- */
-
-#ifdef HAVE_FREEBSD_THREAD
- /* FreeBSD 5.1 */
- oldsigmask = proc->td_sigmask;
- nnpfs_block_sigset (&proc->td_sigmask);
-#elif HAVE_STRUCT_PROC_P_SIGMASK
- /* NetBSD 1.5, Darwin 1.3, FreeBSD 4.3, 5.0, OpenBSD 2.8 */
- oldsigmask = proc->p_sigmask;
- nnpfs_block_sigset (&proc->p_sigmask);
-#elif defined(HAVE_STRUCT_PROC_P_SIGCTX)
- /* NetBSD 1.6 */
- oldsigmask = proc->p_sigctx.ps_sigmask;
- nnpfs_block_sigset (&proc->p_sigctx.ps_sigmask);
-#elif defined(HAVE_STRUCT_PROC_P_SIGWAITMASK)
- /* OSF 4.0 */
- oldsigmask = proc->p_sigwaitmask;
- nnpfs_block_sigset (&proc->p_sigwaitmask);
-#elif defined(__osf__)
- /* OSF 5.0 */
- oldsigmask = u.u_sigmask;
- nnpfs_block_sigset (&u.u_sigmask);
-#endif
-
- /*
- * if we are exiting we should not try to catch signals, since
- * there might not be enough context left in the process to handle
- * signal delivery, and besides, most BSD-variants ignore all
- * signals while closing anyway.
- */
-
- catch = 0;
-#ifdef HAVE_FREEBSD_THREAD
- if (!(proc->td_proc->p_flag & NNPFS_P_EXIT))
-#else
- if (!(proc->p_flag & NNPFS_P_EXIT))
-#endif
- catch |= PCATCH;
-
- /*
- * We have to check if we have a receiver here too because the
- * daemon could have terminated before we sleep. This seems to
- * happen sometimes when rebooting. */
-
- if (!(chan->status & CHANNEL_OPENED)) {
- NNPFSDEB(XDEBMSG, ("nnpfs_message_rpc: channel went away\n"));
- this_process->error_or_size = EINTR;
- } else if ((ret = tsleep((caddr_t) this_process,
- (PZERO + 1) | catch, "nnpfs", 0)) != 0) {
- NNPFSDEB(XDEBMSG, ("caught signal (%d): %ld\n",
- ret, nnpfs_cursig(proc)));
- this_process->error_or_size = EINTR;
- }
-
-#ifdef HAVE_FREEBSD_THREAD
- proc->td_sigmask = oldsigmask;
-#elif HAVE_STRUCT_PROC_P_SIGMASK
- proc->p_sigmask = oldsigmask;
-#elif defined(HAVE_STRUCT_PROC_P_SIGCTX)
- proc->p_sigctx.ps_sigmask = oldsigmask;
-#elif defined(HAVE_STRUCT_PROC_P_SIGWAITMASK)
- proc->p_sigwaitmask = oldsigmask;
-#elif defined(__osf__)
- u.u_sigmask = oldsigmask;
-#endif
-
- /*
- * Caught signal, got reply message or device was closed.
- * Need to clean up both messageq and sleepq.
- */
- if (nnpfs_onq(this_message)) {
- nnpfs_outq(this_message);
- }
- if (nnpfs_onq(this_process)) {
- nnpfs_outq(this_process);
- }
- ret = this_process->error_or_size;
-
- NNPFSDEB(XDEBMSG, ("nnpfs_message_rpc this_process->error_or_size = %d\n",
- this_process->error_or_size));
- NNPFSDEB(XDEBMSG, ("nnpfs_message_rpc opcode ((nnpfs_message_wakeup*)(this_process->message))->error = %d\n", ((struct nnpfs_message_wakeup *) (this_process->message))->error));
-
- bcopy(msg, message, size);
-
- nnpfs_free(this_message, sizeof(*this_message), M_NNPFS_LINK);
- nnpfs_free(this_process, sizeof(*this_process), M_NNPFS_LINK);
- nnpfs_free(msg, size, M_NNPFS_MSG);
-
- return ret;
-}
-
-/*
- * For each message type there is a message handler
- * that implements its action, nnpfs_message_receive
- * invokes the correct function.
- */
-int
-nnpfs_message_receive(int fd,
- struct nnpfs_message_header *message,
- u_int size,
- d_thread_t *p)
-{
- NNPFSDEB(XDEBMSG, ("nnpfs_message_receive opcode = %d\n", message->opcode));
-
- /* Dispatch and coerce message type */
- switch (message->opcode) {
- case NNPFS_MSG_WAKEUP:
- return nnpfs_message_wakeup(fd,
- (struct nnpfs_message_wakeup *) message,
- message->size,
- p);
- case NNPFS_MSG_WAKEUP_DATA:
- return nnpfs_message_wakeup_data(fd,
- (struct nnpfs_message_wakeup_data *) message,
- message->size,
- p);
- case NNPFS_MSG_INSTALLROOT:
- return nnpfs_message_installroot(fd,
- (struct nnpfs_message_installroot *) message,
- message->size,
- p);
- case NNPFS_MSG_INSTALLNODE:
- return nnpfs_message_installnode(fd,
- (struct nnpfs_message_installnode *) message,
- message->size,
- p);
- case NNPFS_MSG_INSTALLATTR:
- return nnpfs_message_installattr(fd,
- (struct nnpfs_message_installattr *) message,
- message->size,
- p);
- case NNPFS_MSG_INSTALLDATA:
- return nnpfs_message_installdata(fd,
- (struct nnpfs_message_installdata *) message,
- message->size,
- p);
- case NNPFS_MSG_INVALIDNODE:
- return nnpfs_message_invalidnode(fd,
- (struct nnpfs_message_invalidnode *) message,
- message->size,
- p);
- case NNPFS_MSG_UPDATEFID:
- return nnpfs_message_updatefid(fd,
- (struct nnpfs_message_updatefid *)message,
- message->size,
- p);
- case NNPFS_MSG_GC_NODES:
- return nnpfs_message_gc_nodes(fd,
- (struct nnpfs_message_gc_nodes *)message,
- message->size,
- p);
- case NNPFS_MSG_VERSION:
- return nnpfs_message_version(fd,
- (struct nnpfs_message_version *)message,
- message->size,
- p);
- default:
- printf("NNPFS PANIC Warning nnpfs_dev: Unknown message opcode == %d\n",
- message->opcode);
- return EINVAL;
- }
-}
-
-int
-nnpfs_message_wakeup(int fd,
- struct nnpfs_message_wakeup *message,
- u_int size,
- d_thread_t *p)
-{
- struct nnpfs_channel *chan = &nnpfs_channel[fd];
- struct nnpfs_link *sleepq = &chan->sleepq;
- struct nnpfs_link *t = chan->sleepq.next; /* Really first in q */
-
- NNPFSDEB(XDEBMSG, ("nnpfs_message_wakeup error: %d\n", message->error));
-
- for (; t != sleepq; t = t->next)
- if (t->message->sequence_num == message->sleepers_sequence_num) {
- if (t->message->size < size) {
- printf("NNPFS PANIC Error: Could not wakeup requestor with opcode = %d properly, to small receive buffer.\n", t->message->opcode);
- t->error_or_size = ENOMEM;
- } else
- bcopy(message, t->message, size);
-
- wakeup((caddr_t) t);
- break;
- }
-
- return 0;
-}
-
-int
-nnpfs_message_wakeup_data(int fd,
- struct nnpfs_message_wakeup_data * message,
- u_int size,
- d_thread_t *p)
-{
- struct nnpfs_channel *chan = &nnpfs_channel[fd];
- struct nnpfs_link *sleepq = &chan->sleepq;
- struct nnpfs_link *t = chan->sleepq.next; /* Really first in q */
-
- NNPFSDEB(XDEBMSG, ("nnpfs_message_wakeup_data error: %d\n", message->error));
-
- for (; t != sleepq; t = t->next)
- if (t->message->sequence_num == message->sleepers_sequence_num) {
- if (t->message->size < size) {
- printf("NNPFS PANIC Error: Could not wakeup requestor with opcode = %d properly, to small receive buffer.\n", t->message->opcode);
- t->error_or_size = ENOMEM;
- } else
- bcopy(message, t->message, size);
- wakeup((caddr_t) t);
- break;
- }
- return 0;
-}
-
-/*
- *
- */
-int
-nnpfs_uprintf_device(void)
-{
-#if 0
- int i;
-
- for (i = 0; i < NNNPFS; i++) {
- uprintf("nnpfs_channel[%d] = {\n", i);
- uprintf("messageq.next = %lx ", nnpfs_channel[i].messageq.next);
- uprintf("messageq.prev = %lx ", nnpfs_channel[i].messageq.prev);
- uprintf("sleepq.next = %lx ", nnpfs_channel[i].sleepq.next);
- uprintf("sleepq.prev = %lx ", nnpfs_channel[i].sleepq.prev);
- uprintf("nsequence = %d status = %d\n",
- nnpfs_channel[i].nsequence,
- nnpfs_channel[i].status);
- uprintf("}\n");
- }
-#endif
- return 0;
-}
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_info.c b/usr.sbin/afs/src/nnpfs/bsd/nnpfs_info.c
deleted file mode 100644
index 03f3059a0db..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_info.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <nnpfs/nnpfs_locl.h>
-#include <mach/mach_types.h>
-#include <mach/kmod.h>
-#include <nnpfs/nnpfs_wrap.h>
-
-RCSID("$arla: nnpfs_info.c,v 1.3 2002/09/07 10:45:08 lha Exp $");
-
-KMOD_EXPLICIT_DECL(nnpfs, VERSION, nnpfs_modload, nnpfs_modunload)
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_message.c b/usr.sbin/afs/src/nnpfs/bsd/nnpfs_message.c
deleted file mode 100644
index 8a87bfde3d3..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_message.c
+++ /dev/null
@@ -1,526 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <nnpfs/nnpfs_locl.h>
-#include <nnpfs/nnpfs_deb.h>
-#include <nnpfs/nnpfs_fs.h>
-#include <nnpfs/nnpfs_message.h>
-#include <nnpfs/nnpfs_msg_locl.h>
-#include <nnpfs/nnpfs_syscalls.h>
-#include <nnpfs/nnpfs_vfsops.h>
-#include <nnpfs/nnpfs_vnodeops.h>
-#include <nnpfs/nnpfs_dev.h>
-
-RCSID("$arla: nnpfs_message.c,v 1.84 2003/06/02 18:25:20 lha Exp $");
-
-static void
-send_inactive_node(int fd, nnpfs_handle *handle)
-{
- struct nnpfs_message_inactivenode msg;
-
- msg.header.opcode = NNPFS_MSG_INACTIVENODE;
- msg.handle = *handle;
- msg.flag = NNPFS_NOREFS | NNPFS_DELETE;
- nnpfs_message_send(fd, &msg.header, sizeof(msg));
-}
-
-
-
-int
-nnpfs_message_installroot(int fd,
- struct nnpfs_message_installroot * message,
- u_int size,
- d_thread_t *p)
-{
- int error = 0;
-
- NNPFSDEB(XDEBMSG, ("nnpfs_message_installroot (%d,%d,%d,%d)\n",
- message->node.handle.a,
- message->node.handle.b,
- message->node.handle.c,
- message->node.handle.d));
-
- if (nnpfs[fd].root != NULL) {
- printf("NNPFS PANIC WARNING! nnpfs_message_installroot: called again!\n");
- error = EBUSY;
- } else {
- error = new_nnpfs_node(&nnpfs[fd], &message->node, &nnpfs[fd].root, p);
- if (error)
- return error;
- NNPFS_MAKE_VROOT(nnpfs[fd].root->vn);
- }
- return error;
-}
-
-int
-nnpfs_message_installnode(int fd,
- struct nnpfs_message_installnode * message,
- u_int size,
- d_thread_t *p)
-{
- int error = 0;
- struct nnpfs_node *n, *dp;
-
- NNPFSDEB(XDEBMSG, ("nnpfs_message_installnode (%d,%d,%d,%d)\n",
- message->node.handle.a,
- message->node.handle.b,
- message->node.handle.c,
- message->node.handle.d));
-
-retry:
- dp = nnpfs_node_find(&nnpfs[fd].nodehead, &message->parent_handle);
- if (dp) {
- struct vnode *t_vnode = XNODE_TO_VNODE(dp);
-
- NNPFSDEB(XDEBMSG, ("nnpfs_message_installnode: t_vnode = %lx\n",
- (unsigned long)t_vnode));
-
- if (nnpfs_do_vget(t_vnode, 0 /* LK_SHARED */, p))
- goto retry;
-
- error = new_nnpfs_node(&nnpfs[fd], &message->node, &n, p);
- if (error) {
- vrele (t_vnode);
- return error;
- }
-
- nnpfs_dnlc_enter_name(t_vnode,
- message->name,
- XNODE_TO_VNODE(n));
- vrele (XNODE_TO_VNODE(n));
- vrele (t_vnode);
- } else {
- printf("NNPFS PANIC WARNING! nnpfs_message_installnode: no parent\n");
- error = ENOENT;
- }
- NNPFSDEB(XDEBMSG, ("return: nnpfs_message_installnode: %d\n", error));
-
- return error;
-}
-
-int
-nnpfs_message_installattr(int fd,
- struct nnpfs_message_installattr * message,
- u_int size,
- d_thread_t *p)
-{
- int error = 0;
- struct nnpfs_node *t;
-
- NNPFSDEB(XDEBMSG, ("nnpfs_message_installattr (%d,%d,%d,%d) \n",
- message->node.handle.a,
- message->node.handle.b,
- message->node.handle.c,
- message->node.handle.d));
-
- t = nnpfs_node_find(&nnpfs[fd].nodehead, &message->node.handle);
- if (t != 0) {
- t->tokens = message->node.tokens;
- if ((t->tokens & NNPFS_DATA_MASK) && DATA_FROM_XNODE(t) == NULL) {
- printf ("nnpfs_message_installattr: tokens and no data\n");
- t->tokens &= ~NNPFS_DATA_MASK;
- }
- nnpfs_attr2vattr(&message->node.attr, &t->attr, 0);
- if ((t->flags & NNPFS_VMOPEN) == 0)
- nnpfs_set_vp_size(XNODE_TO_VNODE(t), t->attr.va_size);
- bcopy(message->node.id, t->id, sizeof(t->id));
- bcopy(message->node.rights, t->rights, sizeof(t->rights));
- t->anonrights = message->node.anonrights;
- } else {
- NNPFSDEB(XDEBMSG, ("nnpfs_message_installattr: no such node\n"));
- }
-
- return error;
-}
-
-int
-nnpfs_message_installdata(int fd,
- struct nnpfs_message_installdata * message,
- u_int size,
- d_thread_t *p)
-{
- struct nnpfs_node *t;
- int error = 0;
-
- NNPFSDEB(XDEBMSG, ("nnpfs_message_installdata (%d,%d,%d,%d)\n",
- message->node.handle.a,
- message->node.handle.b,
- message->node.handle.c,
- message->node.handle.d));
-
-retry:
- t = nnpfs_node_find(&nnpfs[fd].nodehead, &message->node.handle);
- if (t != NULL) {
- struct nnpfs_fhandle_t *fh =
- (struct nnpfs_fhandle_t *)&message->cache_handle;
- struct vnode *t_vnode = XNODE_TO_VNODE(t);
- struct vnode *vp;
-
- message->cache_name[sizeof(message->cache_name)-1] = '\0';
- NNPFSDEB(XDEBMSG, ("cache_name = '%s'\n", message->cache_name));
-
- if (nnpfs_do_vget(t_vnode, 0 /* LK_SHARED */, p))
- goto retry;
-
- if (message->flag & NNPFS_ID_HANDLE_VALID) {
- error = nnpfs_fhlookup (p, fh, &vp);
- } else {
- error = EINVAL;
- }
- if (error != 0) {
-#ifdef __osf__
- struct nameidata *ndp = &u.u_nd;
-#else
- struct nameidata nd;
- struct nameidata *ndp = &nd;
-#endif
-
- NNPFSDEB(XDEBMSG,
- ("nnpfs_message_installdata: fhlookup failed: %d, "
- "opening by name\n", error));
-
- NDINIT(ndp, LOOKUP, FOLLOW | NNPFS_LOCKLEAF, UIO_SYSSPACE,
- message->cache_name, p);
- error = namei(ndp);
- vp = ndp->ni_vp;
- }
-
- if (error == 0) {
-#ifndef __osf__
- nnpfs_vfs_unlock(vp, p);
-#endif
- if (DATA_FROM_XNODE(t))
- vrele(DATA_FROM_XNODE(t));
- DATA_FROM_XNODE(t) = vp;
-
- NNPFSDEB(XDEBMSG, ("nnpfs_message_installdata: t = %lx;"
- " tokens = %x\n",
- (unsigned long)t, message->node.tokens));
-
- t->tokens = message->node.tokens;
- nnpfs_attr2vattr(&message->node.attr, &t->attr, 1);
- if ((t->flags & NNPFS_VMOPEN) == 0)
- nnpfs_set_vp_size(XNODE_TO_VNODE(t), t->attr.va_size);
- if (XNODE_TO_VNODE(t)->v_type == VDIR
- && (message->flag & NNPFS_ID_INVALID_DNLC))
- nnpfs_dnlc_purge (XNODE_TO_VNODE(t));
- bcopy(message->node.id, t->id, sizeof(t->id));
- bcopy(message->node.rights, t->rights, sizeof(t->rights));
- t->anonrights = message->node.anonrights;
- t->offset = message->offset;
-#if 0
- if (message->flag & NNPFS_ID_AFSDIR)
- t->flags |= NNPFS_AFSDIR;
-#endif
- } else {
- printf("NNPFS PANIC WARNING! nnpfs_message_installdata failed!\n");
- printf("Reason: lookup failed on cache file '%s', error = %d\n",
- message->cache_name, error);
- }
- vrele (t_vnode);
- } else {
- printf("NNPFS PANIC WARNING! nnpfs_message_installdata failed\n");
- printf("Reason: No node to install the data into!\n");
- error = ENOENT;
- }
-
- return error;
-}
-
-#ifdef __osf__
-#define nnpfs_writecount v_wrcnt
-#else
-#define nnpfs_writecount v_writecount
-#endif
-
-int
-nnpfs_message_invalidnode(int fd,
- struct nnpfs_message_invalidnode * message,
- u_int size,
- d_thread_t *p)
-{
- int error = 0;
- struct nnpfs_node *t;
-
- NNPFSDEB(XDEBMSG, ("nnpfs_message_invalidnode (%d,%d,%d,%d)\n",
- message->handle.a,
- message->handle.b,
- message->handle.c,
- message->handle.d));
-
-#ifdef __APPLE__
- retry:
-#endif
- t = nnpfs_node_find(&nnpfs[fd].nodehead, &message->handle);
- if (t != 0) {
- struct vnode *vp = XNODE_TO_VNODE(t);
-
- /* If open for writing, return immediately. Last close:er wins! */
- if (vp->v_usecount >= 0 && vp->nnpfs_writecount >= 1)
- return 0;
-
-#ifdef __FreeBSD__
- {
- vm_object_t obj = vp->v_object;
-
- if (obj != NULL
- && (obj->ref_count != 0
-#ifdef OBJ_MIGHTBEDIRTY
- || (obj->flags & OBJ_MIGHTBEDIRTY) != 0
-#endif
- ))
- return 0;
-
- }
-#endif /* __FreeBSD__ */
-
- /* If node is in use, mark as stale */
- if (vp->v_usecount > 0 && vp->v_type != VDIR) {
-#ifdef __APPLE__
- if (vget(vp, 0, p))
- goto retry;
-
- if (UBCISVALID(vp) && !ubc_isinuse(vp, 1)) {
- ubc_setsize(vp, 0);
- vrele(vp);
- } else {
- vrele(vp);
- t->flags |= NNPFS_STALE;
- return 0;
- }
-#else
- t->flags |= NNPFS_STALE;
- return 0;
-#endif
- }
-
- if (DATA_FROM_XNODE(t)) {
- vrele(DATA_FROM_XNODE(t));
- DATA_FROM_XNODE(t) = (struct vnode *) 0;
- }
- NNPFS_TOKEN_CLEAR(t, ~0,
- NNPFS_OPEN_MASK | NNPFS_ATTR_MASK |
- NNPFS_DATA_MASK | NNPFS_LOCK_MASK);
- /* Dir changed, must invalidate DNLC. */
- if (vp->v_type == VDIR)
- nnpfs_dnlc_purge(vp);
- if (vp->v_usecount == 0) {
-#ifndef __osf__
- NNPFSDEB(XDEBVNOPS, ("nnpfs_message_invalidnode: vrecycle\n"));
- vrecycle(vp, p);
-#else
- /* XXX */
-#endif /* __osf__ */
- }
- } else {
- NNPFSDEB(XDEBMSG, ("nnpfs_message_invalidnode: no such node\n"));
- send_inactive_node(fd, &message->handle);
- error = ENOENT;
- }
-
- return error;
-}
-
-int
-nnpfs_message_updatefid(int fd,
- struct nnpfs_message_updatefid * message,
- u_int size,
- d_thread_t *p)
-{
- int error = 0;
- struct nnpfs_node *t;
-
- NNPFSDEB(XDEBMSG, ("nnpfs_message_updatefid (%d,%d,%d,%d) (%d,%d,%d,%d)\n",
- message->old_handle.a,
- message->old_handle.b,
- message->old_handle.c,
- message->old_handle.d,
- message->new_handle.a,
- message->new_handle.b,
- message->new_handle.c,
- message->new_handle.d));
-
- error = nnpfs_update_handle(&nnpfs[fd].nodehead,
- &message->old_handle,
- &message->new_handle);
- if (error)
- printf ("NNPFS PANIC WARNING! nnpfs_message_updatefid: %d\n", error);
- return error;
-}
-
-#if __osf__
-
-/*
- * Try to clean out nodes for the userland daemon
- */
-
-static void
-gc_vnode (struct vnode *vp,
- d_thread_t *p)
-{
- /* This node is on the freelist */
- if (vp->v_usecount <= 0) {
-
- /* DIAGNOSTIC */
- if (vp->v_usecount < 0) {
- vprint("vrele: bad ref count", vp);
- panic("vrele: ref cnt");
- }
-
- NNPFSDEB(XDEBMSG, ("nnpfs_message_gc: success\n"));
-
- vgone(vp, VX_NOSLEEP, NULL);
- } else {
- NNPFSDEB(XDEBMSG, ("nnpfs_message_gc: used\n"));
- }
-
-}
-
-
-#else /* !__osf__ */
-
-/*
- * Try to clean out nodes for the userland daemon
- */
-
-static void
-gc_vnode (struct vnode *vp,
- d_thread_t *p)
-{
-#ifdef HAVE_SYS_MUTEX_H
- mtx_lock(&vp->v_interlock);
-#else
- simple_lock(&vp->v_interlock);
-#endif
-
- /* This node is on the freelist */
- if (vp->v_usecount <= 0) {
-#if __FreeBSD__
- vm_object_t obj;
-
- obj = vp->v_object;
-
- if (obj != NULL
- && (obj->ref_count != 0
-#ifdef OBJ_MIGHTBEDIRTY
- || (obj->flags & OBJ_MIGHTBEDIRTY) != 0
-#endif
- )) {
-#ifdef HAVE_SYS_MUTEX_H
- mtx_unlock(&vp->v_interlock);
-#else
- simple_unlock (&vp->v_interlock);
-#endif
- return;
- }
-#endif /* __FreeBSD__ */
-
- /* DIAGNOSTIC */
- if (vp->v_usecount < 0 || vp->v_writecount != 0) {
- vprint("vrele: bad ref count", vp);
- panic("vrele: ref cnt");
- }
-
- NNPFSDEB(XDEBMSG, ("nnpfs_message_gc: success\n"));
-
-#ifdef HAVE_KERNEL_VGONEL
- vgonel (vp, p);
-#else
-#ifdef HAVE_SYS_MUTEX_H
- mtx_unlock(&vp->v_interlock);
-#else
- simple_unlock(&vp->v_interlock);
-#endif
- vgone (vp);
-#endif
-
- } else {
-#ifdef HAVE_SYS_MUTEX_H
- mtx_unlock(&vp->v_interlock);
-#else
- simple_unlock(&vp->v_interlock);
-#endif
- NNPFSDEB(XDEBMSG, ("nnpfs_message_gc: used\n"));
- }
-
-}
-
-#endif
-
-int
-nnpfs_message_gc_nodes(int fd,
- struct nnpfs_message_gc_nodes *message,
- u_int size,
- d_thread_t *p)
-{
- struct nnpfs_node *node;
- int i;
-
- NNPFSDEB(XDEBMSG, ("nnpfs_message_gc\n"));
-
- for (i = 0; i < message->len; i++) {
- node = nnpfs_node_find (&nnpfs[fd].nodehead, &message->handle[i]);
- if (node)
- gc_vnode(XNODE_TO_VNODE(node), p);
- else {
- NNPFSDEB(XDEBMSG, ("nnpfs_message_gc_nodes: no such node\n"));
- send_inactive_node(fd, &message->handle[i]);
- }
- }
-
- return 0;
-}
-
-
-/*
- * Probe what version of nnpfs this support
- */
-
-int
-nnpfs_message_version(int fd,
- struct nnpfs_message_version *message,
- u_int size,
- d_thread_t *p)
-{
- struct nnpfs_message_wakeup msg;
- int ret;
-
- ret = NNPFS_VERSION;
-
- msg.header.opcode = NNPFS_MSG_WAKEUP;
- msg.sleepers_sequence_num = message->header.sequence_num;
- msg.error = ret;
-
- return nnpfs_message_send(fd,
- (struct nnpfs_message_header *) &msg, sizeof(msg));
-}
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_node-bsd.c b/usr.sbin/afs/src/nnpfs/bsd/nnpfs_node-bsd.c
deleted file mode 100644
index 7d5f541247a..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_node-bsd.c
+++ /dev/null
@@ -1,808 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <nnpfs/nnpfs_locl.h>
-#include <nnpfs/nnpfs_common.h>
-#include <nnpfs/nnpfs_fs.h>
-#include <nnpfs/nnpfs_deb.h>
-#include <nnpfs/nnpfs_vnodeops.h>
-
-RCSID("$arla: nnpfs_node-bsd.c,v 1.70 2003/02/28 02:01:06 lha Exp $");
-
-extern vop_t **nnpfs_vnodeop_p;
-
-#ifndef LK_NOPAUSE
-#define LK_NOPAUSE 0
-#endif
-
-/*
- * Allocate a new vnode with handle `handle' in `mp' and return it in
- * `vpp'. Return 0 or error.
- */
-
-int
-nnpfs_getnewvnode(struct nnpfs *nnpfsp, struct vnode **vpp,
- struct nnpfs_handle *handle)
-{
- struct nnpfs_node *result, *check;
- struct mount *mp;
- int error;
-
- error = getnewvnode(VT_AFS, NNPFS_TO_VFS(nnpfsp), nnpfs_vnodeop_p, vpp);
- if (error)
- return error;
-
- result = nnpfs_alloc(sizeof(*result), M_NNPFS_NODE);
- bzero(result, sizeof(*result));
-
- (*vpp)->v_data = result;
- result->vn = *vpp;
-
- result->handle = *handle;
- result->flags = 0;
- result->tokens = 0;
- result->offset = 0;
-#if defined(HAVE_KERNEL_LOCKMGR) || defined(HAVE_KERNEL_DEBUGLOCKMGR)
- lockinit (&result->lock, PVFS, "nnpfs_lock", 0, LK_NOPAUSE);
-#else
- result->vnlocks = 0;
-#endif
- result->anonrights = 0;
- result->rd_cred = NULL;
- result->wr_cred = NULL;
-
-#if defined(__NetBSD_Version__) && __NetBSD_Version__ >= 105280000
- genfs_node_init(*vpp, &nnpfs_genfsops);
-#endif
-
- check = nnpfs_node_find(&nnpfsp->nodehead, handle);
- if (check) {
- vput(*vpp);
- *vpp = result->vn;
- return 0;
- }
-
- nnpfs_insert(&nnpfs->nodehead, result);
-
- return 0;
-}
-
-/*
- * Create a new nnpfs_node and make a vget
- *
- * Also prevents creation of duplicates. This happens
- * whenever there are more than one name to a file,
- * "." and ".." are common cases. */
-
-int
-new_nnpfs_node(struct nnpfs *nnpfsp,
- struct nnpfs_msg_node *node,
- struct nnpfs_node **xpp,
- d_thread_t *p)
-{
- struct nnpfs_node *result;
-
- NNPFSDEB(XDEBNODE, ("new_nnpfs_node (%d,%d,%d,%d)\n",
- node->handle.a,
- node->handle.b,
- node->handle.c,
- node->handle.d));
-
-retry:
- /* Does not allow duplicates */
- result = nnpfs_node_find(&nnpfsp->nodehead, &node->handle);
- if (result == 0) {
- int error;
- struct vnode *v;
-
- error = nnpfs_getnewvnode(nnpfsp, &v, &node->handle);
- if (error)
- return error;
-
- result = VNODE_TO_XNODE(v);
- result->anonrights = node->anonrights;
-
- nnpfsp->nnodes++;
- } else {
- /* Node is already cached */
- if(nnpfs_do_vget(XNODE_TO_VNODE(result), 0, p))
- goto retry;
- }
-
- /* Init other fields */
- nnpfs_attr2vattr(&node->attr, &result->attr, 1);
- result->vn->v_type = result->attr.va_type;
- result->tokens = node->tokens;
- bcopy(node->id, result->id, sizeof(result->id));
- bcopy(node->rights, result->rights, sizeof(result->rights));
-
-#ifdef __APPLE__
- if (result->vn->v_type == VREG && (!UBCINFOEXISTS(result->vn)))
- ubc_info_init(result->vn);
-#endif
-
- *xpp = result;
- NNPFSDEB(XDEBNODE, ("return: new_nnpfs_node\n"));
- return 0;
-}
-
-void
-free_nnpfs_node(struct nnpfs_node *node)
-{
- struct nnpfs *nnpfsp = NNPFS_FROM_XNODE(node);
-
- NNPFSDEB(XDEBNODE, ("free_nnpfs_node(%lx) (%d,%d,%d,%d)\n",
- (unsigned long)node,
- node->handle.a,
- node->handle.b,
- node->handle.c,
- node->handle.d));
-
- /* XXX Really need to put back dirty data first. */
-
- if (DATA_FROM_XNODE(node)) {
- vrele(DATA_FROM_XNODE(node));
- DATA_FROM_XNODE(node) = NULL;
- }
- nnpfsp->nnodes--;
- XNODE_TO_VNODE(node)->v_data = NULL;
- if (node->rd_cred) {
- crfree (node->rd_cred);
- node->rd_cred = NULL;
- }
- if (node->wr_cred) {
- crfree (node->wr_cred);
- node->wr_cred = NULL;
- }
-
- nnpfs_free(node, sizeof(*node), M_NNPFS_NODE);
-
- NNPFSDEB(XDEBNODE, ("free_nnpfs_node done\n"));
-}
-
-/*
- * FreeBSD 4.4 and newer changed to API to vflush around June 2001
- */
-
-static int
-nnpfs_vflush(struct mount *mp, int flags)
-{
-#if __FreeBSD__ && __FreeBSD_version > 430000
- return vflush(mp, 0, flags);
-#else
- return vflush(mp, NULL, flags);
-#endif
-}
-
-int
-free_all_nnpfs_nodes(struct nnpfs *nnpfsp, int flags, int unmountp)
-{
- int error = 0;
- struct mount *mp = NNPFS_TO_VFS(nnpfsp);
-
- if (mp == NULL) {
- NNPFSDEB(XDEBNODE, ("free_all_nnpfs_nodes already freed\n"));
- return 0;
- }
-
- NNPFSDEB(XDEBNODE, ("free_all_nnpfs_nodes starting\n"));
-
- nnpfs_dnlc_purge_mp(mp);
-
- if (nnpfsp->root) {
- NNPFSDEB(XDEBNODE, ("free_all_nnpfs_nodes now removing root\n"));
-
- vgone(XNODE_TO_VNODE(nnpfsp->root));
- nnpfsp->root = NULL;
- }
-
- NNPFSDEB(XDEBNODE, ("free_all_nnpfs_nodes root removed\n"));
- NNPFSDEB(XDEBNODE, ("free_all_nnpfs_nodes now killing all remaining nodes\n"));
-
- /*
- * If we have a syncer vnode, release it (to emulate dounmount)
- * and the create it again when if we are going to need it.
- */
-
-#ifdef HAVE_STRUCT_MOUNT_MNT_SYNCER
- if (!unmountp) {
- if (mp->mnt_syncer != NULL) {
-#ifdef HAVE_KERNEL_VFS_DEALLOCATE_SYNCVNODE
- vfs_deallocate_syncvnode(mp);
-#else
- /*
- * FreeBSD and OpenBSD uses different semantics,
- * FreeBSD does vrele, and OpenBSD does vgone.
- */
-#if defined(__OpenBSD__)
- vgone(mp->mnt_syncer);
-#elif defined(__FreeBSD__)
- vrele(mp->mnt_syncer);
-#else
-#error what os do you use ?
-#endif
- mp->mnt_syncer = NULL;
-#endif
- }
- }
-#endif
- error = nnpfs_vflush(mp, flags);
-#ifdef HAVE_STRUCT_MOUNT_MNT_SYNCER
- if (!unmountp) {
- NNPFSDEB(XDEBNODE, ("free_all_nnpfs_nodes not flushing syncer vnode\n"));
- if (mp->mnt_syncer == NULL)
- if (vfs_allocate_syncvnode(mp))
- panic("failed to allocate syncer node when nnpfs daemon died");
- }
-#endif
-
- if (error) {
- NNPFSDEB(XDEBNODE, ("xfree_all_nnpfs_nodes: vflush() error == %d\n",
- error));
- return error;
- }
-
- NNPFSDEB(XDEBNODE, ("free_all_nnpfs_nodes done\n"));
- return error;
-}
-
-#ifndef LIST_FOREACH
-#define LIST_FOREACH(var, head, field) \
- for ((var) = ((head)->lh_first); \
- (var); \
- (var) = ((var)->field.le_next))
-#endif
-
-void
-vattr2nnpfs_attr(const struct vattr *va, struct nnpfs_attr *xa)
-{
- bzero(xa, sizeof(*xa));
- if (va->va_mode != (mode_t)VNOVAL)
- XA_SET_MODE(xa, va->va_mode);
- if (va->va_nlink != VNOVAL)
- XA_SET_NLINK(xa, va->va_nlink);
- if (va->va_size != VNOVAL)
- XA_SET_SIZE(xa, va->va_size);
- if (va->va_uid != VNOVAL)
- XA_SET_UID(xa, va->va_uid);
- if (va->va_gid != VNOVAL)
- XA_SET_GID(xa, va->va_gid);
- if (va->va_atime.tv_sec != VNOVAL)
- XA_SET_ATIME(xa, va->va_atime.tv_sec);
- if (va->va_mtime.tv_sec != VNOVAL)
- XA_SET_MTIME(xa, va->va_mtime.tv_sec);
- if (va->va_ctime.tv_sec != VNOVAL)
- XA_SET_CTIME(xa, va->va_ctime.tv_sec);
- if (va->va_fileid != VNOVAL)
- XA_SET_FILEID(xa, va->va_fileid);
- switch (va->va_type) {
- case VNON:
- xa->xa_type = NNPFS_FILE_NON;
- break;
- case VREG:
- xa->xa_type = NNPFS_FILE_REG;
- break;
- case VDIR:
- xa->xa_type = NNPFS_FILE_DIR;
- break;
- case VBLK:
- xa->xa_type = NNPFS_FILE_BLK;
- break;
- case VCHR:
- xa->xa_type = NNPFS_FILE_CHR;
- break;
- case VLNK:
- xa->xa_type = NNPFS_FILE_LNK;
- break;
- case VSOCK:
- xa->xa_type = NNPFS_FILE_SOCK;
- break;
- case VFIFO:
- xa->xa_type = NNPFS_FILE_FIFO;
- break;
- case VBAD:
- xa->xa_type = NNPFS_FILE_BAD;
- break;
- default:
- panic("nnpfs_attr2attr: bad value");
- }
-}
-
-#define SET_TIMEVAL(X, S, N) do { (X)->tv_sec = (S); (X)->tv_nsec = (N); } while(0)
-
-void
-nnpfs_attr2vattr(const struct nnpfs_attr *xa, struct vattr *va, int clear_node)
-{
- if (clear_node)
- VATTR_NULL(va);
- if (XA_VALID_MODE(xa))
- va->va_mode = xa->xa_mode;
- if (XA_VALID_NLINK(xa))
- va->va_nlink = xa->xa_nlink;
- if (XA_VALID_SIZE(xa)) {
- va->va_size = xa->xa_size;
- va->va_bytes = va->va_size;
- }
- if (XA_VALID_UID(xa))
- va->va_uid = xa->xa_uid;
- if (XA_VALID_GID(xa))
- va->va_gid = xa->xa_gid;
- if (XA_VALID_ATIME(xa)) {
- SET_TIMEVAL(&va->va_atime, xa->xa_atime, 0);
- }
- if (XA_VALID_MTIME(xa)) {
- SET_TIMEVAL(&va->va_mtime, xa->xa_mtime, 0);
- }
- if (XA_VALID_CTIME(xa)) {
- SET_TIMEVAL(&va->va_ctime, xa->xa_ctime, 0);
- }
- if (XA_VALID_FILEID(xa)) {
- va->va_fileid = xa->xa_fileid;
- }
- if (XA_VALID_TYPE(xa)) {
- switch (xa->xa_type) {
- case NNPFS_FILE_NON:
- va->va_type = VNON;
- break;
- case NNPFS_FILE_REG:
- va->va_type = VREG;
- break;
- case NNPFS_FILE_DIR:
- va->va_type = VDIR;
- break;
- case NNPFS_FILE_BLK:
- va->va_type = VBLK;
- break;
- case NNPFS_FILE_CHR:
- va->va_type = VCHR;
- break;
- case NNPFS_FILE_LNK:
- va->va_type = VLNK;
- break;
- case NNPFS_FILE_SOCK:
- va->va_type = VSOCK;
- break;
- case NNPFS_FILE_FIFO:
- va->va_type = VFIFO;
- break;
- case NNPFS_FILE_BAD:
- va->va_type = VBAD;
- break;
- default:
- panic("nnpfs_attr2vattr: bad value");
- }
- }
- va->va_flags = 0;
- va->va_blocksize = 8192;
-}
-
-/*
- * A single entry DNLC for systems for handling long names that don't
- * get put into the system DNLC.
- */
-
-struct long_entry {
- struct vnode *dvp, *vp;
- char name[MAXNAMLEN + 1];
- size_t len;
- u_long dvpid, vpid;
-};
-
-static struct long_entry tbl;
-
-/*
- * Nuke the `tbl'
- */
-
-static void
-tbl_clear (void)
-{
- tbl.dvp = tbl.vp = NULL;
- tbl.name[0] = '\0';
- tbl.len = 0;
- tbl.dvpid = tbl.vpid = 0;
-}
-
-/*
- * Set the entry in the `tbl'
- */
-
-static void
-tbl_enter (size_t len, const char *name, struct vnode *dvp, struct vnode *vp)
-{
- tbl.len = len;
- bcopy(name, tbl.name, len);
- tbl.dvp = dvp;
- tbl.vp = vp;
- tbl.dvpid = dvp->v_id;
- tbl.vpid = vp->v_id;
-}
-
-/*
- * Lookup in tbl (`dvp', `name', `len') and return result in `res'.
- * Return -1 if succesful, otherwise 0.
- */
-
-static int
-tbl_lookup (struct componentname *cnp,
- struct vnode *dvp,
- struct vnode **res)
-{
- if (tbl.dvp == dvp
- && tbl.len == cnp->cn_namelen
- && strncmp(tbl.name, cnp->cn_nameptr, tbl.len) == 0
- && tbl.dvpid == tbl.dvp->v_id
- && tbl.vpid == tbl.vp->v_id) {
-
- *res = tbl.vp;
- return -1;
- } else
- return 0;
-}
-
-/*
- * Store a componentname in the DNLC
- */
-
-int
-nnpfs_dnlc_enter(struct vnode *dvp,
- nnpfs_componentname *cnp,
- struct vnode *vp)
-{
- NNPFSDEB(XDEBDNLC, ("nnpfs_dnlc_enter_cnp(%lx, %lx, %lx)\n",
- (unsigned long)dvp,
- (unsigned long)cnp,
- (unsigned long)vp));
- NNPFSDEB(XDEBDNLC, ("nnpfs_dnlc_enter: v_id = %lu\n", (u_long)dvp->v_id));
-
- NNPFSDEB(XDEBDNLC, ("nnpfs_dnlc_enter: calling cache_enter:"
- "dvp = %lx, vp = %lx, cnp = (%s, %ld), "
- "nameiop = %lu, flags = %lx\n",
- (unsigned long)dvp,
- (unsigned long)vp,
- cnp->cn_nameptr, cnp->cn_namelen,
- cnp->cn_nameiop, cnp->cn_flags));
-
-#ifdef NCHNAMLEN
- if (cnp->cn_namelen <= NCHNAMLEN)
-#endif
- {
- /*
- * This is to make sure there's no negative entry already in the dnlc
- */
- u_long save_nameiop;
- u_long save_flags;
- struct vnode *dummy;
-
- save_nameiop = cnp->cn_nameiop;
- save_flags = cnp->cn_flags;
- cnp->cn_nameiop = CREATE;
- cnp->cn_flags &= ~MAKEENTRY;
-
-/*
- * The version number here is not entirely correct, but it's conservative.
- * The real change is sys/kern/vfs_cache:1.20
- */
-
-#if __NetBSD_Version__ >= 104120000 || OpenBSD > 200211
- if (cache_lookup(dvp, &dummy, cnp) != -1) {
- nnpfs_vfs_unlock(dummy, nnpfs_cnp_to_proc(cnp));
- printf ("NNPFS PANIC WARNING! nnpfs_dnlc_enter: %s already in cache\n",
- cnp->cn_nameptr);
- }
-#else
- if (cache_lookup(dvp, &dummy, cnp) != 0) {
- printf ("NNPFS PANIC WARNING! nnpfs_dnlc_enter: %s already in cache\n",
- cnp->cn_nameptr);
- }
-#endif
-
-
- cnp->cn_nameiop = save_nameiop;
- cnp->cn_flags = save_flags;
- cache_enter(dvp, vp, cnp);
- }
-
- if (vp != NULL)
- tbl_enter (cnp->cn_namelen, cnp->cn_nameptr, dvp, vp);
-
- return 0;
-}
-
-
-static void
-nnpfs_cnp_init (struct componentname *cn,
- const char *name,
- d_thread_t *proc, struct ucred *cred,
- int nameiop)
-{
- bzero(cn, sizeof(*cn));
- cn->cn_nameptr = (char *)name;
- cn->cn_namelen = strlen(name);
- cn->cn_flags = 0;
-#if __APPLE__
- {
- const unsigned char *p;
- int i;
-
- cn->cn_hash = 0;
- for (p = cn->cn_nameptr, i = 1; *p; ++p, ++i)
- cn->cn_hash += *p * i;
- }
-#elif defined(HAVE_KERNEL_NAMEI_HASH)
- {
- const char *cp = name + cn->cn_namelen;
- cn->cn_hash = namei_hash(name, &cp);
- }
-#elif defined(HAVE_STRUCT_COMPONENTNAME_CN_HASH)
- {
- const unsigned char *p;
-
- cn->cn_hash = 0;
- for (p = cn->cn_nameptr; *p; ++p)
- cn->cn_hash += *p;
- }
-#endif
- cn->cn_nameiop = nameiop;
-#ifdef HAVE_FREEBSD_THREAD
- cn->cn_thread = proc;
-#else
- cn->cn_proc = proc;
-#endif
- cn->cn_cred = cred;
-}
-
-
-/*
- * Store (dvp, name, vp) in the DNLC
- */
-
-int
-nnpfs_dnlc_enter_name(struct vnode *dvp,
- const char *name,
- struct vnode *vp)
-{
- struct componentname cn;
-
- NNPFSDEB(XDEBDNLC, ("nnpfs_dnlc_enter_name(%lx, \"%s\", %lx)\n",
- (unsigned long)dvp,
- name,
- (unsigned long)vp));
-
- nnpfs_cnp_init (&cn, name, NULL, NULL, LOOKUP);
- return nnpfs_dnlc_enter (dvp, &cn, vp);
-}
-
-/*
- * Lookup (dvp, cnp) in the DNLC and return the result in `res'.
- * Return the result from cache_lookup.
- */
-
-static int
-nnpfs_dnlc_lookup_int(struct vnode *dvp,
- nnpfs_componentname *cnp,
- struct vnode **res)
-{
- int error;
- u_long saved_flags;
-
- NNPFSDEB(XDEBDNLC, ("nnpfs_dnlc_lookup(%lx, \"%s\")\n",
- (unsigned long)dvp, cnp->cn_nameptr));
-
- NNPFSDEB(XDEBDNLC, ("nnpfs_dnlc_lookup: v_id = %lu\n", (u_long)dvp->v_id));
-
- NNPFSDEB(XDEBDNLC, ("nnpfs_dnlc_lookup: calling cache_lookup:"
- "dvp = %lx, cnp = (%s, %ld), flags = %lx\n",
- (unsigned long)dvp,
- cnp->cn_nameptr, cnp->cn_namelen,
- cnp->cn_flags));
-
- saved_flags = cnp->cn_flags;
- cnp->cn_flags |= MAKEENTRY | LOCKPARENT | ISLASTCN;
-
- error = cache_lookup(dvp, res, cnp);
-
- cnp->cn_flags = saved_flags;
-
- NNPFSDEB(XDEBDNLC, ("nnpfs_dnlc_lookup: cache_lookup returned. "
- "error = %d, *res = %lx\n", error,
- (unsigned long)*res));
- return error;
-}
-
-/*
- * do the last (and locking protocol) portion of xnlc_lookup
- *
- * return:
- * -1 for succesful
- * 0 for failed
- */
-
-static int
-nnpfs_dnlc_lock(struct vnode *dvp,
- nnpfs_componentname *cnp,
- struct vnode **res)
-{
- int error = 0;
-
- /*
- * Try to handle the (complex) BSD locking protocol.
- */
-
- if (*res == dvp) { /* "." */
- VREF(dvp);
- } else if (cnp->cn_flags & ISDOTDOT) { /* ".." */
- u_long vpid = dvp->v_id;
-
-#ifdef HAVE_FREEBSD_THREAD
- nnpfs_vfs_unlock(dvp, nnpfs_cnp_to_thread(cnp));
- error = nnpfs_do_vget(*res, LK_EXCLUSIVE, nnpfs_cnp_to_thread(cnp));
- nnpfs_vfs_writelock(dvp, nnpfs_cnp_to_thread(cnp));
-#else
- nnpfs_vfs_unlock(dvp, nnpfs_cnp_to_proc(cnp));
- error = nnpfs_do_vget(*res, LK_EXCLUSIVE, nnpfs_cnp_to_proc(cnp));
- nnpfs_vfs_writelock(dvp, nnpfs_cnp_to_proc(cnp));
-#endif
-
- if (error == 0 && dvp->v_id != vpid) {
- vput(*res);
- return 0;
- }
- } else {
-#ifdef HAVE_FREEBSD_THREAD
- error = nnpfs_do_vget(*res, LK_EXCLUSIVE, nnpfs_cnp_to_thread(cnp));
-#else
- error = nnpfs_do_vget(*res, LK_EXCLUSIVE, nnpfs_cnp_to_proc(cnp));
-#endif
- }
-
- if (error == 0)
- return -1;
- else
- return 0;
-}
-
-/*
- * Lookup (`dvp', `cnp') in the DNLC (and the local cache).
- *
- * Return -1 if succesful, 0 if not and ENOENT if the entry is known
- * not to exist.
- *
- * On modern NetBSD, cache_lookup has been changed to return 0 for
- * succesful and -1 for not.
- * (see the comment above for version information).
- */
-
-#if __NetBSD_Version__ >= 104120000 || OpenBSD > 200211
-
-int
-nnpfs_dnlc_lookup(struct vnode *dvp,
- nnpfs_componentname *cnp,
- struct vnode **res)
-{
- int error = nnpfs_dnlc_lookup_int (dvp, cnp, res);
-
- if (error == 0)
- return -1;
- else if (error == ENOENT)
- return error;
-
- error = tbl_lookup (cnp, dvp, res);
-
- if (error != -1)
- return error;
-
- return nnpfs_dnlc_lock (dvp, cnp, res);
-}
-
-#else /* ! __NetBSD_Version__ >= 104120000 && ! OpenBSD > 200211 */
-
-int
-nnpfs_dnlc_lookup(struct vnode *dvp,
- nnpfs_componentname *cnp,
- struct vnode **res)
-{
- int error = nnpfs_dnlc_lookup_int (dvp, cnp, res);
-
- if (error == 0)
- error = tbl_lookup (cnp, dvp, res);
-
- if (error != -1)
- return error;
-
- return nnpfs_dnlc_lock (dvp, cnp, res);
-}
-
-#endif /* __NetBSD_Version__ >= 104120000 || OpenBSD > 200211 */
-
-/*
- * Remove one entry from the DNLC
- */
-
-void
-nnpfs_dnlc_purge (struct vnode *vp)
-{
- NNPFSDEB(XDEBDNLC, ("nnpfs_dnlc_purge\n"));
-
- if (tbl.dvp == vp || tbl.vp == vp)
- tbl_clear ();
-
- cache_purge(vp);
-}
-
-/*
- * Remove all entries belong to `mp' from the DNLC
- */
-
-void
-nnpfs_dnlc_purge_mp(struct mount *mp)
-{
- NNPFSDEB(XDEBDNLC, ("nnpfs_dnlc_purge_mp()\n"));
-
- tbl_clear ();
- cache_purgevfs(mp);
-}
-
-/*
- * Returns 1 if pag has any rights set in the node
- */
-
-int
-nnpfs_has_pag(const struct nnpfs_node *xn, nnpfs_pag_t pag)
-{
- int i;
-
- for (i = 0; i < MAXRIGHTS; i++)
- if (xn->id[i] == pag)
- return 1;
-
- return 0;
-}
-
-void
-nnpfs_update_write_cred(struct nnpfs_node *xn, struct ucred *cred)
-{
- if (xn->wr_cred)
- crfree (xn->wr_cred);
- crhold (cred);
- xn->wr_cred = cred;
-}
-
-void
-nnpfs_update_read_cred(struct nnpfs_node *xn, struct ucred *cred)
-{
- if (xn->rd_cred)
- crfree (xn->rd_cred);
- crhold (cred);
- xn->rd_cred = cred;
-}
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_node.c b/usr.sbin/afs/src/nnpfs/bsd/nnpfs_node.c
deleted file mode 100644
index 805a6a46e9b..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_node.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2002 - 2003, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <nnpfs/nnpfs_locl.h>
-#include <nnpfs/nnpfs_common.h>
-#include <nnpfs/nnpfs_fs.h>
-#include <nnpfs/nnpfs_deb.h>
-#include <nnpfs/nnpfs_node.h>
-#include <nnpfs/nnpfs_vnodeops.h>
-#include <nnpfs/nnpfs_queue.h>
-
-RCSID("$arla: nnpfs_node.c,v 1.3 2003/02/06 12:56:09 lha Exp $");
-
-#define nnpfs_hash(node) \
- (((node)->a+(node)->b+(node)->c+(node)->d) % XN_HASHSIZE)
-
-/*
- * Init the nnp node storage system
- */
-
-void
-nnfs_init_head(struct nnpfs_nodelist_head *head)
-{
- int i;
-
- for (i = 0; i < XN_HASHSIZE; i++)
- NNPQUEUE_INIT(&head->nh_nodelist[i]);
-}
-
-/*
- * Tries to purge all nodes from the hashtable. Nodes that unpurgeable
- * (still used nodes) are given to proc for special termination
- * (conversion to dead node).
- */
-
-void
-nnpfs_node_purge(struct nnpfs_nodelist_head *head,
- void (*func)(struct nnpfs_node *))
-{
- panic("nnpfs_node_purge");
-}
-
-/*
- * nnpfs_node_find returns the node with the handle `handlep'.
- */
-
-struct nnpfs_node *
-nnpfs_node_find(struct nnpfs_nodelist_head *head, nnpfs_handle *handlep)
-{
- struct nh_node_list *h;
- struct nnpfs_node *nn;
-
- h = &head->nh_nodelist[nnpfs_hash(handlep)];
-
- NNPQUEUE_FOREACH(nn, h, nn_hash) {
- if (nnpfs_handle_eq(handlep, &nn->handle))
- break;
- }
-
- return nn;
-}
-
-/*
- * Remove the node `node' from the node storage system.
- */
-
-void
-nnpfs_remove_node(struct nnpfs_nodelist_head *head, struct nnpfs_node *node)
-{
- struct nh_node_list *h;
-
- h = &head->nh_nodelist[nnpfs_hash(&node->handle)];
- NNPQUEUE_REMOVE(node, h, nn_hash);
-}
-
-/*
- * Add the node `node' from the node storage system.
- */
-
-void
-nnpfs_insert(struct nnpfs_nodelist_head *head, struct nnpfs_node *node)
-{
- struct nh_node_list *h;
-
- h = &head->nh_nodelist[nnpfs_hash(&node->handle)];
- NNPQUEUE_INSERT_HEAD(h, node, nn_hash);
-}
-
-/*
- * Update `old_handlep' in the node list `head' to `new_handlep'.
- */
-
-int
-nnpfs_update_handle(struct nnpfs_nodelist_head *head,
- nnpfs_handle *old_handlep, nnpfs_handle *new_handlep)
-{
- struct nnpfs_node *node;
-
- node = nnpfs_node_find(head, new_handlep);
- if (node)
- return EEXIST;
- node = nnpfs_node_find(head, old_handlep);
- if (node == NULL)
- return ENOENT;
- nnpfs_remove_node(head, node);
- node->handle = *new_handlep;
- nnpfs_insert(head, node);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_syscalls-common.c b/usr.sbin/afs/src/nnpfs/bsd/nnpfs_syscalls-common.c
deleted file mode 100644
index e01aa8d06f0..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_syscalls-common.c
+++ /dev/null
@@ -1,659 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <nnpfs/nnpfs_locl.h>
-
-RCSID("$arla: nnpfs_syscalls-common.c,v 1.72 2003/01/19 20:53:49 lha Exp $");
-
-/*
- * NNPFS system calls.
- */
-
-#include <nnpfs/nnpfs_syscalls.h>
-#include <nnpfs/nnpfs_message.h>
-#include <nnpfs/nnpfs_fs.h>
-#include <nnpfs/nnpfs_dev.h>
-#include <nnpfs/nnpfs_node.h>
-#include <nnpfs/nnpfs_vfsops.h>
-#include <nnpfs/nnpfs_deb.h>
-
-/* Misc syscalls */
-#ifdef HAVE_SYS_IOCCOM_H
-#include <sys/ioccom.h>
-#elif defined(HAVE_SYS_IOCTL_H)
-#include <sys/ioctl.h>
-#endif
-/*
- * XXX - horrible kludge. If we are openbsd and not building an lkm,
- * then use their headerfile.
- */
-#if (defined(__OpenBSD__) || defined(__NetBSD__)) && !defined(_LKM)
-#define NNPFS_NOT_LKM 1
-#elif defined(__FreeBSD__) && !defined(KLD_MODULE)
-#define NNPFS_NOT_LKM 1
-#endif
-
-#ifdef NNPFS_NOT_LKM
-#include <nnpfs/nnpfs_pioctl.h>
-#else
-#include <kafs.h>
-#endif
-
-int (*old_setgroups_func)(syscall_d_thread_t *p, void *v, register_t *retval);
-
-#if defined(__FreeBSD__) && __FreeBSD_version >= 500026
-/*
- * XXX This is wrong
- */
-static struct ucred *
-nnpfs_crcopy(struct ucred *cr)
-{
- struct ucred *ncr;
-
- if (crshared(cr)) {
- ncr = crdup(cr);
- crfree(cr);
- return ncr;
- }
- return cr;
-}
-#else
-#define nnpfs_crcopy crcopy
-#endif
-
-
-/*
- * the syscall entry point
- */
-
-#ifdef NNPFS_NOT_LKM
-int
-sys_nnpfspioctl(syscall_d_thread_t *proc, void *varg, register_t *return_value)
-#else
-int
-nnpfspioctl(syscall_d_thread_t *proc, void *varg, register_t *return_value)
-#endif
-{
-#ifdef NNPFS_NOT_LKM
- struct sys_nnpfspioctl_args *arg = (struct sys_nnpfspioctl_args *) varg;
-#else
- struct sys_pioctl_args *arg = (struct sys_pioctl_args *) varg;
-#endif
- int error = EINVAL;
-
- switch (SCARG(arg, operation)) {
- case AFSCALL_PIOCTL:
- error = nnpfs_pioctl_call(syscall_thread_to_thread(proc),
- varg, return_value);
- break;
- case AFSCALL_SETPAG:
-#ifdef HAVE_FREEBSD_THREAD
- error = nnpfs_setpag_call(&nnpfs_thread_to_cred(proc));
-#else
- error = nnpfs_setpag_call(&nnpfs_proc_to_cred(syscall_thread_to_thread(proc)));
-#endif
- break;
- default:
- NNPFSDEB(XDEBSYS, ("Unimplemeted nnpfspioctl: %d\n",
- SCARG(arg, operation)));
- error = EINVAL;
- break;
- }
-
- return error;
-}
-
-/*
- * Def pag:
- * 33536 <= g0 <= 34560
- * 32512 <= g1 <= 48896
- */
-
-#define NNPFS_PAG1_LLIM 33536
-#define NNPFS_PAG1_ULIM 34560
-#define NNPFS_PAG2_LLIM 32512
-#define NNPFS_PAG2_ULIM 48896
-
-static gid_t pag_part_one = NNPFS_PAG1_LLIM;
-static gid_t pag_part_two = NNPFS_PAG2_LLIM;
-
-/*
- * Is `cred' member of a PAG?
- */
-
-static int
-nnpfs_is_pag(struct ucred *cred)
-{
- /* The first group is the gid of the user ? */
-
- if (cred->cr_ngroups >= 3 &&
- cred->cr_groups[1] >= NNPFS_PAG1_LLIM &&
- cred->cr_groups[1] <= NNPFS_PAG1_ULIM &&
- cred->cr_groups[2] >= NNPFS_PAG2_LLIM &&
- cred->cr_groups[2] <= NNPFS_PAG2_ULIM)
- return 1;
- else
- return 0;
-}
-
-/*
- * Return the pag used by `cred'
- */
-
-nnpfs_pag_t
-nnpfs_get_pag(struct ucred *cred)
-{
- if (nnpfs_is_pag(cred)) {
-
- return (((cred->cr_groups[1] << 16) & 0xFFFF0000) |
- ((cred->cr_groups[2] & 0x0000FFFF)));
-
- } else
- return cred->cr_uid; /* XXX */
-}
-
-/*
- * Set the pag in `ret_cred' and return a new cred.
- */
-
-static int
-store_pag (struct ucred **ret_cred, gid_t part1, gid_t part2)
-{
- struct ucred *cred = *ret_cred;
-
- if (!nnpfs_is_pag (cred)) {
- int i;
-
- if (cred->cr_ngroups + 2 >= NGROUPS)
- return E2BIG;
-
- cred = nnpfs_crcopy (cred);
-
- for (i = cred->cr_ngroups - 1; i > 0; i--) {
- cred->cr_groups[i + 2] = cred->cr_groups[i];
- }
- cred->cr_ngroups += 2;
- } else {
- cred = nnpfs_crcopy (cred);
- }
- cred->cr_groups[1] = part1;
- cred->cr_groups[2] = part2;
- *ret_cred = cred;
-
- return 0;
-}
-
-/*
- * Acquire a new pag in `ret_cred'
- */
-
-int
-nnpfs_setpag_call(struct ucred **ret_cred)
-{
- int ret;
-
- ret = store_pag (ret_cred, pag_part_one, pag_part_two++);
- if (ret)
- return ret;
-
- if (pag_part_two > NNPFS_PAG2_ULIM) {
- pag_part_one++;
- pag_part_two = NNPFS_PAG2_LLIM;
- }
- return 0;
-}
-
-#ifndef NNPFS_NOT_LKM
-/*
- * remove a pag
- */
-
-static int
-nnpfs_unpag (struct ucred *cred)
-{
- while (nnpfs_is_pag (cred)) {
- int i;
-
- for (i = 0; i < cred->cr_ngroups - 2; ++i)
- cred->cr_groups[i] = cred->cr_groups[i+2];
- cred->cr_ngroups -= 2;
- }
- return 0;
-}
-
-/*
- * A wrapper around setgroups that preserves the pag.
- */
-
-int
-nnpfs_setgroups (syscall_d_thread_t *p,
- void *varg,
- register_t *retval)
-{
- struct nnpfs_setgroups_args *uap = (struct nnpfs_setgroups_args *)varg;
-#ifdef HAVE_FREEBSD_THREAD
- struct ucred **cred = &nnpfs_thread_to_cred(p);
-#else
- struct ucred **cred = &nnpfs_proc_to_cred(syscall_thread_to_thread(p));
-#endif
-
- if (nnpfs_is_pag (*cred)) {
- gid_t part1, part2;
- int ret;
-
- if (SCARG(uap,gidsetsize) + 2 > NGROUPS)
- return EINVAL;
-
- part1 = (*cred)->cr_groups[1];
- part2 = (*cred)->cr_groups[2];
- ret = (*old_setgroups_func) (p, uap, retval);
- if (ret)
- return ret;
- return store_pag (cred, part1, part2);
- } else {
- int ret;
-
- ret = (*old_setgroups_func) (p, uap, retval);
- /* don't support setting a PAG */
- if (nnpfs_is_pag (*cred)) {
- nnpfs_unpag (*cred);
- return EINVAL;
- }
- return ret;
- }
-}
-#endif /* !NNPFS_NOT_LKM */
-
-/*
- * Return the vnode corresponding to `pathptr'
- */
-
-static int
-lookup_node (const char *pathptr,
- int follow_links_p,
- struct vnode **res,
- d_thread_t *proc)
-{
- int error;
- char path[MAXPATHLEN];
-#ifdef __osf__
- struct nameidata *ndp = &u.u_nd;
-#else
- struct nameidata nd, *ndp = &nd;
-#endif
- struct vnode *vp;
- size_t count;
-
- NNPFSDEB(XDEBSYS, ("nnpfs_syscall: looking up: %lx\n",
- (unsigned long)pathptr));
-
- error = copyinstr((char *) pathptr, path, MAXPATHLEN, &count);
-
- NNPFSDEB(XDEBSYS, ("nnpfs_syscall: looking up: %s, error: %d\n", path, error));
-
- if (error)
- return error;
-
- NDINIT(ndp, LOOKUP,
- follow_links_p ? FOLLOW : 0,
- UIO_SYSSPACE, path, proc);
-
- error = namei(ndp);
-
- if (error != 0) {
- NNPFSDEB(XDEBSYS, ("nnpfs_syscall: error during namei: %d\n", error));
- return EINVAL;
- }
-
- vp = ndp->ni_vp;
-
- *res = vp;
- return 0;
-}
-
-/*
- * implement nnpfs fhget in a way that should be compatible with the native
- * getfh
- */
-
-static int
-getfh_compat (d_thread_t *p,
- struct ViceIoctl *vice_ioctl,
- struct vnode *vp)
-{
- /* This is to be same as getfh */
- fhandle_t fh;
- int error;
-
- bzero((caddr_t)&fh, sizeof(fh));
- fh.fh_fsid = vp->v_mount->mnt_stat.f_fsid;
-#if __osf__
- VFS_VPTOFH(vp, &fh.fh_fid, error);
-#else
- error = VFS_VPTOFH(vp, &fh.fh_fid);
-#endif
- if (error)
- return error;
-
- if (vice_ioctl->out_size < sizeof(fh))
- return EINVAL;
-
- return copyout((caddr_t)&fh, vice_ioctl->out, sizeof (fh));
-}
-
-/*
- * implement nnpfs fhget by combining (dev, ino, generation)
- */
-
-static int
-trad_fhget (d_thread_t *p,
- struct ViceIoctl *vice_ioctl,
- struct vnode *vp)
-{
- int error;
- struct mount *mnt;
- struct vattr vattr;
- size_t len;
- struct nnpfs_fhandle_t nnpfs_handle;
- struct nnpfs_fh_args fh_args;
-
-#ifdef HAVE_FREEBSD_THREAD
- nnpfs_vop_getattr(vp, &vattr, nnpfs_thread_to_cred(p), p, error);
-#else
- nnpfs_vop_getattr(vp, &vattr, nnpfs_proc_to_cred(p), p, error);
-#endif
- if (error)
- return error;
-
- mnt = vp->v_mount;
-
- SCARG(&fh_args, fsid) = mnt->mnt_stat.f_fsid;
- SCARG(&fh_args, fileid) = vattr.va_fileid;
- SCARG(&fh_args, gen) = vattr.va_gen;
-
- nnpfs_handle.len = sizeof(fh_args);
- memcpy (nnpfs_handle.fhdata, &fh_args, sizeof(fh_args));
- len = sizeof(nnpfs_handle);
-
- if (vice_ioctl->out_size < len)
- return EINVAL;
-
- error = copyout (&nnpfs_handle, vice_ioctl->out, len);
- if (error) {
- NNPFSDEB(XDEBSYS, ("fhget_call: copyout failed: %d\n", error));
- }
- return error;
-}
-
-/*
- * return file handle of `vp' in vice_ioctl->out
- * vp is vrele:d
- */
-
-static int
-fhget_call (d_thread_t *p,
- struct ViceIoctl *vice_ioctl,
- struct vnode *vp)
-{
- int error;
-
- NNPFSDEB(XDEBSYS, ("fhget_call\n"));
-
- if (vp == NULL)
- return EBADF;
-
-#if defined(__APPLE__) || defined(__osf__)
- error = EINVAL; /* XXX: Leaks vnodes if fhget/fhopen is used */
- goto out;
-#endif
-
- error = nnpfs_suser (p);
- if (error)
- goto out;
-
-#if (defined(HAVE_GETFH) && defined(HAVE_FHOPEN)) || defined(__osf__)
- error = getfh_compat (p, vice_ioctl, vp);
-#else
- error = trad_fhget (p, vice_ioctl, vp);
-#endif /* HAVE_GETFH && HAVE_FHOPEN */
-out:
- vrele(vp);
- return error;
-}
-
-/*
- * open the file specified in `vice_ioctl->in'
- */
-
-static int
-fhopen_call (d_thread_t *p,
- struct ViceIoctl *vice_ioctl,
- struct vnode *vp,
- int flags,
- register_t *retval)
-{
-
- NNPFSDEB(XDEBSYS, ("fhopen_call: flags = %d\n", flags));
-
- if (vp != NULL) {
- vrele (vp);
- return EINVAL;
- }
-
-#if defined(__APPLE__) || defined(__osf__)
- return EINVAL; /* XXX: Leaks vnodes if fhget/fhopen is used */
-#endif
-
- return nnpfs_fhopen (p,
- (struct nnpfs_fhandle_t *)vice_ioctl->in,
- flags,
- retval);
-}
-
-/*
- * Send the pioctl to arlad
- */
-
-static int
-remote_pioctl (d_thread_t *p,
- struct sys_pioctl_args *arg,
- struct ViceIoctl *vice_ioctl,
- struct vnode *vp)
-{
- int error;
- struct nnpfs_message_pioctl msg;
- struct nnpfs_message_wakeup_data *msg2;
-
- if (vp != NULL) {
- struct nnpfs_node *xn;
-
- if (vp->v_tag != VT_AFS) {
- NNPFSDEB(XDEBSYS, ("nnpfs_syscall: file is not in afs\n"));
- vrele(vp);
- return EINVAL;
- }
-
- xn = VNODE_TO_XNODE(vp);
-
- msg.handle = xn->handle;
- vrele(vp);
- }
-
- if (vice_ioctl->in_size < 0) {
- printf("nnpfs: remote pioctl: got a negative data size: opcode: %d",
- SCARG(arg, a_opcode));
- return EINVAL;
- }
-
- if (vice_ioctl->in_size > NNPFS_MSG_MAX_DATASIZE) {
- printf("nnpfs_pioctl_call: got a humongous in packet: opcode: %d",
- SCARG(arg, a_opcode));
- return EINVAL;
- }
- if (vice_ioctl->in_size != 0) {
- error = copyin(vice_ioctl->in, msg.msg, vice_ioctl->in_size);
- if (error)
- return error;
- }
-
- msg.header.opcode = NNPFS_MSG_PIOCTL;
- msg.header.size = sizeof(msg);
- msg.opcode = SCARG(arg, a_opcode);
-
- msg.insize = vice_ioctl->in_size;
- msg.outsize = vice_ioctl->out_size;
-#ifdef HAVE_FREEBSD_THREAD
- msg.cred.uid = nnpfs_thread_to_euid(p);
- msg.cred.pag = nnpfs_get_pag(nnpfs_thread_to_cred(p));
-#else
- msg.cred.uid = nnpfs_proc_to_euid(p);
- msg.cred.pag = nnpfs_get_pag(nnpfs_proc_to_cred(p));
-#endif
-
- error = nnpfs_message_rpc(0, &msg.header, sizeof(msg), p); /* XXX */
- msg2 = (struct nnpfs_message_wakeup_data *) &msg;
-
- if (error == 0)
- error = msg2->error;
- if (error == ENODEV)
- error = EINVAL;
-
- if (error == 0 && msg2->header.opcode == NNPFS_MSG_WAKEUP_DATA) {
- int len;
-
- len = msg2->len;
- if (len > vice_ioctl->out_size)
- len = vice_ioctl->out_size;
- if (len > NNPFS_MSG_MAX_DATASIZE)
- len = NNPFS_MSG_MAX_DATASIZE;
- if (len < 0)
- len = 0;
-
- error = copyout(msg2->msg, vice_ioctl->out, len);
- }
- return error;
-}
-
-static int
-nnpfs_debug (d_thread_t *p,
- struct ViceIoctl *vice_ioctl)
-{
- int32_t flags;
- int error;
-
- if (vice_ioctl->in_size != 0) {
- if (vice_ioctl->in_size < sizeof(int32_t))
- return EINVAL;
-
- error = nnpfs_suser (p);
- if (error)
- return error;
-
- error = copyin (vice_ioctl->in,
- &flags,
- sizeof(flags));
- if (error)
- return error;
-
- nnpfsdeb = flags;
- }
-
- if (vice_ioctl->out_size != 0) {
- if (vice_ioctl->out_size < sizeof(int32_t))
- return EINVAL;
-
- error = copyout (&nnpfsdeb,
- vice_ioctl->out,
- sizeof(int32_t));
- if (error)
- return error;
- }
-
- return 0;
-}
-
-
-/*
- * Handle `pioctl'
- */
-
-int
-nnpfs_pioctl_call(d_thread_t *proc,
- struct sys_pioctl_args *arg,
- register_t *return_value)
-{
- int error;
- struct ViceIoctl vice_ioctl;
- char *pathptr;
- struct vnode *vp = NULL;
-
- NNPFSDEB(XDEBSYS, ("nnpfs_syscall(%d, %lx, %d, %lx, %d)\n",
- SCARG(arg, operation),
- (unsigned long)SCARG(arg, a_pathP),
- SCARG(arg, a_opcode),
- (unsigned long)SCARG(arg, a_paramsP),
- SCARG(arg, a_followSymlinks)));
-
- /* Copy in the data structure for us */
-
- error = copyin(SCARG(arg, a_paramsP),
- &vice_ioctl,
- sizeof(vice_ioctl));
-
- if (error)
- return error;
-
- pathptr = SCARG(arg, a_pathP);
-
- if (pathptr != NULL) {
- error = lookup_node (pathptr, SCARG(arg, a_followSymlinks), &vp,
- proc);
- if(error)
- return error;
- }
-
- switch (SCARG(arg, a_opcode)) {
- case VIOC_FHGET :
- return fhget_call (proc, &vice_ioctl, vp);
- case VIOC_FHOPEN :
- return fhopen_call (proc, &vice_ioctl, vp,
- SCARG(arg, a_followSymlinks), return_value);
- case VIOC_NNPFSDEBUG :
- if (vp != NULL)
- vrele (vp);
- return nnpfs_debug (proc, &vice_ioctl);
- default :
- NNPFSDEB(XDEBSYS, ("a_opcode = %x\n", SCARG(arg, a_opcode)));
- return remote_pioctl (proc, arg, &vice_ioctl, vp);
- }
-}
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_syscalls-wrap-bsd.c b/usr.sbin/afs/src/nnpfs/bsd/nnpfs_syscalls-wrap-bsd.c
deleted file mode 100644
index 8980fa4b216..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_syscalls-wrap-bsd.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <nnpfs/nnpfs_locl.h>
-
-RCSID("$arla: nnpfs_syscalls-wrap-bsd.c,v 1.18 2003/01/19 20:53:50 lha Exp $");
-
-/*
- * NNPFS system calls.
- */
-
-#include <nnpfs/nnpfs_syscalls.h>
-#include <nnpfs/nnpfs_message.h>
-#include <nnpfs/nnpfs_fs.h>
-#include <nnpfs/nnpfs_dev.h>
-#include <nnpfs/nnpfs_node.h>
-#include <nnpfs/nnpfs_deb.h>
-
-#include <kafs.h>
-
-int nnpfs_syscall_num;
-
-static struct sysent old_syscallent;
-
-static struct sysent nnpfs_syscallent = {
- 5, /* number of args */
- sizeof(struct sys_pioctl_args), /* size of args */
-#if HAVE_STRUCT_SYSENT_SY_FLAGS
- 0,
-#endif
- nnpfspioctl /* function pointer */
-};
-
-static struct sysent old_setgroups;
-
-/* XXX really defined in kern/kern_lkm.c */
-extern int
-sys_lkmnosys(syscall_d_thread_t *p, void *v, register_t *retval);
-
-/*
- *
- */
-
-#ifdef HAVE_KERNEL_AOUT_SYSENT
-/* XXX if we are running with a.out compatibility, we need to add all
- syscalls to both the ELF, and the a.out syscall tables */
-/* XXX this should be made generic, so we can add support for, say,
- linux afs binaries */
-extern struct sysent aout_sysent[];
-#endif
-
-static int
-try_install_syscall (int offset,
- struct sysent new_sysent,
- struct sysent *old_sysent)
-{
- if(sysent[offset].sy_call != sys_lkmnosys)
-#if defined(__OpenBSD__) && defined(AFS_SYSCALL)
- /* XXX
- * OpenBSD puts a dummy pointer at AFS_SYSCALL,
- * ignore it - we're handling AFS now.
- */
- if (offset != AFS_SYSCALL)
- return EBUSY;
-#else
- return EBUSY;
-#endif
-
-#ifdef HAVE_KERNEL_AOUT_SYSENT
- if(aout_sysent[offset].sy_call != sys_lkmnosys)
- return EBUSY;
-#endif
-
- *old_sysent = sysent[offset];
- sysent[offset] = new_sysent;
-#ifdef HAVE_KERNEL_AOUT_SYSENT
- aout_sysent[offset] = new_sysent;
-#endif
- return 0;
-}
-
-/*
- *
- */
-
-static int
-install_first_free_syscall (int *offset,
- struct sysent sysent,
- struct sysent *old_sysent)
-{
- int i;
-
- for (i = 1; i < SYS_MAXSYSCALL; ++i)
- if (try_install_syscall (i, sysent, old_sysent) == 0) {
- *offset = i;
- return 0;
- }
- return ENFILE;
-}
-
-/*
- * Try AFS_SYSCALL first, if that fails, any free slot
- */
-
-int
-nnpfs_install_syscalls(void)
-{
- int ret = ENOENT;
-
-#ifdef HAVE_KERNEL_AOUT_SYSENT
- /* XXX make sure that the ELF, and the a.out syscall are the same;
- if they're not we don't know what to do (infact you could just
- add two different setgroups calls, but this is probably not
- worth the trouble */
-
- if(sysent[SYS_setgroups].sy_call !=
- aout_sysent[SYS_setgroups].sy_call){
- printf("%s: ELF and a.out setgroups syscalls differ!\n",
- __FUNCTION__);
- return ret;
- }
-#endif
-#ifdef AFS_SYSCALL
- if (ret != 0) {
- ret = try_install_syscall(AFS_SYSCALL,
- nnpfs_syscallent,
- &old_syscallent);
- if (ret == 0)
- nnpfs_syscall_num = AFS_SYSCALL;
- }
-#endif
- if (ret != 0)
- ret = install_first_free_syscall (&nnpfs_syscall_num,
- nnpfs_syscallent,
- &old_syscallent);
- if (ret != 0)
- NNPFSDEB(XDEBSYS, ("failed installing nnpfs_syscall\n"));
- if (ret == 0) {
- old_setgroups = sysent[SYS_setgroups];
- old_setgroups_func = old_setgroups.sy_call;
- sysent[SYS_setgroups].sy_call = nnpfs_setgroups;
-#ifdef HAVE_KERNEL_AOUT_SYSENT
- aout_sysent[SYS_setgroups].sy_call = nnpfs_setgroups;
-#endif
- }
- return ret;
-}
-
-int
-nnpfs_uninstall_syscalls(void)
-{
- if (nnpfs_syscall_num) {
- sysent[nnpfs_syscall_num] = old_syscallent;
- sysent[SYS_setgroups] = old_setgroups;
-#ifdef HAVE_KERNEL_AOUT_SYSENT
- aout_sysent[nnpfs_syscall_num] = old_syscallent;
- aout_sysent[SYS_setgroups] = old_setgroups;
-#endif
- }
- return 0;
-}
-
-int
-nnpfs_stat_syscalls(void)
-{
- return 0;
-}
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_vfsops-bsd.c b/usr.sbin/afs/src/nnpfs/bsd/nnpfs_vfsops-bsd.c
deleted file mode 100644
index 8b51d9ba0c5..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_vfsops-bsd.c
+++ /dev/null
@@ -1,530 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <nnpfs/nnpfs_locl.h>
-
-RCSID("$arla: nnpfs_vfsops-bsd.c,v 1.72 2002/12/19 10:30:17 lha Exp $");
-
-/*
- * NNPFS vfs operations.
- */
-
-#include <nnpfs/nnpfs_common.h>
-#include <nnpfs/nnpfs_message.h>
-#include <nnpfs/nnpfs_fs.h>
-#include <nnpfs/nnpfs_dev.h>
-#include <nnpfs/nnpfs_deb.h>
-#include <nnpfs/nnpfs_vfsops.h>
-#include <nnpfs/nnpfs_vfsops-bsd.h>
-#include <nnpfs/nnpfs_vnodeops.h>
-
-int
-nnpfs_mount_caddr(struct mount *mp,
- const char *user_path,
- caddr_t user_data,
- struct nameidata *ndp,
- d_thread_t *p)
-{
- return nnpfs_mount_common(mp, user_path, user_data, ndp, p);
-}
-
-int
-nnpfs_start(struct mount * mp, int flags, d_thread_t * p)
-{
- NNPFSDEB(XDEBVFOPS, ("nnpfs_start mp = %lx, flags = %d, proc = %lx\n",
- (unsigned long)mp, flags, (unsigned long)p));
- return 0;
-}
-
-
-int
-nnpfs_unmount(struct mount * mp, int mntflags, d_thread_t *p)
-{
- NNPFSDEB(XDEBVFOPS, ("nnpfs_umount: mp = %lx, mntflags = %d, proc = %lx\n",
- (unsigned long)mp, mntflags, (unsigned long)p));
- return nnpfs_unmount_common(mp, mntflags);
-}
-
-int
-nnpfs_root(struct mount *mp, struct vnode **vpp)
-{
- NNPFSDEB(XDEBVFOPS, ("nnpfs_root mp = %lx\n", (unsigned long)mp));
-#ifdef HAVE_FREEBSD_THREAD
- return nnpfs_root_common(mp, vpp, nnpfs_curthread(), nnpfs_curthread()->td_proc->p_ucred);
-#else
- return nnpfs_root_common(mp, vpp, nnpfs_curproc(), nnpfs_curproc()->p_ucred);
-#endif
-}
-
-int
-nnpfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg, d_thread_t *p)
-{
- NNPFSDEB(XDEBVFOPS, ("nnpfs_quotactl: mp = %lx, cmd = %d, uid = %u, "
- "arg = %lx, proc = %lx\n",
- (unsigned long)mp, cmd, uid,
- (unsigned long)arg, (unsigned long)p));
- return EOPNOTSUPP;
-}
-
-int
-nnpfs_statfs(struct mount *mp, struct statfs *sbp, d_thread_t *p)
-{
- NNPFSDEB(XDEBVFOPS, ("nnpfs_statfs: mp = %lx, sbp = %lx, proc = %lx\n",
- (unsigned long)mp,
- (unsigned long)sbp,
- (unsigned long)p));
- bcopy(&mp->mnt_stat, sbp, sizeof(*sbp));
- return 0;
-}
-
-int
-nnpfs_sync(struct mount *mp, int waitfor, struct ucred *cred, d_thread_t *p)
-{
- NNPFSDEB(XDEBVFOPS, ("nnpfs_sync: mp = %lx, waitfor = %d, "
- "cred = %lx, proc = %lx\n",
- (unsigned long)mp,
- waitfor,
- (unsigned long)cred,
- (unsigned long)p));
- return 0;
-}
-
-int
-nnpfs_vget(struct mount * mp,
-#ifdef __APPLE__
- void *ino,
-#else
- ino_t ino,
-#endif
- struct vnode ** vpp)
-{
- NNPFSDEB(XDEBVFOPS, ("nnpfs_vget\n"));
- return EOPNOTSUPP;
-}
-
-static int
-common_fhtovp(struct mount * mp,
- struct fid * fhp,
- struct vnode ** vpp)
-{
-#ifdef ARLA_KNFS
- struct netcred *np = NULL;
- struct nnpfs_node *xn;
- struct vnode *vp;
- nnpfs_handle handle;
- int error;
-
- NNPFSDEB(XDEBVFOPS, ("nnpfs_fhtovp\n"));
-
- if (fhp->fid_len != 16) {
- printf("nnpfs_fhtovp: *PANIC* got a invalid length of a fid\n");
- return EINVAL;
- }
-
- memcpy(&handle, fhp->fid_data, sizeof(handle));
- NNPFSDEB(XDEBVFOPS, ("nnpfs_fhtovp: fid: %d.%d.%d.%d\n",
- handle.a, handle.d, handle.c, handle.d));
-
- NNPFSDEB(XDEBVFOPS, ("nnpfs_fhtovp: nnpfs_vnode_find\n"));
- xn = nnpfs_node_find(&nnpfs[0].nodehead, &handle);
-
- if (xn == NULL) {
- struct nnpfs_message_getattr msg;
-
- error = nnpfs_getnewvnode(nnpfs[0].mp, &vp, &handle);
- if (error)
- return error;
-
- nnpfs_do_vget(vp, 0, curproc);
-
- } else {
- /* XXX access ? */
- vp = XNODE_TO_VNODE(xn);
-
- /* XXX wrong ? (we tell arla below) */
- if (vp->v_usecount <= 0)
- nnpfs_do_vget(vp, 0, curproc);
- else
- VREF(vp);
- error = 0;
- }
-
- *vpp = vp;
-
- if (error == 0) {
- NNPFSDEB(XDEBVFOPS, ("nnpfs_fhtovp done\n"));
-
- /*
- * XXX tell arla about this node is hold by nfsd.
- * There need to be code in nnpfs_write too.
- */
- } else
- NNPFSDEB(XDEBVFOPS, ("nnpfs_fhtovp failed (%d)\n", error));
-
- return error;
-#else /* !ARLA_KNFS */
- return EOPNOTSUPP;
-#endif /* !ARLA_KNFS */
-}
-
-/* new style fhtovp */
-
-#ifdef HAVE_STRUCT_VFSOPS_VFS_CHECKEXP
-int
-nnpfs_fhtovp(struct mount * mp,
- struct fid * fhp,
- struct vnode ** vpp)
-{
- return common_fhtovp (mp, fhp, vpp);
-}
-
-#else /* !HAVE_STRUCT_VFSOPS_VFS_CHECKEXP */
-
-/* old style fhtovp */
-
-int
-nnpfs_fhtovp(struct mount * mp,
- struct fid * fhp,
- struct mbuf * nam,
- struct vnode ** vpp,
- int *exflagsp,
- struct ucred ** credanonp)
-{
- static struct ucred fhtovpcred;
- int error;
-
- /* XXX: Should see if we is exported to this client */
-#if 0
- np = vfs_export_lookup(mp, &ump->um_export, nam);
- if (np == NULL)
- return EACCES;
-#endif
- error = common_fhtovp(mp, fhp, vpp);
- if (error == 0) {
- fhtovpcred.cr_uid = 0;
- fhtovpcred.cr_gid = 0;
- fhtovpcred.cr_ngroups = 0;
-
-#ifdef MNT_EXPUBLIC
- *exflagsp = MNT_EXPUBLIC;
-#else
- *exflagsp = 0;
-#endif
- *credanonp = &fhtovpcred;
- }
- return error;
-}
-#endif /* !HAVE_STRUCT_VFSOPS_VFS_CHECKEXP */
-
-int
-nnpfs_checkexp (struct mount *mp,
-#ifdef __FreeBSD__
- struct sockaddr *nam,
-#else
- struct mbuf *nam,
-#endif
- int *exflagsp,
- struct ucred **credanonp)
-{
- struct netcred *np;
-
- NNPFSDEB(XDEBVFOPS, ("nnpfs_checkexp\n"));
-
-#if 0
- np = vfs_export_lookup(mp, &ump->um_export, nam);
- if (np == NULL)
- return EACCES;
-#endif
- return 0;
-}
-
-int
-nnpfs_vptofh(struct vnode * vp,
- struct fid * fhp)
-{
-#ifdef ARLA_KNFS
- struct nnpfs_node *xn;
- NNPFSDEB(XDEBVFOPS, ("nnpfs_vptofh\n"));
-
- if (MAXFIDSZ < 16)
- return EOPNOTSUPP;
-
- xn = VNODE_TO_XNODE(vp);
-
- if (xn == NULL)
- return EINVAL;
-
- fhp->fid_len = 16;
- memcpy(fhp->fid_data, &xn->handle, 16);
-
- return 0;
-#else
- NNPFSDEB(XDEBVFOPS, ("nnpfs_vptofh\n"));
- return EOPNOTSUPP;
-#endif
-}
-
-/*
- * nnpfs complete dead vnodes implementation.
- *
- * this is because the dead_vnodeops_p is _not_ filesystem, but rather
- * a part of the vfs-layer.
- */
-
-int
-nnpfs_dead_lookup(struct vop_lookup_args * ap)
- /* struct vop_lookup_args {
- struct vnodeop_desc *a_desc;
- struct vnode *a_dvp;
- struct vnode **a_vpp;
- struct componentname *a_cnp;
-}; */
-{
- *ap->a_vpp = NULL;
- return ENOTDIR;
-}
-
-/*
- * Given `fsid', `fileid', and `gen', return in `vpp' a locked and
- * ref'ed vnode from that file system with that id and generation.
- * All is done in the context of `proc'. Returns 0 if succesful, and
- * error otherwise.
- */
-
-int
-nnpfs_fhlookup (d_thread_t *proc,
- struct nnpfs_fhandle_t *fhp,
- struct vnode **vpp)
-{
- int error;
- struct mount *mp;
-#if !(defined(HAVE_GETFH) && defined(HAVE_FHOPEN))
- struct ucred *cred = proc->p_ucred;
- struct vattr vattr;
- fsid_t fsid;
- struct nnpfs_fh_args *fh_args = (struct nnpfs_fh_args *)fhp->fhdata;
-
- NNPFSDEB(XDEBVFOPS, ("nnpfs_fhlookup (nnpfs)\n"));
-
- error = nnpfs_suser (proc);
- if (error)
- return EPERM;
-
- if (fhp->len < sizeof(struct nnpfs_fh_args))
- return EINVAL;
-
- fsid = SCARG(fh_args, fsid);
-
- mp = nnpfs_vfs_getvfs (&fsid);
- if (mp == NULL)
- return ENXIO;
-
-#ifdef __APPLE__
- {
- uint32_t ino = SCARG(fh_args, fileid);
- error = VFS_VGET(mp, &ino, vpp);
- }
-#else
- error = VFS_VGET(mp, SCARG(fh_args, fileid), vpp);
-#endif
-
- if (error)
- return error;
-
- if (*vpp == NULL)
- return ENOENT;
-
- error = VOP_GETATTR(*vpp, &vattr, cred, proc);
- if (error) {
- vput(*vpp);
- return error;
- }
-
- if (vattr.va_gen != SCARG(fh_args, gen)) {
- vput(*vpp);
- return ENOENT;
- }
-#else /* HAVE_GETFH && HAVE_FHOPEN */
- {
- fhandle_t *fh = (fhandle_t *) fhp;
-
- NNPFSDEB(XDEBVFOPS, ("nnpfs_fhlookup (native)\n"));
-
- mp = nnpfs_vfs_getvfs (&fh->fh_fsid);
- if (mp == NULL)
- return ESTALE;
-
- if ((error = VFS_FHTOVP(mp, &fh->fh_fid, vpp)) != 0) {
- *vpp = NULL;
- return error;
- }
- }
-#endif /* HAVE_GETFH && HAVE_FHOPEN */
-
-#ifdef HAVE_KERNEL_VFS_OBJECT_CREATE
- if ((*vpp)->v_type == VREG && (*vpp)->v_object == NULL)
-#ifdef HAVE_FREEBSD_THREAD
- nnpfs_vfs_object_create (*vpp, proc, proc->td_proc->p_ucred);
-#else
- nnpfs_vfs_object_create (*vpp, proc, proc->p_ucred);
-#endif
-#elif __APPLE__
- if ((*vpp)->v_type == VREG && (!UBCINFOEXISTS(*vpp))) {
- ubc_info_init(*vpp);
- }
- ubc_hold(*vpp);
-#endif
- return 0;
-}
-
-
-
-/*
- * Perform an open operation on the vnode identified by a `nnpfs_fhandle_t'
- * (see nnpfs_fhlookup) with flags `user_flags'. Returns 0 or
- * error. If succsesful, the file descriptor is returned in `retval'.
- */
-
-extern struct fileops vnops; /* sometimes declared in <file.h> */
-
-int
-nnpfs_fhopen (d_thread_t *proc,
- struct nnpfs_fhandle_t *fhp,
- int user_flags,
- register_t *retval)
-{
- int error;
- struct vnode *vp;
-#ifdef HAVE_FREEBSD_THREAD
- struct ucred *cred = proc->td_proc->p_ucred;
-#else
- struct ucred *cred = proc->p_ucred;
-#endif
- int flags = FFLAGS(user_flags);
- int index;
- struct file *fp;
- int mode;
- struct nnpfs_fhandle_t fh;
-
- NNPFSDEB(XDEBVFOPS, ("nnpfs_fhopen: flags = %d\n", user_flags));
-
- error = copyin (fhp, &fh, sizeof(fh));
- if (error)
- return error;
-
- error = nnpfs_fhlookup (proc, &fh, &vp);
- NNPFSDEB(XDEBVFOPS, ("nnpfs_fhlookup returned %d\n", error));
- if (error)
- return error;
-
- switch (vp->v_type) {
- case VDIR :
- case VREG :
- break;
- case VLNK :
- error = EMLINK;
- goto out;
- default :
- error = EOPNOTSUPP;
- goto out;
- }
-
- mode = 0;
- if (flags & FWRITE) {
- switch (vp->v_type) {
- case VREG :
- break;
- case VDIR :
- error = EISDIR;
- goto out;
- default :
- error = EOPNOTSUPP;
- goto out;
- }
-
- error = vn_writechk (vp);
- if (error)
- goto out;
-
- mode |= VWRITE;
- }
- if (flags & FREAD)
- mode |= VREAD;
-
- if (mode) {
- error = VOP_ACCESS(vp, mode, cred, proc);
- if (error)
- goto out;
- }
-
- error = VOP_OPEN(vp, flags, cred, proc);
- if (error)
- goto out;
-
- error = falloc(proc, &fp, &index);
- if (error)
- goto out;
-
- if (flags & FWRITE)
- vp->v_writecount++;
-
-#if defined(__FreeBSD_version) && __FreeBSD_version >= 300000
- if (vp->v_type == VREG) {
-#ifdef HAVE_FREEBSD_THREAD
- error = nnpfs_vfs_object_create(vp, proc, proc->td_proc->p_ucred);
-#else
- error = nnpfs_vfs_object_create(vp, proc, proc->p_ucred);
-#endif
- if (error)
- goto out;
- }
-#endif
-
- fp->f_flag = flags & FMASK;
- fp->f_type = DTYPE_VNODE;
- fp->f_ops = &vnops;
- fp->f_data = (caddr_t)vp;
- nnpfs_vfs_unlock(vp, proc);
- *retval = index;
-#ifdef FILE_UNUSE
- FILE_UNUSE(fp, proc);
-#endif
-#ifdef __APPLE__
- *fdflags(proc, index) &= ~UF_RESERVED;
-#endif
- return 0;
-out:
- NNPFSDEB(XDEBVFOPS, ("nnpfs_fhopen: error = %d\n", error));
- vput(vp);
- return error;
-}
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_vfsops-common.c b/usr.sbin/afs/src/nnpfs/bsd/nnpfs_vfsops-common.c
deleted file mode 100644
index 66361c1a706..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_vfsops-common.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <nnpfs/nnpfs_locl.h>
-
-RCSID("$arla: nnpfs_vfsops-common.c,v 1.40 2003/06/02 18:26:40 lha Exp $");
-
-/*
- * NNPFS vfs operations.
- */
-
-#include <nnpfs/nnpfs_common.h>
-#include <nnpfs/nnpfs_message.h>
-#include <nnpfs/nnpfs_fs.h>
-#include <nnpfs/nnpfs_dev.h>
-#include <nnpfs/nnpfs_deb.h>
-#include <nnpfs/nnpfs_syscalls.h>
-#include <nnpfs/nnpfs_vfsops.h>
-
-#ifdef HAVE_KERNEL_UDEV2DEV
-#define VA_RDEV_TO_DEV(x) udev2dev(x, 0) /* XXX what is the 0 */
-#else
-#define VA_RDEV_TO_DEV(x) x
-#endif
-
-
-struct nnpfs nnpfs[NNNPFS];
-
-/*
- * path and data is in system memory
- */
-
-int
-nnpfs_mount_common_sys(struct mount *mp,
- const char *path,
- void *data,
- struct nameidata *ndp,
- d_thread_t *p)
-{
- struct vnode *devvp;
- dev_t dev;
- int error;
- struct vattr vat;
-
- NNPFSDEB(XDEBVFOPS, ("nnpfs_mount: "
- "struct mount mp = %lx path = '%s' data = '%s'\n",
- (unsigned long)mp, path, (char *)data));
-
-#ifdef ARLA_KNFS
- NNPFSDEB(XDEBVFOPS, ("nnpfs_mount: mount flags = %x\n", mp->mnt_flag));
-
- /*
- * mountd(8) flushes all export entries when it starts
- * right now we ignore it (but should not)
- */
-
- if (mp->mnt_flag & MNT_UPDATE ||
- mp->mnt_flag & MNT_DELEXPORT) {
-
- NNPFSDEB(XDEBVFOPS,
- ("nnpfs_mount: ignoreing MNT_UPDATE or MNT_DELEXPORT\n"));
- return 0;
- }
-#endif
-
- NDINIT(ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, data, p);
- error = namei(ndp);
- if (error) {
- NNPFSDEB(XDEBVFOPS, ("namei failed, errno = %d\n", error));
- return error;
- }
-
- devvp = ndp->ni_vp;
-
- if (devvp->v_type != VCHR) {
- vput(devvp);
- NNPFSDEB(XDEBVFOPS, ("not VCHR (%d)\n", devvp->v_type));
- return ENXIO;
- }
-#if defined(__osf__)
- VOP_GETATTR(devvp, &vat, ndp->ni_cred, error);
-#elif defined(HAVE_FREEBSD_THREAD)
- error = VOP_GETATTR(devvp, &vat, p->td_proc->p_ucred, p);
-#else
- error = VOP_GETATTR(devvp, &vat, p->p_ucred, p);
-#endif
- vput(devvp);
- if (error) {
- NNPFSDEB(XDEBVFOPS, ("VOP_GETATTR failed, error = %d\n", error));
- return error;
- }
-
- dev = VA_RDEV_TO_DEV(vat.va_rdev);
-
- NNPFSDEB(XDEBVFOPS, ("dev = %d.%d\n", major(dev), minor(dev)));
-
- if (!nnpfs_is_nnpfs_dev (dev)) {
- NNPFSDEB(XDEBVFOPS, ("%s is not a nnpfs device\n", (char *)data));
- return ENXIO;
- }
-
- if (nnpfs[minor(dev)].status & NNPFS_MOUNTED)
- return EBUSY;
-
- nnpfs[minor(dev)].status = NNPFS_MOUNTED;
- nnpfs[minor(dev)].mp = mp;
- nnpfs[minor(dev)].root = 0;
- nnpfs[minor(dev)].nnodes = 0;
- nnpfs[minor(dev)].fd = minor(dev);
-
- nnfs_init_head(&nnpfs[minor(dev)].nodehead);
-
- VFS_TO_NNPFS(mp) = &nnpfs[minor(dev)];
-#if defined(HAVE_KERNEL_VFS_GETNEWFSID)
-#if defined(HAVE_TWO_ARGUMENT_VFS_GETNEWFSID)
- vfs_getnewfsid(mp, MOUNT_AFS);
-#else
- vfs_getnewfsid(mp);
-#endif /* HAVE_TWO_ARGUMENT_VFS_GETNEWFSID */
-#endif /* HAVE_KERNEL_VFS_GETNEWFSID */
-
- mp->mnt_stat.f_bsize = DEV_BSIZE;
-#ifndef __osf__
- mp->mnt_stat.f_iosize = DEV_BSIZE;
- mp->mnt_stat.f_owner = 0;
-#endif
- mp->mnt_stat.f_blocks = 4711 * 4711;
- mp->mnt_stat.f_bfree = 4711 * 4711;
- mp->mnt_stat.f_bavail = 4711 * 4711;
- mp->mnt_stat.f_files = 4711;
- mp->mnt_stat.f_ffree = 4711;
- mp->mnt_stat.f_flags = mp->mnt_flag;
-
-#ifdef __osf__
- mp->mnt_stat.f_fsid.val[0] = dev;
- mp->mnt_stat.f_fsid.val[1] = MOUNT_NNPFS;
-
- MALLOC(mp->m_stat.f_mntonname, char *, strlen(path) + 1,
- M_PATHNAME, M_WAITOK);
- strcpy(mp->m_stat.f_mntonname, path);
-
- MALLOC(mp->m_stat.f_mntfromname, char *, sizeof("arla"),
- M_PATHNAME, M_WAITOK);
- strcpy(mp->m_stat.f_mntfromname, "arla");
-#else /* __osf__ */
- strncpy(mp->mnt_stat.f_mntonname,
- path,
- sizeof(mp->mnt_stat.f_mntonname));
-
- strncpy(mp->mnt_stat.f_mntfromname,
- "arla",
- sizeof(mp->mnt_stat.f_mntfromname));
-
- strncpy(mp->mnt_stat.f_fstypename,
- "nnpfs",
- sizeof(mp->mnt_stat.f_fstypename));
-#endif /* __osf__ */
-
- return 0;
-}
-
-int
-nnpfs_mount_common(struct mount *mp,
- const char *user_path,
- void *user_data,
- struct nameidata *ndp,
- d_thread_t *p)
-{
- char path[MAXPATHLEN];
- char data[MAXPATHLEN];
- size_t count;
- int error;
-
- error = copyinstr(user_path, path, MAXPATHLEN, &count);
- if (error)
- return error;
-
- error = copyinstr(user_data, data, MAXPATHLEN, &count);
- if (error)
- return error;
- return nnpfs_mount_common_sys (mp, path, data, ndp, p);
-}
-
-#ifdef HAVE_KERNEL_DOFORCE
-extern int doforce;
-#endif
-
-int
-nnpfs_unmount_common(struct mount *mp, int mntflags)
-{
- struct nnpfs *nnpfsp = VFS_TO_NNPFS(mp);
- int flags = 0;
- int error;
-
- if (mntflags & MNT_FORCE) {
-#ifdef HAVE_KERNEL_DOFORCE
- if (!doforce)
- return EINVAL;
-#endif
- flags |= FORCECLOSE;
- }
-
- error = free_all_nnpfs_nodes(nnpfsp, flags, 1);
- if (error)
- return error;
-
- nnpfsp->status = 0;
- NNPFS_TO_VFS(nnpfsp) = NULL;
- return 0;
-}
-
-int
-nnpfs_root_common(struct mount *mp, struct vnode **vpp,
- d_thread_t *proc, struct ucred *cred)
-{
- struct nnpfs *nnpfsp = VFS_TO_NNPFS(mp);
- struct nnpfs_message_getroot msg;
- int error;
-
- do {
- if (nnpfsp->root != NULL) {
- *vpp = XNODE_TO_VNODE(nnpfsp->root);
- nnpfs_do_vget(*vpp, LK_EXCLUSIVE, proc);
- return 0;
- }
- msg.header.opcode = NNPFS_MSG_GETROOT;
- msg.cred.uid = cred->cr_uid;
- msg.cred.pag = nnpfs_get_pag(cred);
- error = nnpfs_message_rpc(nnpfsp->fd, &msg.header, sizeof(msg), proc);
- if (error == 0)
- error = ((struct nnpfs_message_wakeup *) & msg)->error;
- } while (error == 0);
- /*
- * Failed to get message through, need to pretend that all went well
- * and return a fake dead vnode to be able to unmount.
- */
-
- if ((error = nnpfs_make_dead_vnode(mp, vpp)))
- return error;
-
- NNPFS_MAKE_VROOT(*vpp);
- return 0;
-}
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_vfsops-openbsd.c b/usr.sbin/afs/src/nnpfs/bsd/nnpfs_vfsops-openbsd.c
deleted file mode 100644
index 3436f8233c0..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_vfsops-openbsd.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <nnpfs/nnpfs_locl.h>
-
-RCSID("$arla: nnpfs_vfsops-openbsd.c,v 1.16 2003/06/02 18:26:50 lha Exp $");
-
-#include <nnpfs/nnpfs_common.h>
-#include <nnpfs/nnpfs_message.h>
-#include <nnpfs/nnpfs_fs.h>
-#include <nnpfs/nnpfs_dev.h>
-#include <nnpfs/nnpfs_deb.h>
-#include <nnpfs/nnpfs_vfsops.h>
-#include <nnpfs/nnpfs_vfsops-bsd.h>
-#include <nnpfs/nnpfs_vnodeops.h>
-
-static vop_t **nnpfs_dead_vnodeop_p;
-
-int
-nnpfs_make_dead_vnode(struct mount *mp, struct vnode **vpp)
-{
- NNPFSDEB(XDEBNODE, ("make_dead_vnode mp = %lx\n",
- (unsigned long)mp));
-
- return getnewvnode(VT_NON, mp, nnpfs_dead_vnodeop_p, vpp);
-}
-
-static struct vnodeopv_entry_desc nnpfs_dead_vnodeop_entries[] = {
- {&vop_default_desc, (vop_t *) nnpfs_eopnotsupp},
- {&vop_lookup_desc, (vop_t *) nnpfs_dead_lookup},
- {&vop_reclaim_desc, (vop_t *) nnpfs_returnzero},
- {&vop_lock_desc, (vop_t *) vop_generic_lock},
- {&vop_unlock_desc, (vop_t *) vop_generic_unlock},
- {&vop_islocked_desc,(vop_t *) vop_generic_islocked},
- {NULL, NULL}};
-
-static struct vnodeopv_desc nnpfs_dead_vnodeop_opv_desc =
-{&nnpfs_dead_vnodeop_p, nnpfs_dead_vnodeop_entries};
-
-extern struct vnodeopv_desc nnpfs_vnodeop_opv_desc;
-
-static int
-nnpfs_init(struct vfsconf *vfs)
-{
- NNPFSDEB(XDEBVFOPS, ("nnpfs_init\n"));
- vfs_opv_init_explicit(&nnpfs_vnodeop_opv_desc);
- vfs_opv_init_default(&nnpfs_vnodeop_opv_desc);
- vfs_opv_init_explicit(&nnpfs_dead_vnodeop_opv_desc);
- vfs_opv_init_default(&nnpfs_dead_vnodeop_opv_desc);
- return 0;
-}
-
-struct vfsops nnpfs_vfsops = {
-#ifdef HAVE_STRUCT_VFSOPS_VFS_MOUNT
- nnpfs_mount_common,
-#else
- nnpfs_mount_caddr,
-#endif
- nnpfs_start,
- nnpfs_unmount,
- nnpfs_root,
- nnpfs_quotactl,
- nnpfs_statfs,
- nnpfs_sync,
- nnpfs_vget,
- nnpfs_fhtovp,
- nnpfs_vptofh,
- nnpfs_init,
- NULL,
-#ifdef HAVE_STRUCT_VFSOPS_VFS_CHECKEXP
- nnpfs_checkexp, /* checkexp */
-#endif
-};
-
-static struct vfsconf nnpfs_vfc = {
- &nnpfs_vfsops,
- "nnpfs",
- 0,
- 0,
- 0,
- NULL,
- NULL
-};
-
-#ifndef HAVE_KERNEL_VFS_REGISTER
-
-static int
-vfs_register (struct vfsconf *vfs)
-{
- struct vfsconf *vfsp;
- struct vfsconf **vfspp;
-
- /* Check if filesystem already known */
- for (vfspp = &vfsconf, vfsp = vfsconf;
- vfsp;
- vfspp = &vfsp->vfc_next, vfsp = vfsp->vfc_next)
- if (strcmp(vfsp->vfc_name, vfs->vfc_name) == 0)
- return (EEXIST);
-
- maxvfsconf++;
-
- /* Add to the end of the list */
- *vfspp = vfs;
-
- vfs->vfc_next = NULL;
-
- /* Call vfs_init() */
- NNPFSDEB(XDEBVFOPS, ("calling vfs_init\n"));
- (*(vfs->vfc_vfsops->vfs_init)) (vfs);
-
- /* done! */
-
- return 0;
-}
-
-static int
-vfs_unregister (struct vfsconf *vfs)
-{
- struct vfsconf *vfsp;
- struct vfsconf **vfspp;
-
- /* Find our vfsconf struct */
- for (vfspp = &vfsconf, vfsp = vfsconf;
- vfsp;
- vfspp = &vfsp->vfc_next, vfsp = vfsp->vfc_next)
- if (strcmp(vfsp->vfc_name, vfs->vfc_name) == 0)
- break;
-
- if (!vfsp) /* Not found */
- return (ENOENT);
-
- if (vfsp->vfc_refcount) /* In use */
- return (EBUSY);
-
- /* Remove from list and free */
- *vfspp = vfsp->vfc_next;
-
- maxvfsconf--;
-
- return 0;
-}
-
-#endif
-
-int
-nnpfs_install_filesys(void)
-{
- return vfs_register (&nnpfs_vfc);
-}
-
-int
-nnpfs_uninstall_filesys(void)
-{
- return vfs_unregister (&nnpfs_vfc);
-}
-
-int
-nnpfs_stat_filesys (void)
-{
- return 0;
-}
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_vnodeops-bsd.c b/usr.sbin/afs/src/nnpfs/bsd/nnpfs_vnodeops-bsd.c
deleted file mode 100644
index da0b4b017c7..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_vnodeops-bsd.c
+++ /dev/null
@@ -1,1564 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * NNPFS operations.
- */
-
-#ifdef __APPLE__
-#define MACH_KERNEL 1
-#endif
-
-#include <nnpfs/nnpfs_locl.h>
-#include <nnpfs/nnpfs_message.h>
-#include <nnpfs/nnpfs_common.h>
-#include <nnpfs/nnpfs_fs.h>
-#include <nnpfs/nnpfs_dev.h>
-#include <nnpfs/nnpfs_deb.h>
-#include <nnpfs/nnpfs_syscalls.h>
-#include <nnpfs/nnpfs_vnodeops.h>
-#ifdef HAVE_VM_VNODE_PAGER_H
-#include <vm/vnode_pager.h>
-#endif
-
-RCSID("$arla: nnpfs_vnodeops-bsd.c,v 1.123 2003/02/15 16:40:36 lha Exp $");
-
-/*
- * vnode functions
- */
-
-#ifdef HAVE_VOP_OPEN
-int
-nnpfs_open(struct vop_open_args * ap)
- /*
- struct vop_open {
- struct vnode *vp;
- int mode;
- struct ucred *cred;
- struct proc *p;
- }; */
-{
-#ifdef HAVE_FREEBSD_THREAD
- return nnpfs_open_common (ap->a_vp, ap->a_mode, ap->a_cred, ap->a_td);
-#else
- return nnpfs_open_common (ap->a_vp, ap->a_mode, ap->a_cred, ap->a_p);
-#endif
-}
-#endif /* HAVE_VOP_OPEN */
-
-#ifdef HAVE_VOP_FSYNC
-int
-nnpfs_fsync(struct vop_fsync_args * ap)
- /*
- vop_fsync {
- struct vnode *vp;
- struct ucred *cred;
- int waitfor;
- struct proc *p;
-}; */
-{
-#ifdef HAVE_STRUCT_VOP_FSYNC_ARGS_A_FLAGS
- return nnpfs_fsync_common(ap->a_vp, ap->a_cred, ap->a_flags, ap->a_p);
-#else
-#ifdef HAVE_FREEBSD_THREAD
- return nnpfs_fsync_common(ap->a_vp, ap->a_cred, ap->a_waitfor, ap->a_td);
-#else
- return nnpfs_fsync_common(ap->a_vp, ap->a_cred, ap->a_waitfor, ap->a_p);
-#endif
-#endif
-}
-#endif /* HAVE_VOP_FSYNC */
-
-#ifdef HAVE_VOP_CLOSE
-int
-nnpfs_close(struct vop_close_args * ap)
- /* vop_close {
- IN struct vnode *vp;
- IN int fflag;
- IN struct ucred *cred;
- IN struct proc *p;
- }; */
-{
-#ifdef HAVE_FREEBSD_THREAD
- return nnpfs_close_common(ap->a_vp, ap->a_fflag, ap->a_td, ap->a_cred);
-#else
- return nnpfs_close_common(ap->a_vp, ap->a_fflag, ap->a_p, ap->a_cred);
-#endif
-}
-#endif /* HAVE_VOP_CLOSE */
-
-#ifdef HAVE_VOP_READ
-int
-nnpfs_read(struct vop_read_args * ap)
- /* vop_read {
- IN struct vnode *vp;
- INOUT struct uio *uio;
- IN int ioflag;
- IN struct ucred *cred;
- }; */
-{
- return nnpfs_read_common(ap->a_vp, ap->a_uio, ap->a_ioflag, ap->a_cred);
-}
-#endif /* HAVE_VOP_READ */
-
-#ifdef HAVE_VOP_WRITE
-int
-nnpfs_write(struct vop_write_args * ap)
- /* vop_write {
- IN struct vnode *vp;
- INOUT struct uio *uio;
- IN int ioflag;
- IN struct ucred *cred;
- }; */
-{
- return nnpfs_write_common(ap->a_vp, ap->a_uio, ap->a_ioflag, ap->a_cred);
-}
-#endif /* HAVE_VOP_WRITE */
-
-#ifdef HAVE_VOP_IOCTL
-int
-nnpfs_ioctl(struct vop_ioctl_args * ap)
- /* struct vnode *vp,
- int com,
- caddr_t data,
- int flag,
- struct ucred *cred) */
-{
- NNPFSDEB(XDEBVNOPS, ("nnpfs_ioctl\n"));
-
- return EOPNOTSUPP;
-}
-#endif /* HAVE_VOP_IOCTL */
-
-#ifdef HAVE_VOP_SELECT
-int
-nnpfs_select(struct vop_select_args * ap)
- /* struct vnode *vp,
- int which,
- struct ucred *cred ) */
-{
- NNPFSDEB(XDEBVNOPS, ("nnpfs_select\n"));
-
- return EOPNOTSUPP;
-}
-#endif /* HAVE_VOP_SELECT */
-
-#ifdef HAVE_VOP_SEEK
-int
-nnpfs_seek(struct vop_seek_args * ap)
- /*
-struct vop_seek_args {
- struct vnodeop_desc *a_desc;
- struct vnode *a_vp;
- off_t a_oldoff;
- off_t a_newoff;
- struct ucred *a_cred;
-};
-*/
-{
- NNPFSDEB(XDEBVNOPS, ("nnpfs_seek\n"));
- return 0;
-}
-#endif /* HAVE_VOP_SEEK */
-
-#ifdef HAVE_VOP_POLL
-int
-nnpfs_poll(struct vop_poll_args * ap)
- /* vop_poll {
- IN struct vnode *vp;
- IN int events;
- IN struct proc *p;
- }; */
-{
- NNPFSDEB(XDEBVNOPS, ("nnpfs_poll\n"));
- return EOPNOTSUPP;
-}
-#endif /* HAVE_VOP_POLL */
-
-#ifdef HAVE_VOP_GETATTR
-int
-nnpfs_getattr(struct vop_getattr_args * ap)
- /* struct vnode *vp,
- struct vattr *vap,
- struct ucred *cred,
- struct proc *p) */
-{
-#ifdef HAVE_FREEBSD_THREAD
- return nnpfs_getattr_common(ap->a_vp, ap->a_vap, ap->a_cred, ap->a_td);
-#else
- return nnpfs_getattr_common(ap->a_vp, ap->a_vap, ap->a_cred, ap->a_p);
-#endif
-}
-#endif /* HAVE_VOP_GETATTR */
-
-#ifdef HAVE_VOP_SETATTR
-int
-nnpfs_setattr(struct vop_setattr_args * ap)
- /* struct vnode *vp,
- struct vattr *vap,
- struct ucred *cred,
- struct proc *p)
- */
-{
-#ifdef HAVE_FREEBSD_THREAD
- return nnpfs_setattr_common(ap->a_vp, ap->a_vap, ap->a_cred, ap->a_td);
-#else
- return nnpfs_setattr_common(ap->a_vp, ap->a_vap, ap->a_cred, ap->a_p);
-#endif
-}
-#endif /* HAVE_VOP_SETATTR */
-
-#ifdef HAVE_VOP_ACCESS
-int
-nnpfs_access(struct vop_access_args * ap)
- /*
-struct vnode *vp,
- int mode,
- struct ucred *cred,
- struct proc *p)
- */
-{
-#ifdef HAVE_FREEBSD_THREAD
- return nnpfs_access_common(ap->a_vp, ap->a_mode, ap->a_cred, ap->a_td);
-#else
- return nnpfs_access_common(ap->a_vp, ap->a_mode, ap->a_cred, ap->a_p);
-#endif
-}
-#endif /* HAVE_VOP_ACCESS */
-
-#ifdef HAVE_VOP_LOOKUP
-int
-nnpfs_lookup(struct vop_lookup_args * ap)
- /* struct vop_lookup_args {
- struct vnodeop_desc *a_desc;
- struct vnode *a_dvp;
- struct vnode **a_vpp;
- struct componentname *a_cnp;
-}; */
-{
- struct componentname *cnp = ap->a_cnp;
- int error;
- int lockparent = (cnp->cn_flags & (LOCKPARENT | ISLASTCN))
- == (LOCKPARENT | ISLASTCN);
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_lookup: (%s, %ld), nameiop = %lu, flags = %lu\n",
- cnp->cn_nameptr,
- cnp->cn_namelen,
- cnp->cn_nameiop,
- cnp->cn_flags));
-
-#ifdef PDIRUNLOCK
- cnp->cn_flags &= ~PDIRUNLOCK;
-#endif
-
- error = nnpfs_lookup_common(ap->a_dvp, cnp, ap->a_vpp);
-
- if (error == ENOENT
- && (cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME)
- && (cnp->cn_flags & ISLASTCN)) {
- error = EJUSTRETURN;
- }
-
- if (cnp->cn_nameiop != LOOKUP && cnp->cn_flags & ISLASTCN)
- cnp->cn_flags |= SAVENAME;
-
- if (error == 0 || error == EJUSTRETURN) {
- if (ap->a_dvp == *(ap->a_vpp)) {
- /* if we looked up ourself, do nothing */
- } else if (!(cnp->cn_flags & ISLASTCN) || !lockparent) {
- /* if we isn't last component and is isn't requested,
- * return parent unlocked */
-#ifdef HAVE_FREEBSD_THREAD
- nnpfs_vfs_unlock (ap->a_dvp, nnpfs_cnp_to_thread(cnp));
-#else
- nnpfs_vfs_unlock (ap->a_dvp, nnpfs_cnp_to_proc(cnp));
-#endif
-#ifdef PDIRUNLOCK
- cnp->cn_flags |= PDIRUNLOCK;
-#endif
- }
- } else {
- /* in case of a error do nothing */
- }
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_lookup: error = %d\n", error));
-
- return error;
-}
-#endif /* HAVE_VOP_LOOKUP */
-
-#ifdef HAVE_VOP_CACHEDLOOKUP
-int
-nnpfs_cachedlookup(struct vop_cachedlookup_args * ap)
- /* struct vop_cachedlookup_args {
- struct vnodeop_desc *a_desc;
- struct vnode *a_dvp;
- struct vnode **a_vpp;
- struct componentname *a_cnp;
-}; */
-{
- return nnpfs_lookup((struct vop_lookup_args *)ap);
-}
-#endif /* HAVE_VOP_CACHEDLOOKUP */
-
-/*
- * whatever clean-ups are needed for a componentname.
- */
-
-static void
-cleanup_cnp (struct componentname *cnp, int error)
-{
- if (error != 0 || (cnp->cn_flags & SAVESTART) == 0) {
-#if defined(HAVE_KERNEL_ZFREEI)
- zfreei(namei_zone, cnp->cn_pnbuf);
- cnp->cn_flags &= ~HASBUF;
-#elif defined(HAVE_KERNEL_UMA_ZFREE_ARG)
- uma_zfree_arg(namei_zone, cnp->cn_pnbuf, NULL);
- cnp->cn_flags &= ~HASBUF;
-#elif defined(FREE_ZONE)
- FREE_ZONE(cnp->cn_pnbuf, cnp->cn_pnlen, M_NAMEI);
-#elif defined(HAVE_KERNEL_ZFREE)
- zfree(namei_zone, cnp->cn_pnbuf);
- cnp->cn_flags &= ~HASBUF;
-#elif defined(PNBUF_PUT)
- PNBUF_PUT(cnp->cn_pnbuf);
-#else
- FREE (cnp->cn_pnbuf, M_NAMEI);
-#endif
- }
-}
-
-#ifdef HAVE_VOP_CREATE
-int
-nnpfs_create(struct vop_create_args *ap)
-{
- struct vnode *dvp = ap->a_dvp;
- struct componentname *cnp = ap->a_cnp;
- const char *name = cnp->cn_nameptr;
- struct ucred *cred = cnp->cn_cred;
-#ifdef HAVE_FREEBSD_THREAD
- d_thread_t *p = nnpfs_cnp_to_thread(cnp);
-#else
- d_thread_t *p = nnpfs_cnp_to_proc(cnp);
-#endif
- int error;
-
- error = nnpfs_create_common(dvp, name, ap->a_vap, cred, p);
-
- if (error == 0) {
- error = nnpfs_lookup_common(dvp, cnp, ap->a_vpp);
- }
-
- cleanup_cnp (cnp, error);
-
-#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
- vput (dvp);
-#endif
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_create: error = %d\n", error));
-
- return error;
-}
-#endif /* HAVE_VOP_CREATE */
-
-#ifdef HAVE_VOP_REMOVE
-int
-nnpfs_remove(struct vop_remove_args * ap)
- /* struct vnode *dvp,
- struct vnode *vp,
- struct componentname *cnp */
-{
- struct componentname *cnp = ap->a_cnp;
- struct vnode *dvp = ap->a_dvp;
- struct vnode *vp = ap->a_vp;
-
-#ifdef HAVE_FREEBSD_THREAD
- int error = nnpfs_remove_common(dvp, vp, cnp->cn_nameptr,
- cnp->cn_cred, nnpfs_cnp_to_thread(cnp));
-#else
- int error = nnpfs_remove_common(dvp, vp, cnp->cn_nameptr,
- cnp->cn_cred, nnpfs_cnp_to_proc(cnp));
-#endif
-
- cleanup_cnp (cnp, error);
-
-#if !defined(__FreeBSD__) || __FreeBSD_version < 300000
- if (dvp == vp)
- vrele(vp);
- else
- vput(vp);
- vput(dvp);
-#endif
-
-#ifdef __APPLE__
- if (error == 0) {
- if (UBCINFOEXISTS(vp)) {
- ubc_setsize(vp, 0);
- ubc_release(vp);
- ubc_uncache(vp);
- }
- }
-#endif
-
- return error;
-}
-#endif /* HAVE_VOP_REMOVE */
-
-#ifdef HAVE_VOP_RENAME
-int
-nnpfs_rename(struct vop_rename_args * ap)
- /* vop_rename {
- IN WILLRELE struct vnode *fdvp;
- IN WILLRELE struct vnode *fvp;
- IN struct componentname *fcnp;
- IN WILLRELE struct vnode *tdvp;
- IN WILLRELE struct vnode *tvp;
- IN struct componentname *tcnp;
- }; */
-{
- struct vnode *tdvp = ap->a_tdvp;
- struct vnode *tvp = ap->a_tvp;
- struct vnode *fdvp = ap->a_fdvp;
- struct vnode *fvp = ap->a_fvp;
-
- int error = nnpfs_rename_common(fdvp,
- fvp,
- ap->a_fcnp->cn_nameptr,
- tdvp,
- tvp,
- ap->a_tcnp->cn_nameptr,
- ap->a_tcnp->cn_cred,
-#ifdef HAVE_FREEBSD_THREAD
- nnpfs_cnp_to_thread (ap->a_fcnp));
-#else
- nnpfs_cnp_to_proc (ap->a_fcnp));
-#endif
- if(tdvp == tvp)
- vrele(tdvp);
- else
- vput(tdvp);
- if(tvp)
- vput(tvp);
- vrele(fdvp);
- vrele(fvp);
- return error;
-}
-#endif /* HAVE_VOP_RENAME */
-
-#ifdef HAVE_VOP_MKDIR
-int
-nnpfs_mkdir(struct vop_mkdir_args * ap)
- /* struct vnode *dvp,
- char *nm,
- struct vattr *va,
- struct vnode **vpp,
- struct ucred *cred) */
-{
- struct vnode *dvp = ap->a_dvp;
- struct componentname *cnp = ap->a_cnp;
- const char *name = cnp->cn_nameptr;
- struct ucred *cred = cnp->cn_cred;
-#ifdef HAVE_FREEBSD_THREAD
- d_thread_t *p = nnpfs_cnp_to_thread(cnp);
-#else
- d_thread_t *p = nnpfs_cnp_to_proc(cnp);
-#endif
- int error;
-
- error = nnpfs_mkdir_common(dvp, name, ap->a_vap, cred, p);
-
- if (error == 0)
- error = nnpfs_lookup_common(dvp, cnp, ap->a_vpp);
-
- cleanup_cnp (cnp, error);
-
-#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
- vput(dvp);
-#endif
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_mkdir: error = %d\n", error));
-
- return error;
-}
-#endif /* HAVE_VOP_MKDIR */
-
-#ifdef HAVE_VOP_RMDIR
-int
-nnpfs_rmdir(struct vop_rmdir_args * ap)
- /* struct vnode *dvp,
- struct vnode *vp,
- struct componentname *cnp */
-{
- struct componentname *cnp = ap->a_cnp;
- struct vnode *dvp = ap->a_dvp;
- struct vnode *vp = ap->a_vp;
- int error = nnpfs_rmdir_common(ap->a_dvp, ap->a_vp,
- cnp->cn_nameptr,
- cnp->cn_cred,
-#ifdef HAVE_FREEBSD_THREAD
- nnpfs_cnp_to_thread(cnp));
-#else
- nnpfs_cnp_to_proc(cnp));
-#endif
-
- cleanup_cnp (cnp, error);
-#if !defined(__FreeBSD__) || __FreeBSD_version < 300000
- if (dvp == vp)
- vrele(vp);
- else
- vput(vp);
- vput(dvp);
-#endif
-
- return error;
-}
-#endif /* HAVE_VOP_RMDIR */
-
-#ifdef HAVE_VOP_READDIR
-
-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
-typedef u_long nnpfs_cookie_t;
-#elif defined(__NetBSD__)
-typedef off_t nnpfs_cookie_t;
-#else
-#error dunno want kind of cookies you have
-#endif
-
-int
-nnpfs_readdir(struct vop_readdir_args * ap)
- /* struct vnode *vp,
- struct uio *uiop,
- struct ucred *cred) */
-{
- int error;
- off_t off;
-
- off = ap->a_uio->uio_offset;
-
- error = nnpfs_readdir_common(ap->a_vp, ap->a_uio, ap->a_cred,
-#ifdef HAVE_FREEBSD_THREAD
- nnpfs_uio_to_thread (ap->a_uio),
-#else
- nnpfs_uio_to_proc (ap->a_uio),
-#endif
- ap->a_eofflag);
-
- if (!error && ap->a_ncookies != NULL) {
- struct uio *uio = ap->a_uio;
- const struct dirent *dp, *dp_start, *dp_end;
- int ncookies;
- nnpfs_cookie_t *cookies, *cookiep;
-
- if (uio->uio_segflg != UIO_SYSSPACE || uio->uio_iovcnt != 1)
- panic("nnpfs_readdir: mail arla-drinkers and tell them to bake burned cookies");
- dp = (const struct dirent *)
- ((const char *)uio->uio_iov->iov_base - (uio->uio_offset - off));
-
- dp_end = (const struct dirent *) uio->uio_iov->iov_base;
- for (dp_start = dp, ncookies = 0;
- dp < dp_end;
- dp = (const struct dirent *)((const char *) dp + dp->d_reclen)) {
- if (dp->d_reclen <= 0)
- break;
- ncookies++;
- }
-
- MALLOC(cookies, nnpfs_cookie_t *, ncookies * sizeof(nnpfs_cookie_t),
- M_TEMP, M_WAITOK);
- for (dp = dp_start, cookiep = cookies;
- dp < dp_end;
- dp = (const struct dirent *)((const char *) dp + dp->d_reclen)) {
- if (dp->d_reclen <= 0)
- break;
- off += dp->d_reclen;
- *cookiep++ = off;
- }
- *ap->a_cookies = cookies;
- *ap->a_ncookies = ncookies;
- }
- return error;
-}
-#endif /* HAVE_VOP_READDIR */
-
-#ifdef HAVE_VOP_LINK
-int
-nnpfs_link(struct vop_link_args * ap)
- /*
- WILLRELE struct vnode *tdvp;
- struct vnode *vp;
- struct componentname *cnp;
- */
-{
- struct componentname *cnp = ap->a_cnp;
- struct vnode *vp = ap->a_vp;
- struct vnode *dvp;
-#ifdef HAVE_FREEBSD_THREAD
- d_thread_t *p = cnp->cn_thread;
-#else
- d_thread_t *p = cnp->cn_proc;
-#endif
- int error;
-
-#if defined (__OpenBSD__) || defined(__NetBSD__)
- dvp = ap->a_dvp;
-#elif defined(__FreeBSD__) || defined(__APPLE__)
- dvp = ap->a_tdvp;
-#else
-#error what kind of BSD is this?
-#endif
-
- if (vp->v_type == VDIR) {
-#ifdef HAVE_VOP_ABORTOP
- VOP_ABORTOP(dvp, cnp);
-#endif
- error = EPERM;
- goto out;
- }
- if (dvp->v_mount != vp->v_mount) {
-#ifdef HAVE_VOP_ABORTOP
- VOP_ABORTOP(dvp, cnp);
-#endif
- error = EXDEV;
- goto out;
- }
- /* FreeBSD 5.0 doesn't need to lock the vnode in VOP_LINK */
-#if !defined(__FreeBSD_version) || __FreeBSD_version < 500043
-
- if (dvp != vp && (error = nnpfs_vfs_writelock(vp, p))) {
-#ifdef HAVE_VOP_ABORTOP
- VOP_ABORTOP(dvp, cnp);
-#endif
- goto out;
- }
-#endif /* defined(__FreeBSD_version) || __FreeBSD_version < 500043 */
-
- error = nnpfs_link_common(
- dvp,
- vp,
- cnp->cn_nameptr,
- cnp->cn_cred,
-#ifdef HAVE_FREEBSD_THREAD
- nnpfs_cnp_to_thread (cnp));
-#else
- nnpfs_cnp_to_proc (cnp));
-#endif
-
- cleanup_cnp (cnp, error);
-
- if (dvp != vp)
- nnpfs_vfs_unlock(vp, p);
-
-out:
-#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
- vput(dvp);
-#endif
-
- return error;
-}
-#endif /* HAVE_VOP_LINK */
-
-#ifdef HAVE_VOP_SYMLINK
-int
-nnpfs_symlink(struct vop_symlink_args * ap)
- /*
- IN WILLRELE struct vnode *dvp;
- OUT WILLRELE struct vnode **vpp;
- IN struct componentname *cnp;
- IN struct vattr *vap;
- IN char *target;
- */
-{
- struct componentname *cnp = ap->a_cnp;
- struct vnode *dvp = ap->a_dvp;
- struct vnode **vpp = ap->a_vpp;
-
- int error = nnpfs_symlink_common(dvp,
- vpp,
- cnp,
- ap->a_vap,
- ap->a_target);
-
- if (error == 0) {
- error = nnpfs_lookup_common(dvp, cnp, vpp);
-#if (!defined(__FreeBSD__) || __FreeBSD_version < 400012) && (!defined(__NetBSD__) || __NetBSD_Version__ < 105240000) && (!defined(__OpenBSD__) || OpenBSD <= 200211)
- if (error == 0)
- vput (*vpp);
-#endif
- }
- cleanup_cnp (cnp, error);
-#if !defined(__FreeBSD__)
- vput(dvp);
-#endif
- return error;
-}
-#endif /* HAVE_VOP_SYMLINK */
-
-
-#ifdef HAVE_VOP_READLINK
-int
-nnpfs_readlink(struct vop_readlink_args * ap)
- /* struct vnode *vp,
- struct uio *uiop,
- struct ucred *cred) */
-{
- return nnpfs_readlink_common(ap->a_vp, ap->a_uio, ap->a_cred);
-}
-#endif /* HAVE_VOP_READLINK */
-
-#ifdef HAVE_VOP_INACTIVE
-int
-nnpfs_inactive(struct vop_inactive_args * ap)
- /*struct vnode *vp,
- struct ucred *cred)*/
-{
-#ifdef HAVE_FREEBSD_THREAD
- return nnpfs_inactive_common(ap->a_vp, nnpfs_curthread());
-#else
- return nnpfs_inactive_common(ap->a_vp, nnpfs_curproc());
-#endif
-}
-#endif /* HAVE_VOP_INACTICE */
-
-#ifdef HAVE_VOP_RECLAIM
-int
-nnpfs_reclaim(struct vop_reclaim_args * ap)
- /*struct vop_reclaim_args {
- struct vnodeop_desc *a_desc;
- struct vnode *a_vp;
-};*/
-{
- struct vnode *vp = ap->a_vp;
- int ret;
-
- ret = nnpfs_reclaim_common(vp);
- vp->v_data = NULL;
- return ret;
-}
-#endif /* HAVE_VOP_RECLAIM */
-
-/*
- * Do lock, unlock, and islocked with lockmgr if we have it.
- */
-
-#if defined(HAVE_KERNEL_LOCKMGR) || defined(HAVE_KERNEL_DEBUGLOCKMGR)
-
-#ifdef HAVE_VOP_LOCK
-int
-nnpfs_lock(struct vop_lock_args * ap)
-{
- struct vnode *vp = ap->a_vp;
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
- nnpfs_vnode_lock *l = &xn->lock;
- int flags = ap->a_flags;
- int ret;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_lock: %lx, flags 0x%x\n",
- (unsigned long)vp, flags));
-
- if (l == NULL)
- panic("nnpfs_lock: lock NULL");
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_lock before: lk flags: %d share: %d "
- "wait: %d excl: %d holder: 0x%llx\n",
- l->lk_flags, l->lk_sharecount, l->lk_waitcount,
- l->lk_exclusivecount,
- (unsigned long long)
- (nnpfs_uintptr_t)l->lk_lockholder));
-
-#ifndef DEBUG_LOCKS
-#ifdef HAVE_FOUR_ARGUMENT_LOCKMGR
-#ifdef HAVE_FREEBSD_THREAD
- ret = lockmgr(l, flags, &vp->v_interlock, ap->a_td);
-#else
- ret = lockmgr(l, flags, &vp->v_interlock, ap->a_p);
-#endif
-#else
- ret = lockmgr(l, flags, &vp->v_interlock);
-#endif
-#else
-#ifdef HAVE_FREEBSD_THREAD
- ret = debuglockmgr(l, flags, &vp->v_interlock, ap->a_td,
- "nnpfs_lock", ap->a_vp->filename, ap->a_vp->line);
-#else
- ret = debuglockmgr(l, flags, &vp->v_interlock, ap->a_p,
- "nnpfs_lock", ap->a_vp->filename, ap->a_vp->line);
-#endif
-#endif
- NNPFSDEB(XDEBVNOPS, ("nnpfs_lock: lk flags: %d share: %d "
- "wait: %d excl: %d holder: 0x%llx\n",
- l->lk_flags, l->lk_sharecount, l->lk_waitcount,
- l->lk_exclusivecount,
- (unsigned long long)
- (nnpfs_uintptr_t)l->lk_lockholder));
- return ret;
-}
-#endif /* HAVE_VOP_LOCK */
-
-#ifdef HAVE_VOP_UNLOCK
-int
-nnpfs_unlock(struct vop_unlock_args * ap)
-{
- struct vnode *vp = ap->a_vp;
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
- nnpfs_vnode_lock *l = &xn->lock;
- int flags = ap->a_flags;
- int ret;
-
- if (l == NULL)
- panic("nnpfs_unlock: lock NULL");
-
- NNPFSDEB(XDEBVNOPS,
- ("nnpfs_unlock: %lx, flags 0x%x, l %lx, ap %lx\n",
- (unsigned long)vp, flags,
- (unsigned long)l,
- (unsigned long)ap));
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_unlock: lk flags: %d share: %d "
- "wait: %d excl: %d holder: 0x%lld\n",
- l->lk_flags, l->lk_sharecount, l->lk_waitcount,
- l->lk_exclusivecount,
- (unsigned long long)
- (nnpfs_uintptr_t)l->lk_lockholder));
-#ifndef DEBUG_LOCKS
-#ifdef HAVE_FOUR_ARGUMENT_LOCKMGR
-#ifdef HAVE_FREEBSD_THREAD
- ret = lockmgr (l, flags | LK_RELEASE, &vp->v_interlock, ap->a_td);
-#else
- ret = lockmgr (l, flags | LK_RELEASE, &vp->v_interlock, ap->a_p);
-#endif
-#else
- ret = lockmgr (l, flags | LK_RELEASE, &vp->v_interlock);
-#endif
-#else
-#ifdef HAVE_FREEBSD_THREAD
- ret = debuglockmgr (l, flags | LK_RELEASE, &vp->v_interlock, ap->a_td,
- "nnpfs_lock", ap->a_vp->filename, ap->a_vp->line);
-#else
- ret = debuglockmgr (l, flags | LK_RELEASE, &vp->v_interlock, ap->a_p,
- "nnpfs_lock", ap->a_vp->filename, ap->a_vp->line);
-#endif
-#endif
- NNPFSDEB(XDEBVNOPS, ("nnpfs_unlock: return %d\n", ret));
- return ret;
-}
-#endif /* HAVE_VOP_UNLOCK */
-
-#ifdef HAVE_VOP_ISLOCKED
-int
-nnpfs_islocked (struct vop_islocked_args *ap)
-{
- struct vnode *vp = ap->a_vp;
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
- nnpfs_vnode_lock *l = &xn->lock;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_islocked: %lx\n",
- (unsigned long)vp));
-
-#if defined(HAVE_TWO_ARGUMENT_LOCKSTATUS)
-#ifdef HAVE_FREEBSD_THREAD
- return lockstatus (l, ap->a_td);
-#else
- return lockstatus (l, ap->a_p);
-#endif
-#elif defined(HAVE_ONE_ARGUMENT_LOCKSTATUS)
- return lockstatus (l);
-#else
-#error what lockstatus?
-#endif
-}
-#endif /* HAVE_VOP_ISLOCKED */
-
-#else /* !HAVE_KERNEL_LOCKMGR && !HAVE_KERNEL_DEBUGLOCKMGR */
-
-#ifdef HAVE_VOP_LOCK
-int
-nnpfs_lock(struct vop_lock_args * ap)
-{
- struct vnode *vp = ap->a_vp;
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_lock: %lx, %d\n",
- (unsigned long)vp, xn->vnlocks));
-
- while (vp->v_flag & VXLOCK) {
- vp->v_flag |= VXWANT;
- (void) tsleep((caddr_t)vp, PINOD, "nnpfs_vnlock", 0);
- }
- if (vp->v_tag == VT_NON)
- return (ENOENT);
- ++xn->vnlocks;
- return 0;
-}
-#endif /* HAVE_VOP_LOCK */
-
-#ifdef HAVE_VOP_UNLOCK
-int
-nnpfs_unlock(struct vop_unlock_args * ap)
-{
- struct vnode *vp = ap->a_vp;
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
- NNPFSDEB(XDEBVNOPS, ("nnpfs_unlock: %lx, %d\n",
- (unsigned long)vp, xn->vnlocks));
-
- --xn->vnlocks;
- if (xn->vnlocks < 0) {
- printf ("PANIC: nnpfs_unlock: unlocking unlocked\n");
- xn->vnlocks = 0;
- }
- NNPFSDEB(XDEBVNOPS, ("nnpfs_unlock: return\n"));
-
- return 0;
-}
-#endif /* HAVE_VOP_UNLOCK */
-
-#ifdef HAVE_VOP_ISLOCKED
-int
-nnpfs_islocked (struct vop_islocked_args *ap)
-{
- struct vnode *vp = ap->a_vp;
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_islocked: %lx, %d\n",
- (unsigned long)vp, xn->vnlocks));
-
- return xn->vnlocks;
-}
-#endif /* HAVE_VOP_ISLOCKED */
-#endif /* !HAVE_KERNEL_LOCKMGR */
-
-#ifdef HAVE_VOP_ABORTOP
-int
-nnpfs_abortop (struct vop_abortop_args *ap)
- /* struct vnode *dvp;
- struct componentname *cnp; */
-{
- struct componentname *cnp = ap->a_cnp;
-
- if ((cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF)
-#if defined(HAVE_KERNEL_ZFREEI)
- zfreei(namei_zone, cnp->cn_pnbuf);
- ap->a_cnp->cn_flags &= ~HASBUF;
-#elif defined(HAVE_KERNEL_UMA_ZFREE_ARG)
- uma_zfree_arg(namei_zone, cnp->cn_pnbuf, NULL);
- cnp->cn_flags &= ~HASBUF;
-#elif defined(FREE_ZONE)
- FREE_ZONE(cnp->cn_pnbuf, cnp->cn_pnlen, M_NAMEI);
-#elif defined(HAVE_KERNEL_ZFREE)
- zfree(namei_zone, cnp->cn_pnbuf);
- ap->a_cnp->cn_flags &= ~HASBUF;
-#elif defined(PNBUF_PUT)
- PNBUF_PUT(cnp->cn_pnbuf);
-#else
- FREE(cnp->cn_pnbuf, M_NAMEI);
-#endif
- return 0;
-}
-#endif /* HAVE_VOP_ABORTOP */
-
-#ifdef HAVE_VOP_MMAP
-int
-nnpfs_mmap(struct vop_mmap_args *ap)
- /*
- IN struct vnode *vp;
- IN int fflags;
- IN struct ucred *cred;
- IN struct proc *p;
- */
-{
- NNPFSDEB(XDEBVNOPS, ("nnpfs_mmap\n"));
-#ifdef HAVE_KERNEL_GENFS_MMAP
- return genfs_mmap(ap);
-#else
- return EOPNOTSUPP;
-#endif
-}
-#endif /* HAVE_VOP_MMAP */
-
-#ifdef HAVE_VOP_BMAP
-int
-nnpfs_bmap(struct vop_bmap_args *ap)
- /* IN struct vnode *vp;
- IN daddr_t bn;
- OUT struct vnode **vpp;
- IN daddr_t *bnp;
- OUT int *runp;
- OUT int *runb;
- */
-{
- NNPFSDEB(XDEBVNOPS, ("nnpfs_bmap\n"));
- return EOPNOTSUPP;
-}
-#endif /* HAVE_VOP_BMAP */
-
-#ifdef HAVE_VOP_GETPAGES
-
-static size_t
-get_pages_endlength (struct vop_getpages_args *ap)
-{
-#ifdef HAVE_STRUCT_VOP_GETPAGES_ARGS_A_OFFSET
- /* NetBSD ubc */
- return (ap->a_offset << PAGE_SHIFT) + *ap->a_count * PAGE_SIZE;
-#else
- return (ap->a_reqpage << PAGE_SHIFT) + ap->a_count * PAGE_SIZE;
-#endif
-}
-
-int
-nnpfs_getpages (struct vop_getpages_args *ap)
- /* Old BSD
- IN struct vnode *vp;
- IN vm_page_t *m;
- IN int count;
- IN int reqpage;
- IN vm_ooffset_t offset;
- */
- /* NetBSD UBC
- IN struct vnode *vp;
- IN voff_t offset;
- IN vm_page_t *m;
- IN int *count;
- IN int centeridx;
- IN vm_prot_t access_type;
- IN int advice;
- IN int flags;
- */
-{
- int error;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_getpages\n"));
-
-#if HAVE_KERNEL_VNODE_PAGER_GENERIC_GETPAGES
- error = vnode_pager_generic_getpages (ap->a_vp, ap->a_m,
- ap->a_count, ap->a_reqpage);
-#else
- error = nnpfs_data_valid (ap->a_vp, VNODE_TO_XNODE(ap->a_vp)->rd_cred,
- nnpfs_curproc(), NNPFS_DATA_R,
- get_pages_endlength(ap));
- if (error == 0)
- error = VOP_GETPAGES(DATA_FROM_VNODE(ap->a_vp),
- ap->a_offset, ap->a_m,
- ap->a_count, ap->a_centeridx, ap->a_access_type,
- ap->a_advice, ap->a_flags);
-#endif
- NNPFSDEB(XDEBVNOPS, ("nnpfs_getpages = %d\n", error));
- return error;
-}
-#endif /* HAVE_VOP_GETPAGES */
-
-#ifdef HAVE_VOP_PUTPAGES
-int
-nnpfs_putpages (struct vop_putpages_args *ap)
- /* Old BSD
- IN struct vnode *vp;
- IN vm_page_t *m;
- IN int count;
- IN int sync;
- IN int *rtvals;
- IN vm_ooffset_t offset;
- */
- /* NetBSD UBC (>= 1.5Y)
- IN struct vnode *vp;
- IN voff_t offlo;
- IN voff_t offhi;
- IN int flags;
- */
-{
- struct vnode *vp = ap->a_vp;
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
- struct vnode *t = DATA_FROM_XNODE(xn);
- int error;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_putpages\n"));
-
- if (t == NULL)
- return 0;
-
-#ifdef HAVE_STRUCT_VOP_PUTPAGES_ARGS_A_SYNC /* FreeBSD-style */
- xn->flags |= NNPFS_DATA_DIRTY;
-
- return VOP_PUTPAGES(t, ap->a_m, ap->a_count, ap->a_sync, ap->a_rtvals,
- ap->a_offset);
-#else /* NetBSD-style */
-#if defined(__NetBSD__) && __NetBSD_Version__ >= 105250000
- /* XXX should only walk over those pages that is requested */
- if (vp->v_type == VREG && ap->a_flags & PGO_CLEANIT) {
- struct uvm_object *uobj = &t->v_uobj;
- struct vm_page *pg;
- int dirty = 0;
-
- pg = TAILQ_FIRST(&uobj->memq);
-
- while (pg && !dirty) {
- dirty = pmap_is_modified(pg) || (pg->flags & PG_CLEAN) == 0;
- pg = TAILQ_NEXT(pg, listq);
- }
-
- if (dirty)
- xn->flags |= NNPFS_DATA_DIRTY;
- }
-
- return VOP_PUTPAGES(t, ap->a_offlo, ap->a_offhi, ap->a_flags);
-#else
- xn->flags |= NNPFS_DATA_DIRTY;
- return VOP_PUTPAGES(t, ap->a_m, ap->a_count, ap->a_flags, ap->a_rtvals);
-#endif
-#endif /* HAVE_STRUCT_VOP_PUTPAGES_ARGS_A_SYNC */
-}
-#endif /* HAVE_VOP_PUTPAGES */
-
-#ifdef HAVE_VOP_CMP
-int
-nnpfs_cmp(struct vnode * vp1, struct vnode * vp2)
-{
- NNPFSDEB(XDEBVNOPS, ("nnpfs_cmp\n"));
- return EOPNOTSUPP;
-}
-#endif /* HAVE_VOP_CMP */
-
-#ifdef HAVE_VOP_REALVP
-int
-nnpfs_realvp(struct vnode * vp,
- struct vnode ** vpp)
-{
- NNPFSDEB(XDEBVNOPS, ("nnpfs_realvp\n"));
- return EOPNOTSUPP;
-}
-#endif /* HAVE_VOP_REALVP */
-
-#ifdef HAVE_VOP_CNTL
-int
-nnpfs_cntl(struct vnode * vp,
- int cmd,
- caddr_t idata,
- caddr_t odata,
- int iflag,
- int oflag)
-{
- NNPFSDEB(XDEBVNOPS, ("nnpfs_cntl\n"));
- return EOPNOTSUPP;
-}
-#endif /* HAVE_VOP_CNTL */
-
-#ifdef HAVE_VOP_PRINT
-int
-nnpfs_print (struct vop_print_args *v)
-{
- struct vop_print_args /* {
- struct vnode *a_vp;
- } */ *ap = v;
- nnpfs_printnode_common (ap->a_vp);
- return 0;
-}
-#endif
-
-#ifdef HAVE_VOP_ADVLOCK
-int
-nnpfs_advlock(struct vop_advlock_args *v)
-{
- struct vop_advlock_args /* {
- struct vnode *a_vp;
- caddr_t a_id;
- int a_op;
- struct flock *a_fl;
- int a_flags;
- } */ *ap = v;
-#if 0
- struct nnpfs_node *xn = VNODE_TO_XNODE(ap->a_vp);
- int ret;
- nnpfs_locktype_t locktype;
-
-/* if (NNPFS_TOKEN_GOT(xn, */
-
- if (ap->a_fl.l_start != 0 ||
- ap->a_fl.l_end != 0)
- printf ("WARN: someone is trying byte-range locking\n");
-
- switch (ap->a_op) {
- case F_SETLCK:
- locktype = NNPFS_READLOCK;
- break;
-
- ret = nnpfs_advlock_common (xn, );
-
- return ret;
-#elif defined(HAVE_KERNEL_LF_ADVLOCK) && !defined(__OpenBSD__) && !defined(__APPLE__)
- struct nnpfs_node *xn = VNODE_TO_XNODE(ap->a_vp);
-
- return lf_advlock(ap, &xn->lockf, xn->attr.va_size);
- #else
- return EOPNOTSUPP;
-#endif
-}
-#endif /* HAVE_VOP_ADVOCK */
-
-#ifdef HAVE_VOP_REVOKE
-int
-nnpfs_revoke(struct vop_revoke_args *v)
-{
-#if defined(HAVE_KERNEL_GENFS_REVOKE)
- return genfs_revoke (v);
-#elif defined(HAVE_KERNEL_VOP_REVOKE)
- return vop_revoke (v);
-#else
- return EOPNOTSUPP;
-#endif
-}
-#endif /* HAVE_VOP_REVOKE */
-
-#ifdef HAVE_VOP_PAGEIN
-int
-nnpfs_pagein(struct vop_pagein_args *ap)
-{
-#ifdef __APPLE__
- struct uio uio;
- struct iovec iov;
- int ret;
-
- kernel_upl_map(kernel_map, ap->a_pl, &iov.iov_base);
- iov.iov_base+=ap->a_pl_offset;
- iov.iov_len=ap->a_size;
-
- uio.uio_iov=&iov;
- uio.uio_iovcnt=1;
- uio.uio_offset=ap->a_f_offset;
- uio.uio_resid=ap->a_size;
- uio.uio_segflg=UIO_SYSSPACE; /* XXX what is it? */
- uio.uio_rw=UIO_READ;
- uio.uio_procp=nnpfs_curproc();
-
- ret = VOP_READ(ap->a_vp, &uio, 0, ap->a_cred);
-
- /* Zero out rest of last page if there wasn't enough data in the file */
- if (ret == 0 && uio.uio_resid > 0)
- bzero(iov.iov_base, uio.uio_resid);
-
- kernel_upl_unmap(kernel_map, ap->a_pl);
-
- if (ret) {
- kernel_upl_abort_range(ap->a_pl, ap->a_pl_offset, ap->a_size,
- UPL_ABORT_ERROR | UPL_ABORT_FREE_ON_EMPTY);
- } else {
- kernel_upl_commit_range(ap->a_pl, ap->a_pl_offset, ap->a_size,
- UPL_COMMIT_CLEAR_DIRTY | UPL_COMMIT_FREE_ON_EMPTY,
- UPL_GET_INTERNAL_PAGE_LIST(ap->a_pl));
- }
-
- return ret;
-#else
-#error pagein on non apple ?
-#endif
-}
-
-#endif
-
-#ifdef HAVE_VOP_PAGEOUT
-int
-nnpfs_pageout(struct vop_pageout_args *ap)
-{
-#ifdef __APPLE__
- struct uio uio;
- struct iovec iov;
- int ret;
-
- kernel_upl_map(kernel_map, ap->a_pl, &iov.iov_base);
- iov.iov_base+=ap->a_pl_offset;
- iov.iov_len=ap->a_size;
-
- uio.uio_iov=&iov;
- uio.uio_iovcnt=1;
- uio.uio_offset=ap->a_f_offset;
- uio.uio_resid=ap->a_size;
- uio.uio_segflg=UIO_SYSSPACE; /* XXX what is it? */
- uio.uio_rw=UIO_WRITE;
- uio.uio_procp=nnpfs_curproc();
-
- ret = VOP_WRITE(ap->a_vp, &uio, 0, ap->a_cred);
-
- kernel_upl_unmap(kernel_map, ap->a_pl);
-
- if (ret) {
- kernel_upl_abort_range(ap->a_pl, ap->a_pl_offset, ap->a_size,
- UPL_ABORT_FREE_ON_EMPTY);
- } else {
- kernel_upl_commit_range(ap->a_pl, ap->a_pl_offset, ap->a_size,
- UPL_COMMIT_CLEAR_DIRTY | UPL_COMMIT_FREE_ON_EMPTY,
- UPL_GET_INTERNAL_PAGE_LIST(ap->a_pl));
- }
-
- return ret;
-#else
-#error pageout on non apple ?
-#endif
-}
-#endif
-
-#ifdef HAVE_VOP_CREATEVOBJECT
-int
-nnpfs_createvobject(struct vop_createvobject_args *ap)
-/*
-struct vop_createvobject_args {
- struct vnode *vp;
- struct ucred *cred;
- struct proc *p;
-};
- */
-{
- NNPFSDEB(XDEBVNOPS, ("nnpfs_createvobject\n"));
-
- return vop_stdcreatevobject (ap);
-}
-#endif /* HAVE_VOP_CREATEVOBJECT */
-
-#ifdef HAVE_VOP_DESTROYVOBJECT
-int
-nnpfs_destroyvobject(struct vop_destroyvobject_args *ap)
-/*
-struct vop_destroyvobject_args {
- struct vnode *vp;
-};
- */
-{
- NNPFSDEB(XDEBVNOPS, ("nnpfs_destroyvobject\n"));
-
- return vop_stddestroyvobject (ap);
-}
-#endif /* HAVE_VOP_DESTROYVOBJECT */
-
-#ifdef HAVE_VOP_GETVOBJECT
-int
-nnpfs_getvobject(struct vop_getvobject_args *ap)
-/*
-struct vop_getvobject_args {
- struct vnode *vp;
- struct vm_object **objpp;
-};
- */
-{
- NNPFSDEB(XDEBVNOPS, ("nnpfs_getvobject\n"));
-
- return vop_stdgetvobject (ap);
-}
-#endif /* HAVE_VOP_GETVOBJECT */
-
-#ifdef HAVE_VOP_PATHCONF
-int
-nnpfs_pathconf(struct vop_pathconf_args *ap)
-/*
-struct vop_pathconf_args {
- struct vnodeop_desc *a_desc;
- struct vnode *a_vp;
- int a_name;
-};
-*/
-{
- NNPFSDEB(XDEBVNOPS, ("nnpfs_pathconf\n"));
-
-#ifdef HAVE_KERNEL_VOP_STDPATHCONF
- return vop_stdpathconf(ap);
-#else
- return EOPNOTSUPP;
-#endif
-}
-#endif
-
-
-
-vop_t **nnpfs_vnodeop_p;
-
-int
-nnpfs_eopnotsupp (struct vop_generic_args *ap)
-{
- NNPFSDEB(XDEBVNOPS, ("nnpfs_eopnotsupp %s\n", ap->a_desc->vdesc_name));
- return EOPNOTSUPP;
-}
-
-int
-nnpfs_returnzero (struct vop_generic_args *ap)
-{
- NNPFSDEB(XDEBVNOPS, ("nnpfs_returnzero %s\n", ap->a_desc->vdesc_name));
- return 0;
-}
-
-void
-nnpfs_pushdirty(struct vnode *vp, struct ucred *cred, d_thread_t *p)
-{
-#if defined(__NetBSD_Version__) && __NetBSD_Version__ >= 105280000
- VOP_PUTPAGES(vp, 0, 0, PGO_ALLPAGES|PGO_SYNCIO|PGO_CLEANIT);
-#elif defined(__APPLE__)
- ubc_pushdirty(vp);
-#endif
-}
-
-
-
-static struct vnodeopv_entry_desc nnpfs_vnodeop_entries[] = {
- {&vop_default_desc, (vop_t *) nnpfs_eopnotsupp},
-#ifdef HAVE_VOP_LOOKUP
-#ifdef HAVE_KERNEL_VFS_CACHE_LOOKUP
- {&vop_lookup_desc, (vop_t *) vfs_cache_lookup },
-#else
- {&vop_lookup_desc, (vop_t *) nnpfs_lookup },
-#endif
-#endif
-#ifdef HAVE_VOP_CACHEDLOOKUP
- {&vop_cachedlookup_desc, (vop_t *) nnpfs_cachedlookup },
-#endif
-#ifdef HAVE_VOP_OPEN
- {&vop_open_desc, (vop_t *) nnpfs_open },
-#endif
-#ifdef HAVE_VOP_FSYNC
- {&vop_fsync_desc, (vop_t *) nnpfs_fsync },
-#endif
-#ifdef HAVE_VOP_CLOSE
- {&vop_close_desc, (vop_t *) nnpfs_close },
-#endif
-#ifdef HAVE_VOP_READ
- {&vop_read_desc, (vop_t *) nnpfs_read },
-#endif
-#ifdef HAVE_VOP_WRITE
- {&vop_write_desc, (vop_t *) nnpfs_write },
-#endif
-#ifdef HAVE_VOP_MMAP
- {&vop_mmap_desc, (vop_t *) nnpfs_mmap },
-#endif
-#ifdef HAVE_VOP_BMAP
- {&vop_bmap_desc, (vop_t *) nnpfs_bmap },
-#endif
-#ifdef HAVE_VOP_IOCTL
- {&vop_ioctl_desc, (vop_t *) nnpfs_ioctl },
-#endif
-#ifdef HAVE_VOP_SELECT
- {&vop_select_desc, (vop_t *) nnpfs_select },
-#endif
-#ifdef HAVE_VOP_SEEK
- {&vop_seek_desc, (vop_t *) nnpfs_seek },
-#endif
-#ifdef HAVE_VOP_POLL
- {&vop_poll_desc, (vop_t *) nnpfs_poll },
-#endif
-#ifdef HAVE_VOP_GETATTR
- {&vop_getattr_desc, (vop_t *) nnpfs_getattr },
-#endif
-#ifdef HAVE_VOP_SETATTR
- {&vop_setattr_desc, (vop_t *) nnpfs_setattr },
-#endif
-#ifdef HAVE_VOP_ACCESS
- {&vop_access_desc, (vop_t *) nnpfs_access },
-#endif
-#ifdef HAVE_VOP_CREATE
- {&vop_create_desc, (vop_t *) nnpfs_create },
-#endif
-#ifdef HAVE_VOP_REMOVE
- {&vop_remove_desc, (vop_t *) nnpfs_remove },
-#endif
-#ifdef HAVE_VOP_LINK
- {&vop_link_desc, (vop_t *) nnpfs_link },
-#endif
-#ifdef HAVE_VOP_RENAME
- {&vop_rename_desc, (vop_t *) nnpfs_rename },
-#endif
-#ifdef HAVE_VOP_MKDIR
- {&vop_mkdir_desc, (vop_t *) nnpfs_mkdir },
-#endif
-#ifdef HAVE_VOP_RMDIR
- {&vop_rmdir_desc, (vop_t *) nnpfs_rmdir },
-#endif
-#ifdef HAVE_VOP_READDIR
- {&vop_readdir_desc, (vop_t *) nnpfs_readdir },
-#endif
-#ifdef HAVE_VOP_SYMLINK
- {&vop_symlink_desc, (vop_t *) nnpfs_symlink },
-#endif
-#ifdef HAVE_VOP_READLINK
- {&vop_readlink_desc, (vop_t *) nnpfs_readlink },
-#endif
-#ifdef HAVE_VOP_INACTIVE
- {&vop_inactive_desc, (vop_t *) nnpfs_inactive },
-#endif
-#ifdef HAVE_VOP_RECLAIM
- {&vop_reclaim_desc, (vop_t *) nnpfs_reclaim },
-#endif
-#ifdef HAVE_VOP_LOCK
- {&vop_lock_desc, (vop_t *) nnpfs_lock },
-#endif
-#ifdef HAVE_VOP_UNLOCK
- {&vop_unlock_desc, (vop_t *) nnpfs_unlock },
-#endif
-#ifdef HAVE_VOP_ISLOCKED
- {&vop_islocked_desc, (vop_t *) nnpfs_islocked },
-#endif
-#ifdef HAVE_VOP_ABORTOP
- {&vop_abortop_desc, (vop_t *) nnpfs_abortop },
-#endif
-#ifdef HAVE_VOP_GETPAGES
- {&vop_getpages_desc, (vop_t *) nnpfs_getpages },
-#endif
-#ifdef HAVE_VOP_PUTPAGES
- {&vop_putpages_desc, (vop_t *) nnpfs_putpages },
-#endif
-#ifdef HAVE_VOP_REVOKE
- {&vop_revoke_desc, (vop_t *) nnpfs_revoke },
-#endif
-#ifdef HAVE_VOP_PRINT
- {&vop_print_desc, (vop_t *) nnpfs_print},
-#endif
-#ifdef HAVE_VOP_ADVLOCK
- {&vop_advlock_desc, (vop_t *) nnpfs_advlock },
-#endif
-#ifdef HAVE_VOP_PAGEIN
- {&vop_pagein_desc, (vop_t *) nnpfs_pagein },
-#endif
-#ifdef HAVE_VOP_PAGEOUT
- {&vop_pageout_desc, (vop_t *) nnpfs_pageout },
-#endif
-#ifdef HAVE_VOP_CREATEVOBJECT
- {&vop_createvobject_desc, (vop_t *) nnpfs_createvobject },
-#endif
-#ifdef HAVE_VOP_DESTROYVOBJECT
- {&vop_destroyvobject_desc, (vop_t *) nnpfs_destroyvobject },
-#endif
-#ifdef HAVE_VOP_GETVOBJECT
- {&vop_getvobject_desc, (vop_t *) nnpfs_getvobject },
-#endif
-#ifdef HAVE_VOP_PATHCONF
- {&vop_pathconf_desc, (vop_t *) nnpfs_pathconf },
-#endif
- {(struct vnodeop_desc *) NULL, (int (*) (void *)) NULL}
-};
-
-struct vnodeopv_desc nnpfs_vnodeop_opv_desc =
-{&nnpfs_vnodeop_p, nnpfs_vnodeop_entries};
-
-#ifdef VNODEOP_SET
-VNODEOP_SET(nnpfs_vnodeop_opv_desc);
-#endif
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_vnodeops-common.c b/usr.sbin/afs/src/nnpfs/bsd/nnpfs_vnodeops-common.c
deleted file mode 100644
index d4f30d531ed..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_vnodeops-common.c
+++ /dev/null
@@ -1,1137 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * NNPFS operations.
- */
-
-#include <nnpfs/nnpfs_locl.h>
-#include <nnpfs/nnpfs_message.h>
-#include <nnpfs/nnpfs_common.h>
-#include <nnpfs/nnpfs_fs.h>
-#include <nnpfs/nnpfs_dev.h>
-#include <nnpfs/nnpfs_deb.h>
-#include <nnpfs/nnpfs_syscalls.h>
-#include <nnpfs/nnpfs_vnodeops.h>
-
-RCSID("$arla: nnpfs_vnodeops-common.c,v 1.94 2003/01/27 11:58:50 lha Exp $");
-
-static void
-nnpfs_handle_stale(struct nnpfs_node *xn)
-{
- struct vnode *vp = XNODE_TO_VNODE(xn);
-
- if ((xn->flags & NNPFS_STALE) == 0)
- return;
-
-#if __APPLE__
- if (UBCISVALID(vp) && !ubc_isinuse(vp, 1)) {
- xn->flags &= ~NNPFS_STALE;
- ubc_setsize(vp, 0);
- NNPFS_TOKEN_CLEAR(xn, ~0,
- NNPFS_OPEN_MASK | NNPFS_ATTR_MASK |
- NNPFS_DATA_MASK | NNPFS_LOCK_MASK);
- }
-#endif
-}
-
-int
-nnpfs_open_valid(struct vnode *vp, struct ucred *cred, d_thread_t *p,
- u_int tok)
-{
- struct nnpfs *nnpfsp = NNPFS_FROM_VNODE(vp);
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
- int error = 0;
-
- NNPFSDEB(XDEBVFOPS, ("nnpfs_open_valid\n"));
-
- nnpfs_handle_stale(xn);
-
- do {
- if (!NNPFS_TOKEN_GOT(xn, tok)) {
- struct nnpfs_message_open msg;
-
- msg.header.opcode = NNPFS_MSG_OPEN;
- msg.cred.uid = cred->cr_uid;
- msg.cred.pag = nnpfs_get_pag(cred);
- msg.handle = xn->handle;
- msg.tokens = tok;
-
- error = nnpfs_message_rpc(nnpfsp->fd, &msg.header, sizeof(msg), p);
-
- if (error == 0)
- error = ((struct nnpfs_message_wakeup *) & msg)->error;
- } else {
- goto done;
- }
- } while (error == 0);
-
-done:
- NNPFSDEB(XDEBVFOPS, ("nnpfs_open_valid: error = %d\n", error));
-
- return error;
-}
-
-int
-nnpfs_attr_valid(struct vnode *vp, struct ucred *cred, d_thread_t *p,
- u_int tok)
-{
- struct nnpfs *nnpfsp = NNPFS_FROM_VNODE(vp);
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
- int error = 0;
- nnpfs_pag_t pag = nnpfs_get_pag(cred);
-
- do {
- if (!NNPFS_TOKEN_GOT(xn, tok) || !nnpfs_has_pag(xn, pag)) {
- struct nnpfs_message_getattr msg;
-
- msg.header.opcode = NNPFS_MSG_GETATTR;
- msg.cred.uid = cred->cr_uid;
- msg.cred.pag = pag;
- msg.handle = xn->handle;
- error = nnpfs_message_rpc(nnpfsp->fd, &msg.header, sizeof(msg), p);
- if (error == 0)
- error = ((struct nnpfs_message_wakeup *) & msg)->error;
- } else {
- goto done;
- }
- } while (error == 0);
-
-done:
- return error;
-}
-
-int
-nnpfs_data_valid(struct vnode *vp, struct ucred *cred, d_thread_t *p,
- u_int tok, uint32_t want_offset)
-{
- struct nnpfs *nnpfsp = NNPFS_FROM_VNODE(vp);
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
- int error = 0;
- uint32_t offset;
- struct nnpfs_message_getdata msg;
-
- do {
- offset = want_offset;
- if (NNPFS_TOKEN_GOT(xn, tok|NNPFS_ATTR_R) && offset > xn->attr.va_size) {
- offset = xn->attr.va_size;
- }
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_data_valid: offset: want %ld has %ld, "
- "tokens: want %lx has %lx length: %ld\n",
- (long) offset, (long) xn->offset,
- (long) tok, (long) xn->tokens,
- (long) xn->attr.va_size));
-
- if (NNPFS_TOKEN_GOT(xn, tok)) {
- if (offset <= xn->offset || xn->attr.va_type == VDIR) {
- break;
- }
- }
-
- msg.header.opcode = NNPFS_MSG_GETDATA;
- msg.cred.uid = cred->cr_uid;
- msg.cred.pag = nnpfs_get_pag(cred);
- msg.handle = xn->handle;
- msg.tokens = tok;
- msg.offset = offset;
-
- error = nnpfs_message_rpc(nnpfsp->fd, &msg.header, sizeof(msg), p);
-
- if (error == 0)
- error = ((struct nnpfs_message_wakeup *) & msg)->error;
-
- } while (error == 0);
-
- return error;
-}
-
-int
-nnpfs_open_common(struct vnode *vp,
- int mode,
- struct ucred *cred,
- d_thread_t *p)
-{
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
- int ret;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_open\n"));
-
- if (mode & FWRITE) {
- ret = nnpfs_open_valid(vp, cred, p, NNPFS_OPEN_NW);
- } else {
- ret = nnpfs_open_valid(vp, cred, p, NNPFS_OPEN_NR);
- }
-
- /* always update the read cred */
-
- if (mode & FWRITE)
- nnpfs_update_write_cred(xn, cred);
- nnpfs_update_read_cred(xn, cred);
-
- return ret;
-}
-
-static int
-do_fsync(struct nnpfs *nnpfsp,
- struct nnpfs_node *xn,
- struct ucred *cred,
- d_thread_t *p,
- u_int flag)
-{
- int error;
- struct nnpfs_message_putdata msg;
-
- msg.header.opcode = NNPFS_MSG_PUTDATA;
- if (cred != NOCRED) {
- msg.cred.uid = cred->cr_uid;
- msg.cred.pag = nnpfs_get_pag(cred);
- } else {
- msg.cred.uid = 0;
- msg.cred.pag = NNPFS_ANONYMOUSID;
- }
- msg.handle = xn->handle;
- vattr2nnpfs_attr(&xn->attr, &msg.attr);
- msg.flag = flag;
-
- error = nnpfs_message_rpc(nnpfsp->fd, &msg.header, sizeof(msg), p);
-
- if (error == 0)
- error = ((struct nnpfs_message_wakeup *) & msg)->error;
-
- if (error == 0)
- xn->flags &= ~NNPFS_DATA_DIRTY;
-
- return error;
-}
-
-int
-nnpfs_fsync_common(struct vnode *vp, struct ucred *cred,
- int waitfor, d_thread_t *proc)
-{
- struct nnpfs *nnpfsp = NNPFS_FROM_VNODE(vp);
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
- int error = 0;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_fsync: %lx\n", (unsigned long)vp));
-
- /*
- * It seems that fsync is sometimes called after reclaiming a node.
- * In that case we just look happy.
- */
-
- if (xn == NULL) {
- printf("NNPFS PANIC WARNING! nnpfs_fsync called after reclaiming!\n");
- return 0;
- }
-
- nnpfs_pushdirty(vp, cred, proc);
-
- if (xn->flags & NNPFS_DATA_DIRTY) {
-#ifdef FSYNC_RECLAIM
- /* writing back the data from this vnode failed */
- if (waitfor & FSYNC_RECLAIM) {
- printf("nnpfs_fsync: data lost, failed to write back\n");
- xn->flags &= ~NNPFS_DATA_DIRTY;
- return 0;
- }
-#endif
- error = do_fsync(nnpfsp, xn, cred, proc, NNPFS_WRITE | NNPFS_FSYNC);
- }
-
- return error;
-}
-
-int
-nnpfs_close_common(struct vnode *vp, int fflag,
- d_thread_t *proc, struct ucred *cred)
-{
- struct nnpfs *nnpfsp = NNPFS_FROM_VNODE(vp);
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
- int error = 0;
-
- NNPFSDEB(XDEBVNOPS,
- ("nnpfs_close cred = %lx, fflag = %x, xn->flags = %x\n",
- (unsigned long)cred, fflag, xn->flags));
-
- if (vp->v_type == VREG)
- nnpfs_pushdirty(vp, cred, proc);
-
- if (fflag & FWRITE && xn->flags & NNPFS_DATA_DIRTY)
- error = do_fsync(nnpfsp, xn, cred, proc, NNPFS_WRITE);
-
- return error;
-}
-
-size_t
-nnpfs_uio_end_length (struct uio *uio)
-{
-#if DIAGNOSTIC
- size_t sz = 0;
- int i;
-
- for (i = 0; i < uio->uio_iovcnt; i++)
- sz += uio->uio_iov[i].iov_len;
- if (sz != uio->uio_resid)
- panic("nnpfs_uio_end_length");
-#endif
- return uio->uio_offset + uio->uio_resid;
-}
-
-
-int
-nnpfs_read_common(struct vnode *vp, struct uio *uio, int ioflag,
- struct ucred *cred)
-{
- int error = 0;
- int i;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_read\n"));
-
- nnpfs_update_read_cred(VNODE_TO_XNODE(vp), cred);
-
-#ifdef HAVE_FREEBSD_THREAD
- error = nnpfs_data_valid(vp, cred, nnpfs_uio_to_thread(uio), NNPFS_DATA_R,
- nnpfs_uio_end_length(uio));
-#else
- error = nnpfs_data_valid(vp, cred, nnpfs_uio_to_proc(uio), NNPFS_DATA_R,
- nnpfs_uio_end_length(uio));
-#endif
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_read: iovcnt: %d\n", uio->uio_iovcnt));
- for (i = 0; i < uio->uio_iovcnt; i++)
- NNPFSDEB(XDEBVNOPS, (" base: %lx len: %lu\n",
- (unsigned long)uio->uio_iov[i].iov_base,
- (unsigned long)uio->uio_iov[i].iov_len));
-
- if (error == 0) {
- struct vnode *t = DATA_FROM_VNODE(vp);
-
-#ifdef HAVE_FREEBSD_THREAD
- nnpfs_vfs_readlock(t, nnpfs_uio_to_thread(uio));
- nnpfs_vop_read(t, uio, ioflag, cred, error);
- nnpfs_vfs_unlock(t, nnpfs_uio_to_thread(uio));
-#else
- nnpfs_vfs_readlock(t, nnpfs_uio_to_proc(uio));
- nnpfs_vop_read(t, uio, ioflag, cred, error);
- nnpfs_vfs_unlock(t, nnpfs_uio_to_proc(uio));
-#endif
- }
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_read offset: %lu resid: %lu\n",
- (unsigned long)uio->uio_offset,
- (unsigned long)uio->uio_resid));
- NNPFSDEB(XDEBVNOPS, ("nnpfs_read error: %d\n", error));
-
- return error;
-}
-
-int
-nnpfs_write_common(struct vnode *vp, struct uio *uiop, int ioflag,
- struct ucred *cred)
-{
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
- int error = 0;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_write\n"));
-
- nnpfs_update_write_cred(xn, cred);
-
-#ifdef HAVE_FREEBSD_THREAD
- error = nnpfs_data_valid(vp, cred, nnpfs_uio_to_thread(uiop), NNPFS_DATA_W,
- VNODE_TO_XNODE(vp)->attr.va_size);
-#else
- error = nnpfs_data_valid(vp, cred, nnpfs_uio_to_proc(uiop), NNPFS_DATA_W,
- VNODE_TO_XNODE(vp)->attr.va_size);
-#endif
-
- if (error == 0) {
- struct vnode *t = DATA_FROM_XNODE(xn);
- struct vattr sub_attr;
- int error2 = 0;
-
- #ifdef HAVE_FREEBSD_THREAD
- nnpfs_vfs_writelock(t, nnpfs_uio_to_thread(uiop));
- nnpfs_vop_write(t, uiop, ioflag, cred, error);
- VNODE_TO_XNODE(vp)->flags |= NNPFS_DATA_DIRTY;
- nnpfs_vop_getattr(t, &sub_attr, cred, nnpfs_uio_to_thread(uiop), error2);
- #else
- nnpfs_vfs_writelock(t, nnpfs_uio_to_proc(uiop));
- nnpfs_vop_write(t, uiop, ioflag, cred, error);
- VNODE_TO_XNODE(vp)->flags |= NNPFS_DATA_DIRTY;
- nnpfs_vop_getattr(t, &sub_attr, cred, nnpfs_uio_to_proc(uiop), error2);
- #endif
-
- if (error2 == 0) {
- xn->attr.va_size = sub_attr.va_size;
- xn->attr.va_bytes = sub_attr.va_size;
- xn->attr.va_mtime = sub_attr.va_mtime;
- nnpfs_set_vp_size(vp, sub_attr.va_size);
- xn->offset = sub_attr.va_size;
- }
-#ifdef HAVE_FREEBSD_THREAD
- nnpfs_vfs_unlock(t, nnpfs_uio_to_thread(uiop));
-#else
- nnpfs_vfs_unlock(t, nnpfs_uio_to_proc(uiop));
-#endif
- }
-
- return error;
-}
-
-int
-nnpfs_getattr_common(struct vnode *vp, struct vattr *vap,
- struct ucred *cred, d_thread_t *p)
-{
- int error = 0;
-
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_getattr\n"));
-
- error = nnpfs_attr_valid(vp, cred, p, NNPFS_ATTR_R);
- if (error == 0)
- *vap = xn->attr;
- return error;
-}
-
-int
-nnpfs_setattr_common(struct vnode *vp, struct vattr *vap,
- struct ucred *cred, d_thread_t *p)
-{
- struct nnpfs *nnpfsp = NNPFS_FROM_VNODE(vp);
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
- int error = 0;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_setattr\n"));
-
-#define CHECK_NNPFSATTR(A, cast) (vap->A == cast VNOVAL || vap->A == xn->attr.A)
- if (CHECK_NNPFSATTR(va_mode,(mode_t)) &&
- CHECK_NNPFSATTR(va_nlink,(short)) &&
- CHECK_NNPFSATTR(va_size,(va_size_t)) &&
- CHECK_NNPFSATTR(va_uid,(uid_t)) &&
- CHECK_NNPFSATTR(va_gid,(gid_t)) &&
- CHECK_NNPFSATTR(va_mtime.tv_sec,(unsigned int)) &&
- CHECK_NNPFSATTR(va_fileid,(long)) &&
- CHECK_NNPFSATTR(va_type,(enum vtype)))
- return 0; /* Nothing to do */
-#undef CHECK_NNPFSATTR
-
- if (NNPFS_TOKEN_GOT(xn, NNPFS_ATTR_W)) {
- /* Update attributes and mark them dirty. */
- VNODE_TO_XNODE(vp)->flags |= NNPFS_ATTR_DIRTY;
- error = EINVAL; /* XXX not yet implemented */
- goto done;
- } else {
- struct nnpfs_message_putattr msg;
-
- msg.header.opcode = NNPFS_MSG_PUTATTR;
- if (cred != NOCRED) {
- msg.cred.uid = cred->cr_uid;
- msg.cred.pag = nnpfs_get_pag(cred);
- } else {
- msg.cred.uid = 0;
- msg.cred.pag = NNPFS_ANONYMOUSID;
- }
- msg.handle = xn->handle;
- vattr2nnpfs_attr(vap, &msg.attr);
- if (NNPFS_TOKEN_GOT(xn, NNPFS_DATA_R)) {
- if (vp->v_type == VREG) {
- if (vap->va_size != (va_size_t)VNOVAL)
- XA_SET_SIZE(&msg.attr, vap->va_size);
- else
- XA_SET_SIZE(&msg.attr, xn->attr.va_size);
-#ifdef __APPLE__
- /* XXX needed ? */
- if (UBCINFOEXISTS(vp))
- ubc_setsize(vp, msg.attr.xa_size);
-#endif
- }
- if (vap->va_mtime.tv_sec != (unsigned int)VNOVAL)
- XA_SET_MTIME(&msg.attr, vap->va_mtime.tv_sec);
- else
- XA_SET_MTIME(&msg.attr, xn->attr.va_mtime.tv_sec);
- }
-
- NNPFS_TOKEN_CLEAR(xn, NNPFS_ATTR_VALID, NNPFS_ATTR_MASK);
- error = nnpfs_message_rpc(nnpfsp->fd, &msg.header, sizeof(msg), p);
- if (error == 0)
- error = ((struct nnpfs_message_wakeup *) & msg)->error;
- }
-
-done:
- return error;
-}
-
-static int
-check_rights (u_char rights, int mode)
-{
- int error = 0;
-
- if (mode & VREAD)
- if ((rights & NNPFS_RIGHT_R) == 0)
- error = EACCES;
- if (mode & VWRITE)
- if ((rights & NNPFS_RIGHT_W) == 0)
- error = EACCES;
- if (mode & VEXEC)
- if ((rights & NNPFS_RIGHT_X) == 0)
- error = EACCES;
- return error;
-}
-
-int
-nnpfs_access_common(struct vnode *vp, int mode, struct ucred *cred,
- d_thread_t *p)
-{
- int error = 0;
- nnpfs_pag_t pag = nnpfs_get_pag(cred);
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_access mode = 0%o\n", mode));
-
- error = nnpfs_attr_valid(vp, cred, p, NNPFS_ATTR_R);
- if (error == 0) {
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
- int i;
-
- error = check_rights (xn->anonrights, mode);
-
- if (error == 0)
- goto done;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_access anonaccess failed\n"));
-
- error = EACCES; /* default to EACCES if pag isn't in xn->id */
-
- for (i = 0; i < MAXRIGHTS; i++)
- if (xn->id[i] == pag) {
- error = check_rights (xn->rights[i], mode);
- break;
- }
- }
-
-done:
- NNPFSDEB(XDEBVNOPS, ("nnpfs_access(0%o) = %d\n", mode, error));
-
- return error;
-}
-
-int
-nnpfs_lookup_common(struct vnode *dvp,
- nnpfs_componentname *cnp,
- struct vnode **vpp)
-{
- struct nnpfs_message_getnode msg;
- struct nnpfs *nnpfsp = NNPFS_FROM_VNODE(dvp);
- struct nnpfs_node *d = VNODE_TO_XNODE(dvp);
- int error = 0;
-#ifdef HAVE_FREEBSD_THREAD
- d_thread_t *proc = nnpfs_cnp_to_thread(cnp);
- struct ucred *cred = nnpfs_thread_to_cred(proc);
-#else
- d_thread_t *proc = nnpfs_cnp_to_proc(cnp);
- struct ucred *cred = nnpfs_proc_to_cred(proc);
-#endif
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_lookup_common: enter\n"));
-
- *vpp = NULL;
-
- if (cnp->cn_namelen >= NNPFS_MAX_NAME)
- return ENAMETOOLONG;
-
- if (dvp->v_type != VDIR)
- return ENOTDIR;
-
- if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') {
- *vpp = dvp;
- VREF(*vpp);
- return 0;
- }
-
- do {
- nnpfs_vop_access(dvp, VEXEC, cred, proc, error);
- if (error != 0)
- goto done;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_lookup_common: dvp = %lx\n",
- (unsigned long) dvp));
- NNPFSDEB(XDEBVNOPS, ("nnpfs_lookup_common: cnp = %lx, "
- "cnp->cn_nameiop = %d\n",
- (unsigned long) cnp, (int)cnp->cn_nameiop));
-
-
- error = nnpfs_dnlc_lookup(dvp, cnp, vpp);
- if (error == 0) {
-
- /*
- * Doesn't quite work.
- */
-
-#if 0
- if ((cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME)
- && (cnp->cn_flags & ISLASTCN)) {
- error = EJUSTRETURN;
- goto done;
- }
-#endif
-
- msg.header.opcode = NNPFS_MSG_GETNODE;
- if (cnp->cn_cred != NOCRED) {
- msg.cred.uid = cnp->cn_cred->cr_uid;
- msg.cred.pag = nnpfs_get_pag(cnp->cn_cred);
- } else {
- msg.cred.uid = 0;
- msg.cred.pag = NNPFS_ANONYMOUSID;
- }
- msg.parent_handle = d->handle;
- memcpy(msg.name, cnp->cn_nameptr, cnp->cn_namelen);
- msg.name[cnp->cn_namelen] = '\0';
- error = nnpfs_message_rpc(nnpfsp->fd, &msg.header,
- sizeof(msg), proc);
- if (error == 0)
- error = ((struct nnpfs_message_wakeup *) & msg)->error;
- if(error == ENOENT && cnp->cn_nameiop != CREATE) {
- NNPFSDEB(XDEBVNOPS, ("nnpfs_lookup: neg cache %lx (%s, %ld)\n",
- (unsigned long)dvp,
- cnp->cn_nameptr, cnp->cn_namelen));
- nnpfs_dnlc_enter (dvp, cnp, NULL);
- }
- } else if (error == -1) {
- error = 0;
- goto done;
- }
- } while (error == 0);
-
-done:
- NNPFSDEB(XDEBVNOPS, ("nnpfs_lookup_common: return error = %d\n", error));
- return error;
-}
-
-int
-nnpfs_create_common(struct vnode *dvp,
- const char *name,
- struct vattr *vap,
- struct ucred *cred,
- d_thread_t *p)
-{
- struct nnpfs *nnpfsp = NNPFS_FROM_VNODE(dvp);
- struct nnpfs_node *xn = VNODE_TO_XNODE(dvp);
- int error = 0;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_create: (%lx, %s)\n",
- (unsigned long)dvp, name));
- {
- struct nnpfs_message_create msg;
-
- msg.header.opcode = NNPFS_MSG_CREATE;
- msg.parent_handle = xn->handle;
- if (strlcpy(msg.name, name, sizeof(msg.name)) >= NNPFS_MAX_NAME)
- return ENAMETOOLONG;
- vattr2nnpfs_attr(vap, &msg.attr);
-
- msg.mode = 0; /* XXX - mode */
- if (cred != NOCRED) {
- msg.cred.uid = cred->cr_uid;
- msg.cred.pag = nnpfs_get_pag(cred);
- } else {
- msg.cred.uid = 0;
- msg.cred.pag = NNPFS_ANONYMOUSID;
- }
-
-
- error = nnpfs_message_rpc(nnpfsp->fd, &msg.header, sizeof(msg), p);
-
- if (error == 0)
- error = ((struct nnpfs_message_wakeup *) & msg)->error;
- }
-
-#if 0
- if (error == EEXIST)
- error = 0;
-#endif
-
- return error;
-}
-
-int
-nnpfs_remove_common(struct vnode *dvp,
- struct vnode *vp,
- const char *name,
- struct ucred *cred,
- d_thread_t *p)
-{
- struct nnpfs *nnpfsp = NNPFS_FROM_VNODE(dvp);
- struct nnpfs_node *xn = VNODE_TO_XNODE(dvp);
- struct nnpfs_message_remove msg;
- int error;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_remove: %s\n", name));
-
- msg.header.opcode = NNPFS_MSG_REMOVE;
- msg.parent_handle = xn->handle;
- msg.cred.uid = cred->cr_uid;
- msg.cred.pag = nnpfs_get_pag(cred);
-
- if (strlcpy(msg.name, name, sizeof(msg.name)) >= NNPFS_MAX_NAME)
- error = ENAMETOOLONG;
- else
- error = nnpfs_message_rpc(nnpfsp->fd, &msg.header, sizeof(msg), p);
- if (error == 0)
- error = ((struct nnpfs_message_wakeup *) &msg)->error;
-
- if (error == 0)
- nnpfs_dnlc_purge (vp);
-
- return error;
-}
-
-int
-nnpfs_rename_common(struct vnode *fdvp,
- struct vnode *fvp,
- const char *fname,
- struct vnode *tdvp,
- struct vnode *tvp,
- const char *tname,
- struct ucred *cred,
- d_thread_t *p)
-{
- struct nnpfs *nnpfsp = NNPFS_FROM_VNODE(fdvp);
- int error;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_rename: %s %s\n", fname, tname));
-
- if ((fvp->v_mount != tdvp->v_mount)
- || (tvp && (fvp->v_mount != tvp->v_mount))) {
- return EXDEV;
- }
-
- {
- struct nnpfs_message_rename msg;
-
- msg.header.opcode = NNPFS_MSG_RENAME;
- msg.old_parent_handle = VNODE_TO_XNODE(fdvp)->handle;
- if (strlcpy(msg.old_name, fname, sizeof(msg.old_name)) >= NNPFS_MAX_NAME)
- return ENAMETOOLONG;
- msg.new_parent_handle = VNODE_TO_XNODE(tdvp)->handle;
- if (strlcpy(msg.new_name, tname, sizeof(msg.new_name)) >= NNPFS_MAX_NAME)
- return ENAMETOOLONG;
- msg.cred.uid = cred->cr_uid;
- msg.cred.pag = nnpfs_get_pag(cred);
- error = nnpfs_message_rpc(nnpfsp->fd, &msg.header, sizeof(msg), p);
- if (error == 0)
- error = ((struct nnpfs_message_wakeup *) &msg)->error;
-
- }
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_rename: error = %d\n", error));
-
- return error;
-}
-
-int
-nnpfs_mkdir_common(struct vnode *dvp,
- const char *name,
- struct vattr *vap,
- struct ucred *cred,
- d_thread_t *p)
-{
- struct nnpfs *nnpfsp = NNPFS_FROM_VNODE(dvp);
- struct nnpfs_node *xn = VNODE_TO_XNODE(dvp);
- int error = 0;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_mkdir: %s\n", name));
- {
- struct nnpfs_message_mkdir msg;
-
- msg.header.opcode = NNPFS_MSG_MKDIR;
- msg.parent_handle = xn->handle;
- if (strlcpy(msg.name, name, sizeof(msg.name)) >= NNPFS_MAX_NAME)
- return ENAMETOOLONG;
- vattr2nnpfs_attr(vap, &msg.attr);
- if (cred != NOCRED) {
- msg.cred.uid = cred->cr_uid;
- msg.cred.pag = nnpfs_get_pag(cred);
- } else {
- msg.cred.uid = 0;
- msg.cred.pag = NNPFS_ANONYMOUSID;
- }
- error = nnpfs_message_rpc(nnpfsp->fd, &msg.header, sizeof(msg), p);
- if (error == 0)
- error = ((struct nnpfs_message_wakeup *) & msg)->error;
- }
-
- return error;
-}
-
-int
-nnpfs_rmdir_common(struct vnode *dvp,
- struct vnode *vp,
- const char *name,
- struct ucred *cred,
- d_thread_t *p)
-{
- struct nnpfs *nnpfsp = NNPFS_FROM_VNODE(dvp);
- struct nnpfs_node *xn = VNODE_TO_XNODE(dvp);
- struct nnpfs_message_rmdir msg;
- int error;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_rmdir: %s\n", name));
-
- msg.header.opcode = NNPFS_MSG_RMDIR;
- msg.parent_handle = xn->handle;
- msg.cred.uid = cred->cr_uid;
- msg.cred.pag = nnpfs_get_pag(cred);
- if (strlcpy(msg.name, name, sizeof(msg.name)) >= NNPFS_MAX_NAME)
- error = ENAMETOOLONG;
- else
- error = nnpfs_message_rpc(nnpfsp->fd, &msg.header, sizeof(msg), p);
- if (error == 0)
- error = ((struct nnpfs_message_wakeup *) &msg)->error;
-
- if (error == 0)
- nnpfs_dnlc_purge (vp);
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_rmdir error: %d\n", error));
-
- return error;
-}
-
-int
-nnpfs_readdir_common(struct vnode *vp,
- struct uio *uiop,
- struct ucred *cred,
- d_thread_t *p,
- int *eofflag)
-{
- int error = 0;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_readdir\n"));
-
- if(eofflag)
- *eofflag = 0;
-#ifdef HAVE_FREEBSD_THREAD
- error = nnpfs_data_valid(vp, cred, nnpfs_uio_to_thread(uiop), NNPFS_DATA_R,
- nnpfs_uio_end_length(uiop));
-#else
- error = nnpfs_data_valid(vp, cred, nnpfs_uio_to_proc(uiop), NNPFS_DATA_R,
- nnpfs_uio_end_length(uiop));
-#endif
- if (error == 0) {
- struct vnode *t = DATA_FROM_VNODE(vp);
-
-#ifdef HAVE_FREEBSD_THREAD
- nnpfs_vfs_readlock(t, nnpfs_uio_to_thread(uiop));
-#else
- nnpfs_vfs_readlock(t, nnpfs_uio_to_proc(uiop));
-#endif
- nnpfs_vop_read(t, uiop, 0, cred, error);
- if (eofflag) {
- struct vattr t_attr;
- int error2;
-
-#ifdef HAVE_FREEBSD_THREAD
- nnpfs_vop_getattr(t, &t_attr, cred, nnpfs_uio_to_thread(uiop), error2);
-#else
- nnpfs_vop_getattr(t, &t_attr, cred, nnpfs_uio_to_proc(uiop), error2);
-#endif
- if (error2 == 0)
- *eofflag = t_attr.va_size <= uiop->uio_offset;
- }
-#ifdef HAVE_FREEBSD_THREAD
- nnpfs_vfs_unlock(t, nnpfs_uio_to_thread(uiop));
-#else
- nnpfs_vfs_unlock(t, nnpfs_uio_to_proc(uiop));
-#endif
- }
- return error;
-}
-
-int
-nnpfs_link_common(struct vnode *dvp,
- struct vnode *vp,
- const char *name,
- struct ucred *cred,
- d_thread_t *p)
-{
- struct nnpfs *nnpfsp = NNPFS_FROM_VNODE(dvp);
- struct nnpfs_node *xn = VNODE_TO_XNODE(dvp);
- struct nnpfs_node *xn2 = VNODE_TO_XNODE(vp);
- struct nnpfs_message_link msg;
- int error = 0;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_link: %s\n", name));
-
- msg.header.opcode = NNPFS_MSG_LINK;
- msg.parent_handle = xn->handle;
- msg.from_handle = xn2->handle;
- if (strlcpy(msg.name, name, sizeof(msg.name)) >= NNPFS_MAX_NAME)
- return ENAMETOOLONG;
- msg.cred.uid = cred->cr_uid;
- msg.cred.pag = nnpfs_get_pag(cred);
-
- error = nnpfs_message_rpc(nnpfsp->fd, &msg.header, sizeof(msg), p);
- if (error == 0)
- error = ((struct nnpfs_message_wakeup *) & msg)->error;
-
- return error;
-}
-
-int
-nnpfs_symlink_common(struct vnode *dvp,
- struct vnode **vpp,
- nnpfs_componentname *cnp,
- struct vattr *vap,
- char *target)
-{
- struct nnpfs *nnpfsp = NNPFS_FROM_VNODE(dvp);
- struct nnpfs_node *xn = VNODE_TO_XNODE(dvp);
-#ifdef HAVE_FREEBSD_THREAD
- d_thread_t *proc = nnpfs_cnp_to_thread(cnp);
- struct ucred *cred = nnpfs_thread_to_cred(proc);
-#else
- d_thread_t *proc = nnpfs_cnp_to_proc(cnp);
- struct ucred *cred = nnpfs_proc_to_cred(proc);
-#endif
- struct nnpfs_message_symlink msg;
- const char *name = cnp->cn_nameptr;
- int error = 0;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_symlink: %s\n", name));
-
- msg.header.opcode = NNPFS_MSG_SYMLINK;
- msg.parent_handle = xn->handle;
- vattr2nnpfs_attr(vap, &msg.attr);
- msg.cred.uid = cred->cr_uid;
- msg.cred.pag = nnpfs_get_pag(cred);
- if (strlcpy (msg.contents, target, sizeof(msg.contents)) >= NNPFS_MAX_SYMLINK_CONTENT) {
- error = ENAMETOOLONG;
- goto done;
- }
- if (strlcpy(msg.name, name, sizeof(msg.name)) >= NNPFS_MAX_NAME) {
- error = ENAMETOOLONG;
- goto done;
- }
- error = nnpfs_message_rpc(nnpfsp->fd, &msg.header, sizeof(msg), proc);
- if (error == 0)
- error = ((struct nnpfs_message_wakeup *) & msg)->error;
-
- done:
- return error;
-}
-
-int
-nnpfs_readlink_common(struct vnode *vp, struct uio *uiop, struct ucred *cred)
-{
- int error = 0;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_readlink\n"));
-
-#ifdef HAVE_FREEBSD_THREAD
- error = nnpfs_data_valid(vp, cred, nnpfs_uio_to_thread(uiop), NNPFS_DATA_R,
- nnpfs_uio_end_length(uiop));
-#else
- error = nnpfs_data_valid(vp, cred, nnpfs_uio_to_proc(uiop), NNPFS_DATA_R,
- nnpfs_uio_end_length(uiop));
-#endif
- if (error == 0) {
- struct vnode *t = DATA_FROM_VNODE(vp);
-
-#ifdef HAVE_FREEBSD_THREAD
- nnpfs_vfs_readlock(t, nnpfs_uio_to_thread(uiop));
- nnpfs_vop_read(t, uiop, 0, cred, error);
- nnpfs_vfs_unlock(t, nnpfs_uio_to_thread(uiop));
-#else
- nnpfs_vfs_readlock(t, nnpfs_uio_to_proc(uiop));
- nnpfs_vop_read(t, uiop, 0, cred, error);
- nnpfs_vfs_unlock(t, nnpfs_uio_to_proc(uiop));
-#endif
- }
- return error;
-}
-
-int
-nnpfs_inactive_common(struct vnode *vp, d_thread_t *p)
-{
- int error;
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_inactive, %lx\n",
- (unsigned long)vp));
-
- /*
- * This seems rather bogus, but sometimes we get an already
- * cleaned node to be made inactive. Just ignoring it seems safe.
- */
-
- if (xn == NULL) {
- NNPFSDEB(XDEBVNOPS, ("nnpfs_inactive: clean node\n"));
- return 0;
- }
-
- /* xn->wr_cred not set -> NOCRED */
-
- if (vp->v_type == VREG)
- nnpfs_pushdirty(vp, xn->wr_cred, p);
-
- error = nnpfs_fsync_common(vp, xn->wr_cred, /* XXX */ 0, p);
- if (error) {
- printf ("nnpfs_inactive: failed writing back data: %d\n", error);
- xn->flags &= ~NNPFS_DATA_DIRTY;
- }
-
- /* If this node is no longer valid, recycle immediately. */
- if (!NNPFS_TOKEN_GOT(xn, NNPFS_ATTR_R | NNPFS_ATTR_W)
- || (xn->flags & NNPFS_STALE) == NNPFS_STALE)
- {
-#ifndef __osf__
- nnpfs_vfs_unlock(vp, p);
- NNPFSDEB(XDEBVNOPS, ("nnpfs_inactive: vrecycle\n"));
- vrecycle(vp, p);
-#else /* __osf__ */
- NNPFSDEB(XDEBVNOPS, ("nnpfs_inactive: vp = %lx vp->v_usecount= %d\n",
- (unsigned long)vp, vp?vp->v_usecount:0));
-#endif /* __osf__ */
- } else {
-#ifndef __osf__
- nnpfs_vfs_unlock(vp, p);
-#endif
- xn->flags &= ~NNPFS_STALE;
- }
-
- NNPFSDEB(XDEBVNOPS, ("return: nnpfs_inactive\n"));
-
- return 0;
-}
-
-int
-nnpfs_reclaim_common(struct vnode *vp)
-{
- struct nnpfs_message_inactivenode msg;
- struct nnpfs *nnpfsp = NNPFS_FROM_VNODE(vp);
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_reclaim: %lx\n",
- (unsigned long)vp));
-
- NNPFS_TOKEN_CLEAR(xn,
- ~0,
- NNPFS_OPEN_MASK | NNPFS_ATTR_MASK |
- NNPFS_DATA_MASK | NNPFS_LOCK_MASK);
- /* Release, data if we still have it. */
- if (DATA_FROM_XNODE(xn) != 0) {
- vrele(DATA_FROM_XNODE(xn));
- DATA_FROM_XNODE(xn) = 0;
- }
-
- nnpfs_remove_node(&nnpfsp->nodehead, xn);
-
- msg.header.opcode = NNPFS_MSG_INACTIVENODE;
- msg.handle = xn->handle;
- msg.flag = NNPFS_NOREFS | NNPFS_DELETE;
- nnpfs_message_send(nnpfsp->fd, &msg.header, sizeof(msg));
-
- nnpfs_dnlc_purge(vp);
- free_nnpfs_node(xn);
- return 0;
-}
-
-/*
- *
- */
-
-#if 0
-
-int
-nnpfs_advlock_common(struct vnode *dvp,
- int locktype,
- unsigned long lockid, /* XXX this good ? */
- struct ucred *cred)
-{
- struct nnpfs *nnpfsp = NNPFS_FROM_VNODE(dvp);
- struct nnpfs_node *xn = VNODE_TO_XNODE(dvp);
- int error = 0;
-
- NNPFSDEB(XDEBVNOPS, ("nnpfs_advlock\n"));
- {
- struct nnpfs_message_advlock msg;
-
- msg.header.opcode = NNPFS_MSG_ADVLOCK;
- msg.handle = xn->handle;
- msg.locktype = locktype;
- msg.lockid = lockid;
-
- if (cred != NOCRED) {
- msg.cred.uid = cred->cr_uid;
- msg.cred.pag = nnpfs_get_pag(cred);
- } else {
- msg.cred.uid = 0;
- msg.cred.pag = NNPFS_ANONYMOUSID;
- }
- error = nnpfs_message_rpc(nnpfsp->fd, &msg.header, sizeof(msg), p);
- if (error == 0)
- error = ((struct nnpfs_message_wakeup *) & msg)->error;
- }
-
- if (error == 0) {
-
- /* sleep until woken */
-
- } else {
-
- /* die */
- }
-
- return error;
-}
-
-#endif
-
-/*
- *
- */
-
-void
-nnpfs_printnode_common (struct vnode *vp)
-{
- struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
-
- printf ("xnode: fid: %d.%d.%d.%d\n",
- xn->handle.a, xn->handle.b, xn->handle.c, xn->handle.d);
- printf ("\tattr: %svalid\n",
- NNPFS_TOKEN_GOT(xn, NNPFS_ATTR_VALID) ? "": "in");
- printf ("\tdata: %svalid\n",
- NNPFS_TOKEN_GOT(xn, NNPFS_DATA_VALID) ? "": "in");
- printf ("\tflags: 0x%x\n", xn->flags);
- printf ("\toffset: %d\n", xn->offset);
-}
diff --git a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_wrap-bsd.c b/usr.sbin/afs/src/nnpfs/bsd/nnpfs_wrap-bsd.c
deleted file mode 100644
index a6a72313e8a..00000000000
--- a/usr.sbin/afs/src/nnpfs/bsd/nnpfs_wrap-bsd.c
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <nnpfs/nnpfs_locl.h>
-#include <nnpfs/nnpfs_message.h>
-#include <nnpfs/nnpfs_fs.h>
-#include <nnpfs/nnpfs_dev.h>
-#include <nnpfs/nnpfs_syscalls.h>
-#include <nnpfs/nnpfs_deb.h>
-#include <nnpfs/nnpfs_wrap.h>
-
-RCSID("$arla: nnpfs_wrap-bsd.c,v 1.46 2003/02/04 10:28:16 lha Exp $");
-
-#include "version.h"
-
-int nnpfs_dev_major;
-
-/*
- * Iff `dev' represents a valid nnpfs device.
- */
-
-int
-nnpfs_is_nnpfs_dev (dev_t dev)
-{
- return major (dev) == nnpfs_dev_major
- && minor(dev) >= 0 && minor(dev) < NNNPFS;
-}
-
-static int
-nnpfs_uninstall(void)
-{
- int err, ret = 0;
-
- if ((err = nnpfs_uninstall_filesys()) != 0)
- ret = err;
- if ((err = nnpfs_uninstall_device()) != 0)
- ret = err;
- if ((err = nnpfs_uninstall_syscalls()) != 0)
- ret = err;
-
-#if defined(__NetBSD__) && __NetBSD_Version__ >= 106140000
- malloc_type_detach(M_NNPFS);
- malloc_type_detach(M_NNPFS_LINK);
- malloc_type_detach(M_NNPFS_MSG);
- malloc_type_detach(M_NNPFS_NODE);
-#endif
-
- return ret;
-}
-
-static int
-nnpfs_install(void)
-{
- int err = 0;
-
-#if defined(__NetBSD__) && __NetBSD_Version__ >= 106140000
- malloc_type_attach(M_NNPFS);
- malloc_type_attach(M_NNPFS_LINK);
- malloc_type_attach(M_NNPFS_MSG);
- malloc_type_attach(M_NNPFS_NODE);
-#endif
-
- if ((err = nnpfs_install_device()) ||
- (err = nnpfs_install_syscalls()) ||
- (err = nnpfs_install_filesys()))
- nnpfs_uninstall();
- return err;
-}
-
-static int
-nnpfs_stat(void)
-{
- int err = 0;
-
- if ((err = nnpfs_stat_device()) != 0)
- return err;
- else if ((err = nnpfs_stat_syscalls()) != 0)
- return err;
- else if ((err = nnpfs_stat_filesys()) != 0)
- return err;
-
- return err;
-}
-
-extern struct cdevsw nnpfs_dev;
-
-/*
- * This is to build a kld module (FreeBSD3.0 and later, but we only
- * support FreeBSD 4.1 and later)
- */
-
-#if KLD_MODULE
-
-static void
-make_devices (struct cdevsw *devsw)
-{
- int i;
-
- for (i = 0; i < NNNPFS; ++i)
- make_dev (devsw, i, UID_ROOT, GID_WHEEL, 0600, "nnpfs%d", i);
-}
-
-static void
-destroy_devices (struct cdevsw *devsw)
-{
- int i;
-
- for (i = 0; i < NNNPFS; ++i)
- destroy_dev (makedev (devsw->d_maj, i));
-}
-
-/*
- *
- */
-
-static int
-nnpfs_load(struct module *mod, int cmd, void *arg)
-{
- int ret;
-
- NNPFSDEB(XDEBLKM, ("nnpfs_load\n"));
-
- switch (cmd) {
- case MOD_LOAD :
- ret = nnpfs_install ();
- if (ret == 0) {
- make_devices (&nnpfs_dev);
- nnpfs_dev_major = nnpfs_dev.d_maj;
- printf ("nnpfs: cdev: %d, syscall: %d\n",
- nnpfs_dev_major, nnpfs_syscall_num);
- }
- break;
- case MOD_UNLOAD :
- ret = nnpfs_uninstall ();
- if (ret == 0) {
- destroy_devices (&nnpfs_dev);
- }
- break;
- default :
- ret = EINVAL;
- break;
- }
- NNPFSDEB(XDEBLKM, ("nnpfs_load = %d\n", ret));
- return ret;
-}
-
-extern struct vfsops nnpfs_vfsops;
-
-extern struct sysent nnpfs_syscallent;
-
-VFS_SET(nnpfs_vfsops, nnpfs, 0);
-
-DEV_MODULE(arlannpfsdev, nnpfs_load, NULL);
-
-#ifdef MODULE_VERSION
-MODULE_VERSION(arlannpfsdev,1);
-#endif /* MODULE_VERSION */
-
-#else /* KLD_MODULE */
-
-/*
- * An ordinary lkm-module
- */
-
-#if __NetBSD_Version__ >= 106080000
-MOD_DEV("nnpfs_mod","nnpfs_mod", NULL, -1, &nnpfs_dev, -1)
-#elif !defined(__APPLE__)
-MOD_DEV("nnpfs_mod",LM_DT_CHAR,-1,&nnpfs_dev)
-#endif
-
-/*
- *
- */
-
-#if defined(__APPLE__)
-__private_extern__ kern_return_t
-nnpfs_modload(kmod_info_t *ki, void *data)
-#else
-static int
-nnpfs_modload(struct lkm_table *lkmtp, int cmd)
-#endif
-{
- int error = 0;
-
- NNPFSDEB(XDEBLKM, ("nnpfs_modload\n"));
-
- error = nnpfs_install();
- if (error == 0)
- nnpfs_stat();
- return error;
-}
-
-
-/*
- *
- */
-
-#if defined(__APPLE__)
-__private_extern__ kern_return_t
-nnpfs_modunload(kmod_info_t *ki, void *data)
-#else
-static int
-nnpfs_modunload(struct lkm_table * lkmtp, int cmd)
-#endif
-{
- int error = 0;
-
- NNPFSDEB(XDEBLKM, ("nnpfs_modunload\n"));
-
- error = nnpfs_uninstall();
- if (!error)
- NNPFSDEB(XDEBLKM, ("nnpfs_modunload: successful\n"));
- else
- NNPFSDEB(XDEBLKM, ("nnpfs_modunload: unsuccessful, system unstable\n"));
- return error;
-}
-
-/*
- *
- */
-
-#if !defined(__APPLE__)
-static int
-nnpfs_modstat(struct lkm_table * lkmtp, int cmd)
-{
- int error = 0;
-
- NNPFSDEB(XDEBLKM, ("nnpfs_modstat\n"));
-
- error = nnpfs_stat();
- return error;
-}
-
-int
-nnpfs_mod(struct lkm_table * lkmtp, int cmd, int ver);
-
-int
-nnpfs_mod(struct lkm_table * lkmtp,
- int cmd,
- int ver)
-{
- int ret;
- int cdevmaj;
-
- if (ver != LKM_VERSION)
- return EINVAL; /* version mismatch */
- switch (cmd) {
- int error;
- case LKM_E_LOAD:
- lkmtp->private.lkm_any = (struct lkm_any *)&_module;
- if ((error = nnpfs_modload(lkmtp, cmd)) != 0)
- return error;
- break;
- case LKM_E_UNLOAD:
- if ((error = nnpfs_modunload(lkmtp, cmd)) != 0)
- return error;
- break;
- case LKM_E_STAT:
- if ((error = nnpfs_modstat(lkmtp, cmd)) != 0)
- return error;
- break;
- }
- ret = lkmdispatch(lkmtp, cmd);
- if(cmd == LKM_E_LOAD) {
-#if __NetBSD_Version__ >= 106080000
- nnpfs_dev_major = _module.lkm_cdevmaj;
-#else
- nnpfs_dev_major = _module.lkm_offset;
-#endif
- printf ("nnpfs (%s): "
- "protocol version %d, using cdev: %d, syscall: %d\n",
- arla_version, NNPFS_VERSION,
- nnpfs_dev_major, nnpfs_syscall_num);
- }
- return ret;
-}
-#endif
-
-#endif /* KLD_MODULE */
-
diff --git a/usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_attr.h b/usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_attr.h
deleted file mode 100644
index c5734ee7bf3..00000000000
--- a/usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_attr.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: nnpfs_attr.h,v 1.12 2002/09/07 10:46:15 lha Exp $ */
-
-#ifndef _NNPFS_ATTR_H
-#define _NNPFS_ATTR_H
-
-#define XA_V_NONE 0
-#define XA_V_MODE (1 << 0)
-#define XA_V_NLINK (1 << 1)
-#define XA_V_SIZE (1 << 2)
-#define XA_V_UID (1 << 3)
-#define XA_V_GID (1 << 4)
-#define XA_V_ATIME (1 << 5)
-#define XA_V_MTIME (1 << 6)
-#define XA_V_CTIME (1 << 7)
-#define XA_V_FILEID (1 << 8)
-#define XA_V_TYPE (1 << 9)
-
-#define NNPFS_FILE_NON 1
-#define NNPFS_FILE_REG 2
-#define NNPFS_FILE_DIR 3
-#define NNPFS_FILE_BLK 4
-#define NNPFS_FILE_CHR 5
-#define NNPFS_FILE_LNK 6
-#define NNPFS_FILE_SOCK 7
-#define NNPFS_FILE_FIFO 8
-#define NNPFS_FILE_BAD 9
-
-#define XA_CLEAR(xa_p) \
- ((xa_p)->valid = XA_V_NONE)
-#define XA_SET_MODE(xa_p, value) \
- (((xa_p)->valid) |= XA_V_MODE, ((xa_p)->xa_mode) = value)
-#define XA_SET_NLINK(xa_p, value) \
- (((xa_p)->valid) |= XA_V_NLINK, ((xa_p)->xa_nlink) = value)
-#define XA_SET_SIZE(xa_p, value) \
- (((xa_p)->valid) |= XA_V_SIZE, ((xa_p)->xa_size) = value)
-#define XA_SET_UID(xa_p, value) \
- (((xa_p)->valid) |= XA_V_UID, ((xa_p)->xa_uid) = value)
-#define XA_SET_GID(xa_p, value) \
- (((xa_p)->valid) |= XA_V_GID, ((xa_p)->xa_gid) = value)
-#define XA_SET_ATIME(xa_p, value) \
- (((xa_p)->valid) |= XA_V_ATIME, ((xa_p)->xa_atime) = value)
-#define XA_SET_MTIME(xa_p, value) \
- (((xa_p)->valid) |= XA_V_MTIME, ((xa_p)->xa_mtime) = value)
-#define XA_SET_CTIME(xa_p, value) \
- (((xa_p)->valid) |= XA_V_CTIME, ((xa_p)->xa_ctime) = value)
-#define XA_SET_FILEID(xa_p, value) \
- (((xa_p)->valid) |= XA_V_FILEID, ((xa_p)->xa_fileid) = value)
-#define XA_SET_TYPE(xa_p, value) \
- (((xa_p)->valid) |= XA_V_TYPE, ((xa_p)->xa_type) = value)
-
-
-#define XA_VALID_MODE(xa_p) \
- (((xa_p)->valid) & XA_V_MODE)
-#define XA_VALID_NLINK(xa_p) \
- (((xa_p)->valid) & XA_V_NLINK)
-#define XA_VALID_SIZE(xa_p) \
- (((xa_p)->valid) & XA_V_SIZE)
-#define XA_VALID_UID(xa_p) \
- (((xa_p)->valid) & XA_V_UID)
-#define XA_VALID_GID(xa_p) \
- (((xa_p)->valid) & XA_V_GID)
-#define XA_VALID_ATIME(xa_p) \
- (((xa_p)->valid) & XA_V_ATIME)
-#define XA_VALID_MTIME(xa_p) \
- (((xa_p)->valid) & XA_V_MTIME)
-#define XA_VALID_CTIME(xa_p) \
- (((xa_p)->valid) & XA_V_CTIME)
-#define XA_VALID_FILEID(xa_p) \
- (((xa_p)->valid) & XA_V_FILEID)
-#define XA_VALID_TYPE(xa_p) \
- (((xa_p)->valid) & XA_V_TYPE)
-
-struct nnpfs_attr {
- uint32_t valid;
- uint32_t xa_mode;
-
- uint32_t xa_nlink;
- uint32_t xa_size;
-
- uint32_t xa_uid;
- uint32_t xa_gid;
-
- uint32_t xa_atime;
- uint32_t xa_mtime;
-
- uint32_t xa_ctime;
- uint32_t xa_fileid;
-
- uint32_t xa_type;
- uint32_t pad1;
-};
-
-#endif /* _NNPFS_ATTR_H */
diff --git a/usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_debug.h b/usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_debug.h
deleted file mode 100644
index 6a0525aa90e..00000000000
--- a/usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_debug.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 1998 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: nnpfs_debug.h,v 1.5 2002/09/14 09:56:01 tol Exp $ */
-
-#ifndef __NNPFS_DEBUG_H
-#define __NNPFS_DEBUG_H
-
-/*
- * These are GLOBAL nnpfs debugging masks
- *
- * Define HAVE_XDEB in your local nnpfs_deb.h if
- * you want your fs to handle the debugging flags.
- */
-
-/* Masks for the debug macro */
-#define XDEBDEV 0x00000001 /* device handling */
-#define XDEBMSG 0x00000002 /* message sending */
-#define XDEBDNLC 0x00000004 /* name cache */
-#define XDEBNODE 0x00000008 /* nnpfs nodes */
-#define XDEBVNOPS 0x00000010 /* vnode operations */
-#define XDEBVFOPS 0x00000020 /* vfs operations */
-#define XDEBLKM 0x00000040 /* LKM handling */
-#define XDEBSYS 0x00000080 /* syscalls */
-#define XDEBMEM 0x00000100 /* memory allocation */
-#define XDEBREADDIR 0x00000200 /* readdir (linux) */
-#define XDEBLOCK 0x00000400 /* locking (linux) */
-#define XDEBCACHE 0x00000800 /* Cache handeling (linux) */
-#define XDEBREF 0x00001000 /* track reference count */
-
-#endif
diff --git a/usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_global.h b/usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_global.h
deleted file mode 100644
index 7280191b5f2..00000000000
--- a/usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_global.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __NNPFS_GLOBAL_H
-#define __NNPFS_GLOBAL_H
-
-#ifndef RCSID
-#define RCSID(msg) \
-static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
-#endif /* RCSID */
-
-#endif /* __NNPFS_GLOBAL_H */
diff --git a/usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_message.h b/usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_message.h
deleted file mode 100644
index 3babf4894a3..00000000000
--- a/usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_message.h
+++ /dev/null
@@ -1,491 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: nnpfs_message.h,v 1.55 2002/09/27 09:43:21 lha Exp $ */
-
-#ifndef _xmsg_h
-#define _xmsg_h
-
-/* bump this for any incompatible changes */
-
-#define NNPFS_VERSION 18
-
-#include <nnpfs/nnpfs_attr.h>
-
-/* Temporary hack? */
-#define MAX_XMSG_SIZE (1024*64)
-
-typedef uint32_t nnpfs_pag_t;
-
-/*
- * The nnpfs_cred, if pag == 0, use uid
- */
-typedef struct nnpfs_cred {
- uint32_t uid;
- nnpfs_pag_t pag;
-} nnpfs_cred;
-
-typedef uint32_t nnpfs_locktype_t;
-typedef uint32_t nnpfs_lockid_t;
-
-
-#define MAXHANDLE (4*4)
-#define MAXRIGHTS 8
-
-#define NNPFS_ANONYMOUSID 32766
-
-typedef struct nnpfs_handle {
- uint32_t a, b, c, d;
-} nnpfs_handle;
-
-#define nnpfs_handle_eq(p, q) \
-((p)->a == (q)->a && (p)->b == (q)->b && (p)->c == (q)->c && (p)->d == (q)->d)
-
-/*
- * This should be the maximum size of any `file handle'
- */
-
-#define CACHEHANDLESIZE 80
-
-typedef struct nnpfs_cache_handle {
- u_char data[CACHEHANDLESIZE];
-} nnpfs_cache_handle;
-
-/*
- * Tokens that apply to nodes, open modes and attributes. Shared
- * reading might be used for exec and exclusive write for remove.
- */
-#define NNPFS_OPEN_MASK 0x000f
-#define NNPFS_OPEN_NR 0x0001 /* Normal reading, data might change */
-#define NNPFS_OPEN_SR 0x0002 /* Shared reading, data won't change */
-#define NNPFS_OPEN_NW 0x0004 /* Normal writing, multiple writers */
-#define NNPFS_OPEN_EW 0x0008 /* Exclusive writing (open really) */
-
-#define NNPFS_ATTR_MASK 0x0030
-#define NNPFS_ATTR_R 0x0010 /* Attributes valid */
-#define NNPFS_ATTR_W 0x0020 /* Attributes valid and modifiable */
-
-/*
- * Tokens that apply to node data.
- */
-#define NNPFS_DATA_MASK 0x00c0
-#define NNPFS_DATA_R 0x0040 /* Data valid */
-#define NNPFS_DATA_W 0x0080 /* Data valid and modifiable */
-#define NNPFS_LOCK_MASK 0x0300
-#define NNPFS_LOCK_R 0x0100 /* Data Shared locks */
-#define NNPFS_LOCK_W 0x0200 /* Data Exclusive locks */
-
-#define NNPFS_ATTR_VALID NNPFS_ATTR_R
-#define NNPFS_DATA_VALID NNPFS_DATA_W
-
-/* nnpfs_node.flags
- * The lower 16 bit flags are reserved for common nnpfs flags
- * The upper 16 bit flags are reserved for operting system dependant
- * flags.
- */
-
-#define NNPFS_DATA_DIRTY 0x0001
-#define NNPFS_ATTR_DIRTY 0x0002
-#define NNPFS_AFSDIR 0x0004
-#define NNPFS_STALE 0x0008
-#define NNPFS_XDELETED 0x0010
-#define NNPFS_VMOPEN 0x0020
-
-/*
- * Token match macros, NNPFS_TOKEN_GOT is depricated and
- * NNPFS_TOKEN_GOT_* should be used instead.
- */
-
-/* Are necessary tokens available? */
-#define NNPFS_TOKEN_GOT(xn, tok) ((xn)->tokens & (tok)) /* deprecated */
-#define NNPFS_TOKEN_GOT_ANY(xn, tok) ((xn)->tokens & (tok)) /* at least one must match */
-#define NNPFS_TOKEN_GOT_ALL(xn, tok) (((xn)->tokens & (tok)) == (tok)) /* all tokens must match */
-#define NNPFS_TOKEN_SET(xn, tok, mask) ((xn)->tokens |= ((tok) & (mask)))
-#define NNPFS_TOKEN_CLEAR(xn, tok, mask) ((xn)->tokens &= ~((tok) & (mask)))
-
-/* definitions for the rights fields */
-#define NNPFS_RIGHT_R 0x01 /* may read? */
-#define NNPFS_RIGHT_W 0x02 /* may write? */
-#define NNPFS_RIGHT_X 0x04 /* may execute? */
-
-/* Max name length passed in nnpfs messages */
-
-#define NNPFS_MAX_NAME 256
-#define NNPFS_MAX_SYMLINK_CONTENT 2048
-
-struct nnpfs_msg_node {
- nnpfs_handle handle;
- uint32_t tokens;
- uint32_t pad1;
- struct nnpfs_attr attr;
- nnpfs_pag_t id[MAXRIGHTS];
- u_char rights[MAXRIGHTS];
- u_char anonrights;
- uint16_t pad2;
- uint32_t pad3;
-};
-
-/*
- * Messages passed through the nnpfs_dev.
- */
-struct nnpfs_message_header {
- uint32_t size;
- uint32_t opcode;
- uint32_t sequence_num; /* Private */
- uint32_t pad1;
-};
-
-/*
- * Used by putdata flag
- */
-enum { NNPFS_READ = 0x01,
- NNPFS_WRITE = 0x02,
- NNPFS_NONBLOCK = 0x04,
- NNPFS_APPEND = 0x08,
- NNPFS_FSYNC = 0x10};
-
-/*
- * Flags for inactivenode
- */
-enum { NNPFS_NOREFS = 1, NNPFS_DELETE = 2 };
-
-/*
- * Flags for installdata
- */
-
-enum { NNPFS_ID_INVALID_DNLC = 0x01, NNPFS_ID_AFSDIR = 0x02,
- NNPFS_ID_HANDLE_VALID = 0x04 };
-
-/*
- * Defined message types and their opcodes.
- */
-#define NNPFS_MSG_VERSION 0
-#define NNPFS_MSG_WAKEUP 1
-
-#define NNPFS_MSG_GETROOT 2
-#define NNPFS_MSG_INSTALLROOT 3
-
-#define NNPFS_MSG_GETNODE 4
-#define NNPFS_MSG_INSTALLNODE 5
-
-#define NNPFS_MSG_GETATTR 6
-#define NNPFS_MSG_INSTALLATTR 7
-
-#define NNPFS_MSG_GETDATA 8
-#define NNPFS_MSG_INSTALLDATA 9
-
-#define NNPFS_MSG_INACTIVENODE 10
-#define NNPFS_MSG_INVALIDNODE 11
- /* XXX Must handle dropped/revoked tokens better */
-
-#define NNPFS_MSG_OPEN 12
-
-#define NNPFS_MSG_PUTDATA 13
-#define NNPFS_MSG_PUTATTR 14
-
-/* Directory manipulating messages. */
-#define NNPFS_MSG_CREATE 15
-#define NNPFS_MSG_MKDIR 16
-#define NNPFS_MSG_LINK 17
-#define NNPFS_MSG_SYMLINK 18
-
-#define NNPFS_MSG_REMOVE 19
-#define NNPFS_MSG_RMDIR 20
-
-#define NNPFS_MSG_RENAME 21
-
-#define NNPFS_MSG_PIOCTL 22
-#define NNPFS_MSG_WAKEUP_DATA 23
-
-#define NNPFS_MSG_UPDATEFID 24
-
-#define NNPFS_MSG_ADVLOCK 25
-
-#define NNPFS_MSG_GC_NODES 26
-
-#define NNPFS_MSG_COUNT 27
-
-/* NNPFS_MESSAGE_VERSION */
-struct nnpfs_message_version {
- struct nnpfs_message_header header;
- uint32_t ret;
-};
-
-/* NNPFS_MESSAGE_WAKEUP */
-struct nnpfs_message_wakeup {
- struct nnpfs_message_header header;
- uint32_t sleepers_sequence_num; /* Where to send wakeup */
- uint32_t error; /* Return value */
-};
-
-/* NNPFS_MESSAGE_GETROOT */
-struct nnpfs_message_getroot {
- struct nnpfs_message_header header;
- struct nnpfs_cred cred;
-};
-
-/* NNPFS_MESSAGE_INSTALLROOT */
-struct nnpfs_message_installroot {
- struct nnpfs_message_header header;
- struct nnpfs_msg_node node;
-};
-
-/* NNPFS_MESSAGE_GETNODE */
-struct nnpfs_message_getnode {
- struct nnpfs_message_header header;
- struct nnpfs_cred cred;
- nnpfs_handle parent_handle;
- char name[NNPFS_MAX_NAME];
-};
-
-/* NNPFS_MESSAGE_INSTALLNODE */
-struct nnpfs_message_installnode {
- struct nnpfs_message_header header;
- nnpfs_handle parent_handle;
- char name[NNPFS_MAX_NAME];
- struct nnpfs_msg_node node;
-};
-
-/* NNPFS_MESSAGE_GETATTR */
-struct nnpfs_message_getattr {
- struct nnpfs_message_header header;
- struct nnpfs_cred cred;
- nnpfs_handle handle;
-};
-
-/* NNPFS_MESSAGE_INSTALLATTR */
-struct nnpfs_message_installattr {
- struct nnpfs_message_header header;
- struct nnpfs_msg_node node;
-};
-
-/* NNPFS_MESSAGE_GETDATA */
-struct nnpfs_message_getdata {
- struct nnpfs_message_header header;
- struct nnpfs_cred cred;
- nnpfs_handle handle;
- uint32_t tokens;
- uint32_t pad1;
- uint32_t offset;
- uint32_t pad2;
-};
-
-/* NNPFS_MESSAGE_INSTALLDATA */
-struct nnpfs_message_installdata {
- struct nnpfs_message_header header;
- struct nnpfs_msg_node node;
- char cache_name[NNPFS_MAX_NAME];
- struct nnpfs_cache_handle cache_handle;
- uint32_t flag;
- uint32_t pad1;
- uint32_t offset;
- uint32_t pad2;
-};
-
-/* NNPFS_MSG_INACTIVENODE */
-struct nnpfs_message_inactivenode {
- struct nnpfs_message_header header;
- nnpfs_handle handle;
- uint32_t flag;
- uint32_t pad1;
-};
-
-/* NNPFS_MSG_INVALIDNODE */
-struct nnpfs_message_invalidnode {
- struct nnpfs_message_header header;
- nnpfs_handle handle;
-};
-
-/* NNPFS_MSG_OPEN */
-struct nnpfs_message_open {
- struct nnpfs_message_header header;
- struct nnpfs_cred cred;
- nnpfs_handle handle;
- uint32_t tokens;
- uint32_t pad1;
-};
-
-/* NNPFS_MSG_PUTDATA */
-struct nnpfs_message_putdata {
- struct nnpfs_message_header header;
- nnpfs_handle handle;
- struct nnpfs_attr attr; /* XXX ??? */
- struct nnpfs_cred cred;
- uint32_t flag;
- uint32_t pad1;
-};
-
-/* NNPFS_MSG_PUTATTR */
-struct nnpfs_message_putattr {
- struct nnpfs_message_header header;
- nnpfs_handle handle;
- struct nnpfs_attr attr;
- struct nnpfs_cred cred;
-};
-
-/* NNPFS_MSG_CREATE */
-struct nnpfs_message_create {
- struct nnpfs_message_header header;
- nnpfs_handle parent_handle;
- char name[NNPFS_MAX_NAME];
- struct nnpfs_attr attr;
- uint32_t mode;
- uint32_t pad1;
- struct nnpfs_cred cred;
-};
-
-/* NNPFS_MSG_MKDIR */
-struct nnpfs_message_mkdir {
- struct nnpfs_message_header header;
- nnpfs_handle parent_handle;
- char name[NNPFS_MAX_NAME];
- struct nnpfs_attr attr;
- struct nnpfs_cred cred;
-};
-
-/* NNPFS_MSG_LINK */
-struct nnpfs_message_link {
- struct nnpfs_message_header header;
- nnpfs_handle parent_handle;
- char name[NNPFS_MAX_NAME];
- nnpfs_handle from_handle;
- struct nnpfs_cred cred;
-};
-
-/* NNPFS_MSG_SYMLINK */
-struct nnpfs_message_symlink {
- struct nnpfs_message_header header;
- nnpfs_handle parent_handle;
- char name[NNPFS_MAX_NAME];
- char contents[NNPFS_MAX_SYMLINK_CONTENT];
- struct nnpfs_attr attr;
- struct nnpfs_cred cred;
-};
-
-/* NNPFS_MSG_REMOVE */
-struct nnpfs_message_remove {
- struct nnpfs_message_header header;
- nnpfs_handle parent_handle;
- char name[NNPFS_MAX_NAME];
- struct nnpfs_cred cred;
-};
-
-/* NNPFS_MSG_RMDIR */
-struct nnpfs_message_rmdir {
- struct nnpfs_message_header header;
- nnpfs_handle parent_handle;
- char name[NNPFS_MAX_NAME];
- struct nnpfs_cred cred;
-};
-
-/* NNPFS_MSG_RENAME */
-struct nnpfs_message_rename {
- struct nnpfs_message_header header;
- nnpfs_handle old_parent_handle;
- char old_name[NNPFS_MAX_NAME];
- nnpfs_handle new_parent_handle;
- char new_name[NNPFS_MAX_NAME];
- struct nnpfs_cred cred;
-};
-
-#define NNPFS_MSG_MAX_DATASIZE 2048
-
-/* NNPFS_MSG_PIOCTL */
-struct nnpfs_message_pioctl {
- struct nnpfs_message_header header;
- uint32_t opcode ;
- uint32_t pad1;
- nnpfs_cred cred;
- uint32_t insize;
- uint32_t outsize;
- char msg[NNPFS_MSG_MAX_DATASIZE];
- nnpfs_handle handle;
-};
-
-
-/* NNPFS_MESSAGE_WAKEUP_DATA */
-struct nnpfs_message_wakeup_data {
- struct nnpfs_message_header header;
- uint32_t sleepers_sequence_num; /* Where to send wakeup */
- uint32_t error; /* Return value */
- uint32_t len;
- uint32_t pad1;
- char msg[NNPFS_MSG_MAX_DATASIZE];
-};
-
-/* NNPFS_MESSAGE_UPDATEFID */
-struct nnpfs_message_updatefid {
- struct nnpfs_message_header header;
- nnpfs_handle old_handle;
- nnpfs_handle new_handle;
-};
-
-/* NNPFS_MESSAGE_ADVLOCK */
-struct nnpfs_message_advlock {
- struct nnpfs_message_header header;
- nnpfs_handle handle;
- struct nnpfs_cred cred;
- nnpfs_locktype_t locktype;
-#define NNPFS_WR_LOCK 1 /* Write lock */
-#define NNPFS_RD_LOCK 2 /* Read lock */
-#define NNPFS_UN_LOCK 3 /* Unlock */
-#define NNPFS_BR_LOCK 4 /* Break lock (inform that we don't want the lock) */
- nnpfs_lockid_t lockid;
-};
-
-/* NNPFS_MESSAGE_GC_NODES */
-struct nnpfs_message_gc_nodes {
- struct nnpfs_message_header header;
-#define NNPFS_GC_NODES_MAX_HANDLE 50
- uint32_t len;
- uint32_t pad1;
- nnpfs_handle handle[NNPFS_GC_NODES_MAX_HANDLE];
-};
-
-#if 0
-struct nnpfs_name {
- u_int16_t name;
- char name[1];
-};
-#endif
-
-struct nnpfs_message_bulkgetnode {
- struct nnpfs_message_header header;
- nnpfs_handle parent_handle;
- uint32_t flags;
-#define NNPFS_BGN_LAZY 0x1
- uint32_t numnodes;
- struct nnpfs_handle handles[1];
-};
-
-#endif /* _xmsg_h */
diff --git a/usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_queue.h b/usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_queue.h
deleted file mode 100644
index bbe4e94097e..00000000000
--- a/usr.sbin/afs/src/nnpfs/include/nnpfs/nnpfs_queue.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/* $arla: nnpfs_queue.h,v 1.1 2002/11/28 06:24:23 lha Exp $ */
-
-/* Inspirered by the queue macros in BSD. */
-
-#ifndef NNPFS_QUEUE_H
-#define NNPFS_QUEUE_H 1
-
-/* Define a head. */
-#define NNPQUEUE_HEAD(name, type) \
-struct name { \
- struct type *nnpq_first; \
- struct type **nnpq_last; \
-}
-
-/* Defining a entry. */
-#define NNPQUEUE_ENTRY(type) \
-struct { \
- struct type *nnpq_next, **nnpq_prev; \
-}
-
-/* Is the queue empty. */
-#define NNPQUEUE_EMPTY(head) \
- ((head)->nnpq_first == NULL)
-
-/* Init head. */
-#define NNPQUEUE_INIT(head) do { \
- (head)->nnpq_first = NULL; \
- (head)->nnpq_last = &(head)->nnpq_first; \
-} while (0)
-
-/* Insert elm after listelm, field is named. */
-#define NNPQUEUE_INSERT_HEAD(head, elm, field) do { \
- if (((elm)->field.nnpq_next = (head)->nnpq_first) != NULL) \
- (head)->nnpq_first->field.nnpq_prev = \
- &(elm)->field.nnpq_next; \
- else \
- (head)->nnpq_last = &(elm)->field.nnpq_next; \
- (head)->nnpq_first = (elm); \
- (elm)->field.nnpq_prev = &(head)->nnpq_first; \
-} while (0)
-
-/* Remove an entry. */
-#define NNPQUEUE_REMOVE(elm,head,field) do { \
- if (((elm)->field.nnpq_next) != NULL) \
- (elm)->field.nnpq_next->field.nnpq_prev = \
- (elm)->field.nnpq_prev; \
- else \
- (head)->nnpq_last = (elm)->field.nnpq_prev; \
- *(elm)->field.nnpq_prev = (elm)->field.nnpq_next; \
-} while(0)
-
-/* Iterate over the list. */
-#define NNPQUEUE_FOREACH(var,head,field) \
- for ((var) = ((head)->nnpq_first); \
- (var); \
- (var) = ((var)->field.nnpq_next))
-
-#endif /* NNPFS_QUEUE_H */
diff --git a/usr.sbin/afs/src/rx/LICENSE b/usr.sbin/afs/src/rx/LICENSE
deleted file mode 100644
index 59db278cb0f..00000000000
--- a/usr.sbin/afs/src/rx/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-This software is provided on a 'no charge' basis.
-
-No limitations or constraints are imposed on the use of the software; No
-'license or use' provisions are applicable. The software is truly 'publicly'
-available.
-
-IBM claims the following copyright:
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
diff --git a/usr.sbin/afs/src/rx/Makefile.in b/usr.sbin/afs/src/rx/Makefile.in
deleted file mode 100644
index 050f6688624..00000000000
--- a/usr.sbin/afs/src/rx/Makefile.in
+++ /dev/null
@@ -1,157 +0,0 @@
-#
-# $KTH: Makefile.in,v 1.37.2.1 2001/09/15 13:33:59 mattiasa Exp $
-#
-
-SHELL = /bin/sh
-srcdir = @srcdir@
-top_builddir = ..
-VPATH = @srcdir@
-
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-RM = rm
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-sbindir = @sbindir@
-libdir = @libdir@
-includedir = @includedir@
-mandir = @mandir@
-
-DEFS = @DEFS@ -DRXDEBUG
-CFLAGS = @CFLAGS@
-INCLUDES = -I$(srcdir) -I../include -I$(srcdir)/../include \
- @INC_roken@ @KRB4_INC_FLAGS@ -I$(srcdir)/../lib/cmd
-
-LIB = librx.a
-include_HEADERS = rx.h rx_clock.h rx_event.h rx_globs.h rx_mach.h rx_misc.h \
- rx_multi.h rx_null.h rx_pkt.h rx_queue.h rx_trace.h \
- rx_user.h rxgencon.h
-
-PROGS = test_rx_clock rxdebug rxperf
-
-LIB_SOURCES = \
- rx_clock.c \
- rx_event.c \
- rx_user.c \
- rx.c \
- rx_globs.c \
- rx_null.c \
- rx_misc.c \
- rx_pkt.c \
- rx_rdwr.c \
- rx_trace.c \
- rx_multi.c
-
-test_rx_clock_SOURCES = test_rx_clock.c
-rxdebug_SOURCES = rxdebug.c
-rxperf_SOURCES = rxperf.c
-
-SOURCES = \
- $(LIB_SOURCES) \
- $(test_rx_clock_SOURCES) \
- $(rxdebug_SOURCES) \
- $(rxperf_SOURCES)
-
-LIB_OBJECTS = \
- rx_clock.o \
- rx_event.o \
- rx_user.o \
- rx.o \
- rx_globs.o \
- rx_null.o \
- rx_misc.o \
- rx_pkt.o \
- rx_rdwr.o \
- rx_trace.o \
- rx_multi.o
-
-test_rx_clock_OBJECTS = test_rx_clock.o
-rxdebug_OBJECTS = rxdebug.o
-rxperf_OBJECTS = rxperf.o
-
-OBJECTS = \
- $(LIB_OBJECTS) \
- $(test_rx_clock_OBJECTS) \
- $(rxdebug_OBJECTS) \
- $(rxperf_OBJECTS)
-
-MANPAGES = rxdebug.1
-
-all: $(LIB) $(PROGS)
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
- $(MKINSTALLDIRS) $(DESTDIR)$(includedir)/rx
- $(MKINSTALLDIRS) $(DESTDIR)$(sbindir) $(DESTDIR)$(bindir)
- $(INSTALL_PROGRAM) rxdebug $(DESTDIR)$(bindir)/rxdebug
- $(INSTALL_PROGRAM) rxperf $(DESTDIR)$(sbindir)/rxperf
- $(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/$(LIB)
- for x in $(include_HEADERS); do \
- $(INSTALL_DATA) $(srcdir)/$$x $(DESTDIR)$(includedir)/rx/$$x; \
- done ; \
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$$e ; \
- $(INSTALL_DATA) $(srcdir)/$$x \
- $(DESTDIR)$(mandir)/man$$e/$$f.$$e; \
- done
-
-uninstall:
- rm -f $(DESTDIR)$(libdir)/$(LIB)
- rm -f $(DESTDIR)$(bindir)/rxdebug
- rm -f $(DESTDIR)$(sbindir)/rxperf
- for x in $(include_HEADERS); do \
- rm -f $(DESTDIR)$(includedir)/rx/$$x; \
- done ; \
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- rm -rf $(DESTDIR)$(mandir)/$$f.$$e; \
- done
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES) $(CFLAGS) $<
-
-clean:
- rm -f $(LIB) $(PROGS) *.o *.a
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *~
-
-realclean: distclean
- rm -f TAGS
-
-$(LIB): $(LIB_OBJECTS)
- rm -f $@
- $(AR) cr $@ $(LIB_OBJECTS)
- -$(RANLIB) $@
-
-test_rx_clock: $(test_rx_clock_OBJECTS) $(LIB)
- $(CC) -o $@ $(test_rx_clock_OBJECTS) -L. -lrx $(LIBS)
-
-rxdebug: $(rxdebug_OBJECTS) $(LIB)
- $(CC) -o $@ $(rxdebug_OBJECTS) -L../lib/cmd -lcmd -L. -lrx $(LIBS) -L../lwp -llwp @PLWP_LIB_FLAGS@ -L../lib/ko -lko @LIB_roken@ @LIBS@
-
-rxperf: $(rxperf_OBJECTS) $(LIB)
- $(CC) -o $@ $(rxperf_OBJECTS) -L../lib/cmd -lcmd -L. -lrx $(LIBS) -L../lwp -llwp @PLWP_LIB_FLAGS@ @LIB_roken@ @LIBS@
-
-TAGS: $(SOURCES)
- etags $(SOURCES)
-
-Makefile: Makefile.in ../config.status
- cd ..; CONFIG_FILES=rx/Makefile CONFIG_HEADERS= ./config.status
-
-.PHONY: all clean mostlyclean distclean realclean install uninstall
diff --git a/usr.sbin/afs/src/rx/doyle b/usr.sbin/afs/src/rx/doyle
deleted file mode 100644
index 9f0a5589d54..00000000000
--- a/usr.sbin/afs/src/rx/doyle
+++ /dev/null
@@ -1,17 +0,0 @@
-From: Jim Doyle <jrd@bu.edu>
-To: "Derrick J. Brashear" <shadow@DEMENTIA.ORG>
-Subject: Re: more Krb4 issues
-Date: Tue, 5 Mar 1996 16:47:51 -0500 (EST)
-
-In here are the two TAR files (rxbase.tar.gz, rxkad.tar.gz) that
-Transarc gave me with permission to freely redistribute.. This code
-was given to me by Mike Kazar and it was OK'd for release by Al Spector.
-
-From what I understand, Rx was developed at CMU as part of a DARPA
-funded research project jointly funded by IBM. Rx was picked up by
-the AFS group and then used.. So, by all rights, the Rx stack is in
-the public domain because the DARPA funding requirement placed it
-there... You can read the copyright in the header for the full
-legalese.
-
-[snip]
diff --git a/usr.sbin/afs/src/rx/rx-new.h b/usr.sbin/afs/src/rx/rx-new.h
deleted file mode 100644
index a12f3bb25cb..00000000000
--- a/usr.sbin/afs/src/rx/rx-new.h
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * rx.h,v 1.7 1995/04/11 06:07:07 assar Exp
- */
-
-#ifndef _RX_
-#define _RX_
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <list.h>
-#include <pthread.h>
-#include <thrpool.h>
-
-#include <rx_pkt.h>
-
-/* XXX - This should be moved somewhere else and replaced with XDR */
-
-typedef u_long unsigned32;
-typedef u_short unsigned16;
-
-/* Security garbage */
-
-typedef struct rx_securityClass {
-} rx_securityClass;
-
-typedef struct rx_connection rx_connection;
-
-typedef struct rx_call rx_call;
-
-typedef struct rx_service rx_service;
-
-#define RX_MAXDATA 1444 /* XXX - ??? */
-
-
-typedef struct rx_wirepacket {
- rx_header header;
- char data[RX_MAXDATA];
-} rx_wirepacket;
-
-/*
- * There are two different types of acks.
- * soft ack means that the packet has been receieved at the other end,
- * but the sender should not throw away the packet yet. The receiver
- * can still drop the packet or not give it to the application.
- * The point of the soft acks is mainly flow-control.
- *
- * A hard ack means that the packet has been acknowledged by the
- * application. Then the packet can be thrown away.
- *
- */
-
-typedef enum {
- RX_PKT_SOFT_ACK = 1
-} rx_packet_flags;
-
-typedef struct rx_packet {
- rx_wirepacket wire;
- unsigned datalen;
- rx_call *call;
- rx_packet_flags flags;
-} rx_packet;
-
-
-/* every call - i.e. RPC transaction */
-
-struct rx_call {
- enum { SENDING, RECEIVING } mode;
- u_long callno; /* Call # of this connection */
- u_long seqno; /* Seq # for packets */
- int channelid; /* What channel are we using? */
- rx_connection *conn;
- List *recvpackets; /* List of received packets */
-#if 0
- List *ooopackets; /* Packets rec'd out-of-order */
-#endif
- rx_packet *thispacket; /* This packet, sending or receiving */
- char *ptr; /* Here we should write data */
- unsigned nleft; /* How much data there is left */
- pthread_mutex_t mutex; /* Synchronisation */
- pthread_cond_t cond;
-};
-
-/* This represents the on-going communication, i.e. a connection */
-
-typedef enum {
- RX_CONN_SERVER, /* This is a server */
- RX_CONN_CLIENT /* The other side is a server */
-} rx_connection_type;
-
-#define RX_WINDOW 15
-
-struct rx_connection {
- time_t epoch; /* Time when this connection started */
- u_long connid; /* Connection ID. How? */
- struct sockaddr_in peer; /* The one we're talking to */
- u_long serialno; /* Next serial number to use */
- u_long callno[MAXCALLS]; /* Next call number to use */
- rx_call *calls[MAXCALLS]; /* The on-going calls */
- u_char secindex; /* Security index */
- u_short serviceid; /* Service ID */
- rx_connection_type type; /* Type of connection C-S or S-C */
- u_long maxnoacked; /* Max packet sent and soft-acked */
- List *packets; /* Not yet acked sent packets */
- u_long window; /* Size of the window */
- pthread_cond_t condsend; /* Conditional variable for sending */
- pthread_mutex_t mutexsend; /* Mutex for above */
- pthread_cond_t condrecv;
- pthread_mutex_t mutexrecv;
- rx_service *service; /* Service if server, else NULL */
-};
-
-/*
- * About packets:
- *
- * Here we keep the packets that have been sent but not yet
- * hard-acked. When a packet has been soft-acked we set a flag in the
- * packet_flags and stop the resend-timer.
- */
-
-struct rx_service {
- u_short port;
- u_short serviceid;
- char *servicename;
- int (*serviceproc)(rx_call *);
- Thrpool *thrpool;
-};
-
-/* functions */
-
-int rx_Init (int port);
-
-rx_connection *rx_NewConnection (struct in_addr host, u_short port,
- u_short service,
- rx_securityClass *sec,
- int secindex);
-
-void rx_DestroyConnection (rx_connection *);
-
-rx_call *rx_NewCall (rx_connection *);
-
-int rx_EndCall (rx_call *, int);
-
-rx_service *rx_NewService(u_short port, u_short serviceid,
- char *servicename, rx_securityClass **so,
- int nso, int (*serviceproc)(rx_call *));
-
-int rx_Write (rx_call *, void *, int);
-int rx_Read (rx_call *, void *, int);
-int rx_FlushWrite (rx_call *call);
-
-
-#endif /* _RX_ */
-
-
-
-
-/* Old garbage */
-
-#if 0
-
-/* header of a RPC packet */
-/* We should use XDR on this too. */
-
-typedef enum {
- HT_DATA = 1,
- HT_ACK = 2,
- HT_BUSY = 3,
- HT_ABORT = 4,
- HT_ACKALL = 5,
- HT_CHAL = 6,
- HT_RESP = 7,
- HT_DEBUG = 8
-} rx_header_type;
-
-/* For flags in header */
-
-enum {
- HF_CLIENT_INITIATED = 1,
- HF_REQ_ACK = 2,
- HF_LAST = 4,
- HF_MORE = 8};
-
-#define MAXCALLS 4
-
-#define CALL_MASK (MAXCALLS-1)
-#define CONNID_MASK (~(MAXCALLS-1))
-
-typedef struct rx_header {
- unsigned32 epoch;
- unsigned32 connid; /* And channel ID */
- unsigned32 callid;
- unsigned32 seqno; /* Call-based number */
- unsigned32 serialno; /* Unique number */
- u_char type;
- u_char flags;
- u_char status;
- u_char secindex;
- unsigned16 reserved; /* ??? verifier? */
- unsigned16 serviceid;
-/* This should be the other way around according to everything but */
-/* tcpdump */
-} rx_header;
-
-#endif
-
-#if 0
-
-typedef enum {
- RX_ACK_REQUESTED = 1,
- RX_ACK_DUPLICATE = 2,
- RX_ACK_OUT_OF_SEQUENCE = 3,
- RX_ACK_EXEEDS_WINDOW = 4,
- RX_ACK_NOSPACE = 5,
- RX_ACK_PING = 6,
- RX_ACK_PING_RESPONSE = 7,
- RX_ACK_DELAY = 8
-} rx_ack_reason;
-
-typedef enum {
- RX_ACK_TYPE_NACK = 0,
- RX_ACK_TYPE_ACK = 1
-} rx_ack_type;
-
-#define RXMAXACKS 255
-
-typedef struct rx_ack_packet {
- unsigned16 bufferspace;
- unsigned16 maxskew;
- unsigned32 firstpacket; /* First packet in acks below */
- unsigned32 prevpacket;
- unsigned32 serial; /* Packet that prompted this one */
- u_char reason; /* rx_ack_reason */
- u_char nacks; /* # of acks */
- u_char acks[RXMAXACKS]; /* acks (rx_ack_type) */
-} rx_ack_packet;
-
-#endif
diff --git a/usr.sbin/afs/src/rx/rx.c b/usr.sbin/afs/src/rx/rx.c
deleted file mode 100644
index b3858879356..00000000000
--- a/usr.sbin/afs/src/rx/rx.c
+++ /dev/null
@@ -1,4319 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/* RX: Extended Remote Procedure Call */
-
-#include <assert.h>
-#include "rx_locl.h"
-
-RCSID("$arla: rx.c,v 1.34 2003/04/08 22:14:29 lha Exp $");
-
-/*
- * quota system: each attached server process must be able to make
- * progress to avoid system deadlock, so we ensure that we can always
- * handle the arrival of the next unacknowledged data packet for an
- * attached call. rxi_dataQuota gives the max # of packets that must be
- * reserved for active calls for them to be able to make progress, which is
- * essentially enough to queue up a window-full of packets (the first packet
- * may be missing, so these may not get read) + the # of packets the thread
- * may use before reading all of its input (# free must be one more than send
- * packet quota). Thus, each thread allocates rx_Window+1 (max queued input
- * packets) + an extra for sending data. The system also reserves
- * RX_MAX_QUOTA (must be more than RX_PACKET_QUOTA[i], which is 10), so that
- * the extra packet can be sent (must be under the system-wide send packet
- * quota to send any packets)
- */
-/* # to reserve so that thread with input can still make calls (send packets)
- without blocking */
-long rx_tq_dropped = 0; /* Solaris only temp variable */
-long rxi_dataQuota = RX_MAX_QUOTA; /* packets to reserve for active
- * threads */
-
-/*
- * Variables for handling the minProcs implementation. availProcs gives the
- * number of threads available in the pool at this moment (not counting dudes
- * executing right now). totalMin gives the total number of procs required
- * for handling all minProcs requests. minDeficit is a dynamic variable
- * tracking the # of procs required to satisfy all of the remaining minProcs
- * demands.
- */
-
-long rxi_availProcs = 0; /* number of threads in the pool */
-long rxi_totalMin; /* Sum(minProcs) forall services */
-long rxi_minDeficit = 0; /* number of procs needed to handle
- * all minProcs */
-long Rx0 = 0, Rx1 = 0;
-
-struct rx_serverQueueEntry *rx_waitForPacket = 0;
-struct rx_packet *rx_allocedP = 0;
-
-/* ------------Exported Interfaces------------- */
-
-
-/*
- * This function allows rxkad to set the epoch to a suitably random number
- * which rx_NewConnection will use in the future. The principle purpose is to
- * get rxnull connections to use the same epoch as the rxkad connections do, at
- * least once the first rxkad connection is established. This is important now
- * that the host/port addresses aren't used in FindConnection: the uniqueness
- * of epoch/cid matters and the start time won't do.
- */
-
-void
-rx_SetEpoch(uint32_t epoch)
-{
- rx_epoch = epoch;
-}
-
-/*
- * Initialize rx. A port number may be mentioned, in which case this
- * becomes the default port number for any service installed later.
- * If 0 is provided for the port number, a random port will be chosen
- * by the kernel. Whether this will ever overlap anything in
- * /etc/services is anybody's guess... Returns 0 on success, -1 on
- * error.
- */
-static int rxinit_status = 1;
-
-int
-rx_Init(uint16_t port)
-{
- struct timeval tv;
- char *htable, *ptable;
- uint16_t rport;
-
- SPLVAR;
-
- if (rxinit_status != 1)
- return rxinit_status; /* Already done; return previous error
- * code. */
-
- /*
- * Allocate and initialize a socket for client and perhaps server
- * connections
- */
- rx_socket = rxi_GetUDPSocket(port, &rport);
-
- if (rx_socket == OSI_NULLSOCKET) {
- return RX_ADDRINUSE;
- }
-#if defined(AFS_GLOBAL_SUNLOCK) && defined(KERNEL)
- LOCK_INIT(&afs_rxglobal_lock, "afs_rxglobal_lock");
-#endif
-#ifdef RX_ENABLE_LOCKS
- LOCK_INIT(&rx_freePktQ_lock, "rx_freePktQ_lock");
- LOCK_INIT(&freeSQEList_lock, "freeSQEList lock");
- LOCK_INIT(&rx_waitingForPackets_lock, "rx_waitingForPackets lock");
- LOCK_INIT(&rx_freeCallQueue_lock, "rx_waitingForPackets lock");
-#endif
-
- rxi_nCalls = 0;
- rx_connDeadTime = 12;
- memset((char *) &rx_stats, 0, sizeof(struct rx_stats));
-
- htable = (char *) osi_Alloc(rx_hashTableSize *
- sizeof(struct rx_connection *));
- PIN(htable, rx_hashTableSize *
- sizeof(struct rx_connection *)); /* XXXXX */
- memset(htable, 0, rx_hashTableSize *
- sizeof(struct rx_connection *));
- ptable = (char *) osi_Alloc(rx_hashTableSize * sizeof(struct rx_peer *));
- PIN(ptable, rx_hashTableSize * sizeof(struct rx_peer *)); /* XXXXX */
- memset(ptable, 0, rx_hashTableSize * sizeof(struct rx_peer *));
- NETPRI;
-
- osi_GetTime(&tv);
- /*
- * *Slightly* random start time for the cid. This is just to help
- * out with the hashing function at the peer
- */
- rx_port = rport;
- rx_stats.minRtt.sec = 9999999;
- rx_SetEpoch(tv.tv_sec); /*
- * Start time of this package, rxkad
- * will provide a randomer value.
- */
- rxi_dataQuota += rx_extraQuota; /*
- * + extra packets caller asked to
- * reserve
- */
- rx_nPackets = rx_extraPackets + RX_MAX_QUOTA + 2; /* fudge */
- rx_nextCid = ((tv.tv_sec ^ tv.tv_usec) << RX_CIDSHIFT);
- rx_connHashTable = (struct rx_connection **) htable;
- rx_peerHashTable = (struct rx_peer **) ptable;
-
- clock_Init();
- rxevent_Init(20, rxi_ReScheduleEvents);
-
- /* Malloc up a bunch of packet buffers */
- rx_nFreePackets = 0;
- queue_Init(&rx_freePacketQueue);
- rx_nFreeCbufs = 0;
- queue_Init(&rx_freeCbufQueue);
- USERPRI;
- rxi_MorePackets(rx_nPackets);
- rxi_MoreCbufs(rx_nPackets);
- rx_CheckCbufs(0);
- NETPRI;
-
- rx_lastAckDelay.sec = 0;
- rx_lastAckDelay.usec = 400000; /* 400 ms */
-#ifdef SOFT_ACK
- rx_hardAckDelay.sec = 0;
- rx_hardAckDelay.usec = 100000; /* 100 ms */
- rx_softAckDelay.sec = 0;
- rx_softAckDelay.usec = 100000; /* 100 ms */
-#endif /* SOFT_ACK */
-
- /* Initialize various global queues */
- queue_Init(&rx_idleServerQueue);
- queue_Init(&rx_incomingCallQueue);
- queue_Init(&rx_freeCallQueue);
-
- /*
- * Start listener process (exact function is dependent on the
- * implementation environment--kernel or user space)
- */
- rxi_StartListener();
-
- USERPRI;
- rxinit_status = 0;
- return rxinit_status;
-}
-
-/*
- * called with unincremented nRequestsRunning to see if it is OK to start
- * a new thread in this service. Could be "no" for two reasons: over the
- * max quota, or would prevent others from reaching their min quota.
- */
-static int
-QuotaOK(struct rx_service * aservice)
-{
- /* check if over max quota */
- if (aservice->nRequestsRunning >= aservice->maxProcs)
- return 0;
-
- /* under min quota, we're OK */
- if (aservice->nRequestsRunning < aservice->minProcs)
- return 1;
-
- /*
- * otherwise, can use only if there are enough to allow everyone to go to
- * their min quota after this guy starts.
- */
- if (rxi_availProcs > rxi_minDeficit)
- return 1;
- else
- return 0;
-}
-
-
-/*
- * This routine must be called if any services are exported. If the
- * donateMe flag is set, the calling process is donated to the server
- * process pool
- */
-void
-rx_StartServer(int donateMe)
-{
- struct rx_service *service;
- int i;
-
- SPLVAR;
- clock_NewTime();
-
- NETPRI;
- /*
- * Start server processes, if necessary (exact function is dependent
- * on the implementation environment--kernel or user space). DonateMe
- * will be 1 if there is 1 pre-existing proc, i.e. this one. In this
- * case, one less new proc will be created rx_StartServerProcs.
- */
- rxi_StartServerProcs(donateMe);
-
- /*
- * count up the # of threads in minProcs, and add set the min deficit to
- * be that value, too.
- */
- for (i = 0; i < RX_MAX_SERVICES; i++) {
- service = rx_services[i];
- if (service == (struct rx_service *) 0)
- break;
- rxi_totalMin += service->minProcs;
- /*
- * below works even if a thread is running, since minDeficit would
- * still have been decremented and later re-incremented.
- */
- rxi_minDeficit += service->minProcs;
- }
-
- /* Turn on reaping of idle server connections */
- rxi_ReapConnections();
-
- if (donateMe)
- rx_ServerProc(); /* Never returns */
- USERPRI;
- return;
-}
-
-/*
- * Create a new client connection to the specified service, using the
- * specified security object to implement the security model for this
- * connection.
- */
-struct rx_connection *
-rx_NewConnection(uint32_t shost, uint16_t sport, uint16_t sservice,
- struct rx_securityClass * securityObject,
- int serviceSecurityIndex)
-{
- int hashindex, error;
- long cid;
- struct rx_connection *conn;
-
- SPLVAR;
-#if defined(AFS_SGIMP_ENV)
- GLOCKSTATE ms;
-
-#endif
-
- clock_NewTime();
- dpf(("rx_NewConnection(host %x, port %u, service %u, "
- "securityObject %x, serviceSecurityIndex %d)\n",
- shost, sport, sservice, securityObject, serviceSecurityIndex));
- GLOBAL_LOCK();
-#if defined(AFS_SGIMP_ENV)
- AFS_GRELEASE(&ms);
- /* NETPRI protects Cid and Alloc */
- NETPRI;
-#endif
- cid = (rx_nextCid += RX_MAXCALLS);
- conn = rxi_AllocConnection();
-#if !defined(AFS_SGIMP_ENV)
- NETPRI;
-#endif
- conn->type = RX_CLIENT_CONNECTION;
- conn->cid = cid;
- conn->epoch = rx_epoch;
- conn->peer = rxi_FindPeer(shost, sport);
- queue_Append(&conn->peer->connQueue, conn);
- conn->serviceId = sservice;
- conn->securityObject = securityObject;
- conn->securityData = (void *) 0;
- conn->securityIndex = serviceSecurityIndex;
- conn->maxPacketSize = MIN(conn->peer->packetSize, OLD_MAX_PACKET_SIZE);
- rx_SetConnDeadTime(conn, rx_connDeadTime);
-
- error = RXS_NewConnection(securityObject, conn);
- if (error)
- conn->error = error;
- hashindex = CONN_HASH(shost, sport, conn->cid, conn->epoch,
- RX_CLIENT_CONNECTION);
- conn->next = rx_connHashTable[hashindex];
- rx_connHashTable[hashindex] = conn;
- rx_stats.nClientConns++;
-
- conn->refCount++;
- USERPRI;
-#if defined(AFS_SGIMP_ENV)
- AFS_GACQUIRE(&ms);
-#endif
- GLOBAL_UNLOCK();
- return conn;
-}
-
-void
-rxi_SetConnDeadTime(struct rx_connection * conn, int seconds)
-{
- /*
- * This is completely silly; perhaps exponential back off
- * would be more reasonable? XXXX
- */
- conn->secondsUntilDead = seconds;
- conn->secondsUntilPing = seconds / 6;
- if (conn->secondsUntilPing == 0)
- conn->secondsUntilPing = 1; /* XXXX */
-}
-
-/* Destroy the specified connection */
-void
-rx_DestroyConnection(struct rx_connection * conn)
-{
- struct rx_connection **conn_ptr;
- int i;
- int havecalls = 0;
-
- SPLVAR;
-
- clock_NewTime();
-
- NETPRI;
- if (--conn->refCount > 0) {
- /* Busy; wait till the last guy before proceeding */
- USERPRI;
- return;
- }
- /*
- * If the client previously called rx_NewCall, but it is still
- * waiting, treat this as a running call, and wait to destroy the
- * connection later when the call completes.
- */
- if ((conn->type == RX_CLIENT_CONNECTION) &&
- (conn->flags & RX_CONN_MAKECALL_WAITING)) {
- conn->flags |= RX_CONN_DESTROY_ME;
- USERPRI;
- return;
- }
- /* Check for extant references to this connection */
- for (i = 0; i < RX_MAXCALLS; i++) {
- struct rx_call *call = conn->call[i];
-
- if (call) {
- havecalls = 1;
- if (conn->type == RX_CLIENT_CONNECTION) {
- if (call->delayedAckEvent) {
- /*
- * Push the final acknowledgment out now--there
- * won't be a subsequent call to acknowledge the
- * last reply packets
- */
- rxevent_Cancel(call->delayedAckEvent);
- rxi_AckAll((struct rxevent *) 0, call, 0);
- }
- }
- }
- }
-
- if (havecalls) {
- /*
- * Don't destroy the connection if there are any call
- * structures still in use
- */
- conn->flags |= RX_CONN_DESTROY_ME;
- USERPRI;
- return;
- }
- /* Remove from connection hash table before proceeding */
- conn_ptr = &rx_connHashTable[CONN_HASH(peer->host, peer->port, conn->cid,
- conn->epoch, conn->type)];
- for (; *conn_ptr; conn_ptr = &(*conn_ptr)->next) {
- if (*conn_ptr == conn) {
- *conn_ptr = conn->next;
- break;
- }
- }
-
- /*
- * Notify the service exporter, if requested, that this connection
- * is being destroyed
- */
- if (conn->type == RX_SERVER_CONNECTION && conn->service->destroyConnProc)
- (*conn->service->destroyConnProc) (conn);
-
- /* Notify the security module that this connection is being destroyed */
- RXS_DestroyConnection(conn->securityObject, conn);
-
- /* Make sure that the connection is completely reset before deleting it. */
- rxi_ResetConnection(conn);
-
- queue_Remove(conn);
- if (--conn->peer->refCount == 0)
- conn->peer->idleWhen = clock_Sec();
-
- if (conn->type == RX_SERVER_CONNECTION)
- rx_stats.nServerConns--;
- else
- rx_stats.nClientConns--;
-
-
- RX_MUTEX_DESTROY(&conn->lock);
- rxi_FreeConnection(conn);
- USERPRI;
-}
-
-/*
- * Start a new rx remote procedure call, on the specified connection.
- * If wait is set to 1, wait for a free call channel; otherwise return
- * 0. Maxtime gives the maximum number of seconds this call may take,
- * after rx_MakeCall returns. After this time interval, a call to any
- * of rx_SendData, rx_ReadData, etc. will fail with RX_CALL_TIMEOUT.
- */
-struct rx_call *
-rx_NewCall(struct rx_connection * conn)
-{
- int i;
- struct rx_call *call;
-
- SPLVAR;
-#if defined(AFS_SGIMP_ENV)
- GLOCKSTATE ms;
-
-#endif
- clock_NewTime();
- dpf(("rx_NewCall(conn %x)\n", conn));
-
- GLOBAL_LOCK();
-#if defined(AFS_SGIMP_ENV)
- AFS_GRELEASE(&ms);
-#endif
- NETPRI;
- for (;;) {
- for (i = 0; i < RX_MAXCALLS; i++) {
- call = conn->call[i];
- if (call) {
- if (call->state == RX_STATE_DALLY) {
- RX_MUTEX_ENTER(&call->lock);
- rxi_ResetCall(call);
- (*call->callNumber)++;
- break;
- }
- } else {
- call = rxi_NewCall(conn, i);
- RX_MUTEX_ENTER(&call->lock);
- break;
- }
- }
- if (i < RX_MAXCALLS) {
- break;
- }
- conn->flags |= RX_CONN_MAKECALL_WAITING;
-#ifdef RX_ENABLE_LOCKS
- cv_wait(&conn->cv, &conn->lock);
-#else
- osi_rxSleep(conn);
-#endif
- }
-
- /* Client is initially in send mode */
- call->state = RX_STATE_ACTIVE;
- call->mode = RX_MODE_SENDING;
-
- /* remember start time for call in case we have hard dead time limit */
- call->startTime = clock_Sec();
-
- /* Turn on busy protocol. */
- rxi_KeepAliveOn(call);
-
- RX_MUTEX_EXIT(&call->lock);
- USERPRI;
-#if defined(AFS_SGIMP_ENV)
- AFS_GACQUIRE(&ms);
-#endif
- GLOBAL_UNLOCK();
- return call;
-}
-
-static int
-rxi_HasActiveCalls(struct rx_connection * aconn)
-{
- int i;
- struct rx_call *tcall;
-
- SPLVAR;
-
- NETPRI;
- for (i = 0; i < RX_MAXCALLS; i++) {
- if ((tcall = aconn->call[i]) != NULL) {
- if ((tcall->state == RX_STATE_ACTIVE)
- || (tcall->state == RX_STATE_PRECALL)) {
- USERPRI;
- return 1;
- }
- }
- }
- USERPRI;
- return 0;
-}
-
-int
-rxi_GetCallNumberVector(const struct rx_connection * aconn,
- int32_t *alongs)
-{
- int i;
- struct rx_call *tcall;
-
- SPLVAR;
-
- NETPRI;
- for (i = 0; i < RX_MAXCALLS; i++) {
- if ((tcall = aconn->call[i]) && (tcall->state == RX_STATE_DALLY))
- alongs[i] = aconn->callNumber[i] + 1;
- else
- alongs[i] = aconn->callNumber[i];
- }
- USERPRI;
- return 0;
-}
-
-int
-rxi_SetCallNumberVector(struct rx_connection * aconn,
- int32_t *alongs)
-{
- int i;
- struct rx_call *tcall;
-
- SPLVAR;
-
- NETPRI;
- for (i = 0; i < RX_MAXCALLS; i++) {
- if ((tcall = aconn->call[i]) && (tcall->state == RX_STATE_DALLY))
- aconn->callNumber[i] = alongs[i] - 1;
- else
- aconn->callNumber[i] = alongs[i];
- }
- USERPRI;
- return 0;
-}
-
-/*
- * Advertise a new service. A service is named locally by a UDP port
- * number plus a 16-bit service id. Returns (struct rx_service *) 0
- * on a failure.
- */
-struct rx_service *
-rx_NewService(uint16_t port, uint16_t serviceId, char *serviceName,
- struct rx_securityClass ** securityObjects,
- int nSecurityObjects,
- int32_t (*serviceProc) (struct rx_call *))
-{
- osi_socket socket = OSI_NULLSOCKET;
- struct rx_securityClass **sersec;
- struct rx_service *tservice;
- int reuse = 0;
- int i;
-
- SPLVAR;
-
- clock_NewTime();
-
- if (serviceId == 0) {
- osi_Msg(("rx_NewService: service id for service %s is not"
- " non-zero.\n", serviceName));
- return 0;
- }
- if (port == 0) {
- if (rx_port == 0) {
- osi_Msg(("rx_NewService: A non-zero port must be specified on "
- "this call if a non-zero port was not provided at Rx "
- "initialization (service %s).\n", serviceName));
- return 0;
- }
- port = rx_port;
- socket = rx_socket;
- }
- sersec = (void *)rxi_Alloc(sizeof(*sersec) * nSecurityObjects);
- for (i = 0; i < nSecurityObjects; i++)
- sersec[i] = securityObjects[i];
- tservice = rxi_AllocService();
- NETPRI;
- for (i = 0; i < RX_MAX_SERVICES; i++) {
- struct rx_service *service = rx_services[i];
-
- if (service) {
- if (port == service->servicePort) {
- if (service->serviceId == serviceId) {
- /*
- * The identical service has already been
- * installed; if the caller was intending to
- * change the security classes used by this
- * service, he/she loses.
- */
- osi_Msg(("rx_NewService: tried to install service %s "
- "with service id %d, which is already in use "
- "for service %s\n", serviceName, serviceId,
- service->serviceName));
- USERPRI;
- rxi_FreeService(tservice);
- return service;
- }
- /*
- * Different service, same port: re-use the socket which is
- * bound to the same port
- */
- socket = service->socket;
- reuse = 1;
- }
- } else {
- if (socket == OSI_NULLSOCKET) {
-
- /*
- * If we don't already have a socket (from another service on
- * same port) get a new one
- */
- socket = rxi_GetUDPSocket(port, NULL);
- if (socket == OSI_NULLSOCKET) {
- USERPRI;
- rxi_FreeService(tservice);
- return 0;
- }
- }
- service = tservice;
- service->socket = socket;
- service->servicePort = port;
- service->serviceId = serviceId;
- service->serviceName = serviceName;
- service->nSecurityObjects = nSecurityObjects;
- service->securityObjects = sersec;
- service->minProcs = 0;
- service->maxProcs = 1;
- service->idleDeadTime = 60;
- service->connDeadTime = rx_connDeadTime;
- service->executeRequestProc = serviceProc;
- rx_services[i] = service; /* not visible until now */
- for (i = 0; i < nSecurityObjects; i++) {
- if (securityObjects[i])
- RXS_NewService(securityObjects[i], service, reuse);
- }
- USERPRI;
- return service;
- }
- }
- USERPRI;
- rxi_FreeService(tservice);
- osi_Msg(("rx_NewService: cannot support > %d services\n",
- RX_MAX_SERVICES));
- return 0;
-}
-
-/*
- * This is the server process's request loop. This routine should
- * either be each server proc's entry point, or it should be called by
- * the server process (depending upon the rx implementation
- * environment).
- */
-void
-rx_ServerProc(void)
-{
- struct rx_call *call;
- int32_t code;
- struct rx_service *tservice;
-
-#if defined(AFS_SGIMP_ENV)
- SPLVAR;
- GLOCKSTATE ms;
-
- AFS_GRELEASE(&ms);
- NETPRI;
-#endif
-
- rxi_dataQuota += rx_Window + 2; /*
- * reserve a window of packets for
- * hard times
- */
- rxi_MorePackets(rx_Window + 2); /* alloc more packets, too */
- rxi_availProcs++; /*
- * one more thread handling incoming
- * calls
- */
-#if defined(AFS_SGIMP_ENV)
- USERPRI;
-#endif
- for (;;) {
-
- call = rx_GetCall();
-#ifdef KERNEL
- if (afs_termState == AFSOP_STOP_RXCALLBACK) {
- RX_MUTEX_ENTER(&afs_termStateLock);
- afs_termState = AFSOP_STOP_AFS;
-#ifdef RX_ENABLE_LOCKS
- cv_signal(&afs_termStateCv);
-#else
- osi_rxWakeup(&afs_termState);
-#endif
- RX_MUTEX_EXIT(&afs_termStateLock);
- return;
- }
-#endif
- tservice = call->conn->service;
-#if defined(AFS_SGIMP_ENV)
- AFS_GLOCK();
-#endif
- if (tservice->beforeProc)
- (*tservice->beforeProc) (call);
-
- code = call->conn->service->executeRequestProc(call);
-
- if (tservice->afterProc)
- (*tservice->afterProc) (call, code);
-
- rx_EndCall(call, code);
- rxi_nCalls++;
-#if defined(AFS_SGIMP_ENV)
- AFS_GUNLOCK();
-#endif
- }
-}
-
-
-/*
- * Sleep until a call arrives. Returns a pointer to the call, ready
- * for an rx_Read.
- */
-struct rx_call *
-rx_GetCall(void)
-{
- struct rx_serverQueueEntry *sq;
- struct rx_call *call = (struct rx_call *) 0;
- struct rx_service *service = NULL;
-
- SPLVAR;
-
- GLOBAL_LOCK();
- RX_MUTEX_ENTER(&freeSQEList_lock);
-
- if ((sq = rx_FreeSQEList) != NULL) {
- rx_FreeSQEList = *(struct rx_serverQueueEntry **) sq;
- RX_MUTEX_EXIT(&freeSQEList_lock);
- } else { /* otherwise allocate a new one and
- * return that */
- RX_MUTEX_EXIT(&freeSQEList_lock);
- sq = (struct rx_serverQueueEntry *) rxi_Alloc(sizeof(struct rx_serverQueueEntry));
-#ifdef RX_ENABLE_LOCKS
- LOCK_INIT(&sq->lock, "server Queue lock");
-#endif
- }
- RX_MUTEX_ENTER(&sq->lock);
-#if defined(AFS_SGIMP_ENV)
- ASSERT(!isafs_glock());
-#endif
- NETPRI;
-
- if (queue_IsNotEmpty(&rx_incomingCallQueue)) {
- struct rx_call *tcall, *ncall;
-
- /*
- * Scan for eligible incoming calls. A call is not eligible
- * if the maximum number of calls for its service type are
- * already executing
- */
- for (queue_Scan(&rx_incomingCallQueue, tcall, ncall, rx_call)) {
- service = tcall->conn->service;
- if (QuotaOK(service)) {
- call = tcall;
- break;
- }
- }
- }
- if (call) {
- queue_Remove(call);
- call->flags &= (~RX_CALL_WAIT_PROC);
- service->nRequestsRunning++;
- /*
- * just started call in minProcs pool, need fewer to maintain
- * guarantee
- */
- if (service->nRequestsRunning <= service->minProcs)
- rxi_minDeficit--;
- rxi_availProcs--;
- rx_nWaiting--;
- } else {
- /*
- * If there are no eligible incoming calls, add this process
- * to the idle server queue, to wait for one
- */
- sq->newcall = 0;
- queue_Append(&rx_idleServerQueue, sq);
- rx_waitForPacket = sq;
- do {
-#ifdef RX_ENABLE_LOCKS
- cv_wait(&sq->cv, &sq->lock);
-#else
- osi_rxSleep(sq);
-#endif
-#ifdef KERNEL
- if (afs_termState == AFSOP_STOP_RXCALLBACK) {
- GLOBAL_UNLOCK();
- USERPRI;
- return (struct rx_call *) 0;
- }
-#endif
- } while (!(call = sq->newcall));
- }
- RX_MUTEX_EXIT(&sq->lock);
-
- RX_MUTEX_ENTER(&freeSQEList_lock);
- *(struct rx_serverQueueEntry **) sq = rx_FreeSQEList;
- rx_FreeSQEList = sq;
- RX_MUTEX_EXIT(&freeSQEList_lock);
-
- call->state = RX_STATE_ACTIVE;
- call->mode = RX_MODE_RECEIVING;
- if (queue_IsEmpty(&call->rq)) {
- /* we can't schedule a call if there's no data!!! */
- rxi_SendAck(call, 0, 0, 0, 0, RX_ACK_DELAY);
- }
- rxi_calltrace(RX_CALL_START, call);
- dpf(("rx_GetCall(port=%d, service=%d) ==> call %x\n",
- call->conn->service->servicePort,
- call->conn->service->serviceId, call));
-
- GLOBAL_UNLOCK();
- USERPRI;
-
- return call;
-}
-
-
-
-/*
- * Establish a procedure to be called when a packet arrives for a
- * call. This routine will be called at most once after each call,
- * and will also be called if there is an error condition on the or
- * the call is complete. Used by multi rx to build a selection
- * function which determines which of several calls is likely to be a
- * good one to read from.
- * NOTE: the way this is currently implemented it is probably only a
- * good idea to (1) use it immediately after a newcall (clients only)
- * and (2) only use it once. Other uses currently void your warranty
- */
-void
-rx_SetArrivalProc(struct rx_call * call, void (*proc) (),
- void *handle, void *arg)
-{
- call->arrivalProc = proc;
- call->arrivalProcHandle = handle;
- call->arrivalProcArg = arg;
-}
-
-/*
- * Call is finished (possibly prematurely). Return rc to the peer, if
- * appropriate, and return the final error code from the conversation
- * to the caller
- */
-int32_t
-rx_EndCall(struct rx_call * call, int32_t rc)
-{
- struct rx_connection *conn = call->conn;
- struct rx_service *service;
- int32_t error;
-
- SPLVAR;
-#if defined(AFS_SGIMP_ENV)
- GLOCKSTATE ms;
-
-#endif
-
- dpf(("rx_EndCall(call %x)\n", call));
-
-#if defined(AFS_SGIMP_ENV)
- AFS_GRELEASE(&ms);
-#endif
- NETPRI;
- GLOBAL_LOCK();
- RX_MUTEX_ENTER(&call->lock);
-
- call->arrivalProc = (void (*) ()) 0;
- if (rc && call->error == 0) {
- rxi_CallError(call, rc);
- /*
- * Send an abort message to the peer if this error code has
- * only just been set. If it was set previously, assume the
- * peer has already been sent the error code or will request it
- */
- rxi_SendCallAbort(call, (struct rx_packet *) 0);
- }
- if (conn->type == RX_SERVER_CONNECTION) {
- /* Make sure reply or at least dummy reply is sent */
- if (call->mode == RX_MODE_RECEIVING) {
- RX_MUTEX_EXIT(&call->lock);
- GLOBAL_UNLOCK();
-
- rx_Write(call, 0, 0);
-
- GLOBAL_LOCK();
- RX_MUTEX_ENTER(&call->lock);
- }
- if (call->mode == RX_MODE_SENDING) {
- rx_FlushWrite(call);
- }
- service = conn->service;
- service->nRequestsRunning--;
- if (service->nRequestsRunning < service->minProcs)
- rxi_minDeficit++;
- rxi_availProcs++;
- rxi_calltrace(RX_CALL_END, call);
- } else { /* Client connection */
- char dummy;
-
- /*
- * Make sure server receives input packets, in the case where
- * no reply arguments are expected
- */
- if (call->mode == RX_MODE_SENDING) {
- RX_MUTEX_EXIT(&call->lock);
- GLOBAL_UNLOCK();
-
- (void) rx_Read(call, &dummy, 1);
-
- GLOBAL_LOCK();
- RX_MUTEX_ENTER(&call->lock);
- }
- if (conn->flags & RX_CONN_MAKECALL_WAITING) {
- conn->flags &= (~RX_CONN_MAKECALL_WAITING);
-#ifdef RX_ENABLE_LOCKS
- cv_signal(&conn->cv);
-#else
- osi_rxWakeup(conn);
-#endif
- }
- }
- call->state = RX_STATE_DALLY;
- error = call->error;
-
- /*
- * currentPacket, nLeft, and NFree must be zeroed here, because
- * ResetCall cannot: ResetCall may be called at splnet(), in the
- * kernel version, and may interrupt the macros rx_Read or
- * rx_Write, which run at normal priority for efficiency.
- */
- if (call->currentPacket) {
- rxi_FreePacket(call->currentPacket);
- call->currentPacket = (struct rx_packet *) 0;
- call->nLeft = call->nFree = 0;
- } else
- call->nLeft = call->nFree = 0;
-
-
- RX_MUTEX_EXIT(&call->lock);
- GLOBAL_UNLOCK();
- USERPRI;
-#if defined(AFS_SGIMP_ENV)
- AFS_GACQUIRE(&ms);
-#endif
- /*
- * Map errors to the local host's errno.h format.
- */
- error = ntoh_syserr_conv(error);
- return error;
-}
-
-/*
- * Call this routine when shutting down a server or client (especially
- * clients). This will allow Rx to gracefully garbage collect server
- * connections, and reduce the number of retries that a server might
- * make to a dead client
- */
-void
-rx_Finalize(void)
-{
- struct rx_connection **conn_ptr, **conn_end;
-
- SPLVAR;
- NETPRI;
- if (rx_connHashTable)
- for (conn_ptr = &rx_connHashTable[0],
- conn_end = &rx_connHashTable[rx_hashTableSize];
- conn_ptr < conn_end; conn_ptr++) {
- struct rx_connection *conn, *next;
-
- for (conn = *conn_ptr; conn; conn = next) {
- next = conn->next;
- if (conn->type == RX_CLIENT_CONNECTION)
- rx_DestroyConnection(conn);
- }
- }
-
-#ifdef RXDEBUG
- if (rx_debugFile) {
- fclose(rx_debugFile);
- rx_debugFile = NULL;
- }
-#endif
- rxi_flushtrace();
- USERPRI;
-}
-
-/*
- * if we wakeup packet waiter too often, can get in loop with two
- * AllocSendPackets each waking each other up (from ReclaimPacket calls)
- */
-void
-rxi_PacketsUnWait(void)
-{
-
- RX_MUTEX_ENTER(&rx_waitingForPackets_lock);
- if (!rx_waitingForPackets) {
- RX_MUTEX_EXIT(&rx_waitingForPackets_lock);
- return;
- }
- if (rxi_OverQuota(RX_PACKET_CLASS_SEND)) {
- RX_MUTEX_EXIT(&rx_waitingForPackets_lock);
- return; /* still over quota */
- }
- rx_waitingForPackets = 0;
-#ifdef RX_ENABLE_LOCKS
- cv_signal(&rx_waitingForPackets_cv);
-#else
- osi_rxWakeup(&rx_waitingForPackets);
-#endif
- RX_MUTEX_EXIT(&rx_waitingForPackets_lock);
- return;
-}
-
-
-/* ------------------Internal interfaces------------------------- */
-
-/*
- * Return this process's service structure for the
- * specified socket and service
- */
-static struct rx_service *
-rxi_FindService(osi_socket socket, uint16_t serviceId)
-{
- struct rx_service **sp;
-
- for (sp = &rx_services[0]; *sp; sp++) {
- if ((*sp)->serviceId == serviceId && (*sp)->socket == socket)
- return *sp;
- }
- return 0;
-}
-
-/*
- * Allocate a call structure, for the indicated channel of the
- * supplied connection. The mode and state of the call must be set by
- * the caller.
- */
-struct rx_call *
-rxi_NewCall(struct rx_connection * conn, int channel)
-{
- struct rx_call *call;
-
- /*
- * Grab an existing call structure, or allocate a new one.
- * Existing call structures are assumed to have been left reset by
- * rxi_FreeCall
- */
- RX_MUTEX_ENTER(&rx_freeCallQueue_lock);
-
- if (queue_IsNotEmpty(&rx_freeCallQueue)) {
- call = queue_First(&rx_freeCallQueue, rx_call);
- queue_Remove(call);
- rx_stats.nFreeCallStructs--;
- RX_MUTEX_EXIT(&rx_freeCallQueue_lock);
- RX_MUTEX_ENTER(&call->lock);
-
-#ifdef ADAPT_PERF
- /* Bind the call to its connection structure */
- call->conn = conn;
-#endif
- } else {
- call = (struct rx_call *) rxi_Alloc(sizeof(struct rx_call));
-
- RX_MUTEX_EXIT(&rx_freeCallQueue_lock);
- RX_MUTEX_INIT(&call->lock, "call lock", RX_MUTEX_DEFAULT, NULL);
- RX_MUTEX_INIT(&call->lockw, "call wlock", RX_MUTEX_DEFAULT, NULL);
- RX_MUTEX_ENTER(&call->lock);
-
- rx_stats.nCallStructs++;
- /* Initialize once-only items */
- queue_Init(&call->tq);
- queue_Init(&call->rq);
-#ifdef ADAPT_PERF
- /* Bind the call to its connection structure (prereq for reset) */
- call->conn = conn;
-#endif
- rxi_ResetCall(call);
- }
-#ifndef ADAPT_PERF
- /* Bind the call to its connection structure (prereq for reset) */
- call->conn = conn;
-#endif
- call->channel = channel;
- call->callNumber = &conn->callNumber[channel];
- /*
- * Note that the next expected call number is retained (in
- * conn->callNumber[i]), even if we reallocate the call structure
- */
- conn->call[channel] = call;
- /*
- * if the channel's never been used (== 0), we should start at 1, otherwise
- * the call number is valid from the last time this channel was used
- */
- if (*call->callNumber == 0)
- *call->callNumber = 1;
-
- RX_MUTEX_EXIT(&call->lock);
- return call;
-}
-
-/*
- * A call has been inactive long enough that so we can throw away
- * state, including the call structure, which is placed on the call
- * free list.
- */
-void
-rxi_FreeCall(struct rx_call * call)
-{
- int channel = call->channel;
- struct rx_connection *conn = call->conn;
-
-
- RX_MUTEX_ENTER(&call->lock);
-
- if (call->state == RX_STATE_DALLY)
- (*call->callNumber)++;
- rxi_ResetCall(call);
- call->conn->call[channel] = (struct rx_call *) 0;
-
- RX_MUTEX_ENTER(&rx_freeCallQueue_lock);
-
- queue_Append(&rx_freeCallQueue, call);
- rx_stats.nFreeCallStructs++;
-
- RX_MUTEX_EXIT(&rx_freeCallQueue_lock);
- RX_MUTEX_EXIT(&call->lock);
-
- /*
- * Destroy the connection if it was previously slated for
- * destruction, i.e. the Rx client code previously called
- * rx_DestroyConnection (client connections), or
- * rxi_ReapConnections called the same routine (server
- * connections). Only do this, however, if there are no
- * outstanding calls
- */
- if (conn->flags & RX_CONN_DESTROY_ME) {
-#if 0
- conn->refCount++;
-#endif
- rx_DestroyConnection(conn);
- }
-}
-
-
-long rxi_Alloccnt = 0, rxi_Allocsize = 0;
-
-void *
-rxi_Alloc(int size)
-{
- void *p;
-
- rxi_Alloccnt++;
- rxi_Allocsize += size;
- p = osi_Alloc(size);
- if (!p)
- osi_Panic("rxi_Alloc error");
- memset(p, 0, size);
- return p;
-}
-
-void
-rxi_Free(void *addr, int size)
-{
- rxi_Alloccnt--;
- rxi_Allocsize -= size;
-#if (defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV)) && defined(KERNEL)
- osi_FreeSmall(addr);
-#else
- osi_Free(addr, size);
-#endif
-}
-
-/*
- * Find the peer process represented by the supplied (host,port)
- * combination. If there is no appropriate active peer structure, a
- * new one will be allocated and initialized
- */
-struct rx_peer *
-rxi_FindPeer(uint32_t host, uint16_t port)
-{
- struct rx_peer *pp;
- int hashIndex;
-
- hashIndex = PEER_HASH(host, port);
- for (pp = rx_peerHashTable[hashIndex]; pp; pp = pp->next) {
- if ((pp->host == host) && (pp->port == port))
- break;
- }
- if (!pp) {
- pp = rxi_AllocPeer(); /*
- * This bzero's *pp: anything not
- * explicitly
- */
- pp->host = host; /*
- * set here or in InitPeerParams is
- * zero
- */
- pp->port = port;
- queue_Init(&pp->congestionQueue);
- queue_Init(&pp->connQueue);
- pp->next = rx_peerHashTable[hashIndex];
- rx_peerHashTable[hashIndex] = pp;
- rxi_InitPeerParams(pp);
- rx_stats.nPeerStructs++;
- }
- pp->refCount++;
- return pp;
-}
-
-/*
- * Remove `peer' from the hash table.
- */
-
-static void
-rxi_RemovePeer(struct rx_peer *peer)
-{
- struct rx_peer **peer_ptr;
-
- for (peer_ptr = &rx_peerHashTable[PEER_HASH(peer->host, peer->port)];
- *peer_ptr; peer_ptr = &(*peer_ptr)->next) {
- if (*peer_ptr == peer) {
- *peer_ptr = peer->next;
- return;
- }
- }
-}
-
-/*
- * Destroy the specified peer structure, removing it from the peer hash
- * table
- */
-
-static void
-rxi_DestroyPeer(struct rx_peer * peer)
-{
- rxi_RemovePeer(peer);
- assert(queue_IsEmpty(&peer->connQueue));
- rxi_FreePeer(peer);
- rx_stats.nPeerStructs--;
-}
-
-/*
- * Add `peer' to the hash table.
- */
-
-static struct rx_peer *
-rxi_InsertPeer(struct rx_peer *peer)
-{
- struct rx_peer *pp;
- int hashIndex;
-
- hashIndex = PEER_HASH(peer->host, peer->port);
- for (pp = rx_peerHashTable[hashIndex]; pp; pp = pp->next) {
- if ((pp->host == peer->host) && (pp->port == peer->port))
- break;
- }
- if (pp != NULL) {
- struct rx_connection *conn, *next;
-
- pp->refCount += peer->refCount;
- pp->nSent += peer->nSent;
- pp->reSends += peer->reSends;
-
- for (queue_Scan(&peer->connQueue, conn, next, rx_connection)) {
- conn->peer = pp;
- queue_Remove(conn);
- queue_Append(&pp->connQueue, conn);
- }
-
- assert(queue_IsEmpty(&peer->connQueue));
- rxi_FreePeer(peer);
- rx_stats.nPeerStructs--;
- return pp;
- } else {
- peer->next = rx_peerHashTable[hashIndex];
- rx_peerHashTable[hashIndex] = peer;
- return peer;
- }
-}
-
-/*
- * Change the key of a given peer
- */
-
-static struct rx_peer *
-rxi_ChangePeer(struct rx_peer *peer, uint32_t host, uint16_t port)
-{
- rxi_RemovePeer(peer);
- peer->host = host;
- peer->port = port;
- return rxi_InsertPeer(peer);
-}
-
-/*
- * Find the connection at (host, port) started at epoch, and with the
- * given connection id. Creates the server connection if necessary.
- * The type specifies whether a client connection or a server
- * connection is desired. In both cases, (host, port) specify the
- * peer's (host, pair) pair. Client connections are not made
- * automatically by this routine. The parameter socket gives the
- * socket descriptor on which the packet was received. This is used,
- * in the case of server connections, to check that *new* connections
- * come via a valid (port, serviceId). Finally, the securityIndex
- * parameter must match the existing index for the connection. If a
- * server connection is created, it will be created using the supplied
- * index, if the index is valid for this service
- */
-static struct rx_connection *
-rxi_FindConnection(osi_socket socket, uint32_t host,
- uint16_t port, uint16_t serviceId, uint32_t cid,
- uint32_t epoch, int type, u_int securityIndex)
-{
- int hashindex;
- struct rx_connection *conn;
- struct rx_peer *pp = NULL;
-
- hashindex = CONN_HASH(host, port, cid, epoch, type);
- for (conn = rx_connHashTable[hashindex]; conn; conn = conn->next) {
- if ((conn->type == type) && ((cid & RX_CIDMASK) == conn->cid) &&
- (epoch == conn->epoch) &&
- (securityIndex == conn->securityIndex)) {
- pp = conn->peer;
-
- if (type == RX_CLIENT_CONNECTION || pp->host == host)
- break;
- }
- }
- if (conn != NULL) {
- if (pp->host != host || pp->port != port)
- conn->peer = rxi_ChangePeer (pp, host, port);
- } else {
- struct rx_service *service;
-
- if (type == RX_CLIENT_CONNECTION)
- return (struct rx_connection *) 0;
- service = rxi_FindService(socket, serviceId);
- if (!service || (securityIndex >= service->nSecurityObjects)
- || (service->securityObjects[securityIndex] == 0))
- return (struct rx_connection *) 0;
- conn = rxi_AllocConnection(); /* This bzero's the connection */
-#ifdef RX_ENABLE_LOCKS
- LOCK_INIT(&conn->lock, "conn lock");
-#endif
- conn->next = rx_connHashTable[hashindex];
- rx_connHashTable[hashindex] = conn;
- conn->peer = rxi_FindPeer(host, port);
- queue_Append(&conn->peer->connQueue, conn);
- conn->maxPacketSize = MIN(conn->peer->packetSize, OLD_MAX_PACKET_SIZE);
- conn->type = RX_SERVER_CONNECTION;
- conn->lastSendTime = clock_Sec(); /* don't GC immediately */
- conn->epoch = epoch;
- conn->cid = cid & RX_CIDMASK;
- /* conn->serial = conn->lastSerial = 0; */
- /* conn->rock = 0; */
- /* conn->timeout = 0; */
- conn->service = service;
- conn->serviceId = serviceId;
- conn->securityIndex = securityIndex;
- conn->securityObject = service->securityObjects[securityIndex];
- rx_SetConnDeadTime(conn, service->connDeadTime);
- /* Notify security object of the new connection */
- RXS_NewConnection(conn->securityObject, conn);
- /* XXXX Connection timeout? */
- if (service->newConnProc)
- (*service->newConnProc) (conn);
- rx_stats.nServerConns++;
- }
- conn->refCount++;
- return conn;
-}
-
-/*
- * There are two packet tracing routines available for testing and monitoring
- * Rx. One is called just after every packet is received and the other is
- * called just before every packet is sent. Received packets, have had their
- * headers decoded, and packets to be sent have not yet had their headers
- * encoded. Both take two parameters: a pointer to the packet and a sockaddr
- * containing the network address. Both can be modified. The return value, if
- * non-zero, indicates that the packet should be dropped.
- */
-
-int (*rx_justReceived)() = NULL;
-int (*rx_almostSent)() = NULL;
-
-/*
- * A packet has been received off the interface. Np is the packet, socket is
- * the socket number it was received from (useful in determining which service
- * this packet corresponds to), and (host, port) reflect the host,port of the
- * sender. This call returns the packet to the caller if it is finished with
- * it, rather than de-allocating it, just as a small performance hack
- */
-
-struct rx_packet *
-rxi_ReceivePacket(struct rx_packet * np, osi_socket socket,
- uint32_t host, uint16_t port)
-{
- struct rx_call *call;
- struct rx_connection *conn;
- int channel;
- unsigned long currentCallNumber;
- int type;
- int skew;
-
-#ifdef RXDEBUG
- char *packetType;
-
-#endif
- struct rx_packet *tnp;
-
-#ifdef RXDEBUG
-/*
- * We don't print out the packet until now because (1) the time may not be
- * accurate enough until now in the lwp implementation (rx_Listener only gets
- * the time after the packet is read) and (2) from a protocol point of view,
- * this is the first time the packet has been seen
- */
- packetType = (np->header.type > 0 && np->header.type < RX_N_PACKET_TYPES)
- ? rx_packetTypes[np->header.type - 1] : "*UNKNOWN*";
- dpf(("R %d %s: %x.%d.%d.%d.%d.%d.%d flags %d, packet %x",
- np->header.serial, packetType, host, port, np->header.serviceId,
- (int)np->header.epoch, np->header.cid, np->header.callNumber,
- np->header.seq, np->header.flags, np));
-#endif
-
- if (np->header.type == RX_PACKET_TYPE_VERSION)
- return rxi_ReceiveVersionPacket(np, socket, host, port);
-
- if (np->header.type == RX_PACKET_TYPE_DEBUG)
- return rxi_ReceiveDebugPacket(np, socket, host, port);
-
-#ifdef RXDEBUG
-
- /*
- * If an input tracer function is defined, call it with the packet and
- * network address. Note this function may modify its arguments.
- */
- if (rx_justReceived) {
- struct sockaddr_in addr;
- int drop;
-
- addr.sin_family = AF_INET;
- addr.sin_port = port;
- addr.sin_addr.s_addr = host;
- drop = (*rx_justReceived) (np, &addr);
- /* drop packet if return value is non-zero */
- if (drop)
- return np;
- port = addr.sin_port; /* in case fcn changed addr */
- host = addr.sin_addr.s_addr;
- }
-#endif
-
- /* If packet was not sent by the client, then *we* must be the client */
- type = ((np->header.flags & RX_CLIENT_INITIATED) != RX_CLIENT_INITIATED)
- ? RX_CLIENT_CONNECTION : RX_SERVER_CONNECTION;
-
- /*
- * Find the connection (or fabricate one, if we're the server & if
- * necessary) associated with this packet
- */
- conn = rxi_FindConnection(socket, host, port, np->header.serviceId,
- np->header.cid, np->header.epoch, type,
- np->header.securityIndex);
-
- if (!conn) {
- /*
- * If no connection found or fabricated, just ignore the packet.
- * (An argument could be made for sending an abort packet for
- * the conn)
- */
- return np;
- }
- /* compute the max serial number seen on this connection */
- if (conn->maxSerial < np->header.serial)
- conn->maxSerial = np->header.serial;
-
- /*
- * If the connection is in an error state, send an abort packet and
- * ignore the incoming packet
- */
- if (conn->error) {
- rxi_ConnectionError (conn, conn->error);
- /* Don't respond to an abort packet--we don't want loops! */
- if (np->header.type != RX_PACKET_TYPE_ABORT)
- np = rxi_SendConnectionAbort(conn, np);
- conn->refCount--;
- return np;
- }
- /* Check for connection-only requests (i.e. not call specific). */
- if (np->header.callNumber == 0) {
- switch (np->header.type) {
- case RX_PACKET_TYPE_ABORT:
- /* What if the supplied error is zero? */
- rxi_ConnectionError(conn, ntohl(rx_SlowGetLong(np, 0)));
- conn->refCount--;
- return np;
- case RX_PACKET_TYPE_CHALLENGE:
- tnp = rxi_ReceiveChallengePacket(conn, np);
- conn->refCount--;
- return tnp;
- case RX_PACKET_TYPE_RESPONSE:
- tnp = rxi_ReceiveResponsePacket(conn, np);
- conn->refCount--;
- return tnp;
- case RX_PACKET_TYPE_PARAMS:
- case RX_PACKET_TYPE_PARAMS + 1:
- case RX_PACKET_TYPE_PARAMS + 2:
- /* ignore these packet types for now */
- conn->refCount--;
- return np;
-
-
- default:
- /*
- * Should not reach here, unless the peer is broken: send an
- * abort packet
- */
- rxi_ConnectionError(conn, RX_PROTOCOL_ERROR);
- tnp = rxi_SendConnectionAbort(conn, np);
- conn->refCount--;
- return tnp;
- }
- }
- channel = np->header.cid & RX_CHANNELMASK;
- call = conn->call[channel];
-#ifdef RX_ENABLE_LOCKSX
- if (call)
- mutex_enter(&call->lock);
-#endif
- currentCallNumber = conn->callNumber[channel];
-
- if (type == RX_SERVER_CONNECTION) {/* We're the server */
- if (np->header.callNumber < currentCallNumber) {
- rx_stats.spuriousPacketsRead++;
-#ifdef RX_ENABLE_LOCKSX
- if (call)
- mutex_exit(&call->lock);
-#endif
- conn->refCount--;
- return np;
- }
- if (!call) {
- call = rxi_NewCall(conn, channel);
-#ifdef RX_ENABLE_LOCKSX
- mutex_enter(&call->lock);
-#endif
- *call->callNumber = np->header.callNumber;
- call->state = RX_STATE_PRECALL;
- rxi_KeepAliveOn(call);
- } else if (np->header.callNumber != currentCallNumber) {
- /*
- * If the new call cannot be taken right now send a busy and set
- * the error condition in this call, so that it terminates as
- * quickly as possible
- */
- if (call->state == RX_STATE_ACTIVE) {
- struct rx_packet *tp;
-
- rxi_CallError(call, RX_CALL_DEAD);
- tp = rxi_SendSpecial(call, conn, np, RX_PACKET_TYPE_BUSY, (char *) 0, 0);
-#ifdef RX_ENABLE_LOCKSX
- mutex_exit(&call->lock);
-#endif
- conn->refCount--;
- return tp;
- }
- /*
- * If the new call can be taken right now (it's not busy) then
- * accept it.
- */
- rxi_ResetCall(call);
- *call->callNumber = np->header.callNumber;
- call->state = RX_STATE_PRECALL;
- rxi_KeepAliveOn(call);
- } else {
- /* Continuing call; do nothing here. */
- }
- } else { /* we're the client */
-
- /*
- * Ignore anything that's not relevant to the current call. If there
- * isn't a current call, then no packet is relevant.
- */
- if (!call || (np->header.callNumber != currentCallNumber)) {
- rx_stats.spuriousPacketsRead++;
-#ifdef RX_ENABLE_LOCKSX
- if (call)
- mutex_exit(&call->lock);
-#endif
- conn->refCount--;
- return np;
- }
- /*
- * If the service security object index stamped in the packet does not
- * match the connection's security index, ignore the packet
- */
- if (np->header.securityIndex != conn->securityIndex) {
- conn->refCount--;
-#ifdef RX_ENABLE_LOCKSX
- mutex_exit(&call->lock);
-#endif
- return np;
- }
- /*
- * If we're receiving the response, then all transmit packets are
- * implicitly acknowledged. Get rid of them.
- */
- if (np->header.type == RX_PACKET_TYPE_DATA) {
-#ifdef AFS_SUN5_ENV
- /*
- * XXX Hack. Because we can't release the global rx lock when
- * sending packets (osi_NetSend) we drop all acks while we're
- * traversing the tq in rxi_Start sending packets out because
- * packets may move to the freePacketQueue as result of being
- * here! So we drop these packets until we're safely out of the
- * traversing. Really ugly!
- */
- if (call->flags & RX_CALL_TQ_BUSY) {
- rx_tq_dropped++;
- return np; /* xmitting; drop packet */
- }
-#endif
- rxi_ClearTransmitQueue(call);
- } else {
- if (np->header.type == RX_PACKET_TYPE_ACK) {
- /*
- * now check to see if this is an ack packet acknowledging
- * that the server actually *lost* some hard-acked data. If
- * this happens we ignore this packet, as it may indicate that
- * the server restarted in the middle of a call. It is also
- * possible that this is an old ack packet. We don't abort
- * the connection in this case, because this *might* just be
- * an old ack packet. The right way to detect a server restart
- * in the midst of a call is to notice that the server epoch
- * changed, btw.
- */
- /*
- * LWSXXX I'm not sure this is exactly right, since tfirst
- * LWSXXX **IS** unacknowledged. I think that this is
- * LWSXXX off-by-one, but I don't dare change it just yet,
- * LWSXXX since it will interact badly with the
- * LWSXXX server-restart detection code in receiveackpacket.
- */
- if (ntohl(rx_SlowGetLong(np, FIRSTACKOFFSET)) < call->tfirst) {
- rx_stats.spuriousPacketsRead++;
-#ifdef RX_ENABLE_LOCKSX
- mutex_exit(&call->lock);
-#endif
- conn->refCount--;
- return np;
- }
- }
- } /* else not a data packet */
- }
-
- /* Set remote user defined status from packet */
- call->remoteStatus = np->header.userStatus;
-
- /*
- * Note the gap between the expected next packet and the actual packet
- * that arrived, when the new packet has a smaller serial number than
- * expected. Rioses frequently reorder packets all by themselves, so
- * this will be quite important with very large window sizes. Skew is
- * checked against 0 here to avoid any dependence on the type of
- * inPacketSkew (which may be unsigned). In C, -1 > (unsigned) 0 is
- * always true! The inPacketSkew should be a smoothed running value, not
- * just a maximum. MTUXXX see CalculateRoundTripTime for an example of
- * how to keep smoothed values. I think using a beta of 1/8 is probably
- * appropriate. lws 93.04.21
- */
- skew = conn->lastSerial - np->header.serial;
- conn->lastSerial = np->header.serial;
- if (skew > 0) {
- struct rx_peer *peer;
-
- peer = conn->peer;
- if (skew > peer->inPacketSkew) {
- dpf(("*** In skew changed from %d to %d\n",
- peer->inPacketSkew, skew));
- peer->inPacketSkew = skew;
- }
- }
- /* Now do packet type-specific processing */
- switch (np->header.type) {
- case RX_PACKET_TYPE_DATA:
- np = rxi_ReceiveDataPacket(call, np);
- break;
- case RX_PACKET_TYPE_ACK:
- /*
- * Respond immediately to ack packets requesting acknowledgement
- * (ping packets)
- */
- if (np->header.flags & RX_REQUEST_ACK) {
- if (call->error)
- (void) rxi_SendCallAbort(call, 0);
- else
- (void) rxi_SendAck(call, 0, 0, 0, 0, RX_ACK_PING_RESPONSE);
- }
- np = rxi_ReceiveAckPacket(call, np);
- break;
- case RX_PACKET_TYPE_ABORT:
- /*
- * An abort packet: reset the connection, passing the error up to
- * the user
- */
- /* XXX What if error is zero? and length of packet is 0 */
- rxi_CallError(call, ntohl(*(uint32_t *) rx_DataOf(np)));
- break;
- case RX_PACKET_TYPE_BUSY:
- /* XXXX */
- break;
- case RX_PACKET_TYPE_ACKALL:
- /*
- * All packets acknowledged, so we can drop all packets previously
- * readied for sending
- */
-#ifdef AFS_SUN5_ENV
- /*
- * XXX Hack. We because we can't release the global rx lock
- * when sending packets (osi_NetSend) we drop all ack pkts while
- * we're traversing the tq in rxi_Start sending packets out
- * because packets may move to the freePacketQueue as result of
- * being here! So we drop these packets until we're
- * safely out of the traversing. Really ugly!
- */
- if (call->flags & RX_CALL_TQ_BUSY) {
- rx_tq_dropped++;
- return np; /* xmitting; drop packet */
- }
-#endif
- rxi_ClearTransmitQueue(call);
- break;
- default:
- /*
- * Should not reach here, unless the peer is broken: send an abort
- * packet
- */
- rxi_CallError(call, RX_PROTOCOL_ERROR);
- np = rxi_SendCallAbort(call, np);
- break;
- };
- /*
- * Note when this last legitimate packet was received, for keep-alive
- * processing. Note, we delay getting the time until now in the hope that
- * the packet will be delivered to the user before any get time is required
- * (if not, then the time won't actually be re-evaluated here).
- */
- call->lastReceiveTime = clock_Sec();
-#ifdef RX_ENABLE_LOCKSX
- mutex_exit(&call->lock);
-#endif
- conn->refCount--;
- return np;
-}
-
-/*
- * return true if this is an "interesting" connection from the point of view
- * of someone trying to debug the system
- */
-int
-rxi_IsConnInteresting(struct rx_connection * aconn)
-{
- int i;
- struct rx_call *tcall;
-
- if (aconn->flags & (RX_CONN_MAKECALL_WAITING | RX_CONN_DESTROY_ME))
- return 1;
- for (i = 0; i < RX_MAXCALLS; i++) {
- tcall = aconn->call[i];
- if (tcall) {
- if ((tcall->state == RX_STATE_PRECALL) ||
- (tcall->state == RX_STATE_ACTIVE))
- return 1;
- if ((tcall->mode == RX_MODE_SENDING) ||
- (tcall->mode == RX_MODE_RECEIVING))
- return 1;
- }
- }
- return 0;
-}
-
-/*
- * if this is one of the last few packets AND it wouldn't be used by the
- * receiving call to immediately satisfy a read request, then drop it on
- * the floor, since accepting it might prevent a lock-holding thread from
- * making progress in its reading
- */
-
-static int
-TooLow(struct rx_packet * ap, struct rx_call * acall)
-{
- if ((rx_nFreePackets < rxi_dataQuota + 2) &&
- !((ap->header.seq == acall->rnext) &&
- (acall->flags & RX_CALL_READER_WAIT))) {
- return 1;
- } else
- return 0;
-}
-
-/* try to attach call, if authentication is complete */
-static void
-TryAttach(struct rx_call * acall)
-{
- struct rx_connection *conn;
-
- conn = acall->conn;
- if ((conn->type == RX_SERVER_CONNECTION) &&
- (acall->state == RX_STATE_PRECALL)) {
- /* Don't attach until we have any req'd. authentication. */
- if (RXS_CheckAuthentication(conn->securityObject, conn) == 0) {
- rxi_AttachServerProc(acall);
- /*
- * Note: this does not necessarily succeed; there
- * may not any proc available
- */
- } else {
- rxi_ChallengeOn(acall->conn);
- }
- }
-}
-
-/*
- * A data packet has been received off the interface. This packet is
- * appropriate to the call (the call is in the right state, etc.). This
- * routine can return a packet to the caller, for re-use
- */
-struct rx_packet *
-rxi_ReceiveDataPacket(struct rx_call * call,
- struct rx_packet * np)
-{
- u_long seq, serial, flags;
- int ack_done;
-
- ack_done = 0;
-
- seq = np->header.seq;
- serial = np->header.serial;
- flags = np->header.flags;
-
- rx_stats.dataPacketsRead++;
-
- /* If the call is in an error state, send an abort message */
- /* XXXX this will send too many aborts for multi-packet calls */
- if (call->error)
- return rxi_SendCallAbort(call, np);
-
- if (np->header.spare != 0)
- call->conn->flags |= RX_CONN_USING_PACKET_CKSUM;
-
- /*
- * If there are no packet buffers, drop this new packet, unless we can find
- * packet buffers from inactive calls
- */
- if (rxi_OverQuota(RX_PACKET_CLASS_RECEIVE) || TooLow(np, call)) {
- rx_stats.noPacketBuffersOnRead++;
- call->rprev = seq;
- TryAttach(call);
- rxi_calltrace(RX_TRACE_DROP, call);
- return np;
- }
- /* The usual case is that this is the expected next packet */
- if (seq == call->rnext) {
-
- /* Check to make sure it is not a duplicate of one already queued */
- if (queue_IsNotEmpty(&call->rq)
- && queue_First(&call->rq, rx_packet)->header.seq == seq) {
- rx_stats.dupPacketsRead++;
- np = rxi_SendAck(call, np, seq, serial, flags, RX_ACK_DUPLICATE);
- call->rprev = seq;
- return np;
- }
- /*
- * It's the next packet. Stick it on the receive queue for this call
- */
- queue_Prepend(&call->rq, np);
-#ifdef SOFT_ACK
- call->nSoftAcks++;
-#endif /* SOFT_ACK */
-
-#ifndef ADAPT_PERF
- np = 0; /* We can't use this any more */
-
- /*
- * Provide asynchronous notification for those who want it
- * (e.g. multi rx)
- */
- if (call->arrivalProc) {
- (*call->arrivalProc) (call, call->arrivalProcHandle,
- call->arrivalProcArg);
- call->arrivalProc = (void (*) ()) 0;
- }
- /* Wakeup the reader, if any */
- if (call->flags & RX_CALL_READER_WAIT) {
- call->flags &= ~RX_CALL_READER_WAIT;
- RX_MUTEX_ENTER(&call->lockq);
-
-#ifdef RX_ENABLE_LOCKS
- cv_broadcast(&call->cv_rq);
-#else
- osi_rxWakeup(&call->rq);
-#endif
- RX_MUTEX_EXIT(&call->lockq);
- }
-#endif
-
- /*
- * ACK packet right away, in order to keep the window going, and to
- * reduce variability in round-trip-time estimates.
- */
-
- if (flags & RX_REQUEST_ACK) {
-
- /*
- * Acknowledge, if requested. Also take this opportunity to
- * revise MTU estimate.
- */
-#ifdef MISCMTU
- /* Copy a lower estimate of the MTU from the other end. (cfe) */
- /*
- * We can figure out what the other end is using by checking out
- * the size of its packets, and then adding back the header size.
- * We don't count the last packet, since it might be partly empty.
- * We shouldn't do this check on every packet, it's overkill.
- * Perhaps it would be better done in
- * ComputeRate if I decide it's ever worth doing. (lws)
- */
- if (!(flags & RX_LAST_PACKET) && call->conn && call->conn->peer) {
- u_long length;
- struct rx_peer *peer = call->conn->peer;
-
- length = np->length + RX_HEADER_SIZE;
- if (length < peer->packetSize) {
- dpf(("CONG peer %lx/%u: packetsize %lu=>%lu (rtt %u)",
- ntohl(peer->host), ntohs(peer->port), peer->packetSize,
- length, peer->srtt));
- peer->packetSize = length;
- }
- }
-#endif /* MISCMTU */
- } else if (flags & RX_LAST_PACKET) {
- struct clock when;
-
- /* Or schedule an acknowledgement later on. */
- rxevent_Cancel(call->delayedAckEvent);
- clock_GetTime(&when);
- clock_Add(&when, &rx_lastAckDelay);
-
- call->delayedAckEvent = rxevent_Post(&when, rxi_SendDelayedAck,
- call, NULL);
-
- ack_done = 1;
- }
-#ifdef ADAPT_PERF
- /*
- * Provide asynchronous notification for those who want it
- * (e.g. multi rx)
- */
- if (call->arrivalProc) {
- (*call->arrivalProc) (call, call->arrivalProcHandle,
- call->arrivalProcArg);
- call->arrivalProc = (void (*) ()) 0;
- }
- /* Wakeup the reader, if any */
- RX_MUTEX_ENTER(&call->lockq);
- if (call->flags & RX_CALL_READER_WAIT) {
- call->flags &= ~RX_CALL_READER_WAIT;
-#ifdef RX_ENABLE_LOCKS
-/* cv_signal(&call->cv_rq);*/
- cv_broadcast(&call->cv_rq);
-#else
- osi_rxWakeup(&call->rq);
-#endif
- }
- RX_MUTEX_EXIT(&call->lockq);
-
- np = 0; /* We can't use this any more */
-#endif /* ADAPT_PERF */
-
- /* Update last packet received */
- call->rprev = seq;
-
- /*
- * If there is no server process serving this call, grab one, if
- * available
- */
- TryAttach(call);
- }
- /* This is not the expected next packet */
- else {
- /*
- * Determine whether this is a new or old packet, and if it's
- * a new one, whether it fits into the current receive window.
- * It's also useful to know if the packet arrived out of
- * sequence, so that we can force an acknowledgement in that
- * case. We have a slightly complex definition of
- * out-of-sequence: the previous packet number received off
- * the wire is remembered. If the new arrival's sequence
- * number is less than previous, then previous is reset (to
- * 0). MTUXXX This should change slightly if skew is taken into
- * consideration. lws 93.04.20
- * The new packet is then declared out-of-sequence if
- * there are any packets missing between the "previous" packet
- * and the one which just arrived (because the missing packets
- * should have been filled in between the previous packet and
- * the new arrival). This works regardless of whether the
- * peer's retransmission algorithm has been invoked, or not
- * (i.e. whether this is the first or subsequent pass over the
- * sequence of packets). All this assumes that "most" of the
- * time, packets are delivered in the same *order* as they are
- * transmitted, with, possibly, some packets lost due to
- * transmission errors along the way.
- */
-
- u_long prev; /* "Previous packet" sequence number */
- struct rx_packet *tp; /* Temporary packet pointer */
- struct rx_packet *nxp;/*
- * Next packet pointer, for queue_Scan
- */
- int nTwixt; /*
- * Number of packets between previous
- * and new one
- */
-
- /*
- * If the new packet's sequence number has been sent to the
- * application already, then this is a duplicate
- */
- if (seq < call->rnext) {
- rx_stats.dupPacketsRead++;
- np = rxi_SendAck(call, np, seq, serial, flags, RX_ACK_DUPLICATE);
- call->rprev = seq;
- return np;
- }
- /*
- * If the sequence number is greater than what can be
- * accommodated by the current window, then send a negative
- * acknowledge and drop the packet
- */
- if ((call->rnext + call->rwind) <= seq) {
- np = rxi_SendAck(call, np, seq, serial, flags,
- RX_ACK_EXCEEDS_WINDOW);
- call->rprev = seq;
- return np;
- }
- /* Look for the packet in the queue of old received packets */
- prev = call->rprev;
- if (prev > seq)
- prev = 0;
- for (nTwixt = 0, queue_Scan(&call->rq, tp, nxp, rx_packet)) {
- /* Check for duplicate packet */
- if (seq == tp->header.seq) {
- rx_stats.dupPacketsRead++;
- np = rxi_SendAck(call, np, seq, serial, flags,
- RX_ACK_DUPLICATE);
- call->rprev = seq;
- return np;
- }
-
- /*
- * Count the number of packets received 'twixt the previous
- * packet and the new packet
- */
- if (tp->header.seq > prev && tp->header.seq < seq)
- nTwixt++;
-
- /*
- * If we find a higher sequence packet, break out and insert the
- * new packet here.
- */
- if (seq < tp->header.seq)
- break;
- }
-
- /*
- * It's within the window: add it to the the receive queue.
- * tp is left by the previous loop either pointing at the
- * packet before which to insert the new packet, or at the
- * queue head if the queue is empty or the packet should be
- * appended.
- */
- queue_InsertBefore(tp, np);
-#ifdef SOFT_ACK
- call->nSoftAcks++;
-#endif /* SOFT_ACK */
-
- call->rprev = seq;
- np = 0;
- }
-
- /*
- * Acknowledge the packet if requested by peer, or we are doing
- * softack.
- *
- * Add a timed ack to make sure we send out a ack to before we get
- * a request from the client that they send a REQUEST-ACK packet.
- */
- if (ack_done) {
- /* ack is already taken care of */
- } else if (flags & RX_REQUEST_ACK) {
- rxi_SendAck(call, 0, seq, serial, flags, RX_ACK_REQUESTED);
- call->rprev = seq;
-#ifdef SOFT_ACK
- } else if (call->nSoftAcks > rxi_SoftAckRate) {
- rxevent_Cancel(call->delayedAckEvent);
- rxi_SendAck(call, 0, seq, serial, flags, RX_ACK_IDLE);
- } else if (call->nSoftAcks) {
- struct clock when;
-
- rxevent_Cancel(call->delayedAckEvent);
- clock_GetTime(&when);
- clock_Add(&when, &rx_softAckDelay);
- call->delayedAckEvent = rxevent_Post(&when, rxi_SendDelayedAck,
- call, NULL);
-#endif /* SOFT_ACK */
- }
-
- return np;
-}
-
-#ifdef ADAPT_WINDOW
-static void rxi_ComputeRate();
-
-#endif
-
-/* Timeout is set to RTT + 4*MDEV. */
-static
-void
-update_timeout(struct rx_peer *peer)
-{
- u_long rtt_timeout;
- rtt_timeout = peer->srtt + 4*peer->mdev;
- /*
- * Add 100ms to hide the effects of unpredictable
- * scheduling. 100ms is *very* conservative and should probably be
- * much smaller. We don't want to generate any redundant
- * retransmits so for now, let's use 100ms.
- */
- rtt_timeout += 100*1000;
- if (rtt_timeout < 1000) /* 1000 = 1ms */
- rtt_timeout = 1000; /* Minimum timeout */
- peer->timeout.usec = rtt_timeout % 1000000;
- peer->timeout.sec = rtt_timeout / 1000000;
-}
-
-/* On a dubious timeout double MDEV but within reason.
- * Timeout is limited by 5*RTT.
- */
-static
-void
-dubious_timeout(struct rx_peer *peer)
-{
- if (peer->mdev >= peer->srtt)
- return;
-
- peer->mdev *= 2;
- if (peer->mdev > peer->srtt)
- peer->mdev = peer->srtt;
- update_timeout(peer);
-}
-
-/* The real smarts of the whole thing. Right now somewhat short-changed. */
-struct rx_packet *
-rxi_ReceiveAckPacket(struct rx_call * call, struct rx_packet * np)
-{
- struct rx_ackPacket *ap;
- int nAcks;
- struct rx_packet *tp;
- struct rx_packet *nxp; /*
- * Next packet pointer for queue_Scan
- */
- struct rx_connection *conn = call->conn;
- struct rx_peer *peer = conn->peer;
- u_long first;
- u_long serial;
-
- /* because there are CM's that are bogus, sending weird values for this. */
- u_long skew = 0;
- int needRxStart = 0;
- int nbytes;
-
- rx_stats.ackPacketsRead++;
- ap = (struct rx_ackPacket *) rx_DataOf(np);
- nbytes = rx_Contiguous(np) - ((ap->acks) - (u_char *) ap);
- if (nbytes < 0)
- return np; /* truncated ack packet */
-
- nAcks = MIN(nbytes, ap->nAcks); /* depends on ack packet struct */
- first = ntohl(ap->firstPacket);
- serial = ntohl(ap->serial);
-#ifdef notdef
- skew = ntohs(ap->maxSkew);
-#endif
-
-
-#ifdef RXDEBUG
- if (Log) {
- fprintf(Log,
- "RACK: reason %x previous %lu seq %lu serial %lu skew %lu "
- "first %lu", ap->reason,
- (unsigned long)ntohl(ap->previousPacket),
- (unsigned long)np->header.seq,
- (unsigned long)serial,
- (unsigned long)skew,
- (unsigned long)ntohl(ap->firstPacket));
- if (nAcks) {
- int offset;
-
- for (offset = 0; offset < nAcks; offset++)
- putc(ap->acks[offset] == RX_ACK_TYPE_NACK ? '-' : '*', Log);
- }
- putc('\n', Log);
- }
-#endif
-
-#if 0 /* need congestion avoidance stuff first */
- if (np->header.flags & RX_SLOW_START_OK)
- call->flags |= RX_CALL_SLOW_START_OK;
-#endif
-
-
- /*
- * if a server connection has been re-created, it doesn't remember what
- * serial # it was up to. An ack will tell us, since the serial field
- * contains the largest serial received by the other side
- */
- if ((conn->type == RX_SERVER_CONNECTION) && (conn->serial < serial)) {
- conn->serial = serial + 1;
- }
-
- /*
- * Update the outgoing packet skew value to the latest value of the
- * peer's incoming packet skew value. The ack packet, of course, could
- * arrive out of order, but that won't affect things much
- */
- peer->outPacketSkew = skew;
-
-#ifdef AFS_SUN5_ENV
- /*
- * XXX Hack. Because we can't release the global rx lock when sending
- * packets (osi_NetSend) we drop all acks while we're traversing the tq in
- * rxi_Start sending packets out because packets
- * may move to the freePacketQueue as result of being here! So we drop
- * these packets until we're safely out of the traversing. Really ugly!
- */
- if (call->flags & RX_CALL_TQ_BUSY) {
- rx_tq_dropped++;
- return np; /* xmitting; drop packet */
- }
-#endif
- /*
- * Check for packets that no longer need to be transmitted, and
- * discard them. This only applies to packets positively
- * acknowledged as having been sent to the peer's upper level.
- * All other packets must be retained. So only packets with
- * sequence numbers < ap->firstPacket are candidates.
- */
- while (queue_IsNotEmpty(&call->tq)) {
- tp = queue_First(&call->tq, rx_packet);
- if (tp->header.seq >= first)
- break;
- call->tfirst = tp->header.seq + 1;
- if (tp->header.serial == serial) {
- if (ap->reason != RX_ACK_DELAY) {
-#ifdef ADAPT_PERF
- rxi_ComputeRoundTripTime(tp, &tp->timeSent, peer);
-#else
- rxi_ComputeRoundTripTime(tp, 0, 0);
-#endif
- }
-#ifdef ADAPT_WINDOW
- rxi_ComputeRate(peer, call, tp, np, ap->reason);
-#endif
- }
-#ifdef ADAPT_PERF
- else if ((tp->firstSerial == serial)) {
- if (ap->reason != RX_ACK_DELAY)
- rxi_ComputeRoundTripTime(tp, &tp->firstSent, peer);
-#ifdef ADAPT_WINDOW
- rxi_ComputeRate(peer, call, tp, np, ap->reason);
-#endif
- }
-#endif /* ADAPT_PERF */
- queue_Remove(tp);
- rxi_FreePacket(tp); /*
- * rxi_FreePacket mustn't wake up anyone,
- * preemptively.
- */
- }
-
-#ifdef ADAPT_WINDOW
- /* Give rate detector a chance to respond to ping requests */
- if (ap->reason == RX_ACK_PING_RESPONSE) {
- rxi_ComputeRate(peer, call, 0, np, ap->reason);
- }
-#endif
- /* "Slow start" every call. */
- if (call->twind < rx_Window) call->twind += 1;
-
- /*
- * N.B. we don't turn off any timers here. They'll go away by themselves,
- * anyway
- */
-
- /*
- * Now go through explicit acks/nacks and record the results in
- * the waiting packets. These are packets that can't be released
- * yet, even with a positive acknowledge. This positive
- * acknowledge only means the packet has been received by the
- * peer, not that it will be retained long enough to be sent to
- * the peer's upper level. In addition, reset the transmit timers
- * of any missing packets (those packets that must be missing
- * because this packet was out of sequence)
- */
-
- for (queue_Scan(&call->tq, tp, nxp, rx_packet)) {
-
- /*
- * Update round trip time if the ack was stimulated on receipt of
- * this packet
- */
- if (tp->header.serial == serial) {
- if (ap->reason != RX_ACK_DELAY) {
-#ifdef ADAPT_PERF
- rxi_ComputeRoundTripTime(tp, &tp->timeSent, peer);
-#else
- rxi_ComputeRoundTripTime(tp, 0, 0);
-#endif
- }
-#ifdef ADAPT_WINDOW
- rxi_ComputeRate(peer, call, tp, np, ap->reason);
-#endif
- }
-#ifdef ADAPT_PERF
- else if ((tp->firstSerial == serial)) {
- if (ap->reason != RX_ACK_DELAY)
- rxi_ComputeRoundTripTime(tp, &tp->firstSent, peer);
-#ifdef ADAPT_WINDOW
- rxi_ComputeRate(peer, call, tp, np, ap->reason);
-#endif
- }
-#endif /* ADAPT_PERF */
-
- /*
- * Set the acknowledge flag per packet based on the
- * information in the ack packet. It's possible for an
- * acknowledged packet to be downgraded
- */
- if (tp->header.seq < first + nAcks) {
- /* Explicit ack information: set it in the packet appropriately */
- tp->acked = (ap->acks[tp->header.seq - first] == RX_ACK_TYPE_ACK);
- } else {
- /*
- * No ack information: the packet may have been
- * acknowledged previously, but that is now rescinded (the
- * peer may have reduced the window size)
- */
- tp->acked = 0;
- }
-
-
-#ifdef ADAPT_PERF
- /*
- * If packet isn't yet acked, and it has been transmitted at least
- * once, reset retransmit time using latest timeout
- * ie, this should readjust the retransmit timer for all outstanding
- * packets... So we don't just retransmit when we should know better
- */
-
- if (!tp->acked && tp->header.serial) {
- tp->retryTime = tp->timeSent;
- clock_Add(&tp->retryTime, &peer->timeout);
- /* shift by eight because one quarter-sec ~ 256 milliseconds */
- clock_Addmsec(&(tp->retryTime), ((unsigned long) tp->backoff) << 8);
- }
-#endif /* ADAPT_PERF */
-
- /*
- * If the packet isn't yet acked, and its serial number
- * indicates that it was transmitted before the packet which
- * prompted the acknowledge (that packet's serial number is
- * supplied in the ack packet), then schedule the packet to be
- * transmitted *soon*. This is done by resetting the
- * retransmit time in the packet to the current time.
- * Actually this is slightly more intelligent: to guard
- * against packets that have been transmitted out-of-order by
- * the network (this even happens on the local token ring with
- * our IBM RT's!), the degree of out-of-orderness (skew) of
- * the packet is compared against the maximum skew for this
- * peer. If it is less, we don't retransmit yet. Note that
- * we don't do this for packets with zero serial numbers: they
- * never have been transmitted.
- */
-
- /*
- * I don't know if we should add in the new retransmit backoff time
- * here or not. I think that we should also consider reducing
- * the "congestion window" size as an alternative. LWSXXX
- */
-
- if (!tp->acked && tp->header.serial
- && ((tp->header.serial + skew) <= serial)) {
- rx_stats.dataPacketsPushed++;
- clock_GetTime(&tp->retryTime);
- needRxStart = 1;
-
- dpf(("Pushed packet seq %d serial %d, new time %d.%d\n",
- tp->header.seq, tp->header.serial, tp->retryTime.sec,
- tp->retryTime.usec / 1000));
- }
- }
-
- if (ap->reason == RX_ACK_DUPLICATE) {
- /*
- * Other end receives duplicates because either:
- * A. acks where lost
- * B. receiver gets scheduled in an unpredictable way
- * C. we have a busted timer
- *
- * To fix B & C wait for new acks to update srtt and mdev. In
- * the meantime, increase mdev to increase the retransmission
- * timeout.
- */
- dubious_timeout(peer);
- }
-
- /*
- * If the window has been extended by this acknowledge packet,
- * then wakeup a sender waiting in alloc for window space, or try
- * sending packets now, if he's been sitting on packets due to
- * lack of window space
- */
- if (call->tnext < (call->tfirst + call->twind)) {
-#ifdef RX_ENABLE_LOCKS
- RX_MUTEX_ENTER(&call->lockw);
- cv_signal(&call->cv_twind);
- RX_MUTEX_EXIT(&call->lockw);
-#else
- if (call->flags & RX_CALL_WAIT_WINDOW_ALLOC) {
- call->flags &= ~RX_CALL_WAIT_WINDOW_ALLOC;
- osi_rxWakeup(&call->twind);
- }
-#endif
- if (call->flags & RX_CALL_WAIT_WINDOW_SEND) {
- call->flags &= ~RX_CALL_WAIT_WINDOW_SEND;
- needRxStart = 1;
- }
- }
- /*
- * if the ack packet has a receivelen field hanging off it,
- * update our state
- */
- if (np->length >= rx_AckDataSize(ap->nAcks) + 4) {
- unsigned long maxPacketSize;
-
- rx_packetread(np, rx_AckDataSize(ap->nAcks), 4, &maxPacketSize);
- maxPacketSize = (unsigned long) ntohl(maxPacketSize);
- dpf(("maxPacketSize=%lu\n", maxPacketSize));
-
- /*
- * sanity check - peer might have restarted with different params.
- * If peer says "send less", dammit, send less... Peer should never
- * be unable to accept packets of the size that prior AFS versions
- * would send without asking.
- */
- if (OLD_MAX_PACKET_SIZE <= maxPacketSize)
- conn->maxPacketSize = MIN(maxPacketSize, conn->peer->packetSize);
- }
- /* if (needRxStart) rxi_Start(0, call); */
- rxi_Start(0, call); /* Force rxi_Restart for now: skew
- * problems!!! */
- return np;
-}
-
-/* Post a new challenge-event, this is to resend lost packets. */
-static void
-rxi_resend_ChallengeEvent(struct rx_connection *conn)
-{
- struct clock when;
-
- if (conn->challengeEvent)
- rxevent_Cancel(conn->challengeEvent);
-
- clock_GetTime(&when);
- when.sec += RX_CHALLENGE_TIMEOUT;
- conn->challengeEvent = rxevent_Post(&when, rxi_ChallengeEvent,
- conn, NULL);
-}
-
-/* Received a response to a challenge packet */
-struct rx_packet *
-rxi_ReceiveResponsePacket(struct rx_connection * conn,
- struct rx_packet * np)
-{
- int error;
-
- /* Ignore the packet if we're the client */
- if (conn->type == RX_CLIENT_CONNECTION)
- return np;
-
- /* If already authenticated, ignore the packet (it's probably a retry) */
- if (RXS_CheckAuthentication(conn->securityObject, conn) == 0)
- return np;
-
- /* Otherwise, have the security object evaluate the response packet */
- error = RXS_CheckResponse(conn->securityObject, conn, np);
- if (error == RX_AUTH_REPLY) {
- rxi_SendSpecial(NULL, conn, np, RX_PACKET_TYPE_CHALLENGE,
- NULL, -1);
- rxi_resend_ChallengeEvent(conn);
- } else if (error) {
- /*
- * If the response is invalid, reset the connection, sending an abort
- * to the peer
- */
-#ifndef KERNEL
- IOMGR_Sleep(1);
-#endif
- rxi_ConnectionError(conn, error);
- return rxi_SendConnectionAbort(conn, np);
- } else {
- /*
- * If the response is valid, any calls waiting to attach servers can
- * now do so
- */
- int i;
-
- for (i = 0; i < RX_MAXCALLS; i++) {
- struct rx_call *call = conn->call[i];
-
- if (call && (call->state == RX_STATE_PRECALL))
- rxi_AttachServerProc(call);
- }
- }
- return np;
-}
-
-/*
- * A client has received an authentication challenge: the security
- * object is asked to cough up a respectable response packet to send
- * back to the server. The server is responsible for retrying the
- * challenge if it fails to get a response.
- */
-
-struct rx_packet *
-rxi_ReceiveChallengePacket(struct rx_connection * conn,
- struct rx_packet * np)
-{
- int error;
-
- /* Ignore the challenge if we're the server */
- if (conn->type == RX_SERVER_CONNECTION)
- return np;
-
- /*
- * Ignore the challenge if the connection is otherwise idle; someone's
- * trying to use us as an oracle.
- */
- if (!rxi_HasActiveCalls(conn))
- return np;
-
- /*
- * Send the security object the challenge packet. It is expected to fill
- * in the response.
- */
- error = RXS_GetResponse(conn->securityObject, conn, np);
-
- /*
- * If the security object is unable to return a valid response, reset the
- * connection and send an abort to the peer. Otherwise send the response
- * packet to the peer connection.
- */
- if (error) {
- rxi_ConnectionError(conn, error);
- np = rxi_SendConnectionAbort(conn, np);
- } else {
- np = rxi_SendSpecial((struct rx_call *) 0, conn, np,
- RX_PACKET_TYPE_RESPONSE, (char *) 0, -1);
- }
- return np;
-}
-
-
-/*
- * Find an available server process to service the current request in
- * the given call structure. If one isn't available, queue up this
- * call so it eventually gets one
- */
-void
-rxi_AttachServerProc(struct rx_call * call)
-{
- struct rx_serverQueueEntry *sq;
- struct rx_service *service = call->conn->service;
-
- /* May already be attached */
- if (call->state == RX_STATE_ACTIVE)
- return;
-
- if (!QuotaOK(service) || queue_IsEmpty(&rx_idleServerQueue)) {
- /*
- * If there are no processes available to service this call,
- * put the call on the incoming call queue (unless it's
- * already on the queue).
- */
- if (!(call->flags & RX_CALL_WAIT_PROC)) {
- call->flags |= RX_CALL_WAIT_PROC;
- rx_nWaiting++;
- rxi_calltrace(RX_CALL_ARRIVAL, call);
- queue_Append(&rx_incomingCallQueue, call);
- }
- } else {
- sq = queue_First(&rx_idleServerQueue, rx_serverQueueEntry);
-
- RX_MUTEX_ENTER(&sq->lock);
-
- queue_Remove(sq);
- sq->newcall = call;
- if (call->flags & RX_CALL_WAIT_PROC) {
- /* Conservative: I don't think this should happen */
- call->flags &= ~RX_CALL_WAIT_PROC;
- rx_nWaiting--;
- queue_Remove(call);
- }
- call->state = RX_STATE_ACTIVE;
- call->mode = RX_MODE_RECEIVING;
- if (call->flags & RX_CALL_CLEARED) {
- /* send an ack now to start the packet flow up again */
- call->flags &= ~RX_CALL_CLEARED;
- rxi_SendAck(call, 0, 0, 0, 0, RX_ACK_DELAY);
- }
- service->nRequestsRunning++;
- if (service->nRequestsRunning <= service->minProcs)
- rxi_minDeficit--;
- rxi_availProcs--;
-#ifdef RX_ENABLE_LOCKS
- cv_signal(&sq->cv);
-#else
- osi_rxWakeup(sq);
-#endif
- RX_MUTEX_EXIT(&sq->lock);
- }
-}
-
-/*
- * Delay the sending of an acknowledge event for a short while, while
- * a new call is being prepared (in the case of a client) or a reply
- * is being prepared (in the case of a server). Rather than sending
- * an ack packet, an ACKALL packet is sent.
- */
-void
-rxi_AckAll(struct rxevent * event, struct rx_call * call, char *dummy)
-{
- if (event)
- call->delayedAckEvent = (struct rxevent *) 0;
- rxi_SendSpecial(call, call->conn, (struct rx_packet *) 0,
- RX_PACKET_TYPE_ACKALL, (char *) 0, 0);
-}
-
-void
-rxi_SendDelayedAck(struct rxevent * event, struct rx_call * call,
- char *dummy)
-{
- if (event)
- call->delayedAckEvent = (struct rxevent *) 0;
- (void) rxi_SendAck(call, 0, 0, 0, 0, RX_ACK_DELAY);
-}
-
-/*
- * Clear out the transmit queue for the current call (all packets have
- * been received by peer)
- */
-void
-rxi_ClearTransmitQueue(struct rx_call * call)
-{
- struct rx_packet *p, *tp;
-
- for (queue_Scan(&call->tq, p, tp, rx_packet)) {
- queue_Remove(p);
- rxi_FreePacket(p);
- }
-
- rxevent_Cancel(call->resendEvent);
- call->tfirst = call->tnext; /*
- * implicitly acknowledge all data already sent
- */
- RX_MUTEX_ENTER(&call->lockw);
-#ifdef RX_ENABLE_LOCKS
- cv_signal(&call->cv_twind);
-#else
- osi_rxWakeup(&call->twind);
-#endif
- RX_MUTEX_EXIT(&call->lockw);
-}
-
-void
-rxi_ClearReceiveQueue(struct rx_call * call)
-{
- struct rx_packet *p, *tp;
-
- for (queue_Scan(&call->rq, p, tp, rx_packet)) {
- queue_Remove(p);
- rxi_FreePacket(p);
- }
- if (call->state == RX_STATE_PRECALL)
- call->flags |= RX_CALL_CLEARED;
-}
-
-/* Send an abort packet for the specified call */
-struct rx_packet *
-rxi_SendCallAbort(struct rx_call * call, struct rx_packet * packet)
-{
- if (call->error) {
- int32_t error;
-
- error = htonl(call->error);
- packet = rxi_SendSpecial(call, call->conn, packet, RX_PACKET_TYPE_ABORT,
- (char *) &error, sizeof(error));
- }
- return packet;
-}
-
-/*
- * Send an abort packet for the specified connection. Np is an
- * optional packet that can be used to send the abort.
- */
-struct rx_packet *
-rxi_SendConnectionAbort(struct rx_connection * conn,
- struct rx_packet * packet)
-{
- if (conn->error) {
- int32_t error;
-
- error = htonl(conn->error);
- packet = rxi_SendSpecial((struct rx_call *) 0, conn, packet,
- RX_PACKET_TYPE_ABORT, (char *) &error, sizeof(error));
- }
- return packet;
-}
-
-/*
- * Associate an error all of the calls owned by a connection. Called
- * with error non-zero. This is only for really fatal things, like
- * bad authentication responses. The connection itself is set in
- * error at this point, so that future packets received will be
- * rejected.
- */
-void
-rxi_ConnectionError(struct rx_connection * conn, int32_t error)
-{
- if (error) {
- int i;
-
- if (conn->challengeEvent)
- rxevent_Cancel(conn->challengeEvent);
- for (i = 0; i < RX_MAXCALLS; i++) {
- struct rx_call *call = conn->call[i];
-
- if (call)
- rxi_CallError(call, error);
- }
- conn->error = error;
- rx_stats.fatalErrors++;
- }
-}
-
-/* Reset all of the calls associated with a connection. */
-void
-rxi_ResetConnection(struct rx_connection * conn)
-{
- int i;
-
- for (i = 0; i < RX_MAXCALLS; i++) {
- struct rx_call *call = conn->call[i];
-
- if (call)
- rxi_ResetCall(call);
- }
-
- /* get rid of pending events that could zap us later */
- if (conn->challengeEvent)
- rxevent_Cancel(conn->challengeEvent);
-}
-
-void
-rxi_CallError(struct rx_call * call, int32_t error)
-{
- if (call->error)
- error = call->error;
- rxi_ResetCall(call);
- call->error = error;
- call->mode = RX_MODE_ERROR;
-}
-
-/*
- * Reset various fields in a call structure, and wakeup waiting
- * processes. Some fields aren't changed: state & mode are not
- * touched (these must be set by the caller), and bufptr, nLeft, and
- * nFree are not reset, since these fields are manipulated by
- * unprotected macros, and may only be reset by non-interrupting code.
- */
-#ifdef ADAPT_WINDOW
-/* this code requires that call->conn be set properly as a pre-condition. */
-#endif /* ADAPT_WINDOW */
-
-void
-rxi_ResetCall(struct rx_call * call)
-{
- int flags;
-
- /* Notify anyone who is waiting for asynchronous packet arrival */
- if (call->arrivalProc) {
- (*call->arrivalProc) (call, call->arrivalProcHandle,
- call->arrivalProcArg);
- call->arrivalProc = (void (*) ()) 0;
- }
- flags = call->flags;
- rxi_ClearReceiveQueue(call);
- rxi_ClearTransmitQueue(call);
- call->error = 0;
- call->flags = 0;
- call->rwind = rx_Window; /* XXXX */
-#ifdef ADAPT_WINDOW
- call->twind = call->conn->peer->maxWindow; /* XXXX */
-#else
- /* "Slow start" every call. */
- call->twind = rx_initialWindow;
-#endif
-
- call->tfirst = call->rnext = call->tnext = 1;
- call->rprev = 0;
- call->lastAcked = 0;
- call->localStatus = call->remoteStatus = 0;
-
- RX_MUTEX_ENTER(&call->lockq);
- if (flags & RX_CALL_READER_WAIT) {
-#ifdef RX_ENABLE_LOCKS
-/* cv_signal(&call->cv_rq);*/
- cv_broadcast(&call->cv_rq);
-#else
- osi_rxWakeup(&call->rq);
-#endif
- }
- RX_MUTEX_EXIT(&call->lockq);
- if (flags & RX_CALL_WAIT_PACKETS)
- rxi_PacketsUnWait(); /* XXX */
- RX_MUTEX_ENTER(&call->lockw);
-
-#ifdef RX_ENABLE_LOCKS
- cv_signal(&call->cv_twind);
-#else
- if (flags & RX_CALL_WAIT_WINDOW_ALLOC)
- osi_rxWakeup(&call->twind);
-#endif
- RX_MUTEX_EXIT(&call->lockw);
-
- if (queue_IsOnQueue(call)) {
- queue_Remove(call);
- if (flags & RX_CALL_WAIT_PROC)
- rx_nWaiting--;
- }
- rxi_KeepAliveOff(call);
- rxevent_Cancel(call->delayedAckEvent);
-}
-
-/*
- * Send an acknowledge for the indicated packet (seq,serial) of the
- * indicated call, for the indicated reason (reason). This
- * acknowledge will specifically acknowledge receiving the packet, and
- * will also specify which other packets for this call have been
- * received. This routine returns the packet that was used to the
- * caller. The caller is responsible for freeing it or re-using it.
- * This acknowledgement also returns the highest sequence number
- * actually read out by the higher level to the sender; the sender
- * promises to keep around packets that have not been read by the
- * higher level yet (unless, of course, the sender decides to abort
- * the call altogether). Any of p, seq, serial, pflags, or reason may
- * be set to zero without ill effect. That is, if they are zero, they
- * will not convey any information.
- * NOW there is a trailer field, after the ack where it will safely be
- * ignored by mundanes, which indicates the maximum size packet this
- * host can swallow.
- */
-struct rx_packet *
-rxi_SendAck(struct rx_call * call,
- struct rx_packet * optionalPacket, int seq, int serial,
- int pflags, int reason)
-#if 0
- struct rx_call *call;
- struct rx_packet *optionalPacket; /* use to send ack (or null) */
- int seq; /* Sequence number of the packet we
- * are acking */
- int serial; /* Serial number of the packet */
- int pflags; /* Flags field from packet header */
- int reason; /* Reason an acknowledge was prompted */
-
-#endif
-{
- struct rx_ackPacket *ap;
- struct rx_packet *rqp;
- struct rx_packet *nxp; /* For queue_Scan */
- struct rx_packet *p;
- u_char offset;
- long templ;
-
- if (call->rnext > call->lastAcked)
- call->lastAcked = call->rnext;
-
- p = optionalPacket;
-
- if (p) {
- rx_computelen(p, p->length); /* reset length, you never know */
- }
- /* where that's been... */
- else if (!(p = rxi_AllocPacket(RX_PACKET_CLASS_SPECIAL)))
- osi_Panic("rxi_SendAck");
-
-#ifdef SOFT_ACK
- call->nSoftAcks = 0;
- call->nHardAcks = 0;
-#endif /* SOFT_ACK */
-
- templ = rx_AckDataSize(call->rwind) + 4 - rx_GetDataSize(p);
- if (templ > 0) {
- if (rxi_AllocDataBuf(p, templ))
- return optionalPacket;
- templ = rx_AckDataSize(call->rwind) + 4;
- if (rx_Contiguous(p) < templ)
- return optionalPacket;
- } /* MTUXXX failing to send an ack is
- * very serious. We should */
- /* try as hard as possible to send even a partial ack; it's */
- /* better than nothing. */
- ap = (struct rx_ackPacket *) rx_DataOf(p);
- ap->bufferSpace = htonl(0); /* Something should go here, sometime */
- ap->reason = reason;
-
- /* The skew computation used to bullshit, I think it's better now. */
- /* We should start paying attention to skew. XXX */
- ap->serial = htonl(call->conn->maxSerial);
- ap->maxSkew = 0; /* used to be peer->inPacketSkew */
-
- ap->firstPacket = htonl(call->rnext); /*
- * First packet not yet forwarded
- * to reader
- */
- ap->previousPacket = htonl(call->rprev); /* Previous packet received */
-
- /*
- * No fear of running out of ack packet here because there can only be
- * at most one window full of unacknowledged packets. The window size
- * must be constrained to be less than the maximum ack size, of course.
- * Also, an ack should always fit into a single packet -- it should not
- * ever be fragmented.
- */
- for (offset = 0, queue_Scan(&call->rq, rqp, nxp, rx_packet)) {
- while (rqp->header.seq > call->rnext + offset)
- ap->acks[offset++] = RX_ACK_TYPE_NACK;
- ap->acks[offset++] = RX_ACK_TYPE_ACK;
- }
- ap->nAcks = offset;
- p->length = rx_AckDataSize(offset) + 4;
- templ = htonl(rx_maxReceiveSize);
- rx_packetwrite(p, rx_AckDataSize(offset), 4, &templ);
- p->header.serviceId = call->conn->serviceId;
- p->header.cid = (call->conn->cid | call->channel);
- p->header.callNumber = *call->callNumber;
- p->header.seq = seq;
- p->header.securityIndex = call->conn->securityIndex;
- p->header.epoch = call->conn->epoch;
- p->header.type = RX_PACKET_TYPE_ACK;
- p->header.flags = 0;
- if (reason == RX_ACK_PING) {
- p->header.flags |= RX_REQUEST_ACK;
-#ifdef ADAPT_WINDOW
- clock_GetTime(&call->pingRequestTime);
-#endif
- }
- if (call->conn->type == RX_CLIENT_CONNECTION)
- p->header.flags |= RX_CLIENT_INITIATED;
-
-
-#ifdef RXDEBUG
- if (Log) {
- fprintf(Log, "SACK: reason %x previous %lu seq %lu first %lu",
- ap->reason,
- (unsigned long)ntohl(ap->previousPacket),
- (unsigned long)p->header.seq,
- (unsigned long)ntohl(ap->firstPacket));
- if (ap->nAcks) {
- for (offset = 0; offset < ap->nAcks; offset++)
- putc(ap->acks[offset] == RX_ACK_TYPE_NACK ? '-' : '*', Log);
- }
- putc('\n', Log);
- }
-#endif
-
- {
- int i, nbytes = p->length;
-
- for (i = 1; i < p->niovecs; i++) { /* vec 0 is ALWAYS header */
- if (nbytes <= p->wirevec[i].iov_len) {
- int savelen, saven;
-
- savelen = p->wirevec[i].iov_len;
- saven = p->niovecs;
- p->wirevec[i].iov_len = nbytes;
- p->niovecs = i + 1;
- rxi_Send(call, p);
- p->wirevec[i].iov_len = savelen;
- p->niovecs = saven;
- break;
- } else
- nbytes -= p->wirevec[i].iov_len;
- }
- }
- rx_stats.ackPacketsSent++;
- if (!optionalPacket)
- rxi_FreePacket(p);
- return optionalPacket; /* Return packet for re-use by caller */
-}
-
-
-/*
- * This routine is called when new packets are readied for
- * transmission and when retransmission may be necessary, or when the
- * transmission window or burst count are favourable. This should be
- * better optimized for new packets, the usual case, now that we've
- * got rid of queues of send packets. XXXXXXXXXXX
- */
-void
-rxi_Start(struct rxevent * event, struct rx_call * call)
-{
- int nSent = 0;
- struct rx_packet *p;
- struct rx_packet *nxp; /* Next pointer for queue_Scan */
- struct rx_packet *lastPacket;
- struct rx_peer *peer = call->conn->peer;
- struct clock now, retryTime;
- int haveEvent;
-
- /*
- * If rxi_Start is being called as a result of a resend event,
- * then make sure that the event pointer is removed from the call
- * structure, since there is no longer a per-call retransmission
- * event pending.
- */
- if (event && event == call->resendEvent)
- call->resendEvent = 0;
-
- if (queue_IsNotEmpty(&call->tq)) { /* If we have anything to send */
- /*
- * Get clock to compute the re-transmit time for any packets
- * in this burst. Note, if we back off, it's reasonable to
- * back off all of the packets in the same manner, even if
- * some of them have been retransmitted more times than more
- * recent additions
- */
- clock_GetTime(&now);
- retryTime = now; /* initialize before use */
- clock_Add(&retryTime, &peer->timeout);
-
- /*
- * Send (or resend) any packets that need it, subject to
- * window restrictions and congestion burst control
- * restrictions. Ask for an ack on the last packet sent in
- * this burst. For now, we're relying upon the window being
- * considerably bigger than the largest number of packets that
- * are typically sent at once by one initial call to
- * rxi_Start. This is probably bogus (perhaps we should ask
- * for an ack when we're half way through the current
- * window?). Also, for non file transfer applications, this
- * may end up asking for an ack for every packet. Bogus. XXXX
- */
- call->flags |= RX_CALL_TQ_BUSY;
- for (lastPacket = (struct rx_packet *) 0,
- queue_Scan(&call->tq, p, nxp, rx_packet)) {
- if (p->acked) {
- rx_stats.ignoreAckedPacket++;
- continue; /* Ignore this packet if it has been
- * acknowledged */
- }
- /*
- * Turn off all flags except these ones, which are the same
- * on each transmission
- */
- p->header.flags &= RX_PRESET_FLAGS;
-
- if (p->header.seq >= call->tfirst + call->twind) {
- call->flags |= RX_CALL_WAIT_WINDOW_SEND; /*
- * Wait for transmit
- * window
- */
- /*
- * Note: if we're waiting for more window space, we can
- * still send retransmits; hence we don't return here, but
- * break out to schedule a retransmit event
- */
- break;
- }
- /*
- * If we're not allowed to send any more in the current
- * burst, make sure we get scheduled later. Also schedule
- * an event to "give back" the packets we've used, when the
- * burst time has elapsed (if we used any packets at all).
- */
- /* XXX this need to go away and replaced with congestion
- * avoidance */
- if (peer->burstSize && !peer->burst) {
- if (nSent) {
- /* Send off the prior packet */
- /*
- * Don't request an ack if it's a short packet, because the
- * peer will cut down its MTU as a result.
- */
- if ((lastPacket->header.flags & RX_LAST_PACKET) == 0) {
- if (/* call->cwind <= (u_short)call->ackRate || */
- (!(call->flags & RX_CALL_SLOW_START_OK)
- && (lastPacket->header.seq & 1))) {
-
- lastPacket->header.flags |= RX_REQUEST_ACK;
- }
- }
- rxi_Send(call, lastPacket);
- rxi_ScheduleDecongestionEvent(call, nSent);
- }
- rxi_CongestionWait(call);
- /*
- * Note: if we're waiting for congestion to ease, we can't
- * send any packets, including retransmits. Hence we do
- * not schedule a new retransmit event right now
- */
- call->flags &= ~RX_CALL_TQ_BUSY;
- return;
- }
- /*
- * Transmit the packet if it has never been sent, or
- * retransmit it if the current timeout for this host for
- * this packet has elapsed
- */
- if (!clock_IsZero(&p->retryTime)) {
- struct clock updatedRetryTime;
-
- if (clock_Lt(&now, &p->retryTime))
- continue;
-
- /*
- * If the RTT has gone up since the packet
- * was sent, don't retransmit just yet!
- */
- updatedRetryTime = p->timeSent;
- clock_Add(&updatedRetryTime, &peer->timeout);
- if (clock_Lt(&now, &updatedRetryTime)) {
- p->retryTime = updatedRetryTime;
- continue;
- }
-
- /*
- * If we have to retransmit chances are that we have a
- * busted timer. Increase MDEV to reflect this
- * fact. If we are wrong, MDEV will come down quickly
- * as new acks arrive.
- */
- dubious_timeout(peer);
-
- /*
- * Always request an ack on a retransmitted packet; this
- * will help to get the data moving again, especially if
- * the packet is near the beginning of the window.
- * Actually, XXXX, we may want to do just that: only
- * request the acks if the packet is in, say, the first
- * half of the window
- */
- p->header.flags |= RX_REQUEST_ACK;
- peer->reSends++, rx_stats.dataPacketsReSent++;
- p->retryTime = retryTime;
-
- /*
- * if a packet gets dropped, don't keep hammering on it --
- * back off exponentially, at least up to a point. I had
- * to trade off global congestion avoidance against individual
- * performance. Note that most connections will time out
- * after 20 - 60 seconds. In pathological cases, retransmits
- * must still continue to disperse. For instance, there is
- * a condition where the server discards received packets, but
- * still sends keep-alives on the call, so the call may live
- * much longer than 60 seconds.
- */
- if (p->backoff < MAXBACKOFF)
- p->backoff = (p->backoff << 1) + 1; /* so it can't stay == 0 */
- else
- p->backoff++;
- clock_Addmsec(&(p->retryTime), ((unsigned long) p->backoff) << 8);
- /* consider shrinking the packet size? XXXX */
- /* no, shrink the burst size. LWSXXX */
- } else {
- peer->nSent++, rx_stats.dataPacketsSent++;
- p->firstSent = now; /* improved RTO calculation- not Karn */
- p->retryTime = retryTime;
- /*
- * Ask for an ack for the first packet on a new
- * connection, since it may carry some interesting info
- * like maxReceiveSize. It will also help us train to a
- * new estimate of RTT, for good or bad. This has one
- * neat side effect: since the first call on a connection
- * usually triggers a challenge/response exchange, the
- * first packet was often retransmitted before the call
- * could complete. Getting this ack prevents those
- * retransmissions. Admittedly, this is straining at gnats.
- */
- if ((p->header.callNumber == 1) && (p->header.seq == 1) &&
- (p->length >= call->conn->maxPacketSize)) {
- p->header.flags |= RX_REQUEST_ACK;
- }
- }
-
- /*
- * Install the new retransmit time for the packet, and
- * record the time sent
- */
- p->timeSent = now;
-
- /*
- * Send the previous packet, and remember this one--we don't
- * send it immediately, so we can tag it as requiring an ack
- * later, if necessary
- */
- if (peer->burstSize)
- peer->burst--;
- nSent++;
- if (lastPacket) {
- /*
- * Tag this packet as not being the last in this group,
- * for the receiver's benefit
- */
- lastPacket->header.flags |= RX_MORE_PACKETS;
- rxi_Send(call, lastPacket);
- }
- lastPacket = p;
- }
- call->flags &= ~RX_CALL_TQ_BUSY;
-
- /*
- * If any packets are to be sent, send them and post a
- * decongestion event to bump the burst count that we used up
- * sending the packets
- */
- if (nSent) {
-
- /*
- * we don't ask for an ack on the final packet, since the
- * response from the peer implicitly acks it, but we do wait a
- * little longer for the ack on the last packet on server conns.
- */
- if ((lastPacket->header.flags & RX_LAST_PACKET) == 0) {
-
- /*
- * to get the window up faster we ack every packet as
- * long as we are below the fast ack window, or if the
- * client doesn't support slow start, every second packet
- */
- if (/* call->cwind <= (u_short)call->ackRate || */
- (!(call->flags & RX_CALL_SLOW_START_OK)
- && (lastPacket->header.seq & 1))) {
-
- lastPacket->header.flags |= RX_REQUEST_ACK;
- }
- } else if (!(lastPacket->header.flags & RX_CLIENT_INITIATED))
- clock_Addmsec(&(lastPacket->retryTime), 400);
-
- rxi_Send(call, lastPacket);
- if (peer->burstSize)
- rxi_ScheduleDecongestionEvent(call, nSent);
- }
-
- /*
- * Always post a resend event, if there is anything in the queue, and
- * resend is possible. There should be at least one unacknowledged
- * packet in the queue ... otherwise none of these packets should be
- * on the queue in the first place.
- */
- if (call->resendEvent) {
-
- /*
- * If there's an existing resend event, then if its expiry time
- * is sooner than the new one, then it must be less than any
- * possible expiry time (because it represents all previous
- * packets sent that may still need retransmitting). In this
- * case, just leave that event as scheduled
- */
- if (clock_Le(&call->resendEvent->eventTime, &retryTime))
- return;
- /* Otherwise, cancel the existing event and post a new one */
- rxevent_Cancel(call->resendEvent);
- }
-
- /*
- * Loop to find the earliest event. I *know* XXXX that this can be
- * coded more elegantly (perhaps rolled into the above code)
- */
- for (haveEvent = 0, queue_Scan(&call->tq, p, nxp, rx_packet)) {
- if (!p->acked && !clock_IsZero(&p->retryTime)) {
- haveEvent = 1;
- if (clock_Lt(&p->retryTime, &retryTime))
- retryTime = p->retryTime;
- }
- }
-
- /* Post a new event to re-run rxi_Start when retries may be needed */
- if (haveEvent) {
- call->resendEvent = rxevent_Post(&retryTime, rxi_Start, (void *) call, NULL);
- }
- }
-}
-
-/*
- * Also adjusts the keep alive parameters for the call, to reflect
- * that we have just sent a packet (so keep alives aren't sent
- * immediately)
- */
-void
-rxi_Send(struct rx_call *call, struct rx_packet *p)
-{
- struct rx_connection *conn = call->conn;
-
- /* Stamp each packet with the user supplied status */
- p->header.userStatus = call->localStatus;
-
- /*
- * Allow the security object controlling this call's security to make any
- * last-minute changes to the packet
- */
- RXS_SendPacket(conn->securityObject, call, p);
-
- /* Actually send the packet, filling in more connection-specific fields */
- rxi_SendPacket(conn, p);
-
- /*
- * Update last send time for this call (for keep-alive processing), and
- * for the connection (so that we can discover idle connections)
- */
- conn->lastSendTime = call->lastSendTime = clock_Sec();
-
- /*
- * Since we've just sent SOME sort of packet to the peer, it's safe to
- * nuke any scheduled end-of-packets ack
- */
- rxevent_Cancel(call->delayedAckEvent);
-}
-
-
-/*
- * Check if a call needs to be destroyed. Called by keep-alive code to ensure
- * that things are fine. Also called periodically to guarantee that nothing
- * falls through the cracks (e.g. (error + dally) connections have keepalive
- * turned off. Returns 0 if conn is well, negativ otherwise.
- * -1 means that the call still exists, -2 means that the call is freed.
- */
-
-static int
-rxi_CheckCall(struct rx_call *call)
-{
- struct rx_connection *conn = call->conn;
- struct rx_service *tservice;
- u_long now;
-
- now = clock_Sec();
-
- /*
- * These are computed to the second (+- 1 second). But that's good
- * enough for these values, which should be a significant number of
- * seconds.
- */
- if (now > (call->lastReceiveTime + conn->secondsUntilDead)) {
-
- if (call->state == RX_STATE_ACTIVE) {
- rxi_CallError(call, RX_CALL_DEAD);
- return -1;
- } else {
- rxi_FreeCall(call);
- return -2;
- }
-
- /*
- * Non-active calls are destroyed if they are not responding to
- * pings; active calls are simply flagged in error, so the attached
- * process can die reasonably gracefully.
- */
-
- }
- /* see if we have a non-activity timeout */
- tservice = conn->service;
- if ((conn->type == RX_SERVER_CONNECTION) && call->startWait
- && tservice->idleDeadTime
- && ((call->startWait + tservice->idleDeadTime) < now)) {
- if (call->state == RX_STATE_ACTIVE) {
- rxi_CallError(call, RX_CALL_TIMEOUT);
- return -1;
- }
- }
- /* see if we have a hard timeout */
- if (conn->hardDeadTime && (now > (conn->hardDeadTime + call->startTime))) {
- if (call->state == RX_STATE_ACTIVE)
- rxi_CallError(call, RX_CALL_TIMEOUT);
- return -1;
- }
- return 0;
-}
-
-
-/*
- * When a call is in progress, this routine is called occasionally to
- * make sure that some traffic has arrived (or been sent to) the peer.
- * If nothing has arrived in a reasonable amount of time, the call is
- * declared dead; if nothing has been sent for a while, we send a
- * keep-alive packet (if we're actually trying to keep the call alive)
- */
-void
-rxi_KeepAliveEvent(struct rxevent *event, struct rx_call *call,
- char *dummy)
-{
- struct rx_connection *conn = call->conn;
- u_long now;
-
- call->keepAliveEvent = (struct rxevent *) 0;
- now = clock_Sec();
-
- if (rxi_CheckCall(call))
- return;
-
- /* Don't try to keep alive dallying calls */
- if ((call->state != RX_STATE_DALLY)
- && ((now - call->lastSendTime) > conn->secondsUntilPing)) {
- /* Don't try to send keepalives if there is unacknowledged data */
-
- /*
- * the rexmit code should be good enough, this little hack doesn't
- * quite work LWSXXX
- */
- (void) rxi_SendAck(call, 0, 0, 0, 0, RX_ACK_PING);
- }
- rxi_ScheduleKeepAliveEvent(call);
-}
-
-
-void
-rxi_ScheduleKeepAliveEvent(struct rx_call *call)
-{
- if (!call->keepAliveEvent) {
- struct clock when;
-
- clock_GetTime(&when);
- when.sec += call->conn->secondsUntilPing;
- call->keepAliveEvent = rxevent_Post(&when, rxi_KeepAliveEvent, call, NULL);
- }
-}
-
-/* N.B. rxi_KeepAliveOff: is defined earlier as a macro */
-void
-rxi_KeepAliveOn(struct rx_call *call)
-{
-
- /*
- * Pretend last packet received was received now--i.e. if another packet
- * isn't received within the keep alive time, then the call will die;
- * Initialize last send time to the current time--even if a packet hasn't
- * been sent yet. This will guarantee that a keep-alive is sent within
- * the ping time
- */
- call->lastReceiveTime = call->lastSendTime = clock_Sec();
- rxi_ScheduleKeepAliveEvent(call);
-}
-
-/*
- * This routine is called periodically (every RX_AUTH_REQUEST_TIMEOUT
- * seconds) to ask the client to authenticate itself. The routine
- * issues a challenge to the client, which is obtained from the
- * security object associated with the connection
- */
-void
-rxi_ChallengeEvent(struct rxevent *event, struct rx_connection *conn,
- char *dummy)
-{
- conn->challengeEvent = (struct rxevent *) 0;
- if (RXS_CheckAuthentication(conn->securityObject, conn) != 0) {
- struct rx_packet *packet;
-
- packet = rxi_AllocPacket(RX_PACKET_CLASS_SPECIAL);
- if (!packet)
- osi_Panic("rxi_ChallengeEvent");
- RXS_GetChallenge(conn->securityObject, conn, packet);
- rxi_SendSpecial((struct rx_call *) 0, conn, packet,
- RX_PACKET_TYPE_CHALLENGE, (char *) 0, -1);
- rxi_FreePacket(packet);
- rxi_resend_ChallengeEvent(conn);
- }
-}
-
-/*
- * Call this routine to start requesting the client to authenticate
- * itself. This will continue until authentication is established,
- * the call times out, or an invalid response is returned. The
- * security object associated with the connection is asked to create
- * the challenge at this time. N.B. rxi_ChallengeOff is a macro,
- * defined earlier.
- */
-void
-rxi_ChallengeOn(struct rx_connection *conn)
-{
- if (!conn->challengeEvent) {
- RXS_CreateChallenge(conn->securityObject, conn);
- rxi_ChallengeEvent((struct rxevent *) 0, conn, 0);
- };
-}
-
-/*
- * Called by event.c when a decongestion event (setup by
- * rxi_CongestionWait) occurs. This adds back in to the burst count
- * for the specified host the number of packets that were sent at the
- * time the event was scheduled. It also calls rxi_Start on as many
- * waiting calls as possible before the burst count goes down to zero,
- * again.
- */
-static void
-rxi_DecongestionEvent(struct rxevent *event, struct rx_peer *peer,
- int nPackets)
-{
- struct rx_call *call;
- struct rx_call *nxcall; /* Next pointer for queue_Scan */
-
- peer->burst += nPackets;
- if (peer->burst > peer->burstSize)
- peer->burst = peer->burstSize;
- for (queue_Scan(&peer->congestionQueue, call, nxcall, rx_call)) {
- assert(queue_IsNotEmpty(&peer->congestionQueue));
- assert(queue_Prev(&peer->congestionQueue, rx_call));
- queue_Remove(call);
-
- /*
- * The rxi_Start may put the call back on the congestion queue. In
- * that case, peer->burst should be 0 (otherwise no congestion was
- * encountered). It should go on the end of the queue, to allow
- * other calls to proceed when the next burst is allowed
- */
- rxi_Start((struct rxevent *) 0, call);
- if (!peer->burst)
- goto done;
- }
- done:
- peer->refCount--; /* It was bumped by the callee */
- return;
-}
-
-/*
- * Schedule an event at a host-dependent time in the future which will
- * add back nPackets to the current allowed burst window. Any number
- * of these events may be scheduled.
- */
-void
-rxi_ScheduleDecongestionEvent(struct rx_call *call, int nPackets)
-{
- struct rx_peer *peer = call->conn->peer;
- struct clock tmp;
-
- clock_GetTime(&tmp);
- clock_Add(&tmp, &peer->burstWait);
- peer->refCount++; /* So it won't disappear underneath
- * us! */
- /* this is stupid - sending an int as a pointer is begging for trouble */
- rxevent_Post(&tmp, rxi_DecongestionEvent, (void *) peer, (void *)nPackets);
-}
-
-/*
- * The caller wishes to have rxi_Start called when the burst count has
- * gone up, and more packets can therefore be sent. Add the caller to
- * the end of the list of calls waiting for decongestion events to
- * happen. It's important that it's added to the end so that the
- * rxi_DecongestionEvent procedure always terminates (aside from
- * matters of scheduling fairness).
- */
-void
-rxi_CongestionWait(struct rx_call *call)
-{
- if (queue_IsOnQueue(call))
- return;
- assert(queue_IsNotEmpty(&call->conn->peer->congestionQueue));
- assert(queue_Prev(&call->conn->peer->congestionQueue, rx_call));
- queue_Append(&call->conn->peer->congestionQueue, call);
-}
-
-/*
- * Compute round trip time of the packet provided, in *rttp.
- */
-#ifdef ADAPT_PERF
-#define ADAPT_RTO
-#endif
-
-void
-rxi_ComputeRoundTripTime(struct rx_packet *p,
- struct clock *sentp,
- struct rx_peer *peer)
-{
- struct clock thisRtt, *rttp = &thisRtt;
-
-#ifdef ADAPT_RTO
- static char id[] = "@(#)adaptive RTO";
- *id = *id; /* so it won't complain about unsed variables */
-
- clock_GetTime(rttp);
- if (clock_Lt(rttp, sentp)) {
- clock_Zero(rttp);
- return; /* somebody set the clock back, don't
- * count this time. */
- }
- clock_Sub(rttp, sentp);
-#else
- clock_GetTime(rttp);
- clock_Sub(rttp, &p->timeSent);
-#endif
- if (clock_Lt(rttp, &rx_stats.minRtt))
- rx_stats.minRtt = *rttp;
- if (clock_Gt(rttp, &rx_stats.maxRtt)) {
- if (rttp->sec > 110)
- return; /* somebody set the clock ahead */
- rx_stats.maxRtt = *rttp;
- }
- clock_Add(&rx_stats.totalRtt, rttp);
- rx_stats.nRttSamples++;
-
-#ifdef ADAPT_RTO
- /* better rtt calculation courtesy of UMich crew (dave,larry,peter,???) */
-
- /* Apply VanJacobson round-trip estimations */
- if (peer->srtt) {
- u_long rtt;
- u_long err;
-
- rtt = rttp->usec + rttp->sec*1000000;
- if (rtt >= peer->srtt)
- err = rtt - peer->srtt;
- else
- err = peer->srtt - rtt;
-
- /*
- * The following magic is equivalent to the smoothing
- * algorithm in rfc793 with an alpha of .875
- * (srtt = rtt/8 + srtt*7/8 in fixed point).
- */
-
- peer->srtt = (peer->srtt*7 + rtt)/8;
-
- /*
- * We accumulate a smoothed rtt variance (actually, a smoothed
- * mean difference), then set the retransmit timer to smoothed
- * rtt + 4 times the smoothed variance (was 2x in van's
- * original paper, but 4x works better for me, and apparently
- * for him as well).
- *
- * The following is equivalent to rfc793 smoothing with an
- * alpha of .75 (rttvar = rttvar*3/4 + |err| / 4). This
- * replaces rfc793's wired-in beta.
- */
-
- peer->mdev = (peer->mdev*3 + err)/4;
- } else {
- peer->srtt = rttp->usec + rttp->sec*1000000;
- peer->mdev = peer->srtt/2;
- /* One single measurement is a real poor estimate of RTT&MDEV */
- if (peer->mdev < 1000)
- peer->mdev = 1000; /* 1ms */
- }
-
- update_timeout(peer);
-
- dpf(("rtt=%.2f ms, srtt=%.2f ms, mdev=%.2f ms, timeout=%.2f ms\n",
- rttp->usec/1000.0 + rttp->sec*1000.0,
- peer->srtt/1000.0, peer->mdev/1000.0,
- peer->timeout.sec*1000.0 + peer->timeout.usec/1000.0));
-#endif /* ADAPT_RTO */
-}
-
-
-/*
- * Find all server connections that have not been active for a long time,
- * and toss them
- */
-void
-rxi_ReapConnections(void)
-{
- struct clock now;
-
- clock_GetTime(&now);
-
- /*
- * Find server connection structures that haven't been used for greater
- * than rx_idleConnectionTime
- */
- {
- struct rx_connection **conn_ptr, **conn_end;
- int i, havecalls = 0, ret;
-
- for (conn_ptr = &rx_connHashTable[0],
- conn_end = &rx_connHashTable[rx_hashTableSize];
- conn_ptr < conn_end;
- conn_ptr++) {
- struct rx_connection *conn, *next;
-
- rereap:
- for (conn = *conn_ptr; conn; conn = next) {
- next = conn->next;
- /* once a minute look at everything to see what's up */
- havecalls = 0;
- for (i = 0; i < RX_MAXCALLS; i++) {
- if (conn->call[i]) {
- havecalls = 1;
- ret = rxi_CheckCall(conn->call[i]);
- if (ret == -2) {
- /* If CheckCall freed the call, it might
- * have destroyed the connection as well,
- * which screws up the linked lists.
- */
- goto rereap;
- }
- }
- }
- if (conn->type == RX_SERVER_CONNECTION) {
-
- /*
- * This only actually destroys the connection if there
- * are no outstanding calls
- */
- if (!havecalls && !conn->refCount &&
- ((conn->lastSendTime + rx_idleConnectionTime) < now.sec)) {
- conn->refCount++; /* it will be decr in
- * rx_DestroyConn */
- rx_DestroyConnection(conn);
- }
- }
- }
- }
- }
-
- /*
- * Find any peer structures that haven't been used (haven't had an
- * associated connection) for greater than rx_idlePeerTime
- */
- {
- struct rx_peer **peer_ptr, **peer_end;
-
- for (peer_ptr = &rx_peerHashTable[0],
- peer_end = &rx_peerHashTable[rx_hashTableSize];
- peer_ptr < peer_end; peer_ptr++) {
- struct rx_peer *peer, *next;
-
- for (peer = *peer_ptr; peer; peer = next) {
- next = peer->next;
- if (peer->refCount == 0
- && ((peer->idleWhen + rx_idlePeerTime) < now.sec)) {
- rxi_DestroyPeer(peer);
- }
- }
- }
- }
-
- /*
- * THIS HACK IS A TEMPORARY HACK. The idea is that the race condition in
- * rxi_AllocSendPacket, if it hits, will be handled at the next conn GC,
- * just below. Really, we shouldn't have to keep moving packets from one
- * place to another, but instead ought to always know if we can afford to
- * hold onto a packet in its particular use.
- */
- RX_MUTEX_ENTER(&rx_waitingForPackets_lock);
- if (rx_waitingForPackets) {
- rx_waitingForPackets = 0;
-#ifdef RX_ENABLE_LOCKS
- cv_signal(&rx_waitingForPackets_cv);
-#else
- osi_rxWakeup(&rx_waitingForPackets);
-#endif
- }
- RX_MUTEX_EXIT(&rx_waitingForPackets_lock);
-
- now.sec += RX_REAP_TIME; /* Check every RX_REAP_TIME seconds */
- rxevent_Post(&now, rxi_ReapConnections, NULL, NULL);
-}
-
-
-/*
- * rxs_Release - This isn't strictly necessary but, since the macro name from
- * rx.h is sort of strange this is better. This is called with a security
- * object before it is discarded. Each connection using a security object has
- * its own refcount to the object so it won't actually be freed until the last
- * connection is destroyed.
- *
- * This is the only rxs module call. A hold could also be written but no one
- * needs it.
- */
-
-int
-rxs_Release(struct rx_securityClass *aobj)
-{
- return RXS_Close(aobj);
-}
-
-#ifdef ADAPT_WINDOW
-#define RXRATE_PKT_OH (RX_HEADER_SIZE + RX_IPUDP_SIZE)
-#define RXRATE_SMALL_PKT (RXRATE_PKT_OH + sizeof(struct rx_ackPacket))
-#define RXRATE_AVG_SMALL_PKT (RXRATE_PKT_OH + (sizeof(struct rx_ackPacket)/2))
-#define RXRATE_LARGE_PKT (RXRATE_SMALL_PKT + 256)
-
-/*
- * Adjust our estimate of the transmission rate to this peer, given
- * that the packet p was just acked. We can adjust peer->timeout and
- * call->twind (and peer->maxWindow). Pragmatically, this is called
- * only with packets of maximal length.
- */
-
-static void
-rxi_ComputeRate(struct rx_peer *peer, struct rx_call *call,
- struct rx_packet *p, struct rx_packet *ackp, u_char ackReason)
-{
- long xferSize, xferMs;
- long minTime;
- struct clock newTO;
-
- /* Count down packets */
- if (peer->rateFlag > 0)
- peer->rateFlag--;
- /* Do nothing until we're enabled */
- if (peer->rateFlag != 0)
- return;
- if (!call->conn)
- return;
-
- /* Count only when the ack seems legitimate */
- switch (ackReason) {
- case RX_ACK_REQUESTED:
- xferSize = p->length + RX_HEADER_SIZE +
- call->conn->securityMaxTrailerSize;
- xferMs = peer->rtt;
- break;
-
- case RX_ACK_PING_RESPONSE:
- if (p) /* want the response to ping-request,
- * not data send */
- return;
- clock_GetTime(&newTO);
- if (clock_Gt(&newTO, &call->pingRequestTime)) {
- clock_Sub(&newTO, &call->pingRequestTime);
- xferMs = (newTO.sec * 1000) + (newTO.usec / 1000);
- } else {
- return;
- }
- xferSize = rx_AckDataSize(rx_Window) + RX_HEADER_SIZE;
- break;
-
- default:
- return;
- }
-
- dpf(("CONG peer %lx/%u: sample (%s) size %ld, %ld ms (to %lu.%06lu, "
- "rtt %u, win %u, ps %u)",
- ntohl(peer->host), ntohs(peer->port),
- (ackReason == RX_ACK_REQUESTED ? "dataack" : "pingack"),
- xferSize, xferMs, peer->timeout.sec, peer->timeout.usec, peer->smRtt,
- peer->maxWindow, peer->packetSize));
-
- /* Track only packets that are big enough. */
- if ((p->length + RX_HEADER_SIZE + call->conn->securityMaxTrailerSize) <
- peer->packetSize)
- return;
-
- /* absorb RTT data (in milliseconds) for these big packets */
- if (peer->smRtt == 0) {
- peer->smRtt = xferMs;
- } else {
- peer->smRtt = ((peer->smRtt * 15) + xferMs + 4) >> 4;
- if (!peer->smRtt)
- peer->smRtt = 1;
- }
-
- if (peer->countDown) {
- peer->countDown--;
- return;
- }
- peer->countDown = 10; /* recalculate only every so often */
-
-#if 0
-
- /*
- * We here assume that we can approximate the total elapsed time for a
- * window-full of full packets as: time = RTT + ((winSize *
- * (packetSize+overhead)) - minPktSize) / byteRate
- */
- /* The RTT and byteRate numbers are what is measured above. */
-
- /*
- * In principle, we can change the other parameters: - winSize, the
- * number of packets in the transmission window; - packetSize, the max
- * size of a data packet; - the timeout, which must be larger than the
- * expected time.
- */
-
- /*
- * In practice, we do this in two steps: (a) ensure that the timeout is
- * large enough for a single packet to get through; (b) ensure that the
- * transmit-window is small enough to fit in the timeout.
- */
-
- /* First, an expression for the expected RTT for a full packet */
- minTime = peer->smRtt + ((1000 * (peer->packetSize +
- RX_HEADER_SIZE + RX_IPUDP_SIZE)) / peer->smBps);
-
- /* Get a reasonable estimate for a timeout period */
- minTime += minTime;
- newTO.sec = minTime / 1000;
- newTO.usec = (minTime - (newTO.sec * 1000)) * 1000;
-
- /*
- * Increase the timeout period so that we can always do at least one
- * packet exchange
- */
- if (clock_Gt(&newTO, &peer->timeout)) {
-
- dpf(("CONG peer %lx/%u: timeout %lu.%06lu ==> %lu.%06lu "
- "(rtt %u, win %u, ps %u, Bps %u)",
- ntohl(peer->host), ntohs(peer->port), peer->timeout.sec,
- peer->timeout.usec, newTO.sec, newTO.usec, peer->smRtt,
- peer->maxWindow, peer->packetSize, peer->smBps));
-
- peer->timeout = newTO;
- }
- /* Now, get an estimate for the transmit window size. */
- minTime = peer->timeout.sec * 1000 + (peer->timeout.usec / 1000);
-
- /*
- * Now, convert to the number of full packets that could fit in that
- * interval
- */
- minTime = ((((minTime - peer->smRtt) * peer->smBps) / 1000) +
- RXRATE_AVG_SMALL_PKT) /
- (peer->packetSize + RX_HEADER_SIZE + RX_IPUDP_SIZE);
- minTime >>= 1; /* Take half that many */
- xferSize = minTime; /* (make a copy) */
-
- /* Now clamp the size to reasonable bounds. */
- if (minTime <= 1)
- minTime = 1;
- else if (minTime > rx_Window)
- minTime = rx_Window;
- if (minTime != peer->maxWindow) {
- dpf(("CONG peer %lx/%u: windowsize %lu ==> %lu (to %lu.%06lu, "
- "rtt %u, ps %u, Bps %u)",
- ntohl(peer->host), ntohs(peer->port), peer->maxWindow, minTime,
- peer->timeout.sec, peer->timeout.usec, peer->smRtt,
- peer->packetSize, peer->smBps));
-
- peer->maxWindow = minTime;
- /* call->twind = minTime; */
- }
-
- /*
- * Cut back on the peer timeout if it has grown unreasonably. Discern
- * this by calculating the timeout necessary for rx_Window packets.
- */
- if ((xferSize > rx_Window) && (peer->timeout.sec >= 3)) {
- /* calculate estimate for transmission interval in milliseconds */
- minTime = (((1000 * rx_Window *
- (peer->packetSize + RX_HEADER_SIZE + RX_IPUDP_SIZE))
- - RXRATE_AVG_SMALL_PKT) / peer->smBps) + peer->smRtt;
- if (minTime < 1000) {
-
- dpf(("CONG peer %lx/%u: cut TO %lu.%06lu by 0.5 (rtt %u, "
- "win %u, ps %u, Bps %u)",
- ntohl(peer->host), ntohs(peer->port), peer->timeout.sec,
- peer->timeout.usec, peer->smRtt, peer->maxWindow,
- peer->packetSize, peer->smBps));
-
- newTO.sec = 0; /* cut back on timeout by half a
- * second */
- newTO.usec = 500000;
- clock_Sub(&peer->timeout, &newTO);
- }
- }
-#endif /* 0 */
-
- /*
- * In practice, we can measure only the RTT for full packets, because of
- * the way Rx acks the data that it receives. (If it's smaller than a
- * full packet, it often gets implicitly acked either by the call
- * response (from a server) or by the next call (from a client), and
- * either case confuses transmission times with processing times.)
- * Therefore, replace the above more-sophisticated processing with a
- * simpler version, where the smoothed RTT is kept for full-size packets,
- * and the time to transmit a windowful of full-size packets is simply
- * RTT * windowSize. Again, we take two steps: - ensure the timeout is
- * large enough for a single packet's RTT; - ensure that the window is
- * small enough to fit in the desired timeout.
- */
-
- /* First, the timeout check. */
- minTime = peer->smRtt;
- /* Get a reasonable estimate for a timeout period */
- minTime += minTime;
- newTO.sec = minTime / 1000;
- newTO.usec = (minTime - (newTO.sec * 1000)) * 1000;
-
- /*
- * Increase the timeout period so that we can always do at least one
- * packet exchange
- */
- if (clock_Gt(&newTO, &peer->timeout)) {
-
- dpf(("CONG peer %lx/%u: timeout %lu.%06lu ==> %lu.%06lu (rtt %u, "
- "win %u, ps %u)",
- ntohl(peer->host), ntohs(peer->port), peer->timeout.sec,
- peer->timeout.usec, newTO.sec, newTO.usec, peer->smRtt,
- peer->maxWindow, peer->packetSize));
-
- peer->timeout = newTO;
- }
- /* Now, get an estimate for the transmit window size. */
- minTime = peer->timeout.sec * 1000 + (peer->timeout.usec / 1000);
-
- /*
- * Now, convert to the number of full packets that could fit in a
- * reasonable fraction of that interval
- */
- minTime /= (peer->smRtt << 1);
- xferSize = minTime; /* (make a copy) */
-
- /* Now clamp the size to reasonable bounds. */
- if (minTime <= 1)
- minTime = 1;
- else if (minTime > rx_Window)
- minTime = rx_Window;
- if (minTime != peer->maxWindow) {
- dpf(("CONG peer %lx/%u: windowsize %lu ==> %lu (to %lu.%06lu, "
- "rtt %u, ps %u)",
- ntohl(peer->host), ntohs(peer->port), peer->maxWindow, minTime,
- peer->timeout.sec, peer->timeout.usec, peer->smRtt,
- peer->packetSize));
- peer->maxWindow = minTime;
- /* call->twind = minTime; */
- }
-
- /*
- * Cut back on the peer timeout if it had earlier grown unreasonably.
- * Discern this by calculating the timeout necessary for rx_Window
- * packets.
- */
- if ((xferSize > rx_Window) && (peer->timeout.sec >= 3)) {
- /* calculate estimate for transmission interval in milliseconds */
- minTime = rx_Window * peer->smRtt;
- if (minTime < 1000) {
- dpf(("CONG peer %lx/%u: cut TO %lu.%06lu by 0.5 (rtt %u, "
- "win %u, ps %u)",
- ntohl(peer->host), ntohs(peer->port), peer->timeout.sec,
- peer->timeout.usec, peer->smRtt, peer->maxWindow,
- peer->packetSize));
-
- newTO.sec = 0; /* cut back on timeout by half a
- * second */
- newTO.usec = 500000;
- clock_Sub(&peer->timeout, &newTO);
- }
- }
- return;
-} /* end of rxi_ComputeRate */
-
-#endif /* ADAPT_WINDOW */
-
-
-
-
-
-
-#ifdef RXDEBUG
-/* Don't call this debugging routine directly; use dpf */
-void
-rxi_DebugPrint(const char *fmt, ...)
-{
- struct clock now;
- va_list ap;
-
- clock_GetTime(&now);
-
- fprintf(Log, " %lu.%.3lu:", now.sec, now.usec / 1000);
- va_start(ap, fmt);
- vfprintf(Log, fmt, ap);
- va_end(ap);
- putc('\n', Log);
-}
-
-#endif
-
-#if defined(RXDEBUG)
-void
-rx_PrintTheseStats(FILE *file, struct rx_stats *s, int size)
-{
- int i;
-
- if (size != sizeof(struct rx_stats))
- fprintf(file, "Unexpected size of stats structure: was %d, "
- "expected %d\n",
- size,
- (int)sizeof(struct rx_stats));
-
- fprintf(file,
- "rx stats: free packets %d, allocs %d, "
- "alloc-failures(rcv %d,send %d,ack %d)\n", rx_nFreePackets,
- s->packetRequests, s->noPackets[0], s->noPackets[1],
- s->noPackets[2]);
- fprintf(file,
- " greedy %d, bogusReads %d (last from host %x), "
- "noPackets %d, noBuffers %d, selects %d, sendSelects %d\n",
- s->socketGreedy, s->bogusPacketOnRead, s->bogusHost,
- s->noPacketOnRead, s->noPacketBuffersOnRead, s->selects,
- s->sendSelects);
- fprintf(file, " packets read: ");
- for (i = 0; i < RX_N_PACKET_TYPES; i++)
- fprintf(file, "%s %d ", rx_packetTypes[i], s->packetsRead[i]);
-
- fprintf(file, "\n");
- fprintf(file,
- " other read counters: data %d, ack %d, dup %d "
- "spurious %d\n", s->dataPacketsRead, s->ackPacketsRead,
- s->dupPacketsRead, s->spuriousPacketsRead);
- fprintf(file, " packets sent: ");
- for (i = 0; i < RX_N_PACKET_TYPES; i++)
- fprintf(file, "%s %d ", rx_packetTypes[i], s->packetsSent[i]);
- fprintf(file, "\n");
- fprintf(file,
- " other send counters: ack %d, data %d (not resends), "
- "resends %d, pushed %d, acked&ignored %d\n", s->ackPacketsSent,
- s->dataPacketsSent, s->dataPacketsReSent, s->dataPacketsPushed,
- s->ignoreAckedPacket);
- fprintf(file,
- " \t(these should be small) sendFailed %lu, "
- "fatalErrors %lu\n",
- (unsigned long)s->netSendFailures,
- (unsigned long)s->fatalErrors);
- if (s->nRttSamples) {
- fprintf(file, " Average rtt is %0.3f, with %d samples\n",
- clock_Float(&s->totalRtt) / s->nRttSamples, s->nRttSamples);
-
- fprintf(file, " Minimum rtt is %0.3f, maximum is %0.3f\n",
- clock_Float(&s->minRtt), clock_Float(&s->maxRtt));
- }
- fprintf(file,
- " %d server connections, %d client connections, %d "
- "peer structs, %d call structs, %d free call structs\n",
- s->nServerConns, s->nClientConns, s->nPeerStructs,
- s->nCallStructs, s->nFreeCallStructs);
- fprintf(file, " %d clock updates\n", clock_nUpdates);
-}
-
-/* for backward compatibility */
-void
-rx_PrintStats(FILE *file)
-{
- rx_PrintTheseStats(file, &rx_stats, sizeof(rx_stats));
-}
-
-void
-rx_PrintPeerStats(FILE *file, struct rx_peer *peer)
-{
- fprintf(file, "Peer %lx.%d. Burst size %d, burst wait %lu.%ld.\n",
- (unsigned long)ntohl(peer->host),
- peer->port,
- peer->burstSize,
- (unsigned long)peer->burstWait.sec,
- (unsigned long)peer->burstWait.usec);
- fprintf(file, " Rtt %lu us, retry time %lu.%06ld, total sent %d, resent %d\n",
- peer->srtt,
- (unsigned long)peer->timeout.sec,
- (long)peer->timeout.usec,
- peer->nSent,
- peer->reSends);
- fprintf(file,
- " Packet size %d, max in packet skew %ld, max out packet "
- "skew %ld\n", peer->packetSize, peer->inPacketSkew,
- peer->outPacketSkew);
-}
-
-#endif /* RXDEBUG */
-
-void
-shutdown_rx(void)
-{
- struct rx_serverQueueEntry *np;
- int i, j;
-
- rxinit_status = 0;
- {
- struct rx_peer **peer_ptr, **peer_end;
-
- for (peer_ptr = &rx_peerHashTable[0],
- peer_end = &rx_peerHashTable[rx_hashTableSize];
- peer_ptr < peer_end; peer_ptr++) {
- struct rx_peer *peer, *next;
-
- for (peer = *peer_ptr; peer; peer = next) {
- next = peer->next;
- rxi_DestroyPeer(peer);
- }
- }
- }
- for (i = 0; i < RX_MAX_SERVICES; i++) {
- if (rx_services[i])
- rxi_Free(rx_services[i], sizeof(*rx_services));
- }
- for (i = 0; i < rx_hashTableSize; i++) {
- struct rx_connection *tc, *ntc;
-
- for (tc = rx_connHashTable[i]; tc; tc = ntc) {
- ntc = tc->next;
- for (j = 0; j < RX_MAXCALLS; j++) {
- if (tc->call[j]) {
- rxi_Free(tc->call[j], sizeof(*(tc->call)));
- }
- }
- rxi_Free(tc, sizeof(tc));
- }
- }
-
- RX_MUTEX_ENTER(&freeSQEList_lock);
-
- while ((np = rx_FreeSQEList) != NULL) {
- rx_FreeSQEList = *(struct rx_serverQueueEntry **) np;
- RX_MUTEX_DESTROY(&np->lock);
- rxi_Free(np, sizeof(np));
- }
-
- RX_MUTEX_EXIT(&freeSQEList_lock);
- RX_MUTEX_DESTROY(&freeSQEList_lock);
- RX_MUTEX_DESTROY(&rx_waitingForPackets_lock);
- RX_MUTEX_DESTROY(&rx_freeCallQueue_lock);
-
- osi_Free(rx_connHashTable,
- rx_hashTableSize * sizeof(struct rx_connection *));
- osi_Free(rx_peerHashTable, rx_hashTableSize * sizeof(struct rx_peer *));
- osi_Free(rx_allocedP, sizeof(struct rx_packet) * rx_nPackets);
-
- UNPIN(rx_connHashTable, rx_hashTableSize * sizeof(struct rx_connection *));
- UNPIN(rx_peerHashTable, rx_hashTableSize * sizeof(struct rx_peer *));
- UNPIN(rx_allocedP, sizeof(struct rx_packet) * rx_nPackets);
-
- rxi_FreeAllPackets();
-
- rxi_dataQuota = RX_MAX_QUOTA;
- rxi_availProcs = rxi_totalMin = rxi_minDeficit = 0;
-}
-
-void *
-rx_getServiceRock(struct rx_service *service)
-{
- return service->serviceRock;
-}
-
-void
-rx_setServiceRock(struct rx_service *service, void *rock)
-{
- service->serviceRock = rock;
-}
diff --git a/usr.sbin/afs/src/rx/rx.h b/usr.sbin/afs/src/rx/rx.h
deleted file mode 100644
index f0641fbb4b2..00000000000
--- a/usr.sbin/afs/src/rx/rx.h
+++ /dev/null
@@ -1,1084 +0,0 @@
-/* $arla: rx.h,v 1.28 2003/01/19 08:49:53 lha Exp $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#ifndef _RX_
-#define _RX_
-
-#ifdef KERNEL
-#include "../rx/rx_machdep.h"
-#include "../rx/rx_kernel.h"
-#include "../rx/rx_clock.h"
-#include "../rx/rx_event.h"
-#include "../rx/rx_queue.h"
-#include "../rx/rx_packet.h"
-#include "../rx/rxgencon.h"
-#else /* KERNEL */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <atypes.h>
-#include <stdio.h>
-#include <sys/param.h>
-#include "rx_mach.h"
-#include "rx_user.h"
-#include "rx_clock.h"
-#include "rx_event.h"
-#include "rx_pkt.h"
-#include "rxgencon.h"
-#endif /* KERNEL */
-
-
-/* Configurable parameters */
-#define RX_IDLE_DEAD_TIME 60 /* default idle dead time */
-#define RX_MAX_SERVICES 20 /* Maximum number of services that may
- * be installed */
-#define RX_DEFAULT_STACK_SIZE 16000 /* Default process stack size;
- * overriden by rx_SetStackSize */
-
-/* This parameter should not normally be changed */
-#define RX_PROCESS_PRIORITY LWP_NORMAL_PRIORITY
-
-/* backoff is fixed point binary. Ie, units of 1/4 seconds */
-#define MAXBACKOFF 0x1F
-
-struct rx_securityClass;
-struct rx_peer;
-
-/* Exported interfaces XXXX clean this up: not all of these are exported */
-int rx_Init(u_short);
-struct rx_service *rx_NewService(u_short, u_short, char *,
- struct rx_securityClass **, int, int32_t (*)());
-struct rx_connection *rx_NewConnection(uint32_t, u_short, u_short,
- struct rx_securityClass *, int);
-struct rx_call *
- rx_NewCall(struct rx_connection *);
-struct rx_call *
- rx_GetCall(void); /* Not normally used, but not obsolete */
-int32_t rx_EndCall(struct rx_call *, int32_t);
-int rx_AllocPackets(void);
-void rx_FreePackets(void);
-int rx_Write(struct rx_call *, const void *, int);
-int rx_Read(struct rx_call *, void *, int);
-void rx_FlushWrite(struct rx_call *);
-
-#ifdef RXDEBUG
-void rx_PrintStats(FILE *);
-#else
-#define rx_PrintStats(a)
-#endif
-void rx_PrintPeerStats(FILE *file, struct rx_peer *peer);
-void rx_SetArrivalProc(struct rx_call * call, void (*proc) (),
- void *handle, void *arg);
-void rx_Finalize(void);
-void rx_StartServer(int);
-void rx_DestroyConnection(struct rx_connection *);
-void rxi_Free(void *, int);
-int rxi_GetCallNumberVector(const struct rx_connection *, int32_t *);
-int rxi_SetCallNumberVector(struct rx_connection *, int32_t *);
-void rx_SetEpoch(uint32_t);
-
-void shutdown_rx(void);
-
-
-
-#define RX_WAIT 1
-#define RX_DONTWAIT 0
-
-#define rx_ConnectionOf(call) ((call)->conn)
-#define rx_PeerOf(conn) ((conn)->peer)
-#define rx_HostOf(peer) ((peer)->host)
-#define rx_PortOf(peer) ((peer)->port)
-#define rx_SetLocalStatus(call, status) ((call)->localStatus = (status))
-#define rx_GetLocalStatus(call, status) ((call)->localStatus)
-#define rx_GetRemoteStatus(call) ((call)->remoteStatus)
-#define rx_SetCallError(call,status) ((call)->error = (status))
-#define rx_GetCallError(call) ((call)->error)
-#define rx_Error(call) ((call)->error)
-#define rx_ConnError(conn) ((conn)->error)
-#define rx_IsServerConn(conn) ((conn)->type == RX_SERVER_CONNECTION)
-#define rx_IsClientConn(conn) ((conn)->type == RX_CLIENT_CONNECTION)
-/* Don't use these; use the IsServerConn style */
-#define rx_ServerConn(conn) ((conn)->type == RX_SERVER_CONNECTION)
-#define rx_ClientConn(conn) ((conn)->type == RX_CLIENT_CONNECTION)
-#define rx_IsUsingPktCksum(conn) ((conn)->flags & \
- RX_CONN_USING_PACKET_CKSUM)
-
-/*
- * Set and get rock is applicable to both connections and calls.
- * It's used by multi rx macros for calls.
- */
-#define rx_SetRock(obj, newrock) ((obj)->rock = (void *)(newrock))
-#define rx_GetRock(obj, type) ((type)(obj)->rock)
-#define rx_ServiceIdOf(conn) ((conn)->serviceId)
-#define rx_SecurityClassOf(conn) ((conn)->securityIndex)
-#define rx_SecurityObjectOf(conn) ((conn)->securityObject)
-
-/*
- * Macros callable by the user to further define attributes of a
- * service. Must be called before rx_StartServer
- */
-
-/*
- * Set the service stack size. This currently just sets the stack
- * size for all processes to be the maximum seen, so far
- */
-#define rx_SetStackSize(service, stackSize) \
- rx_stackSize = (((stackSize) > rx_stackSize)? stackSize: rx_stackSize)
-
-/*
- * Set minimum number of processes guaranteed to be available for this
- * service at all times
- */
-#define rx_SetMinProcs(service, min) ((service)->minProcs = (min))
-
-/*
- * Set maximum number of processes that will be made available to this
- * service (also a guarantee that this number will be made available
- * if there is no competition)
- */
-#define rx_SetMaxProcs(service, max) ((service)->maxProcs = (max))
-
-/*
- * Define a procedure to be called just before a server connection is
- * destroyed
- */
-#define rx_SetDestroyConnProc(service,proc) ((service)->destroyConnProc = (proc))
-
-/* Define procedure to set service dead time */
-#define rx_SetIdleDeadTime(service,time) ((service)->idleDeadTime = (time))
-
-/*
- * Define procedures for getting and setting before and after execute-request
- * procs
- */
-#define rx_SetAfterProc(service,proc) ((service)->afterProc = (proc))
-#define rx_SetBeforeProc(service,proc) ((service)->beforeProc = (proc))
-#define rx_GetAfterProc(service) ((service)->afterProc)
-#define rx_GetBeforeProc(service) ((service)->beforeProc)
-
-/* Define a procedure to be called when a server connection is created */
-#define rx_SetNewConnProc(service, proc) ((service)->newConnProc = (proc))
-
-/*
- * NOTE: We'll probably redefine the following three routines, again,
- * sometime.
- */
-
-/*
- * Set the connection dead time for any connections created for this service
- * (server only)
- */
-#define rx_SetServiceDeadTime(service, seconds) ((service)->secondsUntilDead = (seconds))
-
-/* Set connection dead time, for a specific client or server connection */
-#define rx_SetConnDeadTime(conn, seconds) (rxi_SetConnDeadTime(conn, seconds))
-extern void rxi_SetConnDeadTime(struct rx_connection * conn, int seconds);
-
-/* Set connection hard timeout for a connection */
-#define rx_SetConnHardDeadTime(conn, seconds) ((conn)->hardDeadTime = (seconds))
-
-/*
- * Set rx default connection dead time; set on both services and
- * connections at creation time
- */
-extern int rx_connDeadTime;
-
-#define rx_SetRxDeadTime(seconds) (rx_connDeadTime = (seconds))
-
-extern int rx_nPackets;
-
-#define cpspace(call) \
- ((call)->currentPacket->wirevec[(call)->curvec].iov_len - (call)->curpos)
-#define cppos(call) \
- ((call)->currentPacket->wirevec[(call)->curvec].iov_base + (call)->curpos)
-
-/*
- * This is the maximum size data packet that can be sent on this connection,
- * accounting for security module-specific overheads.
- */
-#define rx_MaxUserDataSize(conn) ((conn)->maxPacketSize - \
- RX_HEADER_SIZE - \
- (conn)->securityHeaderSize - \
- (conn)->securityMaxTrailerSize)
-
-struct rx_securityObjectStats {
- char type; /* 0:unk 1:null,2:vab 3:kad */
- char level;
- char sparec[10]; /* force correct alignment */
- uint32_t flags; /* 1=>unalloc, 2=>auth, 4=>expired */
- uint32_t expires;
- uint32_t packetsReceived;
- uint32_t packetsSent;
- uint32_t bytesReceived;
- uint32_t bytesSent;
- uint16_t spares[4];
- uint32_t sparel[8];
-};
-
-/*
- * XXXX (rewrite this description) A security class object contains a set of
- * procedures and some private data to implement a security model for rx
- * connections. These routines are called by rx as appropriate. Rx knows
- * nothing about the internal details of any particular security model, or
- * about security state. Rx does maintain state per connection on behalf of
- * the security class. Each security class implementation is also expected to
- * provide routines to create these objects. Rx provides a basic routine to
- * allocate one of these objects; this routine must be called by the class.
- */
-struct rx_securityClass {
- struct rx_securityOps {
- int (*op_Close) ( /* obj */ );
- int (*op_NewConnection) ( /* obj, conn */ );
- int (*op_PreparePacket) ( /* obj, call, packet */ );
- int (*op_SendPacket) ( /* obj, call, packet */ );
- int (*op_CheckAuthentication) ( /* obj,conn */ );
- int (*op_CreateChallenge) ( /* obj,conn */ );
- int (*op_GetChallenge) ( /* obj,conn,packet */ );
- int (*op_GetResponse) ( /* obj,conn,packet */ );
- int (*op_CheckResponse) ( /* obj,conn,packet */ );
- int (*op_CheckPacket) ( /* obj,call,packet */ );
- int (*op_DestroyConnection) ( /* obj, conn */ );
- int (*op_GetStats) ( /* obj, conn, stats */ );
- int (*op_NewService) ( /* obj, service */ );
- int (*op_Spare2) ();
- int (*op_Spare3) ();
- } *ops;
- void *privateData;
- int refCount;
-};
-
-#if defined(__STDC__) && !defined(__HIGHC__)
-#define RXS_OP(obj,op,args) ((obj->ops->op_ ## op) ? \
- (*(obj)->ops->op_ ## op)args : 0)
-#else
-#define RXS_OP(obj,op,args) ((obj->ops->op_/**/op) ? \
- (*(obj)->ops->op_/**/op)args : 0)
-#endif
-
-#define RXS_Close(obj) RXS_OP(obj,Close,(obj))
-#define RXS_NewConnection(obj,conn) RXS_OP(obj,NewConnection,(obj,conn))
-#define RXS_PreparePacket(obj,call,packet) RXS_OP(obj,PreparePacket,\
- (obj,call,packet))
-#define RXS_SendPacket(obj,call,packet) RXS_OP(obj,SendPacket,\
- (obj,call,packet))
-#define RXS_CheckAuthentication(obj,conn) RXS_OP(obj,CheckAuthentication,\
- (obj,conn))
-#define RXS_CreateChallenge(obj,conn) RXS_OP(obj,CreateChallenge,\
- (obj,conn))
-#define RXS_GetChallenge(obj,conn,packet) RXS_OP(obj,GetChallenge,\
- (obj,conn,packet))
-#define RXS_GetResponse(obj,conn,packet) RXS_OP(obj,GetResponse,\
- (obj,conn,packet))
-#define RXS_CheckResponse(obj,conn,packet) RXS_OP(obj,CheckResponse,\
- (obj,conn,packet))
-#define RXS_CheckPacket(obj,call,packet) RXS_OP(obj,CheckPacket,\
- (obj,call,packet))
-#define RXS_DestroyConnection(obj,conn) RXS_OP(obj,DestroyConnection,\
- (obj,conn))
-#define RXS_GetStats(obj,conn,stats) RXS_OP(obj,GetStats,\
- (obj,conn,stats))
-#define RXS_NewService(obj,service,reuse) RXS_OP(obj,NewService,\
- (obj,service,reuse))
-
-int
-rxs_Release(struct rx_securityClass *aobj);
-
-/*
- * A service is installed by rx_NewService, and specifies a service type that
- * is exported by this process. Incoming calls are stamped with the service
- * type, and must match an installed service for the call to be accepted.
- * Each service exported has a (port,serviceId) pair to uniquely identify it.
- * It is also named: this is intended to allow a remote statistics gathering
- * program to retrieve per service statistics without having to know the local
- * service id's. Each service has a number of security objects (instances of
- * security classes) which implement various types of end-to-end security
- * protocols for connections made to this service. Finally, there are two
- * parameters controlling the number of requests which may be executed in
- * parallel by this service: minProcs is the number of requests to this
- * service which are guaranteed to be able to run in parallel at any time;
- * maxProcs has two meanings: it limits the total number of requests which may
- * execute in parallel and it also guarantees that that many requests
- * may be handled in parallel if no other service is handling any
- * requests.
- */
-
-struct rx_service {
- uint16_t serviceId; /* Service number */
- uint16_t servicePort; /* UDP port for this service */
- char *serviceName; /* Name of the service */
- osi_socket socket; /* socket struct or file descriptor */
- u_short nRequestsRunning; /*
- * Number of requests currently in
- * progress
- */
- u_short nSecurityObjects; /* Number of entries in security
- * objects array */
- struct rx_securityClass **securityObjects; /*
- * Array of security class
- * objects
- */
- int32_t (*executeRequestProc) (struct rx_call *);
- /* Routine to call when an rpc request
- * is received */
- void (*destroyConnProc) (); /* Routine to call when a server
- * connection is destroyed */
- void (*newConnProc) (); /*
- * Routine to call when a server
- * connection is created
- */
- void (*beforeProc) (); /* routine to call before a call is
- * executed */
- void (*afterProc) (); /* routine to call after a call is
- * executed */
- u_short maxProcs; /* Maximum procs to be used for this
- * service */
- u_short minProcs; /* Minimum # of requests guaranteed
- * executable simultaneously */
- u_short connDeadTime; /*
- * Secs until a client of this service
- * will be declared dead, if it is not
- * responding
- */
- u_short idleDeadTime; /*
- * Time a server will wait for I/O to
- * start up again
- */
- void *serviceRock; /* Rock for service */
-};
-
-void * rx_getServiceRock(struct rx_service *);
-void rx_setServiceRock(struct rx_service *, void *);
-
-/*
- * A server puts itself on an idle queue for a service using an
- * instance of the following structure. When a call arrives, the call
- * structure pointer is placed in "newcall", the routine to execute to
- * service the request is placed in executeRequestProc, and the
- * process is woken up. The queue entry's address is used for the
- * sleep/wakeup.
- */
-struct rx_serverQueueEntry {
- struct rx_queue queueItemHeader;
- struct rx_call *newcall;
-#ifdef RX_ENABLE_LOCKS
- kmutex_t lock;
- kcondvar_t cv;
-#endif
-};
-
-/* Bottom n-bits of the Call Identifier give the call number */
-#define RX_MAXCALLS 4 /* Power of 2; max async calls per
- * connection */
-#define RX_CIDSHIFT 2 /* Log2(RX_MAXCALLS) */
-#define RX_CHANNELMASK (RX_MAXCALLS-1)
-#define RX_CIDMASK (~RX_CHANNELMASK)
-
-/*
- * A peer refers to a peer process, specified by a (host,port) pair.
- * There may be more than one peer on a given host.
- */
-struct rx_peer {
- struct rx_peer *next; /* Next in hash conflict or free list */
- struct rx_queue connQueue; /* a list of all conn use this peer */
- uint32_t host; /* Remote IP address, in net byte
- * order */
- uint16_t port; /* Remote UDP port, in net byte order */
- u_short packetSize; /*
- * Max packet size, if known, for this
- * host
- */
-
- /* For garbage collection */
- u_long idleWhen; /* When the refcountwent to zero */
- short refCount; /* Reference count for this structure */
-
- /* Congestion control parameters */
- u_char burstSize; /*
- * Reinitialization size for the burst
- * parameter
- */
- u_char burst; /* Number of packets that can be
- * transmitted right now, without
- * pausing */
- struct clock burstWait; /* Delay until new burst is allowed */
- struct rx_queue congestionQueue; /*
- * Calls that are waiting for non-zero
- * burst value
- */
- u_long srtt; /* Smoothed RTT in us. */
- u_long mdev; /* Smoothed mean deviation of RTT (us)*/
-
- struct clock timeout; /* Current retransmission delay */
- int nSent; /*
- * Total number of distinct data packets
- * sent, not including retransmissions
- */
- int reSends; /*
- * Total number of retransmissions for
- * this peer, since this structure was
- * created
- */
-
-/*
- * Skew: if a packet is received N packets later than expected (based
- * on packet serial numbers), then we define it to have a skew of N.
- * The maximum skew values allow us to decide when a packet hasn't
- * been received yet because it is out-of-order, as opposed to when it
- * is likely to have been dropped.
- */
- u_long inPacketSkew; /* Maximum skew on incoming packets */
- u_long outPacketSkew; /* Peer-reported max skew on our sent
- * packets */
- int rateFlag; /* Flag for rate testing (-no 0yes
- * +decrement) */
- u_short maxWindow; /* Maximum window size (number of
- * packets) */
- u_short spare; /*
- * we have to manually align things
- * b/c 220s crash
- */
-};
-
-/*
- * A connection is an authenticated communication path, allowing
- * limited multiple asynchronous conversations.
- */
-struct rx_connection {
- struct rx_queue queue_item; /* conns on same peer */
- struct rx_connection *next; /* on hash chain _or_ free list */
- struct rx_peer *peer;
-#ifdef RX_ENABLE_LOCKS
- kmutex_t lock;
- kcondvar_t cv;
-#endif
- uint32_t epoch; /* Process start time of client side
- * of connection */
- uint32_t cid; /* Connection id (call channel is
- * bottom bits) */
- uint32_t error; /* If this connection is in error,
- * this is it */
- void *rock; /* User definable */
- struct rx_call *call[RX_MAXCALLS];
- uint32_t callNumber[RX_MAXCALLS]; /* Current call numbers */
- uint32_t serial; /* Next outgoing packet serial number */
- uint32_t lastSerial; /* # of last packet received, for
- * computing skew */
- uint32_t maxSerial; /* largest serial number seen on
- * incoming packets */
- uint32_t maxPacketSize; /*
- * max packet size should be
- * per-connection since peer process
- * could be restarted on us.
- */
- struct rxevent *challengeEvent; /* Scheduled when the server is
- * challenging a client-- to
- * retransmit the challenge */
- struct rx_service *service; /* used by servers only */
- u_short serviceId; /* To stamp on requests, clients only */
- short refCount; /* Reference count */
- u_char flags; /* Defined below */
- u_char type; /* Type of connection, defined below */
- u_char secondsUntilPing; /* how often to ping for each active
- * call */
- u_char securityIndex; /* corresponds to the security class
- * of the */
- /* securityObject for this conn */
- struct rx_securityClass *securityObject; /*
- * Security object for this
- * connection
- */
- void *securityData; /* Private data for this conn's
- * security class */
- u_short securityHeaderSize; /*
- * Length of security module's packet
- * header data
- */
- u_short securityMaxTrailerSize; /*
- * Length of security module's packet
- * trailer data
- */
- int timeout; /*
- * Overall timeout per call (seconds)
- * for this conn
- */
- int lastSendTime; /* Last send time for this connection */
- u_short secondsUntilDead; /*
- * Maximum silence from peer before
- * RX_CALL_DEAD
- */
- u_short hardDeadTime; /* hard max for call execution */
-};
-
-/* Flag bits for connection structure */
-#define RX_CONN_MAKECALL_WAITING 1 /* rx_NewCall is waiting for a
- * channel */
-#define RX_CONN_DESTROY_ME 2 /*
- * Destroy *client* connection after
- * last call
- */
-#define RX_CONN_USING_PACKET_CKSUM 4 /* non-zero header.spare field seen */
-#define RX_CONN_BIG_ONES 8 /*
- * may use packets > 1500 bytes
- * (compatibility)
- */
-
-
-/* Type of connection, client or server */
-#define RX_CLIENT_CONNECTION 0
-#define RX_SERVER_CONNECTION 1
-
-/*
- * Call structure: only instantiated for active calls and dallying server
- * calls. The permanent call state (i.e. the call number as well as state
- * shared with other calls associated with this connection) is maintained
- * in the connection structure.
- */
-struct rx_call {
- struct rx_queue queue_item_header; /*
- * Call can be on various queues
- * (one-at-a-time)
- */
- struct rx_queue tq; /* Transmit packet queue */
- struct rx_queue rq; /* Receive packet queue */
-#ifdef RX_ENABLE_LOCKS
- kmutex_t lock;
- kmutex_t lockw;
- kcondvar_t cv_twind;
- kmutex_t lockq;
- kcondvar_t cv_rq;
-#endif
- struct rx_connection *conn; /* Parent connection for this call */
- uint32_t *callNumber; /*
- * Pointer to call number field
- * within connection
- */
-#if 0
- char *bufPtr; /*
- * Next byte to fill or read in current
- * send/read packet
- */
-#endif
- u_short nLeft; /*
- * Number of bytes left in first receive
- * queue packet
- */
- struct rx_packet *currentPacket; /*
- * Current packet being assembled or
- * being read
- */
- u_short curvec; /* current iovec in currentPacket */
- u_short curpos; /* current position within curvec */
- u_short nFree; /* Number of bytes free in last send
- * packet */
- u_char channel; /* Index of call, within connection */
- u_char state; /* Current call state as defined below */
- u_char mode; /* Current mode of a call in ACTIVE
- * state */
- u_char flags; /* Some random flags */
- u_char localStatus; /* Local user status sent out of band */
- u_char remoteStatus; /* Remote user status received out of
- * band */
- int32_t error; /* Error condition for this call */
- u_long timeout; /* High level timeout for this call */
- uint32_t rnext; /*
- * Next sequence number expected to be
- * read by rx_ReadData
- */
- uint32_t rprev; /*
- * Previous packet received; used for
- * deciding what the next packet to be
- * received should be in order to decide
- * whether a negative acknowledge should
- * be sent
- */
- u_long rwind; /*
- * The receive window: the peer must
- * not send packets with sequence
- * numbers >= rnext+rwind
- */
- uint32_t tfirst; /*
- * First unacknowledged transmit packet
- * number
- */
- uint32_t tnext; /* Next transmit sequence number to
- * use */
- u_long twind; /*
- * The transmit window: we cannot
- * assign a sequence number to a
- * packet >= tfirst + twind
- */
-#if SOFT_ACK
- u_short nSoftAcks; /* The number of delayed soft acks */
- u_short nHardAcks; /* The number of delayed hard acks */
-#endif
-#if 0
- u_short cwind; /* The congestion window */
- u_short nextCwind; /* The congestion window after recovery */
- u_short nCwindAcks; /* Number acks received at current cwind */
- u_short ssthresh; /* The slow start threshold */
- u_short nAcks; /* The number of consecttive acks */
- u_short nNacks; /* Number packets acked that follow the
- * first negatively acked packet */
- u_short congestSeq; /* Peer's congestion sequence counter */
-#endif
- struct rxevent *resendEvent; /*
- * If this is non-Null, there is a
- * retransmission event pending
- */
- struct rxevent *timeoutEvent; /*
- * If this is non-Null, then there is an
- * overall timeout for this call
- */
- struct rxevent *keepAliveEvent; /*
- * Scheduled periodically in active
- * calls to keep call alive
- */
- struct rxevent *delayedAckEvent; /*
- * Scheduled after all packets are
- * received to send an ack if a reply
- * or new call is not generated soon
- */
- int lastSendTime; /* Last time a packet was sent on this
- * call */
- int lastReceiveTime; /* Last time a packet was received for
- * this call */
- void (*arrivalProc) (); /* Procedure to call when reply is
- * received */
- void *arrivalProcHandle; /* Handle to pass to replyFunc */
- void *arrivalProcArg; /* Additional arg to pass to reply
- * Proc */
- u_long lastAcked; /* last packet "hard" acked by
- * receiver */
- u_long startTime; /* time the call started running */
- u_long startWait; /*
- * time server began waiting for
- * input data/send quota
- */
- struct clock traceWait; /*
- * time server began waiting for input
- * data/send quota
- */
- struct clock traceStart; /* time the call started running */
-};
-
-/* Major call states */
-#define RX_STATE_NOTINIT 0 /* Call structure has never been
- * initialized */
-#define RX_STATE_PRECALL 1 /*
- * Server-only: call is not in
- * progress, but packets have arrived
- */
-#define RX_STATE_ACTIVE 2 /*
- * An active call; a process is dealing
- * with this call
- */
-#define RX_STATE_DALLY 3 /* Dallying after process is done with
- * call */
-
-/*
- * Call modes: the modes of a call in RX_STATE_ACTIVE state (process attached)
- */
-#define RX_MODE_SENDING 1 /* Sending or ready to send */
-#define RX_MODE_RECEIVING 2 /* Receiving or ready to receive */
-#define RX_MODE_ERROR 3 /* Something in error for current
- * conversation */
-#define RX_MODE_EOF 4 /*
- * Server has flushed (or client has
- * read) last reply packet
- */
-
-/* Flags */
-#define RX_CALL_READER_WAIT 1 /* Reader is waiting for next packet */
-#define RX_CALL_WAIT_WINDOW_ALLOC 2 /*
- * Sender is waiting for window to
- * allocate buffers
- */
-#define RX_CALL_WAIT_WINDOW_SEND 4 /*
- * Sender is waiting for window to
- * send buffers
- */
-#define RX_CALL_WAIT_PACKETS 8 /*
- * Sender is waiting for packet buffers
- */
-#define RX_CALL_WAIT_PROC 16 /*
- * Waiting for a process to be assigned
- */
-#define RX_CALL_RECEIVE_DONE 32 /* All packets received on this call */
-#define RX_CALL_CLEARED 64 /*
- * Receive queue cleared in precall
- * state
- */
-#define RX_CALL_TQ_BUSY 128 /*
- * Call's Xmit Queue is busy;
- * don't modify
- */
-
-#define RX_CALL_SLOW_START_OK 0x2000 /* receiver support slow start */
-
-/* Maximum number of acknowledgements in an acknowledge packet */
-#define RX_MAXACKS 255
-
-/*
- * The structure of the data portion of an acknowledge packet: An acknowledge
- * packet is in network byte order at all times. An acknowledgement is always
- * prompted for a specific reason by a specific incoming packet. This reason
- * is reported in "reason" and the packet's sequence number in the packet
- * header.seq. In addition to this information, all of the current
- * acknowledgement information about this call is placed in the packet.
- * "FirstPacket" is the sequence number of the first packet represented in an
- * array of bytes, "acks", containing acknowledgement information for a number
- * of consecutive packets. All packets prior to FirstPacket are implicitly
- * acknowledged: the sender need no longer be concerned about them. Packets
- * from firstPacket+nAcks and on are not acknowledged. Packets in the range
- * [firstPacket,firstPacket+nAcks) are each acknowledged explicitly. The
- * acknowledgement may be RX_NACK if the packet is not (currently) at the
- * receiver (it may have never been received, or received and then later
- * dropped), or it may be RX_ACK if the packet is queued up waiting to be read
- * by the upper level software. RX_ACK does not imply that the packet may not
- * be dropped before it is read; it does imply that the sender should stop
- * retransmitting the packet until notified otherwise. The field
- * previousPacket identifies the previous packet received by the peer. This
- * was used in a previous version of this software, and could be used in the
- * future. The serial number in the data part of the ack packet corresponds to
- * the serial number oof the packet which prompted the acknowledge. Any
- * packets which are explicitly not acknowledged, and which were last
- * transmitted with a serial number less than the provided serial number,
- * should be retransmitted immediately. Actually, this is slightly inaccurate:
- * packets are not necessarily received in order. When packets are habitually
- * transmitted out of order, this is allowed for in the retransmission
- * algorithm by introducing the notion of maximum packet skew: the degree of
- * out-of-orderness of the packets received on the wire. This number is
- * communicated from the receiver to the sender in ack packets.
- */
-
-struct rx_ackPacket {
- uint16_t bufferSpace; /*
- * Number of packet buffers available.
- * That is: the number of buffers that
- * the sender of the ack packet is
- * willing to provide for data,
- * on this or subsequent calls. Lying is
- * permissable.
- */
- uint16_t maxSkew; /*
- * Maximum difference between serial# of
- * packet acknowledged and highest
- * packet yet received
- */
- uint32_t firstPacket; /*
- * The first packet in the list of
- * acknowledged packets
- */
- uint32_t previousPacket; /*
- * The previous packet number received
- * (obsolete?)
- */
- uint32_t serial; /*
- * Serial number of the packet which
- * prompted the acknowledge
- */
- u_char reason; /*
- * Reason for the acknowledge of
- * ackPacket, defined below
- */
- u_char nAcks; /* Number of acknowledgements */
- u_char acks[RX_MAXACKS]; /*
- * Up to RX_MAXACKS packet ack's,
- * defined below
- */
- /*
- * Packets <firstPacket are implicitly acknowledged and may be discarded
- * by the sender. Packets >= firstPacket+nAcks are implicitly NOT
- * acknowledged. No packets with sequence numbers >= firstPacket should
- * be discarded by the sender (they may thrown out at any time by the
- * receiver)
- */
-};
-
-#define FIRSTACKOFFSET 4
-
-/* Reason for acknowledge message */
-#define RX_ACK_REQUESTED 1 /* Peer requested an ack on this
- * packet */
-#define RX_ACK_DUPLICATE 2 /* Duplicate packet */
-#define RX_ACK_OUT_OF_SEQUENCE 3 /* Packet out of sequence */
-#define RX_ACK_EXCEEDS_WINDOW 4 /*
- * Packet sequence number higher than
- * window; discarded
- */
-#define RX_ACK_NOSPACE 5 /* No buffer space at all */
-#define RX_ACK_PING 6 /* This is a keep-alive ack */
-#define RX_ACK_PING_RESPONSE 7 /* Ack'ing because we were pinged */
-#define RX_ACK_DELAY 8 /*
- * Ack generated since nothing has
- * happened since receiving packet
- */
-#define RX_ACK_IDLE 9 /* */
-
-/* Packet acknowledgement type */
-#define RX_ACK_TYPE_NACK 0 /* I Don't have this packet */
-#define RX_ACK_TYPE_ACK 1 /*
- * I have this packet, although I may
- * discard it later
- */
-
-/*
- * The packet size transmitted for an acknowledge is adjusted to reflect the
- * actual size of the acks array. This macro defines the size
- */
-#define rx_AckDataSize(nAcks) (18 + (nAcks))
-
-#define RX_CHALLENGE_TIMEOUT 2 /*
- * Number of seconds before another
- * authentication request packet is
- * generated
- */
-
-/*
- * RX error codes. RX uses error codes from -1 to -64. Rxgen may use other
- * error codes < -64; user programs are expected to return positive error
- * codes
- */
-
-/* Min rx error */
-#define RX_MIN_ERROR (-1)
-
-/* Something bad happened to the connection; temporary loss of communication */
-#define RX_CALL_DEAD (-1)
-
-/*
- * An invalid operation, such as a client attempting to send data after
- * having received the beginning of a reply from the server
- */
-#define RX_INVALID_OPERATION (-2)
-
-/* An optional timeout per call may be specified */
-#define RX_CALL_TIMEOUT (-3)
-
-/* End of data on a read */
-#define RX_EOF (-4)
-
-/* Some sort of low-level protocol error */
-#define RX_PROTOCOL_ERROR (-5)
-
-/*
- * Generic user abort code; used when no more specific error code needs to
- * be communicated. For example, multi rx clients use this code to abort a
- * multi rx call
- */
-#define RX_USER_ABORT (-6)
-
-/* Port already in use (from rx_Init) */
-#define RX_ADDRINUSE (-7)
-
-/* EMSGSIZE returned from network. Packet too big, must fragment */
-#define RX_MSGSIZE (-8)
-
-/*
- *Not on wire, when CheckResponse/GetResponse return this,
- * packet should be sent.
- */
-#define RX_AUTH_REPLY (-63)
-
-/* Max rx error */
-#define RX_MAX_ERROR (-64)
-
-/*
- * Structure for keeping rx statistics. Note that this structure is returned
- * by rxdebug, so, for compatibility reasons, new fields should be appended (or
- * spares used), the rxdebug protocol checked, if necessary, and the PrintStats
- * code should be updated as well.
- *
- * Clearly we assume that ntohl will work on these structures so sizeof(int)
- * must equal sizeof(long).
- */
-
-struct rx_stats { /* General rx statistics */
- uint32_t packetRequests; /* Number of packet allocation
- * requests */
- uint32_t noPackets[RX_N_PACKET_CLASSES];/*
- * Number of failed packet requests,
- * per allocation class
- */
- uint32_t socketGreedy; /* Whether SO_GREEDY succeeded */
- uint32_t bogusPacketOnRead; /*
- * Number of inappropriately short
- * packets received
- */
- uint32_t bogusHost; /* Host address from bogus packets */
- uint32_t noPacketOnRead; /*
- * Number of read packets attempted
- * when there was actually no packet
- * to read off the wire
- */
- uint32_t noPacketBuffersOnRead; /*
- * Number of dropped data packets due
- * to lack of packet buffers
- */
- uint32_t selects; /*
- * Number of selects waiting for packet
- * or timeout
- */
- uint32_t sendSelects; /*
- * Number of selects forced when
- * sending packet
- */
- uint32_t packetsRead[RX_N_PACKET_TYPES];/*
- * Total number of packets read, per
- * type
- */
- uint32_t dataPacketsRead; /*
- * Number of unique data packets read
- * off the wire
- */
- uint32_t ackPacketsRead; /* Number of ack packets read */
- uint32_t dupPacketsRead; /* Number of duplicate data packets
- * read */
- uint32_t spuriousPacketsRead; /* Number of inappropriate data
- * packets */
- uint32_t packetsSent[RX_N_PACKET_TYPES];/*
- * Number of rxi_Sends: packets sent
- * over the wire, per type
- */
- uint32_t ackPacketsSent; /* Number of acks sent */
- uint32_t pingPacketsSent; /* Total number of ping packets sent */
- uint32_t abortPacketsSent; /* Total number of aborts */
- uint32_t busyPacketsSent; /* Total number of busies sent
- * received */
- uint32_t dataPacketsSent; /* Number of unique data packets sent */
- uint32_t dataPacketsReSent; /* Number of retransmissions */
- uint32_t dataPacketsPushed; /*
- * Number of retransmissions pushed early by
- * a NACK
- */
- uint32_t ignoreAckedPacket; /*
- * Number of packets with acked flag,
- * on rxi_Start
- */
- struct clock totalRtt; /*
- * Total round trip time measured
- * (use to compute average)
- */
- struct clock minRtt; /* Minimum round trip time measured */
- struct clock maxRtt; /* Maximum round trip time measured */
- uint32_t nRttSamples; /* Total number of round trip samples */
- uint32_t nServerConns; /* Total number of server connections */
- uint32_t nClientConns; /* Total number of client connections */
- uint32_t nPeerStructs; /* Total number of peer structures */
- uint32_t nCallStructs; /* Total number of call structures
- * allocated */
- uint32_t nFreeCallStructs; /*
- * Total number of previously allocated
- * free call structures
- */
- uint32_t netSendFailures;
- uint32_t fatalErrors;
- uint32_t spares[8];
-};
-
-void rx_PrintTheseStats(FILE *file, struct rx_stats *s, int size);
-
-/* structures for debug input and output packets */
-
-/* debug input types */
-struct rx_debugIn {
- uint32_t type;
- uint32_t index;
-};
-
-/* Invalid rx debug package type */
-#define RX_DEBUGI_BADTYPE (-8)
-
-#define RX_DEBUGI_VERSION_MINIMUM ('L')/* earliest real version */
-#define RX_DEBUGI_VERSION ('N') /* Latest version */
- /* first version w/ secStats */
-#define RX_DEBUGI_VERSION_W_SECSTATS ('L')
- /* version M is first supporting GETALLCONN and RXSTATS type */
-#define RX_DEBUGI_VERSION_W_GETALLCONN ('M')
-#define RX_DEBUGI_VERSION_W_RXSTATS ('M')
- /* last version with unaligned debugConn */
-#define RX_DEBUGI_VERSION_W_UNALIGNED_CONN ('L')
-#define RX_DEBUGI_VERSION_W_WAITERS ('N')
-
-#define RX_DEBUGI_GETSTATS 1 /* get basic rx stats */
-#define RX_DEBUGI_GETCONN 2 /* get connection info */
-#define RX_DEBUGI_GETALLCONN 3 /* get even uninteresting conns */
-#define RX_DEBUGI_RXSTATS 4 /* get all rx stats */
-
-struct rx_debugStats {
- uint32_t nFreePackets;
- uint32_t packetReclaims;
- uint32_t callsExecuted;
- uint8_t waitingForPackets;
- uint8_t usedFDs;
- uint8_t version;
- uint8_t spare1;
- uint32_t nWaiting;
- uint32_t spare2[9];
-};
-
-struct rx_debugConn_vL {
- uint32_t host;
- uint32_t cid;
- uint32_t serial;
- uint32_t callNumber[RX_MAXCALLS];
- uint32_t error;
- uint16_t port;
- char flags;
- char type;
- char securityIndex;
- char callState[RX_MAXCALLS];
- char callMode[RX_MAXCALLS];
- char callFlags[RX_MAXCALLS];
- char callOther[RX_MAXCALLS];
- /* old style getconn stops here */
- struct rx_securityObjectStats secStats;
- uint32_t sparel[10];
-};
-
-struct rx_debugConn {
- uint32_t host;
- uint32_t cid;
- uint32_t serial;
- uint32_t callNumber[RX_MAXCALLS];
- uint32_t error;
- uint16_t port;
- char flags;
- char type;
- char securityIndex;
- char sparec[3]; /* force correct alignment */
- char callState[RX_MAXCALLS];
- char callMode[RX_MAXCALLS];
- char callFlags[RX_MAXCALLS];
- char callOther[RX_MAXCALLS];
- /* old style getconn stops here */
- struct rx_securityObjectStats secStats;
- uint32_t epoch;
- uint32_t maxPacketSize;
- uint32_t sparel[9];
-};
-
-#define RX_OTHER_IN 1 /* packets avail in in queue */
-#define RX_OTHER_OUT 2 /* packets avail in out queue */
-
-#endif /* _RX_ End of rx.h */
diff --git a/usr.sbin/afs/src/rx/rx_clock.c b/usr.sbin/afs/src/rx/rx_clock.c
deleted file mode 100644
index d27ec59538f..00000000000
--- a/usr.sbin/afs/src/rx/rx_clock.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/* Elapsed time package */
-
-#include "rx_locl.h"
-
-RCSID("$arla: rx_clock.c,v 1.15 2000/11/26 22:29:28 lha Exp $");
-
-#ifndef KERNEL
-
-struct clock clock_now;
-
-int clock_haveCurrentTime;
-
-int clock_nUpdates;
-
-/* Magic tdiff that guarantees a monotonically increasing clock value. */
-static struct clock tdiff;
-
-void
-clock_Init(void)
-{
- struct timeval tv;
-
- gettimeofday(&tv, 0);
- tdiff.sec = tv.tv_sec;
- tdiff.usec = tv.tv_usec;
- clock_now.sec = clock_now.usec = 0;
- clock_haveCurrentTime = 1;
- clock_nUpdates = 0;
-}
-
-/* Refresh value of clock_now. */
-void
-clock_UpdateTime(void)
-{
- struct timeval tv;
- struct clock t;
-
- gettimeofday(&tv, 0);
- t.sec = tv.tv_sec;
- t.usec = tv.tv_usec;
- clock_Sub(&t, &tdiff);
-
- /* We can't have time running backwards!!! */
- if (clock_Le(&t, &clock_now))
- {
- /* Calculate new tdiff. */
- t.sec = tv.tv_sec;
- t.usec = tv.tv_usec;
- clock_Sub(&t, &clock_now);
- tdiff.sec = t.sec;
- tdiff.usec = t.usec;
-
- /* Fake new time. */
- t.sec = tv.tv_sec;
- t.usec = tv.tv_usec;
- clock_Sub(&t, &tdiff);
- t.usec++;
- if (t.usec >= 1000000)
- {
- t.sec += 1;
- t.usec = 0;
- }
- }
-
- clock_now = t;
- clock_haveCurrentTime = 1;
- clock_nUpdates++;
-}
-
-void
-clock_ReInit(void)
-{
-}
-
-#endif /* KERNEL */
diff --git a/usr.sbin/afs/src/rx/rx_clock.h b/usr.sbin/afs/src/rx/rx_clock.h
deleted file mode 100644
index 1184205d4a6..00000000000
--- a/usr.sbin/afs/src/rx/rx_clock.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/* $arla: rx_clock.h,v 1.5 2002/01/22 05:53:29 lha Exp $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/* Elapsed time package
- *
- * A time package that make sure time never goes backwards
- */
-
-#ifndef _CLOCK_
-#define _CLOCK_
-
-#ifdef KERNEL
-#if defined(AFS_AIX_ENV) || defined(AFS_AUX_ENV)
-#include "../h/systm.h"
-#include "../h/time.h"
-#endif /* System V */
-#else /* KERNEL */
-#ifndef ITIMER_REAL
-#include <sys/time.h>
-#endif /* ITIMER_REAL */
-#endif /* KERNEL */
-
-/*
- * Some macros to make macros more reasonable (this allows a block to
- * be used within a macro which does not cause if statements to screw
- * up). That is, you can use "if (...) macro_name(); else ...;"
- * without having things blow up on the semi-colon.
- */
-
-#ifndef BEGIN
-#define BEGIN do {
-#define END } while(0)
-#endif
-
-/* A clock value is the number of seconds and microseconds that have elapsed since calling clock_Init. */
-struct clock {
- long sec; /* Seconds since clock_Init */
- long usec; /* Microseconds since clock_Init */
-};
-
-#ifndef KERNEL
-
-/* For internal use. The last value returned from clock_GetTime() */
-extern struct clock clock_now;
-
-/* For internal use: this flag, if set, indicates a new time should be read by clock_getTime() */
-
-extern int clock_haveCurrentTime;
-
-/* For external use: the number of times the clock value is actually updated */
-extern int clock_nUpdates;
-
-/* Initialize the clock package */
-void clock_Init (void);
-
-/* Restart the interval timer */
-void clock_ReInit(void);
-
-#define clock_NewTime() (clock_haveCurrentTime = 0)
-
-/* Update the value to be returned by gettime */
-void clock_UpdateTime (void);
-
-/* Return the current clock time. If the clock value has not been updated since the last call to clock_NewTime, it is updated now */
-#define clock_GetTime(cv) \
- BEGIN \
- if (!clock_haveCurrentTime) clock_UpdateTime(); \
- (cv)->sec = clock_now.sec; \
- (cv)->usec = clock_now.usec; \
- END
-
-/* Current clock time, truncated to seconds */
-#define clock_Sec() ((!clock_haveCurrentTime)? clock_UpdateTime(), clock_now.sec:clock_now.sec)
-
-#else /* KERNEL */
-
-#define clock_Init()
-#define clock_GetTime(cv) osi_GetTime((struct timeval *)cv) /* Bogus--uses TOD clock */
-#define clock_Sec() osi_Time()
-#define clock_NewTime() /* don't do anything; clock is fast
- * enough in kernel */
-#endif /* KERNEL */
-
-/* Returns the elapsed time in milliseconds between clock values (*cv1) and (*cv2) */
-#define clock_ElapsedTime(cv1, cv2) \
- (((cv2)->sec - (cv1)->sec)*1000 + ((cv2)->usec - (cv1)->usec)/1000)
-
-/* Advance the known value of the current clock time (clock_now) by the specified clock value */
-#define clock_Advance(cv) clock_Add(&clock_now, cv)
-
-/* Some comparison operators for clock values */
-#define clock_Gt(a, b) ((a)->sec>(b)->sec || ((a)->sec==(b)->sec && (a)->usec>(b)->usec))
-#define clock_Ge(a, b) ((a)->sec>(b)->sec || ((a)->sec==(b)->sec && (a)->usec>=(b)->usec))
-#define clock_Eq(a, b) ((a)->sec==(b)->sec && (a)->usec==(b)->usec)
-#define clock_Le(a, b) ((a)->sec<(b)->sec || ((a)->sec==(b)->sec && (a)->usec<=(b)->usec))
-#define clock_Lt(a, b) ((a)->sec<(b)->sec || ((a)->sec==(b)->sec && (a)->usec<(b)->usec))
-
-/* Is the clock value zero? */
-#define clock_IsZero(c) ((c)->sec == 0 && (c)->usec == 0)
-
-/* Set the clock value to zero */
-#define clock_Zero(c) ((c)->sec = (c)->usec = 0)
-
-/* Add time c2 to time c1. Both c2 and c1 must be positive times. */
-#define clock_Add(c1, c2) \
- BEGIN \
- if (((c1)->usec += (c2)->usec) >= 1000000) { \
- (c1)->usec -= 1000000; \
- (c1)->sec++; \
- } \
- (c1)->sec += (c2)->sec; \
- END
-
-#define MSEC(cp) ((cp->sec * 1000) + (cp->usec / 1000))
-
-/* Add ms milliseconds to time c1. Both ms and c1 must be positive */
-/* optimized for ms << 1000 */
-#define clock_Addmsec(c1, ms) \
- BEGIN \
- (c1)->usec += ((unsigned long) (ms)) * 1000; \
- while ((c1)->usec >= 1000000) { \
- (c1)->usec -= 1000000; \
- (c1)->sec++; \
- } \
- END
-
-/* Subtract time c2 from time c1. c2 should be less than c1 */
-#define clock_Sub(c1, c2) \
- BEGIN \
- if (((c1)->usec -= (c2)->usec) < 0) { \
- (c1)->usec += 1000000; \
- (c1)->sec--; \
- } \
- (c1)->sec -= (c2)->sec; \
- END
-
-#define clock_Float(c) ((c)->sec + (c)->usec/1e6)
-
-void clock_Init(void);
-void clock_UpdateTime(void);
-
-
-#endif /* _CLOCK_ */
diff --git a/usr.sbin/afs/src/rx/rx_dumptrace.c b/usr.sbin/afs/src/rx/rx_dumptrace.c
deleted file mode 100644
index 9db1ade160f..00000000000
--- a/usr.sbin/afs/src/rx/rx_dumptrace.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#include "rx_locl.h"
-
-RCSID("$arla: rx_dumptrace.c,v 1.3 2003/04/09 02:33:05 lha Exp $");
-
-int
-main(int argc, char **argv)
-{
- struct rx_trace ip;
- int err = 0;
- int fd;
-
- setlinebuf(stdout);
- argv++;
- argc--;
- while (argc && **argv == '-') {
- if (strcmp(*argv, "-trace") == 0) {
- strlcpy(rxi_tracename, *(++argv), sizeof(rxi_tracename));
- argc--;
- } else {
- err++;
- break;
- }
- argv++, argc--;
- }
- if (err || argc != 0) {
- printf("usage: dumptrace [-trace pathname]");
- exit(1);
- }
- fd = open(rxi_tracename, O_RDONLY);
- if (fd < 0) {
- perror("");
- exit(errno);
- }
- while (read(fd, &ip, sizeof(struct rx_trace))) {
- printf("%9u ", (unsigned)ip.now);
- switch (ip.event) {
- case RX_CALL_END:
- putchar('E');
- break;
- case RX_CALL_START:
- putchar('S');
- break;
- case RX_CALL_ARRIVAL:
- putchar('A');
- break;
- case RX_TRACE_DROP:
- putchar('D');
- break;
- default:
- putchar('U');
- break;
- }
- printf(" %3u %7u %7u %lx.%x\n",
- (unsigned)ip.qlen,
- (unsigned)ip.servicetime,
- (unsigned)ip.waittime,
- ip.cid,
- ip.call);
- }
- return 0;
-}
diff --git a/usr.sbin/afs/src/rx/rx_event.c b/usr.sbin/afs/src/rx/rx_event.c
deleted file mode 100644
index 91d26da463e..00000000000
--- a/usr.sbin/afs/src/rx/rx_event.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#include "rx_locl.h"
-
-RCSID("$arla: rx_event.c,v 1.6 2003/01/19 08:46:29 lha Exp $");
-
-/*
- * All event processing is relative to the apparent current time
- * given by clock_GetTime
- */
-
-/* This should be static, but event_test wants to look at the free list... */
-struct rx_queue rxevent_free; /* It's somewhat bogus to use a
- * doubly-linked queue for the free
- * list */
-static struct rx_queue rxevent_queue; /* The list of waiting events */
-static int rxevent_allocUnit = 10; /* Allocation unit (number of event
- * records to allocate at one time) */
-int rxevent_nFree; /* Number of free event records */
-int rxevent_nPosted; /* Current number of posted events */
-static void (*rxevent_ScheduledEarlierEvent) ();/* Proc to call when an event
- * is scheduled that is
- * earlier than all other
- * events */
-static struct xfreelist {
- struct xfreelist *next;
-} *xfreemallocs = 0, *xsp = 0;
-
-#ifdef RXDEBUG
-FILE *rxevent_debugFile; /* Set to an stdio descriptor for
- * event logging to that file */
-#endif
-
-/* Pass in the number of events to allocate at a time */
-static int initialized = 0;
-
-void
-rxevent_Init(int nEvents, void (*scheduler) ())
-{
- if (initialized)
- return;
- clock_Init();
- if (nEvents)
- rxevent_allocUnit = nEvents;
- queue_Init(&rxevent_free);
- queue_Init(&rxevent_queue);
- rxevent_nFree = rxevent_nPosted = 0;
- rxevent_ScheduledEarlierEvent = scheduler;
- initialized = 1;
-}
-
-/* Add the indicated event (function, arg) at the specified clock time */
-struct rxevent *
-rxevent_Post(struct clock * when, void (*func)(), void *arg, void *arg1)
-/* when - When event should happen, in clock (clock.h) units */
-{
- struct rxevent *ev, *qe, *qpr;
-
-#ifdef RXDEBUG
- if (Log) {
- struct clock now;
-
- clock_GetTime(&now);
- fprintf(Log, "%ld.%ld: rxevent_Post(%ld.%ld, %p, %p)\n",
- now.sec, now.usec, when->sec, when->usec, func, arg);
- }
-#endif
-#if defined(AFS_SGIMP_ENV)
- ASSERT(osi_rxislocked());
-#endif
-
- /*
- * If we're short on free event entries, create a block of new ones and
- * add them to the free queue
- */
- if (queue_IsEmpty(&rxevent_free)) {
- int i;
-
-#if defined(AFS_AIX32_ENV) && defined(KERNEL)
- ev = (struct rxevent *) rxi_Alloc(sizeof(struct rxevent));
- queue_Append(&rxevent_free, &ev[0]), rxevent_nFree++;
-#else
- ev = (struct rxevent *) osi_Alloc(sizeof(struct rxevent) *
- rxevent_allocUnit);
- xsp = xfreemallocs;
- xfreemallocs = (struct xfreelist *) ev;
- xfreemallocs->next = xsp;
- for (i = 0; i < rxevent_allocUnit; i++)
- queue_Append(&rxevent_free, &ev[i]), rxevent_nFree++;
-#endif
- }
- /* Grab and initialize a new rxevent structure */
- ev = queue_First(&rxevent_free, rxevent);
- queue_Remove(ev);
- rxevent_nFree--;
-
- /* Record user defined event state */
- ev->eventTime = *when;
- ev->func = func;
- ev->arg = arg;
- ev->arg1 = arg1;
- rxevent_nPosted += 1; /* Rather than ++, to shut high-C up
- * regarding never-set variables */
-
- /*
- * Locate a slot for the new entry. The queue is ordered by time, and we
- * assume that a new entry is likely to be greater than a majority of the
- * entries already on the queue (unless there's very few entries on the
- * queue), so we scan it backwards
- */
- for (queue_ScanBackwards(&rxevent_queue, qe, qpr, rxevent)) {
- if (clock_Ge(when, &qe->eventTime)) {
- queue_InsertAfter(qe, ev);
- return ev;
- }
- }
- /* The event is to expire earlier than any existing events */
- queue_Prepend(&rxevent_queue, ev);
- if (rxevent_ScheduledEarlierEvent)
- (*rxevent_ScheduledEarlierEvent) (); /* Notify our external
- * scheduler */
- return ev;
-}
-
-/*
- * Cancel an event by moving it from the event queue to the free list.
- * Warning, the event must be on the event queue! If not, this should core
- * dump (reference through 0). This routine should be called using the macro
- * event_Cancel, which checks for a null event and also nulls the caller's
- * event pointer after cancelling the event.
- */
-void
-rxevent_Cancel_1(struct rxevent * ev)
-{
-#ifdef RXDEBUG
- if (Log) {
- struct clock now;
-
- clock_GetTime(&now);
- fprintf(Log, "%ld.%ld: rxevent_Cancel_1(%ld.%ld, %p, %p)\n",
- now.sec, now.usec, ev->eventTime.sec, ev->eventTime.usec,
- ev->func, ev->arg);
- }
-#endif
- /*
- * Append it to the free list (rather than prepending) to keep
- * the free list hot so nothing pages out
- */
-#if defined(AFS_SGIMP_ENV)
- ASSERT(osi_rxislocked());
-#endif
- queue_MoveAppend(&rxevent_free, ev);
- rxevent_nPosted--;
- rxevent_nFree++;
-}
-
-/*
- * Process all events that have expired relative to the current clock time
- * (which is not re-evaluated unless clock_NewTime has been called).
- * The relative time to the next event is returned in the output parameter
- * next and the function returns 1. If there are is no next event,
- * the function returns 0.
- */
-int
-rxevent_RaiseEvents(struct clock * next)
-{
- struct rxevent *qe;
- struct clock now;
-
-#ifdef RXDEBUG
- if (Log)
- fprintf(Log, "rxevent_RaiseEvents(%ld.%ld)\n", now.sec, now.usec);
-#endif
-
- /*
- * Events are sorted by time, so only scan until an event is found that
- * has not yet timed out
- */
- while (queue_IsNotEmpty(&rxevent_queue)) {
- clock_GetTime(&now);
- qe = queue_First(&rxevent_queue, rxevent);
- if (clock_Lt(&now, &qe->eventTime)) {
- *next = qe->eventTime;
- clock_Sub(next, &now);
- return 1;
- }
- queue_Remove(qe);
- rxevent_nPosted--;
- qe->func(qe, qe->arg, qe->arg1);
- queue_Append(&rxevent_free, qe);
- rxevent_nFree++;
- }
- return 0;
-}
-
-#if 0
-static void
-shutdown_rxevent(void)
-{
- struct xfreelist *xp, *nxp;
-
- initialized = 0;
-#if defined(AFS_AIX32_ENV) && defined(KERNEL)
- /* Everything is freed in afs_osinet.c */
-#else
- while ((xp = xfreemallocs) != NULL) {
- nxp = xp->next;
- osi_Free((char *) xp, sizeof(struct rxevent) * rxevent_allocUnit);
- }
-#endif
-}
-#endif
diff --git a/usr.sbin/afs/src/rx/rx_event.h b/usr.sbin/afs/src/rx/rx_event.h
deleted file mode 100644
index 562b1cd2ac9..00000000000
--- a/usr.sbin/afs/src/rx/rx_event.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/* Event package */
-
-#ifndef _EVENT_
-#define _EVENT_
-
-#ifdef KERNEL
-#include "../rx/rx_queue.h"
-#include "../rx/rx_clock.h"
-#else /* KERNEL */
-#include "rx_queue.h"
-#include "rx_clock.h"
-#endif /* KERNEL */
-
-/*
- * An event is something that will happen at (or after) a specified clock
- * time, unless cancelled prematurely. The user routine (*func)() is called
- * with arguments (event, arg, arg1) when the event occurs. Warnings:
- * (1) The user supplied routine should NOT cause process preemption.
- * (2) The event passed to the user is still on the event queue at that time.
- * The user must not remove (event_Cancel) it explicitly, but the user may
- * remove or schedule any OTHER event at this time.
- */
-
-struct rxevent {
- struct rx_queue junk; /* Events are queued */
- struct clock eventTime; /* When this event times out (in
- * clock.c units) */
- void (*func)(); /* Function to call when this expires */
- void *arg; /* Argument to the function */
- void *arg1; /* Another argument */
-};
-
-/*
- * Some macros to make macros more reasonable (this allows a block to be
- * used within a macro which does not cause if statements to screw up).
- * That is, you can use "if (...) macro_name(); else ...;" without having
- * things blow up on the semi-colon.
- */
-
-#ifndef BEGIN
-#define BEGIN do {
-#define END } while(0)
-#endif
-
-/*
- * This routine must be called to initialize the event package.
- * nEvents is the number of events to allocate in a batch whenever more
- * are needed. If this is 0, a default number (10) will be allocated.
- */
-void rxevent_Init(int, void (*)());
-
-/*
- * Arrange for the indicated event at the appointed time. When is a
- * "struct clock", in the clock.c time base
- */
-struct rxevent *rxevent_Post(struct clock*, void (*)(), void*, void*);
-
-/*
- * Remove the indicated event from the event queue. The event must be
- * pending. Also see the warning, above. The event pointer supplied is
- * zeroed.
- */
-void rxevent_Cancel_1(struct rxevent *);
-
-#define rxevent_Cancel(event_ptr) \
- BEGIN \
- if (event_ptr) { \
- rxevent_Cancel_1(event_ptr); \
- event_ptr = (struct rxevent *) 0; \
- } \
- END
-
-/*
- * The actions specified for each event that has reached the current clock
- * time will be taken. The current time returned by GetTime is used
- * (warning: this may be an old time if the user has not called clock_NewTime)
- */
-int rxevent_RaiseEvents(struct clock *);
-
-#endif /* _EVENT_ */
diff --git a/usr.sbin/afs/src/rx/rx_globs.c b/usr.sbin/afs/src/rx/rx_globs.c
deleted file mode 100644
index 7a82d14e901..00000000000
--- a/usr.sbin/afs/src/rx/rx_globs.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/* RX: Globals for internal use, basically */
-
-/* Enable data initialization when the header file is included */
-#define INIT(stuff) = stuff
-#define EXT
-
-#include "rx_locl.h"
-
-RCSID("$arla: rx_globs.c,v 1.5 1998/02/26 14:38:27 art Exp $");
diff --git a/usr.sbin/afs/src/rx/rx_globs.h b/usr.sbin/afs/src/rx/rx_globs.h
deleted file mode 100644
index 87aa1adea7c..00000000000
--- a/usr.sbin/afs/src/rx/rx_globs.h
+++ /dev/null
@@ -1,309 +0,0 @@
-/* $arla: rx_globs.h,v 1.10 2003/01/19 08:49:58 lha Exp $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/* RX: Globals for internal use, basically */
-
-#ifdef KERNEL
-#include "../rx/rx.h"
-#else /* KERNEL */
-#include "rx.h"
-#endif /* KERNEL */
-
-#ifndef INIT
-#define INIT(x)
-#define EXT extern
-#endif /* INIT */
-
-/* The array of installed services. Null terminated. */
-EXT struct rx_service *rx_services[RX_MAX_SERVICES + 1];
-
-/* Incoming calls wait on this queue when there are no available server processes */
-EXT struct rx_queue rx_incomingCallQueue;
-
-/* Server processes wait on this queue when there are no appropriate calls to process */
-EXT struct rx_queue rx_idleServerQueue;
-
-/*
- * Constant delay time before sending an acknowledge of the last
- * packet received. This is to avoid sending an extra acknowledge
- * when the client is about to make another call, anyway, or the
- * server is about to respond.
- */
-EXT struct clock rx_lastAckDelay;
-
-#ifdef SOFT_ACK
-/*
- * Constant delay time before sending a hard ack if the receiver
- * consumes a packet while no delayed ack event is scheduled. Ensures
- * that the sender is able to advance its window when the receiver
- * consumes a packet after the sender has exhausted its transmit
- * window.
- */
-EXT struct clock rx_hardAckDelay;
-
-/*
- * Constant delay time before sending a soft ack when none was
- * requested. This is to make sure we send soft acks before the
- * sender times out, Normally we wait and send a hard ack when the
- * receiver consumes the packet
- */
-EXT struct clock rx_softAckDelay;
-
-#endif /* SOFT_ACK */
-
-/* Variable to allow introduction of network unreliability */
-#ifdef RXDEBUG
-EXT int rx_intentionallyDroppedPacketsPer100 INIT(0); /* Dropped on Send */
-
-#endif
-
-EXT int rx_extraQuota INIT(0); /* extra packets to add to the quota */
-EXT int rx_extraPackets INIT(32); /* extra packets to alloc (2 windows
- * by deflt) */
-
-EXT int rx_stackSize INIT(RX_DEFAULT_STACK_SIZE);
-
-EXT int rx_connDeadTime INIT(12); /* Time until an unresponsive
- * connection is declared dead */
-EXT int rx_idleConnectionTime INIT(700); /* Time until we toss an idle
- * connection */
-EXT int rx_idlePeerTime INIT(60); /* Time until we toss a peer
- * structure, after all connections
- * using it have disappeared */
-
-/* These definitions should be in one place */
-#ifdef AFS_SUN5_ENV
-#define RX_CBUF_TIME 180 /* Check for cbuf deficit */
-#define RX_REAP_TIME 90 /* Check for tossable connections
- * every 90 seconds */
-#else
-#define RX_CBUF_TIME 120 /* Check for cbuf deficit */
-#define RX_REAP_TIME 60 /* Check for tossable connections
- * every 60 seconds */
-#endif
-
-#ifdef SOFT_ACK
-#define RX_FAST_ACK_RATE 1
-
-EXT int rxi_SoftAckRate INIT(RX_FAST_ACK_RATE);
-EXT int rxi_HardAckRate INIT(RX_FAST_ACK_RATE + 1);
-
-#endif /* SOFT_ACK */
-
-EXT int rx_Window INIT(15); /* Temporary HACK: transmit/receive
- * window */
-EXT int rx_initialWindow INIT(2); /* "Slow start" with 2 packets */
-
-EXT int rx_nPackets INIT(100); /* obsolete; use rx_extraPackets now */
-
-/* List of free packets */
-EXT struct rx_queue rx_freePacketQueue;
-EXT struct rx_queue rx_freeCbufQueue;
-
-#ifdef RX_ENABLE_LOCKS
-EXT afs_lock_t rx_freePktQ_lock;
-
-#endif
-
-/* Number of free packets */
-EXT int rx_nFreePackets INIT(0);
-EXT int rx_nFreeCbufs INIT(0);
-EXT int rx_nCbufs INIT(0);
-EXT int rxi_NeedMoreCbufs INIT(0);
-EXT int rx_nWaiting INIT(0);
-
-/* largest packet which we can safely receive, initialized to AFS 3.2 value
- * This is provided for backward compatibility with peers which may be unable
- * to swallow anything larger. THIS MUST NEVER DECREASE WHILE AN APPLICATION
- * IS RUNNING! */
-EXT u_long rx_maxReceiveSize INIT(OLD_MAX_PACKET_SIZE);
-
-EXT u_long rx_MyMaxSendSize INIT(OLD_MAX_PACKET_SIZE - RX_HEADER_SIZE);
-
-
-/* List of free queue entries */
-EXT struct rx_serverQueueEntry *rx_FreeSQEList INIT(0);
-
-#ifdef RX_ENABLE_LOCKS
-EXT kmutex_t freeSQEList_lock;
-
-#endif
-
-/* List of free call structures */
-EXT struct rx_queue rx_freeCallQueue;
-
-#ifdef RX_ENABLE_LOCKS
-EXT kmutex_t rx_freeCallQueue_lock;
-
-#endif
-EXT long rxi_nCalls INIT(0);
-
-/* Basic socket for client requests; other sockets (for receiving server requests) are in the service structures */
-EXT osi_socket rx_socket;
-
-/* Port requested at rx_Init. If this is zero, the actual port used will be different--but it will only be used for client operations. If non-zero, server provided services may use the same port. */
-EXT uint16_t rx_port;
-
-/* This is actually the minimum number of packets that must remain free,
- overall, immediately after a packet of the requested class has been
- allocated. *WARNING* These must be assigned with a great deal of care.
- In order, these are receive quota, send quota and special quota */
-#define RX_PACKET_QUOTAS {1, 10, 0}
-/* value large enough to guarantee that no allocation fails due to RX_PACKET_QUOTAS.
- Make it a little bigger, just for fun */
-#define RX_MAX_QUOTA 15 /* part of min packet computation */
-EXT int rx_packetQuota[RX_N_PACKET_CLASSES] INIT(RX_PACKET_QUOTAS);
-
-EXT int rx_nextCid; /* Next connection call id */
-EXT uint32_t rx_epoch; /* Initialization time of rx */
-
-#ifdef RX_ENABLE_LOCKS
-EXT kmutex_t rx_waitingForPackets_lock;
-EXT kcondvar_t rx_waitingForPackets_cv;
-
-#endif
-EXT char rx_waitingForPackets; /* Processes set and wait on this
- * variable when waiting for packet
- * buffers */
-
-EXT struct rx_stats rx_stats;
-
-EXT struct rx_peer **rx_peerHashTable;
-EXT struct rx_connection **rx_connHashTable;
-EXT u_long rx_hashTableSize INIT(256); /* Power of 2 */
-EXT u_long rx_hashTableMask INIT(255); /* One less than rx_hashTableSize */
-
-#define CONN_HASH(host, port, cid, epoch, type) ((((cid)>>RX_CIDSHIFT)&rx_hashTableMask))
-
-#define PEER_HASH(host, port) ((host ^ port) & rx_hashTableMask)
-
-#ifdef notdef /* Use a func for now to measure
- * allocated structs */
-#define rxi_Free(addr, size) osi_Free(addr, size)
-#endif /* notdef */
-
-#define rxi_AllocSecurityObject() (struct rx_securityClass *) rxi_Alloc(sizeof(struct rx_securityClass))
-#define rxi_FreeSecurityObject(obj) rxi_Free(obj, sizeof(struct rx_securityClass))
-#define rxi_AllocService() (struct rx_service *) rxi_Alloc(sizeof(struct rx_service))
-#define rxi_FreeService(obj) rxi_Free(obj, sizeof(struct rx_service))
-#define rxi_AllocPeer() (struct rx_peer *) rxi_Alloc(sizeof(struct rx_peer))
-#define rxi_FreePeer(peer) rxi_Free(peer, sizeof(struct rx_peer))
-#define rxi_AllocConnection() (struct rx_connection *) rxi_Alloc(sizeof(struct rx_connection))
-#define rxi_FreeConnection(conn) (rxi_Free(conn, sizeof(struct rx_connection)))
-
-/* Forward definitions of internal procedures */
-struct rx_packet * rxi_AllocPacket(int);
-struct rx_packet * rxi_AllocSendPacket(struct rx_call *, int);
-void * rxi_Alloc(int);
-struct rx_peer * rxi_FindPeer(uint32_t, uint16_t);
-struct rx_call * rxi_NewCall(struct rx_connection *, int);
-void rxi_FreeCall(struct rx_call *);
-void rxi_Listener(void);
-int rxi_ReadPacket(int, struct rx_packet *,
- uint32_t *, uint16_t *);
-struct rx_packet * rxi_ReceivePacket(struct rx_packet *, osi_socket,
- uint32_t, uint16_t);
-struct rx_packet * rxi_ReceiveDataPacket(struct rx_call *,
- struct rx_packet *);
-struct rx_packet * rxi_ReceiveAckPacket(struct rx_call *,
- struct rx_packet *);
-struct rx_packet * rxi_ReceiveResponsePacket(struct rx_connection *,
- struct rx_packet *);
-struct rx_packet * rxi_ReceiveChallengePacket(struct rx_connection *,
- struct rx_packet *);
-void rx_ServerProc(void);
-void rxi_AttachServerProc(struct rx_call *);
-void rxi_ChallengeOn(struct rx_connection *);
-void rxi_InitPeerParams(struct rx_peer *);
-
-
-#define rxi_ChallengeOff(conn) rxevent_Cancel((conn)->challengeEvent);
-void rxi_ChallengeEvent(struct rxevent*, struct rx_connection *,
- char *);
-struct rx_packet *rxi_SendAck(struct rx_call *,
- struct rx_packet *, int, int, int, int);
-void rxi_ClearTransmitQueue(struct rx_call *);
-void rxi_ClearReceiveQueue(struct rx_call *);
-void rxi_ResetConnection(struct rx_connection *);
-void rxi_InitCall(void); /* obsolete ? */
-void rxi_ResetCall(struct rx_call *);
-void rxi_CallError(struct rx_call *, int32_t);
-void rxi_ConnectionError(struct rx_connection *, int32_t);
-void rxi_QueuePackets(void); /* obsolete ? */
-void rxi_Start(struct rxevent *, struct rx_call *);
-void rxi_CallIsIdle(void); /* obsolete ? */
-void rxi_CallTimedOut(void); /* obsolete ? */
-void rxi_ComputeRoundTripTime(struct rx_packet *,
- struct clock *,
- struct rx_peer *);
-void rxi_ScheduleKeepAliveEvent(struct rx_call *);
-void rxi_KeepAliveEvent(struct rxevent *, struct rx_call *, char *);
-void rxi_KeepAliveOn(struct rx_call *);
-
-#define rxi_KeepAliveOff(call) rxevent_Cancel((call)->keepAliveEvent)
-void rxi_AckAll(struct rxevent *, struct rx_call *, char *);
-void rxi_SendDelayedAck(struct rxevent *, struct rx_call *, char *);
-struct rx_packet *rxi_SendSpecial(struct rx_call *,
- struct rx_connection *,
- struct rx_packet *, int, char *, int);
-struct rx_packet *rxi_SendCallAbort(struct rx_call *,
- struct rx_packet *);
-struct rx_packet *rxi_SendConnectionAbort(struct rx_connection *,
- struct rx_packet *);
-void rxi_ScheduleDecongestionEvent(struct rx_call *, int);
-void rxi_CongestionWait(struct rx_call *);
-void rxi_ReapConnections(void);
-void rxi_EncodePacketHeader(struct rx_packet *);
-void rxi_DecodePacketHeader(struct rx_packet *);
-void rxi_DebugPrint(const char *, ...);
-void rxi_PrepareSendPacket(struct rx_call *,
- struct rx_packet *, int);
-void rxi_MoreCbufs(int);
-uint32_t rx_SlowGetLong(struct rx_packet *, int);
-
-void rxi_Send(struct rx_call *, struct rx_packet *);
-void rxi_FreeAllPackets(void);
-void rxi_SendPacket(struct rx_connection *,
- struct rx_packet *);
-int rxi_IsConnInteresting(struct rx_connection *);
-struct rx_packet *rxi_ReceiveDebugPacket(struct rx_packet *, osi_socket,
- uint32_t, uint16_t);
-struct rx_packet *rxi_ReceiveVersionPacket(struct rx_packet *, osi_socket,
- uint32_t, uint16_t);
-void rxi_SendDebugPacket(struct rx_packet *, osi_socket, uint32_t, uint16_t);
-
-
-#ifdef RXDEBUG
-/* Some debugging stuff */
-EXT FILE *rx_debugFile; /* Set by the user to a stdio file for
- * debugging output */
-
-#define Log rx_debugFile
-#define dpf(args) do { if (rx_debugFile) rxi_DebugPrint args; } while(0)
-
-EXT char *rx_packetTypes[RX_N_PACKET_TYPES] INIT(RX_PACKET_TYPES); /* Strings defined in
- * rx.h */
-
-#else
-#define dpf(args)
-#endif /* RXDEBUG */
diff --git a/usr.sbin/afs/src/rx/rx_kern.h b/usr.sbin/afs/src/rx/rx_kern.h
deleted file mode 100644
index 75d443074a1..00000000000
--- a/usr.sbin/afs/src/rx/rx_kern.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* $arla: rx_kern.h,v 1.4 2003/01/19 08:47:23 lha Exp $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/* Definitions specific to the in-kernel implementation of Rx, for in-kernel clients */
-
-#ifndef __RX_KERNEL_INCL_
-#define __RX_KERNEL_INCL_ 1
-
-#ifdef AFS_AIX32_ENV
-/*
- * vrmix has some rather peculiar ideas about vax-style processor levels,
- * as evidenced in "net/spl.h".
- */
-#include "net/spl.h"
-#endif
-
-extern int (*rxk_GetPacketProc) (); /* set to packet allocation procedure */
-extern int (*rxk_PacketArrivalProc) ();
-
-#ifdef AFS_SUN5_ENV
-#define SPLVAR
-#define NETPRI
-#define USERPRI
-#else
-#define SPLVAR int splvar
-#define NETPRI splvar=splnet()
-#define USERPRI splx(splvar)
-#endif
-
-rxi_StartListener(void);
-
-#define rxi_ReScheduleEvents 0 /* Not needed by kernel */
-
-/* This is a no-op, because the kernel server procs are pre-allocated */
-#define rxi_StartServerProcs(x)
-
-/* Socket stuff */
-typedef struct socket *osi_socket;
-
-#define OSI_NULLSOCKET ((osi_socket) 0)
-
-extern rx_ReScheduleEvents();
-extern osi_socket rxi_GetUDPSocket();
-
-#define osi_Msg printf)(
-#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN5_ENV)
-#define osi_rxSleep(a) osi_Sleep(a)
-#define osi_rxWakeup(a) osi_Wakeup(a)
-#endif
-#if !defined(AFS_SGI_ENV)
-extern int printf();
-
-#endif
-
-#define osi_YieldIfPossible()
-#define osi_WakeupAndYieldIfPossible(x) rx_Wakeup(x)
-
-#include "../afs/longc_procs.h"
-
-#endif /* __RX_KERNEL_INCL_ */
diff --git a/usr.sbin/afs/src/rx/rx_kmutex.h b/usr.sbin/afs/src/rx/rx_kmutex.h
deleted file mode 100644
index a2db26019aa..00000000000
--- a/usr.sbin/afs/src/rx/rx_kmutex.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2000, International Business Machines Corporation and others.
- * All Rights Reserved.
- *
- * This software has been released under the terms of the IBM Public
- * License. For details, see the LICENSE file in the top-level source
- * directory or online at http://www.openafs.org/dl/license10.html
- */
-
-/*
- * rx_kmutex.h - mutex and condition variable macros for kernel environment.
- *
- * Solaris implementation.
- */
-
-#ifndef _RX_KMUTEX_H_
-#define _RX_KMUTEX_H_
-
-#define AFS_GLOBAL_RXLOCK_KERNEL
-#define RX_ENABLE_LOCKS 1
-
-#define afs_kmutex_t usr_mutex_t
-#define afs_kcondvar_t usr_cond_t
-#define RX_MUTEX_INIT(A,B,C,D) usr_mutex_init(A)
-#define RX_MUTEX_ENTER(A) usr_mutex_lock(A)
-#define RX_MUTEX_TRYENTER(A) usr_mutex_trylock(A)
-#define RX_MUTEX_ISMINE(A) (1)
-#define RX_MUTEX_EXIT(A) usr_mutex_unlock(A)
-#define RX_MUTEX_DESTROY(A) usr_mutex_destroy(A)
-#define CV_INIT(A,B,C,D) usr_cond_init(A)
-#define CV_TIMEDWAIT(A,B,C) usr_cond_timedwait(A,B,C)
-#define CV_SIGNAL(A) usr_cond_signal(A)
-#define CV_BROADCAST(A) usr_cond_broadcast(A)
-#define CV_DESTROY(A) usr_cond_destroy(A)
-#define CV_WAIT(_cv, _lck) { \
- int isGlockOwner = ISAFS_GLOCK(); \
- if (isGlockOwner) { \
- AFS_GUNLOCK(); \
- } \
- usr_cond_wait(_cv, _lck); \
- if (isGlockOwner) { \
- RX_MUTEX_EXIT(_lck); \
- AFS_GLOCK(); \
- RX_MUTEX_ENTER(_lck); \
- } \
- }
-
-extern void osirx_AssertMine(afs_kmutex_t *lockaddr, char *msg);
-
-#define AFS_RXGLOCK()
-#define AFS_RXGUNLOCK()
-#define ISAFS_RXGLOCK() 1
-#define AFS_ASSERT_RXGLOCK()
-
-#define SPLVAR
-#define NETPRI
-#define USERPRI
-
-#endif /* _RX_KMUTEX_H_ */
-
diff --git a/usr.sbin/afs/src/rx/rx_locl.h b/usr.sbin/afs/src/rx/rx_locl.h
deleted file mode 100644
index a5de316b9b0..00000000000
--- a/usr.sbin/afs/src/rx/rx_locl.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: rx_locl.h,v 1.7 2002/12/20 12:52:14 lha Exp $ */
-
-#ifndef __RX_LOCL_H__
-#define __RX_LOCL_H__
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include <limits.h>
-
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/errno.h>
-#include <signal.h>
-#include <sys/socket.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-#include <sys/param.h>
-#include <sys/file.h>
-#include <fcntl.h>
-#include <netdb.h>
-#include <sys/stat.h>
-#include <atypes.h>
-#ifdef HAVE_SYS_SOCKIO_H
-#include <sys/sockio.h>
-#endif
-#include <netinet/in.h>
-#include <sys/time.h>
-#ifdef __osf__ /* brain damage */
-struct mbuf;
-struct ifaddr;
-struct ifmulti;
-struct rtentry;
-#endif
-#include <net/if.h>
-#include <sys/ioctl.h>
-#include <lwp.h>
-#include <unistd.h>
-#ifdef AFS_SUN5_ENV
-#include <sys/sysmacros.h> /* ??? */
-#endif
-
-#include <roken.h>
-
-#include "rx_mach.h"
-#include "rx_user.h"
-#include "rx_clock.h"
-#include "rx_queue.h"
-#include "rx.h"
-#include "rx_globs.h"
-#include "rx_clock.h"
-#include "rx_trace.h"
-#include "rx_misc.h"
-#include "rx_multi.h"
-
-#endif /* __RX_LOCL_H__ */
diff --git a/usr.sbin/afs/src/rx/rx_mach.h b/usr.sbin/afs/src/rx/rx_mach.h
deleted file mode 100644
index 7af2168a849..00000000000
--- a/usr.sbin/afs/src/rx/rx_mach.h
+++ /dev/null
@@ -1,92 +0,0 @@
-#ifndef _RX_MACHDEP_
-#define _RX_MACHDEP_
-
-/* $I$d$ */
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* Copyright Transarc Corporation 1993 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that neither the name of IBM nor the name *
-* of Transarc be used in advertising or publicity pertaining to *
-* distribution of the software without specific, written prior permission. *
-* *
-* IBM AND TRANSARC DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *
-* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO *
-* EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL *
-* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR *
-* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS *
-* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF *
-* THIS SOFTWARE. *
-****************************************************************************
-*/
-
-
-#if defined(AFS_SUN5_ENV) && defined(KERNEL)
-#if defined(AFS_FINEGR_SUNLOCK)
-#define RX_ENABLE_LOCKS 1
-#else
-#undef RX_ENABLE_LOCKS
-#endif
-#include <sys/tiuser.h>
-#include <sys/t_lock.h>
-#include <sys/mutex.h>
-#endif
-
-#ifndef AFS_AOS_ENV
-#define ADAPT_PERF
-#ifndef AFS_SUN5_ENV
-#define MISCMTU
-#ifndef __CYGWIN32__
-#define ADAPT_MTU
-#endif
-#endif
-#endif
-
-#if defined(AFS_AIX32_ENV) && defined(KERNEL)
-#define PIN(a, b) pin(a, b);
-#define UNPIN(a, b) unpin(a, b);
-#else
-#define PIN(a, b) ;
-#define UNPIN(a, b) ;
-#endif
-
-#if defined(AFS_GLOBAL_SUNLOCK) && defined(KERNEL)
-extern kmutex_t afs_rxglobal_lock;
-
-#define GLOBAL_LOCK() mutex_enter(&afs_rxglobal_lock)
-#define GLOBAL_UNLOCK() mutex_exit(&afs_rxglobal_lock)
-#else
-#define GLOBAL_LOCK()
-#define GLOBAL_UNLOCK()
-#endif
-
-#ifdef RX_ENABLE_LOCKS
-extern kmutex_t afs_termStateLock;
-extern kcondvar_t afs_termStateCv;
-
-#define RX_MUTEX_DESTROY(a) mutex_destroy(a)
-#define RX_MUTEX_ENTER(a) mutex_enter(a)
-#define RX_MUTEX_EXIT(a) mutex_exit(a)
-#define RX_MUTEX_INIT(a,b,c,d) mutex_init(a,b,c,d)
-#else
-#define MObtainWriteLock(a)
-#define MReleaseWriteLock(a)
-#define RX_MUTEX_DESTROY(a)
-#define RX_MUTEX_ENTER(a)
-#define RX_MUTEX_EXIT(a)
-#define RX_MUTEX_INIT(a,b,c,d)
-#endif
-
-#ifndef AFS_AIX32_ENV
-#define IFADDR2SA(f) (&((f)->ifa_addr))
-#else /* AFS_AIX32_ENV */
-#define IFADDR2SA(f) ((f)->ifa_addr)
-#endif
-
-
-#endif /* _RX_MACHDEP_ */
diff --git a/usr.sbin/afs/src/rx/rx_misc.c b/usr.sbin/afs/src/rx/rx_misc.c
deleted file mode 100644
index 03d35fffab4..00000000000
--- a/usr.sbin/afs/src/rx/rx_misc.c
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "rx_locl.h"
-
-RCSID("$arla: rx_misc.c,v 1.6 2003/06/10 16:55:01 lha Exp $");
-
-/*
- * We currently only include below the errors that
- * affect us the most. We should add to this list
- * more code mappings, as necessary.
- */
-
-/*
- * Convert from the local (host) to the standard
- * (network) system error code.
- */
-uint32_t
-hton_syserr_conv(uint32_t code)
-{
- uint32_t err;
-
-#if 0
- if (code == ENOSPC)
- err = VDISKFULL;
-#ifndef AFS_SUN5_ENV
- /* EDQUOT doesn't exist on solaris */
- else if (code == EDQUOT)
- err = VOVERQUOTA;
-#endif
- else
-#endif
- err = code;
- return err;
-}
-
-
-/*
- * Convert from the standard (Network) format to the
- * local (host) system error code.
- */
-uint32_t
-ntoh_syserr_conv(uint32_t code)
-{
- uint32_t err;
-
-#if 0
- if (code == VDISKFULL)
- err = ENOSPC;
- else if (code == VOVERQUOTA)
-#ifdef AFS_SUN5_ENV
- err = ENOSPC;
-#else
- err = EDQUOT;
-#endif
- else
-#endif
- err = code;
- return err;
-}
diff --git a/usr.sbin/afs/src/rx/rx_misc.h b/usr.sbin/afs/src/rx/rx_misc.h
deleted file mode 100644
index c32f4f70357..00000000000
--- a/usr.sbin/afs/src/rx/rx_misc.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 1998 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: rx_misc.h,v 1.3 2003/01/19 08:50:01 lha Exp $ */
-
-#ifndef __RX_MISC_H
-#define __RX_MISC_H
-uint32_t ntoh_syserr_conv(uint32_t code);
-uint32_t hton_syserr_conv(uint32_t code);
-
-char *osi_alloc(long);
-void osi_free(char *, long);
-#endif /* __RX_MISC_H */
diff --git a/usr.sbin/afs/src/rx/rx_multi.c b/usr.sbin/afs/src/rx/rx_multi.c
deleted file mode 100644
index 07fe1616606..00000000000
--- a/usr.sbin/afs/src/rx/rx_multi.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#include "rx_locl.h"
-
-RCSID("$arla: rx_multi.c,v 1.6 2000/03/03 08:56:12 assar Exp $");
-
-/* multi.c and multi.h, together with some rxgen hooks, provide a way of making multiple, but similar, rx calls to multiple hosts simultaneously */
-
-struct multi_handle *
-multi_Init(struct rx_connection **conns, int nConns)
-{
- struct rx_call **calls;
- short *ready;
- struct multi_handle *mh;
- int i;
-
- /*
- * Note: all structures that are possibly referenced by other processes
- * must be allocated. In some kernels variables allocated on a process
- * stack will not be accessible to other processes
- */
- calls = (struct rx_call **) osi_Alloc(sizeof(struct rx_call *) * nConns);
- ready = (short *) osi_Alloc(sizeof(short *) * nConns);
- mh = (struct multi_handle *) osi_Alloc(sizeof(struct multi_handle));
- if (!calls || !ready || !mh)
- osi_Panic("multi_Rx: no mem\n");
- mh->calls = calls;
- mh->nextReady = mh->firstNotReady = mh->ready = ready;
- mh->nReady = 0;
- mh->nConns = nConns;
- for (i = 0; i < nConns; i++) {
- struct rx_call *call;
-
- call = mh->calls[i] = rx_NewCall(conns[i]);
- rx_SetArrivalProc(call, multi_Ready, (void *) mh, (void *) i);
- }
- return mh;
-}
-
-/*
- * Return the user's connection index of the most recently ready call; that
- * is, a call that has received at least one reply packet
- */
-int
-multi_Select(struct multi_handle *mh)
-{
- SPLVAR;
- NETPRI;
- if (mh->nextReady == mh->firstNotReady) {
- if (mh->nReady == mh->nConns) {
- USERPRI;
- return -1;
- }
- osi_rxSleep(mh);
- }
- USERPRI;
- return *mh->nextReady++;
-}
-
-/*
- * Called by Rx when the first reply packet of a call is received, or the
- * call is aborted.
- */
-void
-multi_Ready(struct rx_call *call, struct multi_handle *mh,
- int index)
-{
- *mh->firstNotReady++ = index;
- mh->nReady++;
- osi_rxWakeup(mh);
-}
-
-/*
- * Called when the multi rx call is over, or when the user aborts it
- * (by using the macro multi_Abort)
- */
-void
-multi_Finalize(struct multi_handle *mh)
-{
- int i;
- int nCalls = mh->nConns;
-
- for (i = 0; i < nCalls; i++) {
- struct rx_call *call = mh->calls[i];
-
- if (call)
- rx_EndCall(call, RX_USER_ABORT);
- }
- osi_Free(mh->calls, sizeof(struct rx_call *) * nCalls);
- osi_Free(mh->ready, sizeof(short *) * nCalls);
-}
diff --git a/usr.sbin/afs/src/rx/rx_multi.h b/usr.sbin/afs/src/rx/rx_multi.h
deleted file mode 100644
index da3bf667abc..00000000000
--- a/usr.sbin/afs/src/rx/rx_multi.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* $arla: rx_multi.h,v 1.4 2003/01/19 08:48:22 lha Exp $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#ifndef _RX_MULTI_
-#define _RX_MULTI_
-
-#ifdef KERNEL
-#include "../rx/rx.h"
-#else /* KERNEL */
-#include "rx.h"
-#endif /* KERNEL */
-
-struct multi_handle {
- int nConns;
- struct rx_call **calls;
- short *ready;
- short nReady; /* XXX UNALIGNED */
- short *nextReady;
- short *firstNotReady;
-};
-
-void
-multi_Finalize (struct multi_handle*);
-
-struct multi_handle *
-multi_Init (struct rx_connection **, int);
-
-void
-multi_Ready (struct rx_call*, struct multi_handle*, int);
-
-int
-multi_Select (struct multi_handle *);
-
-#define multi_Rx(conns, nConns) \
- do {\
- struct multi_handle *multi_h;\
- int multi_i;\
- struct rx_call *multi_call;\
- multi_h = multi_Init(conns, nConns);\
- for (multi_i = 0; multi_i < nConns; multi_i++)
-
-#define multi_Body(startProc, endProc)\
- multi_call = multi_h->calls[multi_i];\
- startProc;\
- rx_FlushWrite(multi_call);\
- }\
- while ((multi_i = multi_Select(multi_h)) >= 0) {\
- uint32_t multi_error;\
- multi_call = multi_h->calls[multi_i];\
- multi_error = rx_EndCall(multi_call, endProc);\
- multi_h->calls[multi_i] = (struct rx_call *) 0
-
-#define multi_Abort break
-
-#define multi_End\
- multi_Finalize(multi_h);\
- } while (0)
-
-
-#endif /* _RX_MULTI_ End of rx_multi.h */
diff --git a/usr.sbin/afs/src/rx/rx_null.c b/usr.sbin/afs/src/rx/rx_null.c
deleted file mode 100644
index 044be70e3da..00000000000
--- a/usr.sbin/afs/src/rx/rx_null.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#include "rx_locl.h"
-#include "rx_null.h"
-
-RCSID("$arla: rx_null.c,v 1.4 1999/12/31 05:42:06 assar Exp $");
-
-/* The null security object. No authentication, no nothing. */
-
-static struct rx_securityOps null_ops;
-static struct rx_securityClass null_object;
-
-struct rx_securityClass *
-rxnull_NewServerSecurityObject(void)
-{
- null_object.ops = &null_ops;
- return &null_object;
-}
-
-struct rx_securityClass *
-rxnull_NewClientSecurityObject(void)
-{
- null_object.ops = &null_ops;
- return &null_object;
-}
diff --git a/usr.sbin/afs/src/rx/rx_null.h b/usr.sbin/afs/src/rx/rx_null.h
deleted file mode 100644
index 23be406faab..00000000000
--- a/usr.sbin/afs/src/rx/rx_null.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* $arla: /afs/stacken.kth.se/src/SourceRepository/arla/rx/rx_null.h,v 1.3 1998/01/28 04:54:19 art Exp $ */
-/* $arla: /afs/stacken.kth.se/src/SourceRepository/arla/rx/rx_null.h,v $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#ifndef RX_NULL_HEADER
-#define RX_NULL_HEADER
-
-#ifdef KERNEL
-#include "../rx/rx.h"
-#else /* KERNEL */
-#include "rx.h"
-#endif /* KERNEL */
-
-/* The null security object. No authentication, no nothing. */
-
-extern struct rx_securityClass *rxnull_NewServerSecurityObject(void);
-extern struct rx_securityClass *rxnull_NewClientSecurityObject(void);
-
-#endif /* RX_NULL_HEADER */
diff --git a/usr.sbin/afs/src/rx/rx_pkt.c b/usr.sbin/afs/src/rx/rx_pkt.c
deleted file mode 100644
index 80beac988f3..00000000000
--- a/usr.sbin/afs/src/rx/rx_pkt.c
+++ /dev/null
@@ -1,1390 +0,0 @@
-#include "rx_locl.h"
-
-RCSID("$arla: rx_pkt.c,v 1.22 2003/04/08 22:15:08 lha Exp $");
-
-struct rx_packet *rx_mallocedP = 0;
-struct rx_cbuf *rx_mallocedC = 0;
-
-/* string to send to rxdebug */
-#define CML_VERSION_NUMBER_SIZE 65
-static char cml_version_number[CML_VERSION_NUMBER_SIZE]= PACKAGE "-" VERSION ;
-
-extern int (*rx_almostSent) ();
-
-/*
- * some rules about packets:
- * 1. When a packet is allocated, the final iov_buf contains room for
- * a security trailer, but iov_len masks that fact. If the security
- * package wants to add the trailer, it may do so, and then extend
- * iov_len appropriately. For this reason, packet's niovecs and
- * iov_len fields should be accurate before calling PreparePacket.
- */
-
-/*
- * Preconditions:
- * all packet buffers (iov_base) are integral multiples of
- * the word size.
- * offset is an integral multiple of the word size.
- */
-
-uint32_t
-rx_SlowGetLong(struct rx_packet *packet, int offset)
-{
- int i, l;
-
- for (l = 0, i = 1; i < packet->niovecs; i++) {
- if (l + packet->wirevec[i].iov_len > offset) {
- return *((uint32_t *)
- ((char *)packet->wirevec[i].iov_base + (offset - l)));
- }
- l += packet->wirevec[i].iov_len;
- }
-
- return 0;
-}
-
-/* Preconditions:
- * all packet buffers (iov_base) are integral multiples of the word
- * size.
- * offset is an integral multiple of the word size.
- */
-int
-rx_SlowPutLong(struct rx_packet *packet, int offset, uint32_t data)
-{
- int i, l;
-
- for (l = 0, i = 1; i < packet->niovecs; i++) {
- if (l + packet->wirevec[i].iov_len > offset) {
- *((uint32_t *) ((char *)packet->wirevec[i].iov_base + (offset - l))) = data;
- return 0;
- }
- l += packet->wirevec[i].iov_len;
- }
- return 1;
-}
-
-/*
- * Preconditions:
- * all packet buffers (iov_base) are integral multiples of the
- * word size.
- * offset is an integral multiple of the word size.
- * Packet Invariants:
- * all buffers are contiguously arrayed in the iovec from 0..niovecs-1
- */
-size_t
-rx_SlowReadPacket(struct rx_packet *packet, int offset, int resid, void *out)
-{
- int i;
- unsigned char *p = out;
- size_t bytes;
-
- for(i = 1; (i < packet->niovecs) && (offset + (ssize_t)resid > 0); i++) {
- if(offset < packet->wirevec[i].iov_len) {
- /* at this point the intersection of this iovec and
- [offset, offset+resid) is non-empty, so we can copy
- min(base + len, base + offset + resid) -
- max(base, base + offset) bytes
- */
- bytes = min(packet->wirevec[i].iov_len, offset + resid) -
- max(offset, 0);
- memcpy(p,
- (char *)packet->wirevec[i].iov_base + max(offset, 0),
- bytes);
- p += bytes;
- }
- offset -= packet->wirevec[i].iov_len;
- }
- return p - (unsigned char *)out;
-}
-
-
-/*
- * Preconditions:
- * all packet buffers (iov_base) are integral multiples of the
- * word size.
- * offset is an integral multiple of the word size.
- */
-size_t
-rx_SlowWritePacket(struct rx_packet *packet, int offset, int resid, void *in)
-{
- int i;
- unsigned char *p = in;
- size_t bytes;
-
- for(i = 1; i < RX_MAXWVECS && offset + resid > 0; i++) {
- if(i >= packet->niovecs)
- if(rxi_AllocDataBuf(packet, resid))
- break;
- if(offset < packet->wirevec[i].iov_len) {
- /* at this point the intersection of this iovec and
- [offset, offset+resid) is non-empty, so we can copy
- min(base + len, base + offset + resid) -
- max(base, base + offset) bytes
- */
- bytes = min(packet->wirevec[i].iov_len, offset + resid) -
- max(offset, 0);
- memcpy((char *)(packet->wirevec[i].iov_base) + max(offset, 0),
- p, bytes);
- p += bytes;
- }
- offset -= packet->wirevec[i].iov_len;
- }
- return p - (unsigned char *)in;
-}
-
-
-static void
-freeCBuf(struct rx_cbuf *c)
-{
- SPLVAR;
-
- dpf(("Free cbuf %x\n", c));
- NETPRI;
-
- MObtainWriteLock(&rx_freePktQ_lock);
-
- queue_Append(&rx_freeCbufQueue, c);
- rx_nFreeCbufs++;
-
- MReleaseWriteLock(&rx_freePktQ_lock);
- USERPRI;
-
- return;
-}
-
-static struct rx_cbuf *
-allocCBuf(void)
-{
- struct rx_cbuf *c;
-
- SPLVAR;
-
- NETPRI;
- MObtainWriteLock(&rx_freePktQ_lock);
-
- if (queue_IsEmpty(&rx_freeCbufQueue)) {
-#ifdef KERNEL
- c = NULL;
- rxi_NeedMoreCbufs = TRUE;
- goto done;
-#else /* KERNEL */
- rxi_MoreCbufs(rx_Window);
-#endif /* KERNEL */
- }
- rx_nFreeCbufs--;
- c = queue_First(&rx_freeCbufQueue, rx_cbuf);
-
- dpf(("Alloc cb %x\n", c));
-
- queue_Remove(c);
-
-#ifdef KERNEL
-done:
-#endif
- MReleaseWriteLock(&rx_freePktQ_lock);
-
- USERPRI;
- return c;
-}
-
-/* Allocate more CBufs iff we need them */
-/*
- * In kernel, can't page in memory with interrupts disabled, so we
- * don't use the event mechanism.
- */
-void
-rx_CheckCbufs(unsigned long when)
-/* time when I should be called next */
-{
- struct clock now;
-
- clock_GetTime(&now);
-
- if (rxi_NeedMoreCbufs) {
- rxi_MoreCbufs(rx_Window);
- }
-#ifndef KERNEL
- now.sec += RX_CBUF_TIME;
- rxevent_Post(&now, rx_CheckCbufs, (void *)now.sec, NULL);
-#endif
-}
-
-/*
- * this one is kind of awful.
- * In rxkad, the packet has been all shortened, and everything, ready for
- * sending. All of a sudden, we discover we need some of that space back.
- * This isn't terribly general, because it knows that the packets are only
- * rounded up to the EBS (userdata + security header).
- */
-int
-rxi_RoundUpPacket(struct rx_packet *p, unsigned int nb)
-{
- int i;
-
- i = p->niovecs - 1;
- if (p->wirevec[i].iov_base == (caddr_t) p->localdata) {
- if (p->wirevec[i].iov_len <= RX_FIRSTBUFFERSIZE - nb) {
- p->wirevec[i].iov_len += nb;
- return 0;
- }
- } else {
- if (p->wirevec[i].iov_len <= RX_CBUFFERSIZE - nb) {
- p->wirevec[i].iov_len += nb;
- return 0;
- }
- }
-
- return 0;
-}
-
-/* get sufficient space to store nb bytes of data (or more), and hook
- * it into the supplied packet. Return nbytes<=0 if successful, otherwise
- * returns the number of bytes >0 which it failed to come up with.
- * Don't need to worry about locking on packet, since only
- * one thread can manipulate one at a time. Locking on cbufs is handled
- * by allocCBuf */
-/* MTUXXX don't need to go throught the for loop if we can trust niovecs */
-int
-rxi_AllocDataBuf(struct rx_packet *p, int nb)
-{
- int i;
-
- for (i = 0; nb > 0 && i < RX_MAXWVECS; i++) {
- if (p->wirevec[i].iov_base)
- continue;
-
- switch (i) {
- case 1:
- p->wirevec[i].iov_len = RX_FIRSTBUFFERSIZE;
- p->wirevec[i].iov_base = (caddr_t) p->localdata;
- nb -= RX_FIRSTBUFFERSIZE;
- p->length += RX_FIRSTBUFFERSIZE;
- break;
- default:
- {
- struct rx_cbuf *cb;
-
- if ((cb = allocCBuf()) != NULL) {
- p->wirevec[i].iov_base = (caddr_t) cb->data;
- p->wirevec[i].iov_len = RX_CBUFFERSIZE;
- nb -= RX_CBUFFERSIZE;
- p->length += RX_CBUFFERSIZE;
- p->niovecs++;
- } else
- i = RX_MAXWVECS;
- }
- break;
- }
- }
-
- return nb;
-}
-
-int
-rxi_FreeDataBufs(struct rx_packet *p, int first)
-{
- int i;
-
- if (first != 1) /* MTUXXX */
- osi_Panic("FreeDataBufs 1: first must be 1");
-
- for (i = first; i < RX_MAXWVECS; i++) {
- if (p->wirevec[i].iov_base) {
- if (p->wirevec[i].iov_base != (caddr_t) p->localdata) {
- freeCBuf((struct rx_cbuf *)((char *)p->wirevec[i].iov_base -
- sizeof(struct rx_queue)));
- }
- p->wirevec[i].iov_base = NULL;
- } else if (i == 1) /* MTUXXX */
- osi_Panic("FreeDataBufs 4: vec 1 must not be NULL");
-
- p->wirevec[i].iov_len = 0;
- }
- p->length = 0;
-
- return 0;
-}
-
-/*
- * add n more fragment buffers (continuation buffers)
- * Must be called at user priority or will crash RS/6000s
- */
-void
-rxi_MoreCbufs(int n)
-{
- struct rx_cbuf *c, *e;
- int getme;
-
- SPLVAR;
-
- if (!n)
- return;
-
- getme = n * sizeof(struct rx_cbuf);
- c = rx_mallocedC = (struct rx_cbuf *) osi_Alloc(getme);
- if (!c)
- return;
-
- memset(c, 0, getme);
-
- PIN(c, getme); /* XXXXX */
- NETPRI;
- MObtainWriteLock(&rx_freePktQ_lock);
-
- for (e = c + n; c < e; c++) {
- queue_Append(&rx_freeCbufQueue, c);
- }
- rxi_NeedMoreCbufs = FALSE;
- rx_nFreeCbufs += n;
- rx_nCbufs += n;
-
- MReleaseWriteLock(&rx_freePktQ_lock);
- USERPRI;
-
- return;
-}
-
-/* Add more packet buffers */
-void
-rxi_MorePackets(int apackets)
-{
- struct rx_packet *p, *e;
- int getme;
-
- SPLVAR;
-
- getme = apackets * sizeof(struct rx_packet);
- p = rx_mallocedP = (struct rx_packet *) osi_Alloc(getme);
-
- PIN(p, getme); /* XXXXX */
- memset((char *) p, 0, getme);
- NETPRI;
- MObtainWriteLock(&rx_freePktQ_lock);
-
- for (e = p + apackets; p < e; p++) {
- p->wirevec[0].iov_base = (char *) (p->wirehead);
- p->wirevec[0].iov_len = RX_HEADER_SIZE;
- p->wirevec[1].iov_base = (char *) (p->localdata);
- p->wirevec[1].iov_len = RX_FIRSTBUFFERSIZE;
- p->niovecs = 2;
-
- queue_Append(&rx_freePacketQueue, p);
- }
- rx_nFreePackets += apackets;
-
- MReleaseWriteLock(&rx_freePktQ_lock);
- USERPRI;
-
- /*
- * allocate enough cbufs that 1/4 of the packets will be able to hold
- * maximal amounts of data
- */
-/* MTUXXX enable this -- currently disabled for testing
- rxi_MoreCbufs((apackets/4)*(rx_maxReceiveSize - RX_FIRSTBUFFERSIZE)/RX_CBUFFERSIZE);
-*/
-
-}
-
-void
-rxi_FreeAllPackets(void)
-{
- /* must be called at proper interrupt level, etcetera */
- /* MTUXXX need to free all Cbufs */
- osi_Free(rx_mallocedP, (rx_Window + 2) * sizeof(struct rx_packet));
- UNPIN(rx_mallocedP, (rx_Window + 2) * sizeof(struct rx_packet));
-
- return;
-}
-
-
-/*
- * In the packet freeing routine below, the assumption is that
- * we want all of the packets to be used equally frequently, so that we
- * don't get packet buffers paging out. It would be just as valid to
- * assume that we DO want them to page out if not many are being used.
- * In any event, we assume the former, and append the packets to the end
- * of the free list.
- */
-/*
- * This explanation is bogus. The free list doesn't remain in any kind of
- * useful order for long: the packets in use get pretty much randomly scattered
- * across all the pages. In order to permit unused {packets,bufs} to page
- * out, they must be stored so that packets which are adjacent in memory are
- * adjacent in the free list. An array springs rapidly to mind.
- */
-
-/*
- * Free the packet p. P is assumed not to be on any queue, i.e.
- * remove it yourself first if you call this routine.
- */
-void
-rxi_FreePacket(struct rx_packet *p)
-{
- SPLVAR;
- dpf(("Free %x\n", p));
-
- rxi_FreeDataBufs(p, 1); /* this gets the locks below, so must
- * call it first */
-
- NETPRI;
-
- MObtainWriteLock(&rx_freePktQ_lock);
-
- rx_nFreePackets++;
- queue_Append(&rx_freePacketQueue, p);
- /* Wakeup anyone waiting for packets */
- rxi_PacketsUnWait();
-
- MReleaseWriteLock(&rx_freePktQ_lock);
- USERPRI;
-}
-
-
-
-/*
- * rxi_AllocPacket sets up p->length so it reflects the number of
- * bytes in the packet at this point, **not including** the header.
- * The header is absolutely necessary, besides, this is the way the
- * length field is usually used
- */
-struct rx_packet *
-rxi_AllocPacket(int class)
-{
- struct rx_packet *p;
-
- if (rxi_OverQuota(class)) {
- rx_stats.noPackets[class]++;
- return NULL;
- }
- rx_stats.packetRequests++;
-
- MObtainWriteLock(&rx_freePktQ_lock);
- rx_nFreePackets--;
- if (queue_IsEmpty(&rx_freePacketQueue))
- osi_Panic("rxi_AllocPacket error");
-
- p = queue_First(&rx_freePacketQueue, rx_packet);
-
- dpf(("Alloc %x, class %d\n",
- queue_First(&rx_freePacketQueue, rx_packet), class));
-
- queue_Remove(p);
- MReleaseWriteLock(&rx_freePktQ_lock);
-
- /*
- * have to do this here because rx_FlushWrite fiddles with the iovs in
- * order to truncate outbound packets. In the near future, may need to
- * allocate bufs from a static pool here, and/or in AllocSendPacket
- */
- p->wirevec[0].iov_base = (char *) (p->wirehead);
- p->wirevec[0].iov_len = RX_HEADER_SIZE;
- p->wirevec[1].iov_base = (char *) (p->localdata);
- p->wirevec[1].iov_len = RX_FIRSTBUFFERSIZE;
- p->niovecs = 2;
- p->length = RX_FIRSTBUFFERSIZE;
- return p;
-}
-
-
-/*
- * This guy comes up with as many buffers as it {takes,can get} given
- * the MTU for this call. It also sets the packet length before
- * returning. caution: this is often called at NETPRI
- */
-struct rx_packet *
-rxi_AllocSendPacket(struct rx_call *call, int want)
-{
- struct rx_packet *p = (struct rx_packet *) 0;
- int mud;
-
- SPLVAR;
- mud = call->conn->maxPacketSize - RX_HEADER_SIZE;
-
- while (!(call->error)) {
- /* if an error occurred, or we get the packet we want, we're done */
- if ((p = rxi_AllocPacket(RX_PACKET_CLASS_SEND)) != NULL) {
-
- want += rx_GetSecurityHeaderSize(rx_ConnectionOf(call)) +
- rx_GetSecurityMaxTrailerSize(rx_ConnectionOf(call));
- want = MIN(want, mud);
-
- if (want > p->length)
- (void) rxi_AllocDataBuf(p, (want - p->length));
-
- if (p->length > mud)
- p->length = mud;
-
- p->length -= rx_GetSecurityHeaderSize(rx_ConnectionOf(call)) +
- rx_GetSecurityMaxTrailerSize(rx_ConnectionOf(call));
-
- if (p->length <= 0) {
- rxi_FreePacket(p);
- p = NULL;
- }
- break;
- }
-
- /*
- * no error occurred, and we didn't get a packet, so we sleep. At
- * this point, we assume that packets will be returned sooner or
- * later, as packets are acknowledged, and so we just wait.
- */
- NETPRI;
- RX_MUTEX_ENTER(&rx_waitingForPackets_lock);
- rx_waitingForPackets = 1;
- call->flags |= RX_CALL_WAIT_PACKETS;
-
-#ifdef RX_ENABLE_LOCKS
- cv_wait(&rx_waitingForPackets_cv, &rx_waitingForPackets_lock);
-#else
- osi_rxSleep(&rx_waitingForPackets);
-#endif
- call->flags &= ~RX_CALL_WAIT_PACKETS;
- RX_MUTEX_EXIT(&rx_waitingForPackets_lock);
- USERPRI;
- }
-
- return p;
-}
-
-
-#ifndef KERNEL
-/* count the number of used FDs */
-static int
-CountFDs(int amax)
-{
- struct stat tstat;
- int i, code;
- int count;
-
- count = 0;
- for (i = 0; i < amax; i++) {
- code = fstat(i, &tstat);
- if (code == 0)
- count++;
- }
- return count;
-}
-
-/*
- * This function reads a single packet from the interface into the
- * supplied packet buffer (*p). Return 0 if the packet is bogus. The
- * (host,port) of the sender are stored in the supplied variables, and
- * the data length of the packet is stored in the packet structure.
- * The header is decoded.
- */
-int
-rxi_ReadPacket(int socket, struct rx_packet *p,
- uint32_t *host, uint16_t *port)
-{
- struct sockaddr_in from;
- int nbytes;
- long rlen;
- long tlen;
- long _tlen;
- struct msghdr msg;
- uint32_t dummy; /* was using rlen but had aliasing
- * problems */
-
- rx_computelen(p, tlen);
- rx_SetDataSize(p, tlen); /* this is the size of the user data
- * area */
-
- tlen += RX_HEADER_SIZE; /* now this is the size of the entire
- * packet */
- rlen = rx_maxReceiveSize; /* this is what I am advertising.
- * Only check it once in order to
- * avoid races. */
- _tlen = rlen - tlen;
- if (_tlen > 0) {
- _tlen = rxi_AllocDataBuf(p, _tlen);
- if (_tlen >0) {
- _tlen = rlen - _tlen;
- }
- else _tlen = rlen;
- }
- else _tlen = rlen;
- tlen=(tlen>_tlen)?tlen:_tlen;
-
- /*
- * set up this one iovec for padding, it's just to make sure that the
- * read doesn't return more data than we expect, and is done to get
- * around our problems caused by the lack of a length field in the rx
- * header.
- */
- p->wirevec[p->niovecs].iov_base = (caddr_t) & dummy;
- p->wirevec[p->niovecs++].iov_len = 4;
-
- memset(&msg, 0, sizeof(msg));
- msg.msg_name = (char *) &from;
- msg.msg_namelen = sizeof(struct sockaddr_in);
- msg.msg_iov = p->wirevec;
- msg.msg_iovlen = p->niovecs;
-#if 0
- msg.msg_accrights = NULL;
- msg.msg_accrightslen = 0;
-#endif
- nbytes = recvmsg(socket, &msg, 0);
-
- /* restore the vec to its correct state */
- p->wirevec[--p->niovecs].iov_base = NULL;
- p->wirevec[p->niovecs].iov_len = 0;
-
- if (nbytes < 0) {
- /* ignore error? */
- return 0;
- }
-
- p->length = (nbytes - RX_HEADER_SIZE);
- if ((nbytes > tlen) || (nbytes < (int)RX_HEADER_SIZE)) { /* Bogus packet */
- if (nbytes > 0)
- rxi_MoreCbufs(rx_Window);
- if (nbytes > tlen)
- rxi_AllocDataBuf(p, nbytes - tlen);
- else if (nbytes < 0 && errno == EWOULDBLOCK)
- rx_stats.noPacketOnRead++;
- else {
- rx_stats.bogusPacketOnRead++;
- rx_stats.bogusHost = from.sin_addr.s_addr;
- dpf(("B: bogus packet from [%x,%d] nb=%d", from.sin_addr.s_addr,
- from.sin_port, nbytes));
- }
- return 0;
- } else {
- /* Extract packet header. */
- rxi_DecodePacketHeader(p);
-
- *host = from.sin_addr.s_addr;
- *port = from.sin_port;
- if (p->header.type > 0 && p->header.type < RX_N_PACKET_TYPES)
- rx_stats.packetsRead[p->header.type - 1]++;
-
- return 1;
- }
-}
-
-/* Send a udp datagram */
-int
-osi_NetSend(osi_socket socket, char *addr, struct iovec *dvec,
- int nvecs, int length)
-{
- struct msghdr msg;
-
- memset(&msg, 0, sizeof(msg));
- msg.msg_iov = dvec;
- msg.msg_iovlen = nvecs;
-
- msg.msg_name = addr;
- msg.msg_namelen = sizeof(struct sockaddr_in);
-#if 0
- msg.msg_accrights = NULL;
- msg.msg_accrightslen = 0;
-#endif
-
- while (sendmsg(socket, &msg, 0) == -1) {
- int err;
- fd_set sfds;
-
- rx_stats.sendSelects++;
- if (errno != EWOULDBLOCK
- && errno != ENOBUFS
- && errno != ECONNREFUSED) {
- osi_Msg(("rx failed to send packet: %s ", strerror(errno)));
- return 3;
- }
-
- dpf(("rx_send failed with %d\n", errno));
-
- FD_ZERO(&sfds);
- if (socket >= FD_SETSIZE)
- osi_Panic("osi_NetSend: fd too large");
- FD_SET(socket, &sfds);
- while ((err = select(socket + 1, 0, &sfds, 0, 0)) != 1) {
- if (err >= 0 || errno != EINTR)
- osi_Panic("osi_NetSend: select error %d.%d", err, errno);
- }
- }
-
- return 0;
-}
-
-#else /* KERNEL */
-/*
- * osi_NetSend is defined in afs/afs_osinet.c
- * message receipt is done in rxk_input or rx_put.
- */
-
-#ifdef AFS_SUN5_ENV
-/*
- * Copy an mblock to the contiguous area pointed to by cp.
- * MTUXXX Supposed to skip <off> bytes and copy <len> bytes,
- * but it doesn't really.
- * Returns the number of bytes not transferred.
- * The message is NOT changed.
- */
-static int
-cpytoc(mblk_t *mp, int off, int len, char *cp)
-{
- int n;
-
- for (; mp && len > 0; mp = mp->b_cont) {
- if (mp->b_datap->db_type != M_DATA) {
- return -1;
- }
- n = MIN(len, (mp->b_wptr - mp->b_rptr));
- memcpy(cp, mp->b_rptr, n);
- cp += n;
- len -= n;
- mp->b_rptr += n;
- }
- return (len);
-}
-
-/*
- * MTUXXX Supposed to skip <off> bytes and copy <len> bytes,
- * but it doesn't really.
- * This sucks, anyway, do it like m_cpy.... below
- */
-static int
-cpytoiovec(mblk_t *mp, int off, int len,
- struct iovec *iovs, int niovs)
-{
- int m, n, o, t, i;
-
- for (i = -1, t = 0; i < niovs && mp && len > 0; mp = mp->b_cont) {
- if (mp->b_datap->db_type != M_DATA) {
- return -1;
- }
- n = MIN(len, (mp->b_wptr - mp->b_rptr));
- len -= n;
- while (n) {
- if (!t) {
- o = 0;
- i++;
- t = iovs[i].iov_len;
- }
- m = MIN(n, t);
- memcpy(iovs[i].iov_base + o, mp->b_rptr, m);
- mp->b_rptr += m;
- o += m;
- t -= m;
- n -= m;
- }
- }
- return (len);
-}
-
-#define m_cpytoc(a, b, c, d) cpytoc(a, b, c, d)
-#define m_cpytoiovec(a, b, c, d, e) cpytoiovec(a, b, c, d, e)
-#else
-
-static int
-m_cpytoiovec(struct mbuf *m, int off, int len, struct iovec iovs[], int niovs)
-{
- caddr_t p1, p2;
- unsigned int l1, l2, i, t;
-
- if (m == NULL || off < 0 || len < 0 || iovs == NULL)
- panic("m_cpytoiovec"); /* MTUXXX probably don't need this
- * check */
-
- while (off && m)
- if (m->m_len <= off) {
- off -= m->m_len;
- m = m->m_next;
- continue;
- } else
- break;
-
- if (m == NULL)
- return len;
-
- p1 = mtod(m, caddr_t) + off;
- l1 = m->m_len - off;
- i = 0;
- p2 = iovs[0].iov_base;
- l2 = iovs[0].iov_len;
-
- while (len) {
- t = MIN(l1, MIN(l2, (unsigned int) len));
- memcpy(p2, p1, t);
- p1 += t;
- p2 += t;
- l1 -= t;
- l2 -= t;
- len -= t;
- if (!l1) {
- m = m->m_next;
- if (!m)
- break;
- p1 = mtod(m, caddr_t);
- l1 = m->m_len;
- }
- if (!l2) {
- if (++i >= niovs)
- break;
- p2 = iovs[i].iov_base;
- l2 = iovs[i].iov_len;
- }
- }
-
- return len;
-}
-
-#endif /* AFS_SUN5_ENV */
-
-int
-rx_mb_to_packet(char *amb, void (*free)(), int hdr_len, int data_len,
- struct rx_packet *phandle)
-{
- int code;
-
- code = m_cpytoiovec(amb, hdr_len, data_len, phandle->wirevec,
- phandle->niovecs);
- (*free) (amb);
-
- return code;
-}
-
-#define CountFDs(amax) amax
-
-#endif /* KERNEL */
-
-
-/* send a response to a debug packet */
-
-struct rx_packet *
-rxi_ReceiveDebugPacket(struct rx_packet *ap, osi_socket asocket,
- uint32_t ahost, uint16_t aport)
-{
- struct rx_debugIn tin;
- long tl;
-
- rx_packetread(ap, 0, sizeof(struct rx_debugIn), (char *) &tin);
-
- /*
- * all done with packet, now set length to the truth, so we can reuse
- * this packet
- */
- rx_computelen(ap, ap->length);
-
- tin.type = ntohl(tin.type);
- tin.index = ntohl(tin.index);
- switch (tin.type) {
- case RX_DEBUGI_GETSTATS:{
- struct rx_debugStats tstat;
-
- /* get basic stats */
- memset((char *) &tstat, 0, sizeof(tstat)); /* make sure spares are
- * zero */
- tstat.version = RX_DEBUGI_VERSION;
-#ifndef RX_ENABLE_LOCKS
- tstat.waitingForPackets = rx_waitingForPackets;
-#endif
- tstat.nFreePackets = htonl(rx_nFreePackets);
- tstat.callsExecuted = htonl(rxi_nCalls);
- tstat.packetReclaims = htonl(0);
- tstat.usedFDs = CountFDs(64);
- tstat.nWaiting = htonl(rx_nWaiting);
-
-
- tl = sizeof(struct rx_debugStats) - ap->length;
- if (tl > 0)
- tl = rxi_AllocDataBuf(ap, tl);
-
- if (tl <= 0) {
- rx_packetwrite(ap, 0, sizeof(struct rx_debugStats), (char *) &tstat);
- ap->length = sizeof(struct rx_debugStats);
- rxi_SendDebugPacket(ap, asocket, ahost, aport);
- rx_computelen(ap, ap->length);
- }
- break;
- }
-
- case RX_DEBUGI_GETALLCONN:
- case RX_DEBUGI_GETCONN:{
- int i, j;
- struct rx_connection *tc;
- struct rx_call *tcall;
- struct rx_debugConn tconn;
- int all = (tin.type == RX_DEBUGI_GETALLCONN);
-
-
- tl = sizeof(struct rx_debugConn) - ap->length;
- if (tl > 0)
- tl = rxi_AllocDataBuf(ap, tl);
- if (tl > 0)
- return ap;
-
- memset((char *) &tconn, 0, sizeof(tconn)); /* make sure spares are
- * zero */
- /* get N'th (maybe) "interesting" connection info */
- for (i = 0; i < rx_hashTableSize; i++) {
- for (tc = rx_connHashTable[i]; tc; tc = tc->next) {
- if ((all || rxi_IsConnInteresting(tc)) && tin.index-- <= 0) {
- tconn.host = tc->peer->host;
- tconn.port = tc->peer->port;
- tconn.cid = htonl(tc->cid);
- tconn.epoch = htonl(tc->epoch);
- tconn.serial = htonl(tc->serial);
- for (j = 0; j < RX_MAXCALLS; j++) {
- tconn.callNumber[j] = htonl(tc->callNumber[j]);
- if ((tcall = tc->call[j]) != NULL) {
- tconn.callState[j] = tcall->state;
- tconn.callMode[j] = tcall->mode;
- tconn.callFlags[j] = tcall->flags;
- if (queue_IsNotEmpty(&tcall->rq))
- tconn.callOther[j] |= RX_OTHER_IN;
- if (queue_IsNotEmpty(&tcall->tq))
- tconn.callOther[j] |= RX_OTHER_OUT;
- } else
- tconn.callState[j] = RX_STATE_NOTINIT;
- }
-
- tconn.maxPacketSize = htonl(tc->maxPacketSize);
- tconn.error = htonl(tc->error);
- tconn.flags = tc->flags;
- tconn.type = tc->type;
- tconn.securityIndex = tc->securityIndex;
- if (tc->securityObject) {
- RXS_GetStats(tc->securityObject, tc,
- &tconn.secStats);
-#define DOHTONL(a) (tconn.secStats.a = htonl(tconn.secStats.a))
-#define DOHTONS(a) (tconn.secStats.a = htons(tconn.secStats.a))
- DOHTONL(flags);
- DOHTONL(expires);
- DOHTONL(packetsReceived);
- DOHTONL(packetsSent);
- DOHTONL(bytesReceived);
- DOHTONL(bytesSent);
- for (i = 0;
- i < sizeof(tconn.secStats.spares) / sizeof(int16_t);
- i++)
- DOHTONS(spares[i]);
- for (i = 0;
- i < sizeof(tconn.secStats.sparel) / 4;
- i++)
- DOHTONL(sparel[i]);
- }
- rx_packetwrite(ap, 0, sizeof(struct rx_debugConn), (char *) &tconn);
- tl = ap->length;
- ap->length = sizeof(struct rx_debugConn);
- rxi_SendDebugPacket(ap, asocket, ahost, aport);
- ap->length = tl;
- return ap;
- }
- }
- }
- /* if we make it here, there are no interesting packets */
- tconn.cid = htonl(0xffffffff); /* means end */
- rx_packetwrite(ap, 0, sizeof(struct rx_debugConn), &tconn);
- tl = ap->length;
- ap->length = sizeof(struct rx_debugConn);
- rxi_SendDebugPacket(ap, asocket, ahost, aport);
- ap->length = tl;
- break;
- }
-
- case RX_DEBUGI_RXSTATS:{
- int i;
- uint32_t *s;
-
- tl = sizeof(rx_stats) - ap->length;
- if (tl > 0)
- tl = rxi_AllocDataBuf(ap, tl);
- if (tl > 0)
- return ap;
-
- /* Since its all longs convert to network order with a loop. */
- s = (uint32_t *) &rx_stats;
- for (i = 0; i < sizeof(rx_stats) / 4; i++, s++)
- rx_SlowPutLong(ap, i * 4, htonl(*s));
-
- tl = ap->length;
- ap->length = sizeof(rx_stats);
- rxi_SendDebugPacket(ap, asocket, ahost, aport);
- ap->length = tl;
- break;
- }
-
- default:
- /* error response packet */
- tin.type = htonl(RX_DEBUGI_BADTYPE);
- tin.index = tin.type;
- rx_packetwrite(ap, 0, sizeof(struct rx_debugIn), &tin);
- tl = ap->length;
- ap->length = sizeof(struct rx_debugIn);
- rxi_SendDebugPacket(ap, asocket, ahost, aport);
- ap->length = tl;
- break;
- }
- return ap;
-}
-
-struct rx_packet *
-rxi_ReceiveVersionPacket(struct rx_packet *ap, osi_socket asocket,
- uint32_t ahost, uint16_t aport)
-{
- long tl;
-
- rx_packetwrite(ap, 0, CML_VERSION_NUMBER_SIZE, cml_version_number);
- tl = ap->length;
- ap->length = 65;
- rxi_SendDebugPacket(ap, asocket, ahost, aport);
- ap->length = tl;
- return ap;
-}
-
-
-/* send a debug packet back to the sender */
-void
-rxi_SendDebugPacket(struct rx_packet *apacket, osi_socket asocket,
- uint32_t ahost, uint16_t aport)
-{
- struct sockaddr_in taddr;
- int i = 0;
- int savelen = 0;
- int saven = 0;
- int nbytes;
-
- taddr.sin_family = AF_INET;
- taddr.sin_port = aport;
- taddr.sin_addr.s_addr = ahost;
-
- nbytes = apacket->length;
-
- for (i = 1; i < apacket->niovecs; i++) {
- if (nbytes <= apacket->wirevec[i].iov_len) {
- savelen = apacket->wirevec[i].iov_len;
- saven = apacket->niovecs;
- apacket->wirevec[i].iov_len = nbytes;
- apacket->niovecs = i + 1;
- /* so condition fails because i == niovecs */
- } else
- nbytes -= apacket->wirevec[i].iov_len;
- }
-
- GLOBAL_UNLOCK();
- /* debug packets are not reliably delivered, hence the cast below. */
- /* MTUXXX need to adjust lengths as in sendSpecial */
- (void) osi_NetSend(asocket, (char *)&taddr, apacket->wirevec,
- apacket->niovecs, apacket->length + RX_HEADER_SIZE);
- GLOBAL_LOCK();
-
- if (saven) {
- apacket->wirevec[i - 1].iov_len = savelen;
- apacket->niovecs = saven;
- }
-}
-
-/*
- * Send the packet to appropriate destination for the specified
- * connection. The header is first encoded and placed in the packet.
- */
-void
-rxi_SendPacket(struct rx_connection *conn,
- struct rx_packet *p)
-{
- struct sockaddr_in addr;
- struct rx_peer *peer = conn->peer;
- osi_socket socket;
-
-#ifdef RXDEBUG
- char deliveryType = 'S';
-
-#endif
-
- memset(&addr, 0, sizeof(addr));
-
- /* The address we're sending the packet to */
- addr.sin_family = AF_INET;
- addr.sin_port = peer->port;
- addr.sin_addr.s_addr = peer->host;
-
- /*
- * This stuff should be revamped, I think, so that most, if not all, of
- * the header stuff is always added here. We could probably do away with
- * the encode/decode routines. XXXXX
- */
-
- /*
- * Stamp each packet with a unique serial number. The serial number is
- * maintained on a connection basis because some types of security may be
- * based on the serial number of the packet, and security is handled on a
- * per authenticated-connection basis.
- */
-
- /*
- * Pre-increment, to guarantee no zero serial number; a zero serial
- * number means the packet was never sent.
- */
- p->header.serial = ++conn->serial;
-
- /*
- * This is so we can adjust retransmit time-outs better in the face of
- * rapidly changing round-trip times. RTO estimation is not a la Karn.
- */
- if (p->firstSerial == 0) {
- p->firstSerial = p->header.serial;
- }
-#ifdef RXDEBUG
-
- /*
- * If an output tracer function is defined, call it with the packet and
- * network address. Note this function may modify its arguments.
- */
- if (rx_almostSent) {
- int drop = (*rx_almostSent) (p, &addr);
-
- /* drop packet if return value is non-zero? */
- if (drop)
- deliveryType = 'D'; /* Drop the packet */
- }
-#endif
-
- /* Get network byte order header */
- rxi_EncodePacketHeader(p); /* XXX in the event of rexmit, etc,
- * don't need to touch ALL the fields */
-
- /*
- * Send the packet out on the same socket that related packets are being
- * received on
- */
- socket = (conn->type == RX_CLIENT_CONNECTION
- ? rx_socket : conn->service->socket);
-
-#ifdef RXDEBUG
- /* Possibly drop this packet, for testing purposes */
- if ((deliveryType == 'D') ||
- ((rx_intentionallyDroppedPacketsPer100 > 0) &&
- (random() % 100 < rx_intentionallyDroppedPacketsPer100))) {
- deliveryType = 'D'; /* Drop the packet */
- } else {
- deliveryType = 'S'; /* Send the packet */
-#endif /* RXDEBUG */
-
- /*
- * Loop until the packet is sent. We'd prefer just to use a blocking
- * socket, but unfortunately the interface doesn't allow us to have
- * the socket block in send mode, and not block in receive mode
- */
- GLOBAL_UNLOCK();
- if (osi_NetSend(socket, (char *)&addr, p->wirevec,
- p->niovecs, p->length + RX_HEADER_SIZE)) {
- /* send failed, so let's hurry up the resend, eh? */
- rx_stats.netSendFailures++;
- clock_Zero(&p->retryTime);
- p->header.serial = 0; /* Another way of saying never
- * transmitted... */
- }
- GLOBAL_LOCK();
-#ifdef RXDEBUG
- }
- dpf(("%c %d %s: %x.%u.%u.%u.%u.%u.%u flags %d, packet %x resend %d.%0.3d",
- deliveryType, p->header.serial, rx_packetTypes[p->header.type - 1],
- peer->host, peer->port, p->header.serial, p->header.epoch,
- p->header.cid, p->header.callNumber, p->header.seq, p->header.flags,
- p, p->retryTime.sec, p->retryTime.usec / 1000));
-#endif
- rx_stats.packetsSent[p->header.type - 1]++;
-}
-
-
-/*
- * Send a "special" packet to the peer connection. If call is
- * specified, then the packet is directed to a specific call channel
- * associated with the connection, otherwise it is directed to the
- * connection only. Uses optionalPacket if it is supplied, rather than
- * allocating a new packet buffer. Nbytes is the length of the data
- * portion of the packet. If data is non-null, nbytes of data are
- * copied into the packet. Type is the type of the packet, as defined
- * in rx.h. Bug: there's a lot of duplication between this and other
- * routines. This needs to be cleaned up.
- */
-struct rx_packet *
-rxi_SendSpecial(struct rx_call *call,
- struct rx_connection *conn,
- struct rx_packet *optionalPacket, int type, char *data,
- int nbytes)
-{
-
- /*
- * Some of the following stuff should be common code for all packet sends
- * (it's repeated elsewhere)
- */
- struct rx_packet *p;
- int i = 0;
- int savelen = 0;
- int saven = 0;
- int channel, callNumber;
-
- if (call) {
- channel = call->channel;
- callNumber = *call->callNumber;
- } else {
- channel = 0;
- callNumber = 0;
- }
- p = optionalPacket;
- if (!p) {
- p = rxi_AllocPacket(RX_PACKET_CLASS_SPECIAL);
- if (!p)
- osi_Panic("rxi_SendSpecial failure");
- }
- if (nbytes != -1)
- p->length = nbytes;
- else
- nbytes = p->length;
- p->header.serviceId = conn->serviceId;
- p->header.securityIndex = conn->securityIndex;
- p->header.cid = (conn->cid | channel);
- p->header.callNumber = callNumber;
- p->header.seq = 0;
- p->header.epoch = conn->epoch;
- p->header.type = type;
- p->header.flags = 0;
- if (conn->type == RX_CLIENT_CONNECTION)
- p->header.flags |= RX_CLIENT_INITIATED;
- if (data)
- rx_packetwrite(p, 0, nbytes, data);
-
- for (i = 1; i < p->niovecs; i++) {
- if (nbytes <= p->wirevec[i].iov_len) {
- savelen = p->wirevec[i].iov_len;
- saven = p->niovecs;
- p->wirevec[i].iov_len = nbytes;
- p->niovecs = i + 1; /* so condition fails because i ==
- * niovecs */
- } else
- nbytes -= p->wirevec[i].iov_len;
- }
-
- if (call)
- rxi_Send(call, p);
- else
- rxi_SendPacket(conn, p);
- if (saven) { /* means we truncated the packet
- * above. We probably don't */
- /* really need to do this, but it seems safer this way, given that */
- /* sneaky optionalPacket... */
- p->wirevec[i - 1].iov_len = savelen;
- p->niovecs = saven;
- }
- if (!optionalPacket)
- rxi_FreePacket(p);
- return optionalPacket;
-}
-
-
-static void
-put32 (unsigned char **p, uint32_t u)
-{
- (*p)[0] = (u >> 24) & 0xFF;
- (*p)[1] = (u >> 16) & 0xFF;
- (*p)[2] = (u >> 8) & 0xFF;
- (*p)[3] = (u >> 0) & 0xFF;
- (*p) += 4;
-}
-
-static uint32_t
-get32 (unsigned char **p)
-{
- uint32_t u;
-
- u = ((*p)[0] << 24) | ((*p)[1] << 16) | ((*p)[2] << 8) | (*p)[3];
- (*p) += 4;
- return u;
-}
-
-/* Encode the packet's header (from the struct header in the packet to
- * the net byte order representation in the wire representation of the
- * packet, which is what is actually sent out on the wire) */
-void
-rxi_EncodePacketHeader(struct rx_packet *p)
-{
- unsigned char *buf = (unsigned char *)p->wirevec[0].iov_base;
-
- memset(buf, 0, RX_HEADER_SIZE);
- put32(&buf, p->header.epoch);
- put32(&buf, p->header.cid);
- put32(&buf, p->header.callNumber);
- put32(&buf, p->header.seq);
- put32(&buf, p->header.serial);
- put32(&buf,
- ((((unsigned long) p->header.type) << 24)
- | (((unsigned long) p->header.flags) << 16)
- | (p->header.userStatus << 8) | p->header.securityIndex));
- /* Note: top 16 bits of this next word were reserved */
- put32(&buf,
- ((p->header.spare << 16) | (p->header.serviceId & 0xffff)));
-}
-
-/* Decode the packet's header (from net byte order to a struct header) */
-void
-rxi_DecodePacketHeader(struct rx_packet *p)
-{
- unsigned char *buf = (unsigned char *)p->wirevec[0].iov_base;
- uint32_t temp;
-
- p->header.epoch = get32(&buf);
- p->header.cid = get32(&buf);
- p->header.callNumber = get32(&buf);
- p->header.seq = get32(&buf);
- p->header.serial = get32(&buf);
- temp = get32(&buf);
- /* C will truncate byte fields to bytes for me */
- p->header.type = temp >> 24;
- p->header.flags = temp >> 16;
- p->header.userStatus = temp >> 8;
- p->header.securityIndex = temp >> 0;
- temp = get32(&buf);
- p->header.serviceId = (temp & 0xffff);
- p->header.spare = temp >> 16;
- /* Note: top 16 bits of this last word are the security checksum */
-}
-
-void
-rxi_PrepareSendPacket(struct rx_call *call,
- struct rx_packet *p, int last)
-{
- struct rx_connection *conn = call->conn;
- int len, i;
-
- p->acked = 0;
- p->header.cid = (conn->cid | call->channel);
- p->header.serviceId = conn->serviceId;
- p->header.securityIndex = conn->securityIndex;
- p->header.callNumber = *call->callNumber;
- p->header.seq = call->tnext++;
- p->header.epoch = conn->epoch;
- p->header.type = RX_PACKET_TYPE_DATA;
- p->header.flags = 0;
- p->header.spare = 0;
- if (conn->type == RX_CLIENT_CONNECTION)
- p->header.flags |= RX_CLIENT_INITIATED;
-
- if (last)
- p->header.flags |= RX_LAST_PACKET;
-
- clock_Zero(&p->retryTime); /* Never yet transmitted */
- p->header.serial = 0; /* Another way of saying never
- * transmitted... */
- p->backoff = 0;
-
- /*
- * Now that we're sure this is the last data on the call, make sure that
- * the "length" and the sum of the iov_lens matches.
- */
- len = p->length + call->conn->securityHeaderSize;
-
- for (i = 1; i < p->niovecs && len > 0; i++) {
- len -= p->wirevec[i].iov_len;
- }
- if (len > 0) {
- osi_Panic("PrepareSendPacket 1\n"); /* MTUXXX */
- } else {
- p->niovecs = i;
- p->wirevec[i - 1].iov_len += len;
- }
- RXS_PreparePacket(conn->securityObject, call, p);
-}
diff --git a/usr.sbin/afs/src/rx/rx_pkt.h b/usr.sbin/afs/src/rx/rx_pkt.h
deleted file mode 100644
index ae14a866068..00000000000
--- a/usr.sbin/afs/src/rx/rx_pkt.h
+++ /dev/null
@@ -1,301 +0,0 @@
-#ifndef _RX_PACKET_
-#define _RX_PACKET_
-#include "sys/uio.h"
-/*
- * this file includes the macros and decls which depend on packet
- * format, and related packet manipulation macros. Note that code
- * which runs at NETPRI should not sleep, or AIX will panic
- */
-/*
- * There are some assumptions that various code makes -- I'll try to
- * express them all here:
- * 1. rx_ReceiveAckPacket assumes that it can get an entire ack
- * contiguous in the first iovec. As a result, the iovec buffers must
- * be >= sizeof (struct rx_ackpacket)
- * 2. All callers of rx_Pullup besides rx_ReceiveAckPacket try to pull
- * up less data than rx_ReceiveAckPacket does.
- * 3. rx_GetLong and rx_PutLong (and the slow versions of same) assume
- * that the iovec buffers are all integral multiples of the word size,
- * and that the offsets are as well.
- */
-
-
-#ifndef MIN
-#define MIN(a,b) ((a)<(b)?(a):(b))
-#endif
-
-#define RX_IPUDP_SIZE 28
-
-/*
- * REMOTE_PACKET_SIZE is currently the same as local. This is because REMOTE
- * is defined much too generally for my tastes, and includes the case of
- * multiple class C nets connected with a router within one campus or MAN.
- * I don't want to make local performance suffer just because of some
- * out-dated protocol that used to be in use on the NSFANET that's
- * practically unused anymore. Any modern IP implementation will be
- * using MTU discovery, and even old routers shouldn't frag packets
- * when sending from one connected network directly to another. Maybe
- * the next release of RX will do MTU discovery.
- */
-
-/*
- * MTUXXX the various "MAX" params here must be rationalized. From now on,
- * the MAX packet size will be the maximum receive size, but the maximum send
- * size will be larger than that.
- */
-
-#ifdef notdef
-/* some sample MTUs
- 4352 what FDDI(RFC1188) uses... Larger?
- 4096 VJ's recommendation for FDDI
- 17914 what IBM 16MB TR uses
- 8166 IEEE 802.4
- 4464 IEEE 802.5 MAX
- 2002 IEEE 802.5 Recommended
- 1500 what Ethernet uses
- 1492 what 802.3 uses ( 8 bytes for 802.2 SAP )
-*/
-
-/* * * * these are the old defines
-*/
-#define RX_MAX_PACKET_SIZE (RX_MAX_DL_MTU -RX_IPUDP_SIZE)
-
-#define RX_MAX_PACKET_DATA_SIZE (RX_MAX_PACKET_SIZE-RX_HEADER_SIZE)
-#ifdef AFS_HPUX_ENV
-/* HPUX by default uses an 802.3 size, and it's not evident from SIOCGIFCONF */
-#define RX_LOCAL_PACKET_SIZE (1492 - RX_IPUDP_SIZE)
-#define RX_REMOTE_PACKET_SIZE (1492 - RX_IPUDP_SIZE)
-#else
-#define RX_LOCAL_PACKET_SIZE RX_MAX_PACKET_SIZE /* For hosts on same net */
-#define RX_REMOTE_PACKET_SIZE RX_MAX_PACKET_SIZE /* see note above */
-#endif
-
-#endif /* notdef */
-
-/* These are the new, streamlined ones.
- */
-#define RX_HEADER_SIZE 28
-
-#define OLD_MAX_PACKET_SIZE (1500 -RX_IPUDP_SIZE)
-#define RX_PP_PACKET_SIZE (576 +RX_HEADER_SIZE)
-
-/* if the other guy is not on the local net, use this size */
-#define RX_REMOTE_PACKET_SIZE (1500 - RX_IPUDP_SIZE)
-
-/* for now, never send more data than this */
-#define RX_MAX_PACKET_SIZE (16384 + RX_HEADER_SIZE)
-#define RX_MAX_PACKET_DATA_SIZE 16384
-
-
-/* Packet types, for rx_packet.type */
-#define RX_PACKET_TYPE_DATA 1 /* A vanilla data packet */
-#define RX_PACKET_TYPE_ACK 2 /* Acknowledge packet */
-#define RX_PACKET_TYPE_BUSY 3 /* Busy: can't accept call
- * immediately; try later */
-#define RX_PACKET_TYPE_ABORT 4 /* Abort packet. No response needed. */
-#define RX_PACKET_TYPE_ACKALL 5 /* Acknowledges receipt of all packets */
-#define RX_PACKET_TYPE_CHALLENGE 6 /* Challenge client's identity:
- * request credentials */
-#define RX_PACKET_TYPE_RESPONSE 7 /* Respond to challenge packet */
-#define RX_PACKET_TYPE_DEBUG 8 /* Get debug information */
-
-#define RX_PACKET_TYPE_PARAMS 9 /* exchange size params (showUmine) */
-#define RX_PACKET_TYPE_VERSION 13 /* get AFS version */
-
-
-#define RX_PACKET_TYPES {"data", "ack", "busy", "abort", "ackall", "challenge", "response", "debug", "params", "unused", "unused", "unused", "version"}
-#define RX_N_PACKET_TYPES 13 /* Must agree with above list; counts
- * 0 */
-
-/* Packet classes, for rx_AllocPacket */
-#define RX_PACKET_CLASS_RECEIVE 0
-#define RX_PACKET_CLASS_SEND 1
-#define RX_PACKET_CLASS_SPECIAL 2
-
-#define RX_N_PACKET_CLASSES 3 /* Must agree with above list */
-
-/* Flags for rx_header flags field */
-#define RX_CLIENT_INITIATED 1 /* Packet is sent/received from client
- * side of call */
-#define RX_REQUEST_ACK 2 /* Peer requests acknowledgement */
-#define RX_LAST_PACKET 4 /* This is the last packet from this
- * side of the call */
-#define RX_MORE_PACKETS 8 /* There are more packets following
- * this, i.e. the next sequence number
- * seen by the receiver should be
- * greater than this one, rather than
- * a resend of an earlier sequence
- * number */
-#define RX_SLOW_START_OK 32 /* Set this flag in an ack
- * packet to inform the sender
- * that slow start is supported
- * by the receiver. */
-
-/* The following flags are preset per packet, i.e. they don't change
- * on retransmission of the packet */
-#define RX_PRESET_FLAGS (RX_CLIENT_INITIATED | RX_LAST_PACKET)
-
-
-/* The rx part of the header of a packet, in host form */
-struct rx_header {
- uint32_t epoch; /* Start time of client process */
- uint32_t cid; /* Connection id (defined by client) */
- uint32_t callNumber; /* Current call number */
- uint32_t seq; /* Sequence number of this packet,
- * within this call */
- uint32_t serial; /* Serial number of this packet: a new
- * serial number is stamped on each
- * packet sent out */
- u_char type; /* RX packet type */
- u_char flags; /* Flags, defined below */
- u_char userStatus; /* User defined status information,
- * returned/set by macros
- * rx_Get/SetLocal/RemoteStatus */
- u_char securityIndex; /* Which service-defined security
- * method to use */
- u_short serviceId; /* service this packet is directed
- * _to_ */
-
- /*
- * This spare is now used for packet header checkksum. see
- * rxi_ReceiveDataPacket and packet cksum macros above for details.
- */
- u_short spare;
-};
-
-#define RX_MAXWVECS 10 /* most Unixes max is 16, so never let
- * this > 15 */
-/*
- * RX_FIRSTBUFFERSIZE must be larger than the largest ack packet,
- * the largest possible challenge or response packet.
- * Both Firstbuffersize and cbuffersize must be integral multiples of 8,
- * so the security header and trailer stuff works for rxkad_crypt. yuck.
- */
-
-#define RX_FIRSTBUFFERSIZE (OLD_MAX_PACKET_SIZE - RX_HEADER_SIZE - 4)
-#define RX_CBUFFERSIZE 1024
-
-#if 0
-#if defined(AFS_SUN5_ENV) || defined(AFS_AOS_ENV)
-#define RX_FIRSTBUFFERSIZE (OLD_MAX_PACKET_SIZE - RX_HEADER_SIZE)
-#define RX_CBUFFERSIZE 1012
-#else
-#define RX_FIRSTBUFFERSIZE 480 /* MTUXXX should be 1444 */
-#define RX_CBUFFERSIZE 504 /* MTUXXX change this to 1024 or 1012 */
-#endif /* AFS_SUN5_ENV */
-#endif
-
-struct rx_packet {
- struct rx_queue queueItemHeader; /* Packets are chained using the
- * queue.h package */
- struct clock retryTime; /* When this packet should NEXT be
- * re-transmitted */
- struct clock timeSent; /* When this packet was transmitted
- * last */
- uint32_t firstSerial; /* Original serial number of this
- * packet */
- struct clock firstSent; /* When this packet was transmitted
- * first */
- struct rx_header header; /* The internal packet header */
- int niovecs;
- struct iovec wirevec[RX_MAXWVECS + 1]; /* the new form of the packet */
- u_long wirehead[RX_HEADER_SIZE / sizeof(u_long)+1 ];
- u_long localdata[RX_FIRSTBUFFERSIZE / sizeof(u_long)+1];
- uint32_t dummy;
- u_char acked; /* This packet has been *tentatively*
- * acknowledged */
- u_char backoff; /* for multiple re-sends */
- u_short length; /* Data length */
-};
-
-struct rx_cbuf {
- struct rx_queue queueItemHeader;
- u_long data[(RX_CBUFFERSIZE / sizeof(u_long)) + 1];
-};
-
-/* Macros callable by security modules, to set header/trailer lengths,
- * set actual packet size, and find the beginning of the security
- * header (or data) */
-#define rx_SetSecurityHeaderSize(conn, length) ((conn)->securityHeaderSize = (length))
-#define rx_SetSecurityMaxTrailerSize(conn, length) ((conn)->securityMaxTrailerSize = (length))
-#define rx_GetSecurityHeaderSize(conn) ((conn)->securityHeaderSize)
-#define rx_GetSecurityMaxTrailerSize(conn) ((conn)->securityMaxTrailerSize)
-
-/* This is the address of the data portion of the packet. Any encryption
- * headers will be at this address, the actual data, for a data packet, will
- * start at this address + the connection's security header size. */
-#define rx_DataOf(packet) ((char *) (packet)->wirevec[1].iov_base)
-#define rx_GetDataSize(packet) ((packet)->length)
-#define rx_SetDataSize(packet, size) ((packet)->length = (size))
-
-/* These macros used in conjunction with reuse of packet header spare as a
- * packet cksum for rxkad security module. */
-#define rx_GetPacketCksum(packet) ((packet)->header.spare)
-#define rx_SetPacketCksum(packet, cksum) ((packet)->header.spare = (cksum))
-
-#define rxi_OverQuota(packetclass) (rx_nFreePackets - 1 < rx_packetQuota[packetclass])
-
-/* compat stuff */
-#define rx_GetLong(p,off) rx_SlowGetLong((p), (off))
-#define rx_PutLong(p,off,b) rx_SlowPutLong((p), (off), (b))
-
-#define rx_data(p, o, l) ((l=((struct rx_packet*)(p))->wirevec[(o+1)].iov_len),\
- (((struct rx_packet*)(p))->wirevec[(o+1)].iov_base))
-
-
-struct rx_packet *rx_AllocPacket(void);
-void rxi_MorePackets(int);
-void rx_CheckCbufs(unsigned long);
-void rxi_FreePacket(struct rx_packet *);
-int rxi_AllocDataBuf(struct rx_packet *, int);
-size_t rx_SlowReadPacket(struct rx_packet*, int, int, void*);
-size_t rx_SlowWritePacket(struct rx_packet*, int, int, void*);
-int rxi_RoundUpPacket(struct rx_packet *, unsigned int);
-
-uint32_t rx_SlowGetLong(struct rx_packet *packet, int offset);
-int rx_SlowPutLong(struct rx_packet *packet, int offset, uint32_t data);
-int rxi_FreeDataBufs(struct rx_packet *p, int first);
-
-int osi_NetSend(osi_socket socket, char *addr, struct iovec *dvec,
- int nvecs, int length);
-
-/* copy data into an RX packet */
-#define rx_packetwrite(p, off, len, in) \
- ( (off) + (len) > (p)->wirevec[1].iov_len ? \
- rx_SlowWritePacket(p, off, len, in) : \
- ((memcpy((char *)((p)->wirevec[1].iov_base)+(off), (in), (len))),0))
-
-/* copy data from an RX packet */
-#define rx_packetread(p, off, len, out) \
- ( (off) + (len) > (p)->wirevec[1].iov_len ? \
- rx_SlowReadPacket(p, off, len, out) : \
- ((memcpy((out), (char *)((p)->wirevec[1].iov_base)+(off), len)),0))
-
-#define rx_computelen(p,l) { int i; \
- for (l=0, i=1; i < p->niovecs; i++ ) l += p->wirevec[i].iov_len; }
-
-/* return what the actual contiguous space is: should be min(length,size) */
-/* The things that call this really want something like ...pullup MTUXXX */
-#define rx_Contiguous(p) MIN((p)->length,((p)->wirevec[1].iov_len))
-
-#ifndef TRUE
-#define TRUE 1
-#define FALSE 0
-#endif
-
-/* === packet-ized down to here, the following macros work temporarily */
-/* Unfortunately, they know that the cbuf stuff isn't there. */
-
-/* try to ensure that rx_DataOf will return a contiguous space at
- * least size bytes uint32_t */
-/* return what the actual contiguous space is: should be min(length,size) */
-#define rx_Pullup(p,size) /* this idea here is that this will
- * make a guarantee */
-
-
-/* The offset of the actual user's data in the packet, skipping any
- * security header */
-/* DEPRECATED: DON'T USE THIS! [ 93.05.03 lws ] */
-#define rx_UserDataOf(conn, packet) (((char *) (packet)->wirevec[1].iov_base) + (conn)->securityHeaderSize)
-
-#endif /* _RX_PACKET_ */
diff --git a/usr.sbin/afs/src/rx/rx_queue.h b/usr.sbin/afs/src/rx/rx_queue.h
deleted file mode 100644
index eadc1e1131e..00000000000
--- a/usr.sbin/afs/src/rx/rx_queue.h
+++ /dev/null
@@ -1,185 +0,0 @@
-/* $arla: /afs/stacken.kth.se/src/SourceRepository/arla/rx/rx_queue.h,v 1.4 2000/10/02 21:08:29 haba Exp $ */
-/* $arla: /afs/stacken.kth.se/src/SourceRepository/arla/rx/rx_queue.h,v $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/* queue.h: Simple double linked queue package */
-
-/* It's simple, but, I think, it's pretty nice to use, and it's *very* efficient (especially so with a good optimizing compiler). WARNING: Since these functions are implemented as macros, it is best to use only *VERY* simple expressions for all parameters. Double warning: this uses a lot of type coercion, so you have to be *REAL* careful. But C doesn't give me a reasonable alternative (i.e.. in-line expanded functions). */
-
-/* Author: Bob Sidebotham, ITC */
-
-#ifndef _RX_QUEUE_
-#define _RX_QUEUE_
-
-/* A queue head is simply a queue element linked to itself (i.e. the null queue is a queue with exactly one element). Queue elements can be prepended to any structure: these macros assume that the structure passed is coercible to a (struct q). Since all of these operations are implemented as macros, the user should beware of side-effects in macro parameters. Also beware that implicit casting of queue types occurs, so be careful to supply the right parameters at the right times! */
-#undef queue /* Since some OS (ultrix, etc) have
- * their own */
-struct rx_queue {
- struct rx_queue *prev;
- struct rx_queue *next;
-};
-
-/* Sample usages:
-
-(*A queue head:*)
-struct rx_queue myqueue;
-
-(*An element for my queue type:*)
-struct myelement {
- struct rx_queue queue_header;
- int mydata;
-};
-
-(*Initialize the queue:*)
-queue_Init(&myqueue);
-
-(*Append a bunch of items to the queue:*)
-for (i=0; i<20; i++) {
- struct myelement *item = (struct myelement *) malloc(sizeof *item);
- item->mydata = i;
- queue_Append(&myqueue, item);
-}
-
-(*Scan a queue, incrementing the mydata field in each element, and removing any entries for which mydata>MAX. Nqe is used by the scan to hold the next queue element, so the current queue element may be removed safely. *)
-struct myelement *qe, *nqe;
-for (queue_Scan(&myqueue, qe, nqe, myelement)) {
- if (++qe->mydata > MAX) queue_Remove(qe);
-}
-
-(* Count the number of elements in myqueue. The queue_Scan macro specifies all three elements of the for loop, but an additional initializer and an additional incrementor can be added *)
-struct myelement *qe, *nqe;
-int n;
-for (n=0, queue_Scan(&myqueue, qe, nqe, myelement), n++) {}
-
-*/
-
-/* INTERNAL macros */
-
-/* This one coerces the user's structure to a queue element (or queue head) */
-#define _RX_QUEUE(x) ((struct rx_queue *)(x))
-
-/* This one adds a queue element (i) before or after another queue element (or queue head) (q), doubly linking everything together. It's called by the user usable macros, below. If (a,b) is (next,prev) then the element i is linked after q; if it is (prev,next) then it is linked before q */
-/* N.B. I don't think it is possible to write this expression, correctly, with less than one comma (you can easily write an alternative expression with no commas that works with most or all compilers, but it's not clear that it really is un-ambiguous, legal C-code). */
-#define _QA(q,i,a,b) (((i->a=q->a)->b=i)->b=q, q->a=i)
-
-/* These ones splice two queues together. If (a,b) is (next,prev) then (*q2) is appended to (*q1), otherwise (*q2) is prepended to (*q1). */
-#define _QS(q1,q2,a,b) if (queue_IsEmpty(q2)); else \
- ((((q2->a->b=q1)->a->b=q2->b)->a=q1->a, q1->a=q2->a), queue_Init(q2))
-
-/* Basic remove operation. Doesn't update the queue item to indicate it's been removed */
-#define _QR(i) ((_RX_QUEUE(i)->prev->next=_RX_QUEUE(i)->next)->prev=_RX_QUEUE(i)->prev)
-
-/* EXPORTED macros */
-
-/* Initialize a queue head (*q). A queue head is just a queue element */
-#define queue_Init(q) (_RX_QUEUE(q))->prev = (_RX_QUEUE(q))->next = (_RX_QUEUE(q))
-
-/* Prepend a queue element (*i) to the head of the queue, after the queue head (*q). The new queue element should not currently be on any list. */
-#define queue_Prepend(q,i) _QA(_RX_QUEUE(q),_RX_QUEUE(i),next,prev)
-
-/* Append a queue element (*i) to the end of the queue, before the queue head (*q). The new queue element should not currently be on any list. */
-#define queue_Append(q,i) _QA(_RX_QUEUE(q),_RX_QUEUE(i),prev,next)
-
-/* Insert a queue element (*i2) before another element (*i1) in the queue. The new queue element should not currently be on any list. */
-#define queue_InsertBefore(i1,i2) _QA(_RX_QUEUE(i1),_RX_QUEUE(i2),prev,next)
-
-/* Insert a queue element (*i2) after another element (*i1) in the queue. The new queue element should not currently be on any list. */
-#define queue_InsertAfter(i1,i2) _QA(_RX_QUEUE(i1),_RX_QUEUE(i2),next,prev)
-
-/* Spice the members of (*q2) to the beginning of (*q1), re-initialize (*q2) */
-#define queue_SplicePrepend(q1,q2) _QS(_RX_QUEUE(q1),_RX_QUEUE(q2),next,prev)
-
-/* Splice the members of queue (*q2) to the end of (*q1), re-initialize (*q2) */
-#define queue_SpliceAppend(q1,q2) _QS(_RX_QUEUE(q1),_RX_QUEUE(q2),prev,next)
-
-/* Replace the queue (*q1) with the contents of the queue (*q2), re-initialize (*q2) */
-#define queue_Replace(q1,q2) if (queue_IsEmpty(q2)) queue_Init(q1); else \
- (*_RX_QUEUE(q1) = *_RX_QUEUE(q2), _RX_QUEUE(q1)->next->prev = _RX_QUEUE(q1)->prev->next = _RX_QUEUE(q1), queue_Init(q2))
-
-/* Remove a queue element (*i) from it's queue. The next and prev field is 0'd, so that any further use of this q entry will hopefully cause a core dump. Multiple removes of the same queue item are not supported */
-#define queue_Remove(i) (_QR(i), _RX_QUEUE(i)->next = 0, _RX_QUEUE(i)->prev = 0 )
-
-/* Move the queue element (*i) from it's queue to the end of the queue (*q) */
-#define queue_MoveAppend(q,i) (_QR(i), queue_Append(q,i))
-
-/* Move the queue element (*i) from it's queue to the head of the queue (*q) */
-#define queue_MovePrepend(q,i) (_QR(i), queue_Prepend(q,i))
-
-/* Return the first element of a queue, coerced too the specified structure s */
-/* Warning: this returns the queue head, if the queue is empty */
-#define queue_First(q,s) ((struct s *)_RX_QUEUE(q)->next)
-
-/* Return the last element of a queue, coerced to the specified structure s */
-/* Warning: this returns the queue head, if the queue is empty */
-#define queue_Last(q,s) ((struct s *)_RX_QUEUE(q)->prev)
-
-/* Return the next element in a queue, beyond the specified item, coerced to the specified structure s */
-/* Warning: this returns the queue head, if the item specified is the last in the queue */
-#define queue_Next(i,s) ((struct s *)_RX_QUEUE(i)->next)
-
-/* Return the previous element to a specified element of a queue, coerced to the specified structure s */
-/* Warning: this returns the queue head, if the item specified is the first in the queue */
-#define queue_Prev(i,s) ((struct s *)_RX_QUEUE(i)->prev)
-
-/* Return true if the queue is empty, i.e. just consists of a queue head. The queue head must have been initialized some time prior to this call */
-#define queue_IsEmpty(q) (_RX_QUEUE(q)->next == _RX_QUEUE(q))
-
-/* Return true if the queue is non-empty, i.e. consists of a queue head plus at least one queue item */
-#define queue_IsNotEmpty(q) (_RX_QUEUE(q)->next != _RX_QUEUE(q))
-
-/* Return true if the queue item is currently in a queue */
-/* Returns false if the item was removed from a queue OR is uninitialized (zero) */
-#define queue_IsOnQueue(i) (_RX_QUEUE(i)->next != 0)
-
-/* Returns true if the queue item (i) is the first element of the queue (q) */
-#define queue_IsFirst(q,i) (_RX_QUEUE(q)->first == _RX_QUEUE(i))
-
-/* Returns true if the queue item (i) is the last element of the queue (q) */
-#define queue_IsLast(q,i) (_RX_QUEUE(q)->prev == _RX_QUEUE(i))
-
-/* Returns true if the queue item (i) is the end of the queue (q), that is, i is the head of the queue */
-#define queue_IsEnd(q,i) (_RX_QUEUE(q) == _RX_QUEUE(i))
-
-/* Prototypical loop to scan an entire queue forwards. q is the queue
- * head, qe is the loop variable, next is a variable used to store the
- * queue entry for the next iteration of the loop, s is the user's
- * queue structure name. Called using "for (queue_Scan(...)) {...}".
- * Note that extra initializers can be added before the queue_Scan,
- * and additional expressions afterwards. So "for (sum=0,
- * queue_Scan(...), sum += value) {value = qe->value}" is possible.
- * If the current queue entry is deleted, the loop will work
- * correctly. Care must be taken if other elements are deleted or
- * inserted. Next may be updated within the loop to alter the item
- * used in the next iteration. */
-#define queue_Scan(q, qe, next, s) \
- (qe) = queue_First(q, s), next = queue_Next(qe, s); \
- !queue_IsEnd(q, qe); \
- (qe) = (next), next = queue_Next(qe, s)
-
-/* This is similar to queue_Scan, but scans from the end of the queue to the beginning. Next is the previous queue entry. */
-#define queue_ScanBackwards(q, qe, prev, s) \
- (qe) = queue_Last(q, s), prev = queue_Prev(qe, s); \
- !queue_IsEnd(q, qe); \
- (qe) = prev, prev = queue_Prev(qe, s)
-
-#endif /* _RX_QUEUE_ */
diff --git a/usr.sbin/afs/src/rx/rx_rdwr.c b/usr.sbin/afs/src/rx/rx_rdwr.c
deleted file mode 100644
index fa9526efae3..00000000000
--- a/usr.sbin/afs/src/rx/rx_rdwr.c
+++ /dev/null
@@ -1,437 +0,0 @@
-#include "rx_locl.h"
-
-RCSID("$arla: rx_rdwr.c,v 1.9 2002/12/15 11:45:19 lha Exp $");
-
-int
-rx_Read(struct rx_call *call, void *vbuf, int nbytes)
-{
- struct rx_packet *rp;
- int requestCount;
- char *buf = (char *)vbuf;
-
- SPLVAR;
-/* XXXX took out clock_NewTime from here. Was it needed? */
- requestCount = nbytes;
-
- NETPRI;
- GLOBAL_LOCK();
- RX_MUTEX_ENTER(&call->lock);
-
- while (nbytes) {
- if (call->nLeft == 0) {
- /* Get next packet */
- for (;;) {
- if (call->error || (call->mode != RX_MODE_RECEIVING)) {
- if (call->error) {
- RX_MUTEX_EXIT(&call->lock);
- GLOBAL_UNLOCK();
- USERPRI;
- return 0;
- }
- if (call->mode == RX_MODE_SENDING) {
- rx_FlushWrite(call);
- continue;
- }
- }
- if (queue_IsNotEmpty(&call->rq)) {
- /* Check that next packet available is next in sequence */
- rp = queue_First(&call->rq, rx_packet);
- if (rp->header.seq == call->rnext) {
- long error;
- struct rx_connection *conn = call->conn;
-
- queue_Remove(rp);
-
- /*
- * RXS_CheckPacket called to undo RXS_PreparePacket's
- * work. It may reduce the length of the packet by
- * up to conn->maxTrailerSize, to reflect the length
- * of the data + the header.
- */
- if ((error = RXS_CheckPacket(conn->securityObject,
- call, rp)) != 0) {
-
- /*
- * Used to merely shut down the call, but now we
- * shut down the whole connection since this may
- * indicate an attempt to hijack it
- */
- rxi_ConnectionError(conn, error);
- rp = rxi_SendConnectionAbort(conn, rp);
- rxi_FreePacket(rp);
-
- RX_MUTEX_EXIT(&call->lock);
- GLOBAL_UNLOCK();
- USERPRI;
- return 0;
- }
- call->rnext++;
- call->currentPacket = rp;
- call->curvec = 1; /* 0th vec is always header */
-
- /*
- * begin at the beginning [ more or less ], continue
- * on until the end, then stop.
- */
- call->curpos = call->conn->securityHeaderSize;
-
- /*
- * Notice that this code works correctly if the data
- * size is 0 (which it may be--no reply arguments
- * from server, for example). This relies heavily on
- * the fact that the code below immediately frees the
- * packet (no yields, etc.). If it didn't, this
- * would be a problem because a value of zero for
- * call->nLeft normally means that there is no read
- * packet
- */
- call->nLeft = rp->length;
- if (rp->header.flags & RX_LAST_PACKET)
- call->flags |= RX_CALL_RECEIVE_DONE;
-
- /*
- * now, if we haven't send a hard ack for window/2
- * packets we spontaneously generate one, to take
- * care of the case where (most likely in the kernel)
- * we receive a window-full of packets, and ack all
- * of them before any are read by the user, thus not
- * hard-acking any of them. The sender retransmits
- * in this case only under a timer, which is a real
- * loser
- */
-
- {
- int ack_window;
-
-#ifdef ADAPT_WINDOW
- ack_window = call->conn->peer->maxWindow >> 1;
-#else /* !ADAPT_WINDOW */
- ack_window = rx_Window >> 1;
-#endif/* ADAPT_WINDOW */
-
- if (call->rnext > (call->lastAcked + ack_window))
- rxi_SendAck(call, 0, 0, 0, 0, RX_ACK_DELAY);
- }
- break;
- }
- }
-/*
-MTUXXX doesn't there need to be an "else" here ???
-*/
- /* Are there ever going to be any more packets? */
- if (call->flags & RX_CALL_RECEIVE_DONE) {
- RX_MUTEX_EXIT(&call->lock);
- GLOBAL_UNLOCK();
- USERPRI;
- return requestCount - nbytes;
- }
- /* Wait for in-sequence packet */
- call->flags |= RX_CALL_READER_WAIT;
- clock_NewTime();
- call->startWait = clock_Sec();
-
- RX_MUTEX_EXIT(&call->lock);
- RX_MUTEX_ENTER(&call->lockq);
-#ifdef RX_ENABLE_LOCKS
- while (call->flags & RX_CALL_READER_WAIT)
- cv_wait(&call->cv_rq, &call->lockq);
-#else
- osi_rxSleep(&call->rq);
-#endif
- RX_MUTEX_EXIT(&call->lockq);
- RX_MUTEX_ENTER(&call->lock);
-
- call->startWait = 0;
- }
- } else { /* assert(call->currentPacket); */
- /*
- * MTUXXX this should be replaced by
- * some error-recovery code before
- * shipping
- */
- /*
- * It's possible for call->nLeft to be smaller than
- * any particular iov_len. Usually, recvmsg doesn't change the
- * iov_len, since it reflects the size of the buffer. We have to
- * keep track of the number of bytes read in the length field of
- * the packet struct. On the final portion of a received packet,
- * it's almost certain that call->nLeft will be smaller than the
- * final buffer.
- */
- unsigned int t, l1;
- caddr_t p1;
-
- while (nbytes && call->currentPacket) {
- p1 = (char*)call->currentPacket->wirevec[call->curvec].iov_base +
- call->curpos;
- l1 = call->currentPacket->wirevec[call->curvec].iov_len -
- call->curpos;
-
- t = MIN(l1, nbytes);
- t = MIN(t, call->nLeft);
- memcpy(buf, p1, t);
- p1 += t;
- buf += t;
- l1 -= t;
- nbytes -= t;
- call->curpos += t;
- call->nLeft -= t;
-
- if (call->nLeft == 0) {
- /* out of packet. Get another one. */
- rxi_FreePacket(call->currentPacket);
- call->currentPacket = NULL;
- } else if (l1 == 0) {
- /* need to get another struct iov */
- if (++call->curvec > call->currentPacket->niovecs) {
- /*
- * current packet is exhausted, get ready for another
- */
-
- /*
- * don't worry about curvec and stuff, they get set
- * somewhere else
- */
- rxi_FreePacket(call->currentPacket);
- call->currentPacket = NULL;
- call->nLeft = 0;
- } else
- call->curpos = 0;
- }
- }
- if (nbytes == 0) {
- /* user buffer is full, return */
- RX_MUTEX_EXIT(&call->lock);
- GLOBAL_UNLOCK();
- USERPRI;
- return requestCount;
- }
- }
-
- } /* while (nbytes) ... */
-
- RX_MUTEX_EXIT(&call->lock);
- GLOBAL_UNLOCK();
- USERPRI;
- return requestCount;
-}
-
-int
-rx_Write(struct rx_call *call, const void *vbuf, int nbytes)
-{
- struct rx_connection *conn = call->conn;
- int requestCount = nbytes;
- const char *buf = (const char *)vbuf;
-
- SPLVAR;
-
- GLOBAL_LOCK();
- RX_MUTEX_ENTER(&call->lock);
- NETPRI;
- if (call->mode != RX_MODE_SENDING) {
- if ((conn->type == RX_SERVER_CONNECTION)
- && (call->mode == RX_MODE_RECEIVING)) {
- call->mode = RX_MODE_SENDING;
- if (call->currentPacket) {
- rxi_FreePacket(call->currentPacket);
- call->currentPacket = NULL;
- call->nLeft = 0;
- call->nFree = 0;
- }
- } else {
- RX_MUTEX_EXIT(&call->lock);
- GLOBAL_UNLOCK();
- USERPRI;
- return 0;
- }
- }
-
- /*
- * Loop condition is checked at end, so that a write of 0 bytes will
- * force a packet to be created--specially for the case where there are 0
- * bytes on the stream, but we must send a packet anyway.
- */
- do {
- if (call->nFree == 0) {
- struct rx_packet *cp = call->currentPacket;
-
- if (!call->error && call->currentPacket) {
- clock_NewTime(); /* Bogus: need new time package */
-
- /*
- * The 0, below, specifies that it is not the last packet:
- * there will be others. PrepareSendPacket may alter the
- * packet length by up to conn->securityMaxTrailerSize
- */
- rxi_PrepareSendPacket(call, cp, 0);
- queue_Append(&call->tq, cp);
- rxi_Start(0, call);
- }
- /* Wait for transmit window to open up */
- while (!call->error &&
- call->tnext + 1 > call->tfirst + call->twind) {
- clock_NewTime();
- call->startWait = clock_Sec();
-
- RX_MUTEX_EXIT(&call->lock);
- RX_MUTEX_ENTER(&call->lockw);
-
-#ifdef RX_ENABLE_LOCKS
- cv_wait(&call->cv_twind, &call->lockw);
-#else
- call->flags |= RX_CALL_WAIT_WINDOW_ALLOC;
- osi_rxSleep(&call->twind);
-#endif
- RX_MUTEX_EXIT(&call->lockw);
- RX_MUTEX_ENTER(&call->lock);
-
- call->startWait = 0;
- }
- if ((call->currentPacket = rxi_AllocSendPacket(call,
- nbytes)) != 0) {
- call->nFree = call->currentPacket->length;
- call->curvec = 1; /* 0th vec is always header */
-
- /*
- * begin at the beginning [ more or less ], continue on until
- * the end, then stop.
- */
- call->curpos = call->conn->securityHeaderSize;
- }
- if (call->error) {
- if (call->currentPacket) {
- rxi_FreePacket(call->currentPacket);
- call->currentPacket = NULL;
- }
- RX_MUTEX_EXIT(&call->lock);
- GLOBAL_UNLOCK();
- USERPRI;
- return 0;
- }
- }
-
- /*
- * If the remaining bytes fit in the buffer, then store them and
- * return. Don't ship a buffer that's full immediately to the
- * peer--we don't know if it's the last buffer yet
- */
-
- if (!(call->currentPacket)) {
- call->nFree = 0;
- }
- {
- struct rx_packet *cp = call->currentPacket;
- unsigned int t, l1;
- caddr_t p1;
-
- while (nbytes && call->nFree) {
- p1 = (char *)cp->wirevec[call->curvec].iov_base + call->curpos;
- l1 = cp->wirevec[call->curvec].iov_len - call->curpos;
-
- t = MIN(call->nFree, MIN(l1, nbytes));
- memcpy(p1, buf, t);
- p1 += t;
- buf += t;
- l1 -= t;
- nbytes -= t;
- call->curpos += t;
- call->nFree -= t;
-
- if (!l1) {
- call->curpos = 0;
- /* need to get another struct iov */
- if (++call->curvec >= cp->niovecs) {
- /* current packet is full, extend or send it */
- call->nFree = 0;
- }
- }
- if (!call->nFree) {
- int len, mud;
-
- len = cp->length;
- mud = rx_MaxUserDataSize(conn);
- if (mud > len) {
- int want;
-
- if (nbytes)
- want = MIN(nbytes, mud - len);
- else
- want = mud - len;
- rxi_AllocDataBuf(cp, want);
- if (cp->length > mud)
- cp->length = mud;
- call->nFree += (cp->length - len);
- }
- }
- } /*
- * while bytes to send and room to
- * send them
- */
- /* might be out of space now */
- if (!nbytes) {
- RX_MUTEX_EXIT(&call->lock);
- GLOBAL_UNLOCK();
- USERPRI;
- return requestCount;
- } else; /*
- * more data to send, so get another
- * packet and keep going
- */
- }
- } while (nbytes);
-
- RX_MUTEX_EXIT(&call->lock);
- GLOBAL_UNLOCK();
- USERPRI;
- return requestCount - nbytes;
-}
-
-/*
- * Flush any buffered data to the stream, switch to read mode
- * (clients) or to EOF mode (servers)
- */
-void
-rx_FlushWrite(struct rx_call *call)
-{
- SPLVAR;
- NETPRI;
- if (call->mode == RX_MODE_SENDING) {
- struct rx_packet *cp;
-
- call->mode = (call->conn->type == RX_CLIENT_CONNECTION ?
- RX_MODE_RECEIVING : RX_MODE_EOF);
-
- if (call->currentPacket) {
-
- /* cp->length is only supposed to be the user's data */
-
- cp = call->currentPacket;
-
- /*
- * cp->length was already set to (then-current) MaxUserDataSize
- * or less.
- */
- cp->length -= call->nFree;
- call->currentPacket = (struct rx_packet *) 0;
- call->nFree = 0;
-
-
- } else {
- cp = rxi_AllocSendPacket(call, 0);
- if (!cp) {
- /* Mode can no longer be MODE_SENDING */
- USERPRI;
- return;
- }
- cp->length = 0;
- cp->niovecs = 1; /* just the header */
- call->nFree = 0;
- }
-
- /* The 1 specifies that this is the last packet */
- rxi_PrepareSendPacket(call, cp, 1);
- queue_Append(&call->tq, cp);
- rxi_Start(0, call);
- }
- USERPRI;
-}
diff --git a/usr.sbin/afs/src/rx/rx_strm.h b/usr.sbin/afs/src/rx/rx_strm.h
deleted file mode 100644
index d44edc28123..00000000000
--- a/usr.sbin/afs/src/rx/rx_strm.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* $arla: /afs/stacken.kth.se/src/SourceRepository/arla/rx/rx_strm.h,v 1.3 1998/02/22 19:54:23 joda Exp $ */
-/* $arla: /afs/stacken.kth.se/src/SourceRepository/arla/rx/rx_strm.h,v $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/* rx_stream.h: the stream I/O layer for RX */
-
-This file is now obsolete.
-
-
-
-#ifndef _RX_STREAM_
-#define _RX_STREAM_
-
-#ifdef KERNEL
-#include "../rx/rx.h"
-#else /* KERNEL */
-#include <sys/types.h>
-#include <sys/uio.h>
-#include "rx.h"
-#endif /* KERNEL */
-
-/* Write descriptor */
-struct rx_stream_wd {
- char *freePtr; /* Pointer to bytes in first packet */
- int nFree; /* Number of bytes free in first
- * packet */
- struct rx_call *call; /* The call this stream is attached to */
- struct rx_queue wq; /* Currently allocated packets for
- * this stream */
- int packetSize; /* Data size used in each packet */
-};
-
-/* Read descriptor */
-struct rx_stream_rd {
- struct rx_packet *packet; /* The current packet */
- char *nextByte; /* Pointer to bytes in current packet */
- int nLeft; /* Number of bytes free in current
- * packet */
- struct rx_call *call; /* The call this stream is attached to */
- struct rx_queue rq; /* Currently allocated packets for
- * this stream */
- struct rx_queue freeTheseQ; /* These packets should be freed on
- * the next operation */
-};
-
-/* Composite stream descriptor */
-struct rx_stream {
- union {
- struct rx_stream_rd rd;
- struct rx_stream_wd wd;
- } sd;
-};
-
-/* Externals */
-void rx_stream_InitWrite();
-void rx_stream_InitRead();
-void rx_stream_FinishWrite();
-void rx_stream_FinishRead();
-int rx_stream_Read();
-int rx_stream_Write();
-int rx_stream_AllocIov();
-
-/* Write nbytes of data to the write stream. Returns the number of bytes written */
-/* If it returns 0, the call status should be checked with rx_Error. */
-#define rx_stream_Write(iod, buf, nbytes) \
- (iod)->sd.wd.nFree > (nbytes) ? \
- (buf) && memcpy((iod)->sd.wd.freePtr, (buf), (nbytes)), \
- (iod)->sd.wd.nFree -= (nbytes), \
- (iod)->sd.wd.freePtr += (nbytes), (nbytes) \
- : rx_stream_WriteProc((iod), (buf), (nbytes))
-
-
-/* Read nbytes of data from the read stream. Returns the number of bytes read */
-/* If it returns less than requested, the call status should be checked with rx_Error */
-#define rx_stream_Read(iod, buf, nbytes) \
- (iod)->sd.rd.nLeft > (nbytes) ? \
- memcpy((buf), (iod)->sd.rd.nextByte, (nbytes)), \
- (iod)->sd.rd.nLeft -= (nbytes), (iod)->sd.rd.nextByte += (nbytes), (nbytes) \
- : rx_stream_ReadProc((iod), (buf), (nbytes))
-
-#endif /* _RX_STREAM_ End of rx_stream.h */
diff --git a/usr.sbin/afs/src/rx/rx_trace.c b/usr.sbin/afs/src/rx/rx_trace.c
deleted file mode 100644
index 54e9b236746..00000000000
--- a/usr.sbin/afs/src/rx/rx_trace.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#include "rx_locl.h"
-
-RCSID("$arla: rx_trace.c,v 1.8 2002/04/28 22:19:18 lha Exp $");
-
-#ifdef RXTRACEON
-char rxi_tracename[80] = "/tmp/rxcalltrace";
-
-#else
-char rxi_tracename[80] = "\0Change This pathname (and preceding NUL) to initiate tracing";
-
-#endif
-
-#ifdef RXDEBUG
-
-int rxi_logfd = 0;
-char rxi_tracebuf[4096];
-unsigned long rxi_tracepos = 0;
-
-struct rx_trace rxtinfo;
-
-void
-rxi_flushtrace(void)
-{
- write(rxi_logfd, rxi_tracebuf, rxi_tracepos);
- rxi_tracepos = 0;
-}
-
-void
-rxi_calltrace(unsigned int event, struct rx_call *call)
-{
- struct clock now;
-
- if (!rxi_tracename[0])
- return;
-
- if (!rxi_logfd) {
- rxi_logfd = open(rxi_tracename, O_WRONLY | O_CREAT | O_TRUNC, 0777);
- if (!rxi_logfd)
- rxi_tracename[0] = '\0';
- }
- clock_GetTime(&now);
-
- rxtinfo.event = event;
- rxtinfo.now = now.sec * 1000 + now.usec / 1000;
- rxtinfo.cid = call->conn->cid;
- rxtinfo.call = *(call->callNumber);
- rxtinfo.qlen = rx_nWaiting;
- rxtinfo.servicetime = 0;
- rxtinfo.waittime = 0;
-
- switch (event) {
- case RX_CALL_END:
- clock_Sub(&now, &(call->traceStart));
- rxtinfo.servicetime = now.sec * 10000 + now.usec / 100;
- if (call->traceWait.sec) {
- now = call->traceStart;
- clock_Sub(&now, &(call->traceWait));
- rxtinfo.waittime = now.sec * 10000 + now.usec / 100;
- } else
- rxtinfo.waittime = 0;
- call->traceWait.sec = call->traceWait.usec =
- call->traceStart.sec = call->traceStart.usec = 0;
- break;
-
- case RX_CALL_START:
- call->traceStart = now;
- if (call->traceWait.sec) {
- clock_Sub(&now, &(call->traceWait));
- rxtinfo.waittime = now.sec * 10000 + now.usec / 100;
- } else
- rxtinfo.waittime = 0;
- break;
-
- case RX_TRACE_DROP:
- if (call->traceWait.sec) {
- clock_Sub(&now, &(call->traceWait));
- rxtinfo.waittime = now.sec * 10000 + now.usec / 100;
- } else
- rxtinfo.waittime = 0;
- break;
-
- case RX_CALL_ARRIVAL:
- call->traceWait = now;
- default:
- break;
- }
-
- memcpy(rxi_tracebuf + rxi_tracepos, &rxtinfo, sizeof(struct rx_trace));
- rxi_tracepos += sizeof(struct rx_trace);
- if (rxi_tracepos >= (4096 - sizeof(struct rx_trace)))
- rxi_flushtrace();
-}
-
-#endif /* RXDEBUG */
-
diff --git a/usr.sbin/afs/src/rx/rx_trace.h b/usr.sbin/afs/src/rx/rx_trace.h
deleted file mode 100644
index 16bb82af598..00000000000
--- a/usr.sbin/afs/src/rx/rx_trace.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/* $arla: rx_trace.h,v 1.5 2002/04/28 22:19:39 lha Exp $ */
-
-#ifndef _RX_TRACE
-#define _RX_TRACE
-
-#ifndef RXDEBUG
-#define rxi_calltrace(a,b)
-#define rxi_flushtrace()
-#else
-void rxi_calltrace(unsigned int, struct rx_call*);
-void rxi_flushtrace(void);
-
-#define RX_CALL_ARRIVAL 0
-#define RX_CALL_START 1
-#define RX_CALL_END 2
-#define RX_TRACE_DROP 3
-
-struct rx_trace {
- unsigned long cid;
- unsigned short call;
- unsigned short qlen;
- unsigned long now;
- unsigned long waittime;
- unsigned long servicetime;
- unsigned long event;
-};
-
-extern char rxi_tracename[80];
-
-#endif /* RXDEBUG */
-
-#endif /* _RX_TRACE */
diff --git a/usr.sbin/afs/src/rx/rx_user.c b/usr.sbin/afs/src/rx/rx_user.c
deleted file mode 100644
index 5d815eb23db..00000000000
--- a/usr.sbin/afs/src/rx/rx_user.c
+++ /dev/null
@@ -1,609 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/*
- * rx_user.c contains routines specific to the user space UNIX
- * implementation of rx
- */
-
-#include "rx_locl.h"
-
-RCSID("$arla: rx_user.c,v 1.21 2003/04/08 22:14:04 lha Exp $");
-
-#ifndef IPPORT_USERRESERVED
-/*
- * If in.h doesn't define this, define it anyway. Unfortunately, defining
- * this doesn't put the code into the kernel to restrict kernel assigned
- * port numbers to numbers below IPPORT_USERRESERVED...
- */
-#define IPPORT_USERRESERVED 5000
-#endif
-
-static osi_socket *rx_sockets = NULL;
-static int num_rx_sockets = 0;
-
-static fd_set rx_selectMask;
-static int rx_maxSocketNumber = -1; /* Maximum socket number represented
- * in the select mask */
-static PROCESS rx_listenerPid; /* LWP process id of socket listener
- * process */
-void rxi_Listener(void);
-
-/*
- * This routine will get called by the event package whenever a new,
- * earlier than others, event is posted. If the Listener process
- * is blocked in selects, this will unblock it. It also can be called
- * to force a new trip through the rxi_Listener select loop when the set
- * of file descriptors it should be listening to changes...
- */
-void
-rxi_ReScheduleEvents(void)
-{
- if (rx_listenerPid)
- IOMGR_Cancel(rx_listenerPid);
-}
-
-void
-rxi_StartListener(void)
-{
- /* Initialize LWP & IOMGR in case no one else has */
- PROCESS junk;
-
- LWP_InitializeProcessSupport(LWP_NORMAL_PRIORITY, &junk);
- IOMGR_Initialize();
-
- /* Priority of listener should be high, so it can keep conns alive */
-#define RX_LIST_STACK 24000
- LWP_CreateProcess(rxi_Listener, RX_LIST_STACK, LWP_MAX_PRIORITY, 0,
- "rx_Listener", &rx_listenerPid);
-}
-
-/*
- * Called by rx_StartServer to start up lwp's to service calls.
- * NExistingProcs gives the number of procs already existing, and which
- * therefore needn't be created.
- */
-void
-rxi_StartServerProcs(int nExistingProcs)
-{
- struct rx_service *service;
- int i;
- int maxdiff = 0;
- int nProcs = 0;
- PROCESS scratchPid;
-
- /*
- * For each service, reserve N processes, where N is the "minimum" number
- * of processes that MUST be able to execute a request in parallel, at
- * any time, for that process. Also compute the maximum difference
- * between any service's maximum number of processes that can run (i.e.
- * the maximum number that ever will be run, and a guarantee that this
- * number will run if other services aren't running), and its minimum
- * number. The result is the extra number of processes that we need in
- * order to provide the latter guarantee
- */
- for (i = 0; i < RX_MAX_SERVICES; i++) {
- int diff;
-
- service = rx_services[i];
- if (service == (struct rx_service *) 0)
- break;
- nProcs += service->minProcs;
- diff = service->maxProcs - service->minProcs;
- if (diff > maxdiff)
- maxdiff = diff;
- }
- nProcs += maxdiff; /* Extra processes needed to allow max
- * number requested to run in any
- * given service, under good
- * conditions */
- nProcs -= nExistingProcs; /* Subtract the number of procs that
- * were previously created for use as
- * server procs */
- for (i = 0; i < nProcs; i++) {
- LWP_CreateProcess(rx_ServerProc, rx_stackSize, RX_PROCESS_PRIORITY, 0,
- "rx_ServerProc", &scratchPid);
- }
-}
-
-/*
- * Make a socket for receiving/sending IP packets. Set it into non-blocking
- * and large buffering modes. If port isn't specified, the kernel will pick
- * one. Returns the socket (>= 0) on success. Returns OSI_NULLSOCKET on
- * failure.
- *
- * Port must be in network byte order.
- */
-
-osi_socket
-rxi_GetUDPSocket(uint16_t port, uint16_t *retport)
-{
- int code;
- osi_socket socketFd = OSI_NULLSOCKET;
- osi_socket *sockets;
- struct sockaddr_in taddr;
- char *name = "rxi_GetUDPSocket: ";
- int sa_size;
-
- sockets = realloc(rx_sockets, (num_rx_sockets + 1) * sizeof(*rx_sockets));
- if (sockets == NULL) {
- perror("socket");
- osi_Msg(("%sunable to allocated memory for UDP socket\n", name));
- return OSI_NULLSOCKET;
- }
- rx_sockets = sockets;
-
- socketFd = socket(AF_INET, SOCK_DGRAM, 0);
- if (socketFd < 0) {
- perror("socket");
- osi_Msg(("%sunable to create UDP socket\n", name));
- return OSI_NULLSOCKET;
- }
-
- if (socketFd >= FD_SETSIZE) {
- osi_Msg(("socket fd too large\n"));
- close(socketFd);
- return OSI_NULLSOCKET;
- }
-
- rx_sockets[num_rx_sockets] = socketFd;
- num_rx_sockets++;
-
-#ifdef SO_BSDCOMPAT
- {
- int one = 1;
- setsockopt (socketFd, SOL_SOCKET, SO_BSDCOMPAT, &one, sizeof(one));
- }
-#endif
-
- if (rx_maxSocketNumber < 0)
- FD_ZERO(&rx_selectMask);
-
- FD_SET(socketFd, &rx_selectMask);
- if (socketFd > rx_maxSocketNumber)
- rx_maxSocketNumber = socketFd;
-
- memset (&taddr, 0, sizeof(taddr));
- taddr.sin_family = AF_INET;
- taddr.sin_port = port;
-
- code = bind(socketFd, (struct sockaddr *) &taddr, sizeof(taddr));
- if (code < 0) {
- perror("bind");
- osi_Msg(("%sunable to bind UDP socket\n", name));
- goto error;
- }
-
- sa_size = sizeof(taddr);
- code = getsockname(socketFd, (struct sockaddr *) &taddr, &sa_size);
- if (code < 0) {
- perror("getsockname");
- osi_Msg(("%sunable to bind UDP socket\n", name));
- goto error;
- }
- if (retport)
- *retport = taddr.sin_port;
-
- /*
- * Use one of three different ways of getting a socket buffer expanded to
- * a reasonable size
- */
- {
- int len1, len2;
-
- len1 = len2 = 32766;
-
- rx_stats.socketGreedy =
- (setsockopt(socketFd, SOL_SOCKET, SO_SNDBUF,
- &len1, sizeof(len1)) >= 0) &&
- (setsockopt(socketFd, SOL_SOCKET, SO_RCVBUF,
- &len2, sizeof(len2)) >= 0);
- }
-
- if (!rx_stats.socketGreedy)
- osi_Msg(("%s*WARNING* Unable to increase buffering on socket\n",name));
-
- /*
- * Put it into non-blocking mode so that rx_Listener can do a polling
- * read before entering select
- */
- if (fcntl(socketFd, F_SETFL, FNDELAY) == -1) {
- perror("fcntl");
- osi_Msg(("%sunable to set non-blocking mode on socket\n", name));
- goto error;
- }
- return socketFd;
-
-error:
- num_rx_sockets--;
- rx_sockets[num_rx_sockets] = OSI_NULLSOCKET;
-
- close(socketFd);
-
- return OSI_NULLSOCKET;
-}
-
-/*
- * The main loop which listens to the net for datagrams, and handles timeouts
- * and retransmissions, etc. It also is responsible for scheduling the
- * execution of pending events (in conjunction with event.c).
- *
- * Note interaction of nextPollTime and lastPollWorked. The idea is
- * that if rx is not keeping up with the incoming stream of packets
- * (because there are threads that are interfering with its running
- * sufficiently often), rx does a polling select using IOMGR_Select
- * (setting tv_sec = tv_usec = 0). Old code is a system select, but
- * this was bad since we didn't know what calling conversion the
- * system select() was using (on win32 hosts it was PASCAL, and you
- * lost your $sp)
- *
- * So, our algorithm is that if the last poll on the file descriptor found
- * useful data, or we're at the time nextPollTime (which is advanced so that
- * it occurs every 3 or 4 seconds),
- * then we try the polling select. If we eventually
- * catch up (which we can tell by the polling select returning no input
- * packets ready), then we don't do a polling select again until several
- * seconds later (via nextPollTime mechanism).
- */
-
-#ifndef FD_COPY
-#define FD_COPY(f, t) memcpy((t), (f), sizeof(*(f)))
-#endif
-
-void
-rxi_Listener(void)
-{
- uint32_t host;
- uint16_t port;
- struct rx_packet *p = NULL;
- fd_set rfds;
- int socket;
- int fds;
- struct clock cv;
- long nextPollTime; /* time to next poll FD before
- * sleeping */
- int lastPollWorked, doingPoll; /* true iff last poll was useful */
- struct timeval tv, *tvp;
-
- clock_NewTime();
- lastPollWorked = 0;
- nextPollTime = 0;
- for (;;) {
-
- /*
- * Grab a new packet only if necessary (otherwise re-use the old one)
- */
- if (p == NULL) {
- if ((p = rxi_AllocPacket(RX_PACKET_CLASS_RECEIVE)) == NULL)
- osi_Panic("rxi_Listener: no packets!"); /* Shouldn't happen */
- }
- /* Wait for the next event time or a packet to arrive. */
- /*
- * event_RaiseEvents schedules any events whose time has come and
- * then atomically computes the time to the next event, guaranteeing
- * that this is positive. If there is no next event, it returns 0
- */
- if (!rxevent_RaiseEvents(&cv))
- tvp = NULL;
- else {
-
- /*
- * It's important to copy cv to tv, because the 4.3 documentation
- * for select threatens that *tv may be updated after a select,
- * in future editions of the system, to indicate how much of the
- * time period has elapsed. So we shouldn't rely on tv not being
- * altered.
- */
- tv.tv_sec = cv.sec; /* Time to next event */
- tv.tv_usec = cv.usec;
- tvp = &tv;
- }
- rx_stats.selects++;
- FD_COPY(&rx_selectMask, &rfds);
- if (lastPollWorked || nextPollTime < clock_Sec()) {
- /* we're catching up, or haven't tried to for a few seconds */
- doingPoll = 1;
- nextPollTime = clock_Sec() + 4; /* try again in 4 seconds no
- * matter what */
- tv.tv_sec = tv.tv_usec = 0;/* make sure we poll */
- tvp = &tv;
- } else {
- doingPoll = 0;
- }
- lastPollWorked = 0; /* default is that it didn't find
- * anything */
-
- fds = IOMGR_Select (rx_maxSocketNumber + 1, &rfds, 0, 0, tvp);
- clock_NewTime();
- if (fds > 0) {
- if (doingPoll)
- lastPollWorked = 1;
-
- for (socket = 0; socket < num_rx_sockets; socket++) {
- if (p == NULL)
- break;
- if (FD_ISSET(rx_sockets[socket], &rfds) &&
- rxi_ReadPacket(rx_sockets[socket], p, &host, &port))
- {
- p = rxi_ReceivePacket(p, rx_sockets[socket], host, port);
- }
- }
- }
- }
- /* NOTREACHED */
-}
-
-
-void
-osi_Panic(const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- fprintf(stderr, "Fatal Rx error: ");
- vfprintf(stderr, fmt, ap);
- va_end(ap);
- fflush(stderr);
- fflush(stdout);
- exit(-1);
-}
-
-void
-osi_vMsg(const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- vfprintf(stderr, fmt, ap);
- va_end(ap);
- fflush(stderr);
-}
-
-
-#define ADDRSPERSITE 256
-
-#ifdef ADAPT_MTU
-
-static u_long myNetAddrs[ADDRSPERSITE];
-static int myNetMTUs[ADDRSPERSITE];
-static int myNetFlags[ADDRSPERSITE];
-static int numMyNetAddrs;
-
-static void
-GetIFInfo(void)
-{
- int s;
- int len, res;
- struct ifconf ifc;
- struct ifreq ifs[ADDRSPERSITE];
- struct sockaddr_in *a;
- char *p;
- struct ifreq ifreq;
- size_t sz = 0;
-
- numMyNetAddrs = 0;
- memset(myNetAddrs, 0, sizeof(myNetAddrs));
- memset(myNetMTUs, 0, sizeof(myNetMTUs));
- memset(myNetFlags, 0, sizeof(myNetFlags));
-
- s = socket(AF_INET, SOCK_DGRAM, 0);
- if (s < 0)
- return;
-
- ifc.ifc_len = sizeof(ifs);
- ifc.ifc_buf = (caddr_t) & ifs[0];
- memset(&ifs[0], 0, sizeof(ifs));
-
- res = ioctl(s, SIOCGIFCONF, &ifc);
- if (res < 0) {
- close(s);
- return;
- }
- len = ifc.ifc_len / sizeof(struct ifreq);
- if (len > ADDRSPERSITE)
- len = ADDRSPERSITE;
-
- ifreq.ifr_name[0] = '\0';
- for (p = ifc.ifc_buf; p < ifc.ifc_buf + ifc.ifc_len; p += sz) {
- struct ifreq *ifr = (struct ifreq *)p;
-
- sz = sizeof(*ifr);
-#ifdef SOCKADDR_HAS_SA_LEN
- sz = max(sz, sizeof(ifr->ifr_name) + ifr->ifr_addr.sa_len);
-#endif
- if (strncmp (ifreq.ifr_name,
- ifr->ifr_name,
- sizeof(ifr->ifr_name))) {
- res = ioctl(s, SIOCGIFFLAGS, ifr);
- if (res < 0)
- continue;
- if (!(ifr->ifr_flags & IFF_UP))
- continue;
- if (ifr->ifr_flags & IFF_LOOPBACK)
- continue;
- myNetFlags[numMyNetAddrs] = ifr->ifr_flags;
-
- res = ioctl(s, SIOCGIFADDR, ifr);
- if (res < 0)
- continue;
- a = (struct sockaddr_in *)&ifr->ifr_addr;
- if (a->sin_family != AF_INET)
- continue;
- myNetAddrs[numMyNetAddrs] = ntohl(a->sin_addr.s_addr);
-
- res = -1;
-#ifdef SIOCGIFMTU
- res = ioctl(s, SIOCGIFMTU, ifr);
-#elif SIOCRIFMTU
- res = ioctl(s, SIOCRIFMTU, ifr);
-#else
- res = -1;
-#endif
- if (res == 0) {
- myNetMTUs[numMyNetAddrs] = ifr->ifr_metric;
- if (rx_maxReceiveSize < (myNetMTUs[numMyNetAddrs]
- - RX_IPUDP_SIZE))
- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE,
- (myNetMTUs[numMyNetAddrs]
- - RX_IPUDP_SIZE));
-
- if (rx_MyMaxSendSize < myNetMTUs[numMyNetAddrs]
- - RX_IPUDP_SIZE)
- rx_MyMaxSendSize = myNetMTUs[numMyNetAddrs]
- - RX_IPUDP_SIZE;
-
- } else {
- myNetMTUs[numMyNetAddrs] = OLD_MAX_PACKET_SIZE;
- res = 0;
- }
- ++numMyNetAddrs;
- ifreq = *ifr;
- }
- }
-
- {
-#if 0
- RETSIGTYPE (*old)(int);
-
- old = signal(SIGSYS, SIG_IGN);
- if (syscall(31 /* AFS_SYSCALL */ , 28 /* AFSCALL_CALL */ ,
- 20 /* AFSOP_GETMTU */ , myNetAddrs[numMyNetAddrs],
- &(myNetMTUs[numMyNetAddrs])));
- myNetMTUs[numMyNetAddrs] = OLD_MAX_PACKET_SIZE;
- signal(SIGSYS, old);
-#endif
- }
-
- close(s);
-
- /*
- * have to allocate at least enough to allow a single packet to reach its
- * maximum size, so ReadPacket will work. Allocate enough for a couple
- * of packets to do so, for good measure
- */
- /* MTUXXX before shipping, change this 8 to a 4 */
- {
- int npackets, ncbufs;
-
- ncbufs = (rx_maxReceiveSize - RX_FIRSTBUFFERSIZE);
- if (ncbufs > 0) {
- ncbufs = ncbufs / RX_CBUFFERSIZE;
- npackets = (rx_Window / 8);
- npackets = (npackets > 2 ? npackets : 2);
- rxi_MoreCbufs(npackets * (ncbufs + 1));
- }
- }
-}
-
-#endif /* ADAPT_MTU */
-
-/*
- * Called from rxi_FindPeer, when initializing a clear rx_peer structure,
- * to get interesting information.
- */
-
-void
-rxi_InitPeerParams(struct rx_peer * pp)
-{
- uint32_t ppaddr, msk, net;
- int rxmtu;
- int ix, nlix = 0, nlcount;
- static int Inited = 0;
-
-#ifdef ADAPT_MTU
-
- if (!Inited) {
- GetIFInfo();
- Inited = 1;
- }
- /*
- * try to second-guess IP, and identify which link is most likely to
- * be used for traffic to/from this host.
- */
- ppaddr = ntohl(pp->host);
- if (IN_CLASSA(ppaddr))
- msk = IN_CLASSA_NET;
- else if (IN_CLASSB(ppaddr))
- msk = IN_CLASSB_NET;
- else if (IN_CLASSC(ppaddr))
- msk = IN_CLASSC_NET;
- else
- msk = 0;
- net = ppaddr & msk;
-
- for (nlcount = 0, ix = 0; ix < numMyNetAddrs; ++ix) {
-#ifdef IFF_LOOPBACK
- if (!(myNetFlags[ix] & IFF_LOOPBACK)) {
- nlix = ix;
- ++nlcount;
- }
-#endif /* IFF_LOOPBACK */
- if ((myNetAddrs[ix] & msk) == net)
- break;
- }
-
- pp->rateFlag = 2; /* start timing after two full packets */
- /*
- * I don't initialize these, because I presume they are bzero'd...
- * pp->burstSize pp->burst pp->burstWait.sec pp->burstWait.usec
- * pp->timeout.usec
- */
-
- pp->maxWindow = rx_Window;
- if (ix >= numMyNetAddrs) { /* not local */
- pp->timeout.sec = 3;
- pp->packetSize = RX_REMOTE_PACKET_SIZE;
- } else {
- pp->timeout.sec = 2;
- pp->packetSize = MIN(RX_MAX_PACKET_SIZE,
- (rx_MyMaxSendSize + RX_HEADER_SIZE));
- }
-
- /* Now, maybe get routing interface and override parameters. */
- if (ix >= numMyNetAddrs && nlcount == 1)
- ix = nlix;
-
- if (ix < numMyNetAddrs) {
-#ifdef IFF_POINTOPOINT
- if (myNetFlags[ix] & IFF_POINTOPOINT) {
- /* wish we knew the bit rate and the chunk size, sigh. */
- pp->maxWindow = 10;
- pp->timeout.sec = 4;
- /* pp->timeout.usec = 0; */
- pp->packetSize = RX_PP_PACKET_SIZE;
- }
-#endif /* IFF_POINTOPOINT */
-
- /*
- * Reduce the packet size to one based on the MTU given by the
- * interface.
- */
- if (myNetMTUs[ix] > (RX_IPUDP_SIZE + RX_HEADER_SIZE)) {
- rxmtu = myNetMTUs[ix] - RX_IPUDP_SIZE;
- if (rxmtu < pp->packetSize)
- pp->packetSize = rxmtu;
- }
- }
-#else /* ADAPT_MTU */
- pp->rateFlag = 2; /* start timing after two full packets */
- pp->maxWindow = rx_Window;
- pp->timeout.sec = 2;
- pp->packetSize = OLD_MAX_PACKET_SIZE;
-#endif /* ADAPT_MTU */
-}
diff --git a/usr.sbin/afs/src/rx/rx_user.h b/usr.sbin/afs/src/rx/rx_user.h
deleted file mode 100644
index 3803b3ea9aa..00000000000
--- a/usr.sbin/afs/src/rx/rx_user.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* $arla: rx_user.h,v 1.9 2003/04/08 22:13:44 lha Exp $ */
-
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-#ifndef RX_USER_INCLUDE
-#define RX_USER_INCLUDE
-
-/*
- * rx_user.h:
- * definitions specific to the user-level implementation of Rx
- */
-
-#include <stdio.h>
-#include <lwp.h>
-
-#ifdef RXDEBUG
-extern FILE *rx_debugFile;
-#endif
-
-/* These routines are no-ops in the user level implementation */
-#define SPLVAR
-#define NETPRI
-#define USERPRI
-#if defined(AFS_SGIMP_ENV)
-#define AFS_GLOCK()
-#define AFS_GUNLOCK()
-#define ISAFS_GLOCK()
-#endif
-
-void rxi_StartListener(void);
-void rxi_StartServerProcs(int);
-void rxi_ReScheduleEvents(void);
-
-void rxi_PacketsUnWait(void);
-
-/*
- *Some "operating-system independent" stuff, for the user mode implementation
- */
-typedef short osi_socket;
-
-osi_socket rxi_GetUDPSocket(uint16_t, uint16_t *);
-
-#define OSI_NULLSOCKET ((osi_socket) -1)
-
-#define rx_Sleep(x) osi_Sleep(x)
-#define rx_Wakeup(x) osi_Wakeup(x)
-#define osi_rxSleep(x) osi_Sleep(x)
-#define osi_rxWakeup(x) osi_Wakeup(x)
-#define osi_Sleep(x) LWP_WaitProcess(x)
-#define osi_Wakeup(x) LWP_NoYieldSignal(x)
-/*
- * osi_WakeupAndYieldIfPossible doesn't actually have to yield, but
- * its better if it does
- */
-#define osi_WakeupAndYieldIfPossible(x) LWP_SignalProcess(x)
-#define osi_YieldIfPossible() LWP_DispatchProcess();
-
-#ifndef osi_Alloc
-#define osi_Alloc(size) (malloc(size))
-#endif
-
-#ifndef osi_Free
-#define osi_Free(ptr, size) free(ptr)
-#endif
-
-#define osi_GetTime(timevalptr) gettimeofday(timevalptr, 0)
-
-/*
- * Just in case it's possible to distinguish between relatively
- * long-lived stuff and stuff which will be freed very soon, but which
- * needs quick allocation (e.g. dynamically allocated xdr things)
- */
-
-#define osi_QuickFree(ptr, size) osi_Free(ptr, size)
-#define osi_QuickAlloc(size) osi_Alloc(size)
-
-
-void osi_Panic(const char *fmt, ...);
-void osi_vMsg(const char *fmt, ...);
-
-#define osi_Msg(x) do { osi_vMsg x ; } while(0)
-
-#endif /* RX_USER_INCLUDE */
diff --git a/usr.sbin/afs/src/rx/rxdebug.1 b/usr.sbin/afs/src/rx/rxdebug.1
deleted file mode 100644
index 89e205903b6..00000000000
--- a/usr.sbin/afs/src/rx/rxdebug.1
+++ /dev/null
@@ -1,107 +0,0 @@
-.\" Copyright (c) 2000 - 2003 Kungliga Tekniska Högskolan
-.\" (Royal Institute of Technology, Stockholm, Sweden).
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" 3. Neither the name of the Institute nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $arla: rxdebug.1,v 1.3 2003/04/01 14:08:19 lha Exp $
-.\"
-.\" $arla: rxdebug.1,v 1.3 2003/04/01 14:08:19 lha Exp $
-.Dd April 1, 2003
-.Dt RXDEBUG 1
-.Nm rxdebug
-.Os "The Arla Project"
-.Sh NAME
-.Nm rxdebug
-.Nd
-a tool to diagnose problems with rx.
-.Sh SYNOPSIS
-.Nm
-.Op Fl port Ar port
-.Op Fl nodally
-.Op Fl allconnection
-.Op Fl rxstats
-.Op Fl onlyserver
-.Op Fl onlyclient
-.Op Fl onlyport Ar port
-.Op Fl onlyhost Ar host
-.Op Fl onlyauth Ar authlevel
-.Op Fl version
-.Op Fl noconns
-.Fl servers Ar servers ...
-.Sh DESCRIPTION
-Supported options:
-.Bl -tag -width Ds
-.It Fl port Ar port
-what port should be used to talk the rx implemetation
-.It Fl nodally
-don't show dally connections.
-.It Fl allconnection
-show all connection.
-.It Fl rxstats
-show statistics about rx performance, loss of packets, etc
-.It Fl onlyserver
-show only server connections
-.It Fl onlyclient
-show only client connections
-.It Fl onlyport Ar port
-only display the connection that use
-.Ar port .
-.It Fl onlyhost Ar host
-only display the connection from
-.Ar host .
-.It Fl onlyauth Ar authlevel
-only display connection with auth level
-.Ar authlevel
-.It Fl version
-display version of the remote implementation.
-.Nm
-.It Fl noconns
-do not show any connection.
-.It servers ...
-list of the servers to talk to.
-.El
-.Sh DIAGNOSTICS
-.Nm
-is used to diagnose a rx-implementation, what version the AFS-client
-are running, why rx misbehaves, or if there are performance problems.
-.Pp
-.Sh EXAMPLES
-.Bd -literal
-datan# rxdebug -servers localhost -port 4711 -status -noconn
-Trying 127.0.0.1 (port 4711):
-Free packets: 65, packet reclaims: 0, calls: 28, used FDs: 6
-not waiting for packets.
-0 calls waiting for a thread
-Done.
-data# rxdebug -servers localhost -port 4711 -version
-Trying 127.0.0.1 (port 4711):
-AFS version: arla-0.34.1
-.Ed
-.Sh SEE ALSO
-.Xr arlad 8
diff --git a/usr.sbin/afs/src/rx/rxdebug.c b/usr.sbin/afs/src/rx/rxdebug.c
deleted file mode 100644
index 220e0e71540..00000000000
--- a/usr.sbin/afs/src/rx/rxdebug.c
+++ /dev/null
@@ -1,732 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include <agetarg.h>
-
-#include <stdio.h>
-#include <err.h>
-
-#include "rx_user.h"
-#include "rx_clock.h"
-#include "rx_queue.h"
-#include "rx.h"
-
-#include "config.h"
-#include "roken.h"
-
-RCSID ("$arla: rxdebug.c,v 1.15 2003/01/19 08:50:12 lha Exp $");
-
-#define TIMEOUT 20
-
-static uint16_t
-PortNumber(char *aport)
-{
- uint16_t port = atoi(aport);
- return htons(port);
-}
-
-static uint16_t
-PortName(char *aname)
-{
- struct servent *ts = getservbyname(aname, NULL);
- if (ts == NULL)
- return 0;
- return ts->s_port; /* returns it in network byte order */
-}
-
-static int
-MakeCall (int asocket, uint32_t ahost, uint16_t aport, char *adata,
- long alen, char *aresult, long aresultLen)
-{
- static long counter = 100;
- long endTime;
- struct rx_header theader;
- char tbuffer[1500];
- int code;
- struct timeval tv;
- struct sockaddr_in taddr, faddr;
- int faddrLen;
- fd_set imask;
- char *tp;
-
- endTime = time(0) + TIMEOUT; /* try for N seconds */
- counter++;
- tp = &tbuffer[sizeof(struct rx_header)];
- taddr.sin_family = AF_INET;
- taddr.sin_port = aport;
- taddr.sin_addr.s_addr = ahost;
- while(1) {
- memset(&theader, 0, sizeof(theader));
- theader.epoch = htonl(999);
- theader.cid = 0;
- theader.callNumber = htonl(counter);
- theader.seq = 0;
- theader.serial = 0;
- theader.type = RX_PACKET_TYPE_DEBUG;
- theader.flags = RX_CLIENT_INITIATED | RX_LAST_PACKET;
- theader.serviceId = 0;
-
- if (sizeof(theader) + alen > sizeof(tbuffer))
- errx(1, "message to large");
-
- memcpy(tbuffer, &theader, sizeof(theader));
- memcpy(tp, adata, alen);
- code = sendto(asocket, tbuffer, alen+sizeof(struct rx_header), 0,
- (struct sockaddr *)&taddr, sizeof(struct sockaddr_in));
- if (code == -1) {
- err(1, "sendto");
- }
- /* see if there's a packet available */
-
- if (asocket >= FD_SETSIZE) {
- printf("rxdebug: socket fd too large\n");
- exit (1);
- }
-
- FD_ZERO(&imask);
- FD_SET(asocket,&imask);
- tv.tv_sec = 1;
- tv.tv_usec = 0;
- code = select(asocket + 1, &imask, NULL, NULL, &tv);
- if (code == -1) {
- err(1, "select");
- }
- if (code > 0) {
- /* now receive a packet */
- faddrLen = sizeof(struct sockaddr_in);
- code = recvfrom(asocket, tbuffer, sizeof(tbuffer), 0,
- (struct sockaddr *)&faddr, &faddrLen);
- if (code == -1) {
- err(1, "recvfrom");
- }
- memcpy(&theader, tbuffer, sizeof(struct rx_header));
- if (counter == ntohl(theader.callNumber))
- break;
- }
-
- /* see if we've timed out */
- if (endTime < time(0)) return -1;
- }
- code -= sizeof(struct rx_header);
- if (code > aresultLen) code = aresultLen;
- memcpy(aresult, tp, code);
- return code;
-}
-
-static int
-GetVersion(int asocket, uint32_t ahost, uint16_t aport,
- void *adata, long alen,
- char *aresult, long aresultLen)
-{
- static long counter = 100;
- long endTime;
- struct rx_header theader;
- char tbuffer[1500];
- int code;
- struct timeval tv;
- struct sockaddr_in taddr, faddr;
- int faddrLen;
- fd_set imask;
- char *tp;
-
- endTime = time(0) + TIMEOUT; /* try for N seconds */
- counter++;
- tp = &tbuffer[sizeof(struct rx_header)];
- taddr.sin_family = AF_INET;
- taddr.sin_port = aport;
- taddr.sin_addr.s_addr = ahost;
- while(1) {
- memset(&theader, 0, sizeof(theader));
- theader.epoch = htonl(999);
- theader.cid = 0;
- theader.callNumber = htonl(counter);
- theader.seq = 0;
- theader.serial = 0;
- theader.type = RX_PACKET_TYPE_VERSION;
- theader.flags = RX_CLIENT_INITIATED | RX_LAST_PACKET;
- theader.serviceId = 0;
-
- if (sizeof(theader) + alen > sizeof(tbuffer))
- errx(1, "message to large");
-
- memcpy(tbuffer, &theader, sizeof(theader));
- memcpy(tp, adata, alen);
-
- code = sendto(asocket, tbuffer, alen+sizeof(struct rx_header), 0,
- (struct sockaddr *)&taddr, sizeof(struct sockaddr_in));
- if (code == -1) {
- err(1, "sendto");
- }
-
- if (asocket >= FD_SETSIZE) {
- printf("rxdebug: socket fd too large\n");
- exit (1);
- }
-
- /* see if there's a packet available */
- FD_ZERO(&imask);
- FD_SET(asocket, &imask);
-
-/* should be 1 */
-
- tv.tv_sec = 10;
- tv.tv_usec = 0;
-
- code = select(asocket + 1, &imask, 0, 0, &tv);
- if (code == -1) {
- err(1, "select");
- }
- if (code > 0) {
- /* now receive a packet */
- faddrLen = sizeof(struct sockaddr_in);
-
- code = recvfrom(asocket, tbuffer, sizeof(tbuffer), 0,
- (struct sockaddr *)&faddr, &faddrLen);
- if (code == -1) {
- err(1, "recvfrom");
- }
-
- memcpy(&theader, tbuffer, sizeof(struct rx_header));
-
- if (counter == ntohl(theader.callNumber))
- break;
- }
-
- /* see if we've timed out */
- if (endTime < time(0)) return -1;
- }
- code -= sizeof(struct rx_header);
- if (code > aresultLen)
- code = aresultLen;
- memcpy(aresult, tp, code);
- return code;
-}
-
-static int
-MapOldConn (char version, struct rx_debugConn *tconn)
-{
- int i;
- struct rx_debugConn_vL *vL = (struct rx_debugConn_vL *)tconn;
-#define MOVEvL(a) (tconn->a = vL->a)
-
- if ((version <= RX_DEBUGI_VERSION_W_UNALIGNED_CONN) ||
- (version > RX_DEBUGI_VERSION)) {
- /* any old or unrecognized version... */
- for (i=0;i<RX_MAXCALLS;i++) {
- MOVEvL(callState[i]);
- MOVEvL(callMode[i]);
- MOVEvL(callFlags[i]);
- MOVEvL(callOther[i]);
- }
- if (version == RX_DEBUGI_VERSION_W_SECSTATS) {
- MOVEvL(secStats.type);
- MOVEvL(secStats.level);
- MOVEvL(secStats.flags);
- MOVEvL(secStats.expires);
- MOVEvL(secStats.packetsReceived);
- MOVEvL(secStats.packetsSent);
- MOVEvL(secStats.bytesReceived);
- MOVEvL(secStats.bytesSent);
- }
- }
- return 0;
-}
-
-static char *hostName;
-static char *portName;
-static int nodally;
-static int allconns;
-static int rxstats;
-static char *onlyPortName;
-static char *onlyHostName;
-static int onlyServer;
-static int onlyClient;
-static char *onlyAuthName;
-static int version_flag;
-static int noConns;
-static int helpflag;
-
-static int
-MainCommand (void)
-{
- int i;
- int s;
- int j;
- struct sockaddr_in taddr;
- uint32_t host;
- struct in_addr hostAddr;
- uint16_t port;
- struct hostent *th;
- struct rx_debugIn tin;
- int code;
- uint32_t onlyHost;
- uint16_t onlyPort;
- int onlyAuth;
- int flag;
- int dallyCounter;
- int withSecStats;
- int withAllConn;
- int withRxStats;
- int withWaiters;
- struct rx_debugStats tstats;
- struct rx_debugConn tconn;
-
- char version[64];
- char nada[64];
- long length=64;
-
- if (onlyPortName) {
- char *name = onlyPortName;
- if ((onlyPort = PortNumber(name)) == 0)
- onlyPort = PortName(name);
- if (onlyPort == 0) {
- printf("rxdebug: can't resolve port name %s\n", name);
- exit(1);
- }
- } else
- onlyPort = 0xffff;
-
- if (onlyHostName) {
- char *name = onlyHostName;
- struct hostent *th;
- th = gethostbyname(name);
- if (!th) {
- printf("rxdebug: host %s not found in host table\n", name);
- exit(1);
- }
- memcpy(&onlyHost, th->h_addr, sizeof(onlyHost));
- } else
- onlyHost = 0xffffffff;
-
- if (onlyAuthName) {
- char *name = onlyAuthName;
- if (strcmp (name, "clear") == 0) onlyAuth = 0;
- else if (strcmp (name, "auth") == 0) onlyAuth = 1;
- else if (strcmp (name, "crypt") == 0) onlyAuth = 2;
- else if ((strcmp (name, "null") == 0) ||
- (strcmp (name, "none") == 0) ||
- (strncmp (name, "noauth", 6) == 0) ||
- (strncmp (name, "unauth", 6) == 0)) onlyAuth = -1;
- else {
- fprintf (stderr, "Unknown authentication level: %s\n", name);
- exit (1);
- }
- } else onlyAuth = 999;
-
- /* lookup host */
- if (hostName) {
- th = gethostbyname(hostName);
- if (!th) {
- printf("rxdebug: host %s not found in host table\n", hostName);
- exit(1);
- }
- memcpy(&host, th->h_addr, sizeof(host));
- }
- else host = htonl(0x7f000001); /* IP localhost */
-
- if (!portName)
- port = htons(7000); /* default is fileserver */
- else {
- if ((port = PortNumber(portName)) == 0)
- port = PortName(portName);
- if (port == 0) {
- printf("rxdebug: can't resolve port name %s\n", portName);
- exit(1);
- }
- }
-
- dallyCounter = 0;
-
- hostAddr.s_addr = host;
- printf("Trying %s (port %d):\n", inet_ntoa(hostAddr), ntohs(port));
- s = socket(AF_INET, SOCK_DGRAM, 0);
-
- memset(&taddr, 0, sizeof(taddr));
- taddr.sin_family = AF_INET;
- taddr.sin_port = 0;
- taddr.sin_addr.s_addr = 0;
-
- code = bind(s, (struct sockaddr *)&taddr, sizeof(struct sockaddr_in));
- if (code) {
- perror("bind");
- exit(1);
- }
-
- if(version_flag)
- {
- nada[0] = '\0';
-
- code = GetVersion(s, host, port, nada, length,
- version, length);
- if (code < 0)
- {
- printf("get version call failed with code %d, errno %d\n",
- code,errno);
- exit(1);
- }
- printf("AFS version: %s\n",version);fflush(stdout);
-
- exit(0);
-
- }
-
-
- tin.type = htonl(RX_DEBUGI_GETSTATS);
- tin.index = 0;
- code = MakeCall(s, host, port, (char *) &tin, sizeof(tin),
- (char *) &tstats, sizeof(tstats));
- if (code < 0) {
- printf("getstats call failed with code %d\n", code);
- exit(1);
- }
-
- withSecStats = (tstats.version >= RX_DEBUGI_VERSION_W_SECSTATS);
- withAllConn = (tstats.version >= RX_DEBUGI_VERSION_W_GETALLCONN);
- withRxStats = (tstats.version >= RX_DEBUGI_VERSION_W_RXSTATS);
- withWaiters = (tstats.version >= RX_DEBUGI_VERSION_W_WAITERS);
-
- printf("Free packets: %ld, packet reclaims: %ld, calls: %ld, "
- "used FDs: %d\n",
- (long)ntohl(tstats.nFreePackets),
- (long)ntohl(tstats.packetReclaims),
- (long)ntohl(tstats.callsExecuted),
- tstats.usedFDs);
- if (!tstats.waitingForPackets) printf("not ");
- printf("waiting for packets.\n");
- if (withWaiters)
- printf("%ld calls waiting for a thread\n",
- (long)ntohl(tstats.nWaiting));
-
- if (rxstats && withRxStats) {
- if(!withRxStats) {
- fprintf (stderr, "WARNING: Server doens't support "
- "retrieval of Rx statistics\n");
- } else {
- struct rx_stats rxstats;
- int i;
- uint32_t *lp;
-
- memset (&rxstats, 0, sizeof(rxstats));
- tin.type = htonl(RX_DEBUGI_RXSTATS);
- tin.index = 0;
- /* should gracefully handle the case where rx_stats grows */
- code = MakeCall(s, host, port, (char *) &tin, sizeof(tin),
- (char *) &rxstats, sizeof(rxstats));
- if (code < 0) {
- printf("rxstats call failed with code %d\n", code);
- exit(1);
- }
-
- if ((code == sizeof(tin)) &&
- (ntohl(((struct rx_debugIn *)(&rxstats))->type) ==
- RX_DEBUGI_BADTYPE)) {
- fprintf (stderr, "WARNING: Server doens't support "
- "retrieval of Rx statistics\n");
- } else {
- if (code != sizeof(rxstats)) {
- /* handle other versions?... */
- fprintf (stderr, "WARNING: returned Rx statistics of "
- "unexpected size (got %d)\n",
- code);
- }
- /* Since its all int32's, convert to host order with a loop. */
- lp = (uint32_t*)&rxstats;
- for (i=0; i< sizeof(rxstats)/sizeof(uint32_t); i++)
- lp[i] = ntohl(lp[i]);
-
- rx_PrintTheseStats (stdout, &rxstats, sizeof(rxstats));
- }
- }
- }
-
- if (noConns)
- return 0;
-
- tin.type = htonl(RX_DEBUGI_GETCONN);
- if (allconns)
- tin.type = htonl(RX_DEBUGI_GETALLCONN);
-
- if (onlyServer) printf ("Showing only server connections\n");
- if (onlyClient) printf ("Showing only client connections\n");
- if (onlyAuth != 999) {
- static char *name[] =
- {"unauthenticated", "rxkad_clear", "rxkad_auth", "rxkad_crypt"};
- printf ("Showing only %s connections\n", name[onlyAuth+1]);
- }
- if (onlyHost != 0xffffffff) {
- hostAddr.s_addr = onlyHost;
- printf ("Showing only connections from host %s\n",
- inet_ntoa(hostAddr));
- }
- if (onlyPort != 0xffff)
- printf ("Showing only connections on port %u\n", ntohs(onlyPort));
-
- for(i=0;;i++) {
- tin.index = htonl(i);
- memset (&tconn, 0, sizeof(tconn));
- code = MakeCall(s, host, port, (char *)&tin, sizeof(tin),
- (char *) &tconn, sizeof(tconn));
- if (code < 0) {
- printf("getconn call failed with code %d\n", code);
- break;
- }
- MapOldConn (tstats.version, &tconn);
- if (tconn.cid == htonl(0xffffffff)) {
- printf("Done.\n");
- break;
- }
-
- /* see if we're in nodally mode and all calls are dallying */
- if (nodally) {
- flag = 0;
- for(j=0;j<RX_MAXCALLS;j++) {
- if (tconn.callState[j] != RX_STATE_NOTINIT &&
- tconn.callState[j] != RX_STATE_DALLY) {
- flag = 1;
- break;
- }
- }
- if (flag == 0) {
- /*
- * this call looks too ordinary, bump skipped count and go
- * around again
- */
- dallyCounter++;
- continue;
- }
- }
- if ((onlyHost != -1) && (onlyHost != tconn.host)) continue;
- if ((onlyPort != 0) && (onlyPort != tconn.port)) continue;
- if (onlyServer && (tconn.type != RX_SERVER_CONNECTION)) continue;
- if (onlyClient && (tconn.type != RX_CLIENT_CONNECTION)) continue;
- if (onlyAuth != 999) {
- if (onlyAuth == -1) {
- if (tconn.securityIndex != 0) continue;
- } else {
- if (tconn.securityIndex != 2) continue;
- if (withSecStats && (tconn.secStats.type == 3) &&
- (tconn.secStats.level != onlyAuth)) continue;
- }
- }
-
- /* now display the connection */
- hostAddr.s_addr = tconn.host;
- printf("Connection from host %s, port %d, ",
- inet_ntoa(hostAddr), ntohs(tconn.port));
- if (tconn.epoch)
- printf ("Cuid %lx/%lx", (unsigned long)ntohl(tconn.epoch),
- (unsigned long)ntohl(tconn.cid));
- else
- printf ("cid %lx", (unsigned long)ntohl(tconn.cid));
- if (tconn.error)
- printf (", error %ld", (long)ntohl(tconn.error));
- printf("\n serial %ld, ", (long)ntohl(tconn.serial));
- printf(" maxPacketSize %ld, ", (long)ntohl(tconn.maxPacketSize));
-
- if (tconn.flags) {
- printf ("flags");
- if (tconn.flags & RX_CONN_MAKECALL_WAITING)
- printf(" MAKECALL_WAITING");
- if (tconn.flags & RX_CONN_DESTROY_ME) printf(" DESTROYED");
- if (tconn.flags & RX_CONN_USING_PACKET_CKSUM) printf(" pktCksum");
- printf (", ");
- }
- printf("security index %d, ", tconn.securityIndex);
- if (tconn.type == RX_CLIENT_CONNECTION) printf("client conn\n");
- else printf("server conn\n");
-
- if (withSecStats) {
- switch ((int)tconn.secStats.type) {
- case 0:
- if (tconn.securityIndex == 2)
- printf (" no GetStats procedure for security object\n");
- break;
- case 1:
- printf (" rxnull level=%d, flags=%d\n",
- tconn.secStats.level, (int)tconn.secStats.flags);
- break;
- case 2:
- printf (" rxvab level=%d, flags=%d\n",
- tconn.secStats.level, (int)tconn.secStats.flags);
- break;
- case 3: {
- char *level;
- char flags = ntohl(tconn.secStats.flags);
- if (tconn.secStats.level == 0) level = "clear";
- else if (tconn.secStats.level == 1) level = "auth";
- else if (tconn.secStats.level == 2) level = "crypt";
- else level = "unknown";
- printf (" rxkad: level %s", level);
- if (flags) printf (", flags");
- if (flags & 1) printf (" unalloc");
- if (flags & 2) printf (" authenticated");
- if (flags & 4) printf (" expired");
- if (flags & 8) printf (" pktCksum");
- if (tconn.secStats.expires)
- /* Apparently due to a bug in the RT compiler that
- * prevents (u_long)0xffffffff => (double) from working,
- * this code produces negative lifetimes when run on the
- * RT. */
- printf (", expires in %.1f hours",
- ((u_long)ntohl(tconn.secStats.expires) -
- time(0)) / 3600.0);
- if (!(flags & 1)) {
- printf ("\n Received %lu bytes in %lu packets\n",
- (long)ntohl(tconn.secStats.bytesReceived),
- (long)ntohl(tconn.secStats.packetsReceived));
- printf (" Sent %lu bytes in %lu packets\n",
- (long)ntohl(tconn.secStats.bytesSent),
- (long)ntohl(tconn.secStats.packetsSent));
- } else
- printf ("\n");
- break;
- }
-
- default: printf(" unknown\n");
- }
- }
-
- for(j=0;j<RX_MAXCALLS;j++) {
- printf(" call %d: # %ld, state ", j,
- (long)ntohl(tconn.callNumber[j]));
- if (tconn.callState[j]==RX_STATE_NOTINIT) {
- printf("not initialized\n");
- continue;
- }
- else if (tconn.callState[j]==RX_STATE_PRECALL)
- printf("precall, ");
- else if (tconn.callState[j] == RX_STATE_ACTIVE)
- printf("active, ");
- else if (tconn.callState[j] == RX_STATE_DALLY)
- printf("dally, ");
- printf("mode: ");
- if (tconn.callMode[j]==RX_MODE_SENDING)
- printf("sending");
- else if (tconn.callMode[j]==RX_MODE_RECEIVING)
- printf("receiving");
- else if (tconn.callMode[j]==RX_MODE_ERROR)
- printf("error");
- else if (tconn.callMode[j] == RX_MODE_EOF)
- printf("eof");
- else printf("unknown");
- if (tconn.callFlags[j]) {
- printf(", flags:");
- if (tconn.callFlags[j]&RX_CALL_READER_WAIT)
- printf(" reader_wait");
- if (tconn.callFlags[j]&RX_CALL_WAIT_WINDOW_ALLOC)
- printf(" window_alloc");
- if (tconn.callFlags[j]&RX_CALL_WAIT_WINDOW_SEND)
- printf(" window_send");
- if (tconn.callFlags[j]&RX_CALL_WAIT_PACKETS)
- printf(" wait_packets");
- if (tconn.callFlags[j]&RX_CALL_WAIT_PROC)
- printf(" waiting_for_process");
- if (tconn.callFlags[j]&RX_CALL_RECEIVE_DONE)
- printf(" receive_done");
- if (tconn.callFlags[j]&RX_CALL_CLEARED)
- printf(" call_cleared");
- }
- if (tconn.callOther[j] & RX_OTHER_IN)
- printf(", has_input_packets");
- if (tconn.callOther[j] & RX_OTHER_OUT)
- printf(", has_output_packets");
- printf("\n");
- }
- }
- if (nodally) printf("Skipped %d dallying connections.\n", dallyCounter);
- return 0;
-}
-
-static struct agetargs args[] = {
- {"servers", 0, aarg_string, &hostName,
- "server machine", NULL, aarg_mandatory},
- {"port", 0, aarg_string, &portName,
- "IP port", NULL, aarg_optional_swless },
- {"nodally", 0, aarg_flag, &nodally,
- "don't show dallying conns", NULL },
- {"allconnections", 0, aarg_flag, &allconns,
- "don't filter out uninteresting connections on server"},
- {"rxstats", 0, aarg_flag, &rxstats,
- "show Rx statistics", NULL },
- {"onlyserver", 0, aarg_flag, &onlyServer,
- "only show server conns", NULL },
- {"onlyclient", 0, aarg_flag, &onlyClient,
- "only show client conns", NULL},
- {"onlyport", 0, aarg_integer, &onlyPortName,
- "show only <port>", NULL },
- {"onlyhost", 0, aarg_string, &onlyHostName,
- "show only <host>", NULL },
- {"onlyauth", 0, aarg_string, &onlyAuthName,
- "show only <auth level>", NULL },
- {"version", 0, aarg_flag, &version_flag,
- "show AFS version id", NULL },
- {"noconns", 0, aarg_flag, &noConns,
- "show no connections", NULL },
- {NULL}
-};
-
-static void
-usage(void)
-{
- aarg_printusage (args, "rxdebug", "", AARG_AFSSTYLE);
-}
-
-
-/* simple main program */
-
-int
-main(int argc, char **argv)
-{
-
- int optind = 0;
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE)) {
- usage();
- return 0;
- }
-
- if(helpflag) {
- usage();
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc > 0) {
- fprintf (stderr, "create volume: unparsed arguments\n");
- return 0;
- }
-
- return MainCommand();
-}
diff --git a/usr.sbin/afs/src/rx/rxgencon.h b/usr.sbin/afs/src/rx/rxgencon.h
deleted file mode 100644
index 435b8f28948..00000000000
--- a/usr.sbin/afs/src/rx/rxgencon.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-****************************************************************************
-* Copyright IBM Corporation 1988, 1989 - All Rights Reserved *
-* *
-* Permission to use, copy, modify, and distribute this software and its *
-* documentation for any purpose and without fee is hereby granted, *
-* provided that the above copyright notice appear in all copies and *
-* that both that copyright notice and this permission notice appear in *
-* supporting documentation, and that the name of IBM not be used in *
-* advertising or publicity pertaining to distribution of the software *
-* without specific, written prior permission. *
-* *
-* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL *
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM *
-* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY *
-* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER *
-* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *
-* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
-****************************************************************************
-*/
-
-/* $arla: rxgencon.h,v 1.1 1999/02/05 06:09:06 lha Exp $ */
-
-#ifndef _RXGEN_CONSTS_
-#define _RXGEN_CONSTS_
-
-/* These are some rxgen-based (really arbitrary) error codes... */
-#define RXGEN_SUCCESS 0
-#define RXGEN_CC_MARSHAL -450
-#define RXGEN_CC_UNMARSHAL -451
-#define RXGEN_SS_MARSHAL -452
-#define RXGEN_SS_UNMARSHAL -453
-#define RXGEN_DECODE -454
-#define RXGEN_OPCODE -455
-#define RXGEN_SS_XDRFREE -456
-#define RXGEN_CC_XDRFREE -457
-
-#endif /* _RXGEN_CONSTS_ */
diff --git a/usr.sbin/afs/src/rx/rxperf.c b/usr.sbin/afs/src/rx/rxperf.c
deleted file mode 100644
index fa4a0ab83ff..00000000000
--- a/usr.sbin/afs/src/rx/rxperf.c
+++ /dev/null
@@ -1,998 +0,0 @@
-/*
- * Copyright (c) 2000 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-/*
- * We are using getopt since we want it to be possible to link to
- * transarc libs.
- */
-
-#define HAVE_GETRUSAGE 1
-
-#ifdef RCSID
-RCSID("$arla: rxperf.c,v 1.23 2003/04/08 00:19:47 lha Exp $");
-#endif
-
-#include <stdarg.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#if HAVE_GETRUSAGE
-#include <sys/resource.h>
-#endif
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-#include <assert.h>
-#include <unistd.h>
-#include <signal.h>
-#ifdef HAVE_ERRX
-#include <err.h> /* not stricly right, but if we have a errx() there
- * is hopefully a err.h */
-#endif
-#include "rx.h"
-#include "rx_globs.h"
-#include "rx_null.h"
-
-#if defined(u_int32)
-#define uint32_t u_int32
-#elif defined(hget32)
-#define uint32_t afs_uint32
-#endif
-
-static const char *__progname;
-
-#ifndef HAVE_WARNX
-static void
-warnx(const char *fmt, ...)
-{
- va_list args;
-
- va_start(args, fmt);
- fprintf(stderr, "%s: ", __progname);
- vfprintf (stderr, fmt, args);
- fprintf(stderr, "\n");
- va_end(args);
-}
-#endif /* !HAVE_WARNX */
-
-#ifndef HAVE_ERRX
-static void
-errx(int eval, const char *fmt, ...)
-{
- va_list args;
-
- va_start(args, fmt);
- fprintf(stderr, "%s: ", __progname);
- vfprintf (stderr, fmt, args);
- fprintf(stderr, "\n");
- va_end(args);
-
- exit(eval);
-}
-#endif /* !HAVE_ERRX */
-
-#ifndef HAVE_WARN
-static void
-warn(const char *fmt, ...)
-{
- va_list args;
- char *errstr;
-
- va_start(args, fmt);
- fprintf(stderr, "%s: ", __progname);
- vfprintf (stderr, fmt, args);
-
- errstr = strerror(errno);
-
- fprintf(stderr, ": %s\n", errstr ? errstr : "unknown error");
- va_end(args);
-}
-#endif /* !HAVE_WARN */
-
-#ifndef HAVE_ERR
-static void
-err(int eval, const char *fmt, ...)
-{
- va_list args;
- char *errstr;
-
- va_start(args, fmt);
- fprintf(stderr, "%s: ", __progname);
- vfprintf (stderr, fmt, args);
-
- errstr = strerror(errno);
-
- fprintf(stderr, ": %s\n", errstr ? errstr : "unknown error");
- va_end(args);
-
- exit(eval);
-}
-#endif /* !HAVE_ERR */
-
-#define DEFAULT_PORT 7009 /* To match tcpdump */
-#define DEFAULT_HOST "127.0.0.1"
-#define DEFAULT_BYTES 1000000
-#define RXPERF_BUFSIZE 10000
-
-enum { RX_PERF_VERSION = 3 };
-enum { RX_SERVER_ID = 147 };
-enum { RX_PERF_UNKNOWN = -1, RX_PERF_SEND = 0, RX_PERF_RECV = 1,
- RX_PERF_RPC=3, RX_PERF_FILE=4 };
-
-enum { RXPERF_MAGIC_COOKIE = 0x4711 };
-
-/*
- *
- */
-
-#if DEBUG
-#define DBFPRINT(x) do { printf x ; } while(0)
-#else
-#define DBFPRINT(x)
-#endif
-
-static void
-sigusr1 (int foo)
-{
- exit (2); /* XXX profiler */
-}
-
-static void
-sigint (int foo)
-{
- rx_Finalize();
- exit (2); /* XXX profiler */
-}
-
-/*
- *
- */
-
-static struct timeval timer_start;
-static struct timeval timer_stop;
-static int timer_check = 0;
-
-static void
-start_timer (void)
-{
- timer_check++;
- gettimeofday (&timer_start, NULL);
-}
-
-/*
- *
- */
-
-static void
-end_and_print_timer (char *str)
-{
- long long start_l, stop_l;
-
- timer_check--;
- assert (timer_check == 0);
- gettimeofday(&timer_stop, NULL);
- start_l = timer_start.tv_sec * 1000000 + timer_start.tv_usec;
- stop_l = timer_stop.tv_sec * 1000000 + timer_stop.tv_usec;
- printf("%s:\t%8llu msec\n", str, (stop_l-start_l)/1000);
-}
-
-/*
- *
- */
-
-static u_long
-str2addr (const char *s)
-{
- struct in_addr server;
- struct hostent *h;
-
-#ifndef INADDR_NONE
-#define INADDR_NONE 0xffffffff
-#endif
- if (inet_addr(s) != INADDR_NONE)
- return inet_addr(s);
- h = gethostbyname (s);
- if (h != NULL) {
- memcpy (&server, h->h_addr_list[0], sizeof(server));
- return server.s_addr;
- }
- return 0;
-}
-
-
-/*
- *
- */
-
-static void
-get_sec(int serverp, struct rx_securityClass** sec, int *secureindex)
-{
- if (serverp) {
- *sec = rxnull_NewServerSecurityObject();
- *secureindex = 1;
- } else {
- *sec = rxnull_NewClientSecurityObject();
- *secureindex = 0;
- }
-}
-
-/*
- * process the "RPC" and return the results
- */
-
-char somebuf[RXPERF_BUFSIZE];
-
-int32_t rxwrite_size = sizeof(somebuf);
-int32_t rxread_size = sizeof(somebuf);
-
-static int
-readbytes(struct rx_call *call, int32_t bytes)
-{
- int32_t size;
-
- while (bytes > 0) {
- size = rxread_size;
- if (size > bytes)
- size = bytes;
- if (rx_Read (call, somebuf, size) != size)
- return 1;
- bytes -= size;
- }
- return 0;
-}
-
-static int
-sendbytes(struct rx_call *call, int32_t bytes)
-{
- int32_t size;
-
- while (bytes > 0) {
- size = rxwrite_size;
- if (size > bytes)
- size = bytes;
- if (rx_Write (call, somebuf, size) != size)
- return 1;
- bytes -= size;
- }
- return 0;
-}
-
-
-static int32_t
-rxperf_ExecuteRequest(struct rx_call *call)
-{
- int32_t version;
- int32_t command;
- uint32_t bytes;
- uint32_t recvb;
- uint32_t sendb;
- uint32_t data;
- uint32_t num;
- uint32_t *readwrite;
- int i;
- int readp=TRUE;
-
- DBFPRINT(("got a request\n"));
-
- if (rx_Read (call, &version, 4) != 4) {
- warn ("rx_Read failed to read version");
- return -1;
- }
-
- if (htonl(RX_PERF_VERSION) != version) {
- warnx ("client has wrong version");
- return -1;
- }
-
- if (rx_Read (call, &command, 4) != 4) {
- warnx ("rx_Read failed to read command");
- return -1;
- }
- command = ntohl(command);
-
- if (rx_Read (call, &data, 4) != 4) {
- warnx ("rx_Read failed to read size");
- return -1;
- }
- rxread_size = ntohl(data);
- if (rxread_size > sizeof(somebuf)) {
- warnx("rxread_size too large %d", rxread_size);
- return -1;
- }
-
- if (rx_Read (call, &data, 4) != 4) {
- warnx ("rx_Read failed to write size");
- return -1;
- }
- rxwrite_size = ntohl(data);
- if (rxwrite_size > sizeof(somebuf)) {
- warnx("rxwrite_size too large %d", rxwrite_size);
- return -1;
- }
-
- switch (command) {
- case RX_PERF_SEND:
- DBFPRINT(("got a send request\n"));
-
- if (rx_Read (call, &bytes, 4) != 4) {
- warnx ("rx_Read failed to read bytes");
- return -1;
- }
- bytes = ntohl(bytes);
-
- DBFPRINT(("reading(%d) ", bytes));
- readbytes(call, bytes);
-
- data = htonl(RXPERF_MAGIC_COOKIE);
- if (rx_Write (call, &data, 4) != 4) {
- warnx ("rx_Write failed when sending back result");
- return -1;
- }
- DBFPRINT(("done\n"));
-
- break;
- case RX_PERF_RPC:
- DBFPRINT(("got a rpc request, reading commands\n"));
-
- if (rx_Read (call, &recvb, 4) != 4) {
- warnx ("rx_Read failed to read recvbytes");
- return -1;
- }
- recvb = ntohl(recvb);
- if (rx_Read (call, &sendb, 4) != 4) {
- warnx ("rx_Read failed to read recvbytes");
- return -1;
- }
- sendb = ntohl(sendb);
-
- DBFPRINT(("read(%d) ", recvb));
- if (readbytes(call, recvb)) {
- warnx("readbytes failed");
- return -1;
- }
- DBFPRINT(("send(%d) ", sendb));
- if (sendbytes(call, sendb)) {
- warnx("sendbytes failed");
- return -1;
- }
-
- DBFPRINT(("done\n"));
-
- data = htonl(RXPERF_MAGIC_COOKIE);
- if (rx_Write (call, &data, 4) != 4) {
- warnx ( "rx_Write failed when sending back magic cookie");
- return -1;
- }
-
- break;
- case RX_PERF_FILE:
- if (rx_Read (call, &data, 4) != 4)
- errx (1, "failed to read num from client");
- num = ntohl(data);
-
- readwrite = malloc(num*sizeof(uint32_t));
- if(readwrite == NULL)
- err(1, "malloc");
-
- if (rx_Read (call, readwrite, num*sizeof(uint32_t)) !=
- num*sizeof(uint32_t))
- errx (1, "failed to read recvlist from client");
-
- for(i=0; i < num; i++) {
- if(readwrite[i] == 0) {
- DBFPRINT(("readp %d", readwrite[i] ));
- readp = !readp;
- }
-
- bytes = ntohl(readwrite[i])*sizeof(uint32_t);
-
- if(readp) {
- DBFPRINT(("read\n"));
- readbytes(call, bytes);
- } else {
- sendbytes(call, bytes);
- DBFPRINT(("send\n"));
- }
- }
-
- break;
- case RX_PERF_RECV:
- DBFPRINT(("got a recv request\n"));
-
- if (rx_Read (call, &bytes, 4) != 4) {
- warnx ("rx_Read failed to read bytes");
- return -1;
- }
- bytes = ntohl(bytes);
-
- DBFPRINT(("sending(%d) ", bytes));
- sendbytes(call, bytes);
-
- data = htonl(RXPERF_MAGIC_COOKIE);
- if (rx_Write (call, &data, 4) != 4) {
- warnx ("rx_Write failed when sending back result");
- return -1;
- }
- DBFPRINT(("done\n"));
-
- break;
- default:
- warnx ("client sent a unsupported command");
- return -1;
- }
- DBFPRINT(("done with command\n"));
-
- return 0;
-}
-
-/*
- *
- */
-
-static void
-do_server (int port)
-{
- struct rx_service *service;
- struct rx_securityClass *secureobj;
- int secureindex;
- int ret;
-
- ret = rx_Init (port);
- if (ret)
- errx (1, "rx_Init failed");
-
- get_sec(1, &secureobj, &secureindex);
-
- service = rx_NewService (0,
- RX_SERVER_ID,
- "rxperf",
- &secureobj,
- secureindex,
- rxperf_ExecuteRequest);
- if (service == NULL)
- errx(1, "Cant create server");
-
- rx_StartServer(1) ;
- /* NOTREACHED */
- errx(1, "rx_Startserver return, should not happen");
-}
-
-/*
- *
- */
-
-static void
-readfile(const char *filename, uint32_t **readwrite, uint32_t *size)
-{
- FILE *f;
- uint32_t len=16;
- uint32_t num=0;
- uint32_t data;
- char *ptr;
- char buf[RXPERF_BUFSIZE];
-
- *readwrite = malloc(sizeof(uint32_t)*len);
-
- if(*readwrite == NULL)
- err(1, "malloc");
-
- f=fopen(filename, "r");
- if(f==NULL)
- err(1, "fopen");
-
- while(fgets(buf, sizeof(buf), f) != NULL) {
-
- buf[strcspn(buf, "\n")] = '\0';
-
- if(num >= len) {
- len=len*2;
- *readwrite = realloc(*readwrite, len*sizeof(uint32_t));
- if(*readwrite == NULL)
- err(1, "realloc");
- }
-
- if(*buf != '\0') {
- data = htonl(strtol (buf, &ptr, 0));
- if (ptr && ptr == buf)
- errx (1, "can't resolve number of bytes to transfer");
- } else {
- data = 0;
- }
-
- (*readwrite)[num] =data;
- num++;
- }
-
- *size = num;
-
-
- if(fclose(f) == -1)
- err(1, "fclose");
-}
-
-
-/*
- *
- */
-
-static void
-do_client (const char *server, int port, char *filename,
- int32_t command, int32_t times,
- int32_t bytes, int32_t rpc_sendbytes, int32_t rpc_recvbytes)
-{
- struct rx_connection *conn;
- struct rx_call *call;
- uint32_t addr = str2addr(server);
- struct rx_securityClass *secureobj;
- int secureindex;
- int32_t data;
- int32_t num;
- int ret;
- int i;
- int readp = FALSE;
- char stamp[1024];
- uint32_t size;
-
- uint32_t *readwrite;
-
- ret = rx_Init (0);
- if (ret)
- errx (1, "rx_Init failed");
-
- get_sec(0, &secureobj, &secureindex);
-
- conn = rx_NewConnection(addr,
- port,
- RX_SERVER_ID,
- secureobj,
- secureindex);
- if (conn == NULL)
- errx (1, "failed to contact server");
-
- if (command == RX_PERF_RPC)
- snprintf (stamp, sizeof(stamp),
- "send\t%d times\t%d writes\t%d reads",
- times, rpc_sendbytes, rpc_recvbytes);
- else
- snprintf (stamp, sizeof(stamp),
- "send\t%d times", times);
-
- start_timer();
-
- for(i=0; i < times ; i++) {
-
- DBFPRINT(("starting command "));
-
- call = rx_NewCall (conn);
- if (call == NULL)
- errx (1, "rx_NewCall failed");
-
- data = htonl(RX_PERF_VERSION);
- if (rx_Write (call, &data, 4) != 4)
- errx (1, "rx_Write failed to send version");
-
- data = htonl(command);
- if (rx_Write (call, &data, 4) != 4)
- errx (1, "rx_Write failed to send command");
-
- data = htonl(rxread_size);
- if (rx_Write (call, &data, 4) != 4)
- errx (1, "rx_Write failed to send read size");
- data = htonl(rxwrite_size);
- if (rx_Write (call, &data, 4) != 4)
- errx (1, "rx_Write failed to send write read");
-
-
- switch (command) {
- case RX_PERF_RECV:
- DBFPRINT(("command "));
-
- data = htonl (bytes);
- if (rx_Write (call, &data, 4) != 4)
- errx (1, "rx_Write failed to send size");
-
- DBFPRINT(("sending(%d) ", bytes));
- if (readbytes(call, bytes))
- errx(1, "sendbytes");
-
- if (rx_Read (call, &data, 4) != 4)
- errx (1, "failed to read result from server");
-
- if (data != htonl(RXPERF_MAGIC_COOKIE))
- warn("server send wrong magic cookie in responce");
-
- DBFPRINT(("done\n"));
-
- break;
- case RX_PERF_SEND:
- DBFPRINT(("command "));
-
- data = htonl (bytes);
- if (rx_Write (call, &data, 4) != 4)
- errx (1, "rx_Write failed to send size");
-
- DBFPRINT(("sending(%d) ", bytes));
- if (sendbytes(call, bytes))
- errx(1, "sendbytes");
-
- if (rx_Read (call, &data, 4) != 4)
- errx (1, "failed to read result from server");
-
- if (data != htonl(RXPERF_MAGIC_COOKIE))
- warn("server send wrong magic cookie in responce");
-
- DBFPRINT(("done\n"));
-
- break;
- case RX_PERF_RPC:
- DBFPRINT(("commands "));
-
- data = htonl(rpc_sendbytes);
- if (rx_Write(call, &data, 4) != 4)
- errx (1, "rx_Write failed to send command");
-
- data = htonl(rpc_recvbytes);
- if (rx_Write (call, &data, 4) != 4)
- errx (1, "rx_Write failed to send command");
-
- DBFPRINT(("send(%d) ", rpc_sendbytes));
- sendbytes(call, rpc_sendbytes);
-
- DBFPRINT(("recv(%d) ", rpc_recvbytes));
- readbytes(call, rpc_recvbytes);
-
- if (rx_Read (call, &bytes, 4) != 4)
- errx (1, "failed to read result from server");
-
- if (bytes != htonl(RXPERF_MAGIC_COOKIE))
- warn("server send wrong magic cookie in responce");
-
- DBFPRINT(("done\n"));
-
- break;
- case RX_PERF_FILE:
- readfile(filename, &readwrite, &num);
-
- data = htonl(num);
- if (rx_Write(call, &data, sizeof(data)) != 4)
- errx (1, "rx_Write failed to send size");
-
- if (rx_Write(call, readwrite, num*sizeof(uint32_t))
- != num*sizeof(uint32_t))
- errx (1, "rx_Write failed to send list");
-
- for(i=0; i < num; i++) {
- if(readwrite[i] == 0)
- readp = !readp;
-
- size = ntohl(readwrite[i])*sizeof(uint32_t);
-
- if(readp) {
- readbytes(call, size);
- DBFPRINT(("read\n"));
- } else {
- sendbytes(call, size);
- DBFPRINT(("send\n"));
- }
- }
- break;
- default:
- errx(-1, "do_client: unknown command %x", command);
- }
-
- rx_EndCall (call, 0);
- }
-
- end_and_print_timer (stamp);
- DBFPRINT(("done for good\n"));
-
- rx_Finalize();
-}
-
-static void
-usage()
-{
-#define COMMON ""
-
- fprintf(stderr, "usage: %s client -c send -b <bytes>\n",
- __progname);
- fprintf(stderr, "usage: %s client -c recv -b <bytes>\n",
- __progname);
- fprintf(stderr, "usage: %s client -c rpc -S <rpc_sendbytes> -R <rpc_recvbytes>\n",
- __progname);
- fprintf(stderr, "usage: %s client -c file -f filename\n",
- __progname);
- fprintf (stderr, "%s: usage: common option to the client "
- "-w <rx_write size> -r <rx_read size> -T times -p port -s server\n",
- __progname);
- fprintf(stderr, "usage: %s server -p port\n", __progname);
-#undef COMMMON
- exit(1);
-}
-
-/*
- * do argument processing and call networking functions
- */
-
-static int
-rxperf_server (int argc, char **argv)
-{
- int port = DEFAULT_PORT;
- char *ptr;
- int ch;
-
- while ((ch = getopt(argc, argv, "r:d:p:w:")) != -1) {
- switch (ch) {
- case 'd':
-#ifdef RXDEBUG
- rx_debugFile = fopen(optarg, "w");
- if (rx_debugFile == NULL)
- err(1, "fopen %s", optarg);
-#else
- errx(1, "compiled without RXDEBUG");
-#endif
- break;
- case 'r':
- rxread_size = strtol(optarg, &ptr, 0);
- if (ptr != 0 && ptr[0] != '\0')
- errx (1, "can't resolve readsize");
- if (rxread_size > sizeof(somebuf))
- errx(1, "%d > sizeof(somebuf) (%d)",
- rxread_size, sizeof(somebuf));
- break;
- case 'p':
- port = strtol(optarg, &ptr, 0);
- if (ptr != 0 && ptr[0] != '\0')
- errx (1, "can't resolve portname");
- break;
- case 'w':
- rxwrite_size = strtol(optarg, &ptr, 0);
- if (ptr != 0 && ptr[0] != '\0')
- errx (1, "can't resolve writesize");
- if (rxwrite_size > sizeof(somebuf))
- errx(1, "%d > sizeof(somebuf) (%d)",
- rxwrite_size, sizeof(somebuf));
- break;
- default:
- usage();
- }
- }
-
- if (optind != argc)
- usage();
-
- do_server (htons(port));
-
- return 0;
-}
-
-/*
- * do argument processing and call networking functions
- */
-
-static int
-rxperf_client (int argc, char **argv)
-{
- char *host = DEFAULT_HOST;
- int bytes = DEFAULT_BYTES;
- int port = DEFAULT_PORT;
- char *filename = NULL;
- int32_t cmd;
- int rpc_sendbytes = 3;
- int rpc_recvbytes = 30;
- int print_stats = 0;
- int times = 100;
- char *ptr;
- int ch;
-
- cmd = RX_PERF_UNKNOWN;
-
- while ((ch = getopt(argc, argv, "GT:S:R:b:c:d:p:r:s:w:f:")) != -1) {
- switch (ch) {
- case 'G':
- print_stats = 1;
-#ifndef HAVE_GETRUSAGE
- printf("could not find getrusage, can't print stats\n");
-#endif
- break;
- case 'b':
- bytes = strtol (optarg, &ptr, 0);
- if (ptr && *ptr != '\0')
- errx (1, "can't resolve number of bytes to transfer");
- break;
- case 'c':
- if (strcasecmp(optarg, "send") == 0)
- cmd = RX_PERF_SEND;
- else if (strcasecmp(optarg, "recv") == 0)
- cmd = RX_PERF_RECV;
- else if (strcasecmp(optarg, "rpc") == 0)
- cmd = RX_PERF_RPC;
- else if (strcasecmp(optarg, "file") == 0)
- cmd = RX_PERF_FILE;
- else
- errx(1, "unknown command %s", optarg);
- break;
- case 'd':
-#ifdef RXDEBUG
- rx_debugFile = fopen(optarg, "w");
- if (rx_debugFile == NULL)
- err(1, "fopen %s", optarg);
-#else
- errx(1, "compiled without RXDEBUG");
-#endif
- break;
- case 'p':
- port = strtol(optarg, &ptr, 0);
- if (ptr != 0 && ptr[0] != '\0')
- errx (1, "can't resolve portname");
- break;
- case 'r':
- rxread_size = strtol(optarg, &ptr, 0);
- if (ptr != 0 && ptr[0] != '\0')
- errx (1, "can't resolve readsize");
- if (rxread_size > sizeof(somebuf))
- errx(1, "%d > sizeof(somebuf) (%d)",
- rxread_size, sizeof(somebuf));
- break;
- case 's':
- host = strdup(optarg);
- if (host == NULL)
- err(1, "strdup");
- break;
- case 'w':
- rxwrite_size = strtol(optarg, &ptr, 0);
- if (ptr != 0 && ptr[0] != '\0')
- errx (1, "can't resolve writesize");
- if (rxwrite_size > sizeof(somebuf))
- errx(1, "%d > sizeof(somebuf) (%d)",
- rxwrite_size, sizeof(somebuf));
- break;
- case 'T':
- times = strtol (optarg, &ptr, 0);
- if (ptr && *ptr != '\0')
- errx (1, "can't resolve number times to run the test");
- break;
- case 'S':
- rpc_sendbytes = strtol (optarg, &ptr, 0);
- if (ptr && *ptr != '\0')
- errx (1, "can't resolve number of bytes to transfer");
- break;
- case 'R':
- rpc_recvbytes = strtol (optarg, &ptr, 0);
- if (ptr && *ptr != '\0')
- errx (1, "can't resolve number of bytes to transfer");
- break;
- case 'f':
- filename = optarg;
- break;
- default:
- usage();
- }
- }
-
- if (optind != argc)
- usage();
-
- if (cmd == RX_PERF_UNKNOWN)
- errx(1, "no command given to the client");
-
- do_client(host, htons(port), filename, cmd, times, bytes,
- rpc_sendbytes, rpc_recvbytes);
-
-#if HAVE_GETRUSAGE
- if (print_stats) {
- struct rusage rusage;
- if(getrusage (RUSAGE_SELF, &rusage) < 0)
- printf("no stats\n");
- else
- printf ("Status:\n"
- "- utime = (%ld, %ld)\n"
- "- stime = (%ld, %ld)\n"
- "- maxrss = %ld\n"
- "- ixrss = %ld\n"
- "- idrss = %ld\n"
- "- isrss = %ld\n"
- "- minflt = %ld\n"
- "- majflt = %ld\n"
- "- nswap = %ld\n"
- "- inblock = %ld\n"
- "- oublock = %ld\n"
- "- msgsnd = %ld\n"
- "- msgrcv = %ld\n"
- "- nsignals = %ld\n"
- "- nvcsw = %ld\n"
- "- nivcws = %ld\n",
- rusage.ru_utime.tv_sec,
- rusage.ru_utime.tv_usec,
- rusage.ru_stime.tv_sec,
- rusage.ru_stime.tv_usec,
- rusage.ru_maxrss,
- rusage.ru_ixrss,
- rusage.ru_idrss,
- rusage.ru_isrss,
- rusage.ru_minflt,
- rusage.ru_majflt,
- rusage.ru_nswap,
- rusage.ru_inblock,
- rusage.ru_oublock,
- rusage.ru_msgsnd,
- rusage.ru_msgrcv,
- rusage.ru_nsignals,
- rusage.ru_nvcsw,
- rusage.ru_nivcsw);
- }
-#endif /* HAVE_GETRUSAGE */
- return 0;
-}
-
-/*
- * setup world and call cmd
- */
-
-int
-main(int argc, char **argv)
-{
- PROCESS pid;
-
- __progname = strrchr(argv[0], '/');
- if (__progname)
- __progname++;
- else
- __progname = argv[0];
-
- signal (SIGUSR1, sigusr1);
- signal (SIGINT, sigint);
-
- LWP_InitializeProcessSupport (LWP_NORMAL_PRIORITY, &pid);
-
- memset (somebuf, 0, sizeof(somebuf));
-
- if (argc >= 2 && strcmp(argv[1], "server") == 0)
- rxperf_server(argc - 1, argv + 1);
- else if (argc >= 2 && strcmp(argv[1], "client") == 0)
- rxperf_client(argc - 1, argv + 1);
- else
- usage();
- return 0;
-}
-
diff --git a/usr.sbin/afs/src/rx/simple.example/README b/usr.sbin/afs/src/rx/simple.example/README
deleted file mode 100644
index 8005b7e266f..00000000000
--- a/usr.sbin/afs/src/rx/simple.example/README
+++ /dev/null
@@ -1,11 +0,0 @@
-Copyright 2000, International Business Machines Corporation and others.
-All Rights Reserved.
-
-This software has been released under the terms of the IBM Public
-License. For details, see the LICENSE file in the top-level source
-directory or online at http://www.openafs.org/dl/license10.html
-
-The files in this directory can be made (use make or build) into a simple system
-to demonstrate a simple client and server which use the Rx RPC protocol, together with stubs generated by rxgen.
-
-Run the server, sample_server, with no arguments, and the client, sample_client, with a single argument, the hostname where the server is running. The client simply asks the server to add and subtract 10 different pairs of numbers, the results of which are printed out.
diff --git a/usr.sbin/afs/src/rx/simple.example/sample.xg b/usr.sbin/afs/src/rx/simple.example/sample.xg
deleted file mode 100644
index 2ca28263062..00000000000
--- a/usr.sbin/afs/src/rx/simple.example/sample.xg
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2000, International Business Machines Corporation and others.
- * All Rights Reserved.
- *
- * This software has been released under the terms of the IBM Public
- * License. For details, see the LICENSE file in the top-level source
- * directory or online at http://www.openafs.org/dl/license10.html
- */
-
-package TEST_
-
-%#include <rx/rx.h>
-%#include <rx/rx_null.h>
-
-%#define SAMPLE_SERVER_PORT 5000
-%#define SAMPLE_SERVICE_PORT 0 /* i.e. user server's port */
-%#define SAMPLE_SERVICE_ID 4
-
-/* Maximum number of requests that will be handled by this service simultaneously */
-/* This number will also be guaranteed to execute in parallel if no services' requests are being processed */
-%#define SAMPLE_MAX 2
-/* Minimum number of requests that are guaranteed to be handled immediately */
-%#define SAMPLE_MIN 1
-
-/* Index of the "null" security class in the sample service. This must be 0 (there are N classes, numbered from 0. In this case, N is 1) */
-%#define SAMPLE_NULL 0
-
-
-Add(IN int a, int b, OUT int *result) = 1;
-Sub(IN int a, int b, OUT int *result) = 2;
diff --git a/usr.sbin/afs/src/rx/simple.example/sample_client.c b/usr.sbin/afs/src/rx/simple.example/sample_client.c
deleted file mode 100644
index 5ba90e64ffc..00000000000
--- a/usr.sbin/afs/src/rx/simple.example/sample_client.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2000, International Business Machines Corporation and others.
- * All Rights Reserved.
- *
- * This software has been released under the terms of the IBM Public
- * License. For details, see the LICENSE file in the top-level source
- * directory or online at http://www.openafs.org/dl/license10.html
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-RCSID("$arla: /afs/stacken.kth.se/src/SourceRepository/arla/rx/simple.example/sample_client.c,v 1.1.2.1 2001/09/25 15:02:51 lha Exp $");
-
-#include <sys/types.h>
-#include <netdb.h>
-#include <stdio.h>
-#include "sample.h"
-
-/* Bogus procedure to get internet address of host */
-static u_long GetIpAddress(hostname)
- char *hostname;
-{
- struct hostent *hostent;
- u_long host;
- hostent = gethostbyname(hostname);
- if (!hostent) {printf("host %s not found", hostname);exit(1);}
- if (hostent->h_length != sizeof(u_long)) {
- printf("host address is disagreeable length (%d)", hostent->h_length);
- exit(1);
- }
- memcpy((char *)&host, hostent->h_addr, sizeof(host));
- return host;
-}
-
-main(argc, argv)
- char **argv;
-{
- struct rx_connection *conn;
- u_long host;
- struct rx_securityClass *null_securityObject;
- int i;
-
- rx_Init(0);
- host = GetIpAddress(argv[1]);
- null_securityObject = rxnull_NewClientSecurityObject();
- conn = rx_NewConnection(host, SAMPLE_SERVER_PORT, SAMPLE_SERVICE_ID, null_securityObject, SAMPLE_NULL);
- for(i=1;i<10;i++) {
- int error, result;
- printf("add(%d,%d)",i,i*2);
- error = TEST_Add(conn, i,i*2,&result);
- printf(" ==> %d, error %d\n", result, error);
- printf("sub(%d,%d)",i,i*2);
- error = TEST_Sub(conn, i, i*2, &result);
- printf(" ==> %d, error %d\n", result, error);
- }
-}
diff --git a/usr.sbin/afs/src/rx/simple.example/sample_server.c b/usr.sbin/afs/src/rx/simple.example/sample_server.c
deleted file mode 100644
index 71af0a9eca3..00000000000
--- a/usr.sbin/afs/src/rx/simple.example/sample_server.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2000, International Business Machines Corporation and others.
- * All Rights Reserved.
- *
- * This software has been released under the terms of the IBM Public
- * License. For details, see the LICENSE file in the top-level source
- * directory or online at http://www.openafs.org/dl/license10.html
- */
-
-#include <afsconfig.h>
-#include <afs/param.h>
-
-RCSID("$arla: /afs/stacken.kth.se/src/SourceRepository/arla/rx/simple.example/sample_server.c,v 1.1.2.1 2001/09/25 15:02:51 lha Exp $");
-
-#include <sys/types.h>
-#include <netdb.h>
-#include <stdio.h>
-#include "sample.h"
-
-#define N_SECURITY_OBJECTS 1
-
-extern TEST_ExecuteRequest();
-
-main() {
- struct rx_securityClass *(securityObjects[N_SECURITY_OBJECTS]);
- struct rx_service *service;
-
- /* Initialize Rx, telling it port number this server will use for its single service */
- if (rx_Init(SAMPLE_SERVER_PORT) < 0) Quit("rx_init");
-
- /* Create a single security object, in this case the null security object, for unauthenticated connections, which will be used to control security on connections made to this server */
- securityObjects[SAMPLE_NULL] = rxnull_NewServerSecurityObject();
- if (securityObjects[SAMPLE_NULL] == (struct rx_securityClass *) 0) Quit("rxnull_NewServerSecurityObject");
-
- /* Instantiate a single sample service. The rxgen-generated procedure which is called to decode requests is passed in here (TEST_ExecuteRequest). */
- service = rx_NewService(0, SAMPLE_SERVICE_ID, "sample", securityObjects, N_SECURITY_OBJECTS, TEST_ExecuteRequest);
- if (service == (struct rx_service *) 0) Quit("rx_NewService");
-
- rx_StartServer(1); /* Donate this process to the server process pool */
- Quit("StartServer returned?");
-}
-
-int TEST_Add(call, a, b, result)
-struct rx_call *call;
-int a,b;
-int *result;
-{
- printf("TEST_Add(%d,%d)\n", a,b);
- *result = a + b;
- return 0;
-}
-
-int TEST_Sub(call, a, b, result)
-struct rx_call *call;
-int a,b;
-int *result;
-{
- printf("TEST_Sub(%d,%d)\n", a,b);
- *result = a - b;
- return 0;
-}
-
-Quit(msg, a, b)
- char *msg;
-{
- fprintf(stderr, msg, a, b);
- exit(1);
-}
-
diff --git a/usr.sbin/afs/src/rx/test_rx_clock.c b/usr.sbin/afs/src/rx/test_rx_clock.c
deleted file mode 100644
index 04e3acf01b4..00000000000
--- a/usr.sbin/afs/src/rx/test_rx_clock.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <config.h>
-
-#include "rx_clock.h"
-
-RCSID("$arla: test_rx_clock.c,v 1.3 2000/10/03 00:41:44 lha Exp $");
-
-int
-main(int argc, char **argv)
-{
- struct clock clock_old = {0, 0};
-
- clock_Init ();
- for (;;) {
- struct clock now;
-
- clock_NewTime ();
- clock_GetTime (&now);
- if (now.sec < clock_old.sec ||
- (now.sec == clock_old.sec && now.usec < clock_old.usec))
- abort ();
- printf ("%6ld.%6ld\r", now.sec, now.usec);
- }
- return 0;
-}
diff --git a/usr.sbin/afs/src/rx/transarc b/usr.sbin/afs/src/rx/transarc
deleted file mode 100644
index d2ade14194c..00000000000
--- a/usr.sbin/afs/src/rx/transarc
+++ /dev/null
@@ -1,135 +0,0 @@
-From Tony_Mauro@transarc.com Wed Nov 20 22:08:16 1996
-Date: Wed, 17 Jul 1996 15:35:18 -0400 (EDT)
-From: Tony_Mauro@transarc.com
-To: shadow@dementia.org
-Cc: Ken_Ziolkowski@transarc.com, Kathleen_Rizzuti@transarc.com
-Subject: answer on TR-20916
-
-Dear Derrick:
-
-Transarc's licensing coordinator, Ken Ziolkowski, asked me to write to you
-about TR-20916, to share what he learned at a recent IBM seminar on
-export controls in Washington DC.
-
-While at the seminar, he discussed with several IBM experts on US
-export regulations your proposed mechanisms for protecting the
-"DES-contaminated" parts of Rx. Unfortunately, they do not feel that
-your proposals are sufficient. I'm referring specifically to the
-possibilities you described in your mail of 6-21-96:
-
- 2) Create a patch and do one of:
-
- a) place it in a hidden directory on an ftp server, forcing users who
- wish to fetch it to telnet to the machine and log in as
- "getrx". (telnet to bitsy.mit.edu and log in as getpgp, for
- instance) The directory is moved every 30 minutes.
-
- b) have users send me email certifying that they are U.S. citizens, at
- which point they will be given a pointer to the hidden
- directory. The directory would be moved daily, like getting Kerberos
- from Cygnus.
-
-Possibility (b) is more secure than (a), but it still falls short in
-two respects:
-
- - email certification of US citizenship is not sufficient. It is
- not that hard to masquerade as someone other than your true
- identity, and even (I believe) to fake a US/Canada origination
- address when outside those countries. You need to get written
- certification, as I'll detail below.
-
- - in addition to certification of citizenship, requesters need to
- certify that they will not redistribute the software to anyone
- ineligible to receive it.
-
-Transarc could approve your third possibility
-
- c) I have contacted people at MIT to see if they would be interested
- in doing distribution; It may be possible to arrange with someone
- there to do distribution using their existing channels.
-
-on the assurance that MIT's channels would control access to DES
-as strictly as Transarc must do when it distributes software.
-
-The forms of redistribution that Transarc can approve are:
-
-First, you may redistribute the Rx source code that does not "contain any
-DES algorithms which can be used to encrypt data." In other words,
-you may implement the following part of your 6-21-96 mail:
-
- 1) Strip away anything which might possibly be export-controlled, and
- create a "clean" version, which will be advertised, and put in a
- public place. Presumably removing des and rxkad, plus possibly a bit
- more (I haven't looked yet) will be sufficient for this purpose.
-
-The US Government classifies such software as "GDTA" (I don't know
-what that stands for). Here are some guidelines that Ken picked up at
-the seminar about distributing it:
-
- When providing GTDA software over the network (whether
- by FTP, Web Site or other electronic means):
-
- 1. software must be provided on a 'no charge' basis.
-
- 2. the provider may not impose limitations or constraints on
- the use of the software; e.g. no 'license or use' provisions are
- applicable. The software is truly 'publicly' available.
-
- 3. generally, it should be made available on an anonymous basis; that
- is, you aren't collecting names and addresses. While we may be able to
- preserve the characteristics of GTDA if we collect names and addresses
- e.g. for future marketing purposes, I think it's much easier to
- reconcile when we don't collect the names.
-
-Second, for your own protection against prosecution, we must strongly
-recommend that you drop the idea of distributing the DES source
-version of Rx. The US Government classifies software that uses the DES
-algorithms to encrypt data as a ``munition'' and imposes strict
-penalties for non-authorized distribution. If you use mechanism (a) or
-(b) from above, you would be in violation of Federal law.
-
-To comply with the law, you would need to have requestors sign a
-written copy of something like the following, which is taken from the
-AFS License Agreement:
-
- The End-user hereby agrees and acknowledges that any technology and
- technical data obtained by the end-user, including the
- ___________________ software, are under the jurisdiction of the export
- control laws and regulations of the United States and that any direct
- or indirect export, re-export, license, sale or other transfer of such
- technology may require the prior authorization of the United States
- government. The end-user expressly warrants that in its activities
- under this Agreement it will comply with all applicable laws and
- regulations of the United States and its departments and agencies
- relating to the export of technical data. In the event of any breach
- of the foregoing warranty, the end-user hereby indemnifies
- _________________(the parties providing the technology/technical
- data/software) and agrees to hold such parties harmless from and
- against any loss, liability, cost, damage or expense that such parties
- incurs or suffers as a result in any way of the end-user's failure to
- comply with such United States laws and regulations.
-
-Obviously, you would need to protect the software against access by
-anyone who had not signed such a statement.
-
-The US Government's attitude toward this issue is serious enough that
-Transarc would be liable for prosecution if we were aware you were
-planning to (or actually did) go ahead and use one of your proposed
-mechanisms, and did not try to get you to stop. Therefore, Ken will
-be sending you a written confirmation basically repeating what I've
-said here.
-
-Ken and I would both like to apologize for any damper this puts on our
-plans. We recognize that you are trying to do a service to the
-software community, but unfortunately the export laws do not take good
-intentions into consideration. Further, we appreciate very much that
-you asked us about redistributing Rx before actually doing it. I'm
-sorry if you feel penalized for being honest.
-
-Please feel free to call or write me (mauro@transarc.com; 281-5852
-x7376) or Ken (kenz@transarc.com; 338-4480) if you have any further
-questions.
-
-
-Tony Mauro
-Transarc AFS Support
diff --git a/usr.sbin/afs/src/rx/transarc2 b/usr.sbin/afs/src/rx/transarc2
deleted file mode 100644
index c1b2cf295dc..00000000000
--- a/usr.sbin/afs/src/rx/transarc2
+++ /dev/null
@@ -1,31 +0,0 @@
-Date: Fri, 7 Jun 1996 10:56:41 -0400 (EDT)
-From: Tony_Mauro@transarc.com
-To: Derrick J Brashear <shadow+@andrew.cmu.edu>
-Subject: returning to TR-20916 (Rx redistributability)
-
-Dear Derrick:
-
-Back in March, I opened report TR-20916 in response to your question
-about whether it was true that Rx is freely redistributable, as
-represented to you by Jim Doyle of Boston University. I apologize
-that there has been such a long delay in any further action, but I'd
-like to work now on resolving it. Mike Kazar has confirmed for me
-that he made parts of Rx freely redistributable with Alfred Spector's
-approval, so I don't anticipate a problem, but I'd like to clear
-things with our licensing/contracts dept too. As a first step, can
-you please send me a copy of the copyright from the header that Jim
-mentions?
-
- From what I understand, Rx was developed at CMU as part of a DARPA
- funded research project jointly funded by IBM. Rx was picked up by
- the AFS group and then used.. So, by all rights, the Rx stack is in
- the public domain because the DARPA funding requirement placed it
- there... You can read the copyright in the header for the full
- legalese.
-
-With this in hand, I'll be in a better position to answer our
-Licensing guy's questions.
-
-Thank you.
-
-Tony Mauro
diff --git a/usr.sbin/afs/src/rxdef/Makefile.in b/usr.sbin/afs/src/rxdef/Makefile.in
deleted file mode 100644
index 24c418dd21c..00000000000
--- a/usr.sbin/afs/src/rxdef/Makefile.in
+++ /dev/null
@@ -1,198 +0,0 @@
-# $KTH: Makefile.in,v 1.48 2000/10/25 07:07:43 lha Exp $
-
-srcdir = @srcdir@
-top_builddir = ..
-VPATH = @srcdir@
-
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-
-DEFS = @DEFS@
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-includedir = @includedir@
-
-RM = rm
-YDR = ../ydr/ydr
-YDRFLAGS = -I$(srcdir)
-ETAGS = etags
-MAKEDEPEND = makedepend
-DEFINES =
-INCLUDES = -I../include \
- -I$(srcdir)/../include \
- @INC_roken@ \
- -I$(srcdir)/..
-REALCFLAGS = $(INCLUDES) @KRB4_INC_FLAGS@ $(DEFINES) $(CFLAGS)
-XGFILES = $(srcdir)/vldb.xg \
- $(srcdir)/fs.xg \
- $(srcdir)/cb.xg \
- $(srcdir)/pts.xg \
- $(srcdir)/bos.xg \
- $(srcdir)/volumeserver.xg
-HDRS = vldb.h cb.h fs.h pts.h # volumeserver.h bos.h ubik.h
-MOREHDRS = vldb.cs.h vldb.ss.h cb.cs.h cb.ss.h fs.cs.h fs.ss.h \
- pts.cs.h pts.ss.h ubik.cs.h ubik.ss.h \
- bos.cs.h pts.ss.h
-CFILES = vldb.ss.c vldb.cs.c vldb.ydr.c \
- fs.ss.c fs.cs.c fs.ydr.c \
- cb.ss.c cb.cs.c cb.ydr.c \
- pts.ss.c pts.cs.c pts.ydr.c \
- bos.ss.c bos.cs.c bos.ydr.c \
- volumeserver.ss.c volumeserver.cs.c volumeserver.ydr.c \
- ubik.ss.c ubik.cs.c ubik.ydr.c \
- ka.ss.c ka.cs.c ka.ydr.c
-OBJS = $(CFILES:.c=.o)
-SRCS = $(CFILES) $(HDRS)
-
-FSSERVERLIB = librxfsserver.a
-VLSERVERLIB = librxvlserver.a
-VOLSERVERLIB = librxvolserver.a
-PTSERVERLIB = libptserver.a
-PTCLIENTLIB = libptclient.a
-BOSSERVERLIB = libbosserver.a
-BOSCLIENTLIB = libbosclient.a
-KACLIENTLIB = libkaclient.a
-KASERVERLIB = libkaserver.a
-CLIENTLIB = librxdefclient.a
-
-#vldb.ydr.o fs.ydr.o cb.ydr.o volumeserver.ydr.o
-CLIENTOBJS = vldb.cs.o fs.cs.o cb.ss.o volumeserver.cs.o \
- pts.cs.o ubik.cs.o bos.cs.o
-FSSERVEROBJS = fs.ss.o cb.cs.o
-VLSERVEROBJS = vldb.ss.o vldb.ydr.o ubik.ss.o
-VOLSERVEROBJS = volumeserver.ss.o volumeserver.ydr.o
-PTSERVEROBJS = pts.ydr.o pts.ss.o
-PTCLIENTOBJS = pts.ydr.o pts.cs.o
-BOSSERVEROBJS = bos.ydr.o bos.ss.o
-BOSCLIENTOBJS = bos.ydr.o bos.cs.o
-KACLIENTOBJS = ka.ydr.o ka.cs.o
-KASERVEROBJS = ka.ydr.o ka.ss.o
-RESTSERVEROBJS = pts.ss.o ubik.ss.o
-
-LIBS = $(CLIENTLIB) $(FSSERVERLIB) $(VLSERVERLIB) $(VOLSERVERLIB) $(PTSERVERLIB) $(PTCLIENTLIB) $(BOSSERVERLIB) $(BOSCLIENTLIB) $(KACLIENTLIB) $(KASERVERLIB)
-
-.PHONY: all install depend tags clean
-
-all: $(LIBS)
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
- for LIB in $(LIBS) ; do $(INSTALL_DATA) $$LIB $(DESTDIR)$(libdir)/$$LIB ; done
- $(MKINSTALLDIRS) $(DESTDIR)$(includedir)
- for INC in $(HDRS) $(MOREHDRS) ; do $(INSTALL_DATA) $$INC $(DESTDIR)$(includedir)/$$INC ; done
-
-
-uninstall:
- for LIB in $(LIBS); do rm -f $(DESTDIR)$(libdir)/$$LIB ; done
- for INC in $(HDRS) $(MOREHDRS); do rm -f $(DESTDIR)$(includedir)/$$INC ; done
-
-ydr: $(XGFILES)
- ../ydr/ydr $<
-
-# $(SERVEROBJS) $(CLIENTOBJS): $(XGFILES) $(CFILES) $(HDRS)
-
-
-$(CLIENTLIB): $(CLIENTOBJS)
- $(AR) cr $@ $(CLIENTOBJS)
- $(RANLIB) $@
-
-$(FSSERVERLIB): $(FSSERVEROBJS)
- $(AR) cr $@ $(FSSERVEROBJS)
- $(RANLIB) $@
-
-$(VLSERVERLIB): $(VLSERVEROBJS)
- $(AR) cr $@ $(VLSERVEROBJS)
- $(RANLIB) $@
-
-$(VOLSERVERLIB): $(VOLSERVEROBJS)
- $(AR) cr $@ $(VOLSERVEROBJS)
- $(RANLIB) $@
-
-$(PTSERVERLIB): $(PTSERVEROBJS)
- $(AR) cr $@ $(PTSERVEROBJS)
- $(RANLIB) $@
-
-$(PTCLIENTLIB): $(PTCLIENTOBJS)
- $(AR) cr $@ $(PTCLIENTOBJS)
- $(RANLIB) $@
-
-$(BOSSERVERLIB): $(BOSSERVEROBJS)
- $(AR) cr $@ $(BOSSERVEROBJS)
- $(RANLIB) $@
-
-$(BOSCLIENTLIB): $(BOSCLIENTOBJS)
- $(AR) cr $@ $(BOSCLIENTOBJS)
- $(RANLIB) $@
-
-$(KACLIENTLIB): $(KACLIENTOBJS)
- $(AR) cr $@ $(KACLIENTOBJS)
- $(RANLIB) $@
-
-$(KASERVERLIB): $(KASERVEROBJS)
- $(AR) cr $@ $(KASERVEROBJS)
- $(RANLIB) $@
-
-#%.cs.c %.cs.h %.ss.c %.ss.h %.ydr.c %.h: %.xg
-# $(YDR) $(YDRFLAGS) $(srcdir)/$(<F)
-
-vldb.cs.c vldb.cs.h vldb.ss.c vldb.ss.h vldb.ydr.c vldb.h: vldb.xg
- $(YDR) $(YDRFLAGS) $(srcdir)/vldb.xg
-
-fs.cs.c fs.cs.h fs.ss.c fs.ss.h fs.ydr.c fs.h: fs.xg
- $(YDR) $(YDRFLAGS) $(srcdir)/fs.xg
-
-cb.cs.c cb.cs.h cb.ss.c cb.ss.h cb.ydr.c cb.h: cb.xg
- $(YDR) $(YDRFLAGS) $(srcdir)/cb.xg
-
-pts.cs.c pts.cs.h pts.ss.c pts.ss.h pts.ydr.c pts.h: pts.xg
- $(YDR) $(YDRFLAGS) $(srcdir)/pts.xg
-
-bos.cs.c bos.cs.h bos.ss.c bos.ss.h bos.ydr.c bos.h: bos.xg
- $(YDR) $(YDRFLAGS) $(srcdir)/bos.xg
-
-ka.cs.c ka.cs.h ka.ss.c ka.ss.h ka.ydr.c ka.h: ka.xg
- $(YDR) $(YDRFLAGS) $(srcdir)/ka.xg
-
-volumeserver.cs.c volumeserver.cs.h volumeserver.ss.c volumeserver.ss.h volumeserver.ydr.c volumeserver.h: volumeserver.xg
- $(YDR) $(YDRFLAGS) $(srcdir)/volumeserver.xg
-
-ubik.cs.c ubik.cs.h ubik.ss.c ubik.ss.h ubik.ydr.c ubik.h: ubik.xg
- $(YDR) $(YDRFLAGS) $(srcdir)/ubik.xg
-
-
-Makefile: Makefile.in ../config.status
- cd ..; CONFIG_FILES=rxdef/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(CFILES)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(OBJS) $(LIBS) ydr_tmp*.c *.cs.c *.cs.h *.ss.c *.ss.h *.ydr.c *.td.c *~ *.o core *.core vldb.h cb.h fs.h pts.h bos.h ka.h volumeserver.h ubik.h
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *~
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/rxdef/afsuuid.h b/usr.sbin/afs/src/rxdef/afsuuid.h
deleted file mode 100644
index e18ec4c90a7..00000000000
--- a/usr.sbin/afs/src/rxdef/afsuuid.h
+++ /dev/null
@@ -1,19 +0,0 @@
-%#ifndef _AFSUUID_COMMON_
-%#define _AFSUUID_COMMON_
-
-/* $arla: afsuuid.h,v 1.1 2002/04/16 18:44:07 lha Exp $ */
-
-#ifndef AFSUUID_GENERATE
-#define AFSUUID_GENERATE __attribute__((__nogenerate__))
-#endif
-
-struct afsUUID {
- u_long time_low;
- u_short time_mid;
- u_short time_hi_and_version;
- char clock_seq_hi_and_reserved;
- char clock_seq_low;
- char node[6];
-} AFSUUID_GENERATE;
-
-%#endif /* _AFSUUID_COMMON_ */
diff --git a/usr.sbin/afs/src/rxdef/bos.xg b/usr.sbin/afs/src/rxdef/bos.xg
deleted file mode 100644
index 70c76d456bc..00000000000
--- a/usr.sbin/afs/src/rxdef/bos.xg
+++ /dev/null
@@ -1,233 +0,0 @@
-/* This is -*-c-*- */
-/* $arla: bos.xg,v 1.8 2002/05/31 21:05:55 lha Exp $ */
-
-/*
- * Interface to BOS server
- */
-
-package BOZO_
-
-%#include <fs_errors.h>
-
-error-function conv_to_arla_errno
-
-const BZNOTACTIVE = 39424;
-const BZNOENT = 39425;
-const BZBUSY = 39426;
-const BZEXISTS = 39427;
-const BZNOCREATE = 39428;
-const BZDOM = 39429;
-const BZACCESS = 39430;
-const BZSYNTAX = 39431;
-const BZIO = 39432;
-const BZNET = 39433;
-const BZBADTYPE = 39434;
-
-const BOZO_BSSIZE = 256;
-
-/*
- *
- */
-
-const BSTAT_SHUTDOWN = 0;
-const BSTAT_NORMAL = 1;
-const BSTAT_SHUTTINGDOWN = 2;
-const BSTAT_STARTINGUP = 3;
-
-const BOZO_PRUNEOLD = 1;
-const BOZO_PRUNEBAK = 2;
-const BOZO_PRUNECORE = 4;
-
-const BPROC_STARTED = 1;
-const BPROC_EXITED = 2;
-
-const BOZO_HASCORE = 1;
-const BOZO_ERRORSTOP = 2;
-const BOZO_BADDIRACCESS = 4;
-
-const BNODE_NEEDTIMEOUT = 0x01;
-const BNODE_ACTIVE = 0x02;
-const BNODE_WAIT = 0x04;
-const BNODE_DELETE = 0x08;
-const BNODE_ERRORSTOP = 0x10;
-
-const KTIME_HOUR = 0x01;
-const KTIME_MIN = 0x02;
-const KTIME_SEC = 0x04; /* XXX check me */
-const KTIME_DAY = 0x08;
-const KTIME_TIME = 0x07;
-const KTIME_NEVER = 0x10;
-const KTIME_NOW = 0x20;
-
-/* GetRestartTime */
-
-const BOZO_RESTARTTIME_GENERAL = 0x1; /* general reboot time */
-const BOZO_RESTARTTIME_NEWBIN = 0x2; /* new binary */
-
-#if 0
-const GETSTATUS_FSRUN = "file server running";
-const GETSTATUS_RSRUNVOLDOWN = "file server running; volser down";
-const GETSTATUS_SALVAGE = "salvaging file system";
-const GETSTATUS_FSSTART = "starting file server";
-const GETSTATUS_FSDOWN = "file server shutting down";
-const GETSTATUS_SALVAGERDOWN = "salvager shutting down";
-const GETSTATUS_FSSTOP = "salvager shut down";
-#endif
-
-struct bozo_status {
- long goal;
- long fileGoal;
- long porcStartTime;
- long procStarts;
- long lastAnyExit;
- long lastErrorExit;
- long errorCode;
- long errorSignal;
- long flags;
- long spare[8];
-};
-
-struct bozo_netKTime {
- long mask;
- short hour;
- short min;
- short sec;
- short day;
-};
-
-struct bozo_key {
- char data[8];
-};
-
-struct bozo_keyInfo {
- long mod_sec;
- long mod_usec;
- unsigned long keyCheckSum;
- long spare2;
-};
-
-#if 0
-struct bnode_ops {
- struct bnode *(*create)();
- long (*timeout)();
- long (*getstat)();
- long (*setstat)();
- long (*delete)();
- long (*procexit)();
- long (*getstring)();
- long (*getparm)();
- long (*restartp)();
- long (*hascore)();
-};
-#endif
-
-
-CreateBnode (IN string type<BOZO_BSSIZE>,
- IN string instance<BOZO_BSSIZE>,
- IN string p1<BOZO_BSSIZE>,
- IN string p2<BOZO_BSSIZE>,
- IN string p3<BOZO_BSSIZE>,
- IN string p4<BOZO_BSSIZE>,
- IN string p5<BOZO_BSSIZE>,
- IN string p6<BOZO_BSSIZE>) = 80;
-
-DeleteBnode (IN string instance<BOZO_BSSIZE>) = 81;
-
-SetStatus (IN string instance<BOZO_BSSIZE>,
- IN long status) = 82;
-
-
-GetStatus (IN string instance<BOZO_BSSIZE>,
- OUT long *inStat,
- OUT string statdescr<BOZO_BSSIZE>) = 83;
-
-
-EnumerateInstance (IN long instance,
- OUT string iname<BOZO_BSSIZE>) = 84;
-
-GetInstanceInfo (IN string instance<BOZO_BSSIZE>,
- OUT string type<BOZO_BSSIZE>,
- OUT struct bozo_status *status) = 85;
-
-GetInstanceParm (IN string instance<BOZO_BSSIZE>,
- IN long num,
- OUT string parm<BOZO_BSSIZE>) = 86;
-
-AddSUser (IN string name<BOZO_BSSIZE>) = 87;
-
-DeleteSUser (IN string name<BOZO_BSSIZE>) = 88;
-
-ListSUsers (IN long an,
- OUT string name<BOZO_BSSIZE>) = 89;
-
-ListKeys (IN long an,
- OUT long *kvno,
- OUT struct bozo_key *key,
- OUT struct bozo_keyInfo *keinfo) = 90;
-
-AddKey (IN long an,
- IN struct bozo_key *key) = 91;
-
-DeleteKey (IN long an) = 92;
-
-SetCellName (IN string name<BOZO_BSSIZE>) = 93;
-
-GetCellName (OUT string name<BOZO_BSSIZE>) = 94;
-
-GetCellHost (IN long awhich,
- OUT string name<BOZO_BSSIZE>) = 95;
-
-AddCellHost (IN string name<BOZO_BSSIZE>) = 96;
-
-DeleteCellHost (IN string name<BOZO_BSSIZE>) = 97;
-
-SetTStatus (IN string instance<BOZO_BSSIZE>,
- IN long status) = 98;
-
-ShutdownAll () = 99;
-
-RestartAll () = 100;
-
-StartupAll () = 101;
-
-SetNoAuthFlag (IN long flag) = 102;
-
-ReBozo () = 103;
-
-Restart (IN string instance<BOZO_BSSIZE>) = 104;
-
-Install (IN string path<BOZO_BSSIZE>,
- IN long size,
- IN long flags,
- IN long date) split = 105;
-
-UnInstall (IN string path<BOZO_BSSIZE>) = 106;
-
-GetDates (IN string path<BOZO_BSSIZE>,
- OUT long *newtime,
- OUT long *baktime,
- OUT long *oldtime) = 107;
-
-
-Exec (IN string cmd<BOZO_BSSIZE>) = 108;
-
-Prune (IN long flags) = 109;
-
-SetRestartTime (IN long type,
- IN struct bozo_netKTime *restartTime) = 110;
-
-
-
-GetRestartTime (IN long type,
- OUT struct bozo_netKTime *restartTime) = 111;
-
-GetLog(IN string name<BOZO_BSSIZE>) split = 112;
-
-WaitAll () = 113;
-
-GetInstanceStrings (IN string instance<BOZO_BSSIZE>,
- OUT string errorname<BOZO_BSSIZE>,
- OUT string spare1<BOZO_BSSIZE>,
- OUT string spare2<BOZO_BSSIZE>,
- OUT string spare3<BOZO_BSSIZE>) = 114;
-
diff --git a/usr.sbin/afs/src/rxdef/cb.xg b/usr.sbin/afs/src/rxdef/cb.xg
deleted file mode 100644
index a34c8e06c45..00000000000
--- a/usr.sbin/afs/src/rxdef/cb.xg
+++ /dev/null
@@ -1,129 +0,0 @@
-/* This is -*-c-*- */
-
-/*
- * Interface to CM
- */
-
-package RXAFSCB_
-
-%#include <fs_errors.h>
-%#include <fs.h>
-
-error-function conv_to_arla_errno
-
-/*
- * Interface
- */
-
-#include "common.h"
-
-struct AFSDBLockDesc {
- char waitStates;
- char exclLocked;
- short readersReading;
- short numWaiting;
- short spare;
- int pid_last_reader;
- int pid_writer;
- int src_indicator;
-};
-
-struct AFSDBLock {
- char name[16];
- struct AFSDBLockDesc lock;
-};
-
-struct AFSDBCacheEntry {
- int32_t addr;
- int32_t cell; /*Cell part of the fid*/
- AFSFid netFid; /*Network part of the fid*/
- int32_t Length;
- int32_t DataVersion;
- struct AFSDBLockDesc lock;
- int32_t callback;
- int32_t cbExpires;
- short refCount;
- short opens;
- short writers;
- char mvstat;
- char states;
-};
-
-const AFSCB_MAX_XSTAT_LONGS = 2048;
-typedef int32_t AFSCB_CollData<AFSCB_MAX_XSTAT_LONGS>;
-const AFSCB_XSTATSCOLL_CALL_INFO = 0; /*CM call counting & info*/
-const AFSCB_XSTATSCOLL_PERF_INFO = 1; /*CM performance info*/
-const AFSCB_XSTATSCOLL_FULL_PERF_INFO = 2; /*CM performance info*/
-
-const AFS_MAX_INTERFACE_ADDR = 32;
-struct interfaceAddr { /* for multihomed clients */
- int numberOfInterfaces;
- afsUUID uuid;
- ASIS int32_t addr_in[AFS_MAX_INTERFACE_ADDR]; /* interface addresses */
- ASIS int32_t subnetmask[AFS_MAX_INTERFACE_ADDR]; /* subnet masks in net ord */
- int32_t mtu[AFS_MAX_INTERFACE_ADDR]; /* MTU */
-};
-
-const AFSMAXCELLHOSTS = 8; /*Max VLDB servers per cell*/
-
-typedef int32_t serverList[AFSMAXCELLHOSTS];
-
-typedef afs_uint32 cacheConfig<>;
-
-
-CallBack (IN AFSCBFids *a_fidArrayP,
- IN AFSCBs *a_callBackArrayP) = 204;
-
-InitCallBackState () = 205;
-
-Probe () = 206;
-
-/* return 0 if ok, 1 if bad index, lock == lock number index */
-
-GetLock(IN int32_t index, OUT AFSDBLock *lock) = 207;
-
-/* return 0 if ok, 1 if bad index, cbentry == cbentry number index */
-
-GetCE(IN int32_t index, OUT AFSDBCacheEntry *cbentry) = 208;
-
-/* AFSCB_XSTAT_VERSION */
-
-XStatsVersion(OUT int32_t *version) = 209;
-
-GetXStats(IN int32_t client_version_num,
- IN int32_t collection_number,
- OUT int32_t *server_version_number, /* AFSCB_XSTAT_VERSION */
- OUT int32_t *time,
- OUT AFSCB_CollData *stats) = 210;
-
-InitCallBackState2(OUT interfaceAddr *addr) = 211;
-
-/* fill in interfaces et al in `addr' */
-
-WhoAreYou(OUT interfaceAddr *addr) = 212;
-
-/* to be done */
-
-InitCallBackState3(IN afsUUID *serverUuid) = 213;
-
-/* still there? 0 if match, !0 otherwise */
-
-ProbeUUID(IN afsUUID *uuid) = 214;
-
-GetCellServDB(IN afs_int32 cellIndex,
- OUT string cellName<AFSNAMEMAX>,
- OUT serverList *cellHosts) = 216;
-
-GetLocalCell(OUT string cellName<AFSNAMEMAX>) = 217;
-
-GetCacheConfig(IN afs_uint32 callerVersion,
- OUT afs_uint32 *serverVersion,
- OUT afs_uint32 *configCount,
- OUT cacheConfig *config) = 218;
-
-GetCellByNum(IN int32_t cellNumber,
- OUT string cellName<AFSNAMEMAX>,
- OUT serverList *cellHosts) = 65537;
-
-TellMeAboutYourself(OUT struct interfaceAddr *addr,
- OUT Capabilities *capabilities) = 65538;
diff --git a/usr.sbin/afs/src/rxdef/common.h b/usr.sbin/afs/src/rxdef/common.h
deleted file mode 100644
index ecb55301c45..00000000000
--- a/usr.sbin/afs/src/rxdef/common.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Common defintions used by several *.xg files
- */
-
-/* $arla: common.h,v 1.19 2003/03/06 20:39:47 lha Exp $ */
-
-%#ifndef _COMMON_
-%#define _COMMON_
-
-const LockRead = 0;
-const LockWrite = 1;
-const LockExtend = 2;
-const LockRelease = 3;
-
-const AFSNAMEMAX = 256;
-
-const RWVOL = 0;
-const ROVOL = 1;
-const BACKVOL = 2;
-
-struct AFSFid {
- uint32_t Volume;
- uint32_t Vnode;
- uint32_t Unique;
-};
-
-struct VenusFid {
- int32_t Cell;
- AFSFid fid;
-};
-
-struct AFSCallBack {
- uint32_t CallBackVersion;
- uint32_t ExpirationTime;
- uint32_t CallBackType;
-};
-
-enum CallBackType { CBEXCLUSIVE = 1, CBSHARED = 2, CBDROPPED = 3};
-
-const CALLBACK_VERSION = 1;
-
-struct AFSVolSync {
- uint32_t spare1;
- uint32_t spare2;
- uint32_t spare3;
- uint32_t spare4;
- uint32_t spare5;
- uint32_t spare6;
-};
-
-const TYPE_FILE = 1;
-const TYPE_DIR = 2;
-const TYPE_LINK = 3;
-
-struct AFSFetchStatus {
- uint32_t InterfaceVersion;
- uint32_t FileType;
- uint32_t LinkCount;
- uint32_t Length;
- uint32_t DataVersion;
- uint32_t Author;
- uint32_t Owner;
- uint32_t CallerAccess;
- uint32_t AnonymousAccess;
- uint32_t UnixModeBits;
- uint32_t ParentVnode;
- uint32_t ParentUnique;
- uint32_t SegSize;
- uint32_t ClientModTime;
- uint32_t ServerModTime;
- uint32_t Group;
- uint32_t SyncCount;
- uint32_t DataVersionHigh; /* For AFS/DFS translator */
- uint32_t LockCount;
- uint32_t LengthHigh;
- uint32_t ErrorCode;
-};
-
-/*
- * Things in AFSStoreStatus.mask
- */
-
-const SS_MODTIME = 0x01 ;
-const SS_OWNER = 0x02 ;
-const SS_GROUP = 0x04 ;
-const SS_MODEBITS = 0x08 ;
-const SS_SEGSIZE = 0x10 ;
-const SS_FSYNC = 0x400; /* 1024 */
-
-
-struct AFSStoreStatus {
- uint32_t Mask;
- uint32_t ClientModTime;
- uint32_t Owner;
- uint32_t Group;
- uint32_t UnixModeBits;
- uint32_t SegSize;
-};
-
-struct AFSFetchVolumeStatus {
- int32_t Vid;
- int32_t ParentId;
- char Online;
- char InService;
- char Blessed;
- char NeedsSalvage;
- int32_t Type;
- int32_t MinQuota;
- int32_t MaxQuota;
- int32_t BlocksInUse;
- int32_t PartBlocksAvail;
- int32_t PartMaxBlocks;
-};
-
-struct AFSStoreVolumeStatus {
- int32_t Mask;
- int32_t MinQuota;
- int32_t MaxQuota;
-};
-
-const AFS_SETMINQUOTA = 1;
-const AFS_SETMAXQUOTA = 2;
-
-const AFSOPAQUEMAX = 1024;
-
-typedef opaque AFSOpaque<AFSOPAQUEMAX>;
-
-typedef int32_t ViceLockType;
-
-const AFSCBMAX = 50;
-
-typedef AFSCallBack AFSCBs<AFSCBMAX>;
-typedef AFSFetchStatus AFSBulkStats<AFSCBMAX>;
-typedef AFSFid AFSCBFids<AFSCBMAX>;
-
-/* Definitions for ACLs */
-
-const PRSFS_READ = 1 ; /* Read files */
-const PRSFS_WRITE = 2 ; /* Write files & write-lock existing files */
-const PRSFS_INSERT = 4 ; /* Insert & write-lock new files */
-const PRSFS_LOOKUP = 8 ; /* Enumerate files and examine ACL */
-const PRSFS_DELETE = 16 ; /* Remove files */
-const PRSFS_LOCK = 32 ; /* Read-lock files */
-const PRSFS_ADMINISTER = 64 ; /* Set access list of directory */
-
-struct AFSVolumeInfo {
- uint32_t Vid;
- int32_t Type;
- uint32_t Type0;
- uint32_t Type1;
- uint32_t Type2;
- uint32_t Type3;
- uint32_t Type4;
- uint32_t ServerCount;
- uint32_t Server0;
- uint32_t Server1;
- uint32_t Server2;
- uint32_t Server3;
- uint32_t Server4;
- uint32_t Server5;
- uint32_t Server6;
- uint32_t Server7;
- uint16_t Port0;
- uint16_t Port1;
- uint16_t Port2;
- uint16_t Port3;
- uint16_t Port4;
- uint16_t Port5;
- uint16_t Port6;
- uint16_t Port7;
-};
-
-#include "afsuuid.h"
-
-const AFSCAPABILITIESMAX = 196;
-
-typedef int32_t Capabilities<AFSCAPABILITIESMAX>;
-
-%#endif /* _COMMON_ */
diff --git a/usr.sbin/afs/src/rxdef/fs.xg b/usr.sbin/afs/src/rxdef/fs.xg
deleted file mode 100644
index a0faf5ee483..00000000000
--- a/usr.sbin/afs/src/rxdef/fs.xg
+++ /dev/null
@@ -1,185 +0,0 @@
-/* This is -*-c-*- */
-
-/* $arla: fs.xg,v 1.18 2003/03/06 16:15:53 lha Exp $ */
-
-/*
- * Interface to FS
- */
-
-package RXAFS_
-
-%#include <fs_errors.h>
-
-error-function conv_to_arla_errno
-
-#define AFSUUID_GENERATE
-
-#include "common.h"
-
-const FLUSHMAX = 10;
-typedef int32_t ViceIds<FLUSHMAX>;
-typedef int32_t IPAddrs<FLUSHMAX>;
-
-/*
- * Interface
- */
-
-FetchData (IN AFSFid *a_fidToFetchP,
- IN long a_offset,
- IN long a_lenInBytes,
- OUT AFSFetchStatus *a_fidStatP,
- OUT AFSCallBack *a_callBackP,
- OUT AFSVolSync *a_volSyncP) split = 130;
-
-FetchACL (IN AFSFid *a_dirFidP,
- OUT AFSOpaque *a_ACLP,
- OUT AFSFetchStatus *a_dirNewStatP,
- OUT AFSVolSync *a_volSyncP) = 131;
-
-FetchStatus (IN AFSFid *a_fidToStatP,
- OUT AFSFetchStatus *a_currStatP,
- OUT AFSCallBack *a_callBackP,
- OUT AFSVolSync *a_volSyncP) = 132;
-
-StoreData (IN AFSFid *a_fidToStoreP,
- IN AFSStoreStatus *a_fidStatusP,
- IN long a_offset,
- IN long a_lenInBytes,
- IN long a_fileLenInBytes,
- OUT AFSFetchStatus *a_fidStatP,
- OUT AFSVolSync *a_volSyncP) split = 133;
-
-/*
- * Correct documentation wouldn't make this fun enough. Gaah.
- */
-StoreACL (IN AFSFid *a_dirFidP,
- IN AFSOpaque *a_ACLToStoreP,
- OUT AFSFetchStatus *a_dirNewStatP,
- OUT AFSVolSync *a_volSyncP) = 134;
-
-StoreStatus (IN AFSFid *a_fidP,
- IN AFSStoreStatus *a_currStatusP,
- OUT AFSFetchStatus *a_srStatusP,
- OUT AFSVolSync *a_volSyncP) = 135;
-
-RemoveFile (IN AFSFid *a_dirFidP,
- IN string a_name<AFSNAMEMAX>,
- OUT AFSFetchStatus *a_srvStatusP,
- OUT AFSVolSync *a_volSyncP) = 136;
-
-CreateFile (IN AFSFid *DirFid,
- IN string Name<AFSNAMEMAX>,
- IN AFSStoreStatus *InStatus,
- OUT AFSFid *OutFid,
- OUT AFSFetchStatus *OutFidStatus,
- OUT AFSFetchStatus *OutDirStatus,
- OUT AFSCallBack *CallBack,
- OUT AFSVolSync *a_volSyncP) = 137;
-
-Rename (IN AFSFid *a_origDirFidP,
- IN string a_origNameP<AFSNAMEMAX>,
- IN AFSFid *a_newDirFidP,
- IN string a_newNameP<AFSNAMEMAX>,
- OUT AFSFetchStatus *a_origDirStatusP,
- OUT AFSFetchStatus *a_newDirStatusP,
- OUT AFSVolSync *a_volSyncP) = 138;
-
-Symlink (IN AFSFid *a_dirFidP,
- IN string a_nameP<AFSNAMEMAX>,
- IN string a_linkContentsP<AFSNAMEMAX>,
- IN AFSStoreStatus *a_origDirStatP,
- OUT AFSFid *a_newFidP,
- OUT AFSFetchStatus *a_newFidStatP,
- OUT AFSFetchStatus *a_newDirStatP,
- OUT AFSVolSync *a_volSyncP) = 139;
-
-Link (IN AFSFid *a_dirFidP,
- IN string a_nameP<AFSNAMEMAX>,
- IN AFSFid *a_existingFidP,
- OUT AFSFetchStatus *a_newFidStatP,
- OUT AFSFetchStatus *a_newDirStatP,
- OUT AFSVolSync *a_volSyncP) = 140;
-
-MakeDir (IN AFSFid *a_parentDirFidP,
- IN string a_newDirNameP<AFSNAMEMAX>,
- IN AFSStoreStatus *a_currStatP,
- OUT AFSFid *a_newDirFidP,
- OUT AFSFetchStatus *a_dirFidStatP,
- OUT AFSFetchStatus *a_parentDirStatP,
- OUT AFSCallBack *a_newDirCallBackP,
- OUT AFSVolSync *a_volSyncP) = 141;
-
-RemoveDir (IN AFSFid *a_parentDirStatP,
- IN string a_dirNameP<AFSNAMEMAX>,
- OUT AFSFetchStatus *a_newParentDirStatP,
- OUT AFSVolSync *a_volSyncP) = 142;
-
-GiveUpCallBacks (IN AFSCBFids *a_fidArrayP,
- IN AFSCBs *a_callBackArrayP) = 147;
-
-/*
- * fetch the status of volume `a_volIDP' into `a_volFetchStatP'.
- * a_volNameP is not filled in.
- */
-
-GetVolumeStatus (IN long a_volIDP,
- OUT AFSFetchVolumeStatus *a_volFetchStatP,
- OUT string a_volNameP<AFSNAMEMAX>,
- OUT string a_offLineMsgP<AFSOPAQUEMAX>,
- OUT string a_motdP<AFSOPAQUEMAX>) = 149;
-
-SetVolumeStatus (IN long a_volIDP,
- IN AFSStoreVolumeStatus *a_volStoreStatP,
- IN string a_volNameP<AFSNAMEMAX>,
- IN string a_offLineMsgP<AFSOPAQUEMAX>,
- IN string a_motdP<AFSOPAQUEMAX>) = 150;
-
-GetRootVolume (OUT string a_rootVolNameP<AFSNAMEMAX>) = 151;
-
-GetTime (OUT unsigned long *a_secondsP,
- OUT unsigned long *a_uSecondsP) = 153;
-
-NGetVolumeInfo (IN string VolumeName<AFSNAMEMAX>,
- OUT AFSVolumeInfo *stuff) = 154;
-
-BulkStatus (IN AFSCBFids *FidsArray,
- OUT AFSBulkStats *StatArray,
- OUT AFSCBs *CBArray,
- OUT AFSVolSync *Sync) = 155;
-
-SetLock (IN AFSFid *Fid,
- IN ViceLockType Type,
- OUT AFSVolSync *Sync) = 156;
-
-ExtendLock (IN AFSFid *Fid,
- OUT AFSVolSync *Sync) = 157;
-
-ReleaseLock (IN AFSFid *Fid,
- OUT AFSVolSync *Sync) = 158;
-
-FlushCPS (IN ViceIds *IdsArray,
- IN IPAddrs *AddrsArray,
- IN int32_t spare1,
- OUT int32_t *spare2,
- OUT int32_t *spare3) = 162;
-
-#if 0
-FetchData64 (IN AFSFid *Fid,
- IN int64_t Pos,
- IN int64_t Length,
- OUT AFSFetchStatus *OutStatus,
- OUT AFSCallBack *CallBack,
- OUT AFSVolSync *Sync) split = 65537;
-
-StoreData64 (IN AFSFid *Fid,
- IN AFSStoreStatus *InStatus,
- IN uint64_t Pos,
- INT uint64_t Length,
- INT uint64_t FileLength,
- OUT AFSFetchStatus *OutStatus,
- AFSVolSync *Sync) split = 65538;
-#endif
-
-GiveUpAllCallBacks () = 65539 ;
-
-GetCapabilities(OUT Capabilities *capabilities) = 65540;
diff --git a/usr.sbin/afs/src/rxdef/ka.xg b/usr.sbin/afs/src/rxdef/ka.xg
deleted file mode 100644
index 5ae7125c034..00000000000
--- a/usr.sbin/afs/src/rxdef/ka.xg
+++ /dev/null
@@ -1,202 +0,0 @@
-/* This is -*-c-*- */
-
-/*
- * Interface to KAS
- */
-
-const AUTHENTICATE_OLD = 1;
-const CHANGEPASSWORD = 2;
-const GETTICKET_OLD = 3;
-const SETPASSWORD = 4;
-const SETFIELDS = 5;
-const CREATEUSER = 6;
-const DELETEUSER = 7;
-const GETENTRY = 8;
-const LISTENTRY = 9;
-const GETSTATS = 10;
-const DEBUG = 11;
-const GETPASSWORD = 12;
-const GETRANDOMKEY = 13;
-const AUTHENTICATE = 21;
-const GETTICKET = 23;
-
-const MAXKAKVNO = 127;
-
-/* Flags (note 0 is illegal) */
-
-const KAFNORMAL = 0x1;
-/* For the two following the KAFNORMAL MUST not be set */
-const KAFREE = 0x2; /* on freelist */
-const KAOLDKEYS = 0x10; /* used to store old keys */
-/* misc flags */
-const KASPECIAL = 0x100; /* special authserver principal */
-const KAFASSOCROOT = 0x200; /* root of associate tree */
-const KAFASSOC = 0x300; /* associate entry */
-
-/* The following flags are used on KAA_SetFields() */
-const KAFADMIN = 0x004; /* administrator */
-const KAFNOTGS = 0x008; /* can't get or use TGT */
-const KAFNOSEAL = 0x020; /* can't be used as server */
-const KAFNOCPW = 0x040; /* can't change password */
-const KAFNEWASSOC = 0x080; /* can create associates */
-
-/* MISC stuff */
-
-const KAMAJORVERSION = 5;
-const KAMINORVERSION = 1;
-const NEVERDATE = 037777777777;
-const KADEBUGKCINFOSIZE = 25;
-
-#define Date uint32_t
-
-/* Errors */
-
-const KADATABASEINCONSISTENT = 180480;
-const KAEXIST = 180481;
-const KAIO = 180482;
-const KACREATEFAIL = 180483;
-const KANOENT = 180484;
-const KAEMPTY = 180485;
-const KABADNAME = 180486;
-const KABADINDEX = 180487;
-const KANOAUTH = 180488;
-const KAANSWERTOOLONG = 180489;
-const KABADREQUEST = 180490;
-const KAOLDINTERFACE = 180491;
-const KABADARGUMENT = 180492;
-const KABADCMD = 180493;
-const KANOKEYS = 180494;
-const KAREADPW = 180495;
-const KABADKEY = 180496;
-const KAUBIKINIT = 180497;
-const KAUBIKCALL = 180498;
-const KABADPROTOCOL = 180499;
-const KANOCELLS = 180500;
-const KANOCELL = 180501;
-const KATOOMANYUBIKS = 180502;
-const KATOOMANYKEYS = 180503;
-const KABADTICKET = 180504;
-const KAUNKNOWNKEY = 180505;
-const KAKEYCACHEINVALID = 180506;
-const KABADSERVER = 180507;
-const KABADUSER = 180508;
-const KABADCPW = 180509;
-const KABADCREATE = 180510;
-const KANOTICKET = 180511;
-const KAASSOCUSER = 180512;
-const KANOTSPECIAL = 180513;
-const KACLOCKSKEW = 180514;
-const KANORECURSE = 180515;
-const KARXFAIL = 180516;
-const KANULLPASSWORD = 180517;
-const KAINTERNALERROR = 180518;
-const KAPWEXPIRED = 180519;
-const KAREUSED = 180520;
-const KATOOSOON = 180521;
-const KALOCKED = 180522;
-
-
-
-struct ka_CBS {
- opaque Seq<>;
-};
-
-struct ka_BBS {
- int32_t MaxSeqLen;
- opaque Seq<>;
-};
-
-struct EncryptionKey {
- char key[8];
-};
-
-const MAXKANAMELEN = 64;
-#define MAXKANAMELEN 64
-const KA_LABELSIZE = 4;
-
-%#ifndef MAXKTCTICKETLEN
-const MAXKTCTICKETLEN = 344;
-%#endif
-
-typedef string kaname<MAXKANAMELEN>;
-
-struct kaident {
- char name[MAXKANAMELEN];
- char instance[MAXKANAMELEN];
-};
-
-struct kaentryinfo {
- int32_t minor_version;
- int32_t flags;
- uint32_t user_expiration;
- Date modification_time;
- kaident modification_user;
- Date change_password_time;
- long max_ticket_lifetime;
- long key_version;
- EncryptionKey key;
- uint32_t keyCheckSym;
- int32_t reserved2;
- int32_t reserved3;
- int32_t reserved4;
-};
-
-
-package KAA_
-
-Authenticate (IN kaname name,
- IN kaname instance,
- IN Date start_time,
- IN Date end_time,
- IN ka_CBS *request,
- INOUT ka_BBS *answer) = 21;
-
-ChangePassword (IN kaname name,
- IN kaname instance,
- IN ka_CBS arequest,
- INOUT ka_BBS *oanswer) = 2;
-
-package KAM_
-
-SetPassword (IN kaname name,
- IN kaname instance,
- IN int32_t kvno,
- IN EncryptionKey password) = 4;
-
-SetFields (IN kaname name,
- IN kaname instance,
- IN int32_t flags,
- IN Date user_expiration,
- IN int32_t max_ticket_lifetime,
- IN int32_t maxAssociates,
- IN int32_t spare1,
- IN int32_t spare2) = 5;
-
-CreateUser (IN kaname name,
- IN kaname instance,
- IN EncryptionKey password) = 6;
-
-GetEntry (IN kaname name,
- IN kaname instance,
- IN long major_version,
- OUT kaentryinfo *entry) = 8;
-
-
-package KAT_
-
-GetTicket_old (IN int32_t kvno,
- IN kaname auth_domain,
- IN struct ka_CBS *aticket,
- IN kaname name,
- IN kaname instance,
- IN struct ka_CBS *atimes,
- INOUT struct ka_BBS *oanswer) = 3;
-
-GetTicket (IN int32_t kvno,
- IN kaname auth_domain,
- IN struct ka_CBS *aticket,
- IN kaname name,
- IN kaname instance,
- IN struct ka_CBS *atimes,
- INOUT struct ka_BBS *oanswer) = 23;
-
diff --git a/usr.sbin/afs/src/rxdef/pts.xg b/usr.sbin/afs/src/rxdef/pts.xg
deleted file mode 100644
index 91123502b32..00000000000
--- a/usr.sbin/afs/src/rxdef/pts.xg
+++ /dev/null
@@ -1,302 +0,0 @@
-/* This is -*-c-*- */
-
-/*
- * Interface to PTS
- */
-
-package PR_
-
-%#include <fs_errors.h>
-
-error-function conv_to_arla_errno
-
-/*
- * Interface
- */
-
-
-/* Opcodes */
-
-const PRINEWUSER = 500;
-const PRWHEREISIT = 501;
-const PRDUMPENTRY = 502;
-const PRADDTOGROUP = 503;
-const PRNAMETOUID = 504;
-const PRIDTONAME = 505;
-const PRDELETE = 506;
-const PRREMOVEFROMGROUP = 507;
-const PRGETCPS = 508;
-const PRNEWENTRY = 509;
-const PRLISTMAX = 510;
-const PRSETMAX = 511;
-const PRLISTENTRY = 512;
-const PRCHANGEENTRY = 513;
-const PRLISTELEMENTS = 514;
-const PROSAMEMBEROF = 515;
-const PRSETFIELDSENTRY = 516;
-const PRLISTOWNED = 517;
-
-/* Constants */
-
-const PR_MAXNAMELEN = 64;
-const PR_MAXGROUPS = 5000;
-const PR_MAXLIST = 5000;
-const PRSIZE = 10;
-const COSIZE = 39;
-const PRSRV = 73;
-const ENTRYSIZE = 192;
-const HASHSIZE = 8191;
-
-const PRDBVERSION = 0;
-
-/* Bits for PR_SetFieldsEntry() */
-
-const PR_SF_NGROUPS = 0x80000000;
-const PR_SF_NUSERS = 0x40000000;
-const PR_SF_ALLBITS = 0xff;
-
-/* Reserved IDs */
-const PR_SYSADMINID = -204;
-const PR_ANYUSERID = -101;
-const PR_AUTHUSERID = -102;
-const PR_ANONYMOUSID = 32766;
-const PR_BADID = 0x80000000;
-
-/* Bits for struct prentry flags */
-const PRTYPE = 0x3f;
-const PRFREE = 1;
-const PRGRP = 2;
-const PRCONT = 4;
-const PRCELL = 8;
-const PRFOREIGN = 16;
-const PRINST = 32;
-const PRUSER = 0;
-
-const PRACCESS = 0x40;
-const PRQUOTA = 0x80;
-
-/* Privacy Bits */
-
-const PRP_REMOVE_MEM = 0x010000;
-const PRP_ADD_MEM = 0x020000;
-const PRP_ADD_ANY = 0x040000;
-const PRP_MEMBER_MEM = 0x080000;
-const PRP_MEMBER_ANY = 0x100000;
-const PRP_OWNED_ANY = 0x200000;
-const PRP_STATUS_MEM = 0x400000;
-const PRP_STATUS_ANY = 0x800000;
-
-/* Misc */
-const PRSUCCESS = 0;
-const PR_REMEMBER_TIMES = 1;
-
-
-struct prheader {
- long version;
- long headerSize;
- long freePtr;
- long eofPtr;
- long maxGroup;
- long maxID;
- long maxForeign;
- long maxInst;
- long orphan;
- long usercount;
- long groupcount;
- long foreigncount;
- long instcount;
- long reserved[5];
- long nameHash[HASHSIZE];
- long idHash[HASHSIZE];
-};
-
-struct prheader_disk {
- long version;
- long headerSize;
- long maxGroup;
- long maxID;
- long orphan<>;
- long usercount;
- long groupcount;
-};
-
-struct prentry {
- long flags;
- long id;
- long cellid;
- long next;
- long reserved[5];
- long entries[PRSIZE];
- long nextID;
- long nextName;
- long owner;
- long creator;
- long ngroups;
- long nusers;
- long count;
- long instance;
- long owned;
- long nextOwned;
- long parent;
- long sibling;
- long child;
- char name[PR_MAXNAMELEN];
-};
-
-struct prentry_disk {
- long flags;
- long id;
- long cellid;
- long owner;
- long creator;
- long ngroups;
- long owned<PR_MAXGROUPS>;
- string name<PR_MAXNAMELEN>;
- long entries<PR_MAXGROUPS>;
-};
-
-struct prdebugentry {
- long flags;
- long id;
- long cellid;
- long next;
- long reserved[5];
- long entries[PRSIZE];
- long nextID;
- long nextname;
- long owner;
- long creator;
- long ngroups;
- long nusers;
- long count;
- long instance;
- long owned;
- long nextOwned;
- long parent;
- long sibling;
- long child;
- char name[PR_MAXNAMELEN];
-};
-
-struct prcheckentry {
- long flags;
- long id;
- long owner;
- long creator;
- long ngroups;
- long nusers;
- long count;
- long reserved[5];
- char name[PR_MAXNAMELEN];
-};
-
-
-typedef char prname[PR_MAXNAMELEN];
-
-typedef prname namelist<PR_MAXLIST>;
-
-typedef long idlist<PR_MAXLIST>;
-
-typedef long prlist<PR_MAXGROUPS>;
-
-
-/* Error codes */
-
-const PREXIST = 267264 ;
-const PRIDEXIST = 267265 ;
-const PRNOIDS = 267266 ;
-const PRDBFAIL = 267267 ;
-const PRNOENT = 267268 ;
-const PRPERM = 267269 ;
-const PRNOTGROUP = 267270 ;
-const PRNOTUSER = 267271 ;
-const PRBADNAM = 267272 ;
-const PRBADARG = 267273 ;
-const PRNOMORE = 267274 ;
-const PRDBBAD = 267275 ;
-const PRGROUPEMPTY = 267276 ;
-const PRINCONSISTENT = 267277 ;
-const PRBADDR = 267278 ;
-const PRTOOMANY = 267279 ;
-
-
-NameToID(IN namelist *nlist,
- OUT idlist *ilist) = 504;
-
-IDToName(IN idlist *ilist,
- OUT namelist *nlist) = 505;
-
-NewEntry(IN string name<PR_MAXNAMELEN>,
- IN long flag,
- IN long oid,
- OUT long *id) = 509;
-
-INewEntry(IN string name<PR_MAXNAMELEN>,
- IN long id,
- IN long oid) = 500;
-
-ListEntry(IN long id,
- OUT struct prcheckentry *entry) = 512;
-
-DumpEntry(IN long pos,
- OUT struct prdebugentry *entry) = 502;
-
-ChangeEntry(IN long id,
- IN string name<PR_MAXNAMELEN>,
- IN long oid,
- IN long newid) = 513;
-
-SetFieldsEntry(IN long id,
- IN long mask,
- IN long flags,
- IN long ngroups,
- IN long nusers,
- IN long spare1,
- IN long spare2) = 516;
-
-/*
- * Group/entries that can't be deleted: SYSADMINID, ANYUSERID,
- * AUTHUSERID, ANONYMOUSID. Error returned is PRPERM.
- *
- * Rights: member of SYSADMINID, or owner to entry, or member of the
- * owner to `id'.
- *
- * Sucess: PRSUCCESS.
- */
-
-Delete(IN long id) = 506;
-
-WhereIsIt(IN long id,
- OUT long *ps) = 501;
-
-AddToGroup(IN long uid,
- IN long gid) = 503;
-
-RemoveFromGroup(IN long id,
- IN long gid) = 507;
-
-ListMax(OUT long *uid,
- OUT long *gid) = 510;
-
-SetMax(IN long uid,
- IN long gflag) = 511;
-
-ListElements(IN long id,
- OUT prlist *elist,
- OUT long *over) = 514;
-
-GetCPS(IN long id,
- OUT prlist *elist,
- OUT long *over) = 508;
-
-ListOwned(IN long id,
- OUT prlist *elist,
- INOUT long *over) = 517;
-
-IsAMemberOf(IN long uid,
- IN long gid,
- OUT long *flag) = 515;
-
-
-
-/* the end */
diff --git a/usr.sbin/afs/src/rxdef/rx_pkt.xg b/usr.sbin/afs/src/rxdef/rx_pkt.xg
deleted file mode 100644
index ce5743aa1f2..00000000000
--- a/usr.sbin/afs/src/rxdef/rx_pkt.xg
+++ /dev/null
@@ -1,77 +0,0 @@
-/* rx_pkt.xg,v 1.3 1994/12/27 03:37:04 assar Exp */
-
-/* header of a RPC packet */
-
-enum rx_header_type {
- HT_DATA = 1,
- HT_ACK = 2,
- HT_BUSY = 3,
- HT_ABORT = 4,
- HT_ACKALL = 5,
- HT_CHAL = 6,
- HT_RESP = 7,
- HT_DEBUG = 8
-};
-
-/* For flags in header */
-
-enum rx_header_flag {
- HF_CLIENT_INITIATED = 1,
- HF_REQ_ACK = 2,
- HF_LAST = 4,
- HF_MORE = 8
-};
-
-%#define MAXCALLS 4
-
-%#define CALL_MASK (MAXCALLS-1)
-%#define CONNID_MASK (~(MAXCALLS-1))
-
-const RX_HEADER_SIZE=28;
-
-struct rx_header {
- unsigned epoch;
- unsigned connid; /* And channel ID */
- unsigned callid;
- unsigned seqno;
- unsigned serialno;
- u_char type;
- u_char flags;
- u_char status;
- u_char secindex;
- u_short reserved; /* ??? verifier? */
- u_short serviceid;
-/* This should be the other way around according to everything but */
-/* tcpdump */
-};
-
-enum rx_ack_reason {
- RX_ACK_REQUESTED = 1,
- RX_ACK_DUPLICATE = 2,
- RX_ACK_OUT_OF_SEQUENCE = 3,
- RX_ACK_EXEEDS_WINDOW = 4,
- RX_ACK_NOSPACE = 5,
- RX_ACK_PING = 6,
- RX_ACK_PING_RESPONSE = 7,
- RX_ACK_DELAY = 8
-};
-
-enum rx_ack_type {
- RX_ACK_TYPE_NACK = 0,
- RX_ACK_TYPE_ACK = 1
-};
-
-const RXMAXACKS=255;
-
-struct rx_ack_header {
- u_short bufferspace; /* # of packet buffers available */
- u_short maxskew;
- u_long firstpacket; /* First packet in acks below */
- u_long prevpacket;
- u_long serial; /* Packet that prompted this one */
- u_char reason; /* rx_ack_reason */
-/* u_char nacks;*/ /* # of acks */
- u_char acks<u_char>;
-/* u_char acks[RXMAXACKS];*/ /* acks (rx_ack_type) */
-};
-
diff --git a/usr.sbin/afs/src/rxdef/ubik.xg b/usr.sbin/afs/src/rxdef/ubik.xg
deleted file mode 100644
index 821a9aad051..00000000000
--- a/usr.sbin/afs/src/rxdef/ubik.xg
+++ /dev/null
@@ -1,126 +0,0 @@
-/* -*- C -*- */
-
-/*
- * $arla: ubik.xg,v 1.10 2002/09/07 21:02:38 mattiasa Exp $
- */
-
-package Ubik_
-
-%#include <fs_errors.h>
-
-error-function conv_to_arla_errno
-
-/*
- * Interface
- */
-
-struct net_tid {
- long epoch;
- long counter;
-};
-
-const UBIK_MAX_INTERFACE_ADDR = 256; /* max interfaces per server */
-
-typedef net_tid net_version;
-
-struct ubik_debug {
- long now;
- long lastYesTime;
- long lastYesHost;
- long lastYesState;
- long lastYesClaim;
- long lowestHost;
- long lowestTime;
- long syncHost;
- long syncTime;
- net_version syncVersion;
- net_tid syncTid;
- long amSyncSite;
- long syncSiteUntil;
- long nServers;
- long lockedPages;
- long writeLockedPages;
- net_version localVersion;
- long activeWrite;
- long tidCounter;
- long anyReadLocks;
- long anyWriteLocks;
- long recoveryState;
- long currentTrans;
- long writeTrans;
- long epochTime;
-};
-
-struct ubik_sdebug {
- long addr;
- long lastVoteTime;
- long lastBeaconSent;
- long lastVote;
- net_version remoteVersion;
- long currentDB;
- long beaconSinceDown;
- long up;
- afs_int32 altAddr[255]; /*alternate addresses:host byte */
- /*this is actually UBIK_MAX_INTERFACE_ADDR-1*/
-};
-
-
-
-/* Opcodes */
-
-const VOTE_BEACON = 10000;
-const VOTE_DEBUG = 10001;
-const VOTE_SDEBUG = 10002;
-const VOTE_GETSYNCSITE = 10003;
-
-/* Error codes */
-
-const UNOQUORUM = 5376;
-const UNOTSYNC = 5377;
-const UNHOSTS = 5378;
-const UIOERROR = 5379;
-const UINTERNAL = 5380;
-const USYNC = 5381;
-const UNOENT = 5382;
-const UBADLOCK = 5383;
-const UBADLOG = 5384;
-const UBADHOST = 5385;
-const UBADTYPE = 5386;
-const UTWOENDS = 5387;
-const UDONE = 5388;
-const UNOSERVERS = 5389;
-const UEOF = 5390;
-const ULOGIO = 5391;
-const UBADFAM = 5392;
-const UBADCELL = 5393;
-const UBADSECGRP = 5394;
-const UBADGROUP = 5395;
-const UBADUUID = 5396;
-const UNOMEM = 5397;
-const UNOTMEMBER = 5398;
-const UNBINDINGS = 5399;
-const UBADPRINNAME = 5400;
-const UPIPE = 5401;
-const UDEADLOCK = 5402;
-const UEXCEPTION = 5403;
-const UTPQFAIL = 5404;
-const USKEWED = 5405;
-const UNOLOCK = 5406;
-const UNOACCESS = 5407;
-const UNOSPC = 5408;
-const UBADPATH = 5409;
-const UBADF = 5410;
-const UREINITIALIZE = 5411;
-
-/* The rpc calls */
-
-Beacon (IN long state,
- IN long voteStart,
- IN net_version *Version,
- IN net_tid *tid) multi = VOTE_BEACON;
-
-Debug (OUT ubik_debug *db) = VOTE_DEBUG;
-
-SDebug (IN long which, OUT ubik_sdebug *db) = VOTE_SDEBUG;
-
-GetSyncSite (OUT long *site) = VOTE_GETSYNCSITE;
diff --git a/usr.sbin/afs/src/rxdef/vldb.xg b/usr.sbin/afs/src/rxdef/vldb.xg
deleted file mode 100644
index d114d5de8d5..00000000000
--- a/usr.sbin/afs/src/rxdef/vldb.xg
+++ /dev/null
@@ -1,545 +0,0 @@
-/* This is -*-c-*- */
-
-/*
- * Interface to VLDB
- */
-
-package VL_
-
-%#include <fs_errors.h>
-%#include <fs.h>
-
-error-function conv_to_arla_errno
-
-#include "common.h"
-
-/*
- * Structures and defines for vldb data
- */
-
-const VLDB_MAXNAMELEN = 65;
-const MAXNSERVERS = 8;
-const NMAXNSERVERS = 13;
-const MAX_NUMBER_OPCODES = 30;
-const MAXTYPES = 3;
-const MAXSERVERID = 30;
-const HASHSIZE = 8191;
-const DEFAULTBULK = 10000;
-
-typedef opaque bulk<DEFAULTBULK>;
-
-#if 0
-typedef struct single_vldbentry *vldblist;
-#endif
-
-/*
- * Used in vlentry.server[i].flags
- * ie for each site/server
- */
-
-const VLSF_NEWREPSITE = 0x01; /* ??? */
-const VLSF_ROVOL = 0x02; /* Readonly volume on this site */
-const VLSF_RWVOL = 0x04; /* Readwrite volume on this site */
-const VLSF_BACKVOL = 0x08; /* Backup volume on this site */
-const VLSF_UUID = 0x10; /* Internal flag in Transarc client */
-const VLSF_DONTUSE = 0x20; /* Not yet released volumes */
-
-/*
- * Used in vlentry.flags
- * ie used for whole entry
- */
-
-/* Internal information in the vldb */
-const VLFREE = 0x1;
-const VLDELETED = 0x2;
-const VLLOCKED = 0x4;
-
-/* Volser information/status */
-const VLOP_MOVE = 0x10;
-const VLOP_RELEASE = 0x20;
-const VLOP_BACKUP = 0x40;
-const VLOP_DELETE = 0x80;
-const VLOP_DUMP = 0x100;
-
-%#define VLOP_ALLOPERS ( VLOP_MOVE | VLOP_RELEASE | VLOP_BACKUP | VLOP_DELETE | VLOP_DUMP)
-
-/* Location information */
-const VLF_RWEXISTS = 0x1000;
-const VLF_ROEXISTS = 0x2000;
-const VLF_BOEXISTS = 0x4000;
-const VLF_BACKEXISTS = 0x4000;
-const VLF_DFSFILESET = 0x8000;
-
-/* VL error interface */
-const VL_IDEXIST = 363520;
-const VL_IO = 363521;
-const VL_NAMEEXIST = 363522;
-const VL_CREATEFAIL = 363523;
-const VL_NOENT = 363524;
-const VL_EMPTY = 363525;
-const VL_ENTDELETED = 363526;
-const VL_BADNAME = 363527;
-const VL_BADINDEX = 363528;
-const VL_BADVOLTYPE = 363529;
-const VL_BADPARTITION = 363530;
-const VL_BADSERVER = 363531;
-const VL_REPSFULL = 363532;
-const VL_NOREPSERVER = 363533;
-const VL_DUPREPSERVER = 363534;
-const VL_RWNOTFOUND = 363535;
-const VL_BADREFCOUNT = 363536;
-const VL_SIZEEXCEEDED = 363537;
-const VL_BADENTRY = 363538;
-const VL_BADVOLIDBUMP = 363539;
-const VL_IDALREADHASED = 363540;
-const VL_ENTRYLOCKED = 363541;
-const VL_BADVOLOPER = 363542;
-const VL_BADRELLOCKTYPE= 363543;
-const VL_RERELEASE = 363544;
-const VL_BADSERVERFLAG = 363545;
-const VL_PERM = 363546;
-const VL_NOMEM = 363547;
-const VL_BADVERSION = 363548;
-const VL_INDEXERANGE = 363549;
-const VL_MULTIPADDR = 363550;
-const VL_BADMASK = 363551;
-
-
-/*
- * Opcodes
- */
-
-const VLCREATEENTRY = 501;
-const VLDELETEENTRY = 502;
-const VLGETENTRYBYID = 503;
-const VLGETENTRYBYNAME = 504;
-const VLGETNEWVOLUMEID = 505;
-const VLREPLACEENTRY = 506;
-const VLUPDATEENTRY = 507;
-const VLSETLOCK = 508;
-const VLRELEASELOCK = 509;
-const VLLISTENTRY = 510;
-const VLLISTATTRIBUTES = 511;
-const VLLINKEDLIST = 512;
-const VLGETSTATS = 513;
-const VLPROBE = 514;
-const VLGETADDRS = 515;
-const VLCHANGEADDR = 516;
-const VLCREATEENTRYN = 517;
-const VLGETENTRYBYIDN = 518;
-const VLGETENTRYBYNAMEN = 519;
-const VLREPLACEENTRYN = 520;
-const VLLISTENTRYN = 521;
-const VLLISTATTRIBUTESN = 522;
-const VLLINKEDLISTN = 523;
-const VLUPDATEENTRYBYNAME = 524;
-const VLCREATEENTRYU = 525;
-const VLGETENTRYBYIDU = 526;
-const VLGETENTRYBYNAMEU = 527;
-const VLREPLACEENTRYU = 528;
-const VLLISTENTRYU = 529;
-const VLLISTATTRIBUTESU = 530;
-const VLLINKEDLISTU = 531;
-const VLREGADDR = 532;
-const VLGETADDRSU = 533;
-const VLLISTATTRIBUTESN2 = 534;
-
-/*
- * ReleaseType argument for VL_ReleaseLock
- */
-const LOCKREL_TIMESTAMP = 1;
-const LOCKREL_OPCODE = 2;
-const LOCKREL_AFSID = 4;
-
-struct vldbentry {
- char name[VLDB_MAXNAMELEN];
- long volumeType; /* currrent unused */
- long nServers;
- long serverNumber[MAXNSERVERS];
- long serverPartition[MAXNSERVERS];
- long serverFlags[MAXNSERVERS];
- u_long volumeId[MAXTYPES];
- long cloneId;
- long flags;
-};
-
-struct nvldbentry {
- char name[VLDB_MAXNAMELEN];
- long nServers;
- long serverNumber[NMAXNSERVERS];
- long serverPartition[NMAXNSERVERS];
- long serverFlags[NMAXNSERVERS];
- u_long volumeId[MAXTYPES];
- long cloneId;
- long flags;
- long matchindex;
- long spares2;
- long spares3;
- long spares4;
- long spares5;
- long spares6;
- long spares7;
- long spares8;
- long spares9;
-};
-
-struct vlentry {
- u_long volumeId[MAXTYPES];
- long flags;
- long LockAfsId;
- long LockTimestamp;
- long cloneId;
- long AssociatedChain;
- long nextIdHash[MAXTYPES];
- long nextNameHash;
- long spares1[2];
- char name[VLDB_MAXNAMELEN];
- u_char volumeType;
- u_char serverNumber[MAXNSERVERS];
- u_char serverPartition[MAXNSERVERS];
- u_char serverFlags[MAXNSERVERS];
- u_char RefCount;
- char spares2[1];
-};
-
-/* disk_vlentry is arla specific */
-
-struct disk_vlentry {
- u_long volumeId[MAXTYPES];
- long flags;
- long cloneId;
- string name<>;
- long serverNumber<>;
- long serverPartition<>;
- long serverFlags<>;
-};
-
-struct vital_vlheader {
- long vldbversion;
- long headersize;
- long freePtr;
- long eofPtr;
- long allocs;
- long frees;
- long MaxVolumeId;
- long totalEntries[MAXTYPES];
-};
-
-typedef long longarray[MAXTYPES];
-
-struct vlheader {
- struct vital_vlheader vital_header;
- u_long IpMappedAddr[MAXSERVERID];
- long VolnameHash[HASHSIZE];
-/* long VolidHashRW[HASHSIZE];
- long VolidHashRO[HASHSIZE];
- long VolidHashBACK[HASHSIZE];*/
- longarray VolidHash[HASHSIZE];
-};
-
-
-const VLUPDATE_VOLUMENAME = 0x1;
-const VLUPDATE_FLAGS = 0x4;
-const VLUPDATE_READONLYID = 0x8;
-const VLUPDATE_BACKUPID = 0x10;
-const VLUPDATE_REPSITES = 0x20;
-const VLUPDATE_CLONEID = 0x80;
-const VLUPDATE_VOLNAMEHASH = 0x100;
-const VLUPDATE_RWID = 0x200;
-
-const VLUPDATE_REPS_DELETE = 0x100;
-const VLUPDATE_REPS_ADD = 0x200;
-const VLUPDATE_REPS_MODSERV = 0x400;
-const VLUPDATE_REPS_MODPART = 0x800;
-const VLUPDATE_REPS_MODFLAG = 0x1000;
-
-struct VldbUpdateEntry {
- u_long Mask;
- char name[VLDB_MAXNAMELEN];
- long volumeType;
- long flags;
- u_long ReadOnlyId;
- u_long BackupId;
- long cloneid;
- long nModifiedRepsites;
- u_long RepsitesMask[MAXNSERVERS];
- long RepsitesTargetServer[MAXNSERVERS];
- long RepsitesTargetPart[MAXNSERVERS];
- long RepsitesNewServer[MAXNSERVERS];
- long RepsitesNewPart[MAXNSERVERS];
- long RepsitesNewFlags[MAXNSERVERS];
-};
-
-/* bit mask for VldbListByAttributes.Mask */
-const VLLIST_SERVER = 0x1;
-const VLLIST_PARTITION = 0x2;
-/* 0x4 was VLLIST_VOLUMETYPE but now it seems to be depricated */
-const VLLIST_VOLUMEID = 0x8;
-const VLLIST_FLAG = 0x10;
-
-struct VldbListByAttributes {
- u_long Mask;
- long server;
- long partition;
- long volumetype; /* depricated */
- long volumeid;
- long flag;
-};
-
-struct uvldbentry {
- char name[VLDB_MAXNAMELEN];
- long nServers;
- afsUUID serverNumber[NMAXNSERVERS];
- long serverUnique[NMAXNSERVERS];
- long serverPartition[NMAXNSERVERS];
- long serverFlags[NMAXNSERVERS];
- u_long volumeId[MAXTYPES];
- long cloneId;
- long flags;
- long spares1;
- long spares2;
- long spares3;
- long spares4;
- long spares5;
- long spares6;
- long spares7;
- long spares8;
- long spares9;
-};
-
-
-#if 0
-struct single_vldbentry {
- vldbentry VldbEntry;
- vldblist next_vldb;
-};
-
-struct vldb_list {
- vldblist node;
-};
-#endif
-
-struct vldstats {
- unsigned long start_time;
- long requests[MAX_NUMBER_OPCODES];
- long aborts[MAX_NUMBER_OPCODES];
- long reserved[5];
-};
-
-const VL_MAX_BULK_ADDRS = 1024 ;
-
-typedef vldbentry bulkentries<>;
-typedef nvldbentry nbulkentries<>;
-typedef uvldbentry ubulkentries<>;
-typedef int32_t bulkaddrs<VL_MAX_BULK_ADDRS>;
-
-
-/*
- * Bits for ListAddrByAttributes.Mask
- * Note, IPADDR/INDEX/UUID are mutually exclusive
- */
-
-const VLADDR_IPADDR = 0x1;
-const VLADDR_INDEX = 0x2;
-const VLADDR_UUID = 0x4;
-
-struct ListAddrByAttributes {
- int32_t Mask;
- uint32_t ipaddr;
- int32_t index;
- int32_t spare;
- afsUUID uuid;
-};
-
-struct VL_Callback {
- uint32_t version;
- uint32_t expiration_time;
- uint32_t time;
- uint32_t handle;
-};
-
-/*
- * Interface
- */
-
-CreateEntry (IN vldbentry *newentry) = VLCREATEENTRY;
-
-DeleteEntry (IN long Volid,
- IN long voltype) = VLDELETEENTRY;
-
-GetEntryByID (IN long Volid,
- IN long voltype,
- OUT vldbentry *entry) = VLGETENTRYBYID;
-
-GetEntryByName (IN string volumename<VLDB_MAXNAMELEN>,
- OUT vldbentry *entry) = VLGETENTRYBYNAME;
-
-GetNewVolumeId (IN long bumpcount,
- OUT long *newvolumid) = VLGETNEWVOLUMEID;
-
-ReplaceEntry (IN long Volid,
- IN long voltype,
- IN vldbentry *newentry,
- IN long ReleaseType) = VLREPLACEENTRY;
-
-UpdateEntry (IN long Volid,
- IN long voltype,
- IN VldbUpdateEntry *UpdateEntry,
- IN long ReleaseType) = VLUPDATEENTRY;
-
-SetLock (IN long Volid,
- IN long voltype,
- IN long voloper) = VLSETLOCK;
-
-ReleaseLock (IN long volid,
- IN long voltype,
- IN long ReleaseType) = VLRELEASELOCK;
-
-ListEntry (IN long previous_index,
- OUT long *count,
- OUT long *next_index,
- OUT vldbentry *entry) = VLLISTENTRY;
-
-ListAttributes (IN VldbListByAttributes *attributes,
- OUT long *nentries,
- OUT bulkentries *blkentries) = VLLISTATTRIBUTES;
-
-#if 0
-LinkedList (IN VldbListByAttributes *attributes,
- OUT long *nentries,
- OUT vldb_list *linkedentries) = 512;
-#endif
-
-GetStats (OUT vldstats *stats,
- OUT vital_vlheader *vital_header) = VLGETSTATS;
-
-Probe () = VLPROBE;
-
-GetAddrs(IN int32_t handle,
- IN int32_t spare,
- OUT VL_Callback *spare3,
- OUT int32_t *nentries,
- OUT bulkaddrs *blkaddr) = VLGETADDRS;
-
-ChangeAddrs(IN int32_t old_ip,
- IN int32_t new_ip) = VLCHANGEADDR; /* obsolete */
-
-CreateEntryN(IN nvldbentry *newentry) = VLCREATEENTRYN;
-
-GetEntryByIDN (IN long Volid,
- IN long voltype,
- OUT nvldbentry *entry) = VLGETENTRYBYIDN;
-
-GetEntryByNameN (IN string volumename<VLDB_MAXNAMELEN>,
- OUT nvldbentry *entry) = VLGETENTRYBYNAMEN;
-
-ReplaceEntryN (IN long Volid,
- IN long voltype,
- IN nvldbentry *newentry,
- IN long ReleaseType) = VLREPLACEENTRYN;
-
-ListEntryN(IN afs_int32 previous_index,
- OUT afs_int32 *count,
- OUT afs_int32 *next_index,
- OUT nvldbentry *entry) = VLLISTENTRYN;
-
-ListAttributesN (IN VldbListByAttributes *attributes,
- OUT long *nentries,
- OUT nbulkentries *blkentries) = VLLISTATTRIBUTESN;
-
-#if 0
-LinkedListN() = 523;
-#endif
-
-UpdateEntryByName (IN string volname<VLDB_MAXNAMELEN>,
- IN VldbUpdateEntry *UpdateEntry,
- IN long ReleaseType) = VLUPDATEENTRYBYNAME;
-
-#ifdef not_implemented_yet
-CreateEntryU(IN uvldbentry *newentry) = VLCREATEENTRYU;
-
-GetEntryByIDU() = VLGETENTRYBYIDU;
-
-GetEntryByNameU (IN string volumename<VLDB_MAXNAMELEN>,
- OUT struct uvldbentry *entry) = VLGETENTRYBYNAMEU;
-
-ReplaceEntryU() = VLREPLACEENTRYU;
-
-ListEntryU() = VLLISTENTRYU;
-
-ListAttributesU (IN VldbListByAttributes *attributes,
- OUT long *nentries,
- OUT ubulkentries *blkentries) = VLLISTATTRIBUTESU;
-
-LinkedListU() = VLLINKEDLISTU;
-#endif
-
-GetAddrsU(IN ListAddrByAttributes *inaddr,
- OUT afsUUID *uuidp1,
- OUT afs_int32 *uniquifier,
- OUT afs_int32 *nentries,
- OUT bulkaddrs *blkaddrs) = VLGETADDRSU;
-
-
-RegisterAddrs(IN afsUUID *uid,
- IN int32_t spare,
- IN bulkaddrs *addrs) = VLREGADDR;
-
-
-ListAttributesN2(IN VldbListByAttributes *attributes,
- IN string volumename<VLDB_MAXNAMELEN>,
- IN afs_int32 startindex,
- OUT afs_int32 *nentries,
- OUT nbulkentries *blkentries,
- OUT afs_int32 *nextstartindex) = VLLISTATTRIBUTESN2;
-
-#if 0
-
-/*
- *
- */
-
-const VL_LISTATTRUUID_MAXATTR = 64;
-const VL_LISTATTRUUID_MAXATTRSIZE = 512;
-
-struct VL_ListAddrUUID {
- afs_int32 type;
- afs_int32 error;
- opaque data<VL_LISTATTRUUID_MAXATTRSIZE>;
-};
-
-typedef VL_ListAddrUUID VL_ListAddrUUIDs<>;
-
-const VL_UUID_data_INVALID = 1;
-
-const VL_UUID_data_IPV6 = 1;
-struct VL_UUID_data {
- opaque ipv6_addr<128>;
- int ipv6_mtu;
-};
-
-const VL_UUID_data_GSSAPI_name = 2;
-struct VL_UUID_data_gss_name {
- opaque gss_name<>;
-};
-
-/*
- * `uuid' is the uuid we query information the diffrent types are in
- * `query'.
- *
- * For each `query'-item there can be one or more items in `reply'.
- * The reply items have `reply<>.type' set to the same type as in the
- * query. The are always sorted in the same order as the `query'.
- *
- * If the `query' type isn't supported a `reply<>' is sent back with
- * `reply<>.error' set.
- *
- * The `reply<>.data' is filled with `reply<>.type' specific data.
- * XXX should we use union, I don't think so.
- */
-
-ListAttrUUID(IN afsUUID *uuid,
- IN afs_int32 query<VL_LISTATTRUUID_MAXATTR>,
- OUT VL_ListAddrUUIDs *reply) = 10001;
-
-#endif
diff --git a/usr.sbin/afs/src/rxdef/volumeserver.xg b/usr.sbin/afs/src/rxdef/volumeserver.xg
deleted file mode 100644
index 2f9580e867c..00000000000
--- a/usr.sbin/afs/src/rxdef/volumeserver.xg
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * Interface to Volumeserver,
- * reference /afs/nada.kth.se/misc/reference/programming/afs/shadow/
- *
- * $arla: volumeserver.xg,v 1.25 2002/08/05 16:46:14 lha Exp $
- */
-
-package VOLSER_
-
-%#include <fs_errors.h>
-
-error-function conv_to_arla_errno
-
-const VLDB_MAXSERVER = 80;
-const VOLSERVICE_PORT = 7005;
-const VOLSERVICE_ID = 4;
-const INVALID_BID = 0;
-const VOLSER_MAXVOLNAME = 65;
-const VOLSER_OLDMAXVOLNAME = 32;
-const VOLSER_MAX_REPSITES = 7;
-const VNAMESIZE = 32;
-
-const VOLCREATEVOLUME = 100;
-const VOLDELETEVOLUME = 101;
-const VOLRESTORE = 102;
-const VOLFORWARD = 103;
-const VOLENDTRANS = 104;
-const VOLCLONE = 105;
-const VOLSETFLAGS = 106;
-const VOLGETFLAGS = 107;
-const VOLTRANSCREATE = 108;
-const VOLDUMP = 109;
-const VOLGETNTHVOLUME = 110;
-const VOLSETFORWARDING = 111;
-const VOLGETNAME = 112;
-const VOLGETSTATUS = 113;
-const VOLSIGNALRESTORE = 114;
-const VOLLISTPARTITIONS = 115;
-const VOLLISTVOLUMES = 116;
-const VOLSETIDTYPES = 117;
-const VOLMONITOR = 118;
-const VOLPARTITIONINFO = 119;
-const VOLRECLONE = 120;
-const VOLLISTONEVOLUME = 121;
-const VOLNUKEVOLUME = 122;
-const VOLSETDATE = 123;
-const VOLXLISTVOLUMES = 124;
-const VOLXLISTONEVOL = 125;
-const VOLSETINFO = 126;
-const VOLXLISTPARTITIONS= 127;
-const VOLFORWARDMULTIPLE= 128;
-
-const PARTVALID = 0x01;
-const VOK = 0x02;
-const VBUSY = 110;
-
-const VOLSERTRELE_ERROR = 1492325120;
-const VOLSERNO_OP = 1492325121;
-const VOLSERREAD_DUMPERROR = 1492325122;
-const VOLSERDUMPERROR = 1492325123;
-const VOLSERATTACH_ERROR = 1492325124;
-const VOLSERILLEGAL_PARTITION = 1492325125;
-const VOLSERDETACH_ERROR = 1492325126;
-const VOLSERBAD_ACCESS = 1492325127;
-const VOLSERVLDB_ERROR = 1492325128;
-const VOLSERBADNAME = 1492325129;
-const VOLSERVOLMOVED = 1492325130;
-const VOLSERBADOP = 1492325131;
-const VOLSERBADRELEASE = 1492325132;
-const VOLSERVOLBUSY = 1492325133;
-const VOLSERNO_MEMORY = 1492325134;
-const VOLSERNOVOL = 1492325135;
-const VOLSERMULTIRWVOL = 1492325136;
-const VOLSERFAILEDOP = 1492325137;
-
-const ITOffline = 0x1;
-const ITBusy = 0x2;
-const ITReadOnly = 0x8;
-const ITCreate = 0x10;
-const ITCreateVolID = 0x1000;
-
-const VTDeleteOnSalvage = 1;
-const VTOutOfService = 2;
-const VTDeleted = 4;
-
-#if 0
-struct volser_trans {
- volser_trans *next;
- long tid;
- long time;
- long creationTime;
- long returnCode;
- long volid;
- long partition;
- long dumpTransId;
- long dumpSeq; /* Not used */
- short refCount;
- short iflags;
- char vflags;
- char tflags;
- char incremental;
- char lastProcName[30];
-/* struct rx_call *rxCallPtr; XXXXXXX BROKEN /lha */
-};
-#endif
-struct volDescription {
- char volName[VOLSER_MAXVOLNAME];
- long volId;
- long volSize;
- long volFlags;
- long volCloneId;
-};
-
-struct partList {
- int partId[26];
- long partFlags[26];
-};
-
-struct volser_status {
- long volID;
- long nextUnique;
- long type;
- long parentID;
- long cloneID;
- long backupID;
- long restoredFromID;
- long maxQuota;
- long minQuota;
- long owner;
- long creationDate;
- long accessDate;
- long updateDate;
- long exprirationDate;
- long backupDate;
- long copyDate;
-};
-
-struct destServer {
- long destHost;
- long destPort;
- long destSSID; /* currently always set to 1 */
-};
-
-struct volintInfo {
- char name[VNAMESIZE];
- long volid;
- long type;
- long backupID;
- long parentID;
- long cloneID;
- long status;
- long copyDate;
- char inUse;
- char needsSalvaged;
- char destroyMe;
- long creationDate;
- long accessDate;
- long updateDate;
- long backupDate;
- long dayUse;
- long filecount;
- long maxquota;
- long size;
- long flags;
- long spare0;
- long spare1;
- long spare2;
- long spare3;
-};
-
-struct xvolintInfo {
- char name[VNAMESIZE];
- long volid;
- long type;
- long backupID;
- long parentID;
- long cloneID;
- long status;
- long copyDate;
- char inUse;
- long creationDate;
- long accessDate;
- long updateDate;
- long backupDate;
- long dayUse;
- long filecount;
- long maxquota;
- long size;
- int32_t stat_reads[4];
- int32_t stat_writes[4];
- int32_t stat_fileSameAuthor[6];
- int32_t stat_fileDiffAuthor[6];
- int32_t stat_dirSameAuthor[6];
- int32_t stat_dirDiffAuthor[6];
-};
-
-/*
- * same site total, same site authenticated
- * diff site total, diff site authenticated
- */
-
-/*
- * 0-60 s
- * 1-10 min
- * 10-60 min
- * 1-24 hour
- * 1-7 days
- * >7 days
- */
-
-struct transDebugInfo {
- long tid;
- long time;
- long creationTime;
- long returnCode;
- long volid;
- long partition;
- short iflags;
- char vflags;
- char tflags;
- char lastProcName[30];
- long callValid;
- long readNext;
- long transmitNext;
- long lastSendTime;
- long lastReceiveTime;
-};
-
-struct pIDs {
- long partIds[26]; /* -1 if none */
-};
-
-struct diskPartition {
- char name[32];
- char devName[32];
- long lock_fd;
- long totalUsable;
- long free;
- long minFree;
-};
-
-struct restoreCookie {
- char name[32];
- long type;
- long clone;
- long parent;
-};
-
-typedef transDebugInfo transDebugEntries<>;
-typedef volintInfo volEntries<>;
-typedef xvolintInfo xvolEntries<>;
-typedef int32_t part_entries<>;
-typedef int32_t multi_results<>;
-
-struct replica {
- int32_t trans_id;
- struct destServer destserver;
-};
-
-#define AFS_MAX_DESTINATIONS 255
-
-typedef replica manyDests<AFS_MAX_DESTINATIONS>;
-
-AFSVolCreateVolume(IN long partition,
- IN string name,
- IN long type,
- IN long parent,
- INOUT long *volid,
- OUT long *trans) = VOLCREATEVOLUME;
-
-AFSVolDeleteVolume(IN long trans) = VOLDELETEVOLUME;
-
-AFSVolNukeVolume(IN long partID,
- IN long volID) = VOLNUKEVOLUME;
-
-AFSVolDump(IN long fromTrans,
- IN long fromDate) split = VOLDUMP;
-
-AFSVolSignalRestore(IN string name<>,
- IN int type,
- IN long pid,
- IN long cloneid) = VOLSIGNALRESTORE;
-
-AFSVolRestore(IN long toTrans,
- IN long flags,
- IN restoreCookie *cookie) split = VOLRESTORE;
-
-AFSVolForward(IN int32_t fromTrans,
- IN int32_t fromData,
- IN struct destServer *destination,
- IN long destTrans,
- IN struct restoreCookie *cookie) = VOLFORWARD;
-
-AFSVolClone(IN long trans,
- IN long purgeVol,
- IN long newType,
- IN string newName,
- INOUT long *newVol) = VOLCLONE;
-
-AFSVolReClone(IN long tid,
- IN long cloneID) = VOLRECLONE;
-
-AFSVolSetForwarding(IN long tid,
- IN long newsite) = VOLSETFORWARDING;
-
-AFSVolTransCreate(IN long volume,
- IN long partition,
- IN long flags,
- OUT long *trans) = VOLTRANSCREATE;
-
-AFSVolEndTrans(IN long trans,
- OUT long *rcode) = VOLENDTRANS;
-
-AFSVolGetFlags(IN long trans,
- OUT long *flags) = VOLGETFLAGS;
-
-AFSVolSetFlags(IN long trans,
- IN long flags) = VOLSETFLAGS;
-
-AFSVolGetName(IN long tid,
- OUT string tname<256>) = VOLGETNAME;
-
-AFSVolGetStatus(IN long tid,
- OUT volser_status *status) = VOLGETSTATUS;
-
-AFSVolSetIdsTypes(IN long tId,
- IN string name<>,
- IN long type,
- IN long pId,
- IN long cloneId,
- IN long backupId) = VOLSETIDTYPES;
-
-AFSVolSetDate(IN long tid,
- IN long newDate) = VOLSETDATE;
-
-AFSVolListPartitions(OUT struct pIDs *partIDs) = VOLLISTPARTITIONS;
-
-AFSVolPartitionInfo(IN string name<>,
- OUT struct diskPartition *partition) = VOLPARTITIONINFO;
-
-AFSVolListVolumes(IN long partID,
- IN long flags,
- OUT struct volEntries *resultEntries) = VOLLISTVOLUMES;
-
-AFSVolListOneVolume(IN long partID,
- IN long volid,
- OUT struct volEntries *resultEntries) = VOLLISTONEVOLUME;
-
-AFSVolGetNthVolume(IN long index,
- OUT long *volume,
- OUT long *partition) = VOLGETNTHVOLUME;
-
-AFSVolMonitor(OUT transDebugEntries *result) = VOLMONITOR;
-
-AFSVolXListVolumes(IN long partID,
- IN long flags,
- OUT struct xvolEntries *resultEntries) = VOLXLISTVOLUMES;
-
-AFSVolXListOneVolume(IN long partID,
- IN long volid,
- OUT struct xvolEntries *resultEntries) = VOLXLISTONEVOL;
-
-AFSVolSetInfo(IN long transid,
- IN volintInfo *volinfo) = VOLSETINFO;
-
-AFSVolXListPartitions(OUT part_entries *ent) = VOLXLISTPARTITIONS;
-
-AFSVolForwardMultiple(IN int32_t fromTrans,
- IN int32_t fromData,
- IN manyDests *destinations,
- IN long spare0,
- IN struct restoreCookie *cookie,
- OUT multi_results *results) = VOLFORWARDMULTIPLE;
diff --git a/usr.sbin/afs/src/rxkad/Makefile.in b/usr.sbin/afs/src/rxkad/Makefile.in
deleted file mode 100644
index e4ea4bccd40..00000000000
--- a/usr.sbin/afs/src/rxkad/Makefile.in
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-# $KTH: Makefile.in,v 1.18 2000/10/08 06:24:12 lha Exp $
-#
-
-# This should really be set from configure
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-top_builddir = ..
-VPATH = @srcdir@
-
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-DEFS = @DEFS@
-CFLAGS = @CFLAGS@ -O
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-includedir = @includedir@
-libdir = @libdir@
-
-PICFLAGS = # @PICFLAGS@
-
-LIBPREFIX = lib
-#@LIBPREFIX@
-LIBNAME = $(LIBPREFIX)rxkad
-#LIBEXT = @LIBEXT@ Always build archive library!
-LIBEXT = a
-SHLIBEXT = @SHLIBEXT@
-LDSHARED = @LDSHARED@
-LIB = $(LIBNAME).$(LIBEXT)
-
-SOURCES = rxk_locl.c rxk_clnt.c rxk_serv.c rxk_crpt.c rxk_info.c osi_alloc.c compat.c
-
-OBJECTS = rxk_locl.o rxk_clnt.o rxk_serv.o rxk_crpt.o rxk_info.o osi_alloc.o compat.o
-
-all: $(LIB)
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(includedir)/rx
- $(INSTALL_DATA) $(srcdir)/rxkad.h $(DESTDIR)$(includedir)/rx/rxkad.h
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
- $(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/$(LIB)
-
-uninstall:
- rm -f $(DESTDIR)$(includedir)/rx/rxkad.h
- rm -f $(DESTDIR)$(libdir)/$(LIB)
-
-Wall:
- make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
-
-.c.o:
- $(CC) -c $(DEFS) -I../include -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/.. $(CPPFLAGS) $(CFLAGS) $(PICFLAGS) @KRB4_INC_FLAGS@ $<
-
-fc_test: rxk_crpt.c
- $(CC) -DTEST -o $@ $(DEFS) -I../include -I$(srcdir)/.. -I$(srcdir)/../lwp -I$(srcdir)/../include $(CPPFLAGS) $(CFLAGS) $(PICFLAGS) @KRB4_INC_FLAGS@ $(VPATH)/rxk_crpt.c
-
-
-check:
-
-clean:
- rm -f $(LIB) *.o *.a fc_test
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *.tab.c *~
-
-realclean: distclean
- rm -f TAGS
-
-dist: $(DISTFILES)
- for file in $(DISTFILES); do \
- ln $$file ../`cat ../.fname`/lib \
- || cp -p $$file ../`cat ../.fname`/lib; \
- done
-
-$(LIBNAME).a: $(OBJECTS)
- rm -f $@
- $(AR) cr $@ $(OBJECTS)
- -$(RANLIB) $@
-
-$(LIBNAME).$(SHLIBEXT): $(OBJECTS)
- rm -f $@
- $(LDSHARED) -o $@ $(OBJECTS)
-
-TAGS: $(SOURCES)
- etags $(SOURCES)
-
-$(OBJECTS): ../include/config.h
-
-.PHONY: all Wall install uninstall check clean mostlyclean distclean realclean dist
diff --git a/usr.sbin/afs/src/rxkad/compat.c b/usr.sbin/afs/src/rxkad/compat.c
deleted file mode 100644
index 6002788fd17..00000000000
--- a/usr.sbin/afs/src/rxkad/compat.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "rxkad_locl.h"
-
-RCSID("$arla: compat.c,v 1.6 2003/01/11 00:50:30 lha Exp $");
-
-void initialize_rxk_error_table(void);
-
-void
-initialize_rxk_error_table(void)
-{
- /* A no op, our com_err is not compatible anyways. */
-}
-
-uint32_t
-life_to_time(uint32_t start, int life_)
-{
- return krb_life_to_time(start, life_);
-}
-
-int
-time_to_life(uint32_t start, uint32_t end)
-{
- return krb_time_to_life(start, end);
-}
-
-/* function returns:
- *
- * -2 if zero or negative lifetime, or start time is more than now plus time
- * uncertainty plus max ticket lifetime, or if there is an end time, it's
- * before now minus uncertainty, the start time is non-zero, and now minus
- * the start time is greater than the max ticket lifetime plus 24 hours
- *
- * -1 if there is an end time, it's before now minus uncertainty, and the
- * start time is not non-zero or now minus the start time is not greater
- * than the max ticket lifetime plus 24 hours
- *
- * 0 if the times are consistent (not covered by above) but start time is
- * less than now plus uncertainty
- *
- * 1 if the start time is in the past and the end time is infinity.
- *
- * 2 if the start time is past and the end time is in the future
- * and the lifetime is within the legal limit.
- */
-int
-tkt_CheckTimes(int32_t begin, int32_t end, int32_t now)
-{
- if (end <= begin
- || begin > now + KTC_TIME_UNCERTAINTY + MAXKTCTICKETLIFETIME
- || (end
- && end < now - KTC_TIME_UNCERTAINTY
- && now - begin > MAXKTCTICKETLIFETIME + MAXKTCTICKETLIFETIME))
- return -2;
- if (end
- && end < now - KTC_TIME_UNCERTAINTY
- && (begin == 0 || now - begin <= 2 * MAXKTCTICKETLIFETIME))
- return -1;
- if (begin < now + KTC_TIME_UNCERTAINTY)
- return 0;
- if (begin < now && end == 0)
- return 1;
- if (begin < now
- && end > now
- && (end - begin) < MAXKTCTICKETLIFETIME)
- return 2;
- return 2;
-}
-
-
-int
-tkt_MakeTicket(char *ticket,
- int *ticketLen,
- struct ktc_encryptionKey *key,
- char *name, char *inst, char *cell,
- uint32_t start, uint32_t end,
- struct ktc_encryptionKey *sessionKey,
- uint32_t host,
- char *sname, char *sinst)
-{
- int code;
- KTEXT_ST tkt;
-
- /* This routine will probably never be called, only kaserver needs it */
-
- code = krb_create_ticket(&tkt,
- 0, /*flags*/
- name, inst, cell,
- host,
- sessionKey,
- krb_time_to_life(start, end), start,
- sname, sinst,
- (des_cblock *)key);
- if (code != KSUCCESS)
- return code;
-
- *ticketLen = tkt.length;
- memcpy(ticket, tkt.dat, tkt.length);
- return code;
-}
-
-int
-tkt_DecodeTicket (char *asecret,
- int32_t ticketLen,
- struct ktc_encryptionKey *key_,
- char *name,
- char *inst,
- char *cell,
- char *sessionKey,
- int32_t *host_,
- int32_t *start_,
- int32_t *end)
-{
- des_cblock *key = (des_cblock *)key_;
- des_key_schedule sched;
- KTEXT_ST txt;
- int ret;
- unsigned char flags;
- int life;
- char sname[ANAME_SZ];
- char sinst[INST_SZ];
- uint32_t *start = (uint32_t *)start_;
- uint32_t *host = (uint32_t *)host_;
-
- des_key_sched(key, sched);
- txt.length = ticketLen;
- memcpy (txt.dat, asecret, ticketLen);
- ret = decomp_ticket (&txt,
- &flags,
- name,
- inst,
- cell,
- host,
- (unsigned char *)sessionKey,
- &life,
- start,
- sname,
- sinst,
- key,
- sched);
- if (ret == KSUCCESS)
- *end = krb_life_to_time(*start, life);
- return ret;
-}
diff --git a/usr.sbin/afs/src/rxkad/osi_alloc.c b/usr.sbin/afs/src/rxkad/osi_alloc.c
deleted file mode 100644
index 5a7b3d2330b..00000000000
--- a/usr.sbin/afs/src/rxkad/osi_alloc.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "rxkad_locl.h"
-
-RCSID("$arla: osi_alloc.c,v 1.5 2003/01/11 00:50:30 lha Exp $");
-
-#undef osi_Alloc
-#undef osi_Free
-char *osi_Alloc(int32_t size);
-void osi_Free(void *p, int32_t size);
-
-static char zero_malloc;
-
-char *
-osi_Alloc(int32_t size)
-{
- if (size == 0)
- return &zero_malloc;
- return malloc(size);
-}
-
-void
-osi_Free(void *p, int32_t size)
-{
- if (p == &zero_malloc)
- return;
- free(p);
-}
diff --git a/usr.sbin/afs/src/rxkad/rxk_clnt.c b/usr.sbin/afs/src/rxkad/rxk_clnt.c
deleted file mode 100644
index 6367e153928..00000000000
--- a/usr.sbin/afs/src/rxkad/rxk_clnt.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000, 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "rxkad_locl.h"
-
-RCSID("$arla: rxk_clnt.c,v 1.8 2003/01/11 00:50:31 lha Exp $");
-
-/* This code also links into the kernel so we need to use osi_Alloc()
- * to avoid calling malloc(). Similar trick with memcpy() */
-
-#undef osi_Alloc
-#undef osi_Free
-char *osi_Alloc(int32_t size);
-void osi_Free(void *p, int32_t size);
-
-#undef memcpy
-#define memcpy(to, from, len) bcopy1((from), (to), (len))
-
-static
-void
-bcopy1(const void *from_, void *to_, size_t n)
-{
- char *to = to_;
- const char *from = from_;
- for (; n > 0; n--)
- {
- *to = *from;
- to++;
- from++;
- }
-}
-
-/* Security object specific client data */
-typedef struct rxkad_clnt_class {
- struct rx_securityClass klass;
- rxkad_level level;
- key_stuff k;
- int32_t kvno;
- int32_t ticket_len;
- char *ticket;
-} rxkad_clnt_class;
-
-/* Per connection specific client data */
-typedef struct clnt_con_data {
- end_stuff e;
-} clnt_con_data;
-
-static
-int
-client_NewConnection(struct rx_securityClass *obj_, struct rx_connection *con)
-{
- rxkad_clnt_class *obj = (rxkad_clnt_class *) obj_;
- clnt_con_data *cdat;
-
- assert(con->securityData == 0);
- obj->klass.refCount++;
- cdat = (clnt_con_data *) osi_Alloc(sizeof(clnt_con_data));
- cdat->e.bytesReceived = cdat->e.packetsReceived = 0;
- cdat->e.bytesSent = cdat->e.packetsSent = 0;
-
- con->securityData = (char *) cdat;
- rx_nextCid += RX_MAXCALLS;
- con->epoch = rx_epoch;
- con->cid = rx_nextCid;
- /* We don't use trailers but the transarc implementation breaks when
- * we don't set the trailer size, packets get to large */
- switch (obj->level) {
- case rxkad_clear:
- /* nichts */
- break;
- case rxkad_auth:
- rx_SetSecurityHeaderSize(con, 4);
- rx_SetSecurityMaxTrailerSize(con, 4);
- break;
- case rxkad_crypt:
- rx_SetSecurityHeaderSize(con, 8);
- rx_SetSecurityMaxTrailerSize(con, 8);
- break;
- default:
- assert(0);
- }
- rxkad_calc_header_iv(con, obj->k.keysched,
- (const des_cblock *)&obj->k.key, cdat->e.header_iv);
- return 0;
-}
-
-static
-int
-client_Close(struct rx_securityClass *obj_)
-{
- rxkad_clnt_class *obj = (rxkad_clnt_class *) obj_;
- obj->klass.refCount--;
- if (obj->klass.refCount <= 0)
- {
- osi_Free(obj->ticket, obj->ticket_len);
- osi_Free(obj, sizeof(rxkad_clnt_class));
- }
- return 0;
-}
-
-static
-int
-client_DestroyConnection(struct rx_securityClass *obj,
- struct rx_connection *con)
-{
- clnt_con_data *cdat = (clnt_con_data *)con->securityData;
-
- if (cdat)
- osi_Free(cdat, sizeof(clnt_con_data));
- return client_Close(obj);
-}
-
-/*
- * Receive a challange and respond.
- */
-static
-int
-client_GetResponse(const struct rx_securityClass *obj_,
- const struct rx_connection *con,
- struct rx_packet *pkt)
-{
- rxkad_clnt_class *obj = (rxkad_clnt_class *) obj_;
- rxkad_challenge c;
- rxkad_response r;
-
- /* Get challenge */
- if (rx_SlowReadPacket(pkt, 0, sizeof(c), &c) != sizeof(c))
- return RXKADPACKETSHORT;
-
- if (ntohl(c.version) < RXKAD_VERSION)
- return RXKADINCONSISTENCY; /* Don't know how to make vers 1 response. */
- /* Always make a vers 2 response. */
-
- if (ntohl(c.min_level) > obj->level)
- return RXKADLEVELFAIL;
-
- /* Make response */
- r.version = htonl(RXKAD_VERSION);
- r.unused = 0;
- r.encrypted.epoch = htonl(con->epoch);
- r.encrypted.cid = htonl(con->cid & RX_CIDMASK);
- r.encrypted.cksum = 0;
- r.encrypted.security_index = htonl(con->securityIndex);
- {
- int i;
- /* Get and fixup call number vector */
- rxi_GetCallNumberVector(con, r.encrypted.call_numbers);
- for (i = 0; i < RX_MAXCALLS; i++)
- {
- if (r.encrypted.call_numbers[i] < 0)
- return RXKADINCONSISTENCY;
- r.encrypted.call_numbers[i] = htonl(r.encrypted.call_numbers[i]);
- }
- }
- r.encrypted.inc_nonce = htonl(ntohl(c.nonce) + 1);
- r.encrypted.level = htonl((int32_t)obj->level);
- r.kvno = htonl(obj->kvno);
- r.ticket_len = htonl(obj->ticket_len);
- /* Make checksum before we seal r.encrypted */
- r.encrypted.cksum = rxkad_cksum_response(&r);
- /* Seal r.encrypted */
- fc_cbc_enc2(&r.encrypted, &r.encrypted, sizeof(r.encrypted),
- obj->k.keysched, (uint32_t*)obj->k.key, ENCRYPT);
-
- /* Stuff response and kerberos ticket into packet */
- if (rx_SlowWritePacket(pkt, 0, sizeof(r), &r) != sizeof(r))
- return RXKADPACKETSHORT;
- if (rx_SlowWritePacket(pkt, sizeof(r), obj->ticket_len, obj->ticket) != obj->ticket_len)
- return RXKADPACKETSHORT;
- rx_SetDataSize(pkt, sizeof(r) + obj->ticket_len);
- return 0;
-}
-
-/*
- * Checksum and/or encrypt packet.
- */
-static
-int
-client_PreparePacket(struct rx_securityClass *obj_,
- struct rx_call *call,
- struct rx_packet *pkt)
-{
- rxkad_clnt_class *obj = (rxkad_clnt_class *) obj_;
- key_stuff *k = &obj->k;
- struct rx_connection *con = rx_ConnectionOf(call);
- end_stuff *e = &((clnt_con_data *) con->securityData)->e;
-
- return rxkad_prepare_packet(pkt, con, obj->level, k, e);
-}
-
-/*
- * Verify checksums and/or decrypt packet.
- */
-static
-int
-client_CheckPacket(struct rx_securityClass *obj_,
- struct rx_call *call,
- struct rx_packet *pkt)
-{
- rxkad_clnt_class *obj = (rxkad_clnt_class *) obj_;
- key_stuff *k = &obj->k;
- struct rx_connection *con = rx_ConnectionOf(call);
- end_stuff *e = &((clnt_con_data *) con->securityData)->e;
-
- return rxkad_check_packet(pkt, con, obj->level, k, e);
-}
-
-static
-int
-client_GetStats(const struct rx_securityClass *obj,
- const struct rx_connection *con,
- struct rx_securityObjectStats *st)
-{
- clnt_con_data *cdat = (clnt_con_data *) con->securityData;
-
- st->type = rxkad_disipline;
- st->level = ((rxkad_clnt_class *)obj)->level;
- st->flags = rxkad_checksummed;
- if (cdat == 0)
- st->flags |= rxkad_unallocated;
- {
- st->bytesReceived = cdat->e.bytesReceived;
- st->packetsReceived = cdat->e.packetsReceived;
- st->bytesSent = cdat->e.bytesSent;
- st->packetsSent = cdat->e.packetsSent;
- }
- return 0;
-}
-
-static
-struct rx_securityOps client_ops = {
- client_Close,
- client_NewConnection,
- client_PreparePacket,
- 0,
- 0,
- 0,
- 0,
- client_GetResponse,
- 0,
- client_CheckPacket,
- client_DestroyConnection,
- client_GetStats,
- 0,
- 0,
- 0,
-};
-
-int rxkad_EpochWasSet = 0;
-
-int rxkad_min_level = rxkad_clear; /* rxkad_{clear, auth, crypt} */
-
-struct rx_securityClass *
-rxkad_NewClientSecurityObject(/*rxkad_level*/ int level,
- void *sessionkey,
- int32_t kvno,
- int ticket_len,
- char *ticket)
-{
- rxkad_clnt_class *obj;
- static int inited = 0;
-
- if (level < rxkad_min_level)
- level = rxkad_min_level; /* Boost security level */
-
- if (!inited)
- {
- /* Any good random numbers will do, no real need to use
- * cryptographic techniques here */
- union {
- uint32_t rnd[2];
- des_cblock k;
- } u;
- int32_t sched[ROUNDS];
- u_long next_epoch;
-
- u.rnd[0] = rx_nextCid;
- u.rnd[1] = rx_epoch;
- fc_keysched(sessionkey, sched);
- fc_ecb_encrypt(&u.k, &u.k, sched, ENCRYPT);
-
- /* Some paranoia so we won't reveal the key */
- /*des_set_odd_parity(&u.k);*/
- fc_keysched(&u.k, sched);
- fc_ecb_encrypt(&u.k, &u.k, sched, ENCRYPT);
-
- /* Some paranoia so we won't reveal the key */
- /*des_set_odd_parity(&u.k);*/
- fc_keysched(&u.k, sched);
- fc_ecb_encrypt(&u.k, &u.k, sched, ENCRYPT);
-
- /* Set new cid and epoch generator */
- rx_nextCid = u.rnd[0] << RX_CIDSHIFT;
- next_epoch = u.rnd[0] ^ u.rnd[1];
- next_epoch &= 0x7FFFFFFF;
- rx_SetEpoch(next_epoch);
- rxkad_EpochWasSet = 1;
- inited = 1;
- }
-
-#if 0
- /* If we are passed a to large kerberos 5 ticket hope for the best */
- if (ticket_len > MAXKRB5TICKETLEN)
- ticket_len = MAXKRB5TICKETLEN;
-#endif
-
- obj = (rxkad_clnt_class *) osi_Alloc(sizeof(rxkad_clnt_class));
- obj->klass.refCount = 1;
- obj->klass.ops = &client_ops;
-
- obj->klass.privateData = (char *) obj;
-
- obj->level = level;
- fc_keysched(sessionkey, obj->k.keysched);
- memcpy(obj->k.key, sessionkey, sizeof(des_cblock));
- obj->kvno = kvno;
-
- obj->ticket_len = ticket_len;
- obj->ticket = osi_Alloc(ticket_len);
- memcpy(obj->ticket, ticket, ticket_len);
-
- return &obj->klass;
-}
diff --git a/usr.sbin/afs/src/rxkad/rxk_crpt.c b/usr.sbin/afs/src/rxkad/rxk_crpt.c
deleted file mode 100644
index fc85a93c3c9..00000000000
--- a/usr.sbin/afs/src/rxkad/rxk_crpt.c
+++ /dev/null
@@ -1,782 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000, 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "rxkad_locl.h"
-
-
-/*
- * this assumes that KRB_C_BIGENDIAN is used.
- * if we can find out endianess at compile-time, do so,
- * otherwise WORDS_BIGENDIAN should already have been defined
- */
-
-#if ENDIANESS_IN_SYS_PARAM_H
-# undef WORDS_BIGENDIAN
-# include <sys/types.h>
-# include <sys/param.h>
-# if BYTE_ORDER == BIG_ENDIAN
-# define WORDS_BIGENDIAN 1
-# elif BYTE_ORDER == LITTLE_ENDIAN
- /* ok */
-# else
-# error where do you cut your eggs?
-# endif
-#endif
-
-RCSID("$arla: rxk_crpt.c,v 1.15 2003/04/09 02:34:16 lha Exp $");
-
-/*
- * Unrolling of the inner loops helps the most on pentium chips
- * (ca 18%). On risc machines only expect a modest improvement (ca 5%).
- * The cost for this is rougly 4k bytes.
- */
-#define UNROLL_LOOPS 1
-/*
- * Inline assembler gives a boost only to fc_keysched.
- * On the pentium expect ca 28%.
- */
-/*#define GNU_ASM 1 (now autoconfed) */
-
-#if !defined(inline) && !defined(__GNUC__)
-#define inline
-#endif
-
-#ifdef MANGLE_NAMES
-#define fc_keysched _afs_QTKrFdpoFL
-#define fc_ecb_encrypt _afs_sDLThwNLok
-#define fc_cbc_encrypt _afs_fkyCWTvfRS
-#define rxkad_DecryptPacket _afs_SRWEeqTXrS
-#define rxkad_EncryptPacket _afs_bpwQbdoghO
-#endif
-
-/*
- * There is usually no memcpy in kernels but gcc will inline all
- * calls to memcpy in this code anyway.
- */
-#if defined(KERNEL) && !defined(__GNUC__)
-#define memcpy(to, from, n) bcopy((from), (to), (n))
-#endif
-
-/* Rotate 32 bit word left */
-#undef bswap32
-#undef ROT32L
-
-#define ROT32L(x, n) ((((uint32_t) x) << (n)) | (((uint32_t) x) >> (32-(n))))
-#define bswap32(x) (((ROT32L(x, 16) & 0x00ff00ff)<<8) | ((ROT32L(x, 16)>>8) & 0x00ff00ff))
-
-
-#if WORDS_BIGENDIAN
-#define NTOH(x) (x)
-#else
-#define NTOH(x) bswap32(x)
-#endif
-
-/*
- * Try to use a good function for ntohl-ing.
- *
- * The choice is done by autoconf setting EFF_NTOHL to one of:
- * CPU function
- * i386 ntohl
- * i[4-9]86 bswap
- * alpha bswap32
- * all else ntohl
- */
-
-#if defined(__GNUC__) && (defined(i386) || defined(__i386__))
-static inline uint32_t
-bswap(uint32_t x)
-{
- asm("bswap %0" : "=r" (x) : "0" (x));
- return x;
-}
-#endif
-
-/*
- * Sboxes for Feistel network derived from
- * /afs/transarc.com/public/afsps/afs.rel31b.export-src/rxkad/sboxes.h
- */
-
-#undef Z
-#define Z(x) NTOH(x << 3)
-static const uint32_t sbox0[256] = {
- Z(0xea), Z(0x7f), Z(0xb2), Z(0x64), Z(0x9d), Z(0xb0), Z(0xd9), Z(0x11), Z(0xcd), Z(0x86), Z(0x86),
- Z(0x91), Z(0x0a), Z(0xb2), Z(0x93), Z(0x06), Z(0x0e), Z(0x06), Z(0xd2), Z(0x65), Z(0x73), Z(0xc5),
- Z(0x28), Z(0x60), Z(0xf2), Z(0x20), Z(0xb5), Z(0x38), Z(0x7e), Z(0xda), Z(0x9f), Z(0xe3), Z(0xd2),
- Z(0xcf), Z(0xc4), Z(0x3c), Z(0x61), Z(0xff), Z(0x4a), Z(0x4a), Z(0x35), Z(0xac), Z(0xaa), Z(0x5f),
- Z(0x2b), Z(0xbb), Z(0xbc), Z(0x53), Z(0x4e), Z(0x9d), Z(0x78), Z(0xa3), Z(0xdc), Z(0x09), Z(0x32),
- Z(0x10), Z(0xc6), Z(0x6f), Z(0x66), Z(0xd6), Z(0xab), Z(0xa9), Z(0xaf), Z(0xfd), Z(0x3b), Z(0x95),
- Z(0xe8), Z(0x34), Z(0x9a), Z(0x81), Z(0x72), Z(0x80), Z(0x9c), Z(0xf3), Z(0xec), Z(0xda), Z(0x9f),
- Z(0x26), Z(0x76), Z(0x15), Z(0x3e), Z(0x55), Z(0x4d), Z(0xde), Z(0x84), Z(0xee), Z(0xad), Z(0xc7),
- Z(0xf1), Z(0x6b), Z(0x3d), Z(0xd3), Z(0x04), Z(0x49), Z(0xaa), Z(0x24), Z(0x0b), Z(0x8a), Z(0x83),
- Z(0xba), Z(0xfa), Z(0x85), Z(0xa0), Z(0xa8), Z(0xb1), Z(0xd4), Z(0x01), Z(0xd8), Z(0x70), Z(0x64),
- Z(0xf0), Z(0x51), Z(0xd2), Z(0xc3), Z(0xa7), Z(0x75), Z(0x8c), Z(0xa5), Z(0x64), Z(0xef), Z(0x10),
- Z(0x4e), Z(0xb7), Z(0xc6), Z(0x61), Z(0x03), Z(0xeb), Z(0x44), Z(0x3d), Z(0xe5), Z(0xb3), Z(0x5b),
- Z(0xae), Z(0xd5), Z(0xad), Z(0x1d), Z(0xfa), Z(0x5a), Z(0x1e), Z(0x33), Z(0xab), Z(0x93), Z(0xa2),
- Z(0xb7), Z(0xe7), Z(0xa8), Z(0x45), Z(0xa4), Z(0xcd), Z(0x29), Z(0x63), Z(0x44), Z(0xb6), Z(0x69),
- Z(0x7e), Z(0x2e), Z(0x62), Z(0x03), Z(0xc8), Z(0xe0), Z(0x17), Z(0xbb), Z(0xc7), Z(0xf3), Z(0x3f),
- Z(0x36), Z(0xba), Z(0x71), Z(0x8e), Z(0x97), Z(0x65), Z(0x60), Z(0x69), Z(0xb6), Z(0xf6), Z(0xe6),
- Z(0x6e), Z(0xe0), Z(0x81), Z(0x59), Z(0xe8), Z(0xaf), Z(0xdd), Z(0x95), Z(0x22), Z(0x99), Z(0xfd),
- Z(0x63), Z(0x19), Z(0x74), Z(0x61), Z(0xb1), Z(0xb6), Z(0x5b), Z(0xae), Z(0x54), Z(0xb3), Z(0x70),
- Z(0xff), Z(0xc6), Z(0x3b), Z(0x3e), Z(0xc1), Z(0xd7), Z(0xe1), Z(0x0e), Z(0x76), Z(0xe5), Z(0x36),
- Z(0x4f), Z(0x59), Z(0xc7), Z(0x08), Z(0x6e), Z(0x82), Z(0xa6), Z(0x93), Z(0xc4), Z(0xaa), Z(0x26),
- Z(0x49), Z(0xe0), Z(0x21), Z(0x64), Z(0x07), Z(0x9f), Z(0x64), Z(0x81), Z(0x9c), Z(0xbf), Z(0xf9),
- Z(0xd1), Z(0x43), Z(0xf8), Z(0xb6), Z(0xb9), Z(0xf1), Z(0x24), Z(0x75), Z(0x03), Z(0xe4), Z(0xb0),
- Z(0x99), Z(0x46), Z(0x3d), Z(0xf5), Z(0xd1), Z(0x39), Z(0x72), Z(0x12), Z(0xf6), Z(0xba), Z(0x0c),
- Z(0x0d), Z(0x42), Z(0x2e)};
-
-#undef Z
-#define Z(x) NTOH((x << 27) | (x >> 5))
-static const uint32_t sbox1[256] = {
- Z(0x77), Z(0x14), Z(0xa6), Z(0xfe), Z(0xb2), Z(0x5e), Z(0x8c), Z(0x3e), Z(0x67), Z(0x6c), Z(0xa1),
- Z(0x0d), Z(0xc2), Z(0xa2), Z(0xc1), Z(0x85), Z(0x6c), Z(0x7b), Z(0x67), Z(0xc6), Z(0x23), Z(0xe3),
- Z(0xf2), Z(0x89), Z(0x50), Z(0x9c), Z(0x03), Z(0xb7), Z(0x73), Z(0xe6), Z(0xe1), Z(0x39), Z(0x31),
- Z(0x2c), Z(0x27), Z(0x9f), Z(0xa5), Z(0x69), Z(0x44), Z(0xd6), Z(0x23), Z(0x83), Z(0x98), Z(0x7d),
- Z(0x3c), Z(0xb4), Z(0x2d), Z(0x99), Z(0x1c), Z(0x1f), Z(0x8c), Z(0x20), Z(0x03), Z(0x7c), Z(0x5f),
- Z(0xad), Z(0xf4), Z(0xfa), Z(0x95), Z(0xca), Z(0x76), Z(0x44), Z(0xcd), Z(0xb6), Z(0xb8), Z(0xa1),
- Z(0xa1), Z(0xbe), Z(0x9e), Z(0x54), Z(0x8f), Z(0x0b), Z(0x16), Z(0x74), Z(0x31), Z(0x8a), Z(0x23),
- Z(0x17), Z(0x04), Z(0xfa), Z(0x79), Z(0x84), Z(0xb1), Z(0xf5), Z(0x13), Z(0xab), Z(0xb5), Z(0x2e),
- Z(0xaa), Z(0x0c), Z(0x60), Z(0x6b), Z(0x5b), Z(0xc4), Z(0x4b), Z(0xbc), Z(0xe2), Z(0xaf), Z(0x45),
- Z(0x73), Z(0xfa), Z(0xc9), Z(0x49), Z(0xcd), Z(0x00), Z(0x92), Z(0x7d), Z(0x97), Z(0x7a), Z(0x18),
- Z(0x60), Z(0x3d), Z(0xcf), Z(0x5b), Z(0xde), Z(0xc6), Z(0xe2), Z(0xe6), Z(0xbb), Z(0x8b), Z(0x06),
- Z(0xda), Z(0x08), Z(0x15), Z(0x1b), Z(0x88), Z(0x6a), Z(0x17), Z(0x89), Z(0xd0), Z(0xa9), Z(0xc1),
- Z(0xc9), Z(0x70), Z(0x6b), Z(0xe5), Z(0x43), Z(0xf4), Z(0x68), Z(0xc8), Z(0xd3), Z(0x84), Z(0x28),
- Z(0x0a), Z(0x52), Z(0x66), Z(0xa3), Z(0xca), Z(0xf2), Z(0xe3), Z(0x7f), Z(0x7a), Z(0x31), Z(0xf7),
- Z(0x88), Z(0x94), Z(0x5e), Z(0x9c), Z(0x63), Z(0xd5), Z(0x24), Z(0x66), Z(0xfc), Z(0xb3), Z(0x57),
- Z(0x25), Z(0xbe), Z(0x89), Z(0x44), Z(0xc4), Z(0xe0), Z(0x8f), Z(0x23), Z(0x3c), Z(0x12), Z(0x52),
- Z(0xf5), Z(0x1e), Z(0xf4), Z(0xcb), Z(0x18), Z(0x33), Z(0x1f), Z(0xf8), Z(0x69), Z(0x10), Z(0x9d),
- Z(0xd3), Z(0xf7), Z(0x28), Z(0xf8), Z(0x30), Z(0x05), Z(0x5e), Z(0x32), Z(0xc0), Z(0xd5), Z(0x19),
- Z(0xbd), Z(0x45), Z(0x8b), Z(0x5b), Z(0xfd), Z(0xbc), Z(0xe2), Z(0x5c), Z(0xa9), Z(0x96), Z(0xef),
- Z(0x70), Z(0xcf), Z(0xc2), Z(0x2a), Z(0xb3), Z(0x61), Z(0xad), Z(0x80), Z(0x48), Z(0x81), Z(0xb7),
- Z(0x1d), Z(0x43), Z(0xd9), Z(0xd7), Z(0x45), Z(0xf0), Z(0xd8), Z(0x8a), Z(0x59), Z(0x7c), Z(0x57),
- Z(0xc1), Z(0x79), Z(0xc7), Z(0x34), Z(0xd6), Z(0x43), Z(0xdf), Z(0xe4), Z(0x78), Z(0x16), Z(0x06),
- Z(0xda), Z(0x92), Z(0x76), Z(0x51), Z(0xe1), Z(0xd4), Z(0x70), Z(0x03), Z(0xe0), Z(0x2f), Z(0x96),
- Z(0x91), Z(0x82), Z(0x80)};
-
-#undef Z
-#define Z(x) NTOH(x << 11)
-static const uint32_t sbox2[256] = {
- Z(0xf0), Z(0x37), Z(0x24), Z(0x53), Z(0x2a), Z(0x03), Z(0x83), Z(0x86), Z(0xd1), Z(0xec), Z(0x50),
- Z(0xf0), Z(0x42), Z(0x78), Z(0x2f), Z(0x6d), Z(0xbf), Z(0x80), Z(0x87), Z(0x27), Z(0x95), Z(0xe2),
- Z(0xc5), Z(0x5d), Z(0xf9), Z(0x6f), Z(0xdb), Z(0xb4), Z(0x65), Z(0x6e), Z(0xe7), Z(0x24), Z(0xc8),
- Z(0x1a), Z(0xbb), Z(0x49), Z(0xb5), Z(0x0a), Z(0x7d), Z(0xb9), Z(0xe8), Z(0xdc), Z(0xb7), Z(0xd9),
- Z(0x45), Z(0x20), Z(0x1b), Z(0xce), Z(0x59), Z(0x9d), Z(0x6b), Z(0xbd), Z(0x0e), Z(0x8f), Z(0xa3),
- Z(0xa9), Z(0xbc), Z(0x74), Z(0xa6), Z(0xf6), Z(0x7f), Z(0x5f), Z(0xb1), Z(0x68), Z(0x84), Z(0xbc),
- Z(0xa9), Z(0xfd), Z(0x55), Z(0x50), Z(0xe9), Z(0xb6), Z(0x13), Z(0x5e), Z(0x07), Z(0xb8), Z(0x95),
- Z(0x02), Z(0xc0), Z(0xd0), Z(0x6a), Z(0x1a), Z(0x85), Z(0xbd), Z(0xb6), Z(0xfd), Z(0xfe), Z(0x17),
- Z(0x3f), Z(0x09), Z(0xa3), Z(0x8d), Z(0xfb), Z(0xed), Z(0xda), Z(0x1d), Z(0x6d), Z(0x1c), Z(0x6c),
- Z(0x01), Z(0x5a), Z(0xe5), Z(0x71), Z(0x3e), Z(0x8b), Z(0x6b), Z(0xbe), Z(0x29), Z(0xeb), Z(0x12),
- Z(0x19), Z(0x34), Z(0xcd), Z(0xb3), Z(0xbd), Z(0x35), Z(0xea), Z(0x4b), Z(0xd5), Z(0xae), Z(0x2a),
- Z(0x79), Z(0x5a), Z(0xa5), Z(0x32), Z(0x12), Z(0x7b), Z(0xdc), Z(0x2c), Z(0xd0), Z(0x22), Z(0x4b),
- Z(0xb1), Z(0x85), Z(0x59), Z(0x80), Z(0xc0), Z(0x30), Z(0x9f), Z(0x73), Z(0xd3), Z(0x14), Z(0x48),
- Z(0x40), Z(0x07), Z(0x2d), Z(0x8f), Z(0x80), Z(0x0f), Z(0xce), Z(0x0b), Z(0x5e), Z(0xb7), Z(0x5e),
- Z(0xac), Z(0x24), Z(0x94), Z(0x4a), Z(0x18), Z(0x15), Z(0x05), Z(0xe8), Z(0x02), Z(0x77), Z(0xa9),
- Z(0xc7), Z(0x40), Z(0x45), Z(0x89), Z(0xd1), Z(0xea), Z(0xde), Z(0x0c), Z(0x79), Z(0x2a), Z(0x99),
- Z(0x6c), Z(0x3e), Z(0x95), Z(0xdd), Z(0x8c), Z(0x7d), Z(0xad), Z(0x6f), Z(0xdc), Z(0xff), Z(0xfd),
- Z(0x62), Z(0x47), Z(0xb3), Z(0x21), Z(0x8a), Z(0xec), Z(0x8e), Z(0x19), Z(0x18), Z(0xb4), Z(0x6e),
- Z(0x3d), Z(0xfd), Z(0x74), Z(0x54), Z(0x1e), Z(0x04), Z(0x85), Z(0xd8), Z(0xbc), Z(0x1f), Z(0x56),
- Z(0xe7), Z(0x3a), Z(0x56), Z(0x67), Z(0xd6), Z(0xc8), Z(0xa5), Z(0xf3), Z(0x8e), Z(0xde), Z(0xae),
- Z(0x37), Z(0x49), Z(0xb7), Z(0xfa), Z(0xc8), Z(0xf4), Z(0x1f), Z(0xe0), Z(0x2a), Z(0x9b), Z(0x15),
- Z(0xd1), Z(0x34), Z(0x0e), Z(0xb5), Z(0xe0), Z(0x44), Z(0x78), Z(0x84), Z(0x59), Z(0x56), Z(0x68),
- Z(0x77), Z(0xa5), Z(0x14), Z(0x06), Z(0xf5), Z(0x2f), Z(0x8c), Z(0x8a), Z(0x73), Z(0x80), Z(0x76),
- Z(0xb4), Z(0x10), Z(0x86)};
-
-#undef Z
-#define Z(x) NTOH(x << 19)
-static const uint32_t sbox3[256] = {
- Z(0xa9), Z(0x2a), Z(0x48), Z(0x51), Z(0x84), Z(0x7e), Z(0x49), Z(0xe2), Z(0xb5), Z(0xb7), Z(0x42),
- Z(0x33), Z(0x7d), Z(0x5d), Z(0xa6), Z(0x12), Z(0x44), Z(0x48), Z(0x6d), Z(0x28), Z(0xaa), Z(0x20),
- Z(0x6d), Z(0x57), Z(0xd6), Z(0x6b), Z(0x5d), Z(0x72), Z(0xf0), Z(0x92), Z(0x5a), Z(0x1b), Z(0x53),
- Z(0x80), Z(0x24), Z(0x70), Z(0x9a), Z(0xcc), Z(0xa7), Z(0x66), Z(0xa1), Z(0x01), Z(0xa5), Z(0x41),
- Z(0x97), Z(0x41), Z(0x31), Z(0x82), Z(0xf1), Z(0x14), Z(0xcf), Z(0x53), Z(0x0d), Z(0xa0), Z(0x10),
- Z(0xcc), Z(0x2a), Z(0x7d), Z(0xd2), Z(0xbf), Z(0x4b), Z(0x1a), Z(0xdb), Z(0x16), Z(0x47), Z(0xf6),
- Z(0x51), Z(0x36), Z(0xed), Z(0xf3), Z(0xb9), Z(0x1a), Z(0xa7), Z(0xdf), Z(0x29), Z(0x43), Z(0x01),
- Z(0x54), Z(0x70), Z(0xa4), Z(0xbf), Z(0xd4), Z(0x0b), Z(0x53), Z(0x44), Z(0x60), Z(0x9e), Z(0x23),
- Z(0xa1), Z(0x18), Z(0x68), Z(0x4f), Z(0xf0), Z(0x2f), Z(0x82), Z(0xc2), Z(0x2a), Z(0x41), Z(0xb2),
- Z(0x42), Z(0x0c), Z(0xed), Z(0x0c), Z(0x1d), Z(0x13), Z(0x3a), Z(0x3c), Z(0x6e), Z(0x35), Z(0xdc),
- Z(0x60), Z(0x65), Z(0x85), Z(0xe9), Z(0x64), Z(0x02), Z(0x9a), Z(0x3f), Z(0x9f), Z(0x87), Z(0x96),
- Z(0xdf), Z(0xbe), Z(0xf2), Z(0xcb), Z(0xe5), Z(0x6c), Z(0xd4), Z(0x5a), Z(0x83), Z(0xbf), Z(0x92),
- Z(0x1b), Z(0x94), Z(0x00), Z(0x42), Z(0xcf), Z(0x4b), Z(0x00), Z(0x75), Z(0xba), Z(0x8f), Z(0x76),
- Z(0x5f), Z(0x5d), Z(0x3a), Z(0x4d), Z(0x09), Z(0x12), Z(0x08), Z(0x38), Z(0x95), Z(0x17), Z(0xe4),
- Z(0x01), Z(0x1d), Z(0x4c), Z(0xa9), Z(0xcc), Z(0x85), Z(0x82), Z(0x4c), Z(0x9d), Z(0x2f), Z(0x3b),
- Z(0x66), Z(0xa1), Z(0x34), Z(0x10), Z(0xcd), Z(0x59), Z(0x89), Z(0xa5), Z(0x31), Z(0xcf), Z(0x05),
- Z(0xc8), Z(0x84), Z(0xfa), Z(0xc7), Z(0xba), Z(0x4e), Z(0x8b), Z(0x1a), Z(0x19), Z(0xf1), Z(0xa1),
- Z(0x3b), Z(0x18), Z(0x12), Z(0x17), Z(0xb0), Z(0x98), Z(0x8d), Z(0x0b), Z(0x23), Z(0xc3), Z(0x3a),
- Z(0x2d), Z(0x20), Z(0xdf), Z(0x13), Z(0xa0), Z(0xa8), Z(0x4c), Z(0x0d), Z(0x6c), Z(0x2f), Z(0x47),
- Z(0x13), Z(0x13), Z(0x52), Z(0x1f), Z(0x2d), Z(0xf5), Z(0x79), Z(0x3d), Z(0xa2), Z(0x54), Z(0xbd),
- Z(0x69), Z(0xc8), Z(0x6b), Z(0xf3), Z(0x05), Z(0x28), Z(0xf1), Z(0x16), Z(0x46), Z(0x40), Z(0xb0),
- Z(0x11), Z(0xd3), Z(0xb7), Z(0x95), Z(0x49), Z(0xcf), Z(0xc3), Z(0x1d), Z(0x8f), Z(0xd8), Z(0xe1),
- Z(0x73), Z(0xdb), Z(0xad), Z(0xc8), Z(0xc9), Z(0xa9), Z(0xa1), Z(0xc2), Z(0xc5), Z(0xe3), Z(0xba),
- Z(0xfc), Z(0x0e), Z(0x25)};
-
-/*
- * This is a 16 round Feistel network with permutation F_ENCRYPT
- */
-
-#define F_ENCRYPT(R, L, sched) { \
- union lc4 { uint32_t l; unsigned char c[4]; } u; \
- u.l = sched ^ R; \
- L ^= sbox0[u.c[0]] ^ sbox1[u.c[1]] ^ sbox2[u.c[2]] ^ sbox3[u.c[3]]; }
-
-#ifndef WORDS_BIGENDIAN
-/* BEWARE: this code is endian dependent.
- * This should really be inline assembler on the x86.
- */
-#undef F_ENCRYPT
-#define FF(y, shiftN) (((y) >> shiftN) & 0xFF)
-#define F_ENCRYPT(R, L, sched) { \
- uint32_t u; \
- u = sched ^ R; \
- L ^= sbox0[FF(u, 0)] ^ sbox1[FF(u, 8)] ^ sbox2[FF(u, 16)] ^ sbox3[FF(u, 24)];}
-#endif
-
-static inline
-void
-fc_ecb_enc(uint32_t l,
- uint32_t r,
- uint32_t out[2],
- const int32_t sched[ROUNDS])
-{
-#if !defined(UNROLL_LOOPS)
- {
- int i;
- for (i = 0; i < (ROUNDS/4); i++)
- {
- F_ENCRYPT(r, l, *sched++);
- F_ENCRYPT(l, r, *sched++);
- F_ENCRYPT(r, l, *sched++);
- F_ENCRYPT(l, r, *sched++);
- }
- }
-#else
- F_ENCRYPT(r, l, *sched++);
- F_ENCRYPT(l, r, *sched++);
- F_ENCRYPT(r, l, *sched++);
- F_ENCRYPT(l, r, *sched++);
- F_ENCRYPT(r, l, *sched++);
- F_ENCRYPT(l, r, *sched++);
- F_ENCRYPT(r, l, *sched++);
- F_ENCRYPT(l, r, *sched++);
- F_ENCRYPT(r, l, *sched++);
- F_ENCRYPT(l, r, *sched++);
- F_ENCRYPT(r, l, *sched++);
- F_ENCRYPT(l, r, *sched++);
- F_ENCRYPT(r, l, *sched++);
- F_ENCRYPT(l, r, *sched++);
- F_ENCRYPT(r, l, *sched++);
- F_ENCRYPT(l, r, *sched++);
-#endif /* UNROLL_LOOPS */
-
- out[0] = l;
- out[1] = r;
-}
-
-static inline
-void
-fc_ecb_dec(uint32_t l,
- uint32_t r,
- uint32_t out[2],
- const int32_t sched[ROUNDS])
-{
- sched = &sched[ROUNDS-1];
-
-#if !defined(UNROLL_LOOPS)
- {
- int i;
- for (i = 0; i < (ROUNDS/4); i++)
- {
- F_ENCRYPT(l, r, *sched--);
- F_ENCRYPT(r, l, *sched--);
- F_ENCRYPT(l, r, *sched--);
- F_ENCRYPT(r, l, *sched--);
- }
- }
-#else
- F_ENCRYPT(l, r, *sched--);
- F_ENCRYPT(r, l, *sched--);
- F_ENCRYPT(l, r, *sched--);
- F_ENCRYPT(r, l, *sched--);
- F_ENCRYPT(l, r, *sched--);
- F_ENCRYPT(r, l, *sched--);
- F_ENCRYPT(l, r, *sched--);
- F_ENCRYPT(r, l, *sched--);
- F_ENCRYPT(l, r, *sched--);
- F_ENCRYPT(r, l, *sched--);
- F_ENCRYPT(l, r, *sched--);
- F_ENCRYPT(r, l, *sched--);
- F_ENCRYPT(l, r, *sched--);
- F_ENCRYPT(r, l, *sched--);
- F_ENCRYPT(l, r, *sched--);
- F_ENCRYPT(r, l, *sched--);
-#endif /* UNROLL_LOOPS */
-
- out[0] = l;
- out[1] = r;
-}
-
-static inline
-void
-fc_cbc_enc(const uint32_t *in,
- uint32_t *out,
- int32_t length,
- const int32_t sched[ROUNDS],
- uint32_t iv[2])
-{
- int32_t xor0 = iv[0], xor1 = iv[1];
-
- for (; length > 0; length -= 8)
- {
- uint32_t b8[2];
- /* If length < 8 we read to much, usally ok */
- xor0 ^= in[0];
- xor1 ^= in[1];
- fc_ecb_enc(xor0, xor1, b8, sched);
- xor0 = in[0] ^ b8[0];
- xor1 = in[1] ^ b8[1];
-
- /* Out is always a multiple of 8 */
- memcpy(out, b8, 8);
- out += 2;
- in += 2;
- }
- iv[0] = xor0;
- iv[1] = xor1;
-}
-
-static inline
-void
-fc_cbc_dec(const uint32_t *in,
- uint32_t *out,
- int32_t length,
- const int32_t sched[ROUNDS],
- uint32_t iv[2])
-{
- int32_t xor0 = iv[0], xor1 = iv[1];
-
- for (; length > 0; length -= 8)
- {
- uint32_t b8[2];
- /* In is always a multiple of 8 */
- fc_ecb_dec(in[0], in[1], b8, sched);
- b8[0] ^= xor0;
- b8[1] ^= xor1;
- xor0 = in[0] ^ b8[0];
- xor1 = in[1] ^ b8[1];
-
-#if 0
- if (length >= 8)
- memcpy(out, b8, 8);
- else
- memcpy(out, b8, length); /* Don't write to much when length < 8 */
-#else
- /* If length < 8 we write to much, this is not always ok */
- memcpy(out, b8, 8);
-#endif
- out += 2;
- in += 2;
- }
- iv[0] = xor0;
- iv[1] = xor1;
-}
-
-int
-fc_ecb_encrypt(const void *in_,
- void *out_,
- const int32_t sched[ROUNDS],
- int encrypt)
-{
- const uint32_t *in = in_; /* In must be uint32_t aligned */
- uint32_t *out = out_; /* Out must be uint32_t aligned */
- if (encrypt)
- fc_ecb_enc(in[0], in[1], out, sched);
- else
- fc_ecb_dec(in[0], in[1], out, sched);
- return 0;
-}
-
-int
-fc_cbc_encrypt(const void *in_,
- void *out_,
- int32_t length,
- const int32_t sched[ROUNDS],
- uint32_t iv[2],
- int encrypt)
-{
- const uint32_t *in = in_; /* In must be uint32_t aligned */
- uint32_t *out = out_; /* Out must be uint32_t aligned */
- if (encrypt)
- fc_cbc_enc(in, out, length, sched, iv);
- else
- fc_cbc_dec(in, out, length, sched, iv);
- return 0;
-}
-
-/* Rotate two 32 bit numbers as a 56 bit number */
-#define ROT56R(hi, lo, n) { \
- uint32_t t = lo & ((1<<n)-1); \
- lo = (lo >> n) | ((hi & ((1<<n)-1)) << (32-n)); \
- hi = (hi >> n) | (t << (24-n)); }
-
-/* Rotate one 64 bit number as a 56 bit number */
-#define ROT56R64(k, n) { \
- k = (k >> n) | ((k & ((1<<n) - 1)) << (56-n)); }
-
-/*
- * Generate a key schedule from key, the least significant bit in each
- * key byte is parity and shall be ignored. This leaves 56 significant
- * bits in the key to scatter over the 16 key schedules. For each
- * schedule extract the low order 32 bits and use as schedule, then
- * rotate right by 11 bits.
- *
- * Note that this fc_keysched() generates a schedule in natural byte
- * order, the Transarc function does not. Therefore it's *not*
- * possible to mix fc_keysched, fc_ecb_encrypt and fc_cbc_encrypt
- * from different implementations. Keep them in the same module!
- */
-int
-fc_keysched(const void *key_,
- int32_t sched[ROUNDS])
-{
- const unsigned char *key = key_;
-
- /* Do we have 56 bit longs or even longer longs? */
-#if ((1ul << 31) << 1) && defined(ULONG_MAX) && ((ULONG_MAX >> 55) != 0) && ((1ul << 55) != 0)
- unsigned long k; /* k holds all 56 non parity bits */
-
- /* Compress out parity bits */
- k = (*key++) >> 1;
- k <<= 7;
- k |= (*key++) >> 1;
- k <<= 7;
- k |= (*key++) >> 1;
- k <<= 7;
- k |= (*key++) >> 1;
- k <<= 7;
- k |= (*key++) >> 1;
- k <<= 7;
- k |= (*key++) >> 1;
- k <<= 7;
- k |= (*key++) >> 1;
- k <<= 7;
- k |= (*key) >> 1;
-
- /* Use lower 32 bits for schedule, rotate by 11 each round (16 times) */
- *sched++ = EFF_NTOHL((uint32_t)k);
- ROT56R64(k, 11);
- *sched++ = EFF_NTOHL((uint32_t)k);
- ROT56R64(k, 11);
- *sched++ = EFF_NTOHL((uint32_t)k);
- ROT56R64(k, 11);
- *sched++ = EFF_NTOHL((uint32_t)k);
- ROT56R64(k, 11);
-
- *sched++ = EFF_NTOHL((uint32_t)k);
- ROT56R64(k, 11);
- *sched++ = EFF_NTOHL((uint32_t)k);
- ROT56R64(k, 11);
- *sched++ = EFF_NTOHL((uint32_t)k);
- ROT56R64(k, 11);
- *sched++ = EFF_NTOHL((uint32_t)k);
- ROT56R64(k, 11);
-
- *sched++ = EFF_NTOHL((uint32_t)k);
- ROT56R64(k, 11);
- *sched++ = EFF_NTOHL((uint32_t)k);
- ROT56R64(k, 11);
- *sched++ = EFF_NTOHL((uint32_t)k);
- ROT56R64(k, 11);
- *sched++ = EFF_NTOHL((uint32_t)k);
- ROT56R64(k, 11);
-
- *sched++ = EFF_NTOHL((uint32_t)k);
- ROT56R64(k, 11);
- *sched++ = EFF_NTOHL((uint32_t)k);
- ROT56R64(k, 11);
- *sched++ = EFF_NTOHL((uint32_t)k);
- ROT56R64(k, 11);
- *sched++ = EFF_NTOHL((uint32_t)k);
- return 0;
-#else
- uint32_t hi, lo; /* hi is upper 24 bits and lo lower 32, total 56 */
-
- /* Compress out parity bits */
- lo = (*key++) >> 1;
- lo <<= 7;
- lo |= (*key++) >> 1;
- lo <<= 7;
- lo |= (*key++) >> 1;
- lo <<= 7;
- lo |= (*key++) >> 1;
- hi = lo >> 4;
- lo &= 0xf;
- lo <<= 7;
- lo |= (*key++) >> 1;
- lo <<= 7;
- lo |= (*key++) >> 1;
- lo <<= 7;
- lo |= (*key++) >> 1;
- lo <<= 7;
- lo |= (*key) >> 1;
-
- /* Use lower 32 bits for schedule, rotate by 11 each round (16 times) */
- *sched++ = EFF_NTOHL(lo);
- ROT56R(hi, lo, 11);
- *sched++ = EFF_NTOHL(lo);
- ROT56R(hi, lo, 11);
- *sched++ = EFF_NTOHL(lo);
- ROT56R(hi, lo, 11);
- *sched++ = EFF_NTOHL(lo);
- ROT56R(hi, lo, 11);
-
- *sched++ = EFF_NTOHL(lo);
- ROT56R(hi, lo, 11);
- *sched++ = EFF_NTOHL(lo);
- ROT56R(hi, lo, 11);
- *sched++ = EFF_NTOHL(lo);
- ROT56R(hi, lo, 11);
- *sched++ = EFF_NTOHL(lo);
- ROT56R(hi, lo, 11);
-
- *sched++ = EFF_NTOHL(lo);
- ROT56R(hi, lo, 11);
- *sched++ = EFF_NTOHL(lo);
- ROT56R(hi, lo, 11);
- *sched++ = EFF_NTOHL(lo);
- ROT56R(hi, lo, 11);
- *sched++ = EFF_NTOHL(lo);
- ROT56R(hi, lo, 11);
-
- *sched++ = EFF_NTOHL(lo);
- ROT56R(hi, lo, 11);
- *sched++ = EFF_NTOHL(lo);
- ROT56R(hi, lo, 11);
- *sched++ = EFF_NTOHL(lo);
- ROT56R(hi, lo, 11);
- *sched++ = EFF_NTOHL(lo);
- return 0;
-#endif
-}
-
-/*
- * Encryption/decryption of Rx packets is pretty straight forward. Run
- * fc_cbc_encrypt over the packet fragments until len bytes have been
- * processed. Skip the Rx packet header but not the security header.
- */
-int
-rxkad_EncryptPacket(const void *rx_connection_not_used,
- const int32_t sched[ROUNDS],
- const uint32_t iv[2],
- int len,
- struct rx_packet *packet)
-{
- uint32_t ivec[2];
- struct iovec *frag;
-
- {
- /* What is this good for?
- * It turns out that the security header for auth_enc is of
- * size 8 bytes and the last 4 bytes are defined to be 0!
- */
- uint32_t *t = (uint32_t *)packet->wirevec[1].iov_base;
- t[1] = 0;
- }
-
- memcpy(ivec, iv, sizeof(ivec)); /* Must use copy of iv */
- for (frag = &packet->wirevec[1]; len; frag++)
- {
- int iov_len = frag->iov_len;
- uint32_t *iov_bas = (uint32_t *) frag->iov_base;
- if (iov_len == 0)
- return RXKADDATALEN; /* Length mismatch */
- if (len < iov_len)
- iov_len = len; /* Don't process to much data */
- fc_cbc_enc(iov_bas, iov_bas, iov_len, sched, ivec);
- len -= iov_len;
- }
- return 0;
-}
-
-int
-rxkad_DecryptPacket(const void *rx_connection_not_used,
- const int32_t sched[ROUNDS],
- const uint32_t iv[2],
- int len,
- struct rx_packet *packet)
-{
- uint32_t ivec[2];
- struct iovec *frag;
-
- memcpy(ivec, iv, sizeof(ivec)); /* Must use copy of iv */
- for (frag = &packet->wirevec[1]; len > 0; frag++)
- {
- int iov_len = frag->iov_len;
- uint32_t *iov_bas = (uint32_t *) frag->iov_base;
- if (iov_len == 0)
- return RXKADDATALEN; /* Length mismatch */
- if (len < iov_len)
- iov_len = len; /* Don't process to much data */
- fc_cbc_dec(iov_bas, iov_bas, iov_len, sched, ivec);
- len -= iov_len;
- }
- return 0;
-}
-
-#if defined(TEST) || defined(TEST_KERNEL)
-/*
- * It is possible to link with the client kernel libafs.a to verify
- * the test case. Use TEST_KERNEL to get the mangled names.
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#include <time.h>
-
-const char the_quick[] = "The quick brown fox jumps over the lazy dogs.\0\0";
-
-const unsigned char key1[8]={0xf0,0xe1,0xd2,0xc3,0xb4,0xa5,0x96,0x87};
-const char ciph1[] = {
- 0x00, 0xf0, 0xe, 0x11, 0x75, 0xe6, 0x23, 0x82, 0xee, 0xac, 0x98, 0x62,
- 0x44, 0x51, 0xe4, 0x84, 0xc3, 0x59, 0xd8, 0xaa, 0x64, 0x60, 0xae, 0xf7,
- 0xd2, 0xd9, 0x13, 0x79, 0x72, 0xa3, 0x45, 0x03, 0x23, 0xb5, 0x62, 0xd7,
- 0xc, 0xf5, 0x27, 0xd1, 0xf8, 0x91, 0x3c, 0xac, 0x44, 0x22, 0x92, 0xef };
-
-const unsigned char key2[8]={0xfe,0xdc,0xba,0x98,0x76,0x54,0x32,0x10};
-const char ciph2[] = {
- 0xca, 0x90, 0xf5, 0x9d, 0xcb, 0xd4, 0xd2, 0x3c, 0x01, 0x88, 0x7f, 0x3e,
- 0x31, 0x6e, 0x62, 0x9d, 0xd8, 0xe0, 0x57, 0xa3, 0x06, 0x3a, 0x42, 0x58,
- 0x2a, 0x28, 0xfe, 0x72, 0x52, 0x2f, 0xdd, 0xe0, 0x19, 0x89, 0x09, 0x1c,
- 0x2a, 0x8e, 0x8c, 0x94, 0xfc, 0xc7, 0x68, 0xe4, 0x88, 0xaa, 0xde, 0x0f };
-
-#ifdef TEST_KERNEL
-#define fc_keysched _afs_QTKrFdpoFL
-#define fc_ecb_encrypt _afs_sDLThwNLok
-#define fc_cbc_encrypt _afs_fkyCWTvfRS
-#define rxkad_DecryptPacket _afs_SRWEeqTXrS
-#define rxkad_EncryptPacket _afs_bpwQbdoghO
-#endif
-
-int
-main()
-{
- int32_t sched[ROUNDS];
- char ciph[100], clear[100], tmp[100];
- uint32_t data[2];
- uint32_t iv[2];
- struct rx_packet packet;
-
- if (sizeof(int32_t) != 4)
- fprintf(stderr, "error: sizeof(int32_t) != 4\n");
- if (sizeof(uint32_t) != 4)
- fprintf(stderr, "error: sizeof(uint32_t) != 4\n");
-
- /*
- * Use key1 and key2 as iv */
- fc_keysched(key1, sched);
- memcpy(iv, key2, sizeof(iv));
- fc_cbc_encrypt(the_quick, ciph, sizeof(the_quick), sched, iv, ENCRYPT);
- if (memcmp(ciph1, ciph, sizeof(ciph1)) != 0)
- fprintf(stderr, "encrypt FAILED\n");
- memcpy(iv, key2, sizeof(iv));
- fc_cbc_encrypt(ciph, clear, sizeof(the_quick), sched, iv, DECRYPT);
- if (strcmp(the_quick, clear) != 0)
- fprintf(stderr, "crypt decrypt FAILED\n");
-
- /*
- * Use key2 and key1 as iv
- */
- fc_keysched(key2, sched);
- memcpy(iv, key1, sizeof(iv));
- fc_cbc_encrypt(the_quick, ciph, sizeof(the_quick), sched, iv, ENCRYPT);
- if (memcmp(ciph2, ciph, sizeof(ciph2)) != 0)
- fprintf(stderr, "encrypt FAILED\n");
- memcpy(iv, key1, sizeof(iv));
- fc_cbc_encrypt(ciph, clear, sizeof(the_quick), sched, iv, DECRYPT);
- if (strcmp(the_quick, clear) != 0)
- fprintf(stderr, "crypt decrypt FAILED\n");
-
- /*
- * Test Encrypt- and Decrypt-Packet, use key1 and key2 as iv
- */
- fc_keysched(key1, sched);
- memcpy(iv, key2, sizeof(iv));
- strlcpy(clear, the_quick, sizeof(clear));
- packet.wirevec[1].iov_base = clear;
- packet.wirevec[1].iov_len = sizeof(the_quick);
- packet.wirevec[2].iov_len = 0;
-
- /* For unknown reasons bytes 4-7 are zeroed in rxkad_EncryptPacket */
- rxkad_EncryptPacket(tmp, sched, iv, sizeof(the_quick), &packet);
- rxkad_DecryptPacket(tmp, sched, iv, sizeof(the_quick), &packet);
- clear[4] ^= 'q';
- clear[5] ^= 'u';
- clear[6] ^= 'i';
- clear[7] ^= 'c';
- if (strcmp(the_quick, clear) != 0)
- fprintf(stderr, "rxkad_EncryptPacket/rxkad_DecryptPacket FAILED\n");
-
- {
- struct timeval start, stop;
- int i;
-
- fc_keysched(key1, sched);
- gettimeofday(&start, 0);
- for (i = 0; i < 1000000; i++)
- fc_keysched(key1, sched);
- gettimeofday(&stop, 0);
- printf("fc_keysched = %2.2f us\n",
- (stop.tv_sec - start.tv_sec
- + (stop.tv_usec - start.tv_usec)/1e6)*1);
-
- fc_ecb_encrypt(data, data, sched, ENCRYPT);
- gettimeofday(&start, 0);
- for (i = 0; i < 1000000; i++)
- fc_ecb_encrypt(data, data, sched, ENCRYPT);
- gettimeofday(&stop, 0);
- printf("fc_ecb_encrypt = %2.2f us\n",
- (stop.tv_sec - start.tv_sec
- + (stop.tv_usec - start.tv_usec)/1e6)*1);
-
- fc_cbc_encrypt(the_quick, ciph, sizeof(the_quick), sched, iv, ENCRYPT);
- gettimeofday(&start, 0);
- for (i = 0; i < 100000; i++)
- fc_cbc_encrypt(the_quick, ciph, sizeof(the_quick), sched, iv, ENCRYPT);
- gettimeofday(&stop, 0);
- printf("fc_cbc_encrypt = %2.2f us\n",
- (stop.tv_sec - start.tv_sec
- + (stop.tv_usec - start.tv_usec)/1e6)*10);
-
- }
-
- exit(0);
-}
-#endif /* TEST */
diff --git a/usr.sbin/afs/src/rxkad/rxk_locl.c b/usr.sbin/afs/src/rxkad/rxk_locl.c
deleted file mode 100644
index e1789db8f43..00000000000
--- a/usr.sbin/afs/src/rxkad/rxk_locl.c
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "rxkad_locl.h"
-
-RCSID("$arla: rxk_locl.c,v 1.9 2003/01/11 00:50:32 lha Exp $");
-
-/* The header checksum is the last 16 bits of this struct after
- * encryption. Note that only the last 8 bytes change per packet. */
-#if 0
-struct header_data {
- struct const_header_data c; /* 16 bytes */
- struct variable_header_data v; /* 8 bytes */
-};
-#endif
-
-struct const_header_data {
- /* Data that is constant per connection */
- uint32_t epoch;
- uint32_t cid;
- uint32_t zero;
- uint32_t security_index;
-};
-
-struct variable_header_data {
- /* Data that changes per packet */
- uint32_t call_number;
- uint32_t channel_and_seq;
-};
-
-/* To create a 16 bit packet header checksum we first create an iv
- * dependent on the epoch, the connection ID and the security index.
- */
-void
-rxkad_calc_header_iv(const struct rx_connection *conn,
- const int32_t *sched,
- const des_cblock *in_iv,
- uint32_t *out_iv)
-{
- struct const_header_data h;
- uint32_t *t;
-
- h.epoch = htonl(conn->epoch);
- h.cid = htonl(conn->cid & RX_CIDMASK);
- h.zero = 0;
- h.security_index = htonl(conn->securityIndex);
-
- t = (uint32_t *)in_iv; /* memcpy(out_iv, in_iv, 8); */
- out_iv[0] = t[0];
- out_iv[1] = t[1];
- fc_cbc_encrypt(&h, &h, sizeof(h), sched, out_iv, ENCRYPT);
- /* Extract last 8 bytes as iv */
- assert(out_iv[0] == h.zero);
- /* out_iv[0] = h.zero; */
- out_iv[1] = h.security_index;
-}
-
-/* Make a 16 bit header checksum dependent on call number, channel
- * number and packet sequence number. In addition, the checksum is
- * indirectly dependent (via the iv) on epoch, connection ID and
- * security index.
- */
-static
-int
-rxkad_cksum_header(const struct rx_packet *packet,
- const int32_t *sched,
- const unsigned int *iv)
-{
- struct variable_header_data h;
- uint32_t t;
-
- /* Collect selected packet fields */
- h.call_number = htonl(packet->header.callNumber);
- t = ((packet->header.cid & RX_CHANNELMASK) << (32 - RX_CIDSHIFT))
- | ((packet->header.seq & 0x3fffffff));
- h.channel_and_seq = htonl(t);
-
- /* Encrypt selected fields (this is hand rolled CBC mode) */
- h.call_number ^= iv[0];
- h.channel_and_seq ^= iv[1];
- fc_ecb_encrypt(&h, &h, sched, ENCRYPT);
-
- /* Select 16 bits that are now dependent on all selected packet fields */
- t = (ntohl(h.channel_and_seq) >> 16) & 0xffff;
- if (t != 0)
- return t;
- else
- return 1; /* No checksum is 0 */
-}
-
-/* Checksum a rxkad_response, this checksum is buried within the
- * encrypted part of the response but covers the entire response. */
-uint32_t
-rxkad_cksum_response(rxkad_response *r)
-{
- u_char *t;
- uint32_t cksum = 1000003;
-
- for (t = (u_char *)r; t < (u_char*)(r + 1); t++)
- cksum = *t + cksum * 0x10204081;
-
- return htonl(cksum);
-}
-
-int
-rxkad_prepare_packet(struct rx_packet *pkt,
- struct rx_connection *con,
- int level,
- key_stuff *k,
- end_stuff *e)
-{
- u_int len = rx_GetDataSize(pkt);
-
- /* Checksum header */
- rx_SetPacketCksum(pkt, rxkad_cksum_header(pkt, k->keysched, e->header_iv));
-
- e->packetsSent++;
- e->bytesSent += len;
-
- if (level != rxkad_clear)
- {
- uint32_t *data = (uint32_t *) rx_DataOf(pkt);
- uint32_t t;
- int32_t code = 0;
-
- assert(pkt->wirevec[1].iov_len >= 4);
-
- /* First 4 bytes of security header, includes encrypted length */
- t = pkt->header.seq ^ pkt->header.callNumber;
- t <<= 16;
- t |= len; /* Extracted on receiving side */
- data[0] = htonl(t);
-
- switch (level) {
- case rxkad_auth:
- len += rx_GetSecurityHeaderSize(con); /* Extended pkt len */
- /* Extend packet length so that we can encrypt the first 8 bytes */
- if (pkt->wirevec[1].iov_len < 8)
- {
- int diff = 8 - pkt->wirevec[1].iov_len;
- pkt->wirevec[1].iov_len += diff;
- len += diff;
- }
- rx_SetDataSize(pkt, len); /* Set extended packet length */
-
- /* Encrypt security header (4 bytes) and the next 4 bytes */
- assert(pkt->wirevec[1].iov_len >= 8);
- fc_ecb_encrypt(data, data, k->keysched, ENCRYPT);
- break;
-
- case rxkad_crypt:
- len += rx_GetSecurityHeaderSize(con); /* Extended pkt len */
- /* Round up to 8 byte boundary for encryption to work */
- if (len % 8)
- {
- int diff = 8 - (len % 8);
- rxi_RoundUpPacket(pkt, diff);
- len += diff;
- }
- rx_SetDataSize(pkt, len); /* Set extended packet length */
-
- assert((len % 8) == 0);
- code = rxkad_EncryptPacket(con, k->keysched,(uint32_t*)k->key, len,pkt);
- break;
-
- default:
- assert(0);
- }
-
- return code;
- }
- return 0;
-}
-
-int
-rxkad_check_packet(struct rx_packet *pkt,
- struct rx_connection *con,
- int level,
- key_stuff *k,
- end_stuff *e)
-{
- u_int xlen = rx_GetDataSize(pkt); /* Extended packet length */
-
- if (rx_GetPacketCksum(pkt)
- != rxkad_cksum_header(pkt, k->keysched, e->header_iv))
- return RXKADSEALEDINCON;
-
- e->packetsReceived++;
-
- if (level == rxkad_clear)
- {
- e->bytesReceived += xlen; /* Same as real length */
- }
- else
- {
- u_int len; /* Real packet length */
- uint32_t *data = (uint32_t *) rx_DataOf(pkt);
- uint32_t t;
- int32_t code;
-
- switch (level) {
- case rxkad_auth:
- assert(rx_Contiguous(pkt) >= 8);
- fc_ecb_encrypt(data, data, k->keysched, DECRYPT);
- break;
-
- case rxkad_crypt:
- code = rxkad_DecryptPacket(con, k->keysched,(uint32_t*)k->key, xlen, pkt);
- if (code)
- return code;
- break;
-
- default:
- assert(0);
- }
-
- assert(rx_Contiguous(pkt) >= 4);
-
- t = ntohl(data[0]);
- len = t & 0xffff; /* Extract real length */
- t >>= 16;
- if (t != ((pkt->header.seq ^ pkt->header.callNumber) & 0xffff))
- return RXKADSEALEDINCON;
-
-#define TBYTES 15
- /* The packet is extended with 0 - 7 bytes to a chipher block
- * boundary. This is however not true with the Transarc
- * implementation, for unknown reasons it sometimes extendeds
- * the packet with anything up to TBYTES. */
- if (len > xlen)
- return RXKADSEALEDINCON;
- if (xlen > len + TBYTES)
- return RXKADSEALEDINCON;
-
- e->bytesReceived += len;
- rx_SetDataSize(pkt, len); /* Set real packet length */
- return 0;
- }
- return 0;
-}
diff --git a/usr.sbin/afs/src/rxkad/rxk_serv.c b/usr.sbin/afs/src/rxkad/rxk_serv.c
deleted file mode 100644
index d3eef933380..00000000000
--- a/usr.sbin/afs/src/rxkad/rxk_serv.c
+++ /dev/null
@@ -1,563 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "rxkad_locl.h"
-
-#if defined(KRB5)
-#include <krb5.h>
-#endif
-
-RCSID("$arla: rxk_serv.c,v 1.11 2003/06/11 15:24:34 lha Exp $");
-
-/* Security object specific server data */
-typedef struct rxkad_serv_class {
- struct rx_securityClass klass;
- rxkad_level min_level;
- void *appl_data;
- int (*get_key)(void *appl_data, int kvno, des_cblock *key);
- int (*user_ok)(char *name, char *inst, char *realm, int kvno);
-} rxkad_serv_class;
-
-static
-int
-server_NewConnection(struct rx_securityClass *obj, struct rx_connection *con)
-{
- assert(con->securityData == 0);
- obj->refCount++;
- con->securityData = (char *) osi_Alloc(sizeof(serv_con_data));
- memset(con->securityData, 0x0, sizeof(serv_con_data));
- return 0;
-}
-
-static
-int
-server_Close(struct rx_securityClass *obj)
-{
- obj->refCount--;
- if (obj->refCount <= 0)
- osi_Free(obj, sizeof(rxkad_serv_class));
- return 0;
-}
-
-static
-int
-server_DestroyConnection(struct rx_securityClass *obj,
- struct rx_connection *con)
-{
- serv_con_data *cdat = (serv_con_data *)con->securityData;
-
- if (cdat)
- {
- if (cdat->user)
- osi_Free(cdat->user, sizeof(krb_principal));
- osi_Free(cdat, sizeof(serv_con_data));
- }
- return server_Close(obj);
-}
-
-/*
- * Check whether a connection authenticated properly.
- * Zero is good (authentication succeeded).
- */
-static
-int
-server_CheckAuthentication(struct rx_securityClass *obj,
- struct rx_connection *con)
-{
- serv_con_data *cdat = (serv_con_data *) con->securityData;
-
- if (cdat)
- return !cdat->authenticated;
- else
- return RXKADNOAUTH;
-}
-
-/*
- * Select a nonce for later use.
- */
-static
-int
-server_CreateChallenge(struct rx_securityClass *obj_,
- struct rx_connection *con)
-{
- rxkad_serv_class *obj = (rxkad_serv_class *) obj_;
- serv_con_data *cdat = (serv_con_data *) con->securityData;
- union {
- uint32_t rnd[2];
- des_cblock k;
- } u;
-
- /* Any good random numbers will do, no real need to use
- * cryptographic techniques here */
- des_random_key(&u.k);
- cdat->nonce = u.rnd[0] ^ u.rnd[1];
- cdat->authenticated = 0;
- cdat->cur_level = obj->min_level;
- return 0;
-}
-
-/*
- * Wrap the nonce in a challenge packet.
- */
-static
-int
-server_GetChallenge(const struct rx_securityClass *obj,
- const struct rx_connection *con,
- struct rx_packet *pkt)
-{
- serv_con_data *cdat = (serv_con_data *) con->securityData;
- rxkad_challenge c;
-
- /* Make challenge */
- c.version = htonl(RXKAD_VERSION);
- c.nonce = htonl(cdat->nonce);
- c.min_level = htonl((int32_t)cdat->cur_level);
- c.unused = 0; /* Use this to hint client we understand krb5 tickets??? */
-
- /* Stuff into packet */
- if (rx_SlowWritePacket(pkt, 0, sizeof(c), &c) != sizeof(c))
- return RXKADPACKETSHORT;
- rx_SetDataSize(pkt, sizeof(c));
- return 0;
-}
-
-static
-int
-decode_krb5_ticket(rxkad_serv_class *obj,
- int serv_kvno,
- char *ticket,
- int32_t ticket_len,
- /* OUT parms */
- des_cblock session_key,
- uint32_t *expires,
- krb_principal *p)
-{
-#if !defined(KRB5)
- return RXKADBADTICKET;
-#else
- des_cblock serv_key; /* Service's secret key */
- krb5_keyblock key; /* Uses serv_key above */
- int code;
- size_t siz;
-
- Ticket t5; /* Must free */
- EncTicketPart decr_part; /* Must free */
- krb5_context context; /* Must free */
- krb5_data plain; /* Must free */
-
- memset(&t5, 0x0, sizeof(t5));
- memset(&decr_part, 0x0, sizeof(decr_part));
- krb5_init_context(&context);
- krb5_data_zero(&plain);
-
- assert(serv_kvno == RXKAD_TKT_TYPE_KERBEROS_V5);
-
- code = decode_Ticket(ticket, ticket_len, &t5, &siz);
- if (code != 0)
- goto bad_ticket;
-
- /* Find the real service key version number */
- serv_kvno = t5.tkt_vno;
-
- /* Check that the key type really fit into 8 bytes */
- switch (t5.enc_part.etype) {
- case ETYPE_DES_CBC_CRC:
- case ETYPE_DES_CBC_MD4:
- case ETYPE_DES_CBC_MD5:
- key.keytype = KEYTYPE_DES;
- key.keyvalue.length = 8;
- key.keyvalue.data = serv_key;
- break;
- default:
- goto unknown_key;
- }
-
- /* Get the service key. We have to assume that the key type is of
- * size 8 bytes or else we can't store service keys for both krb4
- * and krb5 in the same way in /usr/afs/etc/KeyFile.
- */
- code = (*obj->get_key)(obj->appl_data, serv_kvno, &serv_key);
- if (code)
- goto unknown_key;
-
- /* Decrypt ticket */
- code = krb5_decrypt(context,
- t5.enc_part.cipher.data,
- t5.enc_part.cipher.length,
- t5.enc_part.etype,
- &key,
- &plain);
- if (code != 0)
- goto bad_ticket;
-
- /* Decode ticket */
- code = decode_EncTicketPart(plain.data, plain.length, &decr_part, &siz);
- if (code != 0)
- goto bad_ticket;
-
- /* Check that the key type really fit into 8 bytes */
- switch (decr_part.key.etype) {
- case ETYPE_DES_CBC_CRC:
- case ETYPE_DES_CBC_MD4:
- case ETYPE_DES_CBC_MD5:
- break;
- default:
- goto unknown_key;
- }
-
- /* Extract realm and principal */
- memset(p, 0x0, sizeof(p));
- strncpy(p->realm, decr_part.crealm, REALM_SZ - 1);
- switch (decr_part.cname.name_string.len) {
- case 2:
- strncpy(p->instance, decr_part.cname.name_string.val[1], ANAME_SZ - 1);
- case 1:
- strncpy(p->name, decr_part.cname.name_string.val[0], ANAME_SZ - 1);
- break;
- default:
- goto bad_ticket;
- }
-
- /* Extract session key */
- memcpy(session_key, decr_part.key.keyvalue.data, 8);
-
- /* Check lifetimes and host addresses, flags etc */
- {
- time_t now = time(0); /* Use fast time package instead??? */
- time_t start = decr_part.authtime;
- if (decr_part.starttime)
- start = *decr_part.starttime;
- if (start - now > context->max_skew || decr_part.flags.invalid)
- goto no_auth;
- if (now > decr_part.endtime)
- goto tkt_expired;
- *expires = decr_part.endtime;
- }
-
-#if 0
- /* Check host addresses */
-#endif
-
-cleanup:
- free_Ticket(&t5);
- free_EncTicketPart(&decr_part);
- krb5_free_context(context);
- krb5_data_free(&plain);
- return code;
-
-unknown_key:
- code = RXKADUNKNOWNKEY;
- goto cleanup;
-no_auth:
- code = RXKADNOAUTH;
- goto cleanup;
-tkt_expired:
- code = RXKADEXPIRED;
- goto cleanup;
-bad_ticket:
- code = RXKADBADTICKET;
- goto cleanup;
-#endif /* KRB5 */
-}
-
-static
-int
-decode_krb4_ticket(rxkad_serv_class *obj,
- int serv_kvno,
- char *ticket,
- int32_t ticket_len,
- /* OUT parms */
- des_cblock session_key,
- uint32_t *expires,
- krb_principal *p)
-{
- u_char kflags;
- int klife;
- uint32_t start;
- uint32_t paddress;
- char sname[SNAME_SZ], sinstance[INST_SZ];
- KTEXT_ST tkt;
- des_cblock serv_key; /* Service's secret key */
- des_key_schedule serv_sched; /* Service's schedule */
-
- /* First get service key */
- int code = (*obj->get_key)(obj->appl_data, serv_kvno, &serv_key);
- if (code)
- return RXKADUNKNOWNKEY;
-
- des_key_sched(&serv_key, serv_sched);
- tkt.length = ticket_len;
- memcpy(tkt.dat, ticket, ticket_len);
- code = decomp_ticket(&tkt, &kflags,
- p->name, p->instance, p->realm, &paddress,
- session_key, &klife, &start,
- sname, sinstance,
- &serv_key, serv_sched);
- if (code != KSUCCESS)
- return RXKADBADTICKET;
-
-#if 0
- if (paddress != ntohl(con->peer->host))
- return RXKADBADTICKET;
-#endif
-
- {
- time_t end = krb_life_to_time(start, klife);
- time_t now = time(0);
- if (start > CLOCK_SKEW) /* Transarc sends 0 as start if localauth */
- start -= CLOCK_SKEW;
- if (now < start)
- return RXKADNOAUTH;
- else if (now > end)
- return RXKADEXPIRED;
- *expires = end;
- }
- return 0; /* Success */
-}
-
-/*
- * Process a response to a challange.
- */
-static
-int
-server_CheckResponse(struct rx_securityClass *obj_,
- struct rx_connection *con,
- struct rx_packet *pkt)
-{
- rxkad_serv_class *obj = (rxkad_serv_class *) obj_;
- serv_con_data *cdat = (serv_con_data *) con->securityData;
-
- int serv_kvno; /* Service's kvno we used */
- int32_t ticket_len;
- char ticket[MAXKRB5TICKETLEN];
- int code;
- rxkad_response r;
- krb_principal p;
- uint32_t cksum;
-
- if (rx_SlowReadPacket(pkt, 0, sizeof(r), &r) != sizeof(r))
- return RXKADPACKETSHORT;
-
- serv_kvno = ntohl(r.kvno);
- ticket_len = ntohl(r.ticket_len);
-
- if (ticket_len > MAXKRB5TICKETLEN)
- return RXKADTICKETLEN;
-
- if (rx_SlowReadPacket(pkt, sizeof(r), ticket_len, ticket) != ticket_len)
- return RXKADPACKETSHORT;
-
- /* Disassemble kerberos ticket */
- if (serv_kvno == RXKAD_TKT_TYPE_KERBEROS_V5)
- code = decode_krb5_ticket(obj, serv_kvno, ticket, ticket_len,
- cdat->k.key, &cdat->expires, &p);
- else
- code = decode_krb4_ticket(obj, serv_kvno, ticket, ticket_len,
- cdat->k.key, &cdat->expires, &p);
- if (code != 0)
- return code;
-
- fc_keysched(cdat->k.key, cdat->k.keysched);
-
- /* Unseal r.encrypted */
- fc_cbc_enc2(&r.encrypted, &r.encrypted, sizeof(r.encrypted),
- cdat->k.keysched, (uint32_t*)cdat->k.key, DECRYPT);
-
- /* Verify response integrity */
- cksum = r.encrypted.cksum;
- r.encrypted.cksum = 0;
- if (r.encrypted.epoch != ntohl(con->epoch)
- || r.encrypted.cid != ntohl(con->cid & RX_CIDMASK)
- || r.encrypted.security_index != ntohl(con->securityIndex)
- || cksum != rxkad_cksum_response(&r))
- return RXKADSEALEDINCON;
- {
- int i;
- for (i = 0; i < RX_MAXCALLS; i++)
- {
- r.encrypted.call_numbers[i] = ntohl(r.encrypted.call_numbers[i]);
- if (r.encrypted.call_numbers[i] < 0)
- return RXKADSEALEDINCON;
- }
- }
-
- if (ntohl(r.encrypted.inc_nonce) != cdat->nonce+1)
- return RXKADOUTOFSEQUENCE;
-
- {
- int level = ntohl(r.encrypted.level);
- if ((level < cdat->cur_level) || (level > rxkad_crypt))
- return RXKADLEVELFAIL;
- cdat->cur_level = level;
- /* We don't use trailers but the transarc implementation breaks if
- * we don't set the trailer size, packets get to large */
- if (level == rxkad_auth)
- {
- rx_SetSecurityHeaderSize(con, 4);
- rx_SetSecurityMaxTrailerSize(con, 4);
- }
- else if (level == rxkad_crypt)
- {
- rx_SetSecurityHeaderSize(con, 8);
- rx_SetSecurityMaxTrailerSize(con, 8);
- }
- }
-
- rxi_SetCallNumberVector(con, r.encrypted.call_numbers);
-
- rxkad_calc_header_iv(con, cdat->k.keysched,
- (const des_cblock *)&cdat->k.key, cdat->e.header_iv);
- cdat->authenticated = 1;
-
- if (obj->user_ok)
- {
- code = obj->user_ok(p.name, p.instance, p.realm, serv_kvno);
- if (code)
- return RXKADNOAUTH;
- }
- else
- {
- krb_principal *user = (krb_principal *) osi_Alloc(sizeof(krb_principal));
- *user = p;
- cdat->user = user;
- }
- return 0;
-}
-
-/*
- * Checksum and/or encrypt packet
- */
-static
-int
-server_PreparePacket(struct rx_securityClass *obj_,
- struct rx_call *call,
- struct rx_packet *pkt)
-{
- struct rx_connection *con = rx_ConnectionOf(call);
- serv_con_data *cdat = (serv_con_data *) con->securityData;
- key_stuff *k = &cdat->k;
- end_stuff *e = &cdat->e;
-
- return rxkad_prepare_packet(pkt, con, cdat->cur_level, k, e);
-}
-
-/*
- * Verify checksum and/or decrypt packet.
- */
-static
-int
-server_CheckPacket(struct rx_securityClass *obj_,
- struct rx_call *call,
- struct rx_packet *pkt)
-{
- struct rx_connection *con = rx_ConnectionOf(call);
- serv_con_data *cdat = (serv_con_data *) con->securityData;
- key_stuff *k = &cdat->k;
- end_stuff *e = &cdat->e;
-
- if (time(0) > cdat->expires) /* Use fast time package instead??? */
- return RXKADEXPIRED;
-
- return rxkad_check_packet(pkt, con, cdat->cur_level, k, e);
-}
-
-static
-int
-server_GetStats(const struct rx_securityClass *obj_,
- const struct rx_connection *con,
- struct rx_securityObjectStats *st)
-{
- rxkad_serv_class *obj = (rxkad_serv_class *) obj_;
- serv_con_data *cdat = (serv_con_data *) con->securityData;
-
- st->type = rxkad_disipline;
- st->level = obj->min_level;
- st->flags = rxkad_checksummed;
- if (cdat == 0)
- st->flags |= rxkad_unallocated;
- {
- st->bytesReceived = cdat->e.bytesReceived;
- st->packetsReceived = cdat->e.packetsReceived;
- st->bytesSent = cdat->e.bytesSent;
- st->packetsSent = cdat->e.packetsSent;
- st->expires = cdat->expires;
- st->level = cdat->cur_level;
- if (cdat->authenticated)
- st->flags |= rxkad_authenticated;
- }
- return 0;
-}
-
-static struct rx_securityOps server_ops = {
- server_Close,
- server_NewConnection,
- server_PreparePacket,
- 0,
- server_CheckAuthentication,
- server_CreateChallenge,
- server_GetChallenge,
- 0,
- server_CheckResponse,
- server_CheckPacket,
- server_DestroyConnection,
- server_GetStats,
-};
-
-struct rx_securityClass *
-rxkad_NewServerSecurityObject(/*rxkad_level*/ int min_level,
- void *appl_data,
- int (*get_key)(void *appl_data,
- int kvno,
- void *opaque_key),
- int (*user_ok)(char *name,
- char *inst,
- char *realm,
- int kvno))
-{
- rxkad_serv_class *obj;
-
- if (!get_key)
- return 0;
-
- obj = (rxkad_serv_class *) osi_Alloc(sizeof(rxkad_serv_class));
- obj->klass.refCount = 1;
- obj->klass.ops = &server_ops;
- obj->klass.privateData = (char *) obj;
-
- obj->min_level = min_level;
- obj->appl_data = appl_data;
- obj->get_key = (void *)get_key;
- obj->user_ok = user_ok;
-
- return &obj->klass;
-}
diff --git a/usr.sbin/afs/src/rxkad/rxkad.h b/usr.sbin/afs/src/rxkad/rxkad.h
deleted file mode 100644
index 5be5e965d54..00000000000
--- a/usr.sbin/afs/src/rxkad/rxkad.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/* -*- C -*- */
-
-/*
- * Copyright (c) 1995 - 2001, 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* @(#)$arla: rxkad.h,v 1.11 2003/06/10 16:15:39 lha Exp $ */
-
-#ifndef __RXKAD_H
-#define __RXKAD_H
-
-#ifdef HAVE_STDS_H
-#include <stds.h>
-#endif
-
-/* Krb4 tickets can't have a key version number of 256. This is used
- * as a magic kvno to indicate that this is really a krb5 ticket. The
- * real kvno can be retrieved from the cleartext portion of the
- * ticket. For more info see the Transarc header file rxkad.h.
- */
-#define RXKAD_TKT_TYPE_KERBEROS_V5 256
-
-/* Is this really large enough for a krb5 ticket? */
-#define MAXKRB5TICKETLEN 1024
-#define MAXKRB4TICKETLEN 1024
-
-typedef char rxkad_level;
-#define rxkad_clear 0 /* checksum some selected header fields */
-#define rxkad_auth 1 /* rxkad_clear + protected packet length */
-#define rxkad_crypt 2 /* rxkad_crypt + encrypt packet payload */
-extern int rxkad_min_level; /* enforce min level at client end */
-
-extern int rxkad_EpochWasSet;
-
-#ifndef __P
-#define __P(x) x
-#endif
-
-struct rx_connection;
-
-int32_t rxkad_GetServerInfo __P((struct rx_connection *con,
- rxkad_level *level,
- uint32_t *expiration,
- char *name,
- char *instance,
- char *cell,
- int32_t *kvno));
-
-struct rx_securityClass *
-rxkad_NewServerSecurityObject __P((/*rxkad_level*/ int min_level,
- void *appl_data,
- int (*get_key)(void *appl_data,
- int kvno,
- void *key),
- int (*user_ok)(char *name,
- char *inst,
- char *realm,
- int kvno)));
-
-struct rx_securityClass *
-rxkad_NewClientSecurityObject __P((/*rxkad_level*/ int level,
- void *sessionkey,
- int32_t kvno,
- int ticketLen,
- char *ticket));
-
-#define RXKADINCONSISTENCY (19270400L)
-#define RXKADPACKETSHORT (19270401L)
-#define RXKADLEVELFAIL (19270402L)
-#define RXKADTICKETLEN (19270403L)
-#define RXKADOUTOFSEQUENCE (19270404L)
-#define RXKADNOAUTH (19270405L)
-#define RXKADBADKEY (19270406L)
-#define RXKADBADTICKET (19270407L)
-#define RXKADUNKNOWNKEY (19270408L)
-#define RXKADEXPIRED (19270409L)
-#define RXKADSEALEDINCON (19270410L)
-#define RXKADDATALEN (19270411L)
-#define RXKADILLEGALLEVEL (19270412L)
-
-/* The rest is backwards compatibility stuff that we don't use! */
-#define MAXKTCTICKETLIFETIME (30*24*60*60)
-#define MINKTCTICKETLEN (32)
-#define MAXKTCTICKETLEN (344)
-#define MAXKTCNAMELEN (64)
-#define MAXKTCREALMLEN (64)
-
-/*
-#define MAXKTCNAMELEN ANAME_SZ
-#define MAXKTCREALMLEN REALM_SZ
-*/
-
-#ifndef CLOCK_SKEW
-#define CLOCK_SKEW (5*60)
-#endif
-
-#define KTC_TIME_UNCERTAINTY (CLOCK_SKEW)
-
-/*
-#define KTC_TIME_UNCERTAINTY (60*15)
-*/
-
-struct ktc_encryptionKey {
- char data[8];
-};
-
-struct ktc_principal {
- char name[MAXKTCNAMELEN];
- char instance[MAXKTCNAMELEN];
- char cell[MAXKTCREALMLEN];
-};
-
-uint32_t life_to_time __P((uint32_t start, int life_));
-
-int time_to_life __P((uint32_t start, uint32_t end));
-
-int tkt_CheckTimes __P((int32_t begin, int32_t end, int32_t now));
-
-int
-tkt_MakeTicket __P((char *ticket,
- int *ticketLen,
- struct ktc_encryptionKey *key,
- char *name, char *inst, char *cell,
- uint32_t start, uint32_t end,
- struct ktc_encryptionKey *sessionKey,
- uint32_t host,
- char *sname, char *sinst));
-
-int
-tkt_DecodeTicket __P((char *asecret,
- int32_t ticketLen,
- struct ktc_encryptionKey *key,
- char *name,
- char *inst,
- char *cell,
- char *sessionKey,
- int32_t *host,
- int32_t *start,
- int32_t *end));
-
-#endif /* __RXKAD_H */
diff --git a/usr.sbin/afs/src/rxkad/rxkad_locl.h b/usr.sbin/afs/src/rxkad/rxkad_locl.h
deleted file mode 100644
index 6c25b4ce6dd..00000000000
--- a/usr.sbin/afs/src/rxkad/rxkad_locl.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* @(#)$arla: rxkad_locl.h,v 1.14 2003/06/12 05:32:16 lha Exp $ */
-
-#ifndef __RXKAD_LOCL_H
-#define __RXKAD_LOCL_H
-
-/* $arla: rxkad_locl.h,v 1.14 2003/06/12 05:32:16 lha Exp $ */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-
-#include <sys/types.h>
-#include <netinet/in.h>
-
-#ifdef NDEBUG
-#ifndef assert
-#define assert(e) ((void)0)
-#endif
-#else
-#ifndef assert
-#define assert(e) ((e) ? (void)0 : (void)osi_Panic("assert(%s) failed: file %s, line %d\n", #e, __FILE__, __LINE__, #e))
-#endif
-#endif
-
-#ifdef HAVE_OPENSSL
-#include <openssl/des.h>
-#else
-#include <des.h>
-#endif
-#ifdef HAVE_KRB4
-#include <krb.h>
-#endif /* HAVE_KRB4 */
-
-#undef RCSID
-#include <rx/rx.h>
-#undef RCSID
-#define RCSID(msg) \
-static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
-
-extern int rx_epoch, rx_nextCid;
-
-#include "rxkad.h"
-
-#define rxkad_disipline 3
-
-#define rxkad_unallocated 1
-#define rxkad_authenticated 2
-#define rxkad_expired 4
-#define rxkad_checksummed 8
-
-#define ROUNDS 16
-
-int fc_keysched(const void *key_, int32_t sched[ROUNDS]);
-
-/* In_ and out_ MUST be uint32_t aligned */
-int fc_ecb_encrypt(const void *in_, void *out_,
- const int32_t sched[ROUNDS], int encrypt);
-
-/* In_ and out_ MUST be uint32_t aligned */
-int fc_cbc_encrypt(const void *in_, void *out_, int32_t length,
- const int32_t sched[ROUNDS], uint32_t iv[2],
- int encrypt);
-
-int rxkad_EncryptPacket(const void *rx_connection_not_used,
- const int32_t sched[ROUNDS], const uint32_t iv[2],
- int len, struct rx_packet *packet);
-
-int rxkad_DecryptPacket(const void *rx_connection_not_used,
- const int32_t sched[ROUNDS], const uint32_t iv[2],
- int len, struct rx_packet *packet);
-
-#ifdef __GNUC__
-static inline
-void
-fc_cbc_enc2(const void *in, void *out, int32_t length, const int32_t sched[ROUNDS],
- const uint32_t iv_[2], int encrypt)
-{
- uint32_t iv[2];
- iv[0] = iv_[0];
- iv[1] = iv_[1];
- fc_cbc_encrypt(in, out, length, sched, iv, encrypt);
-}
-#else
-#define fc_cbc_enc2(in, out, length, sched, iv_, encrypt) \
-{ uint32_t _iv_[2]; uint32_t *_tmp_ = (iv_); \
- memcpy(_iv_, _tmp_, 8); \
- fc_cbc_encrypt((in), (out), (length), (sched), (_iv_), (encrypt)); }
-#endif
-
-#define RXKAD_VERSION 2
-
-/* Version 2 challenge format */
-typedef struct rxkad_challenge {
- int32_t version;
- int32_t nonce;
- int32_t min_level;
- int32_t unused;
-} rxkad_challenge;
-
-/* To protect the client from being used as an oracle the response
- * contains connection specific information. */
-typedef struct rxkad_response {
- int32_t version;
- int32_t unused;
- struct {
- int32_t epoch;
- int32_t cid;
- uint32_t cksum; /* Cksum of this response */
- int32_t security_index;
- int32_t call_numbers[RX_MAXCALLS];
- int32_t inc_nonce;
- int32_t level;
- } encrypted;
- int32_t kvno;
- int32_t ticket_len;
- /* u_char the_ticket[ticket_len]; */
-} rxkad_response;
-
-typedef struct key_stuff {
- int32_t keysched[ROUNDS];
- des_cblock key;
-} key_stuff;
-
-typedef struct end_stuff {
- uint32_t header_iv[2];
- uint32_t bytesReceived, packetsReceived, bytesSent, packetsSent;
-} end_stuff;
-
-uint32_t
-rxkad_cksum_response(rxkad_response *r);
-
-void
-rxkad_calc_header_iv(const struct rx_connection *conn,
- const int32_t sched[ROUNDS],
- const des_cblock *in_iv,
- uint32_t out_iv[2]);
-
-int
-rxkad_prepare_packet(struct rx_packet *pkt, struct rx_connection *con,
- int level, key_stuff *k, end_stuff *e);
-
-int
-rxkad_check_packet(struct rx_packet *pkt, struct rx_connection *con,
- int level, key_stuff *k, end_stuff *e);
-
-#ifdef HAVE_KRB4
-
-/* Per connection specific server data */
-typedef struct serv_con_data {
- end_stuff e;
- key_stuff k;
- uint32_t expires;
- int32_t nonce;
- krb_principal *user;
- rxkad_level cur_level; /* Starts at min_level and can only increase */
- char authenticated;
-} serv_con_data;
-
-#endif
-
-#endif /* __RXKAD_LOCL_H */
diff --git a/usr.sbin/afs/src/tests/Makefile.in b/usr.sbin/afs/src/tests/Makefile.in
deleted file mode 100644
index c76b83f289b..00000000000
--- a/usr.sbin/afs/src/tests/Makefile.in
+++ /dev/null
@@ -1,264 +0,0 @@
-# $KTH: Makefile.in,v 1.75.2.2 2001/05/17 07:39:13 lha Exp $
-
-srcdir = @srcdir@
-top_builddir = ..
-VPATH = @srcdir@
-
-SHELL = /bin/sh
-
-CC = @CC@
-CFLAGS = @CFLAGS@
-REALCFLAGS = -I$(srcdir)/.. -I../include -I$(srcdir)/../include \
- @KRB4_INC_FLAGS@ \
- $(CFLAGS) -I../rxdef -I$(srcdir)/../appl/lib @INC_roken@
-CPPFLAGS = @CPPFLAGS@
-DEFS = @DEFS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIB_roken@ @LIBS@
-KAFS_LIBS = @AFS_EXTRA_LIBS@ @KAFS_LIBS@
-KRB_LIBS = @KRB4_LIB_FLAGS@
-APPL_LIB = -L../appl/lib -larlalib -L../lib/ko -lko
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-
-TEST_PROGRAMS = write-ro-file hello-world read-vs-mmap read-vs-mmap2 \
- mmap-and-read large-dir large-dir2 large-dir3 mountpoint \
- test-setgroups test-setpag hardlink1 hardlink2 mkdir2 \
- create-files create-symlinks create-dirs dup2-and-unlog \
- readdir-vs-lstat read-write ga-test create-remove \
- symlink echo-n test-parallel1 test-parallel2 create-stat \
- kill-softly kill-softer rm-rf apwd exit-wo-close \
- mmap-vs-read mmap-vs-read2 strange-characters-c pine \
- append-over-page write-ucc utime-dir mmap-shared-write \
- rename5 rename-under-feet write-closed write-closed2 \
- truncate fchmod fhbench make-page utime-file \
- invalidate-file still-there-p mmap-cat
-
-TEST_OBJS = write-ro-file.o read-vs-mmap.o read-vs-mmap2.o \
- mmap-and-read.o large-dir.o large-dir2.o large-dir3.o \
- test-setgroups.o test-setpag.o hardlink1.o hardlink2.o \
- mkdir2.o create-files.o create-symlinks.o create-dirs.o \
- dup2-and-unlog.o readdir-vs-lstat.o read-write.o ga-test.o \
- create-remove.o symlink.o echo-n.o test-parallel1.o \
- test-parallel1.o \
- create-stat.o kill-softly.o kill-softer.o rm-rf.o apwd.o \
- exit-wo-close.o mmap-vs-read.o mmap-vs-read2.o \
- strange-characters-c.o pine.o append-over-page.o \
- write-ucc.o utime-dir.o mmap-shared-write.o rename5.o \
- rename-under-feet.o write-closed.o write-closed2.o \
- truncate.o fchmod.o fhbench.o make-page.o utime-file.o \
- invalidate-file.o still-there-p.o mmap-cat.o
-
-TEST_SRCS = write-ro-file.c read-vs-mmap.c read-vs-mmap2.c \
- mmap-and-read.c large-dir.c large-dir2.c large-dir3.o \
- test-setgroups.c test-setpag.c hardlink1.c hardlink2.c \
- mkdir2.c create-files.c create-symlinks.c create-dirs.c \
- dup2-and-unlog.c readdir-vs-lstat.c read-write.c ga-test.c \
- create-remove.c symlink.c echo-n.c test-parallel1.c \
- test-parallel2.c \ \
- create-stat.c kill-softly.c kill-softer.c rm-rf.c apwd.c \
- exit-wo-close.c mmap-vs-read.c mmap-vs-read2.c \
- strange-characters-c.c pine.c append-over-page.c \
- write-ucc.c utime-dir.c mmap-shared-write.c rename5.c \
- rename-under-feet.c write-closed.c write-closed2.c \
- truncate.c fchmod.c fhbench.c make-page.c utime-file.c \
- invalidate-file.c still-there-p.c mmap-cat.c
-
-all: run-tests $(TEST_PROGRAMS)
-
-run-tests: run-tests.in
- (cd ..; CONFIG_FILES=tests/run-tests CONFIG_HEADERS= $(SHELL) config.status)
- @chmod +x run-tests
-
-write-ro-file: write-ro-file.o
- $(CC) $(LDFLAGS) -o $@ write-ro-file.o $(LIBS)
-
-read-vs-mmap: read-vs-mmap.o
- $(CC) $(LDFLAGS) -o $@ read-vs-mmap.o $(LIBS)
-
-read-vs-mmap2: read-vs-mmap2.o
- $(CC) $(LDFLAGS) -o $@ read-vs-mmap2.o $(LIBS)
-
-mmap-vs-read: mmap-vs-read.o
- $(CC) $(LDFLAGS) -o $@ mmap-vs-read.o $(LIBS)
-
-mmap-vs-read2: mmap-vs-read2.o
- $(CC) $(LDFLAGS) -o $@ mmap-vs-read2.o $(LIBS)
-
-read-write: read-write.o
- $(CC) $(LDFLAGS) -o $@ read-write.o $(LIBS)
-
-mmap-and-read: mmap-and-read.o
- $(CC) $(LDFLAGS) -o $@ mmap-and-read.o $(LIBS)
-
-large-dir: large-dir.o
- $(CC) $(LDFLAGS) -o $@ large-dir.o $(LIBS)
-
-large-dir2: large-dir2.o
- $(CC) $(LDFLAGS) -o $@ large-dir2.o $(LIBS)
-
-large-dir3: large-dir3.o
- $(CC) $(LDFLAGS) -o $@ large-dir3.o $(LIBS)
-
-fchmod: fchmod.o
- $(CC) $(LDFLAGS) -o $@ fchmod.o $(LIBS)
-
-truncate: truncate.o
- $(CC) $(LDFLAGS) -o $@ truncate.o $(LIBS)
-
-make-page: make-page.o
- $(CC) $(LDFLAGS) -o $@ make-page.o $(LIBS)
-
-still-there-p: still-there-p.o
- $(CC) $(LDFLAGS) -o $@ still-there-p.o $(LIBS)
-
-mmap-cat: mmap-cat.o
- $(CC) $(LDFLAGS) -o $@ mmap-cat.o $(APPL_LIB) $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-ga-test: ga-test.o
- $(CC) $(LDFLAGS) -o $@ ga-test.o $(APPL_LIB) $(LIBS)
-
-test-setgroups: test-setgroups.o
- $(CC) $(LDFLAGS) -o $@ test-setgroups.o $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-test-setpag: test-setpag.o
- $(CC) $(LDFLAGS) -o $@ test-setpag.o $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-hardlink1: hardlink1.o
- $(CC) $(LDFLAGS) -o $@ hardlink1.o $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-hardlink2: hardlink2.o
- $(CC) $(LDFLAGS) -o $@ hardlink2.o $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-mkdir2: mkdir2.o
- $(CC) $(LDFLAGS) -o $@ mkdir2.o $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-create-files: create-files.o
- $(CC) $(LDFLAGS) -o $@ create-files.o $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-create-symlinks: create-symlinks.o
- $(CC) $(LDFLAGS) -o $@ create-symlinks.o $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-create-dirs: create-dirs.o
- $(CC) $(LDFLAGS) -o $@ create-dirs.o $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-create-remove: create-remove.o
- $(CC) $(LDFLAGS) -o $@ create-remove.o $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-
-dup2-and-unlog: dup2-and-unlog.o
- $(CC) $(LDFLAGS) -o $@ dup2-and-unlog.o $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-readdir-vs-lstat: readdir-vs-lstat.o
- $(CC) $(LDFLAGS) -o $@ readdir-vs-lstat.o $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-symlink: symlink.o
- $(CC) $(LDFLAGS) -o $@ symlink.o $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-echo-n: echo-n.o
- $(CC) $(LDFLAGS) -o $@ echo-n.o
-
-test-parallel1: test-parallel1.o
- $(CC) $(LDFLAGS) -o $@ test-parallel1.o $(LIBS)
-
-test-parallel2: test-parallel2.o
- $(CC) $(LDFLAGS) -o $@ test-parallel2.o $(LIBS)
-
-create-stat: create-stat.o
- $(CC) $(LDFLAGS) -o $@ create-stat.o $(APPL_LIB) $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-kill-softly: kill-softly.o
- $(CC) $(LDFLAGS) -o $@ kill-softly.o $(APPL_LIB) $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-kill-softer: kill-softer.o
- $(CC) $(LDFLAGS) -o $@ kill-softer.o $(APPL_LIB) $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-rm-rf: rm-rf.o
- $(CC) $(LDFLAGS) -o $@ rm-rf.o $(APPL_LIB) $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-apwd: apwd.o
- $(CC) $(LDFLAGS) -o $@ apwd.o $(APPL_LIB) $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-invalidate-file: invalidate-file.o
- $(CC) $(LDFLAGS) -o $@ invalidate-file.o $(APPL_LIB) $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-exit-wo-close: exit-wo-close.o
- $(CC) $(LDFLAGS) -o $@ exit-wo-close.o $(APPL_LIB) $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-strange-characters-c: strange-characters-c.o
- $(CC) $(LDFLAGS) -o $@ strange-characters-c.o $(KRB_LIBS) $(LIBS)
-
-pine: pine.o
- $(CC) $(LDFLAGS) -o $@ pine.o $(KRB_LIBS) $(LIBS)
-
-append-over-page: append-over-page.o
- $(CC) $(LDFLAGS) -o $@ append-over-page.o $(KRB_LIBS) $(LIBS)
-
-write-ucc: write-ucc.o
- $(CC) $(LDFLAGS) -o $@ write-ucc.o $(KRB_LIBS) $(LIBS)
-
-utime-dir: utime-dir.o
- $(CC) $(LDFLAGS) -o $@ utime-dir.o $(KRB_LIBS) $(LIBS)
-
-utime-file: utime-file.o
- $(CC) $(LDFLAGS) -o $@ utime-file.o $(LIBS)
-
-mmap-shared-write: mmap-shared-write.o
- $(CC) $(LDFLAGS) -o $@ mmap-shared-write.o $(KRB_LIBS) $(LIBS)
-
-rename5: rename5.o
- $(CC) $(LDFLAGS) -o $@ rename5.o $(KRB_LIBS) $(LIBS)
-
-rename-under-feet: rename-under-feet.o
- $(CC) $(LDFLAGS) -o $@ rename-under-feet.o $(KRB_LIBS) $(LIBS)
-
-write-closed: write-closed.o
- $(CC) $(LDFLAGS) -o $@ write-closed.o $(KRB_LIBS) $(LIBS)
-
-write-closed2: write-closed2.o
- $(CC) $(LDFLAGS) -o $@ write-closed2.o $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-fhbench: fhbench.o
- $(CC) $(LDFLAGS) -o $@ fhbench.o $(APPL_LIB) $(KAFS_LIBS) $(KRB_LIBS) $(LIBS)
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $<
-
-hello-world: hello-world.in
- sed -e "s!%CC%!$(CC)!" $(srcdir)/hello-world.in > $@
- chmod +x hello-world
-
-mountpoint: mountpoint.in
- sed -e "s!%bindir%!$(bindir)!" $(srcdir)/mountpoint.in > $@
- chmod +x mountpoint
-
-clean:
- rm -f run-tests $(TEST_PROGRAMS) *.o *~
-
-realclean:
-
-distclean: clean
- rm -f Makefile
-
-mostlyclean:
-
-install:
-
-uninstall:
-
-
-TAGS: $(TEST_SRCS)
- etags $(TEST_SRCS)
-
-check: run-tests $(TEST_PROGRAMS)
- ./run-tests -all
-
-check-fast: run-tests $(TEST_PROGRAMS)
- ./run-tests -all -fast
-
-Makefile: Makefile.in ../config.status
- cd ..; CONFIG_FILES=tests/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-.PHONY: all install clean realclean distclean mostlyclean install uninstall check
diff --git a/usr.sbin/afs/src/tests/append-over-page.c b/usr.sbin/afs/src/tests/append-over-page.c
deleted file mode 100644
index 3f7a9aedd44..00000000000
--- a/usr.sbin/afs/src/tests/append-over-page.c
+++ /dev/null
@@ -1,981 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include <roken.h>
-
-#include <err.h>
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-RCSID("$KTH: append-over-page.c,v 1.3 2000/10/03 00:33:07 lha Exp $");
-
-static char long_buf[] =
-"1000\n"
-"1001\n"
-"1002\n"
-"1003\n"
-"1004\n"
-"1005\n"
-"1006\n"
-"1007\n"
-"1008\n"
-"1009\n"
-"1010\n"
-"1011\n"
-"1012\n"
-"1013\n"
-"1014\n"
-"1015\n"
-"1016\n"
-"1017\n"
-"1018\n"
-"1019\n"
-"1020\n"
-"1021\n"
-"1022\n"
-"1023\n"
-"1024\n"
-"1025\n"
-"1026\n"
-"1027\n"
-"1028\n"
-"1029\n"
-"1030\n"
-"1031\n"
-"1032\n"
-"1033\n"
-"1034\n"
-"1035\n"
-"1036\n"
-"1037\n"
-"1038\n"
-"1039\n"
-"1040\n"
-"1041\n"
-"1042\n"
-"1043\n"
-"1044\n"
-"1045\n"
-"1046\n"
-"1047\n"
-"1048\n"
-"1049\n"
-"1050\n"
-"1051\n"
-"1052\n"
-"1053\n"
-"1054\n"
-"1055\n"
-"1056\n"
-"1057\n"
-"1058\n"
-"1059\n"
-"1060\n"
-"1061\n"
-"1062\n"
-"1063\n"
-"1064\n"
-"1065\n"
-"1066\n"
-"1067\n"
-"1068\n"
-"1069\n"
-"1070\n"
-"1071\n"
-"1072\n"
-"1073\n"
-"1074\n"
-"1075\n"
-"1076\n"
-"1077\n"
-"1078\n"
-"1079\n"
-"1080\n"
-"1081\n"
-"1082\n"
-"1083\n"
-"1084\n"
-"1085\n"
-"1086\n"
-"1087\n"
-"1088\n"
-"1089\n"
-"1090\n"
-"1091\n"
-"1092\n"
-"1093\n"
-"1094\n"
-"1095\n"
-"1096\n"
-"1097\n"
-"1098\n"
-"1099\n"
-"1100\n"
-"1101\n"
-"1102\n"
-"1103\n"
-"1104\n"
-"1105\n"
-"1106\n"
-"1107\n"
-"1108\n"
-"1109\n"
-"1110\n"
-"1111\n"
-"1112\n"
-"1113\n"
-"1114\n"
-"1115\n"
-"1116\n"
-"1117\n"
-"1118\n"
-"1119\n"
-"1120\n"
-"1121\n"
-"1122\n"
-"1123\n"
-"1124\n"
-"1125\n"
-"1126\n"
-"1127\n"
-"1128\n"
-"1129\n"
-"1130\n"
-"1131\n"
-"1132\n"
-"1133\n"
-"1134\n"
-"1135\n"
-"1136\n"
-"1137\n"
-"1138\n"
-"1139\n"
-"1140\n"
-"1141\n"
-"1142\n"
-"1143\n"
-"1144\n"
-"1145\n"
-"1146\n"
-"1147\n"
-"1148\n"
-"1149\n"
-"1150\n"
-"1151\n"
-"1152\n"
-"1153\n"
-"1154\n"
-"1155\n"
-"1156\n"
-"1157\n"
-"1158\n"
-"1159\n"
-"1160\n"
-"1161\n"
-"1162\n"
-"1163\n"
-"1164\n"
-"1165\n"
-"1166\n"
-"1167\n"
-"1168\n"
-"1169\n"
-"1170\n"
-"1171\n"
-"1172\n"
-"1173\n"
-"1174\n"
-"1175\n"
-"1176\n"
-"1177\n"
-"1178\n"
-"1179\n"
-"1180\n"
-"1181\n"
-"1182\n"
-"1183\n"
-"1184\n"
-"1185\n"
-"1186\n"
-"1187\n"
-"1188\n"
-"1189\n"
-"1190\n"
-"1191\n"
-"1192\n"
-"1193\n"
-"1194\n"
-"1195\n"
-"1196\n"
-"1197\n"
-"1198\n"
-"1199\n"
-"1200\n"
-"1201\n"
-"1202\n"
-"1203\n"
-"1204\n"
-"1205\n"
-"1206\n"
-"1207\n"
-"1208\n"
-"1209\n"
-"1210\n"
-"1211\n"
-"1212\n"
-"1213\n"
-"1214\n"
-"1215\n"
-"1216\n"
-"1217\n"
-"1218\n"
-"1219\n"
-"1220\n"
-"1221\n"
-"1222\n"
-"1223\n"
-"1224\n"
-"1225\n"
-"1226\n"
-"1227\n"
-"1228\n"
-"1229\n"
-"1230\n"
-"1231\n"
-"1232\n"
-"1233\n"
-"1234\n"
-"1235\n"
-"1236\n"
-"1237\n"
-"1238\n"
-"1239\n"
-"1240\n"
-"1241\n"
-"1242\n"
-"1243\n"
-"1244\n"
-"1245\n"
-"1246\n"
-"1247\n"
-"1248\n"
-"1249\n"
-"1250\n"
-"1251\n"
-"1252\n"
-"1253\n"
-"1254\n"
-"1255\n"
-"1256\n"
-"1257\n"
-"1258\n"
-"1259\n"
-"1260\n"
-"1261\n"
-"1262\n"
-"1263\n"
-"1264\n"
-"1265\n"
-"1266\n"
-"1267\n"
-"1268\n"
-"1269\n"
-"1270\n"
-"1271\n"
-"1272\n"
-"1273\n"
-"1274\n"
-"1275\n"
-"1276\n"
-"1277\n"
-"1278\n"
-"1279\n"
-"1280\n"
-"1281\n"
-"1282\n"
-"1283\n"
-"1284\n"
-"1285\n"
-"1286\n"
-"1287\n"
-"1288\n"
-"1289\n"
-"1290\n"
-"1291\n"
-"1292\n"
-"1293\n"
-"1294\n"
-"1295\n"
-"1296\n"
-"1297\n"
-"1298\n"
-"1299\n"
-"1300\n"
-"1301\n"
-"1302\n"
-"1303\n"
-"1304\n"
-"1305\n"
-"1306\n"
-"1307\n"
-"1308\n"
-"1309\n"
-"1310\n"
-"1311\n"
-"1312\n"
-"1313\n"
-"1314\n"
-"1315\n"
-"1316\n"
-"1317\n"
-"1318\n"
-"1319\n"
-"1320\n"
-"1321\n"
-"1322\n"
-"1323\n"
-"1324\n"
-"1325\n"
-"1326\n"
-"1327\n"
-"1328\n"
-"1329\n"
-"1330\n"
-"1331\n"
-"1332\n"
-"1333\n"
-"1334\n"
-"1335\n"
-"1336\n"
-"1337\n"
-"1338\n"
-"1339\n"
-"1340\n"
-"1341\n"
-"1342\n"
-"1343\n"
-"1344\n"
-"1345\n"
-"1346\n"
-"1347\n"
-"1348\n"
-"1349\n"
-"1350\n"
-"1351\n"
-"1352\n"
-"1353\n"
-"1354\n"
-"1355\n"
-"1356\n"
-"1357\n"
-"1358\n"
-"1359\n"
-"1360\n"
-"1361\n"
-"1362\n"
-"1363\n"
-"1364\n"
-"1365\n"
-"1366\n"
-"1367\n"
-"1368\n"
-"1369\n"
-"1370\n"
-"1371\n"
-"1372\n"
-"1373\n"
-"1374\n"
-"1375\n"
-"1376\n"
-"1377\n"
-"1378\n"
-"1379\n"
-"1380\n"
-"1381\n"
-"1382\n"
-"1383\n"
-"1384\n"
-"1385\n"
-"1386\n"
-"1387\n"
-"1388\n"
-"1389\n"
-"1390\n"
-"1391\n"
-"1392\n"
-"1393\n"
-"1394\n"
-"1395\n"
-"1396\n"
-"1397\n"
-"1398\n"
-"1399\n"
-"1400\n"
-"1401\n"
-"1402\n"
-"1403\n"
-"1404\n"
-"1405\n"
-"1406\n"
-"1407\n"
-"1408\n"
-"1409\n"
-"1410\n"
-"1411\n"
-"1412\n"
-"1413\n"
-"1414\n"
-"1415\n"
-"1416\n"
-"1417\n"
-"1418\n"
-"1419\n"
-"1420\n"
-"1421\n"
-"1422\n"
-"1423\n"
-"1424\n"
-"1425\n"
-"1426\n"
-"1427\n"
-"1428\n"
-"1429\n"
-"1430\n"
-"1431\n"
-"1432\n"
-"1433\n"
-"1434\n"
-"1435\n"
-"1436\n"
-"1437\n"
-"1438\n"
-"1439\n"
-"1440\n"
-"1441\n"
-"1442\n"
-"1443\n"
-"1444\n"
-"1445\n"
-"1446\n"
-"1447\n"
-"1448\n"
-"1449\n"
-"1450\n"
-"1451\n"
-"1452\n"
-"1453\n"
-"1454\n"
-"1455\n"
-"1456\n"
-"1457\n"
-"1458\n"
-"1459\n"
-"1460\n"
-"1461\n"
-"1462\n"
-"1463\n"
-"1464\n"
-"1465\n"
-"1466\n"
-"1467\n"
-"1468\n"
-"1469\n"
-"1470\n"
-"1471\n"
-"1472\n"
-"1473\n"
-"1474\n"
-"1475\n"
-"1476\n"
-"1477\n"
-"1478\n"
-"1479\n"
-"1480\n"
-"1481\n"
-"1482\n"
-"1483\n"
-"1484\n"
-"1485\n"
-"1486\n"
-"1487\n"
-"1488\n"
-"1489\n"
-"1490\n"
-"1491\n"
-"1492\n"
-"1493\n"
-"1494\n"
-"1495\n"
-"1496\n"
-"1497\n"
-"1498\n"
-"1499\n"
-"1500\n"
-"1501\n"
-"1502\n"
-"1503\n"
-"1504\n"
-"1505\n"
-"1506\n"
-"1507\n"
-"1508\n"
-"1509\n"
-"1510\n"
-"1511\n"
-"1512\n"
-"1513\n"
-"1514\n"
-"1515\n"
-"1516\n"
-"1517\n"
-"1518\n"
-"1519\n"
-"1520\n"
-"1521\n"
-"1522\n"
-"1523\n"
-"1524\n"
-"1525\n"
-"1526\n"
-"1527\n"
-"1528\n"
-"1529\n"
-"1530\n"
-"1531\n"
-"1532\n"
-"1533\n"
-"1534\n"
-"1535\n"
-"1536\n"
-"1537\n"
-"1538\n"
-"1539\n"
-"1540\n"
-"1541\n"
-"1542\n"
-"1543\n"
-"1544\n"
-"1545\n"
-"1546\n"
-"1547\n"
-"1548\n"
-"1549\n"
-"1550\n"
-"1551\n"
-"1552\n"
-"1553\n"
-"1554\n"
-"1555\n"
-"1556\n"
-"1557\n"
-"1558\n"
-"1559\n"
-"1560\n"
-"1561\n"
-"1562\n"
-"1563\n"
-"1564\n"
-"1565\n"
-"1566\n"
-"1567\n"
-"1568\n"
-"1569\n"
-"1570\n"
-"1571\n"
-"1572\n"
-"1573\n"
-"1574\n"
-"1575\n"
-"1576\n"
-"1577\n"
-"1578\n"
-"1579\n"
-"1580\n"
-"1581\n"
-"1582\n"
-"1583\n"
-"1584\n"
-"1585\n"
-"1586\n"
-"1587\n"
-"1588\n"
-"1589\n"
-"1590\n"
-"1591\n"
-"1592\n"
-"1593\n"
-"1594\n"
-"1595\n"
-"1596\n"
-"1597\n"
-"1598\n"
-"1599\n"
-"1600\n"
-"1601\n"
-"1602\n"
-"1603\n"
-"1604\n"
-"1605\n"
-"1606\n"
-"1607\n"
-"1608\n"
-"1609\n"
-"1610\n"
-"1611\n"
-"1612\n"
-"1613\n"
-"1614\n"
-"1615\n"
-"1616\n"
-"1617\n"
-"1618\n"
-"1619\n"
-"1620\n"
-"1621\n"
-"1622\n"
-"1623\n"
-"1624\n"
-"1625\n"
-"1626\n"
-"1627\n"
-"1628\n"
-"1629\n"
-"1630\n"
-"1631\n"
-"1632\n"
-"1633\n"
-"1634\n"
-"1635\n"
-"1636\n"
-"1637\n"
-"1638\n"
-"1639\n"
-"1640\n"
-"1641\n"
-"1642\n"
-"1643\n"
-"1644\n"
-"1645\n"
-"1646\n"
-"1647\n"
-"1648\n"
-"1649\n"
-"1650\n"
-"1651\n"
-"1652\n"
-"1653\n"
-"1654\n"
-"1655\n"
-"1656\n"
-"1657\n"
-"1658\n"
-"1659\n"
-"1660\n"
-"1661\n"
-"1662\n"
-"1663\n"
-"1664\n"
-"1665\n"
-"1666\n"
-"1667\n"
-"1668\n"
-"1669\n"
-"1670\n"
-"1671\n"
-"1672\n"
-"1673\n"
-"1674\n"
-"1675\n"
-"1676\n"
-"1677\n"
-"1678\n"
-"1679\n"
-"1680\n"
-"1681\n"
-"1682\n"
-"1683\n"
-"1684\n"
-"1685\n"
-"1686\n"
-"1687\n"
-"1688\n"
-"1689\n"
-"1690\n"
-"1691\n"
-"1692\n"
-"1693\n"
-"1694\n"
-"1695\n"
-"1696\n"
-"1697\n"
-"1698\n"
-"1699\n"
-"1700\n"
-"1701\n"
-"1702\n"
-"1703\n"
-"1704\n"
-"1705\n"
-"1706\n"
-"1707\n"
-"1708\n"
-"1709\n"
-"1710\n"
-"1711\n"
-"1712\n"
-"1713\n"
-"1714\n"
-"1715\n"
-"1716\n"
-"1717\n"
-"1718\n"
-"1719\n"
-"1720\n"
-"1721\n"
-"1722\n"
-"1723\n"
-"1724\n"
-"1725\n"
-"1726\n"
-"1727\n"
-"1728\n"
-"1729\n"
-"1730\n"
-"1731\n"
-"1732\n"
-"1733\n"
-"1734\n"
-"1735\n"
-"1736\n"
-"1737\n"
-"1738\n"
-"1739\n"
-"1740\n"
-"1741\n"
-"1742\n"
-"1743\n"
-"1744\n"
-"1745\n"
-"1746\n"
-"1747\n"
-"1748\n"
-"1749\n"
-"1750\n"
-"1751\n"
-"1752\n"
-"1753\n"
-"1754\n"
-"1755\n"
-"1756\n"
-"1757\n"
-"1758\n"
-"1759\n"
-"1760\n"
-"1761\n"
-"1762\n"
-"1763\n"
-"1764\n"
-"1765\n"
-"1766\n"
-"1767\n"
-"1768\n"
-"1769\n"
-"1770\n"
-"1771\n"
-"1772\n"
-"1773\n"
-"1774\n"
-"1775\n"
-"1776\n"
-"1777\n"
-"1778\n"
-"1779\n"
-"1780\n"
-"1781\n"
-"1782\n"
-"1783\n"
-"1784\n"
-"1785\n"
-"1786\n"
-"1787\n"
-"1788\n"
-"1789\n"
-"1790\n"
-"1791\n"
-"1792\n"
-"1793\n"
-"1794\n"
-"1795\n"
-"1796\n"
-"1797\n"
-"1798\n"
-"1799\n"
-"1800\n"
-"1801\n"
-"1802\n"
-"1803\n"
-"1804\n"
-"1805\n"
-"1806\n"
-"1807\n"
-"1808\n"
-"1809\n"
-"1810\n"
-"1811\n"
-"1812\n"
-"1813\n"
-"1814\n"
-"1815\n"
-"1816\n"
-"1817\n"
-"1818\n"
-"1819\n"
-"1820\n"
-"1821\n"
-"1822\n"
-"1823\n"
-"1824\n"
-"1825\n"
-"1826\n";
-
-/*
- * compare this file with read and mmap.
- * return 0 iff identical.
- */
-
-static int
-compare_file (const char *filename)
-{
- struct stat sb;
- int fd;
- int ret;
- void *read_buf;
- void *mmap_buf;
-
- fd = open (filename, O_RDONLY);
- if (fd < 0)
- err(1, "open %s", filename);
- ret = fstat (fd, &sb);
- if (ret < 0)
- err (1, "stat %s", filename);
- read_buf = malloc (sb.st_size);
- if (read_buf == NULL)
- err (1, "malloc %u", (unsigned)sb.st_size);
- ret = read (fd, read_buf, sb.st_size);
- if (ret < 0)
- err (1, "read %s", filename);
- if (ret != sb.st_size)
- errx (1, "short read from %s", filename);
- mmap_buf = mmap (NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
- if (mmap_buf == (void *)MAP_FAILED)
- err (1, "mmap %s", filename);
- ret = memcmp (read_buf, mmap_buf, sb.st_size);
- close (fd);
- free (read_buf);
- return ret;
-}
-
-static void
-doit (const char *filename)
-{
- int fd;
- int ret;
-
- fd = open (filename, O_WRONLY | O_APPEND | O_CREAT | O_TRUNC, 0600);
- if (fd < 0)
- err (1, "open %s", filename);
- ret = close (fd);
- if (ret < 0)
- err (1, "close %s", filename);
- fd = open (filename, O_WRONLY | O_APPEND);
- if (fd < 0)
- err (1, "open %s", filename);
- ret = write (fd, "foobar\n", 7);
- if (ret < 0)
- err (1, "write %s", filename);
- if (ret != 7)
- errx (1, "short write to %s", filename);
- ret = close (fd);
- if (ret < 0)
- err(1, "close %s", filename);
-
- if(compare_file (filename))
- errx (1, "compare 1 failed");
-
- fd = open (filename, O_WRONLY | O_APPEND);
- if (fd < 0)
- err (1, "open %s", filename);
- ret = write (fd, long_buf, strlen(long_buf));
- if (ret < 0)
- err (1, "write %s", filename);
- if (ret != strlen(long_buf))
- errx (1, "short write to %s", filename);
- ret = close (fd);
- if (ret < 0)
- err(1, "close %s", filename);
-
- if(compare_file (filename))
- errx (1, "compare 2 failed");
-}
-
-int
-main(int argc, char **argv)
-{
- const char *file = "blaha";
-
- set_progname (argv[0]);
- if (argc != 1 && argc != 2)
- errx (1, "usage: %s [file]", argv[0]);
- if (argc == 2)
- file = argv[1];
- doit (file);
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/append1 b/usr.sbin/afs/src/tests/append1
deleted file mode 100644
index c7dc373571b..00000000000
--- a/usr.sbin/afs/src/tests/append1
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-$objdir/echo-n hej > foo || exit 1
-if test `cat foo` != "hej"; then exit 1; fi
-$objdir/echo-n hopp >> foo || exit 1
-if test `cat foo` != "hejhopp"; then exit 1; fi
-rm foo || exit 1
diff --git a/usr.sbin/afs/src/tests/apwd.c b/usr.sbin/afs/src/tests/apwd.c
deleted file mode 100644
index 7aca1c99cf7..00000000000
--- a/usr.sbin/afs/src/tests/apwd.c
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include <err.h>
-#include <agetarg.h>
-
-#include <roken.h>
-
-RCSID("$KTH: apwd.c,v 1.10 2000/10/03 00:33:12 lha Exp $");
-
-static int verbose_flag;
-static FILE *verbose_fp = NULL;
-
-static int
-initial_string (char **buf, size_t *size, size_t new_size)
-{
- char *tmp = malloc (new_size);
-
- if (tmp == NULL)
- return -1;
- *buf = tmp;
- *size = new_size;
- return 0;
-}
-
-static int
-expand_string (char **buf, size_t *size, size_t new_size)
-{
- char *tmp = realloc (*buf, new_size);
-
- if (tmp == NULL)
- return -1;
- *buf = tmp;
- *size = new_size;
- return 0;
-}
-
-/*
- * Verify that the dynamically allocated string `buf' of length
- * `size', has room for `len' bytes. Returns -1 if realloc fails.
- */
-
-static int
-guarantee_room (char **buf, size_t *size, size_t len)
-{
- if (*size > len)
- return 0;
-
- return expand_string (buf, size, min(*size * 2, len));
-}
-
-static char *
-getcwd_classic (char *buf, size_t size)
-{
- int dynamic_buf = 0;
- struct stat root_sb, dot_sb, dotdot_sb;
- char *work_string;
- size_t work_length;
- char slash_dot_dot[] = "/..";
- char *curp;
- char *endp;
- DIR *dir = NULL;
-
- if (initial_string (&work_string, &work_length, MAXPATHLEN) < 0)
- return NULL;
-
- if (buf == NULL) {
- dynamic_buf = 1;
- if (initial_string (&buf, &size, MAXPATHLEN) < 0) {
- free (work_string);
- return NULL;
- }
- }
-
- endp = curp = buf + size - 1;
-
- if (lstat (".", &dot_sb) < 0)
- goto err_ret;
- if (lstat ("/", &root_sb) < 0)
- goto err_ret;
- strcpy (work_string, "..");
- fprintf (verbose_fp, "\".\" is (%u, %u), \"/\" is (%u, %u)\n",
- (unsigned)dot_sb.st_dev, (unsigned)dot_sb.st_ino,
- (unsigned)root_sb.st_dev, (unsigned)root_sb.st_ino);
-
- while (dot_sb.st_dev != root_sb.st_dev
- || dot_sb.st_ino != root_sb.st_ino) {
- struct dirent *dp;
- int found = 0;
- int change_dev = 0;
- int pattern_len = strlen (work_string);
-
- if (lstat (work_string, &dotdot_sb) < 0)
- goto err_ret;
- fprintf (verbose_fp, "\"..\" is (%u, %u)\n",
- (unsigned)dotdot_sb.st_dev, (unsigned)dotdot_sb.st_ino);
- if (dot_sb.st_dev != dotdot_sb.st_dev)
- change_dev = 1;
- dir = opendir (work_string);
- if (dir == NULL)
- goto err_ret;
- while ((dp = readdir (dir)) != NULL) {
- size_t name_len = strlen (dp->d_name);
-
- if (change_dev) {
- struct stat sb;
-
- if (guarantee_room (&work_string, &work_length,
- pattern_len + name_len + 2) < 0) {
- goto err_ret;
- }
-
- strcat (work_string, "/");
- strcat (work_string, dp->d_name);
-
- if (lstat (work_string, &sb) < 0) {
- goto err_ret;
- }
- if (sb.st_dev == dot_sb.st_dev
- && sb.st_ino == dot_sb.st_ino) {
- fprintf (verbose_fp, "\"%s\" found\n", work_string);
- found = 1;
- }
- work_string[pattern_len] = '\0';
- } else if (dp->d_ino == dot_sb.st_ino) {
- fprintf (verbose_fp, "\"%s\" found\n", dp->d_name);
- found = 1;
- }
-
- if (found) {
- while (buf + name_len >= curp) {
- size_t old_len;
-
- if (!dynamic_buf) {
- errno = ERANGE;
- goto err_ret;
- }
- old_len = endp - curp + 1;
- if (expand_string (&buf, &size, size * 2) < 0)
- goto err_ret;
- memmove (buf + size - old_len,
- buf + size / 2 - old_len,
- old_len);
- endp = buf + size - 1;
- curp = endp - old_len + 1;
- }
- memcpy (curp - name_len, dp->d_name, name_len);
- curp[-(name_len + 1)] = '/';
- curp -= name_len + 1;
- break;
- }
- }
- closedir (dir);
- dir = NULL;
-
- if (!found)
- goto err_ret;
-
- dot_sb = dotdot_sb;
- if (guarantee_room (&work_string, &work_length,
- pattern_len + strlen(slash_dot_dot) + 1) < 0)
- goto err_ret;
- strcat (work_string, slash_dot_dot);
- }
- if (curp == endp) {
- while (buf >= curp) {
- if (!dynamic_buf) {
- errno = ERANGE;
- goto err_ret;
- }
- if (expand_string (&buf, &size, size * 2) < 0)
- goto err_ret;
- }
- *--curp = '/';
- }
- *endp = '\0';
- memmove (buf, curp, endp - curp + 1);
- free (work_string);
- return buf;
-
-err_ret:
- if (dir)
- closedir (dir);
- if (dynamic_buf)
- free (buf);
- free (work_string);
- return NULL;
-}
-
-#if linux
-
-static char *
-getcwd_proc (char *buf, size_t size)
-{
- int dynamic_buf = 0;
-
- if (buf == NULL) {
- dynamic_buf = 1;
- if (initial_string (&buf, &size, MAXPATHLEN) < 0)
- return NULL;
- } else if (size <= 1) {
- errno = ERANGE;
- return NULL;
- }
-
- for (;;) {
- int ret;
-
- ret = readlink ("/proc/self/cwd", buf, size);
- if (ret == -1)
- goto err_ret;
- if (buf[0] != '/') {
- errno = EINVAL;
- goto err_ret;
- }
- if (buf[ret-1] != '\0' && ret >= size) {
- if (!dynamic_buf) {
- errno = ERANGE;
- goto err_ret;
- }
- if (expand_string (&buf, &size, size * 2) < 0)
- goto err_ret;
- } else {
- if (buf[ret - 1] != '\0')
- buf[ret] = '\0';
- return buf;
- }
- }
-err_ret:
- if (dynamic_buf)
- free (buf);
- return NULL;
-}
-
-#endif /* linux */
-
-static int
-test_1(char *(*func)(char *, size_t), const char *func_name, int init_size)
-{
- char real_buf[2048];
- char buf[2048], *buf2, buf3[4711];
- int i;
- int ret = 0;
- int three_done = 1;
-
- if (getcwd (real_buf, sizeof(real_buf)) == NULL) {
- fprintf (verbose_fp, "getcwd(buf, %u) failed\n", sizeof(real_buf));
- ret = 1;
- }
- if (func (buf, sizeof(buf)) == NULL) {
- fprintf (verbose_fp, "%s(buf, %u) failed\n", func_name, sizeof(buf));
- ret = 1;
- } else {
- fprintf (verbose_fp, "first *%s*\n", buf);
- if (strcmp (real_buf, buf) != 0) {
- fprintf (verbose_fp, "first comparison failed: *%s* != *%s*\n",
- real_buf, buf);
- ret = 1;
- }
- }
-
- buf2 = func (NULL, 0);
- if (buf2 == NULL) {
- fprintf (verbose_fp, "%s(NULL, 0) failed\n", func_name);
- ret = 1;
- } else {
- fprintf (verbose_fp, "second *%s*\n", buf2);
- if (strcmp (real_buf, buf2) != 0) {
- fprintf (verbose_fp, "second comparison failed: *%s* != *%s*\n",
- real_buf, buf2);
- ret = 1;
- }
- free (buf2);
- }
-
- for (i = init_size; i < sizeof(buf3); ++i) {
- memset (buf3, '\x01', sizeof(buf3));
- if (func (buf3, i) == NULL) {
- if (errno != ERANGE) {
- fprintf (verbose_fp, "%s(buf,%u) call failed\n", func_name, i);
- three_done = 0;
- break;
- }
- } else {
- int j;
-
- for (j = i; j < sizeof(buf3); ++j)
- if (buf3[j] != '\x01') {
- fprintf (verbose_fp, "buffer was overwritten at %d\n", j);
- three_done = 0;
- break;
- }
- break;
- }
- }
-
- if (three_done) {
- fprintf (verbose_fp, "third *%s*\n", buf3);
- if (strcmp (real_buf, buf3) != 0) {
- fprintf (verbose_fp, "third comparison failed: *%s* != *%s*\n",
- real_buf, buf3);
- ret = 1;
- } else if (strlen (buf3) + 1 != i
- && strlen (buf3) + 1 >= init_size) {
- fprintf (verbose_fp, "wrong len in third call: %d != %d\n",
- strlen(buf3) + 1, i);
- ret = 1;
- }
- } else {
- ret = 1;
- }
-
- return ret;
-}
-
-static int
-test_it(char *(*func)(char *, size_t), const char *name, int init_size)
-{
- int ret;
-
- fprintf (verbose_fp, "testing %s (initial size %d)\n", name, init_size);
- ret = test_1 (func, name, init_size);
- if (ret)
- fprintf (verbose_fp, "FAILED!\n");
- else
- fprintf (verbose_fp, "passed\n");
- return ret;
-}
-
-#ifdef linux
-#include <linux/unistd.h>
-#endif
-
-#ifdef __NR_getcwd
-
-#define __NR_sys_getcwd __NR_getcwd
-
-static
-_syscall2(int, sys_getcwd, char *, buf, size_t, size)
-
-static char *
-getcwd_syscall (char *buf, size_t size)
-{
- int dynamic_buf = 0;
-
- if (buf == NULL) {
- dynamic_buf = 1;
- if (initial_string (&buf, &size, MAXPATHLEN) < 0)
- return NULL;
- }
-
- for (;;) {
- int ret;
-
- ret = sys_getcwd (buf, size);
- if (ret >= 0)
- return buf;
- else if (errno == ERANGE) {
- if (!dynamic_buf)
- return NULL;
- if (expand_string (&buf, &size, size * 2) < 0)
- return NULL;
- } else
- return NULL;
- }
-}
-
-#endif
-
-static int help_flag;
-
-static struct agetargs args[] = {
- {"verbose", 'v', aarg_flag, &verbose_flag, "verbose", NULL},
- {"help", 0, aarg_flag, &help_flag, NULL, NULL},
- {NULL, 0, aarg_end, NULL, NULL, NULL}
-};
-
-static void
-usage (int exit_val)
-{
- aarg_printusage (args, NULL, "", AARG_GNUSTYLE);
-}
-
-int
-main(int argc, char **argv)
-{
- int ret = 0;
- int optind = 0;
-
- set_progname (argv[0]);
-
- verbose_flag = getenv ("VERBOSE") != NULL;
-
- if (agetarg (args, argc, argv, &optind, AARG_GNUSTYLE))
- usage (1);
-
- argc -= optind;
- argv += optind;
-
- if (argc != 0)
- usage (1);
- if (help_flag)
- usage (0);
-
- verbose_fp = fdopen (4, "w");
- if (verbose_fp == NULL) {
- verbose_fp = fopen ("/dev/null", "w");
- if (verbose_fp == NULL)
- err (1, "fopen");
- }
-
- ret += test_it (getcwd, "getcwd", 3);
-#ifdef __NR_getcwd
- ret += test_it (getcwd_syscall, "getcwd_syscall", 3);
-#endif
- ret += test_it (getcwd_classic, "getcwd_classic", 0);
-#if linux
- ret += test_it (getcwd_proc, "getcwd_proc", 0);
-#endif
- return ret;
-}
diff --git a/usr.sbin/afs/src/tests/boot-strap-arla b/usr.sbin/afs/src/tests/boot-strap-arla
deleted file mode 100644
index 086e0dbd1ae..00000000000
--- a/usr.sbin/afs/src/tests/boot-strap-arla
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-# $KTH: boot-strap-arla,v 1.8 2000/08/02 01:36:48 assar Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ;exit 0; fi
-
-ARLA_RELEASE=${AFSROOT}/stacken.kth.se/ftp/pub/arla/arla-0.34.tar.gz
-
-mkdir src || exit 1
-mkdir obj || exit 1
-
-cd src || exit 1
-gzip -dc $ARLA_RELEASE | tar xf -
-cd ../obj || exit 1
-../src/*/configure || exit 1
-make || exit 1
-cd milko || exit 1
-make || exit 1
-exit 0
diff --git a/usr.sbin/afs/src/tests/build-emacs b/usr.sbin/afs/src/tests/build-emacs
deleted file mode 100644
index 79d5d57ac19..00000000000
--- a/usr.sbin/afs/src/tests/build-emacs
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# $KTH: build-emacs,v 1.13 2000/07/01 05:41:40 assar Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-$SHELL $SHELLVERBOSE $srcdir/generic-build $AFSROOT/stacken.kth.se/ftp/pub/gnu/emacs/emacs-20.7.tar.gz emacs-20.7
diff --git a/usr.sbin/afs/src/tests/build-emacs-j b/usr.sbin/afs/src/tests/build-emacs-j
deleted file mode 100644
index 26759f9aa5e..00000000000
--- a/usr.sbin/afs/src/tests/build-emacs-j
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# $KTH: build-emacs-j,v 1.6 2000/07/01 05:41:51 assar Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-env MAKEFLAGS="-j" $SHELL $SHELLVERBOSE $srcdir/generic-build $AFSROOT/stacken.kth.se/ftp/pub/gnu/emacs/emacs-20.7.tar.gz emacs-20.7
diff --git a/usr.sbin/afs/src/tests/build-gdb b/usr.sbin/afs/src/tests/build-gdb
deleted file mode 100644
index f7cfa74755b..00000000000
--- a/usr.sbin/afs/src/tests/build-gdb
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# $KTH: build-gdb,v 1.8 2000/06/23 04:28:27 lha Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-$SHELL $SHELLVERBOSE $srcdir/generic-build $AFSROOT/stacken.kth.se/ftp/pub/gnu/gdb/gdb-5.0.tar.gz
diff --git a/usr.sbin/afs/src/tests/checkpwd b/usr.sbin/afs/src/tests/checkpwd
deleted file mode 100644
index f08d1e0b5bf..00000000000
--- a/usr.sbin/afs/src/tests/checkpwd
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-# $KTH: checkpwd,v 1.1 2000/03/17 15:41:45 assar Exp $
-$objdir/apwd
diff --git a/usr.sbin/afs/src/tests/compare-inum-mp b/usr.sbin/afs/src/tests/compare-inum-mp
deleted file mode 100644
index 7fdbd073d26..00000000000
--- a/usr.sbin/afs/src/tests/compare-inum-mp
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-# $KTH: compare-inum-mp,v 1.5 2000/06/10 09:17:06 assar Exp $
-FS=${FS:-${objdir}/../appl/fs/fs}
-${FS} sa . system:anyuser all || exit 1
-${FS} mkm root.cell root.cell || exit 1
-$objdir/readdir-vs-lstat . || exit 1
-$objdir/readdir-vs-lstat root.cell || exit 1
-${FS} rmm root.cell || exit 1
diff --git a/usr.sbin/afs/src/tests/compare-inums b/usr.sbin/afs/src/tests/compare-inums
deleted file mode 100644
index e949f186cf1..00000000000
--- a/usr.sbin/afs/src/tests/compare-inums
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# $KTH: compare-inums,v 1.2 1999/10/13 20:47:46 lha Exp $
-$objdir/create-files 100 0 || exit 1
-$objdir/readdir-vs-lstat . || exit 1
diff --git a/usr.sbin/afs/src/tests/compare-with-local b/usr.sbin/afs/src/tests/compare-with-local
deleted file mode 100644
index 75c52a54617..00000000000
--- a/usr.sbin/afs/src/tests/compare-with-local
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/sh
-# $KTH: compare-with-local,v 1.3 2000/06/26 00:49:58 assar Exp $
-#################################################################
-#
-# Copy file back and forth between $TMPDIR (defaults to /tmp)
-# which is hopefully on local disk or any other well tested
-# file system and the filesystem we want to test (in $PWD).
-#
-#################################################################
-
-test $SHELLVERBOSE && set $SHELLVERBOSE
-
-function compare () {
- if cmp $1 $2; then
- :
- else
- diff $1 $2
- exit 1
- fi
-}
-
-test $TMPDIR || TMPDIR=/tmp
-TMPDIR=$TMPDIR/compare-with-local-$$
-mkdir $TMPDIR || exit 1
-
-# Generate test file
-cat > $TMPDIR/bar << EOF
-This is an arla temporary test file.
-You may remove it any time.
-Kontrollen blinkar blå.
-EOF
-
-cp $TMPDIR/bar bar
-compare $TMPDIR/bar bar
-mv bar $TMPDIR/bas
-compare $TMPDIR/bar $TMPDIR/bas
- # this is for later overwrite test
- test -f bar && echo bar should not exist && exit 1
- cp $TMPDIR/bar bar
- compare $TMPDIR/bar bar
-cat $TMPDIR/bas > bat
-compare $TMPDIR/bar bat
-cat bat > $TMPDIR/bau
-compare $TMPDIR/bar $TMPDIR/bau
-mv $TMPDIR/bau bav
-compare $TMPDIR/bar bav
- # this is for later overwrite test
- test -f $TMPDIR/bau && echo $TMPDIR/bau should not exist && exit 1
- cp $TMPDIR/bar $TMPDIR/bau
-cp bav $TMPDIR/baw
-compare $TMPDIR/bar $TMPDIR/baw
-
-# If we get so far we can write new files.
-# Now test overwrite.
-
-# Generate test file slightly different
-cat > $TMPDIR/bar << EOF
-This is an arla temporary test file.
-You may remove it any time.
-Mera jul.
-EOF
-
-cp $TMPDIR/bar bar
-compare $TMPDIR/bar bar
-mv bar $TMPDIR/bas
-compare $TMPDIR/bar $TMPDIR/bas
-cat $TMPDIR/bas > bat
-compare $TMPDIR/bar bat
-cat bat > $TMPDIR/bau
-compare $TMPDIR/bar $TMPDIR/bau
-mv $TMPDIR/bau bav
-compare $TMPDIR/bar bav
-cp bav $TMPDIR/baw
-compare $TMPDIR/bar $TMPDIR/baw
-
-${objdir}/rm-rf $TMPDIR
-exit 0
diff --git a/usr.sbin/afs/src/tests/copy-and-diff-gnu-mirror b/usr.sbin/afs/src/tests/copy-and-diff-gnu-mirror
deleted file mode 100644
index 83fe8128a93..00000000000
--- a/usr.sbin/afs/src/tests/copy-and-diff-gnu-mirror
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-# $KTH: copy-and-diff-gnu-mirror,v 1.7.36.1 2002/02/05 13:23:28 lha Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-if test "X$LARGE" = "X" ; then echo "Not running large test $0" ; exit 0 ; fi
-original=${1-$AFSROOT/stacken.kth.se/ftp/pub}
-(cd $original; tar cvf - gnu) 2>&4 | tar xvf - >&4
-find gnu -type f -exec cmp '{}' $original/'{}' \;
diff --git a/usr.sbin/afs/src/tests/copy-file b/usr.sbin/afs/src/tests/copy-file
deleted file mode 100644
index b71a40bda75..00000000000
--- a/usr.sbin/afs/src/tests/copy-file
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-# $KTH: copy-file,v 1.1 2000/10/14 04:01:52 lha Exp $
-cat > foo <<EOF
-hej love
-
-ska vi g|ra r{tt nu.
-EOF
-
-cp foo foo2 || exit 1
-cp foo foo2 || exit 1
-cp foo foo2 || exit 1
-cp foo foo2 || exit 1
-cp foo foo2 || exit 1
-cp foo foo2 || exit 1
-cp foo foo2 || exit 1
-cp foo foo2 || exit 1
-cp foo foo2 || exit 1
-cp foo foo2 || exit 1
-cp foo foo2 || exit 1
-cp foo foo2 || exit 1
-cp foo foo2 || exit 1
-cp foo foo2 || exit 1
-cp foo foo2 || exit 1
-cp foo foo2 || exit 1
-cp foo foo2 || exit 1
-exit 0
diff --git a/usr.sbin/afs/src/tests/creat1 b/usr.sbin/afs/src/tests/creat1
deleted file mode 100644
index 9bdf2b50c6b..00000000000
--- a/usr.sbin/afs/src/tests/creat1
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-> foobar
-test -f foobar || exit 1
-test -s foobar && exit 1
-rm foobar || exit 1
diff --git a/usr.sbin/afs/src/tests/create-dirs.c b/usr.sbin/afs/src/tests/create-dirs.c
deleted file mode 100644
index 2ee698cd6db..00000000000
--- a/usr.sbin/afs/src/tests/create-dirs.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: create-dirs.c,v 1.2 2000/10/03 00:33:17 lha Exp $");
-#endif
-
-static int
-creat_dirs (int count)
-{
- int i;
-
- for (i = 0; i < count; ++i) {
- char num[17];
- int ret;
-
- snprintf (num, sizeof(num), "%d", i);
-
- ret = mkdir (num, 0777);
- if (ret < 0)
- err (1, "mkdir %s", num);
- }
- return 0;
-}
-
-static void
-usage (int ret)
-{
- fprintf (stderr, "%s number-of-dirs\n", __progname);
- exit (ret);
-}
-
-int
-main(int argc, char **argv)
-{
- char *ptr;
- int count;
-
- set_progname (argv[0]);
-
- if (argc != 2)
- usage (1);
-
- count = strtol (argv[1], &ptr, 0);
- if (count == 0 && ptr == argv[1])
- errx (1, "'%s' not a number", argv[1]);
-
- return creat_dirs (count);
-}
diff --git a/usr.sbin/afs/src/tests/create-files.c b/usr.sbin/afs/src/tests/create-files.c
deleted file mode 100644
index 2c250377435..00000000000
--- a/usr.sbin/afs/src/tests/create-files.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: create-files.c,v 1.6 2000/10/03 00:33:23 lha Exp $");
-#endif
-
-static int
-creat_files (int count, long startsize)
-{
- int i;
- long size = 0;
-
- for (i = 0; i < count; ++i) {
- char num[17];
- int fd;
-
- snprintf (num, sizeof(num), "%d", i);
-
- fd = open (num, O_WRONLY | O_CREAT | O_EXCL, 0777);
- if (fd < 0)
- err (1, "open %s", num);
- size = startsize;
- while (size > 0) {
- char buf[8192];
- size_t len;
- ssize_t ret;
-
- len = min(sizeof(buf), size);
-
- ret = write (fd, buf, len);
- if (ret < 0)
- err (1, "write to %s", num);
- if (ret != len)
- errx (1, "short write to %s", num);
- size -= ret;
- }
- if (close (fd) < 0)
- err (1, "close %s", num);
- }
- return 0;
-}
-
-static void
-usage (int ret)
-{
- fprintf (stderr, "%s number-of-files size-of-files\n", __progname);
- exit (ret);
-}
-
-int
-main(int argc, char **argv)
-{
- char *ptr;
- int count;
- long size;
-
- set_progname (argv[0]);
-
- if (argc != 3)
- usage (1);
-
- count = strtol (argv[1], &ptr, 0);
- if (count == 0 && ptr == argv[1])
- errx (1, "'%s' not a number", argv[1]);
-
- size = strtol (argv[2], &ptr, 0);
- if (size == 0 && ptr == argv[2])
- errx (1, "`%s' not a number", argv[2]);
-
- return creat_files (count, size);
-}
diff --git a/usr.sbin/afs/src/tests/create-remove-dirs b/usr.sbin/afs/src/tests/create-remove-dirs
deleted file mode 100644
index 3f3e0fd742e..00000000000
--- a/usr.sbin/afs/src/tests/create-remove-dirs
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# $KTH: create-remove-dirs,v 1.2 1999/12/20 14:59:22 lha Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-$objdir/create-remove dir 1000
diff --git a/usr.sbin/afs/src/tests/create-remove-files b/usr.sbin/afs/src/tests/create-remove-files
deleted file mode 100644
index 365b3dbf7c5..00000000000
--- a/usr.sbin/afs/src/tests/create-remove-files
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# $KTH: create-remove-files,v 1.2 1999/12/20 14:59:23 lha Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-$objdir/create-remove file 1000
diff --git a/usr.sbin/afs/src/tests/create-remove.c b/usr.sbin/afs/src/tests/create-remove.c
deleted file mode 100644
index 936c594fb78..00000000000
--- a/usr.sbin/afs/src/tests/create-remove.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: create-remove.c,v 1.2 2000/10/03 00:33:28 lha Exp $");
-#endif
-
-static int
-creat_dir (const char *name)
-{
- int ret = mkdir (name, 0777);
- if (ret < 0) err (1, "mkdir %s", name);
- return 0;
-}
-
-static int
-remove_dir (const char *name)
-{
- int ret = rmdir (name);
- if (ret < 0) err (1, "rmdir %s", name);
- return 0;
-}
-
-static int
-creat_file (const char *name)
-{
- int ret = open (name, O_CREAT|O_RDWR, 0777);
- if (ret < 0) err (1, "mkdir %s", name);
- close (ret);
- return 0;
-}
-
-static int
-unlink_file (const char *name)
-{
- int ret = unlink (name);
- if (ret < 0) err (1, "unlink %s", name);
- return 0;
-}
-
-
-static void
-usage (int ret)
-{
- fprintf (stderr, "%s [file|dir] number-of-dirs\n", __progname);
- exit (ret);
-}
-
-static int
-creat_many (int num,
- int (*c) (const char *name),
- int (*d) (const char *name))
-{
- char name[MAXPATHLEN];
-
- if (num < 0)
- errx (1, "not be negative");
-
- snprintf (name, sizeof(name), "foo-%d-%d", num, getpid());
-
- while (num-- > 0) {
- (c) (name);
- (d) (name);
- }
- return 0;
-}
-
-
-int
-main(int argc, char **argv)
-{
- char *ptr;
- int count;
-
- set_progname (argv[0]);
-
- if (argc != 3)
- usage (1);
-
- count = strtol (argv[2], &ptr, 0);
- if (count == 0 && ptr == argv[2])
- errx (1, "'%s' not a number", argv[2]);
-
- if (strcmp ("file", argv[1]) == 0)
- return creat_many (count, creat_file, unlink_file);
- else if (strcmp("dir", argv[1]) == 0)
- return creat_many (count, creat_dir, remove_dir);
- else
- errx (1, "unknown type: %s", argv[1]);
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/create-stat.c b/usr.sbin/afs/src/tests/create-stat.c
deleted file mode 100644
index 78f92fb5c8f..00000000000
--- a/usr.sbin/afs/src/tests/create-stat.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include <atypes.h>
-
-#include <kafs.h>
-
-#include <fs.h>
-#include <arlalib.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: create-stat.c,v 1.5 2000/10/03 00:33:33 lha Exp $");
-#endif
-
-#ifdef KERBEROS
-
-static void
-usage (int ret)
-{
- fprintf (stderr, "%s file\n", __progname);
- exit (ret);
-}
-
-int
-main(int argc, char **argv)
-{
- char *file;
- int ret;
- struct stat sb;
- struct stat sb_new;
- struct stat sb_old;
- VenusFid fid;
- char *filename;
- ino_t afsfileid;
-
- set_progname (argv[0]);
-
- if (!k_hasafs())
- errx (1, "!k_hasafs");
-
- if (argc != 2)
- usage (1);
-
- file = argv[1];
-
- asprintf (&filename, "%s.new", file);
-
- ret = open (file, O_RDWR, 0600);
- if (ret < 0)
- err (1, "open");
- close (ret);
-
- ret = open (filename, O_RDWR|O_CREAT|O_EXCL, 0600);
- if (ret < 0) {
- unlink(file);
- err (1, "open");
- }
- close (ret);
-
- ret = stat (file, &sb);
- if (ret < 0) {
- unlink(filename);
- unlink(file);
- err (1, "stat");
- }
-
- ret = lstat (filename, &sb_new);
- if (ret < 0) {
- unlink(filename);
- unlink(file);
- err (1, "stat");
- }
-
- if (sb.st_ino == sb_new.st_ino)
- err (1, "sb.st_ino == sb_new.st_ino");
-
- ret = lstat (file, &sb_old);
- if (ret < 0) {
- unlink(filename);
- unlink(file);
- err (1, "stat");
- }
-
- if (sb_old.st_ino == sb_new.st_ino)
- err (1, "sb_old.st_ino == sb_new.st_ino");
- if (sb.st_ino == sb_new.st_ino)
- err (1, "sb.st_ino == sb_new.st_ino");
- if (sb_old.st_ino != sb.st_ino)
- err (1, "sb_old.st_ino != sb.st_ino");
-
- ret = fs_getfid (file, &fid);
- if (ret) {
- unlink(file);
- unlink(filename);
- err (1, "fs_getfid: %d", ret);
- }
-
- afsfileid = ((fid.fid.Volume & 0x7FFF) << 16 | (fid.fid.Vnode & 0xFFFFFFFF));
- if (sb.st_ino != afsfileid) {
- unlink(file);
- unlink(filename);
- errx (1, "sb.st_ino(%ld) != afsfileid(%ld) (%d.%d.%d.%d)",
- (long)sb.st_ino, (long)afsfileid,
- fid.Cell, fid.fid.Volume, fid.fid.Vnode, fid.fid.Unique);
- }
-
- unlink(filename);
- unlink(file);
-
- return 0;
-}
-
-#else /* !KERBEROS */
-
-int
-main (int argc, char **argv)
-{
- set_progname (argv[0]);
-
- errx (1, "no kafs");
-}
-
-#endif
diff --git a/usr.sbin/afs/src/tests/create-symlinks.c b/usr.sbin/afs/src/tests/create-symlinks.c
deleted file mode 100644
index 8a62d364693..00000000000
--- a/usr.sbin/afs/src/tests/create-symlinks.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: create-symlinks.c,v 1.3 2000/10/12 00:26:03 lha Exp $");
-#endif
-
-#define CONTENT_STRING "kaka"
-
-static FILE *verbose_fp = NULL;
-
-static int
-creat_symlinks (int count)
-{
- int ret;
- int i;
-
- fprintf (verbose_fp, "creating:");
-
- for (i = 0; i < count; ++i) {
- char num[17];
-
- fprintf (verbose_fp, " c%d", i);
- fflush (verbose_fp);
-
- snprintf (num, sizeof(num), "%d", i);
-
- ret = symlink (CONTENT_STRING, num);
- if (ret < 0)
- err (1, "symlink %s", num);
- }
- fprintf (verbose_fp, "\n");
- return 0;
-}
-
-static int
-verify_contents (int count)
-{
- int ret, i;
- char file[MAXPATHLEN];
- char content[MAXPATHLEN];
-
- fprintf (verbose_fp, "reading:");
- for (i = 0; i < count; i++) {
- fprintf (verbose_fp, " r%d", i);
- fflush (verbose_fp);
-
- snprintf (file, sizeof(file), "%d", i);
- ret = readlink (file, content, sizeof(content));
- if (ret < 0)
- err (1, "readlink: %d", i);
- if (strcmp (CONTENT_STRING, content) != 0)
- errx (1, "%s != %s", content, CONTENT_STRING);
- }
- fprintf (verbose_fp, "\n");
- return 0;
-}
-
-static void
-usage (int ret)
-{
- fprintf (stderr, "%s number-of-symlinks\n", __progname);
- exit (ret);
-}
-
-int
-main(int argc, char **argv)
-{
- char *ptr;
- int count;
-
- set_progname (argv[0]);
-
- if (argc != 2)
- usage (1);
-
- verbose_fp = fdopen (4, "w");
- if (verbose_fp == NULL) {
- verbose_fp = fopen ("/dev/null", "w");
- if (verbose_fp == NULL)
- err (1, "fopen");
- }
-
- count = strtol (argv[1], &ptr, 0);
- if (count == 0 && ptr == argv[1])
- errx (1, "'%s' not a number", argv[1]);
-
- return creat_symlinks (count) ||
- verify_contents(count);
-}
diff --git a/usr.sbin/afs/src/tests/dd b/usr.sbin/afs/src/tests/dd
deleted file mode 100644
index 1cdde421f21..00000000000
--- a/usr.sbin/afs/src/tests/dd
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-# $KTH: dd,v 1.4 2000/03/18 05:30:18 assar Exp $
-if test -r /dev/zero; then
- dd if=/dev/zero of=foo bs=1k count=20 >/dev/null 2>/dev/null || exit 1
- rm foo || exit 1
-else
- echo "not running dd (you have no /dev/zero)"
-fi
diff --git a/usr.sbin/afs/src/tests/deep-tree b/usr.sbin/afs/src/tests/deep-tree
deleted file mode 100644
index f9136b8961b..00000000000
--- a/usr.sbin/afs/src/tests/deep-tree
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-# $KTH: deep-tree,v 1.7 2000/07/03 16:11:15 haba Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ;exit 0; fi
-
-mkdir foo && ( cd foo && $SHELL $SHELLVERBOSE ${srcdir}/dir-tree 5 "0 1 2 3 4 5 6 7 8 9" )
-${objdir}/rm-rf foo
diff --git a/usr.sbin/afs/src/tests/deep-tree2 b/usr.sbin/afs/src/tests/deep-tree2
deleted file mode 100644
index 8d6cc7b1bdf..00000000000
--- a/usr.sbin/afs/src/tests/deep-tree2
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-# $KTH: deep-tree2,v 1.1 1999/05/17 16:21:12 lha Exp $
-
-mkdir foo
-
-b=foo
-for a in 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z å ä ö; do
- b=$b/$a
- mkdir $b
-done
-
-rm -rf foo \ No newline at end of file
diff --git a/usr.sbin/afs/src/tests/dir-size-mismatch b/usr.sbin/afs/src/tests/dir-size-mismatch
deleted file mode 100644
index 12ade17fec2..00000000000
--- a/usr.sbin/afs/src/tests/dir-size-mismatch
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-# $KTH: dir-size-mismatch,v 1.3 1999/01/31 19:48:10 assar Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ;exit 0; fi
-
-for i in `awk 'BEGIN {for(i=0; i < 1000; ++i) printf "%d\n", i}' /dev/null`; do
- ln -s hejsan qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq$i
-done
-find . -name 'qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq*' -print | xargs rm
-ln -s foo bar
-rm bar
diff --git a/usr.sbin/afs/src/tests/dir-tree b/usr.sbin/afs/src/tests/dir-tree
deleted file mode 100644
index 7c7b5d05de9..00000000000
--- a/usr.sbin/afs/src/tests/dir-tree
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-# $KTH: dir-tree,v 1.6 2000/07/03 16:13:00 haba Exp $
-
-#######################################################
-#
-# Make a directory tree of directories
-# dir-tree <depth> <dirnames>+
-#
-#######################################################
-
-DEPTH=$1; shift
-DIRNUMS="$*"
-export DIRNUMS DEPTH
-
-# catch non numeric args and recurse cond
-expr $DEPTH '>' 0 > /dev/null 2>&1 || exit 0
-
-for a in $DIRNUMS; do
- (mkdir $a && cd $a && \
- $SHELL $SHELLVERBOSE ${srcdir}/dir-tree \
- `expr $DEPTH - 1` "$DIRNUMS") || exit 1
-done
diff --git a/usr.sbin/afs/src/tests/discon-create b/usr.sbin/afs/src/tests/discon-create
deleted file mode 100644
index b4b566a1630..00000000000
--- a/usr.sbin/afs/src/tests/discon-create
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-# $KTH: discon-create,v 1.3 2000/06/10 09:17:06 assar Exp $
-FS=${FS:-${objdir}/../appl/fs/fs}
-${FS} conn disconn
-> foobar
-${FS} conn conn
diff --git a/usr.sbin/afs/src/tests/discon-echo b/usr.sbin/afs/src/tests/discon-echo
deleted file mode 100644
index c7e732980ab..00000000000
--- a/usr.sbin/afs/src/tests/discon-echo
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-# $KTH: discon-echo,v 1.3 2000/06/10 09:17:07 assar Exp $
-FS=${FS:-${objdir}/../appl/fs/fs}
-${FS} conn disconn
-echo hej > hej
-${FS} conn conn
diff --git a/usr.sbin/afs/src/tests/discon-mkdir b/usr.sbin/afs/src/tests/discon-mkdir
deleted file mode 100644
index 868be423f82..00000000000
--- a/usr.sbin/afs/src/tests/discon-mkdir
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-# $KTH: discon-mkdir,v 1.3 2000/06/10 09:17:07 assar Exp $
-FS=${FS:-${objdir}/../appl/fs/fs}
-${FS} conn disconn
-mkdir dir
-${FS} conn conn
diff --git a/usr.sbin/afs/src/tests/discon-mkdir2 b/usr.sbin/afs/src/tests/discon-mkdir2
deleted file mode 100644
index 7ef77124bdb..00000000000
--- a/usr.sbin/afs/src/tests/discon-mkdir2
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-# $KTH: discon-mkdir2,v 1.3 2000/06/10 09:17:08 assar Exp $
-FS=${FS:-${objdir}/../appl/fs/fs}
-${FS} conn disconn
-mkdir dir || exit 1
-cd dir || exit 1
-${FS} conn conn
diff --git a/usr.sbin/afs/src/tests/discon-tar1 b/usr.sbin/afs/src/tests/discon-tar1
deleted file mode 100644
index 1d91a764e1a..00000000000
--- a/usr.sbin/afs/src/tests/discon-tar1
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-# $KTH: discon-tar1,v 1.4 2000/06/10 09:17:08 assar Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-FS=${FS:-${objdir}/../appl/fs/fs}
-TARBOLL=$AFSROOT/stacken.kth.se/ftp/pub/gnu/emacs/emacs-20.5a.tar.gz
-file $TARBOLL >&4 || exit 1
-${FS} conn disconn
-gzip -dc $TARBOLL | tar xvf - >&4 || exit 1
-${FS} conn conn
diff --git a/usr.sbin/afs/src/tests/discon-tar2 b/usr.sbin/afs/src/tests/discon-tar2
deleted file mode 100644
index 991fcaa2a7e..00000000000
--- a/usr.sbin/afs/src/tests/discon-tar2
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-# $KTH: discon-tar2,v 1.4 2000/06/10 09:17:08 assar Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-FS=${FS:-${objdir}/../appl/fs/fs}
-TARBOLL=$AFSROOT/stacken.kth.se/ftp/pub/gnu/emacs/emacs-20.5a.tar.gz
-file $TARBOLL >&4 || exit 1
-mkdir one || exit 1
-(cd one && gzip -dc $TARBOLL | tar xvf - >&4 || exit 1)
-${FS} conn disconn
-mkdir two || exit 1
-(cd two && gzip -dc $TARBOLL | tar xvf - >&4 || exit 1)
-${FS} conn conn
-diff -r one two >/dev/null || exit 1
diff --git a/usr.sbin/afs/src/tests/discon-touch1 b/usr.sbin/afs/src/tests/discon-touch1
deleted file mode 100644
index 3113de7f3a4..00000000000
--- a/usr.sbin/afs/src/tests/discon-touch1
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-# $KTH: discon-touch1,v 1.3 2000/06/10 09:17:09 assar Exp $
-FS=${FS:-${objdir}/../appl/fs/fs}
-> foobar
-${FS} conn disconn
-touch foobar
-${FS} conn conn
diff --git a/usr.sbin/afs/src/tests/discon-touch2 b/usr.sbin/afs/src/tests/discon-touch2
deleted file mode 100644
index c8bf89fc9ab..00000000000
--- a/usr.sbin/afs/src/tests/discon-touch2
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-# $KTH: discon-touch2,v 1.3 2000/06/10 09:17:09 assar Exp $
-FS=${FS:-${objdir}/../appl/fs/fs}
-> foobar
-${FS} conn disconn
-touch foobar
-touch foobar
-${FS} conn conn
diff --git a/usr.sbin/afs/src/tests/dup2-and-unlog.c b/usr.sbin/afs/src/tests/dup2-and-unlog.c
deleted file mode 100644
index 0151fe79ddb..00000000000
--- a/usr.sbin/afs/src/tests/dup2-and-unlog.c
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <err.h>
-#include <roken.h>
-#include <atypes.h>
-#include <kafs.h>
-
-#ifdef KERBEROS
-
-int
-main(int argc, char **argv)
-{
- int fd;
-
- set_progname (argv[0]);
-
- if (!k_hasafs())
- errx (1, "no afs");
-
- fd = open ("foo", O_RDWR|O_CREAT, 0666);
- if (fd < 0)
- err (1, "open");
-
- dup2 (fd + 1, fd);
-
- if (write (fd, "foo\n", 4) != 4)
- errx (1, "write");
-
- k_unlog();
-
- close (fd);
- close (fd + 1);
-
- exit (0);
-}
-
-#else /* !KERBEROS */
-
-int
-main (int argc, char **argv)
-{
- set_progname (argv[0]);
-
- errx (1, "no kafs");
-}
-
-#endif /* !KERBEROS */
diff --git a/usr.sbin/afs/src/tests/echo-n.c b/usr.sbin/afs/src/tests/echo-n.c
deleted file mode 100644
index dd2508e2a8b..00000000000
--- a/usr.sbin/afs/src/tests/echo-n.c
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-
-RCSID("$KTH: echo-n.c,v 1.1 1999/12/11 04:57:31 lha Exp $");
-
-int
-main (int argc, char **argv)
-{
- int i;
- for (i = 1; i < argc ; i++) {
- printf ("%s", argv[i]);
- if (argc > i + 1)
- printf (" ");
- }
- fflush (stdout);
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/exec b/usr.sbin/afs/src/tests/exec
deleted file mode 100644
index f6535c0531b..00000000000
--- a/usr.sbin/afs/src/tests/exec
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-echo '#!/bin/sh' > foo.sh
-export objdir
-echo '$objdir/echo-n "foo"' >> foo.sh
-test -f foo.sh || exit 1
-chmod +x foo.sh
-test -x foo.sh || exit 1
-FOO=`./foo.sh`
-test "X"$FOO = "Xfoo" || exit 1
diff --git a/usr.sbin/afs/src/tests/exit-wo-close.c b/usr.sbin/afs/src/tests/exit-wo-close.c
deleted file mode 100644
index 334d3bcea21..00000000000
--- a/usr.sbin/afs/src/tests/exit-wo-close.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: exit-wo-close.c,v 1.4 2000/10/03 00:33:44 lha Exp $");
-#endif
-
-static int
-child (const char *filename)
-{
- int fd;
- int ret;
-
- fd = open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
- if (fd < 0)
- err (1, "open %s", filename);
- ret = write (fd, "hej", 3);
- if (ret != 3)
- err (1, "write %s", filename);
- return 0;
-}
-
-static int
-parent (const char *filename, pid_t child_pid)
-{
- int stat;
- int ret;
- int fd;
- struct stat sb;
- char buf[3];
-
- ret = waitpid (child_pid, &stat, 0);
- if (ret < 0)
- err (1, "waitpid %u", (unsigned)child_pid);
- if (!WIFEXITED(stat) || WEXITSTATUS(stat) != 0)
- errx (1, "weird child %u", (unsigned)child_pid);
- fd = open (filename, O_RDONLY, 0);
- if (fd < 0)
- err (1, "open %s", filename);
- ret = fstat (fd, &sb);
- if (ret < 0)
- err (1, "fstat %s", filename);
- if (sb.st_size != 3)
- errx (1, "size of %s = %u != 3", filename, (unsigned)sb.st_size);
- ret = read (fd, buf, sizeof(buf));
- if (ret < 0)
- err (1, "read %s", filename);
- if (ret != 3)
- errx (1, "short read from %s", filename);
- if (memcmp (buf, "hej", 3) != 0)
- errx (1, "bad contents of %s = `%.3s'", filename, buf);
- close (fd);
- return 0;
-}
-
-static int
-doit (const char *filename)
-{
- pid_t pid;
-
- pid = fork ();
- if (pid < 0)
- err (1, "fork");
-
- if (pid == 0)
- return child (filename);
- else
- return parent (filename, pid);
-}
-
-int
-main(int argc, char **argv)
-{
- const char *file = "foo";
-
- set_progname (argv[0]);
-
- if (argc != 2 && argc != 1)
- errx (1, "usage: %s [file]", argv[0]);
- if (argc == 2)
- file = argv[1];
- return doit (file);
-}
diff --git a/usr.sbin/afs/src/tests/fcachesize-dir b/usr.sbin/afs/src/tests/fcachesize-dir
deleted file mode 100644
index 5a199b12251..00000000000
--- a/usr.sbin/afs/src/tests/fcachesize-dir
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-# $KTH: fcachesize-dir,v 1.3 2000/06/10 09:17:10 assar Exp $
-
-FS=${FS:-${objdir}/../appl/fs/fs}
-SIZE1=`$FS getcache -b | awk '{ print $4 ; exit }'`
-mkdir foo
-SIZE2=`$FS getcache -b | awk '{ print $4 ; exit }'`
-test $SIZE2 = `expr $SIZE1 + 2048` || exit 1
-rmdir foo
-#SIZE3=`$FS getcache -b | awk '{ print $4 ; exit }'`
-#test $SIZE3 = $SIZE1 || exit 1
-
-exit 0
diff --git a/usr.sbin/afs/src/tests/fcachesize-file-small b/usr.sbin/afs/src/tests/fcachesize-file-small
deleted file mode 100644
index 42b5737c624..00000000000
--- a/usr.sbin/afs/src/tests/fcachesize-file-small
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-# $KTH: fcachesize-file-small,v 1.3 2000/06/10 09:17:10 assar Exp $
-
-FS=${FS:-${objdir}/../appl/fs/fs}
-SIZE1=`$FS getcache -b | awk '{ print $4 ; exit }'`
-echo foo > foo
-SIZE2=`$FS getcache -b | awk '{ print $4 ; exit }'`
-test $SIZE2 = `expr $SIZE1 + 4` || exit 1
-rm foo
-#SIZE3=`$FS getcache -b | awk '{ print $4 ; exit }'`
-#test $SIZE3 = $SIZE1 || exit 1
-
-exit 0
diff --git a/usr.sbin/afs/src/tests/fchmod.c b/usr.sbin/afs/src/tests/fchmod.c
deleted file mode 100644
index c112ab6ce95..00000000000
--- a/usr.sbin/afs/src/tests/fchmod.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <err.h>
-#include <roken.h>
-
-RCSID("$KTH: fchmod.c,v 1.2 2000/10/03 00:33:49 lha Exp $");
-
-int
-main(int argc, char **argv)
-{
- int fd, ret;
- struct stat sb;
-
- set_progname (argv[0]);
-
- fd = open ("deps", O_WRONLY|O_CREAT|O_TRUNC, 0666);
- if (fd < 0)
- err (1, "open");
- ret = fstat (fd, &sb);
- if (ret < 0)
- err (1, "fstat");
- ret = write (fd, "# DO NOT DELETE\n", 16);
- if (ret != 16)
- err (1, "write");
- ret = fchmod (fd, 0100644);
- if (ret < 0)
- errx (1, "fchmod");
- ret = close (fd);
- if (ret < 0)
- errx (1, "close");
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/fhbench.c b/usr.sbin/afs/src/tests/fhbench.c
deleted file mode 100644
index 7365a91b105..00000000000
--- a/usr.sbin/afs/src/tests/fhbench.c
+++ /dev/null
@@ -1,370 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <unistd.h>
-#include <limits.h>
-#include <sys/mount.h>
-
-#ifdef HAVE_SYS_IOCCOM_H
-#include <sys/ioccom.h>
-#endif
-
-#include <fcntl.h>
-
-#include <err.h>
-#include <roken.h>
-#include <agetarg.h>
-
-#include <atypes.h>
-#include <roken.h>
-#include <kafs.h>
-
-RCSID("$KTH: fhbench.c,v 1.6.2.1 2002/02/24 22:37:36 lha Exp $");
-
-struct fhb_handle {
- char data[512];
-};
-
-static int help_flag;
-static int num_files;
-static int write_file = 0;
-static int num_runs = 3;
-
-static struct agetargs args[] = {
- {"num", 'n', aarg_integer, &num_files, "number of files"},
- {"write", 'w', aarg_integer, &write_file, "write num kb"},
- {"runs", 'r', aarg_integer, &num_runs, "number of runs"},
- {"help", 0, aarg_flag, &help_flag, NULL, NULL},
- {NULL, 0, aarg_end, NULL, NULL, NULL}
-};
-
-
-static void
-fhb_fhget (char *filename, struct fhb_handle *handle)
-{
- int ret = 0;
-#if defined(HAVE_GETFH) && defined(HAVE_FHOPEN)
- {
- fhandle_t fh;
-
- ret = getfh (filename, &fh);
- if (ret)
- err (1, "getfh");
- memcpy (handle, &fh, sizeof(fh));
- }
-#endif
-#ifdef KERBEROS
- {
- struct ViceIoctl vice_ioctl;
-
- vice_ioctl.in = NULL;
- vice_ioctl.in_size = 0;
-
- vice_ioctl.out = (caddr_t)handle;
- vice_ioctl.out_size = sizeof(*handle);
-
- ret = k_pioctl (filename, VIOC_FHGET, &vice_ioctl, 0);
- if (ret)
- errx (1, "k_pioctl");
- }
-#endif
-}
-
-
-static int
-fhb_fhopen (struct fhb_handle *handle, int flags)
-{
- int ret;
-#if defined(HAVE_GETFH) && defined(HAVE_FHOPEN)
- {
- fhandle_t fh;
-
- memcpy (&fh, handle, sizeof(fh));
- ret = fhopen (&fh, flags);
- if (ret >= 0)
- return ret;
- }
-#endif
-
-#ifdef KERBEROS /* really KAFS */
- {
- struct ViceIoctl vice_ioctl;
-
- vice_ioctl.in = (caddr_t)handle;
- vice_ioctl.in_size = sizeof(*handle);
-
- vice_ioctl.out = NULL;
- vice_ioctl.out_size = 0;
-
- ret = k_pioctl (NULL, VIOC_FHOPEN, &vice_ioctl, flags);
- if (ret >= 0)
- return ret;
- }
-#endif
- errx (1, "fhopen/k_pioctl");
-}
-
-static void
-nop_call (void)
-{
-#ifdef KERBEROS /* really KAFS */
- {
- struct ViceIoctl vice_ioctl;
- char c[8];
- int ret;
-
- vice_ioctl.in = (caddr_t)&c;
- vice_ioctl.in_size = sizeof(c);
-
- vice_ioctl.out = NULL;
- vice_ioctl.out_size = 0;
-
- ret = k_pioctl (NULL, VIOC_XFSDEBUG, &vice_ioctl, 0);
- if (ret < 0)
- err (1, "k_pioctl");
- }
-#else
- {
- static first = 1;
- if (first) {
- warnx ("can't test this");
- first = 0;
- }
- }
-#endif
-}
-
-static void
-create_file (int num, struct fhb_handle *handle)
-{
- int fd;
- char filename[1024];
-
- snprintf (filename, sizeof(filename), "file-%d", num);
-
- fd = open (filename, O_CREAT|O_EXCL|O_RDWR, 0666);
- if (fd < 0)
- err (1, "open");
-
- close (fd);
-
- fhb_fhget(filename, handle);
-}
-
-char databuf[1024];
-
-static void
-write_to_file (int fd, int num)
-{
- int ret;
- while (num > 0) {
- ret = write (fd, databuf, sizeof(databuf));
- if (ret != sizeof(databuf))
- err (1, "write");
- num--;
- }
-}
-
-static void
-fhopen_file (int num, struct fhb_handle *handle)
-{
- int fd;
-
- fd = fhb_fhopen(handle, O_RDWR);
- if (fd < 0)
- err (1, "open");
-
- if (write_file)
- write_to_file(fd, write_file);
- close(fd);
-}
-
-static void
-open_file (int num)
-{
- int fd;
- char filename[1024];
-
- snprintf (filename, sizeof(filename), "file-%d", num);
-
- fd = open (filename, O_RDWR, 0666);
- if (fd < 0)
- err (1, "open");
-
- if (write_file)
- write_to_file(fd, write_file);
-
- close (fd);
-}
-
-static void
-unlink_file (int num)
-{
- int ret;
- char filename[1024];
-
- snprintf (filename, sizeof(filename), "file-%d", num);
-
- ret = unlink(filename);
- if (ret < 0)
- err (1, "unlink");
-}
-
-/*
- * Make `t1' consistent.
- */
-
-static void
-tvfix(struct timeval *t1)
-{
- if (t1->tv_usec < 0) {
- t1->tv_sec--;
- t1->tv_usec += 1000000;
- }
- if (t1->tv_usec >= 1000000) {
- t1->tv_sec++;
- t1->tv_usec -= 1000000;
- }
-}
-
-/*
- * t1 -= t2
- */
-
-static void
-tvsub(struct timeval *t1, const struct timeval *t2)
-{
- t1->tv_sec -= t2->tv_sec;
- t1->tv_usec -= t2->tv_usec;
- tvfix(t1);
-}
-
-
-struct timeval time1, time2;
-
-static void
-starttesting(char *msg)
-{
- printf("testing %s...\n", msg);
- fflush (stdout);
- gettimeofday(&time1, NULL);
-}
-
-static void
-endtesting(void)
-{
- gettimeofday(&time2, NULL);
- tvsub(&time2, &time1);
- printf("timing: %ld.%06ld\n", (long)time2.tv_sec, (long)time2.tv_usec);
-}
-
-static void
-usage (int exit_val)
-{
- aarg_printusage (args, NULL, "number of files", AARG_GNUSTYLE);
- exit (exit_val);
-}
-
-static void
-open_bench (int i, struct fhb_handle *handles)
-{
- printf ("====== test run %d\n"
- "==================\n",
- i);
-
- starttesting ("fhopening files");
- for (i = 0; i < num_files; i++)
- fhopen_file (i, &handles[i]);
- endtesting ();
-
- starttesting ("opening files");
- for (i = 0; i < num_files; i++)
- open_file (i);
- endtesting ();
-}
-
-int
-main (int argc, char **argv)
-{
- int optind = 0;
- int i;
- struct fhb_handle *handles;
-
- set_progname (argv[0]);
-
- if (agetarg (args, argc, argv, &optind, AARG_GNUSTYLE))
- usage (1);
-
- if (help_flag)
- usage (0);
-
- if (num_files <= 0)
- usage (1);
-
- if (write_file < 0)
- usage (1);
-
- if (!k_hasafs())
- errx (1, "no afs kernel module");
-
- handles = emalloc (num_files * sizeof(*handles));
-
- starttesting ("creating files");
- for (i = 0; i < num_files; i++)
- create_file (i, &handles[i]);
- endtesting ();
-
- for (i = 0 ; i < num_runs; i++)
- open_bench (i, handles);
-
- printf ( "==================\n");
- starttesting ("unlink files");
- for (i = 0; i < num_files; i++)
- unlink_file (i);
- endtesting ();
-
- printf ( "==================\n");
- starttesting ("nop call");
- for (i = 0; i < num_files; i++)
- nop_call ();
- endtesting ();
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/find-and-cat-netbsd b/usr.sbin/afs/src/tests/find-and-cat-netbsd
deleted file mode 100644
index c005848652a..00000000000
--- a/usr.sbin/afs/src/tests/find-and-cat-netbsd
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-# $KTH: find-and-cat-netbsd,v 1.6 1999/08/14 02:25:09 lha Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-netbsd_ftp_mirror=${1-$AFSROOT/stacken.kth.se/ftp/pub/NetBSD/NetBSD-1.4/}
-find ${netbsd_ftp_mirror} -type f -exec cat '{}' \; > /dev/null
diff --git a/usr.sbin/afs/src/tests/find-linux b/usr.sbin/afs/src/tests/find-linux
deleted file mode 100644
index 5c5fd4ed1d7..00000000000
--- a/usr.sbin/afs/src/tests/find-linux
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-# $KTH: find-linux,v 1.1 1999/08/14 02:30:06 lha Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-linux_src=${1-$AFSROOT/pdc.kth.se/src/OS/Linux/}
-(cd ${linux_src} ; find . ) >&4
diff --git a/usr.sbin/afs/src/tests/fs-flush b/usr.sbin/afs/src/tests/fs-flush
deleted file mode 100644
index de50d5f77fc..00000000000
--- a/usr.sbin/afs/src/tests/fs-flush
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-# $KTH: fs-flush,v 1.3 2000/06/10 09:17:10 assar Exp $
-FS=${FS:-${objdir}/../appl/fs/fs}
-> foobar
-${FS} flush
-test -f foobar || exit 1 \ No newline at end of file
diff --git a/usr.sbin/afs/src/tests/fs-sa-la b/usr.sbin/afs/src/tests/fs-sa-la
deleted file mode 100644
index 095fc5d13a8..00000000000
--- a/usr.sbin/afs/src/tests/fs-sa-la
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-# $KTH: fs-sa-la,v 1.3 2000/06/10 09:17:11 assar Exp $
-FS=${FS:-${objdir}/../appl/fs/fs}
-${FS} sa . kalle-anka-nu rl 2>&4
-${FS} la >&4 2>&4
-exit 0
diff --git a/usr.sbin/afs/src/tests/ga-test.c b/usr.sbin/afs/src/tests/ga-test.c
deleted file mode 100644
index 46eccbd603c..00000000000
--- a/usr.sbin/afs/src/tests/ga-test.c
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * Copyright (c) 1999 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Test if agetarg works as expected
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-
-#include <err.h>
-#include <roken.h>
-
-#include <agetarg.h>
-
-RCSID("$KTH: ga-test.c,v 1.12 2000/10/03 00:33:59 lha Exp $");
-
-typedef struct {
- int style;
- int argc;
- char *argv[10];
- enum { GA_SUCCESS = 0, GA_FAILURE } retval ;
-} ga_tests;
-
-
-/* XXX TODO: aarg_negative_flag, manualpage generation ? */
-
-/*
- *
- */
-
-static void
-test_simple_string (void)
-{
- char *string;
- int i, optind;
- ga_tests tests[] = {
- { AARG_GNUSTYLE, 2, { "string", "--string=foo", NULL } },
- { AARG_GNUSTYLE, 3, { "string", "-s", "foo", NULL} },
- { AARG_AFSSTYLE, 3, { "string", "-string", "foo", NULL} },
- { AARG_AFSSTYLE, 2, { "string", "--flag"}, GA_FAILURE },
- { AARG_AFSSTYLE, 2, { "string", "foo", NULL} }
- };
-
- struct agetargs args[] = {
- { "string", 's', aarg_string, NULL,
- "string test", "stringfoo", aarg_mandatory},
- { NULL, 0, aarg_end, NULL, NULL }
- }, *a = args;
-
- a->value = &string;
-
- for (i = 0 ; i < sizeof(tests)/sizeof(*tests); i++) {
- string = NULL;
- optind = 0;
-
- if (agetarg (args, tests[i].argc, tests[i].argv, &optind,
- tests[i].style)) {
- if (tests[i].retval == GA_FAILURE)
- continue;
- warnx ("test_string: %s failed for test %d",
- tests[i].argv[1], i);
- continue;
- } else {
- if (tests[i].retval != GA_SUCCESS) {
- warnx ("test_string: %s failed to fail for test %d",
- tests[i].argv[1], i);
- continue;
- }
- }
-
- if (optind != tests[i].argc) {
- warnx ("argc != optind for test %s, %d", tests[i].argv[1], i);
- continue;
- }
-
- if (string == NULL || strcmp (string, "foo") != 0) {
- warnx ("error parsing for test %d: string", i);
- continue;
- }
- }
-}
-
-/*
- *
- */
-
-static void
-test_simple_strings (void)
-{
- agetarg_strings strings;
-
- int i, optind;
- ga_tests tests[] = {
- { AARG_GNUSTYLE, 3, { "strings",
- "--strings=foo", "--strings=bar", NULL } },
- { AARG_GNUSTYLE, 5, { "strings", "-s", "foo", "-s", "bar", NULL} },
- { AARG_AFSSTYLE, 4, { "strings", "-string", "foo", "bar", NULL} }
-#if 0
- { AARG_AFSSTYLE, 3, { "strings", "foo", "bar", NULL} }
-#endif
- };
-
- struct agetargs args[] = {
- { "strings", 's', aarg_strings, NULL,
- "strings test", "stringsfoo", aarg_optional},
- { NULL, 0, aarg_end, NULL, NULL }
- }, *a = args;
-
- a->value = &strings;
-
- for (i = 0 ; i < sizeof(tests)/sizeof(*tests); i++) {
- strings.num_strings = 0;
- strings.strings = NULL;
- optind = 0;
-
- if (agetarg (args, tests[i].argc, tests[i].argv, &optind,
- tests[i].style)) {
- if (tests[i].retval == GA_FAILURE)
- continue;
- warnx ("test_strings: %s failed for test %d",
- tests[i].argv[1], i);
- continue;
- } else {
- if (tests[i].retval != GA_SUCCESS) {
- warnx ("test_strings: %s failed to fail for test %d",
- tests[i].argv[1], i);
- continue;
- }
- }
-
- if (optind != tests[i].argc) {
- warnx ("argc != optind for test %s, %d",
- tests[i].argv[1], i);
- continue;
- }
-
- if (strings.num_strings != 2
- || strcmp(strings.strings[0], "foo") != 0
- || strcmp(strings.strings[1], "bar") != 0)
- {
- warnx ("error parsing for test %d: strings", i);
- continue;
- }
- }
-}
-
-/*
- *
- */
-
-static void
-test_simple_integer (void)
-{
- int integer;
- int i, optind;
- ga_tests tests[] = {
- { AARG_GNUSTYLE, 2, { "integer", "--integer=4711", NULL } },
- { AARG_GNUSTYLE, 3, { "integer", "-i", "4711", NULL} },
- { AARG_AFSSTYLE, 3, { "integer", "-integer", "4711", NULL} },
- { AARG_AFSSTYLE, 2, { "integer", "4711", NULL} }
- };
-
- struct agetargs args[] = {
- { "integer", 'i', aarg_integer, NULL,
- "integer test", "integer", aarg_mandatory},
- { NULL, 0, aarg_end, NULL, NULL }
- }, *a = args;
-
- a->value = &integer;
-
- for (i = 0 ; i < sizeof(tests)/sizeof(*tests); i++) {
- integer = 0;
- optind = 0;
-
- if (agetarg (args, tests[i].argc, tests[i].argv, &optind,
- tests[i].style)) {
- if (tests[i].retval == GA_FAILURE)
- continue;
- warnx ("test_integer: %s failed for test %d",
- tests[i].argv[1], i);
- continue;
- } else {
- if (tests[i].retval != GA_SUCCESS) {
- warnx ("test_integer: %s failed to fail for test %d",
- tests[i].argv[1], i);
- continue;
- }
- }
-
- if (optind != tests[i].argc) {
- warnx ("argc != optind for test %s, %d",
- tests[i].argv[1], i);
- continue;
- }
-
- if (integer != 4711) {
- warnx ("error parsing for test %d: integer 4711", i);
- continue;
- }
- }
-}
-
-/*
- *
- */
-
-static void
-test_simple_flag (void)
-{
- int flag;
- int i, optind;
- ga_tests tests[] = {
- { AARG_GNUSTYLE, 2, { "flag", "--flag=yes", NULL }, GA_SUCCESS },
- { AARG_GNUSTYLE, 2, { "flag", "-g", NULL}, GA_SUCCESS },
- { AARG_AFSSTYLE, 2, { "flag", "--flag"}, GA_FAILURE },
- { AARG_AFSSTYLE, 2, { "flag", "-flag", NULL}, GA_SUCCESS },
-#if 0
- /* XXX */
- { AARG_AFSSTYLE, 2, { "flag", "yes", NULL}, GA_SUCCESS },
-#endif
- { AARG_GNUSTYLE, 2, { "flag", "--no-flag", NULL}, GA_SUCCESS }
- };
-
- struct agetargs args[] = {
- { "flag", 'g', aarg_flag, NULL,
- "flag", "flag bar", aarg_optional},
- { NULL, 0, aarg_end, NULL, NULL }
- }, *a = args;
-
- a->value = &flag;
-
- for (i = 0 ; i < sizeof(tests)/sizeof(*tests); i++) {
- if (i < 4)
- flag = 0;
- else
- flag = 1;
- optind = 0;
-
- if (agetarg (args, tests[i].argc, tests[i].argv, &optind,
- tests[i].style)) {
- if (tests[i].retval == GA_FAILURE)
- continue;
- warnx ("test_flag: %s failed for test %d",
- tests[i].argv[1], i);
- continue;
- } else {
- if (tests[i].retval != GA_SUCCESS) {
- warnx ("test_flag: %s failed to fail for test %d",
- tests[i].argv[1], i);
- continue;
- }
- }
-
- if (optind != tests[i].argc) {
- warnx ("argc != optind for test %s, %d",
- tests[i].argv[1], i);
- continue;
- }
-
- if (i < 4) {
- if (flag == 0) {
- warnx ("error parsing for test %d: flag %s",
- i,
- tests[i].argv[1]);
- continue;
- }
- } else {
- if (flag != 0) {
- warnx ("error parsing test %d: flag %s",
- i,
- tests[i].argv[1]);
- continue;
- }
- }
- }
-}
-
-/*
- *
- */
-
-int
-main (int argc, char **argv)
-{
- set_progname (argv[0]);
-
- test_simple_string();
- test_simple_strings();
- test_simple_integer();
- test_simple_flag();
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/generic-build b/usr.sbin/afs/src/tests/generic-build
deleted file mode 100644
index ed5f489712f..00000000000
--- a/usr.sbin/afs/src/tests/generic-build
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-# $KTH: generic-build,v 1.5 2000/01/05 11:20:20 assar Exp $
-if test $# -ne 1 -a $# -ne 2; then
- echo "Usage: $0 file [directory]"
- exit 1
-fi
-filename=$1
-if test $# -gt 1; then
- b=$2
-else
- b=`basename $filename .tar.gz`
-fi
-obj=$b-obj
-
-gzip -dc $filename | tar xvf - >&4 2>&1 || exit 1
-mkdir $obj || exit 1
-cd $obj || exit 1
-../$b/configure >&4 || exit 1
-make $MAKEFLAGS || exit 1
diff --git a/usr.sbin/afs/src/tests/getdents-and-unlink1 b/usr.sbin/afs/src/tests/getdents-and-unlink1
deleted file mode 100644
index fde732982fe..00000000000
--- a/usr.sbin/afs/src/tests/getdents-and-unlink1
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-# $KTH: getdents-and-unlink1,v 1.5 2000/07/01 05:41:41 assar Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-gzip -dc ${AFSROOT}/stacken.kth.se/ftp/pub/gnu/emacs/emacs-20.7.tar.gz |
-tar vxf - >&4 2>&1 || exit 1
-cd emacs-20.7 || exit 1
-$objdir/kill-softer lisp || exit 1
-test -d lisp && exit 1
-exit 0
diff --git a/usr.sbin/afs/src/tests/getdents-and-unlink2 b/usr.sbin/afs/src/tests/getdents-and-unlink2
deleted file mode 100644
index 792f7b1c26b..00000000000
--- a/usr.sbin/afs/src/tests/getdents-and-unlink2
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-# $KTH: getdents-and-unlink2,v 1.6 2000/07/01 05:41:41 assar Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-gzip -dc ${AFSROOT}/stacken.kth.se/ftp/pub/gnu/emacs/emacs-20.7.tar.gz |
-tar vxf - >&4 2>&1 || exit 1
-cd emacs-20.7 || exit 1
-$objdir/rm-rf lisp || exit 1
-test -d lisp && exit 1
-exit 0
diff --git a/usr.sbin/afs/src/tests/getdents-and-unlink3 b/usr.sbin/afs/src/tests/getdents-and-unlink3
deleted file mode 100644
index 5c6d10a852a..00000000000
--- a/usr.sbin/afs/src/tests/getdents-and-unlink3
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-# $KTH: getdents-and-unlink3,v 1.6 2000/07/01 05:41:41 assar Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-gzip -dc ${AFSROOT}/stacken.kth.se/ftp/pub/gnu/emacs/emacs-20.7.tar.gz |
-tar vxf - >&4 2>&1 || exit 1
-cd emacs-20.7 || exit 1
-$objdir/kill-softly lisp || exit 1
-test -d lisp && exit 1
-exit 0
diff --git a/usr.sbin/afs/src/tests/hardlink1.c b/usr.sbin/afs/src/tests/hardlink1.c
deleted file mode 100644
index ea279673f2a..00000000000
--- a/usr.sbin/afs/src/tests/hardlink1.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright (c) 1999 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: hardlink1.c,v 1.5 2000/10/03 00:34:04 lha Exp $");
-#endif
-
-int
-main(int argc, char *argv[])
-{
- int fd1, fd2;
- int ret;
- struct stat sb1, sb2;
-
- set_progname (argv[0]);
-
- fd1 = open("foo", O_RDWR|O_CREAT, 0666);
- if (fd1 < 0)
- err (1, "open foo");
-
- ret = fstat (fd1, &sb1);
- if (ret < 0)
- err (1, "stat foo");
-
- if (sb1.st_nlink != 1)
- errx (1, "foo.st_nlink != 1");
-
- ret = link ("foo", "bar");
- if (ret < 0)
- err (1, "link foo, bar");
-
- ret = fstat (fd1, &sb1);
- if (ret < 0)
- err (1, "stat foo");
-
- ret = lstat ("bar", &sb2);
- if (ret < 0)
- err (1, "stat bar");
-
- if (sb1.st_nlink != 2)
- errx (1, "foo.st_nlink != 2");
-
- if (sb2.st_nlink != 2)
- errx (1, "bar.st_nlink != 2");
-
- if (sb1.st_dev != sb2.st_dev
- || sb1.st_ino != sb2.st_ino)
- errx (1, "dev and ino differ");
-
- fd2 = open("bar", O_RDONLY, 0);
- if (fd2 < 0)
- err (1, "open bar");
-
- ret = fstat (fd2, &sb2);
- if (ret < 0)
- err (1, "fstat bar");
-
- if (sb2.st_nlink != 2)
- errx (1, "bar.st_nlink != 2");
-
- if (write (fd1, "hej", 3) != 3)
- errx (1, "write to foo");
-
- ret = fstat (fd1, &sb1);
- if (ret < 0)
- err (1, "stat foo");
-
- if (sb1.st_size != 3)
- errx (1, "foo.st_size != 3");
-
- ret = close (fd1);
- if (ret < 0)
- err (1, "close foo");
-
- ret = fstat (fd2, &sb2);
- if (ret < 0)
- err (1, "fstat bar");
-
- if (sb2.st_size != 3)
- errx (1, "bar.st_size != 3");
-
- if (unlink ("foo") < 0)
- err (1, "unlink foo");
-
- ret = fstat (fd2, &sb2);
- if (ret < 0)
- err (1, "fstat bar");
-
- if (sb2.st_nlink != 1)
- errx (1, "bar.st_nlink != 1");
-
- if (unlink ("bar") < 0)
- err (1, "unlink bar");
-
- ret = fstat (fd2, &sb2);
- if (ret < 0)
- err (1, "fstat bar");
-
- if (sb2.st_nlink != 0)
- errx (1, "bar.st_nlink != 0");
-
- ret = close (fd2);
- if (ret < 0)
- err (1, "close bar");
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/hardlink2.c b/usr.sbin/afs/src/tests/hardlink2.c
deleted file mode 100644
index 5f46d9f9974..00000000000
--- a/usr.sbin/afs/src/tests/hardlink2.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 1999 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: hardlink2.c,v 1.3 2000/10/03 00:34:10 lha Exp $");
-#endif
-
-int
-main(int argc, char *argv[])
-{
- int fd1;
- int ret;
- struct stat sb1;
-
- set_progname (argv[0]);
-
- ret = mkdir ("1", 0777);
- if (ret < 0)
- err (1, "mkdir 1");
-
- ret = link ("1", "2");
- if (ret == 0)
- errx (1, "link 1 2 should have failed");
-
- ret = mkdir ("2", 0777);
- if (ret < 0)
- err (1, "mkdir 2");
-
- fd1 = open("1/foo", O_RDWR|O_CREAT, 0666);
- if (fd1 < 0)
- err (1, "open 1/foo");
-
- ret = fstat (fd1, &sb1);
- if (ret < 0)
- err (1, "stat foo");
-
- if (sb1.st_nlink != 1)
- errx (1, "foo.st_nlink != 1");
-
- ret = close (fd1);
- if (ret < 0)
- err (1, "close 1/foo");
-
- ret = link ("1/foo", "2/foo");
- if (ret == 0)
- unlink ("2/foo");
- if (ret < 0 && errno != EXDEV)
- err (1, "link 1/foo, 2/foo");
-
- ret = unlink ("1/foo");
- if (ret < 0)
- err (1, "unlink 1/foo");
-
- ret = rmdir ("1");
- if (ret < 0)
- err (1, "rmdir 1");
-
- ret = rmdir ("2");
- if (ret < 0)
- err (1, "rmdir 2");
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/hardlink3 b/usr.sbin/afs/src/tests/hardlink3
deleted file mode 100644
index 0edd553bf3e..00000000000
--- a/usr.sbin/afs/src/tests/hardlink3
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-# $KTH: hardlink3,v 1.1.2.2 2001/12/20 20:41:03 lha Exp $
-
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-
-FS=${FS:-${objdir}/../appl/fs/fs}
-
-touch file
-for i in `awk 'BEGIN {for(i=0; i < 1000; ++i) printf "%d\n", i}' /dev/null`; do
- ln file file$i
-done
-
-# now trigger bulkstatus
-for i in `awk 'BEGIN {for(i=0; i < 1000; ++i) printf "%d\n", i}' /dev/null`; do
- ls -l file > /dev/null 2>&1 || exit 1
- ${FS} flush file
-done
-
-# just stat them all
-for i in `awk 'BEGIN {for(i=0; i < 1000; ++i) printf "%d\n", i}' /dev/null`; do
- ls -l file$i > /dev/null 2>&1 || exit 1
-done
-
-#clean up
-for i in `awk 'BEGIN {for(i=0; i < 1000; ++i) printf "%d\n", i}' /dev/null`; do
- rm file$i > /dev/null 2>&1 || exit 1
-done
-rm file \ No newline at end of file
diff --git a/usr.sbin/afs/src/tests/hello-world.in b/usr.sbin/afs/src/tests/hello-world.in
deleted file mode 100644
index 368a6b67810..00000000000
--- a/usr.sbin/afs/src/tests/hello-world.in
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-# $KTH: hello-world.in,v 1.1 1998/11/19 16:47:34 assar Exp $
-cat <<FOO > foo.c
-int main() { return 0; }
-FOO
-%CC% -o foo foo.c || exit 1
-./foo || exit 1
-rm -f foo foo.c
diff --git a/usr.sbin/afs/src/tests/invalidate-file.c b/usr.sbin/afs/src/tests/invalidate-file.c
deleted file mode 100644
index 8312cb2bf20..00000000000
--- a/usr.sbin/afs/src/tests/invalidate-file.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-
-#include <unistd.h>
-#include <fcntl.h>
-
-#include <atypes.h>
-
-#include <kafs.h>
-
-#include <fs.h>
-#include <arlalib.h>
-
-#include <err.h>
-#include <roken.h>
-
-RCSID("$KTH: invalidate-file.c,v 1.3 2000/10/16 22:01:08 assar Exp $");
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-static void
-create_write_file (char *filename)
-{
- int ret;
- int fd;
-
- fs_invalidate (filename);
-
- fd = open(filename, O_RDWR|O_CREAT, 0666);
- if (fd < 0)
- err (1, "open(rw): %s", filename);
-
- ret = write (fd, "foo", 3);
- if (ret < 0)
- err (1, "write");
-
- fs_invalidate (filename);
-
- ret = write (fd, "foo", 3);
- if (ret < 0)
- err (1, "write2");
-
- ret = close (fd);
- if (ret < 0)
- err (1, "close");
-}
-
-static void
-read_file (char *filename)
-{
- int ret;
- int fd;
- char buf[3];
-
- fs_invalidate (filename);
-
- fd = open(filename, O_RDONLY, 0666);
- if (fd < 0)
- err (1, "open(ro)");
-
- ret = read (fd, buf, sizeof(buf));
- if (ret < 0)
- err (1, "read");
-
- fs_invalidate (filename);
-
- ret = read (fd, buf, sizeof(buf));
- if (ret < 0)
- err (1, "read");
-
- ret = close (fd);
- if (ret < 0)
- err (1, "close");
-}
-
-static void
-mmap_read_file (char *filename)
-{
- int fd;
- void *v;
- char buf[6];
-
- fs_invalidate (filename);
-
- fd = open(filename, O_RDONLY, 0666);
- if (fd < 0)
- err (1, "open(ro-mmap)");
-
- v = mmap (NULL, 6, PROT_READ, MAP_SHARED, fd, 0);
- if (v == (void *)MAP_FAILED)
- err (1, "mmap(ro) %s", filename);
-
- memcpy (buf, v, 3);
- fs_invalidate (filename);
- memcpy (buf, v, 3);
-
- munmap (v, 6);
-}
-
-static void
-mmap_write_file (char *filename)
-{
- int fd;
- void *v;
-
- fs_invalidate (filename);
-
- fd = open (filename, O_RDWR, 0666);
- if (fd < 0)
- err (1, "open(rw-mmap)");
-
- v = mmap (NULL, 6, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
- if (v == (void *)MAP_FAILED)
- err (1, "mmap(rw) %s", filename);
-
- memcpy (v, "foo", 3);
- fs_invalidate (filename);
- memcpy (v, "foo", 3);
-
- munmap (v, 6);
- close (fd);
-}
-
-int
-main(int argc, char **argv)
-{
- char *filename = "foo";
-
- set_progname (argv[0]);
-
- if (!k_hasafs())
- exit (1);
-
- create_write_file (filename);
- read_file (filename);
- read_file (filename);
- read_file (filename);
- read_file (filename);
- mmap_read_file (filename);
- mmap_read_file (filename);
- mmap_read_file (filename);
- mmap_read_file (filename);
- mmap_write_file (filename);
- mmap_write_file (filename);
- mmap_write_file (filename);
- mmap_write_file (filename);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/kill-softer.c b/usr.sbin/afs/src/tests/kill-softer.c
deleted file mode 100644
index 77eaeee8d8e..00000000000
--- a/usr.sbin/afs/src/tests/kill-softer.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: kill-softer.c,v 1.10 2000/10/03 00:34:15 lha Exp $");
-#endif
-
-static FILE *verbose;
-
-struct entry {
- char *name;
- int status;
-};
-
-static void
-kill_one (struct entry *ents, int ind, int curents);
-
-static void
-do_dir (const char *dirname);
-
-static void
-kill_dir (const char *dirname);
-
-static void
-kill_one (struct entry *ents, int ind, int curents)
-{
- int ret;
- int i;
-
- ret = unlink (ents[ind].name);
- if (ret < 0) {
- if (errno == EISDIR || errno == EPERM)
- do_dir (ents[ind].name);
- else
- err (1, "unlink %s", ents[ind].name);
- }
- ents[ind].status = 0;
- for (i = 0; i <= ind; ++i) {
- struct stat sb;
-
- ret = lstat (ents[i].name, &sb);
- if (ret == 0 || errno != ENOENT)
- err (1, "%s still exists?", ents[i].name);
- }
-
- for (i = ind + 1; i < curents; ++i) {
- struct stat sb;
-
- ret = lstat (ents[i].name, &sb);
- if (ret < 0)
- err (1, "stat %s", ents[i].name);
- }
-}
-
-static void
-do_dir (const char *dirname)
-{
- int ret;
-
- ret = chdir (dirname);
- if (ret < 0)
- err (1, "chdir %s", dirname);
- kill_dir (dirname);
- ret = chdir ("..");
- if (ret < 0)
- err (1, "chdir ..");
- ret = rmdir (dirname);
- if (ret < 0)
- err (1, "rmdir %s", dirname);
-}
-
-static void
-kill_dir (const char *dirname)
-{
- struct entry *ents;
- int maxents;
- int curents = 0;
- DIR *dir;
- struct dirent *dp;
- int i;
-
- fprintf (verbose, "reading %s\n", dirname);
-
- dir = opendir (".");
- if (dir == NULL)
- err (1, "opendir %s", dirname);
- maxents = 10;
- ents = malloc (sizeof (*ents) * maxents);
- if (ents == NULL)
- err (1, "malloc");
- while ((dp = readdir (dir)) != NULL) {
- if (strcmp (dp->d_name, ".") == 0
- || strcmp (dp->d_name, "..") == 0)
- continue;
-
- if (curents >= maxents) {
- maxents *= 2;
- ents = realloc (ents, sizeof(*ents) * maxents);
- if (ents == NULL)
- err (1, "realloc");
- }
- ents[curents].name = strdup (dp->d_name);
- ents[curents].status = 1;
- ++curents;
- fprintf (verbose, " adding %s\n", dp->d_name);
- }
- closedir (dir);
- dir = opendir (".");
- if (dir == NULL)
- err (1, "opendir %s", dirname);
- i = 0;
- while((dp = readdir (dir)) != NULL) {
- if (strcmp (dp->d_name, ".") == 0
- || strcmp (dp->d_name, "..") == 0)
- continue;
-
- if (strcmp (ents[i].name, dp->d_name) != 0) {
- errx (1, "%s != %s", ents[i].name, dp->d_name);
- }
- fprintf (verbose, " deleting %s\n", ents[i].name);
- kill_one (ents, i, curents);
- ++i;
- }
- if (i != curents)
- errx (1, "missing %d entries in %s", curents - i, dirname);
- closedir (dir);
- free (ents);
- fprintf (verbose, "end of %s\n", dirname);
-}
-
-int
-main(int argc, char **argv)
-{
- set_progname (argv[0]);
-
- verbose = fdopen (4, "w");
- if (verbose == NULL) {
- verbose = fopen ("/dev/null", "w");
- if (verbose == NULL)
- err (1, "fopen /dev/null");
- }
-
- if (argc != 2)
- errx (1, "usage: %s directory", argv[0]);
- do_dir (argv[1]);
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/kill-softly.c b/usr.sbin/afs/src/tests/kill-softly.c
deleted file mode 100644
index 12c2068e9ad..00000000000
--- a/usr.sbin/afs/src/tests/kill-softly.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: kill-softly.c,v 1.6 2000/10/03 00:34:20 lha Exp $");
-#endif
-
-struct entry {
- char *name;
- int status;
-};
-
-static void
-kill_one (struct entry *ents, int ind, int curents);
-
-static void
-do_dir (const char *dirname);
-
-static void
-kill_dir (const char *dirname);
-
-static void
-kill_one (struct entry *ents, int ind, int curents)
-{
- int ret;
- int i;
-
- ret = unlink (ents[ind].name);
- if (ret < 0) {
- if (errno == EISDIR || errno == EPERM)
- do_dir (ents[ind].name);
- else
- err (1, "unlink %s", ents[ind].name);
- }
- ents[ind].status = 0;
- for (i = 0; i <= ind; ++i) {
- struct stat sb;
-
- ret = lstat (ents[i].name, &sb);
- if (ret == 0 || errno != ENOENT)
- err (1, "%s still exists?", ents[i].name);
- }
-
- for (i = ind + 1; i < curents; ++i) {
- struct stat sb;
-
- ret = lstat (ents[i].name, &sb);
- if (ret < 0)
- err (1, "stat %s", ents[i].name);
- }
-}
-
-static void
-do_dir (const char *dirname)
-{
- int ret;
-
- ret = chdir (dirname);
- if (ret < 0)
- err (1, "chdir %s", dirname);
- kill_dir (dirname);
- ret = chdir ("..");
- if (ret < 0)
- err (1, "chdir ..");
- ret = rmdir (dirname);
- if (ret < 0)
- err (1, "rmdir %s", dirname);
-}
-
-static void
-kill_dir (const char *dirname)
-{
- struct entry *ents;
- int maxents;
- int curents = 0;
- DIR *dir;
- struct dirent *dp;
- int i;
-
- dir = opendir (".");
- if (dir == NULL)
- err (1, "opendir %s", dirname);
- maxents = 10;
- ents = malloc (sizeof (*ents) * maxents);
- if (ents == NULL)
- err (1, "malloc");
- while ((dp = readdir (dir)) != NULL) {
- if (strcmp (dp->d_name, ".") == 0
- || strcmp (dp->d_name, "..") == 0)
- continue;
-
- if (curents >= maxents) {
- maxents *= 2;
- ents = realloc (ents, sizeof(*ents) * maxents);
- if (ents == NULL)
- err (1, "realloc");
- }
- ents[curents].name = strdup (dp->d_name);
- ents[curents].status = 1;
- ++curents;
- }
- closedir (dir);
- for (i = 0; i < curents; ++i)
- kill_one (ents, i, curents);
- free (ents);
-}
-
-int
-main(int argc, char **argv)
-{
- set_progname (argv[0]);
-
- if (argc != 2)
- errx (1, "usage: %s directory", argv[0]);
- do_dir (argv[1]);
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/kotest b/usr.sbin/afs/src/tests/kotest
deleted file mode 100644
index cd65793db06..00000000000
--- a/usr.sbin/afs/src/tests/kotest
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# $KTH: kotest,v 1.2 2000/05/19 14:35:33 assar Exp $
-
-exec ${objdir}/../lib/ko/kotest
diff --git a/usr.sbin/afs/src/tests/large-dir-16384 b/usr.sbin/afs/src/tests/large-dir-16384
deleted file mode 100644
index 30695885bfe..00000000000
--- a/usr.sbin/afs/src/tests/large-dir-16384
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# $KTH: large-dir-16384,v 1.3 1998/12/13 09:09:48 map Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-$objdir/large-dir large-dir-16384 16384
diff --git a/usr.sbin/afs/src/tests/large-dir-extra b/usr.sbin/afs/src/tests/large-dir-extra
deleted file mode 100644
index 7fb55fc9493..00000000000
--- a/usr.sbin/afs/src/tests/large-dir-extra
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-# $KTH: large-dir-extra,v 1.2 1999/12/02 22:16:23 assar Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-for i in 10 20 30 31 40 50 60 70 80 90 100; do
- $objdir/large-dir2 large-dir-$i $i || exit 1
- $objdir/large-dir3 large-dir-$i $i || exit 1
-done
diff --git a/usr.sbin/afs/src/tests/large-dir.c b/usr.sbin/afs/src/tests/large-dir.c
deleted file mode 100644
index 269923ba491..00000000000
--- a/usr.sbin/afs/src/tests/large-dir.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: large-dir.c,v 1.7 2000/10/03 00:34:31 lha Exp $");
-#endif
-
-static int
-creat_files (const char *dirname, int count)
-{
- struct stat sb;
- int i;
- DIR *d;
- struct dirent *dp;
-
- if (mkdir (dirname, 0777) < 0)
- err (1, "mkdir %s", dirname);
-
- if (chdir (dirname) < 0)
- err (1, "chdir %s", dirname);
- if (stat (".", &sb) < 0)
- err (1, "stat .");
- if (sb.st_size != 2048)
- errx (1, "size != 2048");
- for (i = 0; i < count; ++i) {
- char num[17];
- int fd;
-
- snprintf (num, sizeof(num), "%d", i);
-
- fd = open (num, O_CREAT | O_EXCL, 0777);
- if (fd < 0)
- err (1, "open %s", num);
- if (close (fd) < 0)
- err (1, "close %s", num);
- }
- if (stat (".", &sb) < 0)
- err (1, "stat .");
-
- d = opendir (".");
- if (d == NULL)
- err (1, "opendir .");
- for (i = -2; i < count; ++i) {
- char num[17];
-
- dp = readdir (d);
- if (dp == NULL)
- errx (1, "out of entries at %d?", i);
- if (i == -2)
- strlcpy (num, ".", sizeof(num));
- else if (i == -1)
- strlcpy (num, "..", sizeof(num));
- else
- snprintf (num, sizeof(num), "%d", i);
- if (strcmp (num, dp->d_name) != 0)
- errx (1, "'%s' != '%s'", num, dp->d_name);
- }
- if (readdir (d) != NULL)
- errx (1, "more entries?");
- closedir (d);
- for (i = 0; i < count; ++i) {
- char num[17];
-
- snprintf (num, sizeof(num), "%d", i);
-
- if (unlink (num) < 0)
- err (1, "unlink %s", num);
- }
- d = opendir (".");
- if (d == NULL)
- err (1, "opendir .");
- dp = readdir (d);
- if (dp == NULL || strcmp (dp->d_name, ".") != 0)
- errx (1, "where's .?");
- dp = readdir (d);
- if (dp == NULL || strcmp (dp->d_name, "..") != 0)
- errx (1, "where's ..?");
- if (readdir (d) != NULL)
- errx (1, "even more entries?");
- closedir (d);
- if (stat (".", &sb) < 0)
- err (1, "stat .");
-#if 0
- if (sb.st_size != 2048)
- errx (1, "size != 2048");
-#endif
- return 0;
-}
-
-static void
-usage (int ret)
-{
- fprintf (stderr, "%s directory number-of-files\n", __progname);
- exit (ret);
-}
-
-int
-main(int argc, char **argv)
-{
- char *ptr;
- int count;
-
- set_progname (argv[0]);
-
- if (argc != 3)
- usage (1);
-
- count = strtol (argv[2], &ptr, 0);
- if (count == 0 && ptr == argv[2])
- errx (1, "'%s' not a number", argv[2]);
-
- return creat_files (argv[1], count);
-}
diff --git a/usr.sbin/afs/src/tests/large-dir2.c b/usr.sbin/afs/src/tests/large-dir2.c
deleted file mode 100644
index 454c8cc174e..00000000000
--- a/usr.sbin/afs/src/tests/large-dir2.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: large-dir2.c,v 1.3 2000/10/03 00:34:37 lha Exp $");
-#endif
-
-static int
-creat_files (const char *dirname, int count)
-{
- struct stat sb;
- int i;
- DIR *d;
- struct dirent *dp;
-
- srand (time (NULL));
-
- if (mkdir (dirname, 0777) < 0)
- err (1, "mkdir %s", dirname);
-
- if (chdir (dirname) < 0)
- err (1, "chdir %s", dirname);
- if (stat (".", &sb) < 0)
- err (1, "stat .");
-#if 0
- if (sb.st_size != 2048)
- errx (1, "size != 2048");
-#endif
- for (i = 0; i < count; ++i) {
- char fname[256];
- int len;
- int j;
- int fd;
-
- len = 1 + rand () % (sizeof(fname) - 2);
-
- for (j = 0; j < len; ++j)
- fname[j] = 'A' + rand() % ('z' - 'A');
- fname[j] = '\0';
-
- fd = open (fname, O_CREAT | O_EXCL, 0777);
- if (fd < 0)
- err (1, "open %s", fname);
- if (close (fd) < 0)
- err (1, "close %s", fname);
- }
- if (stat (".", &sb) < 0)
- err (1, "stat .");
-
- d = opendir (".");
- if (d == NULL)
- err (1, "opendir .");
- while ((dp = readdir (d)) != NULL) {
- if (strcmp (dp->d_name, ".") == 0
- || strcmp (dp->d_name, "..") == 0)
- continue;
-
- if (unlink (dp->d_name) < 0)
- err (1, "unlink %s", dp->d_name);
- }
- closedir (d);
- if (chdir ("..") < 0)
- err (1, "chdir ..");
- if (rmdir (dirname) < 0)
- err (1, "rmdir");
- return 0;
-}
-
-static void
-usage (int ret)
-{
- fprintf (stderr, "%s directory number-of-files\n", __progname);
- exit (ret);
-}
-
-int
-main(int argc, char **argv)
-{
- char *ptr;
- int count;
-
- set_progname (argv[0]);
-
- if (argc != 3)
- usage (1);
-
- count = strtol (argv[2], &ptr, 0);
- if (count == 0 && ptr == argv[2])
- errx (1, "'%s' not a number", argv[2]);
-
- return creat_files (argv[1], count);
-}
diff --git a/usr.sbin/afs/src/tests/large-dir3.c b/usr.sbin/afs/src/tests/large-dir3.c
deleted file mode 100644
index 0d76ce6e63e..00000000000
--- a/usr.sbin/afs/src/tests/large-dir3.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: large-dir3.c,v 1.3 2000/10/03 00:34:42 lha Exp $");
-#endif
-
-static int
-creat_files (const char *dirname, int count)
-{
- struct stat sb;
- int i;
- DIR *d;
- struct dirent *dp;
-
- if (mkdir (dirname, 0777) < 0)
- err (1, "mkdir %s", dirname);
-
- if (chdir (dirname) < 0)
- err (1, "chdir %s", dirname);
- if (stat (".", &sb) < 0)
- err (1, "stat .");
- for (i = 0; i < count; ++i) {
- char num[17];
- int fd;
-
- snprintf (num, sizeof(num), "%d", i);
-
- fd = open (num, O_CREAT | O_EXCL, 0777);
- if (fd < 0)
- err (1, "open %s", num);
- if (close (fd) < 0)
- err (1, "close %s", num);
- }
- if (stat (".", &sb) < 0)
- err (1, "stat .");
-
- d = opendir (".");
- if (d == NULL)
- err (1, "opendir .");
- while ((dp = readdir (d)) != NULL) {
- if (strcmp (dp->d_name, ".") == 0
- || strcmp (dp->d_name, "..") == 0)
- continue;
-
- if (unlink (dp->d_name) < 0)
- err (1, "unlink %s", dp->d_name);
- }
- closedir (d);
- if (chdir ("..") < 0)
- err (1, "chdir ..");
- if (rmdir (dirname) < 0)
- err (1, "rmdir");
- return 0;
-}
-
-static void
-usage (int ret)
-{
- fprintf (stderr, "%s directory number-of-files\n", __progname);
- exit (ret);
-}
-
-int
-main(int argc, char **argv)
-{
- char *ptr;
- int count;
-
- set_progname (argv[0]);
-
- if (argc != 3)
- usage (1);
-
- count = strtol (argv[2], &ptr, 0);
- if (count == 0 && ptr == argv[2])
- errx (1, "'%s' not a number", argv[2]);
-
- return creat_files (argv[1], count);
-}
diff --git a/usr.sbin/afs/src/tests/large-filename b/usr.sbin/afs/src/tests/large-filename
deleted file mode 100644
index b680d0afa75..00000000000
--- a/usr.sbin/afs/src/tests/large-filename
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-# $KTH: large-filename,v 1.3 2000/10/19 06:15:58 lha Exp $
-
-touch aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 2>/dev/null >/dev/null || exit 0
-
-exit 0
diff --git a/usr.sbin/afs/src/tests/ls-afs b/usr.sbin/afs/src/tests/ls-afs
deleted file mode 100644
index 45eab1dcdf3..00000000000
--- a/usr.sbin/afs/src/tests/ls-afs
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-# $KTH: ls-afs,v 1.4 1998/12/15 03:50:12 assar Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-ls -l $AFSROOT >/dev/null
-true
diff --git a/usr.sbin/afs/src/tests/make-page.c b/usr.sbin/afs/src/tests/make-page.c
deleted file mode 100644
index 6509e5b1ba6..00000000000
--- a/usr.sbin/afs/src/tests/make-page.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <unistd.h>
-
-#include <roken.h>
-
-#include <err.h>
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-RCSID("$KTH: make-page.c,v 1.2.2.1 2001/04/27 23:42:50 mattiasa Exp $");
-
-int
-main (int argc, char **argv)
-{
- int mb = 10;
- int ret;
- size_t sz;
- void *mmap_buf;
-
- srand(getpid() * time(NULL));
-
- sz = mb * 1024 * 1024;
-
-#ifdef MAP_ANON
- mmap_buf = mmap (NULL, sz, PROT_READ|PROT_WRITE,
- MAP_ANON|MAP_PRIVATE, -1, 0);
-#else
- {
- int fd;
-
- fd = open ("/dev/zero", O_RDWR);
- if (fd < 0)
- err (1, "open /dev/zero");
- mmap_buf = mmap (NULL, sz, PROT_READ | PROT_WRITE,
- MAP_PRIVATE, fd, 0);
- close (fd);
- }
-#endif
- if (mmap_buf == (void *)MAP_FAILED)
- err (1, "mmap");
-
- while (1) {
- int *foo = (int *) ((unsigned char *) mmap_buf + (((rand() % (sz - 9)) + 7) & ~7));
- struct timeval tv = { 0, 1000} ;
- *foo = 10;
- select (0, NULL, NULL, NULL, &tv);
- }
-
- ret = munmap (mmap_buf, sz);
- if (ret)
- err (1, "munmap");
-}
diff --git a/usr.sbin/afs/src/tests/many-dirs b/usr.sbin/afs/src/tests/many-dirs
deleted file mode 100644
index e6ca7d7af8c..00000000000
--- a/usr.sbin/afs/src/tests/many-dirs
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# $KTH: many-dirs,v 1.3 1999/07/14 12:08:16 assar Exp $
-
-$objdir/create-dirs 1000
diff --git a/usr.sbin/afs/src/tests/many-fetchs b/usr.sbin/afs/src/tests/many-fetchs
deleted file mode 100644
index 9256db2fdb2..00000000000
--- a/usr.sbin/afs/src/tests/many-fetchs
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-# $KTH: many-fetchs,v 1.4 2000/06/10 09:17:11 assar Exp $
-
-FS=${FS:-${objdir}/../appl/fs/fs}
-
-touch foo
-
-echo "foobar" > foo
-
-for i in `awk 'BEGIN {for(i=0; i < 1000; ++i) printf "%d\n", i}' /dev/null`; do
- ${FS} flush foo
- cat foo > /dev/null || exit 1
-done
-
-rm foo \ No newline at end of file
diff --git a/usr.sbin/afs/src/tests/many-files b/usr.sbin/afs/src/tests/many-files
deleted file mode 100644
index 5a0442a55fe..00000000000
--- a/usr.sbin/afs/src/tests/many-files
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# $KTH: many-files,v 1.4 1999/10/10 23:51:00 assar Exp $
-
-$objdir/create-files 1000 0
diff --git a/usr.sbin/afs/src/tests/many-files-with-content b/usr.sbin/afs/src/tests/many-files-with-content
deleted file mode 100644
index 563d44500c8..00000000000
--- a/usr.sbin/afs/src/tests/many-files-with-content
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# $KTH: many-files-with-content,v 1.2 1999/10/08 02:53:39 assar Exp $
-
-$objdir/create-files 1000 10
diff --git a/usr.sbin/afs/src/tests/many-stores b/usr.sbin/afs/src/tests/many-stores
deleted file mode 100644
index 9fd0711e4d1..00000000000
--- a/usr.sbin/afs/src/tests/many-stores
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-# $KTH: many-stores,v 1.1 1999/05/29 01:06:37 lha Exp $
-
-touch foo
-
-for i in `awk 'BEGIN {for(i=0; i < 1000; ++i) printf "%d\n", i}' /dev/null`; do
- echo "foo$i" >> foo || exit 1
-done
-
-rm foo \ No newline at end of file
diff --git a/usr.sbin/afs/src/tests/many-symlinks b/usr.sbin/afs/src/tests/many-symlinks
deleted file mode 100644
index d82a5436eb9..00000000000
--- a/usr.sbin/afs/src/tests/many-symlinks
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# $KTH: many-symlinks,v 1.2 1999/07/14 12:07:58 assar Exp $
-
-$objdir/create-symlinks 1000
diff --git a/usr.sbin/afs/src/tests/mkdir b/usr.sbin/afs/src/tests/mkdir
deleted file mode 100644
index 26ac89679f8..00000000000
--- a/usr.sbin/afs/src/tests/mkdir
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-# $KTH: mkdir,v 1.2 2000/05/25 01:22:30 lha Exp $
-mkdir foo || exit 1
-echo hej > foo/1 || exit 1
-rmdir foo >/dev/null 2>&1
-test -d foo || exit 1
-rm -f foo/1 || exit 1
-rmdir foo || exit 1
-test -d foo && exit 1
-exit 0
diff --git a/usr.sbin/afs/src/tests/mkdir-lnk b/usr.sbin/afs/src/tests/mkdir-lnk
deleted file mode 100644
index f2247a23575..00000000000
--- a/usr.sbin/afs/src/tests/mkdir-lnk
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-mkdir foo || exit 1
-ls -ld foo | awk '{if($2 != 2) { exit(1) }}' || exit 1
-mkdir foo/1 || exit 1
-ls -ld foo | awk '{if($2 != 3) { exit(1) }}' || exit 1
-mkdir foo/2 || exit 1
-ls -ld foo | awk '{if($2 != 4) { exit(1) }}' || exit 1
-rmdir foo/1 || exit 1
-ls -ld foo | awk '{if($2 != 3) { exit(1) }}' || exit 1
-rmdir foo/2 || exit 1
-ls -ld foo | awk '{if($2 != 2) { exit(1) }}' || exit 1
-rmdir foo || exit 1
diff --git a/usr.sbin/afs/src/tests/mkdir1 b/usr.sbin/afs/src/tests/mkdir1
deleted file mode 100644
index 0141924e3f1..00000000000
--- a/usr.sbin/afs/src/tests/mkdir1
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-# $KTH: mkdir1,v 1.2 1999/07/04 09:24:51 assar Exp $
-mkdir foobar || exit 1
-test -d foobar || exit 1
-test -d foobar/. || exit 1
-test -d foobar/.. || exit 1
-rmdir foobar || exit 1
diff --git a/usr.sbin/afs/src/tests/mkdir2.c b/usr.sbin/afs/src/tests/mkdir2.c
deleted file mode 100644
index b44266bbc1b..00000000000
--- a/usr.sbin/afs/src/tests/mkdir2.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 1999 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: mkdir2.c,v 1.3 2000/10/03 00:34:47 lha Exp $");
-#endif
-
-int
-main(int argc, char *argv[])
-{
- int ret;
- struct stat dot_sb, sb;
-
- set_progname (argv[0]);
-
- ret = mkdir ("foo", 0777);
- if (ret < 0)
- err (1, "mkdir foo");
- ret = lstat (".", &dot_sb);
- if (ret < 0)
- err (1, "lstat .");
- ret = lstat ("foo", &sb);
- if (ret < 0)
- err (1, "lstat foo");
- if (sb.st_nlink != 2)
- errx (1, "sb.st_link != 2");
- ret = lstat ("foo/.", &sb);
- if (ret < 0)
- err (1, "lstat foo/.");
- if (sb.st_nlink != 2)
- errx (1, "sb.st_link != 2");
- ret = lstat ("foo/..", &sb);
- if (ret < 0)
- err (1, "lstat foo");
- if (sb.st_nlink != dot_sb.st_nlink)
- errx (1, "sb.st_link != dot_sb.st_nlink");
- ret = rmdir ("foo");
- if (ret < 0)
- err (1, "rmdir foo");
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/mkm-rmm b/usr.sbin/afs/src/tests/mkm-rmm
deleted file mode 100644
index df20b0e2117..00000000000
--- a/usr.sbin/afs/src/tests/mkm-rmm
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-# $KTH: mkm-rmm,v 1.4 2000/06/10 09:17:12 assar Exp $
-FS=${FS:-${objdir}/../appl/fs/fs}
-${FS} sa . system:anyuser all || exit 1
-${FS} mkm root.cell root.cell || exit 1
-test -d root.cell || exit 1
-${FS} rmm root.cell || exit 1
-test -d root.cell && exit 1
-${FS} mkm root.cell root.cell || exit 1
-test -d root.cell || exit 1
-${FS} rmm root.cell || exit 1
-test -d root.cell && exit 1
-exit 0
diff --git a/usr.sbin/afs/src/tests/mmap-and-read.c b/usr.sbin/afs/src/tests/mmap-and-read.c
deleted file mode 100644
index 816ed518ff8..00000000000
--- a/usr.sbin/afs/src/tests/mmap-and-read.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <time.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: mmap-and-read.c,v 1.12 2000/12/18 04:03:51 assar Exp $");
-#endif
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-static char *
-generate_random_file (const char *filename,
- unsigned npages,
- unsigned pagesize,
- int writep)
-{
- int fd;
- char *buf, *fbuf;
- int i;
- int prot;
- int flags;
- size_t sz = npages * pagesize;
-
- buf = malloc (sz);
- if (buf == NULL)
- err (1, "malloc %u", sz);
-
- for (i = 0; i < npages; ++i)
- memset (buf + pagesize * i, '0' + i, pagesize);
-
- fd = open (filename, O_RDWR | O_CREAT | O_TRUNC, 0666);
- if (fd < 0)
- err (1, "open %s", filename);
-
- if (ftruncate (fd, sz) < 0)
- err (1, "ftruncate");
-
- prot = PROT_READ | PROT_WRITE;
- flags = MAP_SHARED;
-
- fbuf = mmap (0, sz, prot, flags, fd, 0);
- if (fbuf == (void *)MAP_FAILED)
- err (1, "mmap");
-
- if (writep) {
- if(write(fd, "hej\n", 4) != 4)
- err(1, "write");
- }
-
- memcpy (fbuf, buf, sz);
-
-#if 0
- if (msync (fbuf, sz, MS_SYNC))
- err(1, "msync");
-#endif
-
- if (munmap (fbuf, sz) != 0)
- err (1, "munmap");
-
- if (close (fd))
- err (1, "close");
- return buf;
-}
-
-static char *
-read_file (int fd, size_t sz)
-{
- char *buf;
-
- buf = malloc (sz);
- if (buf == NULL)
- err (1, "malloc %u", sz);
- if (read (fd, buf, sz) != sz)
- err (1, "read");
- return buf;
-}
-
-static int
-test (const char *file, int writep)
-{
- const size_t sz = 4 * getpagesize();
- char *buf;
- char *malloc_buf;
- int fd;
- int ret;
-
- buf = generate_random_file (file, 4, getpagesize(), writep);
-
- fd = open (file, O_RDONLY, 0);
- if (fd < 0)
- err (1, "open %s", file);
-
- malloc_buf = read_file (fd, sz);
- close (fd);
- ret = memcmp (buf, malloc_buf, sz);
- free (buf);
-
- return ret;
-}
-
-
-int
-main (int argc, char **argv)
-{
-
- set_progname (argv[0]);
-
- srand (time(NULL));
-
- if (test ("foo", 1) != 0)
- errx (1, "test(1)");
- if (test ("bar", 0) != 0)
- errx (1, "test(2)");
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/mmap-cat.c b/usr.sbin/afs/src/tests/mmap-cat.c
deleted file mode 100644
index 4d09804f9f2..00000000000
--- a/usr.sbin/afs/src/tests/mmap-cat.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (c) 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include <roken.h>
-#include <agetarg.h>
-
-#include <err.h>
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-RCSID("$KTH: mmap-cat.c,v 1.1.2.1 2001/05/17 07:38:56 lha Exp $");
-
-static void
-doit_mmap(int fd, struct stat *sb)
-{
- void *mmap_buf;
- int ret;
-
- mmap_buf = mmap (NULL, sb->st_size, PROT_READ, MAP_PRIVATE, fd, 0);
- if (mmap_buf == (void *)MAP_FAILED)
- err (1, "mmap");
- ret = write (STDOUT_FILENO, mmap_buf, sb->st_size);
- if (ret != sb->st_size)
- err(1, "write returned %d wanted to write %d",
- ret, (int)sb->st_size);
- munmap(mmap_buf, sb->st_size);
-}
-
-
-static void
-doit_read(int fd, struct stat *sb)
-{
- int ret;
- void *read_buf;
-
- read_buf = malloc(sb->st_size);
- if (read_buf == NULL)
- err(1, "malloc(%d)", (int)sb->st_size);
- ret = read(fd, read_buf, sb->st_size);
- if (ret != sb->st_size)
- err(1, "read returned %d wanted to write %d",
- ret, (int)sb->st_size);
- ret = write (STDOUT_FILENO, read_buf, sb->st_size);
- if (ret != sb->st_size)
- err(1, "write returned %d wanted to write %d",
- ret, (int)sb->st_size);
- free(read_buf);
-}
-
-static void
-doit (const char *filename, void (*func)(int, struct stat *))
-{
- struct stat sb;
- int fd;
- int ret;
-
- fd = open (filename, O_RDONLY);
- if (fd < 0)
- err(1, "open %s", filename);
- ret = fstat (fd, &sb);
- (*func)(fd, &sb);
- if (ret < 0)
- err (1, "stat %s", filename);
- close (fd);
-}
-
-static int read_flag;
-static int mmap_flag;
-static int help_flag;
-
-static struct agetargs args[] = {
- {"read", 'r', aarg_flag, &read_flag, "read", NULL},
- {"mmap", 'm', aarg_flag, &mmap_flag, "mmap", NULL},
- {"help", 0, aarg_flag, &help_flag, NULL, NULL},
- {NULL, 0, aarg_end, NULL, NULL, NULL}
-};
-
-static void
-usage (int exit_val)
-{
- aarg_printusage (args, NULL, "filename", AARG_AFSSTYLE);
- exit (exit_val);
-}
-
-int
-main(int argc, char **argv)
-{
- int optind = 0;
-
- set_progname (argv[0]);
-
- if (agetarg (args, argc, argv, &optind, AARG_AFSSTYLE))
- usage (1);
-
- argc -= optind;
- argv += optind;
-
- if (help_flag)
- usage(0);
-
- if (argc != 1)
- usage(1);
-
- if (read_flag && mmap_flag)
- errx(1, "can't do both mmap and read");
-
- if (read_flag)
- doit(argv[0], doit_read);
- if (mmap_flag)
- doit(argv[0], doit_mmap);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/mmap-shared-write.c b/usr.sbin/afs/src/tests/mmap-shared-write.c
deleted file mode 100644
index 6eaba590055..00000000000
--- a/usr.sbin/afs/src/tests/mmap-shared-write.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <time.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <err.h>
-#include <roken.h>
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-#ifdef RCSID
-RCSID("$KTH: mmap-shared-write.c,v 1.3 2000/10/03 00:34:57 lha Exp $");
-#endif
-
-static int
-doit (const char *filename)
-{
- int fd;
- size_t sz = getpagesize ();
- void *v;
-
- fd = open (filename, O_RDWR | O_CREAT, 0600);
- if (fd < 0)
- err (1, "open %s", filename);
- if (ftruncate (fd, sz) < 0)
- err (1, "ftruncate %s", filename);
- v = mmap (NULL, sz, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
- if (v == (void *)MAP_FAILED)
- err (1, "mmap %s", filename);
-
- memset (v, 'z', sz);
-
- msync (v, sz, MS_SYNC);
-
- if (close (fd) < 0)
- err (1, "close %s", filename);
- return 0;
-}
-
-static void
-usage(void)
-{
- errx (1, "usage: [filename]");
-}
-
-int
-main (int argc, char **argv)
-{
- const char *filename = "foo";
-
- set_progname(argv[0]);
-
- if (argc != 1 && argc != 2)
- usage ();
-
- if (argc == 2)
- filename = argv[1];
-
- return doit (filename);
-}
diff --git a/usr.sbin/afs/src/tests/mmap-vs-read.c b/usr.sbin/afs/src/tests/mmap-vs-read.c
deleted file mode 100644
index c10031488cb..00000000000
--- a/usr.sbin/afs/src/tests/mmap-vs-read.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <time.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: mmap-vs-read.c,v 1.5 2000/10/03 00:35:03 lha Exp $");
-#endif
-
-static int debug = 0;
-
-static void
-generate_file (const char *filename, int randomp, size_t sz)
-{
- int fd;
- char *buf;
- int i;
-
- buf = malloc (sz);
- if (buf == NULL)
- err (1, "malloc %u", sz);
-
- fd = open (filename, O_WRONLY | O_CREAT, 0666);
- if (fd < 0)
- err (1, "open %s", filename);
-
- for (i = 0; i < sz; ++i)
- if (randomp)
- buf[i] = rand();
- else
- buf[0] = 0;
-
- if (write (fd, buf, sz) != sz)
- err (1, "write");
- if (close (fd))
- err (1, "close");
- free (buf);
-}
-
-static char *
-read_file (int fd, size_t sz)
-{
- char *buf;
-
- buf = malloc (sz);
- if (buf == NULL)
- err (1, "malloc %u", sz);
- if (read (fd, buf, sz) != sz)
- err (1, "read");
- return buf;
-}
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-static void *
-mmap_file (int fd, size_t sz)
-{
- void *ret;
-
- ret = mmap (0, sz, PROT_READ, MAP_PRIVATE, fd, 0);
- if (ret == (void *)MAP_FAILED)
- err (1, "mmap");
- return ret;
-}
-
-static void __attribute__ ((__unused__))
-print_area (unsigned char *ptr, size_t len)
-{
- while (len--) {
- printf ("%x", *ptr);
- ptr++;
- }
-}
-
-static int
-do_test (int randomp)
-{
- char *malloc_buf;
- void *mmap_buf;
- int fd;
- const char *file = "foo";
- const size_t sz = 4 * getpagesize();
-
- generate_file (file, randomp, sz);
-
- fd = open (file, O_RDONLY, 0);
- if (fd < 0)
- err (1, "open %s", file);
-
- mmap_buf = mmap_file (fd, sz);
- malloc_buf = read_file (fd, sz);
- close (fd);
- unlink (file);
- if (memcmp (malloc_buf, mmap_buf, sz) != 0) {
- if (debug) {
- printf ("type: %s\n", randomp ? "random" : "allzero");
- printf ("read: ");
- print_area (malloc_buf, sz);
- printf ("\nmmap: ");
- print_area (mmap_buf, sz);
- printf ("\n");
- }
- return 1;
- }
- return 0;
-}
-
-int
-main (int argc, char **argv)
-{
- set_progname (argv[0]);
-
- if (argc != 1)
- debug = 1;
-
- srand (time(NULL));
-
- if (do_test (0))
- return 1;
- if (do_test (1))
- return 2;
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/mmap-vs-read2.c b/usr.sbin/afs/src/tests/mmap-vs-read2.c
deleted file mode 100644
index fadc21f4a94..00000000000
--- a/usr.sbin/afs/src/tests/mmap-vs-read2.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <time.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: mmap-vs-read2.c,v 1.4 2000/10/03 00:35:08 lha Exp $");
-#endif
-
-static int debug = 0;
-
-static void
-generate_file (const char *filename, int randomp, size_t sz)
-{
- int fd;
- char *buf;
- int i;
-
- buf = malloc (sz);
- if (buf == NULL)
- err (1, "malloc %u", sz);
-
- fd = open (filename, O_WRONLY | O_CREAT, 0666);
- if (fd < 0)
- err (1, "open %s", filename);
-
- for (i = 0; i < sz; ++i)
- if (randomp)
- buf[i] = rand();
- else
- buf[0] = 0;
-
- if (write (fd, buf, sz) != sz)
- err (1, "write");
- if (close (fd))
- err (1, "close");
- free (buf);
-}
-
-static char *
-read_file (int fd, size_t sz)
-{
- char *buf;
-
- buf = malloc (sz);
- if (buf == NULL)
- err (1, "malloc %u", sz);
- if (read (fd, buf, sz) != sz)
- err (1, "read");
- return buf;
-}
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-static void *
-mmap_file (int fd, size_t sz)
-{
- void *ret;
-
- ret = mmap (0, sz, PROT_READ, MAP_PRIVATE, fd, 0);
- if (ret == (void *)MAP_FAILED)
- err (1, "mmap");
- return ret;
-}
-
-static void __attribute__ ((__unused__))
-print_area (unsigned char *ptr, size_t len)
-{
- while (len--) {
- printf ("%x", *ptr);
- ptr++;
- }
-}
-
-static int
-do_test (int randomp)
-{
- char *malloc_buf;
- void *mmap_buf;
- int fd;
- const char *file = "foo";
- const size_t sz = 3 * getpagesize() / 2;
-
- generate_file (file, randomp, sz);
-
- fd = open (file, O_RDONLY, 0);
- if (fd < 0)
- err (1, "open %s", file);
-
- mmap_buf = mmap_file (fd, sz);
- malloc_buf = read_file (fd, sz);
- close (fd);
- unlink (file);
- if (memcmp (malloc_buf, mmap_buf, sz) != 0) {
- if (debug) {
- printf ("type: %s\n", randomp ? "random" : "allzero");
- printf ("read: ");
- print_area (malloc_buf, sz);
- printf ("\nmmap: ");
- print_area (mmap_buf, sz);
- printf ("\n");
- }
- return 1;
- }
- return 0;
-}
-
-int
-main (int argc, char **argv)
-{
- set_progname (argv[0]);
-
- if (argc != 1)
- debug = 1;
-
- srand (time(NULL));
-
- if (do_test (0))
- return 1;
- if (do_test (1))
- return 2;
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/mountpoint.in b/usr.sbin/afs/src/tests/mountpoint.in
deleted file mode 100644
index 21d3a1af305..00000000000
--- a/usr.sbin/afs/src/tests/mountpoint.in
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-# $KTH: mountpoint.in,v 1.9 2000/07/19 00:07:02 assar Exp $
-FS=${FS:-${objdir}/../appl/fs/fs}
-${FS} sa . system:anyuser all || exit 1
-${FS} mkm root root.afs || exit 1
-test -d root || exit 1
-${FS} rmm root || exit 1
-${FS} mkm no-such-volume no-such-volume 2>/dev/null || exit 1
-if ls no-such-volume 2>/dev/null && touch no-such-volume/foo 2>/dev/null; then
- ${FS} rmm no-such-volume; exit 1
-fi
-${FS} rmm no-such-volume || exit 1
diff --git a/usr.sbin/afs/src/tests/parallel1 b/usr.sbin/afs/src/tests/parallel1
deleted file mode 100644
index 3f57db53b1d..00000000000
--- a/usr.sbin/afs/src/tests/parallel1
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-# $KTH: parallel1,v 1.2 2000/01/17 02:46:50 lha Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-$objdir/test-parallel1 1>&4
-
diff --git a/usr.sbin/afs/src/tests/pine.c b/usr.sbin/afs/src/tests/pine.c
deleted file mode 100644
index d53cc7db5b5..00000000000
--- a/usr.sbin/afs/src/tests/pine.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/stat.h>
-
-#include <err.h>
-#include <roken.h>
-
-RCSID("$KTH: pine.c,v 1.3 2000/10/03 00:35:13 lha Exp $");
-
-#define LOCK "mailbox-name.lock"
-
-int
-main(int argc, char *argv[])
-{
- int ret;
- struct stat sb;
- char unique[1024];
- int retrycount = 0;
-
- set_progname (argv[0]);
-
- snprintf (unique, sizeof(unique), LOCK ".%d.%d",
- getpid(), (int)time(NULL));
-
- ret = umask(077);
- if (ret < 0)
- err (1, "umask");
-
- ret = open(unique, O_WRONLY|O_CREAT|O_EXCL, 0666);
- if (ret < 0)
- errx (1, "open");
-
- close (ret);
-
- retry:
- retrycount++;
- if (retrycount > 10000000)
- errx (1, "failed getting the lock");
- ret = link(unique, LOCK);
- if (ret < 0)
- goto retry;
-
- ret = stat(unique, &sb);
- if (ret < 0)
- errx (1, "stat");
-
- if (sb.st_nlink != 2)
- goto retry;
-
- ret = chmod (LOCK, 0666);
- if (ret < 0)
- errx (1, "chmod");
-
- ret = unlink (LOCK);
- if (ret < 0)
- err (1, "unlink " LOCK);
-
- ret = unlink (unique);
- if (ret < 0)
- err (1, "unlink: %s", unique);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/read-vs-mmap.c b/usr.sbin/afs/src/tests/read-vs-mmap.c
deleted file mode 100644
index c120815e176..00000000000
--- a/usr.sbin/afs/src/tests/read-vs-mmap.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <time.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: read-vs-mmap.c,v 1.9 2000/10/03 00:35:18 lha Exp $");
-#endif
-
-static int debug = 0;
-
-static void
-generate_file (const char *filename, int randomp, size_t sz)
-{
- int fd;
- char *buf;
- int i;
-
- buf = malloc (sz);
- if (buf == NULL)
- err (1, "malloc %u", sz);
-
- fd = open (filename, O_WRONLY | O_CREAT, 0666);
- if (fd < 0)
- err (1, "open %s", filename);
-
- for (i = 0; i < sz; ++i)
- if (randomp)
- buf[i] = rand();
- else
- buf[0] = 0;
-
- if (write (fd, buf, sz) != sz)
- err (1, "write");
- if (close (fd))
- err (1, "close");
- free (buf);
-}
-
-static char *
-read_file (int fd, size_t sz)
-{
- char *buf;
-
- buf = malloc (sz);
- if (buf == NULL)
- err (1, "malloc %u", sz);
- if (read (fd, buf, sz) != sz)
- err (1, "read");
- return buf;
-}
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-static void *
-mmap_file (int fd, size_t sz)
-{
- void *ret;
-
- ret = mmap (0, sz, PROT_READ, MAP_PRIVATE, fd, 0);
- if (ret == (void *)MAP_FAILED)
- err (1, "mmap");
- return ret;
-}
-
-static void __attribute__ ((__unused__))
-print_area (unsigned char *ptr, size_t len)
-{
- while (len--) {
- printf ("%x", *ptr);
- ptr++;
- }
-}
-
-static int
-do_test (int randomp)
-{
- char *malloc_buf;
- void *mmap_buf;
- int fd;
- const char *file = "foo";
- const size_t sz = 16384;
-
- generate_file (file, randomp, sz);
-
- fd = open (file, O_RDONLY, 0);
- if (fd < 0)
- err (1, "open %s", file);
-
- malloc_buf = read_file (fd, sz);
- mmap_buf = mmap_file (fd, sz);
- close (fd);
- unlink (file);
- if (memcmp (malloc_buf, mmap_buf, sz) != 0) {
- if (debug) {
- printf ("type: %s\n", randomp ? "random" : "allzero");
- printf ("read: ");
- print_area (malloc_buf, sz);
- printf ("\nmmap: ");
- print_area (mmap_buf, sz);
- printf ("\n");
- }
- return 1;
- }
- return 0;
-}
-
-int
-main (int argc, char **argv)
-{
- set_progname (argv[0]);
-
- if (argc != 1)
- debug = 1;
-
- srand (time(NULL));
-
- if (do_test (0))
- return 1;
- if (do_test (1))
- return 2;
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/read-vs-mmap2.c b/usr.sbin/afs/src/tests/read-vs-mmap2.c
deleted file mode 100644
index cf4b6b6a2ac..00000000000
--- a/usr.sbin/afs/src/tests/read-vs-mmap2.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <time.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: read-vs-mmap2.c,v 1.8 2000/10/03 00:35:24 lha Exp $");
-#endif
-
-static void
-generate_random_file (const char *filename, size_t sz)
-{
- int fd;
- char *buf;
- int i;
-
- buf = malloc (sz);
- if (buf == NULL)
- err (1, "malloc %u", sz);
-
- fd = open (filename, O_WRONLY | O_CREAT, 0666);
- if (fd < 0)
- err (1, "open %s", filename);
-
- for (i = 0; i < sz; ++i)
- buf[i] = rand();
-
- if (write (fd, buf, sz) != sz)
- err (1, "write");
- if (close (fd))
- err (1, "close");
- free (buf);
-}
-
-static char *
-read_file (int fd, size_t sz)
-{
- char *buf;
-
- buf = malloc (sz);
- if (buf == NULL)
- err (1, "malloc %u", sz);
- if (read (fd, buf, sz) != sz)
- err (1, "read");
- return buf;
-}
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-static void *
-mmap_file (int fd, size_t sz)
-{
- void *ret;
-
- ret = mmap (0, sz, PROT_READ, MAP_SHARED, fd, 0);
- if (ret == (void *)MAP_FAILED)
- err (1, "mmap");
- return ret;
-}
-
-int
-main (int argc, char **argv)
-{
- const char *file = "foo";
- const size_t sz = 16384;
- char *malloc_buf;
- void *mmap_buf;
- int fd;
-
- set_progname (argv[0]);
-
- srand (time(NULL));
-
- generate_random_file (file, sz);
-
- fd = open (file, O_RDONLY, 0);
- if (fd < 0)
- err (1, "open %s", file);
-
- malloc_buf = read_file (fd, sz);
- mmap_buf = mmap_file (fd, sz);
- close (fd);
- unlink (file);
- if (memcmp (malloc_buf, mmap_buf, sz) != 0)
- return 1;
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/read-write.c b/usr.sbin/afs/src/tests/read-write.c
deleted file mode 100644
index 3b17b887913..00000000000
--- a/usr.sbin/afs/src/tests/read-write.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <time.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: read-write.c,v 1.5 2000/10/03 00:35:29 lha Exp $");
-#endif
-
-static char *
-write_random_file (int fd, size_t sz)
-{
- char *buf;
- int i;
-
- buf = malloc (sz);
- if (buf == NULL)
- err (1, "malloc %u", sz);
-
- for (i = 0; i < sz; ++i)
- buf[i] = rand();
-
- if (write (fd, buf, sz) != sz)
- err (1, "write");
-
- return buf;
-}
-
-static void
-write_null_file (int fd, size_t sz)
-{
- char *buf;
- int i;
-
- buf = malloc (sz);
- if (buf == NULL)
- err (1, "malloc %u", sz);
-
- for (i = 0; i < sz; ++i)
- buf[i] = 0;
-
- if (write (fd, buf, sz) != sz)
- err (1, "write");
-
- free (buf);
-}
-
-static char *
-read_file (int fd, size_t sz)
-{
- char *buf;
-
- buf = malloc (sz);
- if (buf == NULL)
- err (1, "malloc %u", sz);
- if (read(fd, buf, sz) != sz)
- err (1, "read");
- return buf;
-}
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-int
-main (int argc, char **argv)
-{
- const char *file = "foo";
- const size_t sz = 16384;
- char *random_buf;
- char *read_buf1;
- char *read_buf2;
- int fd;
-
- set_progname (argv[0]);
-
- srand (time(NULL));
-
- fd = open (file, O_RDWR | O_CREAT, 0);
- if (fd < 0)
- err (1, "open %s", file);
-
- if (lseek(fd, 0, SEEK_SET) < 0)
- err (1, "lseek");
- write_null_file(fd, sz);
- if (lseek(fd, 0, SEEK_SET) < 0)
- err (1, "lseek");
- read_buf1 = read_file (fd, sz);
- if (lseek(fd, 0, SEEK_SET) < 0)
- err (1, "lseek");
- random_buf = write_random_file(fd, sz);
- if (lseek(fd, 0, SEEK_SET) < 0)
- err (1, "lseek");
- read_buf2 = read_file (fd, sz);
-
- close (fd);
- unlink (file);
- if (memcmp (random_buf, read_buf2, sz) != 0)
- return 1;
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/readdir-vs-lstat.c b/usr.sbin/afs/src/tests/readdir-vs-lstat.c
deleted file mode 100644
index aef98ea0704..00000000000
--- a/usr.sbin/afs/src/tests/readdir-vs-lstat.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <errno.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: readdir-vs-lstat.c,v 1.11 2000/10/03 00:35:34 lha Exp $");
-#endif
-
-static int
-verify_inodes (const char *dirname)
-{
- DIR *d;
- struct dirent *dp;
-
- if (chdir (dirname) < 0)
- err (1, "chdir %s", dirname);
-
- d = opendir (".");
- if (d == NULL)
- err (1, "opendir %s", dirname);
- while ((dp = readdir (d)) != NULL) {
- struct stat sb;
-
- if (lstat (dp->d_name, &sb) < 0) {
- if (errno == EACCES)
- continue;
- err (1, "lstat %s", dp->d_name);
- }
- if (dp->d_ino != sb.st_ino)
- errx (1, "%s: inode %u != %u", dp->d_name,
- (unsigned)dp->d_ino, (unsigned)sb.st_ino);
- }
- closedir (d);
- return 0;
-}
-
-static void
-usage (int ret)
-{
- fprintf (stderr, "%s [directory]\n", __progname);
- exit (ret);
-}
-
-int
-main(int argc, char **argv)
-{
- char *name = ".";
-
- set_progname (argv[0]);
-
- if (argc > 2)
- usage (1);
-
- if (argc > 1)
- name = argv[1];
-
- return verify_inodes (name);
-}
diff --git a/usr.sbin/afs/src/tests/readfile-wo-create b/usr.sbin/afs/src/tests/readfile-wo-create
deleted file mode 100644
index 209fd344927..00000000000
--- a/usr.sbin/afs/src/tests/readfile-wo-create
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-FOO=`cat $AFSROOT/stacken.kth.se/ftp/pub/arla/tests/used-by-arla-check`
-test "X"$FOO = "Xfoo" || exit 1
diff --git a/usr.sbin/afs/src/tests/rename-under-feet.c b/usr.sbin/afs/src/tests/rename-under-feet.c
deleted file mode 100644
index 66d9dd1172d..00000000000
--- a/usr.sbin/afs/src/tests/rename-under-feet.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include <roken.h>
-
-#include <err.h>
-
-RCSID("$KTH: rename-under-feet.c,v 1.9 2000/10/03 00:35:39 lha Exp $");
-
-static void
-emkdir (const char *path, mode_t mode)
-{
- int ret = mkdir (path, mode);
- if (ret < 0)
- err (1, "mkdir %s", path);
-}
-
-static pid_t child_pid;
-
-static sig_atomic_t term_sig = 0;
-
-static RETSIGTYPE
-child_sigterm (int signo)
-{
- term_sig = 1;
-}
-
-static int
-child_chdir (const char *path)
-{
- int ret;
- int pfd[2];
-
- ret = pipe (pfd);
- if (ret < 0)
- err (1, "pipe");
-
- child_pid = fork ();
- if (child_pid < 0)
- err (1, "fork");
- if (child_pid != 0) {
- close (pfd[1]);
- return pfd[0];
- } else {
- char buf[256];
- struct sigaction sa;
- FILE *fp;
-
- sa.sa_handler = child_sigterm;
- sigfillset(&sa.sa_mask);
- sa.sa_flags = 0;
- sigaction (SIGTERM, &sa, NULL);
-
- close (pfd[0]);
- ret = chdir (path);
- if (ret < 0)
- err (1, "chdir %s", path);
- ret = write (pfd[1], "", 1);
- if (ret != 1)
- err (1, "write");
- while (!term_sig)
- pause ();
- if(getcwd (buf, sizeof(buf)) == NULL)
- err (1, "getcwd");
- fp = fdopen (4, "w");
- if (fp != NULL)
- fprintf (fp, "child: cwd = %s\n", buf);
- exit (0);
- }
-}
-
-static void
-kill_child (void)
-{
- kill (child_pid, SIGTERM);
-}
-
-int
-main (int argc, char **argv)
-{
- struct stat sb;
- int ret;
- int fd;
- char buf[1];
- int status;
-
- set_progname (argv[0]);
-
- emkdir ("one", 0777);
- emkdir ("two", 0777);
- emkdir ("one/a", 0777);
-
- fd = child_chdir ("one/a");
- atexit (kill_child);
- ret = read (fd, buf, 1);
- if (ret != 1)
- err (1, "read");
- ret = rename ("one/a", "two/a");
- if (ret < 0)
- err (1, "rename one/a two");
- ret = lstat ("two/a", &sb);
- if (ret < 0)
- err (1, "lstat two/a");
- ret = lstat ("one/a", &sb);
- if (ret != -1 || errno != ENOENT)
- errx (1, "one/a still exists");
- kill_child ();
- waitpid (child_pid, &status, 0);
- ret = lstat ("one/a", &sb);
- if (ret != -1 || errno != ENOENT)
- errx (1, "one/a still exists after child");
- if (WIFEXITED(status) && WEXITSTATUS(status) == 0)
- return 0;
- else
- return 1;
-}
diff --git a/usr.sbin/afs/src/tests/rename1 b/usr.sbin/afs/src/tests/rename1
deleted file mode 100644
index 9e78cf7eb3e..00000000000
--- a/usr.sbin/afs/src/tests/rename1
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-# $KTH: rename1,v 1.2 2000/02/28 00:19:25 assar Exp $
-touch foo || exit 1
-mv foo bar || exit 1
-test -f foo && exit 1
-test -f bar || exit 1
-rm bar || exit 1
diff --git a/usr.sbin/afs/src/tests/rename2 b/usr.sbin/afs/src/tests/rename2
deleted file mode 100644
index 6891b9975f6..00000000000
--- a/usr.sbin/afs/src/tests/rename2
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-# $KTH: rename2,v 1.2 2000/02/28 00:19:25 assar Exp $
-touch foo bar || exit 1
-mv foo bar || exit 1
-test -f foo && exit 1
-test -f bar || exit 1
-rm bar || exit 1
diff --git a/usr.sbin/afs/src/tests/rename3 b/usr.sbin/afs/src/tests/rename3
deleted file mode 100644
index c0354f29521..00000000000
--- a/usr.sbin/afs/src/tests/rename3
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-# $KTH: rename3,v 1.1 2000/02/28 00:17:49 assar Exp $
-echo foo > foo || exit 1
-sed 's/foo/bar/' foo > bar || exit 1
-rm foo || exit 1
-test -f foo && exit 1
-mv bar foo || exit 1
-test -f bar && exit 1
-test -f foo || exit 1
diff --git a/usr.sbin/afs/src/tests/rename4 b/usr.sbin/afs/src/tests/rename4
deleted file mode 100644
index 43c9219228c..00000000000
--- a/usr.sbin/afs/src/tests/rename4
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-# $KTH: rename4,v 1.1 2000/03/26 11:53:23 assar Exp $
-mkdir old_parent new_parent old_parent/victim || exit 1
-mv old_parent/victim new_parent || exit 1
-test -d old_parent || exit 1
-test -d new_parent || exit 1
-test -d old_parent/victim && exit 1
-test -d new_parent/victim || exit 1
diff --git a/usr.sbin/afs/src/tests/rename5.c b/usr.sbin/afs/src/tests/rename5.c
deleted file mode 100644
index edbdeeee476..00000000000
--- a/usr.sbin/afs/src/tests/rename5.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include <roken.h>
-
-#include <err.h>
-
-RCSID("$KTH: rename5.c,v 1.3 2000/10/03 00:35:44 lha Exp $");
-
-static void
-emkdir (const char *path, mode_t mode)
-{
- int ret;
-
- ret = mkdir (path, mode);
- if (ret < 0)
- err (1, "mkdir %s", path);
-}
-
-static void
-elstat (const char *path, struct stat *sb)
-{
- int ret;
-
- ret = lstat (path, sb);
- if (ret < 0)
- err (1, "lstat %s", path);
-}
-
-static void
-check_inum (const struct stat *sb1, const struct stat *sb2)
-{
- if (sb1->st_ino != sb2->st_ino)
- errx (1, "wrong inode-number %u != %u",
- (unsigned)sb1->st_ino, (unsigned)sb2->st_ino);
-}
-
-int
-main(int argc, char **argv)
-{
- int ret;
- struct stat old_sb, new_sb, dot_sb;
-
- set_progname (argv[0]);
- emkdir ("old_parent", 0777);
- emkdir ("new_parent", 0777);
- emkdir ("old_parent/victim", 0777);
-
- elstat ("old_parent", &old_sb);
- elstat ("new_parent", &new_sb);
- elstat ("old_parent/victim/..", &dot_sb);
- check_inum (&old_sb, &dot_sb);
-
- ret = rename("old_parent/victim", "new_parent/victim");
- if (ret < 0)
- err (1, "rename old_parent/victim new_parent/victim");
-
- elstat ("new_parent/victim/..", &dot_sb);
-
- check_inum (&new_sb, &dot_sb);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/rm-rf.c b/usr.sbin/afs/src/tests/rm-rf.c
deleted file mode 100644
index 54a717d30a9..00000000000
--- a/usr.sbin/afs/src/tests/rm-rf.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <fs.h>
-#include <arlalib.h>
-#include <kafs.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: rm-rf.c,v 1.10 2000/10/03 00:35:49 lha Exp $");
-#endif
-
-static void
-kill_one (const char *filename);
-
-static void
-kill_dir (const char *dirname);
-
-static void
-do_dir (const char *dirname);
-
-#ifdef KERBEROS
-static int has_afs = 0;
-#endif
-
-static void
-kill_one (const char *filename)
-{
- int ret;
-
- ret = unlink (filename);
- if (ret < 0) {
- if (errno == EISDIR || errno == EPERM)
- do_dir (filename);
- else
- err (1, "unlink %s", filename);
- }
-}
-
-static void
-do_dir (const char *dirname)
-{
- int ret;
-
-#ifdef KERBEROS
- if (has_afs) {
- ret = fs_rmmount (dirname);
- if (ret == 0)
- return;
- }
-#endif
-
- ret = chdir (dirname);
- if (ret < 0)
- err (1, "chdir %s", dirname);
- kill_dir (dirname);
- ret = chdir ("..");
- if (ret < 0)
- err (1, "chdir ..");
- ret = rmdir (dirname);
- if (ret < 0)
- err (1, "rmdir %s", dirname);
-}
-
-static void
-kill_dir (const char *dirname)
-{
- DIR *dir;
- struct dirent *dp;
-
- dir = opendir (".");
- if (dir == NULL)
- err (1, "opendir %s", dirname);
- while ((dp = readdir (dir)) != NULL) {
- if (strcmp (dp->d_name, ".") == 0
- || strcmp (dp->d_name, "..") == 0)
- continue;
-
- kill_one (dp->d_name);
- }
- closedir(dir);
-}
-
-int
-main(int argc, char **argv)
-{
- set_progname (argv[0]);
-
-#ifdef KERBEROS
- has_afs = k_hasafs();
-#endif
-
- if (argc < 2)
- errx (1, "usage: %s directory [...]", argv[0]);
- while (argc >= 2) {
- do_dir (argv[1]);
- argc--;
- argv++;
- }
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/run-tests.in b/usr.sbin/afs/src/tests/run-tests.in
deleted file mode 100644
index 27c8ac7b9cd..00000000000
--- a/usr.sbin/afs/src/tests/run-tests.in
+++ /dev/null
@@ -1,250 +0,0 @@
-#!/bin/sh
-#
-# $KTH: run-tests.in,v 1.70.2.3 2002/02/05 13:22:11 lha Exp $
-#
-srcdir=@srcdir@
-objdir=`pwd`
-SHELL=/bin/sh
-VERSION=@VERSION@
-PACKAGE=@PACKAGE@
-host=@host@
-
-AFSROOT=${AFSROOT-/afs}
-export AFSROOT
-
-ARLA_TESTS="creat1 \
- mkdir1 \
- mkdir2 \
- symlink \
- hardlink1 \
- hardlink2 \
- hardlink3 \
- touch1 \
- write1 \
- write2 \
- append1 \
- rename1 \
- rename2 \
- rename3 \
- rename4 \
- rename5 \
- rename-under-feet \
- large-filename \
- fchmod \
- truncate \
- mkdir-lnk \
- mkm-rmm \
- fs-sa-la \
- copy-file \
- dd \
- exec \
- ga-test \
- kotest \
- readfile-wo-create \
- mountpoint \
- strange-characters \
- strange-characters-c \
- strange-other-characters \
- pine \
- write-ro-file \
- hello-world \
- write-ucc \
- utime-dir \
- append-over-page \
- mmap-shared-write \
- read-vs-mmap \
- read-vs-mmap2 \
- mmap-vs-read \
- mmap-vs-read2 \
- read-write \
- mmap-and-read \
- checkpwd \
- exit-wo-close \
- dir-size-mismatch \
- parallel1 \
- getdents-and-unlink1 \
- getdents-and-unlink2 \
- getdents-and-unlink3 \
- build-gdb \
- large-dir-16384 \
- large-dir-extra \
- find-linux \
- find-and-cat-netbsd \
- test-gunzip-gnu-mirror \
- build-emacs \
- build-emacs-j \
- untar-emacs \
- copy-and-diff-gnu-mirror \
- setpag \
- create-remove-files \
- create-remove-dirs \
- fcachesize-dir \
- fcachesize-file-small \
- compare-inums"
-
-# this should really be work, but it's hard and it doesn't work so
-# leave it out not to scare users
-
-# compare-inum-mp \
-
-# visit-volumes \
-
-
-# discon-create \
-# discon-echo \
-# discon-touch1 \
-# discon-touch2 \
-# discon-mkdir \
-# discon-mkdir2 \
-# discon-tar1 \
-# discon-tar2 \
-
-# you need to be root to run this: setgroups
-
-MILKO_TESTS="mkdir \
- many-dirs \
- many-files \
- many-symlinks \
- many-files-with-content \
- many-stores \
- many-fetchs \
- deep-tree \
- deep-tree2 \
- boot-strap-arla"
-
-TESTS="$ARLA_TESTS"
-TEST_MODE="arla"
-
-linebreak=":-------------------------------;"
-
-PARALLELL=
-FAST=
-LARGE=
-FAIL=
-PRINT_CACHESIZE=
-usage="Usage: $0 [-arla|-milko] [-all] [-fast] [-fail] [-j] [-large] [-verbose] [-x] tests ..."
-while true
-do
- case $1 in
- -all) ALL=yes;;
- -fast) FAST=yes;;
- -fail) FAIL=yes;;
- -large) LARGE=yes;;
- -j) PARALLELL="&";;
- -verbose) VERBOSE=yes;;
- -x) SHELLVERBOSE="-x";;
- -p) PRINT_CACHESIZE="yes";;
- -arla) TESTS="$ARLA_TESTS";TEST_MODE="arla";;
- -milko) TESTS="$MILKO_TESTS";TEST_MODE="milko";;
- -help|--help) echo $usage;
- echo "arla tests available: $linebreak"; for a in "$ARLA_TESTS"; do echo $a ; done;
- echo "milko tests available: $linebreak"; for a in "$MILKO_TESTS"; do echo $a ; done;
- exit 0;;
- -version|--version) echo "$KTH: run-tests.in,v 1.70.2.3 2002/02/05 13:22:11 lha Exp $"; exit 0;;
- -*) echo "$0: Bad option $1"; echo $usage; exit 1;;
- *) break;;
- esac
- shift
-done
-
-if test "X$WORKDIR" = "X";then
- echo "WORKDIR=workdir $0 $* or env WORKDIR=workdir $0 $*"; exit 1;
-fi
-
-RUNTESTS=
-if test "X$ALL" != "X" ; then
- RUNTESTS="$TESTS"
-elif test $# -lt 1; then
- echo $usage; exit
-else
- RUNTESTS=$*
-fi
-
-# these are variables exported to the scripts
-
-export FAST
-export LARGE
-export VERBOSE
-export SHELLVERBOSE
-
-# and file descriptors
-
-# 3 - progress
-# 4 - details
-
-if test "$VERBOSE" = "yes"; then
- exec 3>/dev/null
- exec 4>&1
-else
- exec 3>&1
- exec 4>/dev/null
-fi
-
-# Find out where we really are
-
-srcdir=`cd $srcdir; pwd`
-objdir=`cd $objdir; pwd`
-
-export srcdir
-export objdir
-
-echo "-------------------------------------------------"
-echo "$PACKAGE-$VERSION"
-echo "hosttype $host"
-echo "${SHELL},${SHELLVERBOSE},${VERBOSE},${PARALLELL},${FAST}"
-echo "testmode ${TEST_MODE}"
-echo "${srcdir}"
-echo "${objdir}"
-echo "${WORKDIR}"
-date
-echo "-------------------------------------------------"
-
-test "X$VERBOSE" != "X" && echo "Running tests"
-
-FAILEDTESTS=
-exitval=0
-
-for a in $RUNTESTS; do
- #
- # XXX Test if binary in $srcdir, shellscript in $srcdir else
- # its a binary in objdir
- #
- if test -x ${srcdir}/$a ; then
- b="${srcdir}/$a"
- elif test -f ${srcdir}/$a ; then
- b="${SHELL} ${SHELLVERBOSE} ${srcdir}/$a"
- else
- b="${objdir}/$a"
- fi
- echo "Running $a"
- test "X$VERBOSE" != "X" && echo "Running test $a ($b)."
- tmpdir="`hostname`-$a-`date +%Y-%m-%d-%H-%M-%S`-$$"
- cd $WORKDIR && mkdir $tmpdir && (cd $tmpdir && $b ${PARALLELL})
- saved_res=$?
- test "X$VERBOSE" != "X" && echo "Saved res = $saved_res"
- if test "X${PARALLELL}" = "X" ;then
- if test $saved_res != 0 ; then
- echo "Test $a FAILED"
- FAILEDTESTS="${FAILEDTESTS} $a";
- exitval=$savedres
- if test X$FAIL != X; then break; fi
- else
- test "X$VERBOSE" != "X" && echo "Test $a succeeded, tmpdir is removed"
- ${objdir}/rm-rf $tmpdir
- fi
- test "X$VERBOSE" != "X" && echo "Done test $a."
- fi
- test "X${PRINT_CACHESIZE}" = Xyes && $objdir/../appl/fs/fs calculate
-done
-
-wait
-date
-
-if test "$FAILEDTESTS"; then
- echo "-----------------------------------------------------------"
- echo "Failed test(s) were: $FAILEDTESTS"
-else
- echo "All test(s) were succesful!"
-fi
-
-exit $exitval
diff --git a/usr.sbin/afs/src/tests/setgroups b/usr.sbin/afs/src/tests/setgroups
deleted file mode 100644
index 565ea5114ca..00000000000
--- a/usr.sbin/afs/src/tests/setgroups
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# $KTH: setgroups,v 1.1 1999/05/28 09:43:00 assar Exp $
-
-$objdir/test-setgroups nobody 1>&4
diff --git a/usr.sbin/afs/src/tests/setpag b/usr.sbin/afs/src/tests/setpag
deleted file mode 100644
index 444b5d99694..00000000000
--- a/usr.sbin/afs/src/tests/setpag
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# $KTH: setpag,v 1.1 1999/05/28 09:43:01 assar Exp $
-
-$objdir/test-setpag 1>&4
diff --git a/usr.sbin/afs/src/tests/shallow-tree b/usr.sbin/afs/src/tests/shallow-tree
deleted file mode 100644
index 4da507627f9..00000000000
--- a/usr.sbin/afs/src/tests/shallow-tree
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-# $KTH: shallow-tree,v 1.5 2000/07/03 16:12:11 haba Exp $
-
-mkdir foo && ( cd foo && $SHELL $SHELLVERBOSE ${srcdir}/dir-tree 3 "0 1 2 3 4" )
-${objdir}/rm-rf foo \ No newline at end of file
diff --git a/usr.sbin/afs/src/tests/still-there-p.c b/usr.sbin/afs/src/tests/still-there-p.c
deleted file mode 100644
index be097c58ac8..00000000000
--- a/usr.sbin/afs/src/tests/still-there-p.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include <roken.h>
-
-#include <err.h>
-
-RCSID("$KTH: still-there-p.c,v 1.1.2.1 2001/04/28 22:09:39 lha Exp $");
-
-#define TEST_BUFFER_SZ (1024*8)
-
-int
-main(int argc, char **argv)
-{
- const char *file = "foo";
- char otherbuf[TEST_BUFFER_SZ];
- char buf[TEST_BUFFER_SZ];
- int fd;
-
- set_progname (argv[0]);
-
- fd = open (file, O_RDWR|O_TRUNC|O_CREAT, 0644);
- if (fd < 0)
- err(1, "open(%s)", file);
-
- if (write (fd, buf, sizeof(buf)) != sizeof(buf))
- errx(1, "write");
-
- while (1) {
- if (lseek(fd, 0, SEEK_SET) < 0)
- err(1, "lseek");
-
- if (read(fd, otherbuf, sizeof(otherbuf)) != sizeof(otherbuf)) {
- struct stat sb;
-
- if (fstat(fd, &sb) < 0)
- err(1, "fstat");
- printf("size: %d\n", (int)sb.st_size);
- printf ("lseek(SEEK_CUR): %d\n", (int)lseek(fd, 0, SEEK_CUR));
- errx(1, "read");
- }
-
- if (memcmp(buf, otherbuf, sizeof(buf)) != 0)
- errx (1, "buf != otherbuf");
- }
- close(fd);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/strange-characters b/usr.sbin/afs/src/tests/strange-characters
deleted file mode 100644
index 6b3acc94a28..00000000000
--- a/usr.sbin/afs/src/tests/strange-characters
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-# $KTH: strange-characters,v 1.1 1998/12/05 22:46:58 assar Exp $
-for i in å ä ö åäö; do
- touch $i || exit 1
- test -f $i || exit 1
- rm $i || exit 1
-done
diff --git a/usr.sbin/afs/src/tests/strange-characters-c.c b/usr.sbin/afs/src/tests/strange-characters-c.c
deleted file mode 100644
index 379801bdf17..00000000000
--- a/usr.sbin/afs/src/tests/strange-characters-c.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: strange-characters-c.c,v 1.2 2000/10/03 00:35:54 lha Exp $");
-#endif
-
-static void
-creat_file (char *name)
-{
- int fd;
-
- fd = open (name, O_WRONLY | O_CREAT | O_EXCL, 0777);
- if (fd < 0)
- err (1, "open %s", name);
- if (close (fd) < 0)
- err (1, "close %s", name);
-}
-
-static void
-look_at_file (char *name)
-{
- int fd;
-
- fd = open (name, O_RDONLY | O_EXCL, 0777);
- if (fd < 0)
- err (1, "open %s", name);
- if (close (fd) < 0)
- err (1, "close %s", name);
-}
-
-static void
-usage (int ret)
-{
- fprintf (stderr, "%s\n", __progname);
- exit (ret);
-}
-
-int
-main(int argc, char **argv)
-{
- char *file = "åäö";
-
- set_progname (argv[0]);
-
- if (argc != 1)
- usage (1);
-
- creat_file (file);
- look_at_file (file);
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/strange-other-characters b/usr.sbin/afs/src/tests/strange-other-characters
deleted file mode 100644
index 937ef9a3638..00000000000
--- a/usr.sbin/afs/src/tests/strange-other-characters
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-# $KTH: strange-other-characters,v 1.2 1998/12/15 03:50:13 assar Exp $
-dir=$AFSROOT/stacken.kth.se/ftp/pub/arla/tests
-
-test -f $dir/åäö || exit 1
diff --git a/usr.sbin/afs/src/tests/symlink.c b/usr.sbin/afs/src/tests/symlink.c
deleted file mode 100644
index bf33787cc37..00000000000
--- a/usr.sbin/afs/src/tests/symlink.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 1999 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: symlink.c,v 1.3 2000/10/03 00:35:59 lha Exp $");
-#endif
-
-int
-main(int argc, char **argv)
-{
- int ret;
- struct stat sb;
-
- set_progname (argv[0]);
-
- ret = symlink ("foo", "bar");
- if (ret < 0)
- err (1, "symlink foo,bar");
- ret = lstat ("bar", &sb);
- if (ret < 0)
- err (1, "lstat bar");
- if ((sb.st_mode & S_IFLNK) != S_IFLNK)
- errx (1, "bar is not symlink");
- ret = unlink ("bar");
- if (ret < 0)
- err (1, "unlink bar");
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/test-gunzip-gnu-mirror b/usr.sbin/afs/src/tests/test-gunzip-gnu-mirror
deleted file mode 100644
index 67cca4e1337..00000000000
--- a/usr.sbin/afs/src/tests/test-gunzip-gnu-mirror
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-# $KTH: test-gunzip-gnu-mirror,v 1.2 1999/07/03 05:38:22 assar Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-original=${1-$AFSROOT/stacken.kth.se/ftp/pub/gnu}
-cd $original || exit 1
-find . -name '*.gz' -print | while read i; do
- foo=`gunzip --verbose --test $i 2>&1`
- echo $foo >& 4
- case "$foo" in
-*not*in*gzip*format*) ;;
-*OK*) ;;
-*) exit 1 ;;
- esac
-done
diff --git a/usr.sbin/afs/src/tests/test-parallel1.c b/usr.sbin/afs/src/tests/test-parallel1.c
deleted file mode 100644
index 3bc18def1fb..00000000000
--- a/usr.sbin/afs/src/tests/test-parallel1.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/param.h>
-#include <unistd.h>
-
-#include <err.h>
-#include <roken.h>
-
-#include <atypes.h>
-#include <kafs.h>
-
-#ifdef RCSID
-RCSID("$KTH: test-parallel1.c,v 1.3 2000/10/03 00:36:05 lha Exp $");
-#endif
-
-#define WORKER_TIMES 100
-#define NUM_WORKER 10
-
-static int
-worker (int num)
-{
- int i, fd;
-
- for (i = 0 ; i < WORKER_TIMES ; i++) {
- fd = open ("foo", O_CREAT|O_RDWR, 0600);
- if (fd >= 0) {
- fchmod (fd, 0700);
- close (fd);
- }
- unlink("foo");
- if (i % 1000) {
- printf (" %d", num);
- fflush (stdout);
- }
- }
- return 0;
-}
-
-
-int
-main(int argc, char **argv)
-{
- int i, ret;
-
- set_progname (argv[0]);
-
- for (i = 0; i < NUM_WORKER ; i++) {
- int ret;
-
- ret = fork();
- switch (ret) {
- case 0:
- return worker(i);
- case -1:
- err (1, "fork");
- }
- }
- i = NUM_WORKER;
- while (i && wait (&ret)) {
- i--;
- if (ret)
- err (1, "wait: %d", ret);
- }
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/test-parallel2.c b/usr.sbin/afs/src/tests/test-parallel2.c
deleted file mode 100644
index b609b13800a..00000000000
--- a/usr.sbin/afs/src/tests/test-parallel2.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include <err.h>
-#include <roken.h>
-
-#include <atypes.h>
-#include <kafs.h>
-
-#ifdef RCSID
-RCSID("$KTH: test-parallel2.c,v 1.2 2000/10/03 00:36:10 lha Exp $");
-#endif
-
-#define WORKER_TIMES 1000
-#define NUM_WORKER 100
-
-static int
-getcwd_worker (int num)
-{
- char name[17];
- int i;
-
- snprintf (name, sizeof(name), "%d", num);
- if (mkdir (name, 0777) < 0)
- err (1, "mkdir %s", name);
- if (chdir (name) < 0)
- err (1, "chdir %s", name);
- for (i = 0; i < WORKER_TIMES; ++i) {
- char buf[256];
-
- getcwd (buf, sizeof(buf));
- }
- return 0;
-}
-
-static int
-mkdir_worker (int num)
-{
- int i;
-
- for (i = 0; i < WORKER_TIMES; ++i){
- char name[256];
-
- snprintf (name, sizeof(name), "m%d-%d", num, i);
- mkdir (name, 0777);
- }
- return 0;
-}
-
-static int
-mkdir_rmdir_worker (int num)
-{
- int i;
-
- for (i = 0; i < WORKER_TIMES; ++i){
- char name[256];
-
- snprintf (name, sizeof(name), "rm%d-%d", num, i);
- mkdir (name, 0777);
- }
- for (i = 0; i < WORKER_TIMES; ++i){
- char name[256];
-
- snprintf (name, sizeof(name), "rm%d-%d", num, i);
- rmdir (name);
- }
- return 0;
-}
-
-static int
-rename_worker (int num)
-{
- int i;
-
- for (i = 0; i < WORKER_TIMES; ++i){
- char name[256];
- int fd;
-
- snprintf (name, sizeof(name), "rm%d-%d", num, i);
- fd = open (name, O_WRONLY | O_CREAT, 0777);
- close (fd);
- }
- for (i = 0; i < WORKER_TIMES; ++i){
- char name[256], name2[256];
-
- snprintf (name, sizeof(name), "rm%d-%d", num, i);
- snprintf (name2, sizeof(name2), "rn%d-%d", num, i);
- rename (name, name2);
- }
- return 0;
-}
-
-static int
-stat_worker (int num)
-{
- char name[17];
- int i;
- char buf[256];
- struct stat sb;
-
- snprintf (name, sizeof(name), "%d", num);
- if (mkdir (name, 0777) < 0)
- err (1, "mkdir %s", name);
- if (chdir (name) < 0)
- err (1, "chdir %s", name);
- for (i = 0; i < WORKER_TIMES; ++i) {
- getcwd (buf, sizeof(buf));
- stat (buf, &sb);
- }
- return 0;
-}
-
-static int (*workers[])(int) = {getcwd_worker, mkdir_worker,
- mkdir_rmdir_worker, rename_worker,
- stat_worker};
-
-static int nworkers = sizeof(workers)/sizeof(*workers);
-
-int
-main(int argc, char **argv)
-{
- int i, ret;
-
- set_progname (argv[0]);
-
- for (i = 0; i < NUM_WORKER ; i++) {
- int ret;
-
- ret = fork();
- switch (ret) {
- case 0:
- return (*workers[i % nworkers])(i);
- case -1:
- err (1, "fork");
- }
- }
- i = NUM_WORKER;
- while (i && wait (&ret)) {
- i--;
- if (ret)
- err (1, "wait: %d", ret);
- }
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/test-setgroups.c b/usr.sbin/afs/src/tests/test-setgroups.c
deleted file mode 100644
index 8455c59ecf3..00000000000
--- a/usr.sbin/afs/src/tests/test-setgroups.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <unistd.h>
-#include <pwd.h>
-#include <limits.h>
-
-#include <err.h>
-#include <roken.h>
-
-#include <atypes.h>
-#include <kafs.h>
-
-#ifdef RCSID
-RCSID("$KTH: test-setgroups.c,v 1.6 2000/10/03 00:36:15 lha Exp $");
-#endif
-
-#ifdef KERBEROS
-
-#if !defined(NGROUPS) && defined(NGROUPS_MAX)
-#define NGROUPS NGROUPS_MAX
-#endif
-
-static void
-print_groups (int ngroups, gid_t groups[NGROUPS])
-{
- int i;
-
- printf ("groups: ");
- for (i = 0; i < ngroups; ++i)
- printf ("%d%s", groups[i], (i < ngroups - 1) ? ", " : "");
- printf ("\n");
-}
-
-int
-main(int argc, char **argv)
-{
- char *user;
- char *this_user;
- struct passwd *this_pwd, *pwd;
- int ret;
- gid_t groups[NGROUPS];
- int ngroups;
- gid_t pag0, pag1, pag2;
-
- set_progname (argv[0]);
-
- if (argc != 2)
- errx (1, "Usage: %s user", argv[0]);
- user = argv[1];
-
- if (!k_hasafs ())
- errx (1, "No AFS?");
-
- this_pwd = getpwuid (getuid ());
- if (this_pwd == NULL)
- errx (1, "Who are you?");
- this_user = estrdup (this_pwd->pw_name);
-
- pwd = getpwnam (user);
- if (pwd == NULL)
- errx (1, "User %s not found", user);
-
- ngroups = getgroups (NGROUPS, groups);
- if (ngroups < 0)
- err (1, "getgroups %d", NGROUPS);
- printf ("user %s ", this_user);
- print_groups (ngroups, groups);
- printf ("doing k_setpag()\n");
- ret = k_setpag ();
- if (ret < 0)
- err (1, "k_setpag");
-
- ngroups = getgroups (NGROUPS, groups);
- if (ngroups < 0)
- err (1, "getgroups %d", NGROUPS);
- pag0 = groups[0];
- pag1 = groups[1];
- pag2 = groups[2];
- printf ("user %s ", this_user);
- print_groups (ngroups, groups);
-
- ret = initgroups (user, pwd->pw_gid);
- if (ret < 0)
- err (1, "initgroups");
-
- ngroups = getgroups (NGROUPS, groups);
- if (ngroups < 0)
- err (1, "getgroups %d", NGROUPS);
- printf ("user %s ", user);
- print_groups (ngroups, groups);
- if ((groups[0] == pag0 && groups[1] == pag1)
- || (groups[1] == pag1 && groups[2] == pag2))
- return 0;
- else
- return 1;
-}
-
-#else /* !KERBEROS */
-
-int
-main (int argc, char **argv)
-{
- set_progname (argv[0]);
-
- errx (1, "no kafs");
-}
-
-#endif /* !KERBEROS */
diff --git a/usr.sbin/afs/src/tests/test-setpag.c b/usr.sbin/afs/src/tests/test-setpag.c
deleted file mode 100644
index 3aecdb5ad7a..00000000000
--- a/usr.sbin/afs/src/tests/test-setpag.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/param.h>
-#include <unistd.h>
-#include <pwd.h>
-#include <limits.h>
-
-#include <err.h>
-#include <roken.h>
-
-#include <atypes.h>
-#include <kafs.h>
-
-#ifdef RCSID
-RCSID("$KTH: test-setpag.c,v 1.5 2000/10/03 00:36:21 lha Exp $");
-#endif
-
-#ifdef KERBEROS
-
-#if !defined(NGROUPS) && defined(NGROUPS_MAX)
-#define NGROUPS NGROUPS_MAX
-#endif
-
-static void
-print_groups (int ngroups, gid_t groups[NGROUPS])
-{
- int i;
-
- printf ("groups: ");
- for (i = 0; i < ngroups; ++i)
- printf ("%d%s", groups[i], (i < ngroups - 1) ? ", " : "");
- printf ("\n");
-}
-
-int
-main(int argc, char **argv)
-{
- int ret;
- gid_t groups[NGROUPS];
- int ngroups;
- gid_t pag1, pag2;
- pid_t pid;
-
- set_progname (argv[0]);
-
- if (argc != 1)
- errx (1, "Usage: %s", argv[0]);
-
- if (!k_hasafs ())
- errx (1, "No AFS?");
-
- ngroups = getgroups (NGROUPS, groups);
- if (ngroups < 0)
- err (1, "getgroups %d", NGROUPS);
- pag1 = groups[1];
- pag2 = groups[2];
- printf ("in parent ");
- print_groups (ngroups, groups);
- pid = fork ();
- if (pid < 0)
- err (1, "fork");
- if (pid == 0) {
- ret = k_setpag ();
- if (ret < 0)
- err (1, "k_setpag");
- ngroups = getgroups (NGROUPS, groups);
- if (ngroups < 0)
- err (1, "getgroups %d", NGROUPS);
- printf ("in child ");
- print_groups (ngroups, groups);
- return 0;
- } else {
- int status;
-
- while(waitpid (pid, &status, WNOHANG | WUNTRACED) != pid)
- ;
- if (status)
- return 1;
- ngroups = getgroups (NGROUPS, groups);
- if (ngroups < 0)
- err (1, "getgroups %d", NGROUPS);
- printf ("in parent ");
- print_groups (ngroups, groups);
- if (groups[1] == pag1 && groups[2] == pag2)
- return 0;
- else
- return 1;
- }
-}
-
-#else /* !KERBEROS */
-
-int
-main (int argc, char **argv)
-{
- set_progname (argv[0]);
-
- errx (1, "no kafs");
-}
-
-#endif /* !KERBEROS */
diff --git a/usr.sbin/afs/src/tests/touch1 b/usr.sbin/afs/src/tests/touch1
deleted file mode 100644
index 61badc5dc6a..00000000000
--- a/usr.sbin/afs/src/tests/touch1
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-touch foobar || exit 1
-test -f foobar || exit 1
-rm foobar || exit 1
diff --git a/usr.sbin/afs/src/tests/truncate.c b/usr.sbin/afs/src/tests/truncate.c
deleted file mode 100644
index 50653a158a5..00000000000
--- a/usr.sbin/afs/src/tests/truncate.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <err.h>
-#include <roken.h>
-
-RCSID("$KTH: truncate.c,v 1.2 2000/10/03 00:36:26 lha Exp $");
-
-static void
-create_and_write (char *name, const char *buf)
-{
- int fd, ret;
- int len = strlen(buf);
-
- fd = open (name, O_WRONLY|O_CREAT|O_TRUNC, 0666);
- if (fd < 0)
- err (1, "open");
- ret = write (fd, buf, len);
- if (ret != len)
- err (1, "write");
- ret = close (fd);
- if (ret < 0)
- err (1, "close");
-}
-
-static void
-check_size (char *name, int len)
-{
- struct stat sb;
- int ret;
-
- ret = stat(name, &sb);
- if (ret < 0)
- err (1, "stat");
-
- if (len != sb.st_size)
- errx (1, "len != sb.st_size");
-}
-
-int
-main(int argc, char **argv)
-{
- int ret;
-
- set_progname (argv[0]);
-
- create_and_write ("foo", "hej\n");
-
- ret = truncate ("foo", 0);
- if (ret < 0)
- err (1, "truncate(0)");
-
- check_size ("foo", 0);
-
- ret = unlink("foo");
- if (ret < 0)
- errx (1, "unlink");
-
- create_and_write ("bar", "hej\nhej\n");
-
- ret = truncate ("bar", 16);
- if (ret < 0)
- err (1, "truncate(16)");
-
- check_size ("bar", 16);
-
- ret = unlink("bar");
- if (ret < 0)
- errx (1, "unlink");
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/untar-emacs b/usr.sbin/afs/src/tests/untar-emacs
deleted file mode 100644
index 77af57e72d6..00000000000
--- a/usr.sbin/afs/src/tests/untar-emacs
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-# $KTH: untar-emacs,v 1.17 2000/07/01 05:41:40 assar Exp $
-if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi
-for i in 1 2 3 4 5 6 7 8 9 10; do
- $objdir/echo-n '.' >&3
- gzip -dc $AFSROOT/stacken.kth.se/ftp/pub/gnu/emacs/emacs-20.7.tar.gz | tar xvf - >&4 || exit 1
- rm -rf emacs-20.7
-done
-echo >&3
diff --git a/usr.sbin/afs/src/tests/utime-dir.c b/usr.sbin/afs/src/tests/utime-dir.c
deleted file mode 100644
index 24ad33f084d..00000000000
--- a/usr.sbin/afs/src/tests/utime-dir.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <err.h>
-#include <roken.h>
-
-RCSID("$KTH: utime-dir.c,v 1.2 2000/10/03 00:36:32 lha Exp $");
-
-static void
-doit (const char *filename)
-{
- int ret;
- struct timeval tv[2];
-
- ret = mkdir (filename, 0700);
- if (ret < 0)
- err (1, "mkdir %s", filename);
- gettimeofday (&tv[0], NULL);
- tv[1] = tv[0];
- ret = utimes (filename, tv);
- if (ret < 0)
- err(1, "utimes %s", filename);
-}
-
-int
-main(int argc, char **argv)
-{
- const char *file = "blaha";
-
- set_progname (argv[0]);
- if (argc != 1 && argc != 2)
- errx (1, "usage: %s [file]", argv[0]);
- if (argc == 2)
- file = argv[1];
- doit (file);
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/utime-file.c b/usr.sbin/afs/src/tests/utime-file.c
deleted file mode 100644
index 6956ffd8be5..00000000000
--- a/usr.sbin/afs/src/tests/utime-file.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef RCSID
-RCSID("$KTH: utime-file.c,v 1.2 2000/12/01 15:01:21 lha Exp $");
-#endif
-
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <utime.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-
-#include <roken.h>
-#include <err.h>
-
-int
-main (int argc, char ** argv)
-{
- int len;
- int ret;
- int fd;
- char *filename = "foo";
- char *buf;
- struct stat sb;
- struct utimbuf t;
-
- switch (argc) {
- case 1:
- len = 8 * 1024; break;
- case 2:
- len = atoi(argv[1]);
- if (len == 0)
- errx (1, "invalid len");
- default:
- errx (1, "argv != [12]");
- }
-
- buf = malloc (len);
- memset (buf, 'a', len);
-
- fd = open (filename, O_RDWR|O_CREAT|O_EXCL, 0744);
- if (fd < 0)
- errx (1, "open");
- ret = fstat (fd, &sb);
- if (ret < 0)
- errx (1, "open");
-
- ret = ftruncate (fd, len);
- fstat (fd, &sb);
- lseek (fd, 0, SEEK_SET);
- write (fd, buf, len);
- fstat (fd, &sb);
-
- t.modtime = t.actime = time (NULL);
- utime (filename, &t);
-
- close (fd);
- free (buf);
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/visit-volumes b/usr.sbin/afs/src/tests/visit-volumes
deleted file mode 100644
index d66c8394272..00000000000
--- a/usr.sbin/afs/src/tests/visit-volumes
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-# $KTH: visit-volumes,v 1.2 2000/07/01 08:26:37 assar Exp $
-ls ${AFSROOT}/nada.kth.se/* >&4 2>&4 || exit 1
-ls -l ${AFSROOT}/nada.kth.se/* >&4 2>&4 || exit 1
-ls ${AFSROOT}/nada.kth.se/*/* >&4 2>&4 || exit 1
-ls -l ${AFSROOT}/nada.kth.se/*/* >&4 2>&4 || exit 1
diff --git a/usr.sbin/afs/src/tests/write-closed.c b/usr.sbin/afs/src/tests/write-closed.c
deleted file mode 100644
index 1e714598597..00000000000
--- a/usr.sbin/afs/src/tests/write-closed.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include <roken.h>
-
-#include <err.h>
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-RCSID("$KTH: write-closed.c,v 1.3 2000/10/03 00:36:37 lha Exp $");
-
-static void
-doit (const char *filename)
-{
- int fd;
- int ret;
- void *buf;
-
- fd = open (filename, O_RDWR | O_CREAT | O_TRUNC, 0600);
- if (fd < 0)
- err (1, "open %s", filename);
- ret = ftruncate (fd, 1);
- if (ret < 0)
- err (1, "ftruncate %s", filename);
- buf = mmap (NULL, 1, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
- if (buf == (void *) MAP_FAILED)
- err (1, "mmap");
- if (fchmod (fd, 0) < 0)
- err (1, "fchmod %s, 0", filename);
- ret = close (fd);
- if (ret < 0)
- err (1, "close %s", filename);
- *((char *)buf) = 0x17;
- ret = munmap (buf, 1);
- if (ret < 0)
- err (1, "munmap");
-}
-
-int
-main(int argc, char **argv)
-{
- const char *file = "foo";
-
- set_progname (argv[0]);
- if (argc != 1 && argc != 2)
- errx (1, "usage: %s [file]", argv[0]);
- if (argc == 2)
- file = argv[1];
- doit (file);
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/write-closed2.c b/usr.sbin/afs/src/tests/write-closed2.c
deleted file mode 100644
index f758dd5c856..00000000000
--- a/usr.sbin/afs/src/tests/write-closed2.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#ifdef HAVE_SYS_IOCCOM_H
-#include <sys/ioccom.h>
-#endif
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <dirent.h>
-
-#include <atypes.h>
-#include <kafs.h>
-
-#include <roken.h>
-
-#include <err.h>
-
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif
-
-RCSID("$KTH: write-closed2.c,v 1.5 2000/10/03 00:36:42 lha Exp $");
-
-static int
-set_acl (char *dir)
-{
- struct ViceIoctl a_params;
- char *foo = "1\n0\nsystem:anyuser 0\n";
-
- a_params.in_size = strlen(foo);
- a_params.out_size = 0;
- a_params.in = foo;
- a_params.out = NULL;
-
- return k_pioctl (dir, VIOCSETAL, &a_params, 1);
-}
-
-static void
-doit (const char *filename)
-{
- int fd;
- int ret;
- void *buf;
-
- ret = mkdir ("bad", 0777);
- if (ret < 0)
- err (1, "mkdir bad");
-
- ret = chdir ("bad");
- if (ret < 0)
- err (1, "chdir bad");
-
- fd = open (filename, O_RDWR | O_CREAT | O_TRUNC, 0600);
- if (fd < 0)
- err (1, "open %s", filename);
- ret = ftruncate (fd, 1);
- if (ret < 0)
- err (1, "ftruncate %s", filename);
- buf = mmap (NULL, 1, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
- if (buf == (void *) MAP_FAILED)
- err (1, "mmap");
- ret = set_acl (".");
- if (ret < 0)
- err (1, "setacl failed");
-
- ret = close (fd);
- if (ret < 0)
- err (1, "close %s", filename);
- *((char *)buf) = 0x17;
- ret = munmap (buf, 1);
- if (ret < 0)
- err (1, "munmap");
-}
-
-int
-main(int argc, char **argv)
-{
- const char *file = "foo";
-
- set_progname (argv[0]);
-
- if (!k_hasafs())
- errx (1, "!k_hasafs");
-
- if (argc != 1 && argc != 2)
- errx (1, "usage: %s [file]", argv[0]);
- if (argc == 2)
- file = argv[1];
- doit (file);
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/write-ro-file.c b/usr.sbin/afs/src/tests/write-ro-file.c
deleted file mode 100644
index 929dbdb2ca5..00000000000
--- a/usr.sbin/afs/src/tests/write-ro-file.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#include <err.h>
-#include <roken.h>
-
-#ifdef RCSID
-RCSID("$KTH: write-ro-file.c,v 1.6 2000/10/03 00:36:48 lha Exp $");
-#endif
-
-int
-main(int argc, char *argv[])
-{
- int fd;
- int ret;
-
- set_progname (argv[0]);
-
- fd = open("foo", O_RDWR|O_CREAT, 0);
- if (fd < 0)
- err (1, "open foo");
- ret = write (fd, "foo", 3);
- if (ret < 0) {
- unlink("foo");
- err (1, "write foo");
- }
- ret = close (fd);
- if (ret < 0) {
- unlink("foo");
- err (1, "close foo");
- }
- unlink("foo");
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/write-ucc.c b/usr.sbin/afs/src/tests/write-ucc.c
deleted file mode 100644
index c87b25f4a6c..00000000000
--- a/usr.sbin/afs/src/tests/write-ucc.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <err.h>
-#include <roken.h>
-
-RCSID("$KTH: write-ucc.c,v 1.3 2000/10/03 00:36:53 lha Exp $");
-
-static void
-doit (const char *filename)
-{
- int fd;
- int ret;
- struct timeval tv[2];
- struct stat sb;
-
- fd = open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0600);
- if (fd < 0)
- err (1, "open %s", filename);
- ret = write (fd, "hej\n", 4);
- if(ret < 0)
- err (1, "write %s", filename);
- if (ret != 4)
- errx (1, "short write to %s", filename);
- gettimeofday (&tv[0], NULL);
- tv[1] = tv[0];
- ret = utimes (filename, tv);
- if(ret < 0)
- err (1, "utimes %s", filename);
- ret = chmod (filename, 0644);
- if (ret < 0)
- err (1, "chmod %s", filename);
- ret = chown (filename, 0, 0);
- ret = fstat (fd, &sb);
- if (ret < 0)
- err (1, "fstat %s", filename);
- if (sb.st_size != 4)
- errx (1, "stat 1: size = %lu != 4", (unsigned long)sb.st_size);
- ret = close (fd);
- if (ret < 0)
- err (1, "close %s", filename);
- ret = stat (filename, &sb);
- if (ret < 0)
- err (1, "stat %s", filename);
- if (sb.st_size != 4)
- errx (1, "stat 1: size = %lu != 4", (unsigned long)sb.st_size);
-}
-
-int
-main(int argc, char **argv)
-{
- const char *file = "blaha";
-
- set_progname (argv[0]);
- if (argc != 1 && argc != 2)
- errx (1, "usage: %s [file]", argv[0]);
- if (argc == 2)
- file = argv[1];
- doit (file);
- return 0;
-}
diff --git a/usr.sbin/afs/src/tests/write1 b/usr.sbin/afs/src/tests/write1
deleted file mode 100644
index 00d386d9b11..00000000000
--- a/usr.sbin/afs/src/tests/write1
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-echo hej > foo || exit 1
-if test X`cat foo` != X"hej"; then exit 1; fi
-rm foo || exit 1
diff --git a/usr.sbin/afs/src/tests/write2 b/usr.sbin/afs/src/tests/write2
deleted file mode 100644
index 8d15d9a7a95..00000000000
--- a/usr.sbin/afs/src/tests/write2
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-echo hopp > foo || exit 1
-if test `cat foo` != "hopp"; then exit 1; fi
-echo hej > foo || exit 1
-if test `cat foo` != "hej"; then exit 1; fi
-rm foo || exit 1
diff --git a/usr.sbin/afs/src/tools/gnats/COPYING b/usr.sbin/afs/src/tools/gnats/COPYING
deleted file mode 100644
index 60549be514a..00000000000
--- a/usr.sbin/afs/src/tools/gnats/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/usr.sbin/afs/src/tools/gnats/INSTALL b/usr.sbin/afs/src/tools/gnats/INSTALL
deleted file mode 100644
index 711c63d8a16..00000000000
--- a/usr.sbin/afs/src/tools/gnats/INSTALL
+++ /dev/null
@@ -1,83 +0,0 @@
- Installation procedures for `send-pr'
-
-If you receive `send-pr' as part of a larger software distribution, it
-will be automatically installed when the full distribution is
-installed. The `send-pr' directory, however, is easily installed by
-itself by following these steps:
-
-1. Unpack the distribution into a directory which we will refer to as
- SRCDIR.
-
-2. Edit the `Makefile' to reflect local conventions.
-
- Specifically, you should edit the variable "prefix" to alter
- the installation location. The default is '/usr/local'. All
- files are installed under "prefix" (see below).
-
-3. Run
- make all install [ info ] install-info [ clean ]
-
- from the "build directory". The targets mean the following:
-
- all Builds `send-pr' and `install-sid'
-
- install Installs the following:
-
- send-pr into PREFIX/bin
- install-sid into PREFIX/bin
- send-pr.1 into PREFIX/man/man1
- categories as PREFIX/lib/gnats/SITE
- send-pr-el.in as PREFIX/lib/emacs/lisp/send-pr.el
-
- info (optional) Builds "send-pr.info" from "send-pr.texi"
- (send-pr.info is included with this distribution)
-
-install-info Installs "send-pr.info" into PREFIX/info
-
- clean (optional) Removes all intermediary build files that can
- be rebuilt from source code
-
-4. Run
-
- install-sid SID
-
- where SID is the submitter identification code you received with
- `send-pr'. If you've downloaded `send-pr' from the Net, use "net"
- for this value.
-
-
-5. Any users who wish to use the Emacs version of `send-pr' must place
- the following line in their ".emacs" files:
-
- (autoload 'send-pr "send-pr" "Submit a Problem Report." t)
-
-
-6. Create a mail alias for the support site you received `send-pr'
- from, and for every site with which you wish to use `send-pr' to
- communicate with, each with a suffix of `-gnats'. The support
- site(s) will provide the correct addresses toward which these
- aliases should point. For instance, edit your mail aliases file
- to contain something like:
-
- # support sites; for use with send-pr
- cygnus-gnats: bugs@cygnus.com # Cygnus Support
- bumblebee-gnats: bumblebugs@bumblebee.com # Bumblebee BASIC, Inc.
- mycompany-gnats: bugs@my.company.com (if you use GNATS locally)
-
- `send-pr' automatically searches for these aliases when you type
-
- send-pr cygnus
- send-pr bumblebee
- send-pr SITE...
-
- `send-pr' also uses SITE to determine the categories of bugs the site
- in question accepts by looking in PREFIX/lib/gnats/SITE
-
-
-7. That's it! See "send-pr.info", "send-pr.texi", and/or "send-pr.1" for
- information on using `send-pr'.
-
-
-Copyright (c) 1993, Free Software Foundation, Inc.
-See the file COPYING for copyright information concerning this
-distribution and all its components.
diff --git a/usr.sbin/afs/src/tools/gnats/MANIFEST b/usr.sbin/afs/src/tools/gnats/MANIFEST
deleted file mode 100644
index 35375a6fd49..00000000000
--- a/usr.sbin/afs/src/tools/gnats/MANIFEST
+++ /dev/null
@@ -1,20 +0,0 @@
- MANIFEST for send-pr
-
-The following files should have accompanied this distribution.
-
- COPYING copyright information
- ChangeLog sourcecode change log
- INSTALL installation procedure
- Makefile.in Makefile template used by `configure'
- MANIFEST list of accompanying files
- README introductory information
- config/ any specialized configuration files
- configure.in input file for `configure'
- categories list of valid categories
- install-sid.sh script which installs Submitter-Id
- send-pr-el.in elisp version of `send-pr' for Emacs
- send-pr.man `send-pr' man file, installed as send-pr.1
- send-pr.info `send-pr' Info file
- send-pr.sh `send-pr' shell script - command line version
- send-pr.texi `send-pr' Texinfo documentation
- send-pr.input `send-pr' Texinfo documentation input file
diff --git a/usr.sbin/afs/src/tools/gnats/README b/usr.sbin/afs/src/tools/gnats/README
deleted file mode 100644
index b479179555f..00000000000
--- a/usr.sbin/afs/src/tools/gnats/README
+++ /dev/null
@@ -1,43 +0,0 @@
- send-pr - sends bug reports to a central support site
-
-`send-pr' uses electronic mail to submit support questions and
-software bugs to a central site. No piece of software is perfect, and
-software organizations understand this `send-pr' is designed to allow
-users who have problems to submit reports of these problems to sites
-responsible for supporting the software in question, in a defined form
-which can be read by an electronically managed database.
-
-`send-pr' is part of a suite of programs known collectively as GNATS,
-an acronym for Problem Report Management System. GNATS consists of
-several programs which, used in concert, formulate and partially
-administer a database of Problem Reports, or PRs, at a central support
-site. A PR goes through several states in its lifetime; GNATS tracks
-the PR and all information associated with it through each state and
-finally acts as an archive for PRs which have been resolved.
-
-The same engine can be used to submit bugs to any number of support
-sites by setting up aliases for each of them; `send-pr' error-checks
-each PR as it is sent to be sure that the category specified matches a
-category supported by the site in question.
-
-`send-pr' invokes an editor on a problem report template (after trying
-to fill in some fields with reasonable default values). When you exit
-the editor, `send-pr' sends the completed form to the support site.
-At the support site, the PR is assigned a unique number and is stored
-in the GNATS database according to its category and customer-id. GNATS
-automatically replies with an acknowledgement, citing the category and
-the PR number.
-
-See the Texinfo file `send-pr.texi' or the Info file `send-pr.info'
-for detailed installation and usage information.
-
-See the file MANIFEST for a list of the files which should have
-accompanied this distribution.
-
-See `send-pr.texi', `send-pr.info', or the file INSTALL for the
-installation procedure for `send-pr'.
-
-
-Copyright (c) 1993, Free Software Foundation, Inc.
-See the file COPYING for copyright information concerning this
-distribution and all its components.
diff --git a/usr.sbin/afs/src/tools/gnats/categ.texi b/usr.sbin/afs/src/tools/gnats/categ.texi
deleted file mode 100644
index c6be6e37a56..00000000000
--- a/usr.sbin/afs/src/tools/gnats/categ.texi
+++ /dev/null
@@ -1,123 +0,0 @@
-@node Valid Categories
-@unnumberedsec Valid Categories
-@cindex valid categories
-@cindex example of a list of valid categories
-
-@table @code
-@item bfd
-@sc{gnu} binary file descriptor library.
-
-@item bifrabulator
-This one doesn't actually exist.
-
-@item binutils
-@sc{gnu} utilities for binary files (@code{ar}, @code{nm}, @code{size}@dots{}).
-
-@item bison
-@sc{gnu} parser generator.
-
-@item byacc
-Free parser generator.
-
-@item config
-Cygnus Solutions Software configuration and installation.
-
-@item cvs
-Concurrent Version System.
-
-@item diff
-@sc{gnu} @code{diff} program.
-
-@item doc
-Documentation and manuals.
-
-@item emacs
-@sc{gnu} Emacs editor and related functions.
-
-@item flex
-@sc{gnu} lexical analyzer.
-
-@item g++
-@sc{gnu} C++ compiler.
-
-@item gas
-@sc{gnu} assembler.
-
-@item gcc
-@sc{gnu} C compiler.
-
-@item gdb
-@sc{gnu} source code debugger.
-
-@item glob
-The filename globbing functions.
-
-@item gprof
-@sc{gnu} profiler.
-
-@item grep
-@sc{gnu} @code{grep} program.
-
-@item info
-@sc{gnu} @code{info} hypertext reader.
-
-@item ispell
-@sc{gnu} spelling checker.
-
-@item kerberos
-Kerberos authentication system.
-
-@item ld
-@sc{gnu} linker.
-
-@item libc
-Cygnus Solutions C Support Library.
-
-@item libg++
-@sc{gnu} C++ class library.
-
-@item libiberty
-@sc{gnu} @samp{libiberty} library.
-
-@item libm
-Cygnus Solutions C Math Library.
-
-@item make
-@sc{gnu} @code{make} program.
-
-@item makeinfo
-@sc{gnu} utility to build Info files from Texinfo documents.
-
-@item mas
-@sc{gnu} Motorola syntax assembler.
-
-@item newlib
-Cygnus Solutions C Support and Math Libraries.
-
-@item patch
-@sc{gnu} bug patch program.
-
-@item gnats
-@sc{gnu} Problem Report Management System.
-
-@item rcs
-Revision Control System.
-
-@item readline
-@sc{gnu} @code{readline} library.
-
-@item send-pr
-@sc{gnu} Problem Report submitting program.
-
-@item test
-Category to use when testing @code{send-pr}.
-
-@item texindex
-@sc{gnu} documentation indexing utility.
-
-@item texinfo
-@sc{gnu} documentation macros.
-
-@item other
-Anything which is not covered by the above categories.
-@end table
diff --git a/usr.sbin/afs/src/tools/gnats/categories b/usr.sbin/afs/src/tools/gnats/categories
deleted file mode 100644
index 08353775c21..00000000000
--- a/usr.sbin/afs/src/tools/gnats/categories
+++ /dev/null
@@ -1,2 +0,0 @@
-pending
-arla
diff --git a/usr.sbin/afs/src/tools/gnats/fields.texi b/usr.sbin/afs/src/tools/gnats/fields.texi
deleted file mode 100644
index ac967061080..00000000000
--- a/usr.sbin/afs/src/tools/gnats/fields.texi
+++ /dev/null
@@ -1,520 +0,0 @@
-@node Fields
-@section Problem Report format
-@cindex Problem Report format
-@cindex format
-@cindex database similarities
-@cindex fields
-
-The format of a PR is designed to reflect the nature of @sc{gnats} as a
-database. Information is arranged into @dfn{fields}, and kept in
-individual records (Problem Reports).
-
-A Problem Report contains two different types of fields: @dfn{Mail
-Header} fields, which are used by the mail handler for delivery, and
-@dfn{Problem Report} fields, which contain information relevant to the
-Problem Report and its submitter. A Problem Report is essentially a
-specially formatted electronic mail message.
-
-Problem Report fields are denoted by a keyword which begins with
-@samp{>} and ends with @samp{:}, as in @samp{>Confidential:}. Fields
-belong to one of three data types:
-
-@table @asis
-@cindex Problem Report data types
-@cindex @emph{Enumerated} data types
-@item @sc{Enumerated}
-One of a specific set of values, which vary according to the field. The
-value for each keyword must be on the same line as the keyword. These
-values are not configurable (yet).
-
-@ifset SENDPR
-For each @sc{Enumerated} keyword, the possible choices are listed in the
-@code{send-pr} template as a comment.
-@end ifset
-The following fields are @sc{Enumerated} format; see the descriptions of
-fields below for explanations of each field in detail:
-
-@smallexample
-@group
->Confidential: >Severity: >Priority:
->Class: >State: >Number:
-@end group
-@end smallexample
-
-@cindex @emph{Text} data types
-@item @sc{Text}
-One single line of text which must begin and end on the same line (i.e.,
-before a newline) as the keyword. See the descriptions of fields below
-for explanations of each field in detail. The following fields are
-@sc{Text} format:
-
-@smallexample
-@group
->Submitter-Id: >Originator: >Synopsis:
->Category: >Release: >Responsible:
->Arrival-Date:
-@end group
-@end smallexample
-
-@cindex @emph{MultiText} data types
-@item @sc{MultiText}
-Text of any length may occur in this field. @sc{MultiText} may span
-multiple lines and may also include blank lines. A @sc{MultiText} field
-ends only when another keyword appears. See the descriptions of fields
-below for explanations of each field in detail.
-
-The following fields are @sc{MultiText} format:
-
-@smallexample
-@group
->Organization: >Environment: >Description:
->How-To-Repeat: >Fix: >Audit-Trail:
->Unformatted:
-@end group
-@end smallexample
-
-@end table
-
-@ifclear SENDPR
-@subheading Example Problem Report
-@end ifclear
-
-The following is an example Problem Report. Mail headers are at the
-top, followed by @sc{gnats} fields, which begin with @samp{>} and end
-with @samp{:}. The @samp{Subject:} line in the mail header and the
-@samp{>Synopsis:} field are usually duplicates of each other.
-
-@cindex sample Problem Report
-@cindex example Problem Report
-@cindex Problem Report template
-@cartouche
-@smallexample
-@group
-Message-Id: @var{message-id}
-Date: @var{date}
-From: @var{address}
-Reply-To: @var{address}
-To: @var{bug-address}
-Subject: @var{subject}
-
->Number: @var{gnats-id}
->Category: @var{category}
->Synopsis: @var{synopsis}
->Confidential: yes @emph{or} no
->Severity: critical, serious, @emph{or} non-critical
->Priority: high, medium @emph{or} low
->Responsible: @var{responsible}
->State: open, analyzed, suspended, feedback, @emph{or} closed
->Class: sw-bug, doc-bug, change-request, support,
-@ifset SENDPR
-@emph{or} duplicate
-@end ifset
-@ifclear SENDPR
-duplicate, @emph{or} mistaken
-@end ifclear
->Submitter-Id: @var{submitter-id}
->Arrival-Date: @var{date}
->Originator: @var{name}
->Organization: @var{organization}
->Release: @var{release}
->Environment:
- @var{environment}
->Description:
- @var{description}
->How-To-Repeat:
- @var{how-to-repeat}
->Fix:
- @var{fix}
->Audit-Trail:
-@var{appended-messages@dots{}}
-State-Changed-From-To: @var{from}-@var{to}
-State-Changed-When: @var{date}
-State-Changed-Why:
- @var{reason}
-Responsible-Changed-From-To: @var{from}-@var{to}
-Responsible-Changed-When: @var{date}
-Responsible-Changed-Why:
- @var{reason}
->Unformatted:
- @var{miscellaneous}
-@end group
-@end smallexample
-@end cartouche
-
-@menu
-* Mail header fields::
-* Problem Report fields::
-@end menu
-
-@c ----------------------
-@node Mail header fields
-@subsection Mail header fields
-@cindex mail header fields
-@cindex Internet standard RFC-822
-
-A Problem Report may contain any mail header field described in the
-Internet standard RFC-822. However, only the fields which identify the
-sender and the subject are required by @code{send-pr}:
-
-@table @code
-@cindex @code{To:} header
-@item To:
-The preconfigured mail address for the Support Site where the PR is to
-be sent, automatically supplied by @code{send-pr}.
-
-@cindex @code{Subject:} header
-@item Subject:
-A terse description of the problem. This field normally contains the
-same information as the @samp{>Synopsis:} field.
-
-@cindex @code{From:} header
-@item From:
-Usually supplied automatically by the originator's mailer; should
-contain the originator's electronic mail address.
-
-@cindex @code{Reply-To:} header
-@item Reply-To:
-A return address to which electronic replies can be sent; in most cases,
-the same address as the @code{From:} field.
-@end table
-
-@ifclear SENDPR
-@cindex @code{Received-By:} headers
-One of the configurable options for @sc{gnats} is whether or not to
-retain @w{@samp{Received-By:}} headers, which often consume a lot of
-space and are not often used. @xref{Local configuration,,Changing your
-local configuration}.
-@end ifclear
-
-@c ----------------------
-@node Problem Report fields
-@subsection Problem Report fields
-@cindex GNATS database fields
-@cindex field format
-
-@c FIXME - this node is loooooooooooooooong...
-
-@subheading Field descriptions
-
-The following fields are present whenever a PR is submitted via the
-program @code{send-pr}. @sc{gnats} adds additional fields when the PR
-arrives at the Support Site; explanations of them follow this list.
-
-@cindex fields - list
-@cindex GNATS fields - list
-@table @code
-@cindex @code{Submitter-Id} field
-@cindex @code{>Submitter-Id:}
-@item >Submitter-Id:
-(@sc{Text}) A unique identification code assigned by the Support Site.
-It is used to identify all Problem Reports coming from a particular
-site. (Submitters without a value for this field can invoke
-@code{send-pr} with the @samp{--request-id} option to apply for one from
-the support organization. Problem Reports from those not affiliated
-with the support organization should use the default value of @samp{net}
-for this field.)
-
-@cindex @code{Originator} field
-@cindex @code{>Originator:}
-@item >Originator:
-(@sc{Text}) Originator's real name. The default is the value of the
-originator's environment variable @code{NAME}.
-
-@cindex @code{>Organization:}
-@cindex @code{Organization} field
-@item >Organization:
-(@sc{MultiText}) The originator's organization. The default value is
-set with the variable @w{@code{DEFAULT_ORGANIZATION}} in the
-@ifclear SENDPR
-@file{config} file (@pxref{config file,,The @code{config} file}).
-@end ifclear
-@ifset SENDPR
-@code{send-pr} shell script.
-@end ifset
-
-@cindex @code{Confidential} field
-@cindex @code{>Confidential:}
-@cindex confidentiality in PRs
-@cindex PR confidentiality
-@item >Confidential:
-(@sc{Enumerated}) Use of this field depends on the originator's
-relationship with the support organization; contractual agreements often
-have provisions for preserving confidentiality. Conversely, a lack of a
-contract often means that any data provided will not be considered
-confidential. Submitters should be advised to contact the support
-organization directly if this is an issue.
-
-If the originator's relationship to the support organization provides
-for confidentiality, then if the value of this field is @samp{yes} the
-support organization treats the PR as confidential; any code samples
-provided are not made publicly available (e.g., in regression test
-suites). The default value is @samp{yes}.
-
-@cindex @code{Synopsis} field
-@cindex @code{>Synopsis:}
-@item >Synopsis:
-(@sc{Text}) One-line summary of the problem. @w{@code{send-pr}} copies
-this information to the @samp{Subject:} line when you submit a Problem
-Report.
-
-@cindex @code{Severity} field
-@cindex @code{>Severity:}
-@item >Severity:
-(@sc{Enumerated}) The severity of the problem. Accepted values include:
-
-@table @code
-@cindex @emph{critical} severity problems
-@item critical
-The product, component or concept is completely non-operational or some
-essential functionality is missing. No workaround is known.
-
-@cindex @emph{serious} severity problems
-@item serious
-The product, component or concept is not working properly or significant
-functionality is missing. Problems that would otherwise be considered
-@samp{critical} are rated @samp{serious} when a workaround is known.
-
-@cindex @emph{non-critical} severity problems
-@item non-critical
-The product, component or concept is working in general, but lacks
-features, has irritating behavior, does something wrong, or doesn't
-match its documentation.
-@end table
-@noindent
-The default value is @samp{serious}.
-@sp 1
-
-@cindex @code{Priority} field
-@cindex @code{>Priority:}
-@item >Priority:
-(@sc{Enumerated}) How soon the originator requires a solution. Accepted
-values include:
-
-@table @code
-@cindex @emph{high} priority problems
-@item high
-A solution is needed as soon as possible.
-
-@cindex @emph{medium} priority problems
-@item medium
-The problem should be solved in the next release.
-
-@cindex @emph{low} priority problems
-@item low
-The problem should be solved in a future release.
-@end table
-@noindent
-The default value is @samp{medium}.
-@sp 1
-
-@cindex @code{Category} field
-@cindex @code{>Category:}
-@item >Category:
-(@sc{Text}) The name of the product, component or concept where
-the problem lies. The values for this field are defined by the Support
-Site.
-@ifclear SENDPR
-@xref{categories file,,The @code{categories} file}, for details.
-@end ifclear
-
-@cindex @code{Class} field
-@cindex @code{>Class:}
-@item >Class:
-(@sc{Enumerated}) The class of a problem can be one of the following:
-
-@table @code
-@cindex @emph{sw-bug} class
-@item sw-bug
-A general product problem. (@samp{sw} stands for ``software''.)
-
-@cindex @emph{doc-bug} class
-@item doc-bug
-A problem with the documentation.
-
-@cindex @emph{change-request} class
-@item change-request
-A request for a change in behavior, etc.
-
-@cindex @emph{support} class
-@item support
-A support problem or question.
-
-@cindex @emph{duplicate} class
-@item duplicate (@var{pr-number})
-Duplicate PR. @var{pr-number} should be the number of the original PR.
-
-@ifclear SENDPR
-@cindex @emph{mistaken} class
-@item mistaken
-No problem, user error or misunderstanding. This value is valid only at
-the Support Site.
-@end ifclear
-@end table
-
-@noindent
-The default is @samp{sw-bug}.
-@sp 1
-
-@cindex @code{Release} field
-@cindex @code{>Release:}
-@item >Release:
-(@sc{Text}) Release or version number of the product, component or
-concept.
-
-@cindex @code{Environment} field
-@cindex @code{>Environment:}
-@item >Environment:
-(@sc{MultiText}) Description of the environment where the problem occurred:
-machine architecture, operating system, host and target types,
-libraries, pathnames, etc.
-
-@cindex @code{Description} field
-@cindex @code{>Description:}
-@item >Description:
-(@sc{MultiText}) Precise description of the problem.
-
-@cindex @code{How-To-Repeat} field
-@cindex @code{>How-To-Repeat:}
-@item >How-To-Repeat:
-(@sc{MultiText}) Example code, input, or activities to reproduce the
-problem. The support organization uses example code both to reproduce
-the problem and to test whether the problem is fixed. Include all
-preconditions, inputs, outputs, conditions after the problem, and
-symptoms. Any additional important information should be included.
-Include all the details that would be necessary for someone else to
-recreate the problem reported, however obvious. Sometimes seemingly
-arbitrary or obvious information can point the way toward a solution.
-See also @ref{Helpful hints,,Helpful hints}.
-
-@cindex @code{Fix} field
-@cindex @code{>Fix:}
-@item >Fix:
-(@sc{MultiText}) A description of a solution to the problem, or a patch
-which solves the problem. (This field is most often filled in at the
-Support Site; we provide it to the submitter in case she has solved the
-problem.)
-
-@end table
-
-@noindent
-@sc{gnats} adds the following fields when the PR arrives at the Support
-Site:
-
-@table @code
-@cindex @code{Number} field
-@cindex @code{>Number:}
-@item >Number:
-(@sc{Enumerated}) The incremental identification number for this PR.
-@ifclear SENDPR
-This is included in the automated reply to the submitter (if that
-feature of @sc{gnats} is activated; @pxref{Local configuration,,Changing
-your local configuration}). It is also included in the copy of the PR
-that is sent to the maintainer.
-@end ifclear
-
-The @samp{>Number:} field is often paired with the @samp{>Category:}
-field as
-
-@smallexample
-@var{category}/@var{number}
-@end smallexample
-
-@noindent
-in subsequent email messages. This is for historical reasons, as well
-as because Problem Reports are stored in subdirectories which are named
-by category.
-
-@cindex @code{State} field
-@cindex @code{>State:}
-@item >State:
-(@sc{Enumerated}) The current state of the PR. Accepted values are:
-
-@table @code
-@item open
-The PR has been filed and the responsible person notified.
-
-@item analyzed
-The responsible person has analyzed the problem.
-
-@item feedback
-The problem has been solved, and the originator has been given a patch
-or other fix.
-
-@item closed
-The changes have been integrated, documented, and tested, and the
-originator has confirmed that the solution works.
-
-@item suspended
-Work on the problem has been postponed.
-@end table
-
-@noindent
-The initial state of a PR is @samp{open}. @xref{States,,States of
-Problem Reports}.
-
-@cindex @code{Responsible} field
-@cindex @code{>Responsible:}
-@item >Responsible:
-(@sc{Text}) The person responsible for this category.
-@ifclear SENDPR
-@sc{gnats} retrieves this information from the @file{categories} file
-(@pxref{categories file,,The @code{categories} file}).
-@end ifclear
-
-@cindex @code{>Arrival-Date:}
-@cindex @code{Arrival-Date} field
-@item >Arrival-Date:
-(@sc{Text}) The time that this PR was received by @sc{gnats}. The date
-is provided automatically by @sc{gnats}.
-
-@cindex @code{>Audit-Trail:}
-@cindex @code{Audit-Trail} field
-@item >Audit-Trail:
-(@sc{MultiText}) Tracks related electronic mail as well as changes in
-the @samp{>State:} and @samp{>Responsible:} fields with the sub-fields:
-
-@table @code
-@cindex @code{State-Changed-<From>-<To>:} in @code{>Audit-Trail:}
-@item @w{State-Changed-<From>-<To>: @var{oldstate}>-<@var{newstate}}
-The old and new @samp{>State:} field values.
-
-@cindex @code{Responsible-Changed-<From>-<To>:} in @code{>Audit-Trail:}
-@item @w{Responsible-Changed-<From>-<To>: @var{oldresp}>-<@var{newresp}}
-The old and new @samp{>Responsible:} field values.
-
-@cindex @code{State-Changed-By:} in @code{>Audit-Trail:}
-@cindex @code{Responsible-Changed-By:} in @code{>Audit-Trail:}
-@item State-Changed-By: @var{name}
-@itemx Responsible-Changed-By: @var{name}
-The name of the maintainer who effected the change.
-
-@cindex @code{State-Changed-When:} in @code{>Audit-Trail:}
-@cindex @code{Responsible-Changed-When:} in @code{>Audit-Trail:}
-@item State-Changed-When: @var{timestamp}
-@itemx Responsible-Changed-When: @var{timestamp}
-The time the change was made.
-
-@cindex @code{State-Changed-Why:} in @code{>Audit-Trail:}
-@cindex @code{Responsible-Changed-Why:} in @code{>Audit-Trail:}
-@item State-Changed-Why: @var{reason@dots{}}
-@itemx Responsible-Changed-Why: @var{reason@dots{}}
-The reason for the change.
-@end table
-
-@cindex subsequent mail
-@cindex other mail
-@cindex appending PRs
-@cindex saving related mail
-@cindex related mail
-@noindent
-The @samp{>Audit-Trail:} field also contains any mail messages received
-by @sc{gnats} related to this PR, in the order received.
-
-@cindex @code{>Unformatted:}
-@cindex @code{Unformatted} field
-@item
- >Unformatted:
-(@sc{MultiText}) Any random text found outside the fields in the
-original Problem Report.
-@end table
-
diff --git a/usr.sbin/afs/src/tools/gnats/install-sid.sh b/usr.sbin/afs/src/tools/gnats/install-sid.sh
deleted file mode 100644
index 32d4def1eba..00000000000
--- a/usr.sbin/afs/src/tools/gnats/install-sid.sh
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/bin/sh
-# Drop in the SUBMITTER id into a site's installed send-pr script.
-# Copyright (C) 1993 Free Software Foundation, Inc.
-# Contributed by Brendan Kehoe (brendan@cygnus.com), based on a
-# version written by Heinz G. Seidl (hgs@ide.com).
-#
-# This file is part of GNU GNATS.
-#
-# GNU GNATS is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# GNU GNATS is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU GNATS; see the file COPYING. If not, write to
-# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
-COMMAND=`echo $0 | sed -e 's,.*/,,g'`
-USAGE="Usage: $COMMAND [--install-dir=prefix] [--help] [--version] submitter-id"
-
-VERSION=3.113.1
-
-BINDIR=@BINDIR@
-
-SUBMITTER=
-TEMP=/tmp/sp$$
-
-if [ $# -eq 0 ]; then
- echo "$USAGE"
- exit 1
-fi
-
-while [ $# -gt 0 ]; do
- case "$1" in
- -install-dir=*|--install-dir=*|--install-di=*|--install-d=*|--install-=*|--install=*|--instal=*|--insta=*|--inst=*|--ins=*|--in=*|--i=*)
- I=`echo "$1" | sed 's/-*i[a-z\-]*=//'`
- BINDIR=$I/bin ;;
- --version) echo $COMMAND version $VERSION ; exit 1 ;;
- -*) echo "$USAGE" ; exit 1 ;;
- *) SUBMITTER=$1 ;;
- esac
- shift
-done
-
-path=`echo $0 | sed -e "s;${COMMAND};;"`
-
-[ -z "$path" ] && path=.
-
-examinebindir=yes
-
-if [ "$examinebindir" = yes ] && [ -f $BINDIR/send-pr ]; then
- SPPATHLIST=$BINDIR/send-pr
-else
- if [ -f $path/send-pr ]; then
- SPPATHLIST=$path/send-pr
- else
- echo "$COMMAND: cannot find \`$BINDIR/send-pr' or \`$path/send-pr'" >&2
- exit 1
- fi
-fi
-
-trap 'rm -f $TEMP ; exit 0' 0
-trap 'echo "$COM: Aborting ..."; rm -f $TEMP ; exit 1' 1 2 3 13 15
-
-for SPPATH in $SPPATHLIST; do
- sed -e "s/^SUBMITTER=.*/SUBMITTER=${SUBMITTER}/" $SPPATH > $TEMP
-
- if grep $SUBMITTER $TEMP > /dev/null; then
- cp $SPPATH $SPPATH.orig &&
- rm -f $SPPATH &&
- cp $TEMP $SPPATH &&
- chmod a+rx $SPPATH &&
- rm -f $TEMP $SPPATH.orig ||
- { echo "$COMMAND: unable to replace send-pr" >&2 ; exit 1; }
- else
- echo "$COMMAND: something went wrong when sed-ing the submitter into send-pr" >&2
- exit 1
- fi
-done
-
-echo "$COMMAND: \`$SUBMITTER' is now the default submitter ID for send-pr"
-
-exit 0
diff --git a/usr.sbin/afs/src/tools/gnats/s-usage.texi b/usr.sbin/afs/src/tools/gnats/s-usage.texi
deleted file mode 100644
index 63097685671..00000000000
--- a/usr.sbin/afs/src/tools/gnats/s-usage.texi
+++ /dev/null
@@ -1,565 +0,0 @@
-@c This is the usage section for send-pr. It is called as
-@c chapter (Invoking send-pr) by send-pr.texi, and also as
-@c section (Submitting Problem Reports) by gnats.texi (chapter/section
-@c identifiers are adjusted accordingly)
-
-@c FIXME! This still seems jumbled...
-
-You can invoke @code{send-pr} from a shell prompt, or from within
-@sc{gnu} Emacs using @w{@samp{M-x send-pr}}.
-
-@menu
-* using send-pr:: Creating new Problem Reports
-* send-pr in Emacs:: Using send-pr from within Emacs
-* send-pr from the shell:: Invoking send-pr from the shell
-* Submitting via e-mail:: Submitting a Problem Report via direct e-mail
-* Helpful hints::
-@end menu
-
-@node using send-pr
-@section Creating new Problem Reports
-
-@c FIXME - this is a long node
-Invoking @code{send-pr} presents a PR @dfn{template} with a number of
-fields already filled in. Complete the template as thoroughly as
-possible to make a useful bug report. Submit only one bug with each PR.
-
-@cindex template
-A template consists of three sections:
-
-@table @dfn
-@item Comments
-The top several lines of a blank template consist of a series of
-comments that provide some basic instructions for completing the Problem
-Report, as well as a list of valid entries for the @samp{>Category:}
-field. These comments are all preceded by the string @samp{SEND-PR:}
-and are erased automatically when the PR is submitted. The
-instructional comments within @samp{<} and @samp{>} are also removed.
-(Only these comments are removed; lines you provide that happen to have
-those characters in them, such as examples of shell-level redirection,
-are not affected.)
-
-@item Mail Header
-@code{send-pr} creates a standard mail header. @code{send-pr} completes
-all fields except the @samp{Subject:} line with default values.
-(@xref{Fields,,Problem Report format}.)
-
-@item @sc{gnats} fields
-These are the informational fields that @sc{gnats} uses to route your
-Problem Report to the responsible party for further action. They should
-be filled out as completely as possible. (@xref{Fields,,Problem Report
-format}. Also see @ref{Helpful hints,,Helpful hints}.)
-@end table
-
-@ifset SENDPR
-@noindent
-For examples of a Problem Report template and complete Problem Report,
-see @ref{An Example}.
-@end ifset
-
-The default template contains your preconfigured @samp{>Submitter-Id:}.
-@code{send-pr} attempts to determine values for the @samp{>Originator:}
-and @samp{>Organization:} fields (@pxref{Fields,,Problem Report
-format}). @code{send-pr} will set the @samp{>Originator:} field to
-the value of the @code{NAME} environment variable if it has been set;
-similarly, @samp{>Organization:} will be set to the value of @code{ORGANIZATION}.
-@code{send-pr} also attempts to find out some information
-about your system and architecture, and places this information in the
-@samp{>Environment:} field if it finds any.
-
-You may submit problem reports to different Support Sites from the
-default site by specifying the alternate site when you invoke
-@code{send-pr}. @xref{send-pr from the shell}.
-Each @code{site} has its own list of categories for
-which it accepts Problem Reports.
-@c FIXME! This should go in..
-@c For a list of sites to whom @code{send-pr} is configured to send
-@c Problem Reports, type @w{@samp{send-pr -S}}.
-@ifset SENDPR
-(@xref{default site,,Setting a default @var{site}}.)
-@end ifset
-
-@code{send-pr} also provides the mail header section of the template
-with default values in the @samp{To:}, @samp{From:}, and
-@samp{Reply-To:} fields. The @samp{Subject:} field is empty.
-
-The template begins with a comment section:
-
-@cindex template comment section
-@cindex comment section in the PR template
-@smallexample
-@group
-SEND-PR: -*- send-pr -*-
-SEND-PR: Lines starting with `SEND-PR' will be removed
-SEND-PR: automatically as well as all comments (the text
-SEND-PR: below enclosed in `<' and `>').
-SEND-PR:
-SEND-PR: Please consult the document `Reporting Problems
-SEND-PR: Using send-pr' if you are not sure how to fill out
-SEND-PR: a problem report.
-SEND-PR:
-SEND-PR: Choose from the following categories:
-@end group
-@end smallexample
-
-@noindent
-and also contains a list of valid @code{>Category:} values for the
-Support Site to whom you are submitting this Problem Report. One (and
-only one) of these values should be placed in the @code{>Category:}
-field.
-@ifset SENDPR
-A complete sample bug report, from template to completed PR, is shown in
-@ref{An Example}. For a complete list of valid categories, type
-@w{@samp{send-pr -L}} at your prompt. @xref{Valid Categories,,Valid
-Categories}, for a sample list of categories, .
-@end ifset
-
-@c FIXME.. this sounds awkward
-The mail header is just below the comment section. Fill out the
-@samp{Subject:} field, if it is not already completed using the value of
-@samp{>Synopsis:}. The other mail header fields contain default values.
-
-@cindex mail header section
-@smallexample
-@group
-To: @var{support-site}
-Subject: @emph{complete this field}
-From: @var{your-login}@@@var{your-site}
-Reply-To: @var{your-login}@@@var{your-site}
-X-send-pr-version: send-pr @value{VERSION}
-@end group
-@end smallexample
-
-@noindent
-where @var{support-site} is an alias on your local machine for the
-Support Site you wish to submit this PR to.
-
-The rest of the template contains @sc{gnats} fields. Each field is
-either automatically completed with valid information (such as your
-@samp{>Submitter-Id:}) or contains a one-line instruction specifying the
-information that field requires in order to be correct. For example,
-the @samp{>Confidential:} field expects a value of @samp{yes} or
-@samp{no}, and the answer must fit on one line; similarly, the
-@samp{>Synopsis:} field expects a short synopsis of the problem, which
-must also fit on one line. Fill out the fields as completely as
-possible. @xref{Helpful hints,,Helpful hints}, for suggestions as to
-what kinds of information to include.
-
-In this example, words in @emph{italics} are filled in with
-pre-configured information:
-
-@cindex @code{send-pr} fields
-@smallexample
-@group
->Submitter-Id: @emph{your submitter-id}
->Originator: @emph{your name here}
->Organization:
- @emph{your organization}
->Confidential:<[ yes | no ] (one line)>
->Synopsis: <synopsis of the problem (one line)>
->Severity: <[non-critical | serious | critical](one line)>
->Priority: <[ low | medium | high ] (one line)>
->Category: <name of the product (one line)>
->Class: <[sw-bug | doc-bug | change-request | support]>
->Release: <release number (one line)>
->Environment:
- <machine, os, target, libraries (multiple lines)>
-
->Description:
- <precise description of the problem (multiple lines)>
->How-To-Repeat:
- <code/input/activities to reproduce (multiple lines)>
->Fix:
- <how to correct or work around the problem, if known
- (multiple lines)>
-@end group
-@end smallexample
-
-@cindex @code{Submitter-Id} field
-@cindex @code{>Submitter-Id:}
-When you finish editing the Problem Report, @code{send-pr} mails it to
-the address named in the @samp{To:} field in the mail header.
-@code{send-pr} checks that the complete form contains a valid
-@samp{>Category:}.
-
-@ifset SENDPR
-Your copy of @code{send-pr} should have already been customized on
-installation to reflect your @samp{>Submitter-Id:}. (@xref{Installing
-send-pr, , Installing @code{send-pr} on your system}.) If you don't
-know your @samp{>Submitter-Id:}, you can request it using
-@w{@samp{send-pr --request-id}}. If your organization is not affiliated
-with the site you send Problem Reports to, a good generic
-@samp{>Submitter-Id:} to use is @samp{net}.
-@end ifset
-
-@cindex bad Problem Reports
-@cindex errors
-@cindex invalid Problem Reports
-If your PR has an invalid value in one of the @sc{Enumerated} fields
-(@pxref{Fields,,Problem Report format}), @code{send-pr} places the PR in
-a temporary file named @samp{/tmp/pbad@var{nnnn}} on your machine.
-@var{nnnn} is the process identification number given to your current
-@code{send-pr} session. If you are running @code{send-pr} from the
-shell, you are prompted as to whether or not you wish to try editing the
-same Problem Report again. If you are running @code{send-pr} from
-Emacs, the Problem Report is placed in the buffer
-@w{@samp{*send-pr-error*}}; you can edit this file and then submit it
-with
-
-@smallexample
-M-x gnats-submit-pr
-@end smallexample
-
-@cindex subsequent mail
-@cindex other mail
-@cindex appending PRs
-@cindex saving related mail
-@cindex related mail
-Any further mail concerning this Problem Report should be carbon-copied
-to the @sc{gnats} mailing address as well, with the category and
-identification number in the @samp{Subject:} line of the message.
-
-@smallexample
-Subject: Re: PR @var{category}/@var{gnats-id}: @var{original message subject}
-@end smallexample
-
-@noindent
-Messages which arrive with @samp{Subject:} lines of this form are
-automatically appended to the Problem Report in the @samp{>Audit-Trail:}
-field in the order received.
-
-@c ---------------------------------------------------------------
-@node send-pr in Emacs
-@section Using @code{send-pr} from within Emacs
-@cindex using @code{send-pr} from within Emacs
-@cindex @code{send-pr} within Emacs
-@cindex invoking @code{send-pr} from Emacs
-@cindex interactive interface
-
-You can use an interactive @code{send-pr} interface from within @sc{gnu}
-Emacs to fill out your Problem Report. We recommend that you
-familiarize yourself with Emacs before using this feature
-(@pxref{Introduction,,Introduction,emacs,GNU Emacs}).
-
-Call @code{send-pr} with @w{@samp{M-x send-pr}}.@footnote{If typing
-@w{@samp{M-x send-pr}} doesn't work, see your system administrator for
-help loading @code{send-pr} into Emacs.} @code{send-pr} responds with a
-Problem Report template preconfigured for the Support Site from which
-you received @code{send-pr}. (If you use @code{send-pr} locally, the
-default Support Site is probably your local site.)
-
-You may also submit problem reports to different Support Sites from the
-default site. To use this feature, invoke @code{send-pr} with
-
-@smallexample
-C-u M-x send-pr
-@end smallexample
-
-@code{send-pr} prompts you for the name of a @var{site}. @var{site} is
-an alias on your local machine which points to an alternate Support
-Site.
-
-@cindex Emacs
-@code{send-pr} displays the template and prompts you in the minibuffer
-with the line:
-@smallexample
->Category: other
-@end smallexample
-
-@noindent
-Delete the default value @samp{other} @emph{in the minibuffer} and
-replace it with the keyword corresponding to your problem (the list of
-valid categories is in the topmost section of the PR template). For
-example, if the problem you wish to report has to do with the @sc{gnu} C
-compiler, and your support organization accepts bugs submitted for this
-program under the category @samp{gcc}, delete @samp{other} and then type
-@w{@samp{gcc[@key{RET}]}}. @code{send-pr} replaces the line
-
-@smallexample
->Category: <name of the product (one line)>
-@end smallexample
-
-@noindent
-in the template with
-
-@smallexample
->Category: gcc
-@end smallexample
-
-@noindent
-and moves on to another field.
-
-@cindex completion in Emacs
-@cindex name completion in Emacs
-@w{@code{send-pr}} provides name completion in the minibuffer. For
-instance, you can also type @w{@samp{gc[@key{TAB}]}}, and @code{send-pr}
-attempts to complete the entry for you. Typing @w{@samp{g[@key{TAB}]}}
-may not have the same effect if several possible entries begin with
-@samp{g}. In that case @code{send-pr} cannot complete the entry because
-it cannot determine whether you mean @samp{gcc} or, for example,
-@samp{gdb}, if both of those are possible categories.
-@w{@code{send-pr}} continues to prompt you for a valid entry until you
-enter one.
-
-@w{@code{send-pr}} prompts you interactively to enter each field for
-which there is a range of specific choices. If you attempt to enter a
-value which is not in the range of acceptable entries, @code{send-pr}
-responds with @w{@samp{[No match]}} and allows you to change the entry
-until it contains an acceptable value. This avoids unusable information
-(at least in these fields) and also avoids typographical errors which
-could cause problems later.
-
-@code{send-pr} prompts you for the following fields:
-
-@c FIXME - should these go before the discussion on completion?
-@example
-@group
->Category:
->Confidential: (@emph{default}: no)
->Severity: (@emph{default}: serious)
->Priority: (@emph{default}: medium)
->Class: (@emph{default}: sw-bug)
->Release:
->Synopsis: (@emph{this value is copied to @code{Subject:}})
-@end group
-@end example
-
-@noindent
-After you complete these fields, @w{@code{send-pr}} places the cursor in
-the @samp{>Description:} field and displays the message
-
-@smallexample
-To send the problem report use: C-c C-c
-@end smallexample
-
-@noindent
-in the minibuffer. At this point, edit the file in the main buffer to
-reflect your specific problem, putting relevant information in the
-proper fields.
-@ifset SENDPR
-@xref{An Example}, for a sample Problem Report.
-@end ifset
-
-@w{@samp{send-pr}} provides a few key bindings to make moving
-around in a template buffer more simple:
-
-@table @code
-@item C-c C-f
-@itemx M-x change-field
-Changes the field under the cursor. @code{edit-pr} prompts you for a
-new value.
-
-@item M-C-b
-@itemx M-x gnats-backward-field
-Moves the cursor to the beginning of the value of the current field.
-
-@item M-C-f
-@itemx M-x gnats-forward-field
-Moves the cursor to the end of the value of the current field.
-
-@item M-p
-@itemx M-x gnats-previous-field
-Moves the cursor back one field to the beginning of the value of the
-previous field.
-
-@item M-n
-@itemx M-x gnats-next-field
-Moves the cursor forward one field to the beginning of the value of the
-next field.
-@end table
-
-@code{send-pr} takes over again when you type @samp{C-c C-c} to send the
-message. @code{send-pr} reports any errors in a separate buffer, which
-remains in existence until you send the PR properly (or, of course,
-until you explicitly kill the buffer).
-
-For detailed instructions on using Emacs, see
-@ref{Introduction,,,emacs,GNU Emacs}.
-
-@node send-pr from the shell
-@section Invoking @code{send-pr} from the shell
-@cindex command line options
-@cindex invoking @code{send-pr} from the shell
-@cindex shell invocation
-
-@c FIXME! Add [ -S ] right after [ -L ]...
-@smallexample
-send-pr [ @var{site} ]
- [ -f @var{problem-report} | --file @var{problem-report} ]
- [ -t @var{mail-address} | --to @var{mail-address} ]
- [ --request-id ]
- [ -L | --list ] [ -P | --print ]
- [ -V | --version] [ -h | --help ]
-@end smallexample
-
-@var{site} is an alias on your local machine which points to an address
-used by a Support Site. If this argument is not present, the default
-@var{site} is usually the site which you received @code{send-pr} from,
-or your local site if you use @sc{gnats} locally.
-@ifset SENDPR
-(@xref{default site,,Setting a default @var{site}}.)
-@end ifset
-
-Invoking @code{send-pr} with no options calls the editor named in your
-environment variable @code{EDITOR} on a default PR template. If the
-environment variable @code{PR_FORM} is set, its value is used as a file
-name which contains a valid template. If @code{PR_FORM} points to a
-missing or unreadable file, or if the file is empty, @code{send-pr}
-generates an error message and opens the editor on a default template.
-
-@table @code
-@item -f @var{problem-report}
-@itemx --file @var{problem-report}
-Specifies a file, @var{problem-report}, where a completed Problem Report
-already exists. @code{send-pr} sends the contents of the file without
-invoking an editor. If @var{problem-report} is @samp{-},
-@w{@code{send-pr}} reads from standard input.
-
-@item -t @var{mail-address}
-@itemx --to @var{mail-address}
-Sends the PR to @var{mail-address}. The default is preset when
-@code{send-pr} is configured. @emph{This option is not recommended};
-instead, use the argument @var{site} on the command line.
-
-@item -c @var{mail-address}
-@itemx --cc @var{mail-address}
-Places @var{mail-address} in the @code{Cc:} header field of the message
-to be sent.
-
-@item --request-id
-Sends a request for a @code{>Submitter-Id:} to the Support Site.
-
-@cindex listing valid categories
-@item -L
-@itemx --list
-Prints the list of valid @code{>Category:} values on standard output.
-No mail is sent.
-
-@item -s @var{severity}
-@itemx --severity @var{severity}
-@cindex @code{send-pr} fields
-Sets the initial value of the @code{>Severity:} field to @var{severity}.
-
-@ignore
-@item -S
-@itemx --sites
-Displays a list of valid @var{site} values on standard output. No mail
-is sent.
-@end ignore
-
-@item -P
-@itemx --print
-Displays the PR template. If the variable @code{PR_FORM} is set in your
-environment, the file it specifies is printed. If @code{PR_FORM} is not
-set, @code{send-pr} prints the standard blank form. If the file
-specified by @code{PR_FORM} doesn't exist, @code{send-pr} displays an
-error message. No mail is sent.
-
-@item -V
-@itemx --version
-Displays the @code{send-pr} version number and a usage summary. No mail
-is sent.
-
-@item -h
-@itemx --help
-Displays a usage summary for @code{send-pr}. No mail is sent.
-@end table
-
-@c -------------------------------------------------------------------------
-@node Submitting via e-mail
-@section Submitting a Problem Report via direct e-mail
-@cindex Direct e-mail
-@cindex Submitting a PR via e-mail
-In addition to using @code{send-pr}, there is another way to submit a problem
-report. You can simply send an e-mail message to the support site.
-
-To do this, look at the address in the @samp{To:} field of the @code{send-pr}
-template. When you send unformatted e-mail to this address, @sc{gnats}
-processes the message as a new problem report, filling in as many fields from
-defaults as it can:
-
-@table @code
-@item Synopsis
-The @samp{>Synopsis} field is filled in by the @samp{Subject:} header.
-
-@item Submitter ID
-@sc{gnats} will try to derive the @samp{>Submitter} field from the address
-in the @samp{From:} header.
-
-@item Description
-All of the text in the body of the e-mail message is put into the
-@samp{>Description} field. Each line of the text is indented by one space,
-indicating that it is "quoted text" from the sender.
-@end table
-
-Other fields, such as category, version, severity, etc. are set to default
-values (if the @sc{gnats} administrator has set them).
-
-@c --------------------------------------------------------------------------
-@node Helpful hints
-@section Helpful hints
-@cindex helpful hints
-@cindex Using and Porting @sc{gnu} CC
-@cindex effective problem reporting
-@cindex kinds of helpful information
-@cindex information to submit
-@cindex Report all the facts!
-
-There is no orthodox standard for submitting effective bug reports,
-though you might do well to consult the section on submitting bugs for
-@sc{gnu} @code{gcc} in @ref{Bugs, , Reporting Bugs, gcc, Using and
-Porting GNU CC}, by Richard Stallman. This section contains
-instructions on what kinds of information to include and what kinds of
-mistakes to avoid.
-
-In general, common sense (assuming such an animal exists) dictates the
-kind of information that would be most helpful in tracking down and
-resolving problems in software.
-@itemize @bullet
-@item
-Include anything @emph{you} would want to know if you were looking at
-the report from the other end. There's no need to include every minute
-detail about your environment, although anything that might be different
-from someone else's environment should be included (your path, for
-instance).
-
-@item
-Narratives are often useful, given a certain degree of restraint. If a
-person responsible for a bug can see that A was executed, and then B and
-then C, knowing that sequence of events might trigger the realization of
-an intermediate step that was missing, or an extra step that might have
-changed the environment enough to cause a visible problem. Again,
-restraint is always in order (``I set the build running, went to get a
-cup of coffee (Columbian, cream but no sugar), talked to Sheila on the
-phone, and then THIS happened@dots{}'') but be sure to include anything
-relevant.
-
-@item
-Richard Stallman writes, ``The fundamental principle of reporting bugs
-usefully is this: @strong{report all the facts}. If you are not sure
-whether to state a fact or leave it out, state it!'' This holds true
-across all problem reporting systems, for computer software or social
-injustice or motorcycle maintenance. It is especially important in the
-software field due to the major differences seemingly insignificant
-changes can make (a changed variable, a missing semicolon, etc.).
-
-@item
-Submit only @emph{one} problem with each Problem Report. If you have
-multiple problems, use multiple PRs. This aids in tracking each problem
-and also in analyzing the problems associated with a given program.
-
-@item
-It never hurts to do a little research to find out if the bug you've
-found has already been reported. Most software releases contain lists
-of known bugs in the Release Notes which come with the software; see
-your system administrator if you don't have a copy of these.
-
-@item
-The more closely a PR adheres to the standard format, the less
-interaction is required by a database administrator to route the
-information to the proper place. Keep in mind that anything that
-requires human interaction also requires time that might be better spent
-in actually fixing the problem. It is therefore in everyone's best
-interest that the information contained in a PR be as correct as
-possible (in both format and content) at the time of submission.
-@end itemize
diff --git a/usr.sbin/afs/src/tools/gnats/send-pr-el.in b/usr.sbin/afs/src/tools/gnats/send-pr-el.in
deleted file mode 100644
index 12b517e9c85..00000000000
--- a/usr.sbin/afs/src/tools/gnats/send-pr-el.in
+++ /dev/null
@@ -1,811 +0,0 @@
-;;;; -*-emacs-lisp-*-
-;;;;---------------------------------------------------------------------------
-;;;; EMACS interface for send-pr (by Heinz G. Seidl)
-;;;; Slightly hacked by Brendan Kehoe (brendan@cygnus.com).
-;;;;
-;;;; This file is part of the Problem Report Management System (GNATS)
-;;;; Copyright 1992, 1993, 1997 Cygnus Support
-;;;;
-;;;; This program is free software; you can redistribute it and/or
-;;;; modify it under the terms of the GNU General Public
-;;;; License as published by the Free Software Foundation; either
-;;;; version 2 of the License, or (at your option) any later version.
-;;;;
-;;;; This program is distributed in the hope that it will be useful,
-;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;;;; General Public License for more details.
-;;;;
-;;;; You should have received a copy of the GNU Library General Public
-;;;; License along with this program; if not, write to the Free
-;;;; Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-;;;;
-;;;;---------------------------------------------------------------------------
-;;;;
-;;;; This file contains the EMACS interface to the Problem Report Management
-;;;; System (GNATS):
-;;;;
-;;;; - The `send-pr' command and the `send-pr-mode' for sending
-;;;; Problem Reports (PRs).
-;;;;
-;;;; For more information about how to send a PR see send-pr(1).
-;;;;
-;;;;---------------------------------------------------------------------------
-;;;;
-;;;; Configuration: the symbol `DEFAULT-RELEASE' can be replaced by
-;;;; site/release specific strings during the configuration/installation
-;;;; process.
-;;;;
-;;;; Install this file in your EMACS library directory.
-;;;;
-;;;;---------------------------------------------------------------------------
-
-(provide 'send-pr)
-
-;;;;---------------------------------------------------------------------------
-;;;; Customization: put the following forms into your default.el file
-;;;; (or into your .emacs)
-;;;;---------------------------------------------------------------------------
-
-;(autoload 'send-pr-mode "send-pr"
-; "Major mode for sending problem reports." t)
-
-;(autoload 'send-pr "send-pr"
-; "Command to create and send a problem report." t)
-
-;;;;---------------------------------------------------------------------------
-;;;; End of Customization Section
-;;;;---------------------------------------------------------------------------
-
-(autoload 'server-buffer-done "server")
-(defvar server-buffer-clients nil)
-(defvar mail-self-blind nil)
-(defvar mail-default-reply-to nil)
-
-(defconst send-pr::version "3.113.1")
-
-(defvar gnats:root "/gnats/db"
- "*The top of the tree containing the GNATS database.")
-
-;;;;---------------------------------------------------------------------------
-;;;; hooks
-;;;;---------------------------------------------------------------------------
-
-(defvar text-mode-hook nil) ; we define it here in case it's not defined
-(defvar send-pr-mode-hook text-mode-hook "Called when send-pr is invoked.")
-
-;;;;---------------------------------------------------------------------------
-;;;; Domains and default values for (some of) the Problem Report fields;
-;;;; constants and definitions.
-;;;;---------------------------------------------------------------------------
-
-(defconst gnats::emacs-19p
- (not (or (and (boundp 'epoch::version) epoch::version)
- (string-lessp emacs-version "19")))
- "Is this emacs v19?")
-
-;;; This has to be here rather than at the bottom of this file with
-;;; the other utility functions because it is used by
-;;; gnats::get-config, which is called when send-pr.el is being
-;;; loaded (see the "defconst" below), before the whole file has been
-;;; loaded.
-
-(defun gnats::find-safe-default-directory (&optional buffer)
-"If the directory referred to by `default-directory' for the current
-buffer (or for optional argument BUFFER) does not exist, set it to the home
-directory of the current user if that exists, or to `/'.
-
-Returns the final value of default-directory in the buffer."
- (let ((homedir (expand-file-name "~/")))
- (save-excursion
- (if buffer (set-buffer buffer))
- (if (not (file-exists-p default-directory))
- (if (file-exists-p homedir)
- (setq default-directory homedir)
- (setq default-directory "/")))
- default-directory)))
-
-;;; These may be changed during configuration/installation or by the individual
-;;; user in his/her .emacs file.
-;;;
-(defun gnats::get-config (var)
- (let ((shell-file-name "/bin/sh")
- (buf (generate-new-buffer " *GNATS config*"))
- ret)
- (save-excursion
- (set-buffer buf)
- (shell-command-on-region
- (point-min) (point-max)
- (concat ". " gnats:root "/gnats-adm/config; echo $" var ) t)
- (goto-char (point-min))
- ; We have to use get-buffer, since shell-command-on-region will wipe
- ; out the buffer if there's no output from the command.
- (if (or (not (get-buffer "*Shell Command Output*"))
- (looking-at "/bin/sh:\\|\.:\\|\n"))
- (setq ret nil)
- (setq ret (buffer-substring (point-min) (- (point-max) 1)))))
- (if (and ret (string-equal ret "")) (setq ret nil))
- (kill-buffer buf)
- ret))
-
-;; const because it must match the script's value
-(defconst send-pr:datadir (or (gnats::get-config "DATADIR") "@DATADIR@")
- "*Where the `gnats' subdirectory containing category lists lives.")
-
-(defvar send-pr::sites nil
- "List of GNATS support sites; computed at runtime.")
-(defvar send-pr:default-site
- (or (gnats::get-config "GNATS_SITE") "stacken")
- "Default site to send bugs to.")
-(defvar send-pr:::site send-pr:default-site
- "The site to which a problem report is currently being submitted, or NIL
-if using the default site (buffer local).")
-
-(defvar send-pr:::categories nil
- "Buffer local list of available categories, derived at runtime from
-send-pr:::site and send-pr::category-alist.")
-(defvar send-pr::category-alist nil
- "Alist of GNATS support sites and the categories supported at each; computed
-at runtime.")
-
-;;; Ideally we would get all the following values from a central database
-;;; during runtime instead of having them here in the code.
-;;;
-(defconst send-pr::fields
- (` (("Category" send-pr::set-categories
- (, (or (gnats::get-config "DEFAULT_CATEGORY") nil)) enum)
- ("Class" (("sw-bug") ("doc-bug") ("change-request") ("support"))
- (, (or (gnats::get-config "DEFAULT_CLASS") 0)) enum)
- ("Confidential" (("yes") ("no"))
- (, (or (gnats::get-config "DEFAULT_CONFIDENTIAL") 1)) enum)
- ("Severity" (("non-critical") ("serious") ("critical"))
- (, (or (gnats::get-config "DEFAULT_SEVERITY") 1)) enum)
- ("Priority" (("low") ("medium") ("high"))
- (, (or (gnats::get-config "DEFAULT_PRIORITY") 1)) enum)
- ("Release" nil
- (, (or (gnats::get-config "DEFAULT_RELEASE") "@DEFAULT_RELEASE@"))
- text)
- ("Submitter-Id" nil
- (, (or (gnats::get-config "SUBMITTER") "@SUBMITTER@")) text)
- ("Synopsis" nil nil text
- (lambda (a b c) (gnats::set-mail-field "Subject" c)))))
- "AList, keyed on the name of the field, of:
-1) The field name.
-2) The list of completions. This can be a list, a function to call, or nil.
-3) The default value.
-4) The type of the field.
-5) A sub-function to call when changed.")
-
-(defvar gnats::fields nil)
-
-(defmacro gnats::push (i l)
- (` (setq (, l) (cons (,@ (list i l))))))
-
-(defun send-pr::set-categories (&optional arg)
- "Get the list of categories for the current site out of
-send-pr::category-alist if there or from send-pr if not. With arg, force
-update."
- ;;
- (let ((entry (assoc send-pr:::site send-pr::category-alist)))
- (or (and entry (null arg))
- (let ((oldpr (getenv "GNATS_ROOT")) cats)
- (send-pr::set-sites arg)
- (setenv "GNATS_ROOT" gnats:root)
- (setq cats (gnats::get-value-from-shell
- "send-pr" "-CL" send-pr:::site))
- (setenv "GNATS_ROOT" oldpr)
- (if entry (setcdr entry cats)
- (setq entry (cons send-pr:::site cats))
- (gnats::push entry send-pr::category-alist))))
- (setq send-pr:::categories (cdr entry))))
-
-(defun send-pr::set-sites (&optional arg)
- "Get the list of sites (by listing the contents of DATADIR/gnats) and assign
-it to send-pr::sites. With arg, force update."
- (or (and (null arg) send-pr::sites)
- (progn
- (setq send-pr::sites nil)
- (mapcar
- (function
- (lambda (file)
- (or (memq t (mapcar (function (lambda (x) (string= x file)))
- '("." ".." "pr-edit" "pr-addr")))
- (not (file-readable-p file))
- (gnats::push (list (file-name-nondirectory file))
- send-pr::sites))))
- (directory-files (format "%s/gnats" send-pr:datadir) t))
- (setq send-pr::sites (reverse send-pr::sites)))))
-
-(defconst send-pr::pr-buffer-name "*send-pr*"
- "Name of the temporary buffer, where the problem report gets composed.")
-
-(defconst send-pr::err-buffer-name "*send-pr-error*"
- "Name of the temporary buffer, where send-pr error messages appear.")
-
-(defvar send-pr:::err-buffer nil
- "The error buffer used by the current PR buffer.")
-
-(defvar send-pr:::spawn-to-send nil
- "Whether or not send-pr-mode should spawn a send-pr process to send the PR.")
-
-(defconst gnats::indent 17 "Indent for formatting the value.")
-
-;;;;---------------------------------------------------------------------------
-;;;; `send-pr' - command for creating and sending of problem reports
-;;;;---------------------------------------------------------------------------
-
-(fset 'send-pr 'send-pr:send-pr)
-(defun send-pr:send-pr (&optional site)
- "Create a buffer and read in the result of `send-pr -P'.
-When finished with editing the problem report use \\[send-pr:submit-pr]
-to send the PR with `send-pr -b -f -'."
- ;;
- (interactive
- (if current-prefix-arg
- (list (completing-read "Site: " (send-pr::set-sites 'recheck) nil t
- send-pr:default-site))))
- (or site (setq site send-pr:default-site))
- (let ((buf (get-buffer send-pr::pr-buffer-name)))
- (if (or (not buf)
- (progn (switch-to-buffer buf)
- (cond ((or (not (buffer-modified-p buf))
- (y-or-n-p "Erase previous problem report? "))
- (erase-buffer) t)
- (t nil))))
- (send-pr::start-up site))))
-
-(defun send-pr::start-up (site)
- (switch-to-buffer (get-buffer-create send-pr::pr-buffer-name))
- (setq default-directory (expand-file-name "~/"))
- (auto-save-mode auto-save-default)
- (let ((oldpr (getenv "GNATS_ROOT"))
- (case-fold-search nil))
- (setenv "GNATS_ROOT" gnats:root)
- (send-pr::insert-template site)
- (setenv "GNATS_ROOT" oldpr)
- (goto-char (point-min))
- (if (looking-at "send-pr:")
- (cond ((looking-at "send-pr: .* does not have a categories list")
- (setq send-pr::sites nil)
- (error "send-pr: the GNATS site %s does not have a categories list" site))
- (t (error (buffer-substring (point-min) (point-max)))))
- (save-excursion
- ;; Clear cruft inserted by bdamaged .cshrcs
- (goto-char 1)
- (re-search-forward "^SEND-PR:")
- (delete-region 1 (match-beginning 0)))))
- (set-buffer-modified-p nil)
- (send-pr:send-pr-mode)
- (setq send-pr:::site site)
- (setq send-pr:::spawn-to-send t)
- (send-pr::set-categories)
- (if (null send-pr:::categories)
- (progn
- (and send-pr:::err-buffer (kill-buffer send-pr:::err-buffer))
- (kill-buffer nil)
- (message "send-pr: no categories found"))
- (or (stringp mail-default-reply-to)
- (setq mail-default-reply-to (getenv "REPLYTO")))
- (and mail-default-reply-to
- (gnats::set-mail-field "Reply-To" mail-default-reply-to))
- (and mail-self-blind
- (gnats::set-mail-field "BCC" (user-login-name)))
- (mapcar 'send-pr::maybe-change-field send-pr::fields)
- (gnats::position-on-field "Description")
- (message (substitute-command-keys
- "To send the problem report use: \\[send-pr:submit-pr]"))))
-
-(defvar send-pr::template-alist nil
- "An alist containing the output of send-pr -P <sitename> for various sites.")
-
-(defun send-pr::insert-template (site)
- (let ((elt (assoc site send-pr::template-alist)))
- (if elt
- (save-excursion (insert (cdr elt)))
- (call-process "send-pr" nil t nil "-P" site)
- (save-excursion
- (setq send-pr::template-alist
- (cons (cons site (buffer-substring (point-min) (point-max)))
- send-pr::template-alist))))))
-
-(fset 'do-send-pr 'send-pr:submit-pr) ;backward compat
-(defun send-pr:submit-pr ()
- "Pipe the contents of the buffer *send-pr* to `send-pr -f -.' unless this
-buffer was loaded with emacsclient, in which case save the buffer and exit."
- ;;
- (interactive)
- (cond
- ((and (boundp 'server-buffer-clients)
- server-buffer-clients)
- (let ((buffer (current-buffer))
- (version-control nil) (buffer-backed-up nil))
- (save-buffer buffer)
- (kill-buffer buffer)
- (server-buffer-done buffer)))
- (send-pr:::spawn-to-send
- (if (or (buffer-modified-p)
- (not send-pr:::sent)
- (y-or-n-p "PR already sent; resend? "))
- (progn
- (or (and send-pr:::err-buffer
- (buffer-name send-pr:::err-buffer))
- (setq send-pr:::err-buffer
- (get-buffer-create send-pr::err-buffer-name)))
- (let ((err-buffer send-pr:::err-buffer) mesg ok)
- (save-excursion (set-buffer err-buffer) (erase-buffer))
- (message "running send-pr...")
- (let ((oldpr (getenv "GNATS_ROOT")))
- (setenv "GNATS_ROOT" gnats:root)
- ;; ensure that a final newline is present:
- (if (not (equal (char-after (1- (point-max))) ?\n))
- (save-excursion (goto-char (point-max))
- (insert ?\n)))
- (call-process-region (point-min) (point-max) "send-pr"
- nil err-buffer nil send-pr:::site
- "-b" "-f" "-")
- (setenv "GNATS_ROOT" oldpr))
- (message "running send-pr...done")
- ;; stupidly we cannot check the return value in EMACS 18.57,
- ;; thus we need this kluge to find out whether send-pr succeeded.
- (if (save-excursion
- (set-buffer err-buffer)
- (goto-char (point-min))
- (setq mesg (buffer-substring (point-min) (- (point-max) 1)))
- (search-forward "problem report sent" nil t))
- (progn (message mesg)
- (kill-buffer err-buffer)
- (delete-auto-save-file-if-necessary)
- (set-buffer-modified-p nil)
- (setq send-pr:::sent t)
- (bury-buffer))
- (pop-to-buffer err-buffer))
- ))))
- (t
- (save-buffer)
- (message "Exit emacs to send the PR."))))
-
-;;;;---------------------------------------------------------------------------
-;;;; send-pr:send-pr-mode mode
-;;;;---------------------------------------------------------------------------
-
-(defvar send-pr-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "\C-c\C-c" 'send-pr:submit-pr)
- (define-key map "\C-c\C-f" 'gnats:change-field)
- (define-key map "\M-n" 'gnats:next-field)
- (define-key map "\M-p" 'gnats:previous-field)
- (define-key map "\C-\M-f" 'gnats:forward-field)
- (define-key map "\C-\M-b" 'gnats:backward-field)
- map)
- "Keymap for send-pr mode.")
-
-(defconst gnats::keyword "^>\\([-a-zA-Z]+\\):")
-(defconst gnats::before-keyword "[ \t\n\f]*[\n\f]+>\\([-a-zA-Z]+\\):")
-(defconst gnats::after-keyword "^>\\([-a-zA-Z]+\\):[ \t\n\f]+")
-
-(fset 'send-pr-mode 'send-pr:send-pr-mode)
-(defun send-pr:send-pr-mode ()
- "Major mode for submitting problem reports.
-For information about the form see gnats(1) and send-pr(1).
-Special commands: \\{send-pr-mode-map}
-Turning on send-pr-mode calls the value of the variable send-pr-mode-hook,
-if it is not nil."
- (interactive)
- (gnats::patch-exec-path)
- (put 'send-pr:send-pr-mode 'mode-class 'special)
- (kill-all-local-variables)
- (setq major-mode 'send-pr:send-pr-mode)
- (setq mode-name "send-pr")
- (use-local-map send-pr-mode-map)
- (set-syntax-table text-mode-syntax-table)
- (setq local-abbrev-table text-mode-abbrev-table)
- (setq buffer-offer-save t)
- (make-local-variable 'send-pr:::site)
- (make-local-variable 'send-pr:::categories)
- (make-local-variable 'send-pr:::err-buffer)
- (make-local-variable 'send-pr:::spawn-to-send)
- (make-local-variable 'send-pr:::sent)
- (setq send-pr:::sent nil)
- (make-local-variable 'paragraph-separate)
- (setq paragraph-separate (concat (default-value 'paragraph-separate)
- "\\|" gnats::keyword "[ \t\n\f]*$"))
- (make-local-variable 'paragraph-start)
- (setq paragraph-start (concat (default-value 'paragraph-start)
- "\\|" gnats::keyword))
- (run-hooks 'send-pr-mode-hook)
- t)
-
-;;;;---------------------------------------------------------------------------
-;;;; Functions to read and replace field values.
-;;;;---------------------------------------------------------------------------
-
-(defun gnats::position-on-field (field &optional quiet)
- (goto-char (point-min))
- (if (not (re-search-forward (concat "^>" field ":") nil t))
- (if quiet
- nil
- (error "Field `>%s:' not found." field))
- (re-search-forward "[ \t\n\f]*")
- (if (looking-at gnats::keyword)
- (backward-char 1))
- t))
-
-(defun gnats::mail-position-on-field (field)
- (let (end
- (case-fold-search t))
- (goto-char (point-min))
- (re-search-forward "^$")
- (setq end (match-beginning 0))
- (goto-char (point-min))
- (if (not (re-search-forward (concat "^" field ":") end 'go-to-end))
- (insert field ": \n")
- (re-search-forward "[ \t\n\f]*"))
- (skip-chars-backward "\n")
- t))
-
-(defun gnats::field-contents (field &optional elem move)
- (let (pos)
- (unwind-protect
- (save-excursion
- (if (not (gnats::position-on-field field t))
- nil
- (setq pos (point-marker))
- (if (or (looking-at "<.*>$") (eolp))
- t
- (looking-at ".*$") ; to set match-{beginning,end}
- (gnats::nth-word
- (buffer-substring (match-beginning 0) (match-end 0))
- elem))))
- (and move pos (goto-char pos)))))
-
-(defun gnats::functionp (thing)
- (or (and (symbolp thing) (fboundp thing))
- (and (listp thing) (eq (car thing) 'lambda))))
-
-(defun gnats::field-values (field)
- "Return the possible (known) values for field FIELD."
- (let* ((fields (if (eq major-mode 'gnats:gnats-mode) gnats::fields
- send-pr::fields))
- (thing (elt (assoc field fields) 1)))
- (cond ((gnats::functionp thing) (funcall thing))
- ((listp thing) thing)
- (t (error "ACK")))))
-
-(defun gnats::field-default (field)
- "Return the default value for field FIELD."
- (let* ((fields (if (eq major-mode 'gnats:gnats-mode) gnats::fields
- send-pr::fields))
- (thing (elt (assoc field fields) 2)))
- (cond ((stringp thing) thing)
- ((null thing) "")
- ((numberp thing) (car (elt (gnats::field-values field) thing)))
- ((gnats::functionp thing)
- (funcall thing (gnats::field-contents field)))
- ((eq thing t) (gnats::field-contents field))
- (t (error "ACK")))))
-
-(defun gnats::field-type (field)
- "Return the type of field FIELD."
- (let* ((fields (if (eq major-mode 'gnats:gnats-mode) gnats::fields
- send-pr::fields))
- (thing (elt (assoc field fields) 3)))
- thing))
-
-(defun gnats::field-action (field)
- "Return the extra handling function for field FIELD."
- (let* ((fields (if (eq major-mode 'gnats:gnats-mode) gnats::fields
- send-pr::fields))
- (thing (elt (assoc field fields) 4)))
- (cond ((null thing) 'ignore)
- ((gnats::functionp thing) thing)
- (t (error "ACK")))))
-
-;;;;---------------------------------------------------------------------------
-;;;; Point movement functions
-;;;;---------------------------------------------------------------------------
-
-(or (fboundp 'defsubst) (fset 'defsubst 'defun))
-
-(defun send-pr::maybe-change-field (field)
- (setq field (car field))
- (let ((thing (gnats::field-contents field)))
- (and thing (eq t thing)
- (not (eq 'multi-text (gnats::field-type field)))
- (gnats:change-field field))))
-
-(defun gnats:change-field (&optional field default)
- "Change the value of the field containing the cursor. With arg, ask the
-user for the field to change. From a program, the function takes optional
-arguments of the field to change and the default value to use."
- (interactive)
- (or field current-prefix-arg (setq field (gnats::current-field)))
- (or field
- (setq field
- (completing-read "Field: "
- (if (eq major-mode 'gnats:gnats-mode)
- gnats::fields
- send-pr::fields)
- nil t)))
- (gnats::position-on-field field)
- (sit-for 0)
- (let* ((old (gnats::field-contents field))
- new)
- (if (null old)
- (error "ACK")
- (if (or (interactive-p) t)
- (let ((prompt (concat ">" field ": "))
- (domain (gnats::field-values field))
- (type (gnats::field-type field)))
- (or default (setq default (gnats::field-default field)))
- (setq new
- (if (eq type 'enum)
- (completing-read prompt domain nil t
- (if gnats::emacs-19p (cons default 0)
- default))
- (read-string prompt (if gnats::emacs-19p (cons default 1)
- default)))))
- (setq new default))
- (gnats::set-field field new)
- (funcall (gnats::field-action field) field old new)
- new)))
-
-(defun gnats::set-field (field value)
- (save-excursion
- (gnats::position-on-field field)
- (delete-horizontal-space)
- (looking-at ".*$")
- (replace-match
- (concat (make-string (- gnats::indent (length field) 2) ?\40 ) value) t)))
-
-(defun gnats::set-mail-field (field value)
- (save-excursion
- (gnats::mail-position-on-field field)
- (delete-horizontal-space)
- (looking-at ".*$")
- (replace-match (concat " " value) t)))
-
-(defun gnats::before-keyword (&optional where)
- "Returns t if point is in some white space before a keyword.
-If where is nil, then point is not changed; if where is t then point is moved
-to the beginning of the keyword, otherwise it is moved to the beginning
-of the white space it was in."
- ;;
- (if (looking-at gnats::before-keyword)
- (prog1 t
- (cond ((eq where t)
- (re-search-forward "^>") (backward-char))
- ((not (eq where nil))
- (re-search-backward "[^ \t\n\f]") (forward-char))))
- nil))
-
-(defun gnats::after-keyword (&optional where)
- "Returns t if point is in some white space after a keyword.
-If where is nil, then point is not changed; if where is t then point is moved
-to the beginning of the keyword, otherwise it is moved to the end of the white
-space it was in."
- ;;
- (if (gnats::looking-after gnats::after-keyword)
- (prog1 t
- (cond ((eq where t)
- (re-search-backward "^>"))
- ((not (eq where nil))
- (re-search-forward "[^ \t\n\f]") (backward-char))))
- nil))
-
-(defun gnats::in-keyword (&optional where)
- "Returns t if point is within a keyword.
-If where is nil, then point is not changed; if where is t then point is moved
-to the beginning of the keyword."
- ;;
- (let ((old-point (point-marker)))
- (beginning-of-line)
- (cond ((and (looking-at gnats::keyword)
- (< old-point (match-end 0)))
- (prog1 t
- (if (eq where t)
- t
- (goto-char old-point))))
- (t (goto-char old-point)
- nil))))
-
-(defun gnats::forward-bofield ()
- "Moves point to the beginning of a field. Assumes that point is in the
-keyword."
- ;;
- (if (re-search-forward "[ \t\n\f]+[^ \t\n\f]" (point-max) '-)
- (backward-char)
- t))
-
-(defun gnats::backward-eofield ()
- "Moves point to the end of a field. Assumes point is in the keyword."
- ;;
- (if (re-search-backward "[^ \t\n\f][ \t\n\f]+" (point-min) '-)
- (forward-char)
- t))
-
-(defun gnats::forward-eofield ()
- "Moves point to the end of a field. Assumes that point is in the field."
- ;;
- ;; look for the next field
- (if (re-search-forward gnats::keyword (point-max) '-)
- (progn (beginning-of-line) (gnats::backward-eofield))
- (re-search-backward "[^ \t\n\f][ \t\n\f]*" (point-min) '-)
- (forward-char)))
-
-(defun gnats::backward-bofield ()
- "Moves point to the beginning of a field. Assumes that point is in the
-field."
- ;;
- ;;look for previous field
- (if (re-search-backward gnats::keyword (point-min) '-)
- (gnats::forward-bofield)
- t))
-
-
-(defun gnats:forward-field ()
- "Move point forward to the end of the field or to the beginning of the next
-field."
- ;;
- (interactive)
- (if (or (gnats::before-keyword t) (gnats::in-keyword t)
- (gnats::after-keyword t))
- (gnats::forward-bofield)
- (gnats::forward-eofield)))
-
-(defun gnats:backward-field ()
- "Move point backward to the beginning/end of a field."
- ;;
- (interactive)
- (backward-char)
- (if (or (gnats::before-keyword t) (gnats::in-keyword t)
- (gnats::after-keyword t))
- (gnats::backward-eofield)
- (gnats::backward-bofield)))
-
-(defun gnats:next-field ()
- "Move point to the beginning of the next field."
- ;;
- (interactive)
- (if (or (gnats::before-keyword t) (gnats::in-keyword t)
- (gnats::after-keyword t))
- (gnats::forward-bofield)
- (if (re-search-forward gnats::keyword (point-max) '-)
- (gnats::forward-bofield)
- t)))
-
-(defun gnats:previous-field ()
- "Move point to the beginning of the previous field."
- ;;
- (interactive)
- (backward-char)
- (if (or (gnats::after-keyword t) (gnats::in-keyword t)
- (gnats::before-keyword t))
- (progn (re-search-backward gnats::keyword (point-min) '-)
- (gnats::forward-bofield))
- (gnats::backward-bofield)))
-
-(defun gnats:beginning-of-field ()
- "Move point to the beginning of the current field."
- (interactive)
- (cond ((gnats::in-keyword t)
- (gnats::forward-bofield))
- ((gnats::after-keyword 0))
- (t
- (gnats::backward-bofield))))
-
-(defun gnats::current-field ()
- (save-excursion
- (if (cond ((or (gnats::in-keyword t) (gnats::after-keyword t))
- (looking-at gnats::keyword))
- ((re-search-backward gnats::keyword nil t)))
- (buffer-substring (match-beginning 1) (match-end 1))
- nil)))
-
-;;;;---------------------------------------------------------------------------
-;;;; Support functions
-;;;;---------------------------------------------------------------------------
-
-(defun gnats::looking-after (regex)
- "Returns t if point is after regex."
- ;;
- (let* ((old-point (point))
- (start (if (eobp)
- old-point
- (forward-char) (point))))
- (cond ((re-search-backward regex (point-min) t)
- (goto-char old-point)
- (cond ((eq (match-end 0) start)
- t))))))
-
-(defun gnats::nth-word (string &optional elem)
- "Returns the elem-th word of the string.
-If elem is nil, then the first wort is returned, if elem is 0 then
-the whole string is returned."
- ;;
- (if (integerp elem)
- (cond ((eq elem 0) string)
- ((eq elem 1) (gnats::first-word string))
- ((equal string "") "")
- ((>= elem 2)
- (let ((i 0) (value ""))
- (setq string ; strip leading blanks
- (substring string (or (string-match "[^ \t]" string) 0)))
- (while (< i elem)
- (setq value
- (substring string 0
- (string-match "[ \t]*$\\|[ \t]+" string)))
- (setq string
- (substring string (match-end 0)))
- (setq i (+ i 1)))
- value)))
- (gnats::first-word string)))
-
-(defun gnats::first-word (string)
- (setq string
- (substring string (or (string-match "[^ \t]" string) 0)))
- (substring string 0 (string-match "[ \t]*$\\|[ \t]+" string)))
-
-;;;;---------------------------------------------------------------------------
-
-(defun gnats::patch-exec-path ()
- ;;
- "Replaces `//' by `/' in `exec-path'."
- ;;
- ;(make-local-variable 'exec-path)
- (let ((err-buffer (get-buffer-create " *gnats::patch-exec-path*"))
- (ret))
- (setq exec-path (save-excursion (set-buffer err-buffer)
- (prin1 exec-path err-buffer)
- (goto-char (point-min))
- (while (search-forward "//" nil t)
- (replace-match "/" nil t))
- (goto-char (point-min))
- (setq ret (read err-buffer))
- (kill-buffer err-buffer)
- ret
- ))))
-
-(defun gnats::get-value-from-shell (&rest command)
- "Execute shell command to get a list of valid values for `variable'."
- ;;
- (let ((err-buffer (get-buffer-create " *gnats::get-value-from-shell*")))
- (save-excursion
- (set-buffer err-buffer)
- (unwind-protect
- (condition-case var
- (progn
- (apply 'call-process
- (car command) nil err-buffer nil (cdr command))
- (goto-char (point-min))
- (if (looking-at "[-a-z]+: ")
- (error (buffer-substring (point-min) (point-max))))
- (read err-buffer))
- (error nil))
- (kill-buffer err-buffer)))))
-
-(or (fboundp 'setenv)
- (defun setenv (variable &optional value)
- "Set the value of the environment variable named VARIABLE to VALUE.
-VARIABLE should be a string. VALUE is optional; if not provided or is
-`nil', the environment variable VARIABLE will be removed.
-This function works by modifying `process-environment'."
- (interactive "sSet environment variable: \nsSet %s to value: ")
- (if (string-match "=" variable)
- (error "Environment variable name `%s' contains `='" variable)
- (let ((pattern (concat "\\`" (regexp-quote (concat variable "="))))
- (case-fold-search nil)
- (scan process-environment))
- (while scan
- (cond
- ((string-match pattern (car scan))
- (if (eq nil value)
- (setq process-environment (delq (car scan)
- process-environment))
- (setcar scan (concat variable "=" value)))
- (setq scan nil))
- ((null (setq scan (cdr scan)))
- (setq process-environment
- (cons (concat variable "=" value)
- process-environment)))))))))
-
-;;;; end of send-pr.el
diff --git a/usr.sbin/afs/src/tools/gnats/send-pr.1 b/usr.sbin/afs/src/tools/gnats/send-pr.1
deleted file mode 100644
index 7698d4e049b..00000000000
--- a/usr.sbin/afs/src/tools/gnats/send-pr.1
+++ /dev/null
@@ -1,289 +0,0 @@
-.\" -*- nroff -*-
-.\" ---------------------------------------------------------------------------
-.\" man page for send-pr (by Heinz G. Seidl, hgs@cygnus.com)
-.\" updated Feb 1993 for GNATS 3.00 by Jeffrey Osier, jeffrey@cygnus.com
-.\"
-.\" This file is part of the Problem Report Management System (GNATS)
-.\" Copyright 1992 Cygnus Support
-.\"
-.\" This program is free software; you can redistribute it and/or
-.\" modify it under the terms of the GNU General Public
-.\" License as published by the Free Software Foundation; either
-.\" version 2 of the License, or (at your option) any later version.
-.\"
-.\" This program is distributed in the hope that it will be useful,
-.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
-.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-.\" General Public License for more details.
-.\"
-.\" You should have received a copy of the GNU Library General Public
-.\" License along with this program; if not, write to the Free
-.\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
-.\"
-.\" ---------------------------------------------------------------------------
-.nh
-.TH SEND-PR 1 3.113.1 "February 1993"
-.SH NAME
-send-pr \- send problem report (PR) to a central support site
-.SH SYNOPSIS
-.B send-pr
-[
-.I site
-]
-[
-.B \-f
-.I problem-report
-]
-[
-.B \-t
-.I mail-address
-]
-.br
-.in +0.8i
-[
-.B \-P
-]
-[
-.B \-L
-]
-[
-.B \-s
-.I severity
-]
-[
-.B \-c
-.I address
-]
-.br
-[
-.B \-\-request-id
-]
-[
-.B \-V
-]
-.SH DESCRIPTION
-.B send-pr
-is a tool used to submit
-.I problem reports
-.\" SITE ADMINISTRATORS - change this if you use a local default
-(PRs) to a central support site. In most cases the correct
-.I site
-will be the default. This argument indicates the support site which
-is responsible for the category of problem involved. Some sites may
-use a local address as a default.
-.I site
-values are defined by using the
-.BR aliases (5).
-.LP
-.B send-pr
-invokes an editor on a problem report template (after trying to fill
-in some fields with reasonable default values). When you exit the
-editor,
-.B send-pr
-sends the completed form to the
-.I Problem Report Management System
-(\fBGNATS\fR) at a central support site. At the support site, the PR
-is assigned a unique number and is stored in the \fBGNATS\fR database
-according to its category and submitter-id. \fBGNATS\fR automatically
-replies with an acknowledgement, citing the category and the PR
-number.
-.LP
-To ensure that a PR is handled promptly, it should contain your (unique)
-\fIsubmitter-id\fR and one of the available \fIcategories\fR to identify the
-problem area. (Use
-.B `send-pr -L'
-to see a list of categories.)
-.LP
-The
-.B send-pr
-template at your site should already be customized with your
-submitter-id (running `\|\fBinstall-sid\fP \fIsubmitter-id\fP\|' to
-accomplish this is part of the installation procedures for
-.BR send-pr ).
-If this hasn't been done, see your system administrator for your
-submitter-id, or request one from your support site by invoking
-.B `send-pr \-\-request\-id'.
-If your site does not distinguish between different user sites, or if
-you are not affiliated with the support site, use
-.B `net'
-for this field.
-.LP
-The more precise your problem description and the more complete your
-information, the faster your support team can solve your problems.
-.SH OPTIONS
-.TP
-.BI \-f " problem-report"
-specify a file (\fIproblem-report\fR) which already contains a
-complete problem report.
-.B send-pr
-sends the contents of the file without invoking the editor. If
-the value for
-.I problem-report
-is
-.BR `\|\-\|' ,
-then
-.B send-pr
-reads from standard input.
-.TP
-.BI \-s " severity"
-Give the problem report the severity
-.IR severity .
-.TP
-.BI \-t " mail-address"
-Change mail address at the support site for problem reports. The
-default
-.I mail-address
-is the address used for the default
-.IR site .
-Use the
-.I site
-argument rather than this option in nearly all cases.
-.TP
-.BI \-c " address"
-Put
-.I address
-in the
-.B Cc:
-header of the message.
-.TP
-.B \-P
-print the form specified by the environment variable
-.B PR_FORM
-on standard output. If
-.B PR_FORM
-is not set, print the standard blank PR template. No mail is sent.
-.TP
-.B -L
-print the list of available categories. No mail is sent.
-.TP
-.B \-\-request\-id
-sends mail to the default support site, or
-.I site
-if specified, with a request for your
-.IR submitter-id .
-If you are
-not affiliated with
-.IR site ,
-use a
-.I submitter-id
-of
-.BR net \|'.
-.TP
-.B \-V
-Display the
-.B send-pr
-version number.
-.LP
-Note: use
-.B send-pr
-to submit problem reports rather than mailing them directly. Using
-both the template and
-.B send-pr
-itself will help ensure all necessary information will reach the
-support site.
-.SH ENVIRONMENT
-The environment variable
-.B EDITOR
-specifies the editor to invoke on the template.
-.br
-default:
-.B vi
-.sp
-If the environment variable
-.B PR_FORM
-is set, then its value is used as the file name of the template for
-your problem-report editing session. You can use this to start with a
-partially completed form (for example, a form with the identification
-fields already completed).
-.SH "HOW TO FILL OUT A PROBLEM REPORT"
-Problem reports have to be in a particular form so that a program can
-easily manage them. Please remember the following guidelines:
-.IP \(bu 3m
-describe only
-.B one problem
-with each problem report.
-.IP \(bu 3m
-For follow-up mail, use the same subject line as the one in the automatic
-acknowledgent. It consists of category, PR number and the original synopsis
-line. This allows the support site to relate several mail messages to a
-particular PR and to record them automatically.
-.IP \(bu 3m
-Please try to be as accurate as possible in the subject and/or synopsis line.
-.IP \(bu 3m
-The subject and the synopsis line are not confidential. This is
-because open-bugs lists are compiled from them. Avoid confidential
-information there.
-.LP
-See the GNU
-.B Info
-file
-.B send-pr.info
-or the document \fIReporting Problems With send-pr\fR\ for detailed
-information on reporting problems
-.SH "HOW TO SUBMIT TEST CASES, CODE, ETC."
-Submit small code samples with the PR. Contact the support site for
-instructions on submitting larger test cases and problematic source
-code.
-.SH FILES
-.ta \w'/tmp/pbad$$ 'u
-/tmp/p$$ copy of PR used in editing session
-.br
-/tmp/pf$$ copy of empty PR form, for testing purposes
-.br
-/tmp/pbad$$ file for rejected PRs
-.SH EMACS USER INTERFACE
-An Emacs user interface for
-.B send-pr
-with completion of field values is part of the
-.B send-pr
-distribution (invoked with
-.BR "M-x send-pr" ).
-See the file
-.B send-pr.info
-or the ASCII file
-.B INSTALL
-in the top level directory of the distribution for configuration and
-installation information. The Emacs LISP template file is
-.B send-pr-el.in
-and is installed as
-.BR send-pr.el .
-.SH INSTALLATION AND CONFIGURATION
-See
-.B send-pr.info
-or
-.B INSTALL
-for installation instructions.
-.SH SEE ALSO
-.I Reporting Problems Using send-pr
-(also installed as the GNU Info file
-.BR send-pr.info ).
-.LP
-.BR gnats (l),
-.BR query-pr (1),
-.BR edit-pr (1),
-.BR gnats (8),
-.BR queue-pr (8),
-.BR at-pr (8),
-.BR mkcat (8),
-.BR mkdist (8).
-.SH AUTHORS
-Jeffrey Osier, Brendan Kehoe, Jason Merrill, Heinz G. Seidl (Cygnus
-Support)
-.SH COPYING
-Copyright (c) 1992, 1993 Free Software Foundation, Inc.
-.PP
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-.PP
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-.PP
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
-
diff --git a/usr.sbin/afs/src/tools/gnats/send-pr.info b/usr.sbin/afs/src/tools/gnats/send-pr.info
deleted file mode 100644
index c7eb01281fb..00000000000
--- a/usr.sbin/afs/src/tools/gnats/send-pr.info
+++ /dev/null
@@ -1,1606 +0,0 @@
-This is Info file send-pr.info, produced by Makeinfo version 1.68 from
-the input file /usr/src/gnu/usr.bin/send-pr/send-pr.texi.
-
-START-INFO-DIR-ENTRY
-* send-pr: (send-pr). Reporting problems--using send-pr
-END-INFO-DIR-ENTRY
-
- Copyright (C) 1993, 1994 Free Software Foundation, Inc.
-
- Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
- Permission is granted to copy and distribute modified versions of
-this manual under the conditions for verbatim copying, provided also
-that the entire resulting derived work is distributed under the terms
-of a permission notice identical to this one.
-
- Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions.
-
-
-File: send-pr.info, Node: Top, Next: send-pr in detail, Up: (dir)
-
-Overview
-********
-
- This manual documents `send-pr', version 3.95, which uses electronic
-mail to submit support questions and problem reports to a central
-Support Site. No body of work is perfect, and support organizations
-understand this; `send-pr' is designed to allow users who have problems
-to submit reports of these problems to sites responsible for supporting
-the products in question, in a defined form which can be read by an
-electronically managed database.
-
- `send-pr' is part of a suite of programs known collectively as
-GNATS, the GNU Problem Report Management System. GNATS consists of
-several programs which, used in concert, formulate and partially
-administer a database of "Problem Reports", or "PRs", at a central
-Support Site. A PR goes through several states in its lifetime; GNATS
-tracks the PR and all information associated with it through each state
-and finally acts as an archive for PRs which have been "closed".
-
- Because `send-pr' exists as a shell (`/bin/sh') script and as an
-Elisp file for use with GNU Emacs, it can be used from any machine on
-your network which can run a shell script and/or Emacs.
-
- In general, you can use any editor and mailer to submit valid Problem
-Reports, as long as the format required by GNATS is preserved.
-`send-pr' automates the process, however, and ensures that certain
-fields necessary for automatic processing are present. `send-pr' is
-strongly recommended for all initial problem-oriented correspondence
-with your Support Site. The organization you submit Problem Reports to
-supplies an address to which further information can be sent; the person
-responsible for the category of the problem you report contacts you
-directly.
-
-* Menu:
-
-* send-pr in detail:: Details about send-pr and GNATS
-* Invoking send-pr:: Editing and sending PRs
-* An Example:: A working example
-* Installing send-pr:: Installing send-pr on your system
-* Index::
-
-
-File: send-pr.info, Node: send-pr in detail, Next: Invoking send-pr, Prev: Top, Up: Top
-
-Details about send-pr and GNATS
-*******************************
-
- A "Problem Report" is a message that describes a problem you are
-having with a body of work. `send-pr' organizes this message into a
-form which can be understood and automatically processed by GNATS, the
-GNU Problem Report Management System. A Problem Report is organized
-into "fields" which contain data describing you, your organization, and
-the problem you are announcing (*note Problem Report format: Fields.).
-Problem Reports go through several defined states in their lifetimes,
-from "open" to "closed" (*note States of Problem Reports: States.).
-
-* Menu:
-
-* States:: States of Problem Reports
-* Fields:: Problem Report format
-
-
-File: send-pr.info, Node: States, Next: Fields, Up: send-pr in detail
-
-States of Problem Reports
-=========================
-
- Each PR goes through a defined series of states between origination
-and closure. The originator of a PR receives notification
-automatically of any state changes.
-
-"open"
- The initial state of a Problem Report. This means the PR has been
- filed and the responsible person(s) notified.
-
-"analyzed"
- The responsible person has analyzed the problem. The analysis
- should contain a preliminary evaluation of the problem and an
- estimate of the amount of time and resources necessary to solve
- the problem. It should also suggest possible workarounds.
-
-"feedback"
- The problem has been solved, and the originator has been given a
- patch or other fix. The PR remains in this state until the
- originator acknowledges that the solution works.
-
-"closed"
- A Problem Report is closed ("the bug stops here") only when any
- changes have been integrated, documented, and tested, and the
- submitter has confirmed the solution.
-
-"suspended"
- Work on the problem has been postponed. This happens if a timely
- solution is not possible or is not cost-effective at the present
- time. The PR continues to exist, though a solution is not being
- actively sought. If the problem cannot be solved at all, it
- should be closed rather than suspended.
-
-
-File: send-pr.info, Node: Fields, Prev: States, Up: send-pr in detail
-
-Problem Report format
-=====================
-
- The format of a PR is designed to reflect the nature of GNATS as a
-database. Information is arranged into "fields", and kept in
-individual records (Problem Reports).
-
- Problem Report fields are denoted by a keyword which begins with `>'
-and ends with `:', as in `>Confidential:'. Fields belong to one of
-three data types:
-
-ENUMERATED
- One of a specific set of values, which vary according to the
- field. The value for each keyword must be on the same line as the
- keyword. These values are not configurable (yet).
-
- For each ENUMERATED keyword, the possible choices are listed in the
- `send-pr' template as a comment. The following fields are
- ENUMERATED format; see the descriptions of fields below for
- explanations of each field in detail:
-
- >Confidential: >Severity: >Priority:
- >Class: >State: >Number:
-
-TEXT
- One single line of text which must begin and end on the same line
- (i.e., before a newline) as the keyword. See the descriptions of
- fields below for explanations of each field in detail. The
- following fields are TEXT format:
-
- >Submitter-Id: >Originator: >Synopsis:
- >Category: >Release: >Responsible:
- >Arrival-Date:
-
-MULTITEXT
- Text of any length may occur in this field. MULTITEXT may span
- multiple lines and may also include blank lines. A MULTITEXT field
- ends only when another keyword appears. See the descriptions of
- fields below for explanations of each field in detail.
-
- The following fields are MULTITEXT format:
-
- >Organization: >Environment: >Description:
- >How-To-Repeat: >Fix: >Audit-Trail:
- >Unformatted:
-
- A Problem Report contains two different types of fields: "Mail
-Header" fields, which are used by the mail handler for delivery, and
-"Problem Report" fields, which contain information relevant to the
-Problem Report and its submitter. A Problem Report is essentially a
-specially formatted electronic mail message.
-
- The following is an example Problem Report. Mail headers are at the
-top, followed by GNATS fields, which begin with `>' and end with `:'.
-The `Subject:' line in the mail header and the `>Synopsis:' field are
-usually duplicates of each other.
-
- Message-Id: MESSAGE-ID
- Date: DATE
- From: ADDRESS
- Reply-To: ADDRESS
- To: BUG-ADDRESS
- Subject: SUBJECT
-
- >Number: GNATS-ID
- >Category: CATEGORY
- >Synopsis: SYNOPSIS
- >Confidential: no *or* yes
- >Severity: critical, serious, *or* non-critical
- >Priority: high, medium *or* low
- >Responsible: RESPONSIBLE
- >State: open, analyzed, suspended, feedback, *or* closed
- >Class: sw-bug, doc-bug, change-request, support,
- *or* duplicate
- >Submitter-Id: SUBMITTER-ID
- >Arrival-Date: DATE
- >Originator: NAME
- >Organization: ORGANIZATION
- >Release: RELEASE
- >Environment:
- ENVIRONMENT
- >Description:
- DESCRIPTION
- >How-To-Repeat:
- HOW-TO-REPEAT
- >Fix:
- FIX
- >Audit-Trail:
- APPENDED-MESSAGES...
- State-Changed-From-To: FROM-TO
- State-Changed-When: DATE
- State-Changed-Why:
- REASON
- Responsible-Changed-From-To: FROM-TO
- Responsible-Changed-When: DATE
- Responsible-Changed-Why:
- REASON
- >Unformatted:
- MISCELLANEOUS
-
-* Menu:
-
-* Mail header fields::
-* Problem Report fields::
-
-
-File: send-pr.info, Node: Mail header fields, Next: Problem Report fields, Up: Fields
-
-Mail header fields
-------------------
-
- A Problem Report may contain any mail header field described in the
-Internet standard RFC-822. However, only the fields which identify the
-sender and the subject are required by `send-pr':
-
-`To:'
- The preconfigured mail address for the Support Site where the PR
- is to be sent, automatically supplied by `send-pr'.
-
-`Subject:'
- A terse description of the problem. This field normally contains
- the same information as the `>Synopsis:' field.
-
-`From:'
- Usually supplied automatically by the originator's mailer; should
- contain the originator's electronic mail address.
-
-`Reply-To:'
- A return address to which electronic replies can be sent; in most
- cases, the same address as the `From:' field.
-
-
-File: send-pr.info, Node: Problem Report fields, Prev: Mail header fields, Up: Fields
-
-Problem Report fields
----------------------
-
-Field descriptions
-------------------
-
- The following fields are present whenever a PR is submitted via the
-program `send-pr'. GNATS adds additional fields when the PR arrives at
-the Support Site; explanations of these follow this list.
-
-`>Submitter-Id:'
- (TEXT) A unique identification code assigned by the Support Site.
- It is used to identify all Problem Reports coming from a particular
- site. (Submitters without a value for this field can invoke
- `send-pr' with the `--request-id' option to apply for one from the
- support organization. Problem Reports from those not affiliated
- with the support organization should use the default value of `net'
- for this field.)
-
-`>Originator:'
- (TEXT) Originator's real name. The default is the value of the
- originator's environment variable `NAME'.
-
-`>Organization:'
- (MULTITEXT) The originator's organization. The default value is
- set with the variable `DEFAULT_ORGANIZATION' in the `send-pr'
- shell script.
-
-`>Confidential:'
- (ENUMERATED) Use of this field depends on the originator's
- relationship with the support organization; contractual agreements
- often have provisions for preserving confidentiality. Conversely,
- a lack of a contract often means that any data provided will not
- be considered confidential. Submitters should be advised to
- contact the support organization directly if this is an issue.
-
- If the originator's relationship to the support organization
- provides for confidentiality, then if the value of this field is
- `yes' the support organization treats the PR as confidential; any
- code samples provided are not made publicly available (e.g., in
- regression test suites). The default value is `yes'.
-
-`>Synopsis:'
- (TEXT) One-line summary of the problem. `send-pr' copies this
- information to the `Subject:' line when you submit a Problem
- Report.
-
-`>Severity:'
- (ENUMERATED) The severity of the problem. Accepted values include:
-
- `critical'
- The product, component or concept is completely
- non-operational or some essential functionality is missing.
- No workaround is known.
-
- `serious'
- The product, component or concept is not working properly or
- significant functionality is missing. Problems that would
- otherwise be considered `critical' are rated `serious' when a
- workaround is known.
-
- `non-critical'
- The product, component or concept is working in general, but
- lacks features, has irritating behavior, does something
- wrong, or doesn't match its documentation.
-
- The default value is `serious'.
-
-`>Priority:'
- (ENUMERATED) How soon the originator requires a solution. Accepted
- values include:
-
- `high'
- A solution is needed as soon as possible.
-
- `medium'
- The problem should be solved in the next release.
-
- `low'
- The problem should be solved in a future release.
-
- The default value is `medium'.
-
-`>Category:'
- (TEXT) The name of the product, component or concept where the
- problem lies. The values for this field are defined by the Support
- Site.
-
-`>Class:'
- (ENUMERATED) The class of a problem can be one of the following:
-
- `sw-bug'
- A general product problem. (`sw' stands for "software".)
-
- `doc-bug'
- A problem with the documentation.
-
- `change-request'
- A request for a change in behavior, etc.
-
- `support'
- A support problem or question.
-
- `duplicate (PR-NUMBER)'
- Duplicate PR. PR-NUMBER should be the number of the original
- PR.
-
- The default is `sw-bug'.
-
-`>Release:'
- (TEXT) Release or version number of the product, component or
- concept.
-
-`>Environment:'
- (MULTITEXT) Description of the environment where the problem
- occured: machine architecture, operating system, host and target
- types, libraries, pathnames, etc.
-
-`>Description:'
- (MULTITEXT) Precise description of the problem.
-
-`>How-To-Repeat:'
- (MULTITEXT) Example code, input, or activities to reproduce the
- problem. The support organization uses example code both to
- reproduce the problem and to test whether the problem is fixed.
- Include all preconditions, inputs, outputs, conditions after the
- problem, and symptoms. Any additional important information
- should be included. Include all the details that would be
- necessary for someone else to recreate the problem reported,
- however obvious. Sometimes seemingly arbitrary or obvious
- information can point the way toward a solution. See also *Note
- Helpful hints: Helpful hints.
-
-`>Fix:'
- (MULTITEXT) A description of a solution to the problem, or a patch
- which solves the problem. (This field is most often filled in at
- the Support Site; we provide it to the submitter in case she has
- solved the problem.)
-
-GNATS adds the following fields when the PR arrives at the Support Site:
-
-`>Number:'
- (ENUMERATED) The incremental identification number for this PR.
-
- The `>Number:' field is often paired with the `>Category:' field as
-
- CATEGORY/NUMBER
-
- in subsequent email messages. This is for historical reasons, as
- well as because Problem Reports are stored in subdirectories which
- are named by category.
-
-`>State:'
- (ENUMERATED) The current state of the PR. Accepted values are:
-
- `open'
- The PR has been filed and the responsible person notified.
-
- `analyzed'
- The responsible person has analyzed the problem.
-
- `feedback'
- The problem has been solved, and the originator has been
- given a patch or other fix.
-
- `closed'
- The changes have been integrated, documented, and tested, and
- the originator has confirmed that the solution works.
-
- `suspended'
- Work on the problem has been postponed.
-
- The initial state of a PR is `open'. *Note States of Problem
- Reports: States.
-
-`>Responsible:'
- (TEXT) The person responsible for this category.
-
-`>Arrival-Date:'
- (TEXT) The time that this PR was received by GNATS. The date is
- provided automatically by GNATS.
-
-`>Audit-Trail:'
- (MULTITEXT) Tracks related electronic mail as well as changes in
- the `>State:' and `>Responsible:' fields with the sub-fields:
-
- `State-Changed-<From>-<To>: OLDSTATE>-<NEWSTATE'
- The old and new `>State:' field values.
-
- `Responsible-Changed-<From>-<To>: OLDRESP>-<NEWRESP'
- The old and new `>Responsible:' field values.
-
- `State-Changed-By: NAME'
- `Responsible-Changed-By: NAME'
- The name of the maintainer who effected the change.
-
- `State-Changed-When: TIMESTAMP'
- `Responsible-Changed-When: TIMESTAMP'
- The time the change was made.
-
- `State-Changed-Why: REASON...'
- `Responsible-Changed-Why: REASON...'
- The reason for the change.
-
- The `>Audit-Trail:' field also contains any mail messages received
- by GNATS related to this PR, in the order received.
-
-`>Unformatted:'
- (MULTITEXT) Any random text found outside the fields in the
- original Problem Report.
-
-
-File: send-pr.info, Node: Invoking send-pr, Next: An Example, Prev: send-pr in detail, Up: Top
-
-Editing and sending PRs
-***********************
-
- You can invoke `send-pr' from a shell prompt or from within GNU
-Emacs using `M-x send-pr'.
-
-* Menu:
-
-* using send-pr:: Creating new Problem Reports
-* send-pr in Emacs:: Using send-pr from within Emacs
-* send-pr from the shell:: Invoking send-pr from the shell
-* Helpful hints::
-
-
-File: send-pr.info, Node: using send-pr, Next: send-pr in Emacs, Up: Invoking send-pr
-
-Creating new Problem Reports
-============================
-
- Invoking `send-pr' presents a PR "template" with a number of fields
-already filled in. Complete the template as thoroughly as possible to
-make a useful bug report. Submit only one bug with each PR.
-
- A template consists of three sections:
-
-"Comments"
- The top several lines of a blank template consist of a series of
- comments that provide some basic instructions for completing the
- Problem Report, as well as a list of valid entries for the
- `>Category:' field. These comments are all preceded by the string
- `SEND-PR:' and are erased automatically when the PR is submitted.
- The instructional comments within `<' and `>' are also removed.
- (Only these comments are removed; lines you provide that happen to
- have those characters in them, such as examples of shell-level
- redirection, are not affected.)
-
-"Mail Header"
- `send-pr' creates a standard mail header. `send-pr' completes all
- fields except the `Subject:' line with default values. (*Note
- Problem Report format: Fields.)
-
-"GNATS fields"
- These are the informational fields that GNATS uses to route your
- Problem Report to the responsible party for further action. They
- should be filled out as completely as possible. (*Note Problem
- Report format: Fields. Also see *Note Helpful hints: Helpful
- hints.)
-
-For examples of a Problem Report template and complete Problem Report,
-see *Note An Example::.
-
- The default template contains your preconfigured `>Submitter-Id:'.
-`send-pr' attempts to determine values for the `>Originator:' and
-`>Organization:' fields (*note Problem Report format: Fields.).
-`send-pr' also attempts to find out some information about your system
-and architecture, and places this information in the `>Environment:'
-field if it finds any.
-
- You may submit problem reports to different Support Sites from the
-default site by specifying the alternate site when you invoke
-`send-pr'. Each `site' has its own list of categories for which it
-accepts Problem Reports. (*Note Setting a default SITE: default site.)
-
- `send-pr' also provides the mail header section of the template with
-default values in the `To:', `From:', and `Reply-To:' fields. The
-`Subject:' field is empty.
-
- The template begins with a comment section:
-
- SEND-PR: -*- send-pr -*-
- SEND-PR: Lines starting with `SEND-PR' will be removed
- SEND-PR: automatically as well as all comments (the text
- SEND-PR: below enclosed in `<' and `>').
- SEND-PR:
- SEND-PR: Please consult the document `Reporting Problems
- SEND-PR: Using send-pr' if you are not sure how to fill out
- SEND-PR: a problem report.
- SEND-PR:
- SEND-PR: Choose from the following categories:
-
-and also contains a list of valid `>Category:' values for the Support
-Site to whom you are submitting this Problem Report. One (and only
-one) of these values should be placed in the `>Category:' field. A
-complete sample bug report, from template to completed PR, is shown in
-*Note An Example::. For a complete list of valid categories, type
-`send-pr -L' at your prompt. *Note Valid Categories: Valid Categories,
-for a sample list of categories, .
-
- The mail header is just below the comment section. Fill out the
-`Subject:' field, if it is not already completed using the value of
-`>Synopsis:'. The other mail header fields contain default values.
-
- To: SUPPORT-SITE
- Subject: *complete this field*
- From: YOUR-LOGIN@YOUR-SITE
- Reply-To: YOUR-LOGIN@YOUR-SITE
- X-send-pr-version: send-pr 3.95
-
-where SUPPORT-SITE is an alias for the Support Site you wish to submit
-this PR to.
-
- The rest of the template contains GNATS fields. Each field is
-either automatically completed with valid information (such as your
-`>Submitter-Id:') or contains a one-line instruction specifying the
-information that field requires in order to be correct. For example,
-the `>Confidential:' field expects a value of `yes' or `no', and the
-answer must fit on one line; similarly, the `>Synopsis:' field expects
-a short synopsis of the problem, which must also fit on one line. Fill
-out the fields as completely as possible. *Note Helpful hints: Helpful
-hints, for suggestions as to what kinds of information to include.
-
- In this example, words in *italics* are filled in with
-pre-configured information:
-
- >Submitter-Id: *your submitter-id*
- >Originator: *your name here*
- >Organization:
- *your organization*
- >Confidential:<[ yes | no ] (one line)>
- >Synopsis: <synopsis of the problem (one line)>
- >Severity: <[non-critical | serious | critical](one line)>
- >Priority: <[ low | medium | high ] (one line)>
- >Category: <name of the product (one line)>
- >Class: <[sw-bug | doc-bug | change-request | support]>
- >Release: <release number or tag (one line)>
- >Environment:
- <machine, os, target, libraries (multiple lines)>
-
- >Description:
- <precise description of the problem (multiple lines)>
- >How-To-Repeat:
- <code/input/activities to reproduce (multiple lines)>
- >Fix:
- <how to correct or work around the problem, if known
- (multiple lines)>
-
- When you finish editing the Problem Report, `send-pr' mails it to
-the address named in the `To:' field in the mail header. `send-pr'
-checks that the complete form contains a valid `>Category:'.
-
- Your copy of `send-pr' should have already been customized on
-installation to reflect your `>Submitter-Id:'. (*Note Installing
-`send-pr' on your system: Installing send-pr.) If you don't know your
-`>Submitter-Id:', you can request it using `send-pr --request-id'. If
-your organization is not affiliated with the site you send Problem
-Reports to, a good generic `>Submitter-Id:' to use is `net'.
-
- If your PR has an invalid value in one of the ENUMERATED fields
-(*note Problem Report format: Fields.), `send-pr' places the PR in a
-temporary file named `/tmp/pbadNNNN' on your machine. NNNN is the
-process identification number given to your current `send-pr' session.
-If you are running `send-pr' from the shell, you are prompted as to
-whether or not you wish to try editing the same Problem Report again.
-If you are running `send-pr' from Emacs, the Problem Report is placed
-in the buffer `*send-pr-error*'; you can edit this file and then submit
-it with
-
- M-x gnats-submit-pr
-
- Any further mail concerning this Problem Report should be
-carbon-copied to the GNATS mailing address as well, with the category
-and identification number in the `Subject:' line of the message.
-
- Subject: Re: PR CATEGORY/GNATS-ID: ORIGINAL MESSAGE SUBJECT
-
-Messages which arrive with `Subject:' lines of this form are
-automatically appended to the Problem Report in the `>Audit-Trail:'
-field in the order received.
-
-
-File: send-pr.info, Node: send-pr in Emacs, Next: send-pr from the shell, Prev: using send-pr, Up: Invoking send-pr
-
-Using `send-pr' from within Emacs
-=================================
-
- You can use an interactive `send-pr' interface from within GNU Emacs
-to fill out your Problem Report. We recommend that you familiarize
-yourself with Emacs before using this feature (*note Introduction:
-(emacs)Introduction.).
-
- Call `send-pr' with `M-x send-pr'.(1) `send-pr' responds with a
-Problem Report template preconfigured for the Support Site from which
-you received `send-pr'. (If you use `send-pr' locally, the default
-Support Site is probably your local site.)
-
- You may also submit problem reports to different Support Sites from
-the default site. To use this feature, invoke `send-pr' with
-
- C-u M-x send-pr
-
- `send-pr' prompts you for the name of a SITE. SITE is an alias on
-your local machine which points to an alternate Support Site.
-
- `send-pr' displays the template and prompts you in the minibuffer
-with the line:
- >Category: other
-
-Delete the default value `other' *in the minibuffer* and replace it
-with the keyword corresponding to your problem (the list of valid
-categories is in the topmost section of the PR template). For example,
-if the problem you wish to report has to do with the GNU C compiler,
-and your support organization accepts bugs submitted for this program
-under the category `gcc', delete `other' and then type `gcc[<RET>]'.
-`send-pr' replaces the line
-
- >Category: <name of the product (one line)>
-
-in the template with
-
- >Category: gcc
-
-and moves on to another field.
-
- `send-pr' provides name completion in the minibuffer. For instance,
-you can also type `gc[<TAB>]', and `send-pr' attempts to complete the
-entry for you. Typing `g[<TAB>]' may not have the same effect if
-several possible entries begin with `g'. In that case `send-pr' cannot
-complete the entry because it cannot determine whether you mean `gcc'
-or, for example, `gdb', if both of those are possible categories.
-`send-pr' continues to prompt you for a valid entry until you enter one.
-
- `send-pr' prompts you interactively to enter each field for which
-there is a range of specific choices. If you attempt to enter a value
-which is not in the range of acceptable entries, `send-pr' responds
-with `[No match]' and allows you to change the entry until it contains
-an acceptable value. This avoids unusable information (at least in
-these fields) and also avoids typographical errors which could cause
-problems later.
-
- `send-pr' prompts you for the following fields:
-
- >Category:
- >Confidential: (*default*: no)
- >Severity: (*default*: serious)
- >Priority: (*default*: medium)
- >Class: (*default*: sw-bug)
- >Release:
- >Synopsis: (*this value is copied to `Subject:'*)
-
-After you complete these fields, `send-pr' places the cursor in the
-`>Description:' field and displays the message
-
- To send the problem report use: C-c C-c
-
-in the minibuffer. At this point, edit the file in the main buffer to
-reflect your specific problem, putting relevant information in the
-proper fields. *Note An Example::, for a sample Problem Report.
-
- `send-pr' provides a few key bindings to make moving around in a
-template buffer more simple:
-
-`C-c C-f'
-`M-x change-field'
- Changes the field under the cursor. `edit-pr' prompts you for a
- new value.
-
-`M-C-b'
-`M-x gnats-backward-field'
- Moves the cursor to the beginning of the value of the current
- field.
-
-`M-C-f'
-`M-x gnats-forward-field'
- Moves the cursor to the end of the value of the current field.
-
-`M-p'
-`M-x gnats-previous-field'
- Moves the cursor back one field to the beginning of the value of
- the previous field.
-
-`M-n'
-`M-x gnats-next-field'
- Moves the cursor forward one field to the beginning of the value
- of the next field.
-
- `send-pr' takes over again when you type `C-c C-c' to send the
-message. `send-pr' reports any errors in a separate buffer, which
-remains in existence until you send the PR properly (or, of course,
-until you explicitly kill the buffer).
-
- For detailed instructions on using Emacs, see *Note Introduction:
-(emacs)Introduction.
-
- ---------- Footnotes ----------
-
- (1) If typing `M-x send-pr' doesn't work, see your system
-administrator for help loading `send-pr' into Emacs.
-
-
-File: send-pr.info, Node: send-pr from the shell, Next: Helpful hints, Prev: send-pr in Emacs, Up: Invoking send-pr
-
-Invoking `send-pr' from the shell
-=================================
-
- send-pr [ SITE ]
- [ -f PROBLEM-REPORT | --file PROBLEM-REPORT ]
- [ -t MAIL-ADDRESS | --to MAIL-ADDRESS ]
- [ --request-id ]
- [ -L | --list ] [ -P | --print ]
- [ -V | --version] [ -h | --help ]
-
- SITE is an alias on your local machine which points to an address
-used by a Support Site. If this argument is not present, the default
-SITE is usually the site which you received `send-pr' from, or your
-local site if you use GNATS locally. (*Note Setting a default SITE:
-default site.)
-
- Invoking `send-pr' with no options calls the editor named in your
-environment variable `EDITOR' on a default PR template. If the
-environment variable `PR_FORM' is set, its value is used as a file name
-which contains a valid template. If `PR_FORM' points to a missing or
-unreadable file, or if the file is empty, `send-pr' generates an error
-message and opens the editor on a default template.
-
-`-f PROBLEM-REPORT'
-`--file PROBLEM-REPORT'
- Specifies a file, PROBLEM-REPORT, where a completed Problem Report
- already exists. `send-pr' sends the contents of the file without
- invoking an editor. If PROBLEM-REPORT is `-', `send-pr' reads
- from standard input.
-
-`-t MAIL-ADDRESS'
-`--to MAIL-ADDRESS'
- Sends the PR to MAIL-ADDRESS. The default is preset when `send-pr'
- is configured. *This option is not recommended*; instead, use the
- argument SITE on the command line.
-
-`--request-id'
- Sends a request for a `>Submitter-Id:' to the Support Site.
-
-`-L'
-
-`--list'
- Prints the list of valid `>Category:' values on standard output.
- No mail is sent.
-
-`-P'
-`--print'
- Displays the PR template. If the variable `PR_FORM' is set in your
- environment, the file it specifies is printed. If `PR_FORM' is not
- set, `send-pr' prints the standard blank form. If the file
- specified by `PR_FORM' doesn't exist, `send-pr' displays an error
- message. No mail is sent.
-
-`-V'
-`--version'
- Displays the `send-pr' version number and a usage summary. No mail
- is sent.
-
-`-h'
-`--help'
- Displays a usage summary for `send-pr'. No mail is sent.
-
-
-File: send-pr.info, Node: Helpful hints, Prev: send-pr from the shell, Up: Invoking send-pr
-
-Helpful hints
-=============
-
- There is no orthodox standard for submitting effective bug reports,
-though you might do well to consult the section on submitting bugs for
-GNU `gcc' in *Note Reporting Bugs: (gcc)Bugs, by Richard Stallman.
-This section contains instructions on what kinds of information to
-include and what kinds of mistakes to avoid.
-
- In general, common sense (assuming such an animal exists) dictates
-the kind of information that would be most helpful in tracking down and
-resolving problems in software.
- * Include anything *you* would want to know if you were looking at
- the report from the other end. There's no need to include every
- minute detail about your environment, although anything that might
- be different from someone else's environment should be included
- (your path, for instance).
-
- * Narratives are often useful, given a certain degree of restraint.
- If a person responsible for a bug can see that A was executed, and
- then B and then C, knowing that sequence of events might trigger
- the realization of an intermediate step that was missing, or an
- extra step that might have changed the environment enough to cause
- a visible problem. Again, restraint is always in order ("I set
- the build running, went to get a cup of coffee (Columbian, cream
- but no sugar), talked to Sheila on the phone, and then THIS
- happened...") but be sure to include anything relevant.
-
- * Richard Stallman writes, "The fundamental principle of reporting
- bugs usefully is this: *report all the facts*. If you are not sure
- whether to state a fact or leave it out, state it!" This holds
- true across all problem reporting systems, for computer software
- or social injustice or motorcycle maintenance. It is especially
- important in the software field due to the major differences
- seemingly insignificant changes can make (a changed variable, a
- missing semicolon, etc.).
-
- * Submit only *one* problem with each Problem Report. If you have
- multiple problems, use multiple PRs. This aids in tracking each
- problem and also in analyzing the problems associated with a given
- program.
-
- * It never hurts to do a little research to find out if the bug
- you've found has already been reported. Most software releases
- contain lists of known bugs in the Release Notes which come with
- the software; see your system administrator if you don't have a
- copy of these.
-
- * The more closely a PR adheres to the standard format, the less
- interaction is required by a database administrator to route the
- information to the proper place. Keep in mind that anything that
- requires human interaction also requires time that might be better
- spent in actually fixing the problem. It is therefore in
- everyone's best interest that the information contained in a PR be
- as correct as possible (in both format and content) at the time of
- submission.
-
-
-File: send-pr.info, Node: An Example, Next: Installing send-pr, Prev: Invoking send-pr, Up: Top
-
-An Example
-**********
-
- Cygnus Support in Mountain View, CA, uses GNATS and `send-pr'
-extensively for their support activities. As a support company, Cygnus
-finds problem tracking to be a crucial part of everyday business.
-Cygnus supports the GNU compiling tools (including GNATS and `send-pr')
-over several many platforms
-
- With each shipment of the Cygnus Support Developer's Kit, customers
-receive the latest version of `send-pr', which contains an up-to-date
-listing of valid categories (values for the `>Category:' field). Using
-these tools, Cygnus' customers can communicate their problems to Cygnus
-effectively and receive automatic confirmation of receipt as well as
-notification of changes in the status of their reported problems. Much
-of Cygnus' support mechanism relies on electronic mail.
-
- As an example, let's pretend we're a customer of Cygnus Support, and
-that we're having a problem compiling some of our software using the
-GNU C compiler, which Cygnus supports.
-
- Assume that we're getting an error in our `bifrabulator' program
-wherein the `prestidigitation' routines don't match with the
-`whatsitsname'. We've made sure we're following the rules of the
-program and checked the Release Notes from Cygnus and found that the bug
-isn't already known. In other words, we're pretty sure we've found a
-bug.
-
- Our first step is to call `send-pr'. It really doesn't matter
-whether we use `send-pr' from the shell or from within Emacs. Indeed,
-if we use Emacs as a primary editor, calling `send-pr' from the shell
-is likely to start `send-pr' in an Emacs buffer anyway. So, since our
-company, *Imaginary Software, Ltd.*, uses GNU software extensively,
-we're pretty familiar with Emacs, so from within Emacs we type
- M-x send-pr
-
-and we're greeted with the following screen:
-
- SEND-PR: -*- text -*-
- SEND-PR: Lines starting with `SEND-PR' will be removed
- SEND-PR: automatically as well as all comments (the text
- SEND-PR: below enclosed in `<' and `>').
- SEND-PR: Please consult the manual if you are not sure
- SEND-PR: how to fill out a problem report.
- SEND-PR:
- SEND-PR: Choose from the following categories:
- SEND-PR:
- SEND-PR: bfd binutils bison
- SEND-PR: byacc clib config cvs diff
- SEND-PR: doc emacs flex g++ gas
- SEND-PR: gcc gdb glob gprof grep
- SEND-PR: info ispell kerberos ld libg++
- SEND-PR: libiberty make makeinfo mas newlib
- SEND-PR: other patch rcs readline send-pr
- SEND-PR: test texindex texinfo texinfo.tex
- SEND-PR: bifrabulator <---*note: this one is fake*
- SEND-PR:
- To: cygnus-bugs@cygnus.com
- Subject:
- From: jeffrey@imaginary.com
- Reply-To: jeffrey@imaginary.com
- X-send-pr-version: send-pr 3.95
-
- >Submitter-Id: imaginary
- >Originator: Jeffrey Osier
- >Organization:
- Imaginary Software, Ltd.
- >Confidential: <[ no | yes ] (one line)>
- >Synopsis: <synopsis of the problem (one line)>
- >Severity: <[ non-critical | serious | critical ] (one line)>
- >Priority: <[ low | medium | high ] (one line)>
- >Category: <name of the product (one line)>
- >Class: <[sw-bug|doc-bug|change-request|support](oneline)>
- >Release: <release number or tag (one line)>
- >Environment:
- <machine, os, target, libraries (multiple lines)>
- System: SunOS imaginary.com 4.1.1 1 sun4
- Architecture: sun4
-
- >Description:
- <precise description of the problem (multiple lines)>
- >How-To-Repeat:
- <code/input/activities to reproduce (multiple lines)>
- >Fix:
- -----Emacs: *send-pr* (send-pr Fill)----All------------------
- >Category: other[]
-
- We know from past experience that we need to set certain information
-into each field, so we compile all the information we know about our
-problem. We have some sample code which we know should work, even
-though it doesn't, so we'll include that. Below is the completed PR;
-we send this using `C-c C-c'. (The comments have been truncated).
-
- SEND-PR: Lines starting with `SEND-PR' will be removed
- SEND-PR: automatically as well as all comments (the text
- SEND-PR: ...
- SEND-PR:
- To: cygnus-bugs@cygnus.com
- Subject: bifrabulator routines don't match
- From: jeffrey@imaginary.com
- Reply-To: jeffrey@imaginary.com
- X-send-pr-version: send-pr 3.95
-
- >Submitter-Id: imaginary
- >Originator: Jeffrey Osier
- >Organization:
- Imaginary Software, Ltd.
- >Confidential: no
- >Synopsis: bifrabulator routines don't match
- >Severity: serious
- >Priority: medium
- >Category: bifrabulator
- >Class: sw-bug
- >Release: progressive-930101
- >Environment:
- System: SunOS imaginary.com 4.1.1 1 sun4
- Architecture: sun4 (SPARC)
-
- >Description:
- the following code I fed into the bifrabulator came back
- with a strange error. apparently, the prestidigitation
- routine doesn't match with the whatsitsname in all cases.
-
- >How-To-Repeat:
- call the bifrabulator on the following code.
- *code sample...*
-
- >Fix:
- -----Emacs: *send-pr* (send-pr Fill)----All------------------
- To send the problem report use: C-c C-c
-
- We type `C-c C-c', and off it goes. Now, we depend on Cygnus
-Support to figure out the answer to our problem.
-
- Soon afterward, we get the following message from Cygnus:
-
- From: gnats (GNATS management)
- Sender: gnats-admin
- Reply-To: hacker@cygnus.com
- To: jeffrey@imaginary.com
- Subject: Re: bifrabulator/1425: routines don't match
-
- Thank you very much for your problem report.
- It has the internal identification: g++/1425.
- The individual assigned to look at your bug is: hacker
- (F.B. Hacker)
-
- Category: bifrabulator
- Responsible: hacker
- Synopsis: bifrabulator routines don't match
- Arrival-Date: Sat Feb 30 03:12:55 1993
-
-This is our receipt that the bug has been accepted and forwarded to the
-responsible party.
-
-A while later, we get the analysis:
-
- To: jeffrey@imaginary.com
- From: hacker@cygnus.com
- Subject: Re: bifrabulator/1425: routines don't match
- Reply-To: hacker@cygnus.com
-
- Got your message, Jeff. It seems that the bifrabulator was
- confusing the prestidigitation routines with the realitychecker
- when lexically parsing the whatsitsname.
-
- I'm working on robustisizing the bifrabulator now.
-
- How about lunch next week?
- --
- F.B. Hacker
- Cygnus Support, Mountain View, CA 415 903 1400
- #include <std-disclaimer.h>
-
-About the same time, we get another message from Cygnus.
-
- From: hacker@cygnus.com
- To: jeffrey@imaginary.com
- Subject: Re: bifrabulator/1425: doesn't match prestidig
- Reply-To: hacker@cygnus.com
-
-
- `F.B. Hacker' changed the state to `analyzed'.
-
- State-Changed-From-To: open-analyzed
- State-Changed-By: hacker
- State-Changed-When: Fri Feb 31 1993 08:59:16 1993
- State-Changed-Why:
- figured out the problem, working on a patch this afternoon
- --
- F.B. Hacker
- Cygnus Support, Mountain View, CA 415 903 1400
- #include <std-disclaimer.h>
-
-The bug has now been analyzed, and Cygnus is working on a solution.
-
-Sometime later, we get more mail from F.B.:
-
- To: jeffrey@imaginary.com
- From: hacker@cygnus.com
- Subject: Re: bifrabulator/1425: routines don't match
- Reply-To: hacker@cygnus.com
-
- There's a patch now that you can ftp over and check out.
-
- Hey, that joke you sent me was great! The one about the
- strings walking into a bar... my boss laughed for an hour!
- --
- F.B. Hacker
- Cygnus Support, Mountain View, CA 415 903 1400
- #include <std-disclaimer.h>
-
- From: hacker@cygnus.com
- To: jeffrey@imaginary.com
- Subject: Re: bifrabulator/1425: doesn't match prestidig
- Reply-To: hacker@cygnus.com
-
-
- `F.B. Hacker' changed the state to `feedback'.
-
- State-Changed-From-To: analyzed-feedback
- State-Changed-By: hacker
- State-Changed-When: Fri Feb 31 1993 23:43:16 1993
- State-Changed-Why:
- got the patch finished, notified Jeff at Imaginary Software
- --
- F.B. Hacker
- Cygnus Support, Mountain View, CA 415 903 1400
- #include <std-disclaimer.h>
-
-The bug has gone into "feedback" status now, until we get the patch,
-install it and test it. When everything tests well, we can mail F.B.
-back and tell him the bug's been fixed, and he can change the state of
-the PR from "feedback" to "closed".
-
- Following is a list of valid `>Category:' entries that are supported
-by Cygnus.
-
-* Menu:
-
-* Valid Categories::
-
-
-File: send-pr.info, Node: Valid Categories, Up: An Example
-
-Valid Categories
-================
-
-`bfd'
- GNU binary file descriptor library.
-
-`bifrabulator'
- This one doesn't actually exist.
-
-`binutils'
- GNU utilities for binary files (`ar', `nm', `size'...).
-
-`bison'
- GNU parser generator.
-
-`byacc'
- Free parser generator.
-
-`config'
- Cygnus Support Software configuration and installation.
-
-`cvs'
- Concurrent Version System.
-
-`diff'
- GNU `diff' program.
-
-`doc'
- Documentation and manuals.
-
-`emacs'
- GNU Emacs editor and related functions.
-
-`flex'
- GNU lexical analyzer.
-
-`g++'
- GNU C++ compiler.
-
-`gas'
- GNU assembler.
-
-`gcc'
- GNU C compiler.
-
-`gdb'
- GNU source code debugger.
-
-`glob'
- The filename globbing functions.
-
-`gprof'
- GNU profiler.
-
-`grep'
- GNU `grep' program.
-
-`info'
- GNU `info' hypertext reader.
-
-`ispell'
- GNU spelling checker.
-
-`kerberos'
- Kerberos authentication system.
-
-`ld'
- GNU linker.
-
-`libc'
- Cygnus Support C Support Library.
-
-`libg++'
- GNU C++ class library.
-
-`libiberty'
- GNU `libiberty' library.
-
-`libm'
- Cygnus Support C Math Library.
-
-`make'
- GNU `make' program.
-
-`makeinfo'
- GNU utility to build Info files from Texinfo documents.
-
-`mas'
- GNU Motorola syntax assembler.
-
-`newlib'
- Cygnus Support C Support and Math Libraries.
-
-`patch'
- GNU bug patch program.
-
-`gnats'
- GNU Problem Report Management System.
-
-`rcs'
- Revision Control System.
-
-`readline'
- GNU `readline' library.
-
-`send-pr'
- GNU Problem Report submitting program.
-
-`test'
- Category to use when testing `send-pr'.
-
-`texindex'
- GNU documentation indexing utility.
-
-`texinfo'
- GNU documentation macros.
-
-`other'
- Anything which is not covered by the above categories.
-
-
-File: send-pr.info, Node: Installing send-pr, Next: Index, Prev: An Example, Up: Top
-
-Installing `send-pr' on your system
-***********************************
-
- If you receive `send-pr' as part of a larger software distribution,
-it probably gets installed when the full distribution is installed. If
-you are using GNATS at your site as well, you must decide where
-`send-pr' sends Problem Reports by default; see *Note Setting a default
-SITE: default site.
-
-* Menu:
-
-* installation:: installing `send-pr' by itself
-* default site:: setting a default site
-
-
-File: send-pr.info, Node: installation, Next: default site, Up: Installing send-pr
-
-Installing `send-pr' by itself
-==============================
-
- Install `send-pr' by following these steps (you may need `root'
-access in order to change the `aliases' file and to install `send-pr'):
-
- * Unpack the distribution into a directory which we refer to as
- SRCDIR.
-
- * Edit the file `Makefile' to reflect local conventions.
- Specifically, you should edit the variable `prefix' to alter the
- installation location. The default is `/usr/local'. All files are
- installed under `prefix' (see below).
-
- * *Run*
- make all install [ info ] [ install-info ] [ clean ]
-
- The targets mean the following:
-
- `all'
- Builds `send-pr' and `install-sid'
-
- `install'
- Installs the following:
-
- `install-sid'
- `send-pr'
- into `PREFIX/bin'
-
- `send-pr.1'
- into `PREFIX/man/man1'
-
- `SITE'
- the list of valid CATEGORIES for the Support Site from
- which you received `send-pr', installed as
- `PREFIX/lib/gnats/SITE'
-
- `send-pr.el'
- into `PREFIX/lib/emacs/lisp'(1)
-
- `info (*optional*)'
- Builds `send-pr.info' from `send-pr.texi'
- (`send-pr.info' is included with this distribution)
-
- `install-info (*optional*)'
- Installs `send-pr.info' into `PREFIX/info'
-
- `clean (*optional*)'
- Removes all intermediary build files that can be rebuilt from
- source code
-
- * Run
-
- install-sid YOUR-SID
-
- where YOUR-SID is the identification code you received with
- `send-pr'. `send-pr' automatically inserts this value into the
- template field `>Submitter-Id:'. If you've downloaded `send-pr'
- from the Net, use `net' for this value.
-
- * Place the following line in `PREFIX/lib/emacs/lisp/default.el', or
- instruct your users to place the following line in their `.emacs'
- files:
-
- (autoload 'send-pr "send-pr" "Submit a Problem Report." t)
-
- * Create a mail alias for the Support Site from which you received
- `send-pr', and for every site with which you wish to use `send-pr'
- to communicate. Each alias must have a suffix of `-gnats'. The
- Support Site(s) will provide the correct addresses where these
- aliases should point. For instance, edit your mail aliases file
- to contain something like:
-
- # support sites; for use with send-pr
- cygnus-gnats: bugs@cygnus.com # Cygnus Support
- bumblebee-gnats: bumblebugs@bumblebee.com # Bumblebee Inc.
- mycompany-gnats: bugs@my.company.com (*if you use GNATS locally*)
-
- `send-pr' automatically searches for these aliases when you type
-
- send-pr cygnus
- send-pr bumblebee
- send-pr SITE...
-
- `send-pr' also uses SITE to determine the categories of problems
- accepted by the site in question by looking in
-
- PREFIX/lib/gnats/SITE
-
- ---------- Footnotes ----------
-
- (1) If your main Emacs lisp repository is in a different directory
-from this, substitute that directory for `PREFIX/lib/emacs/lisp'.
-
-
-File: send-pr.info, Node: default site, Prev: installation, Up: Installing send-pr
-
-Setting a default SITE
-======================
-
- `send-pr' is capable of sending Problem Reports to any number of
-Support Sites, using mail aliases which have `-gnats' appended them.
-`send-pr' automatically appends the suffix, so that when you type
-
- send-pr SITE
-
-the Problem Report goes to the address noted in the `aliases' file as
-`SITE-gnats'. You can do this in the Emacs version of `send-pr' by
-invoking the program with
-
- C-u M-x send-pr
-
-You are prompted for SITE.
-
- SITE is also used to error-check the `>Category:' field, as a
-precaution against sending mistaken information (and against sending
-information to the wrong site).
-
- You may also simply type
-
- send-pr
-
-from the shell (or `M-x send-pr' in Emacs), and the Problem Report you
-generate will be sent to the SITE, which is usually the site from which
-you received your distribution of `send-pr'. If you use GNATS at your
-own organization, the default is usually your local address for
-reporting problems.
-
- To change this, simply edit the file `Makefile' before installing
-and change the line
-
- GNATS_SITE = SITE
-
-to reflect the site where you wish to send PRs by default.
-
-
-File: send-pr.info, Node: Index, Prev: Installing send-pr, Up: Top
-
-Index
-*****
-
-* Menu:
-
-* *analyzed* state: States.
-* *change-request* class: Problem Report fields.
-* *closed* state: States.
-* *critical* severity problems: Problem Report fields.
-* *doc-bug* class: Problem Report fields.
-* *duplicate* class: Problem Report fields.
-* *Enumerated* data types: Fields.
-* *feedback* state: States.
-* *high* priority problems: Problem Report fields.
-* *low* priority problems: Problem Report fields.
-* *medium* priority problems: Problem Report fields.
-* *MultiText* data types: Fields.
-* *non-critical* severity problems: Problem Report fields.
-* *open* state: States.
-* *serious* severity problems: Problem Report fields.
-* *support* class: Problem Report fields.
-* *suspended* state: States.
-* *sw-bug* class: Problem Report fields.
-* *Text* data types: Fields.
-* >Arrival-Date:: Problem Report fields.
-* >Audit-Trail:: Problem Report fields.
-* >Category:: Problem Report fields.
-* >Class:: Problem Report fields.
-* >Confidential:: Problem Report fields.
-* >Description:: Problem Report fields.
-* >Environment:: Problem Report fields.
-* >Fix:: Problem Report fields.
-* >How-To-Repeat:: Problem Report fields.
-* >Number:: Problem Report fields.
-* >Organization:: Problem Report fields.
-* >Originator:: Problem Report fields.
-* >Priority:: Problem Report fields.
-* >Release:: Problem Report fields.
-* >Responsible:: Problem Report fields.
-* >Severity:: Problem Report fields.
-* >State:: Problem Report fields.
-* >Submitter-Id: <1>: Problem Report fields.
-* >Submitter-Id:: using send-pr.
-* >Synopsis:: Problem Report fields.
-* >Unformatted:: Problem Report fields.
-* an example: An Example.
-* appending PRs <1>: using send-pr.
-* appending PRs: Problem Report fields.
-* Arrival-Date field: Problem Report fields.
-* Audit-Trail field: Problem Report fields.
-* automatic notification: States.
-* bad Problem Reports: using send-pr.
-* bifrabulator: An Example.
-* blank PR template: An Example.
-* Category field: Problem Report fields.
-* Class field: Problem Report fields.
-* command line options: send-pr from the shell.
-* comment section in the PR template: using send-pr.
-* completed Problem Report: An Example.
-* completion in Emacs: send-pr in Emacs.
-* Confidential field: Problem Report fields.
-* confidentiality in PRs: Problem Report fields.
-* Cygnus Support: An Example.
-* database similarities: Fields.
-* default PR template: An Example.
-* default SITE: default site.
-* Description field: Problem Report fields.
-* details about send-pr: send-pr in detail.
-* editing and sending PRs: Invoking send-pr.
-* effective problem reporting: Helpful hints.
-* Emacs: send-pr in Emacs.
-* Environment field: Problem Report fields.
-* errors: using send-pr.
-* example of a completed PR: An Example.
-* example of a default template: An Example.
-* example of a list of valid categories: Valid Categories.
-* example of a state change: An Example.
-* example PR: An Example.
-* example Problem Report: Fields.
-* field format: Problem Report fields.
-* fields: Fields.
-* fields - list: Problem Report fields.
-* final state ("closed"): States.
-* Fix field: Problem Report fields.
-* foreword to send-pr: Top.
-* format: Fields.
-* From: header: Mail header fields.
-* generating new PRs: Invoking send-pr.
-* GNATS: Top.
-* GNATS database fields: Problem Report fields.
-* GNATS fields - list: Problem Report fields.
-* GNU software support: An Example.
-* helpful hints: Helpful hints.
-* How-To-Repeat field: Problem Report fields.
-* Imaginary Software, Ltd.: An Example.
-* information to submit: Helpful hints.
-* initial state ("open"): States.
-* installation: Installing send-pr.
-* installation procedure: installation.
-* interactive interface: send-pr in Emacs.
-* Internet standard RFC-822: Mail header fields.
-* introduction to send-pr: Top.
-* invalid Problem Reports: using send-pr.
-* invoking send-pr: Invoking send-pr.
-* invoking send-pr from Emacs: send-pr in Emacs.
-* invoking send-pr from the shell: send-pr from the shell.
-* kinds of helpful information: Helpful hints.
-* life-cycle of a Problem Report: States.
-* listing valid categories: send-pr from the shell.
-* mail header fields: Mail header fields.
-* mail header section: using send-pr.
-* name completion in Emacs: send-pr in Emacs.
-* Number field: Problem Report fields.
-* Organization field: Problem Report fields.
-* Originator field: Problem Report fields.
-* other mail <1>: Problem Report fields.
-* other mail: using send-pr.
-* overview to send-pr: Top.
-* PR confidentiality: Problem Report fields.
-* Priority field: Problem Report fields.
-* Problem Report data types: Fields.
-* Problem Report format: Fields.
-* Problem Report states: States.
-* Problem Report template: Fields.
-* Problem Reports: send-pr in detail.
-* related mail <1>: Problem Report fields.
-* related mail: using send-pr.
-* Release field: Problem Report fields.
-* Reply-To: header: Mail header fields.
-* Report all the facts!: Helpful hints.
-* Responsible field: Problem Report fields.
-* Responsible-Changed-<From>-<To>: in >Audit-Trail:: Problem Report fields.
-* Responsible-Changed-By: in >Audit-Trail:: Problem Report fields.
-* Responsible-Changed-When: in >Audit-Trail:: Problem Report fields.
-* Responsible-Changed-Why: in >Audit-Trail:: Problem Report fields.
-* sample Problem Report: Fields.
-* saving related mail <1>: using send-pr.
-* saving related mail: Problem Report fields.
-* send-pr fields: using send-pr.
-* send-pr within Emacs: send-pr in Emacs.
-* sending PRs: Invoking send-pr.
-* setting a default SITE: default site.
-* Severity field: Problem Report fields.
-* shell invocation: send-pr from the shell.
-* state change example: An Example.
-* State field: Problem Report fields.
-* state--"analyzed": States.
-* state--"closed": States.
-* state--"feedback": States.
-* state--"open": States.
-* state--"suspended": States.
-* State-Changed-<From>-<To>: in >Audit-Trail:: Problem Report fields.
-* State-Changed-By: in >Audit-Trail:: Problem Report fields.
-* State-Changed-When: in >Audit-Trail:: Problem Report fields.
-* State-Changed-Why: in >Audit-Trail:: Problem Report fields.
-* states of Problem Reports: States.
-* Subject: header: Mail header fields.
-* Submitter-Id field <1>: using send-pr.
-* Submitter-Id field: Problem Report fields.
-* subsequent mail <1>: Problem Report fields.
-* subsequent mail: using send-pr.
-* Synopsis field: Problem Report fields.
-* template: using send-pr.
-* template comment section: using send-pr.
-* To: header: Mail header fields.
-* Unformatted field: Problem Report fields.
-* Using and Porting GNU CC: Helpful hints.
-* using send-pr: Invoking send-pr.
-* using send-pr from within Emacs: send-pr in Emacs.
-* valid categories: Valid Categories.
-
-
-
-Tag Table:
-Node: Top868
-Node: send-pr in detail2879
-Node: States3718
-Node: Fields5150
-Node: Mail header fields8819
-Node: Problem Report fields9684
-Node: Invoking send-pr17073
-Node: using send-pr17530
-Node: send-pr in Emacs24538
-Node: send-pr from the shell28948
-Node: Helpful hints31296
-Node: An Example34401
-Node: Valid Categories43503
-Node: Installing send-pr45322
-Node: installation45889
-Node: default site49113
-Node: Index50370
-
-End Tag Table
diff --git a/usr.sbin/afs/src/tools/gnats/send-pr.sh b/usr.sbin/afs/src/tools/gnats/send-pr.sh
deleted file mode 100644
index 90aef7da6fb..00000000000
--- a/usr.sbin/afs/src/tools/gnats/send-pr.sh
+++ /dev/null
@@ -1,553 +0,0 @@
-#!/bin/sh
-# Submit a problem report to a GNATS site.
-# Copyright (C) 1993 Free Software Foundation, Inc.
-# Contributed by Brendan Kehoe (brendan@cygnus.com), based on a
-# version written by Heinz G. Seidl (hgs@cygnus.com).
-#
-# This file is part of GNU GNATS.
-#
-# GNU GNATS is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# GNU GNATS is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU GNATS; see the file COPYING. If not, write to
-# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# The version of this send-pr.
-VERSION=3.113.1
-
-# The submitter-id for your site.
-SUBMITTER=@SUBMITTER@
-
-# Where the GNATS directory lives, if at all.
-[ -z "$GNATS_ROOT" ] &&
-GNATS_ROOT=
-
-# The default mail address for PR submissions.
-GNATS_ADDR=bugs@stacken.kth.se
-
-# Where the gnats category tree lives.
-DATADIR=@DATADIR@
-
-# If we've been moved around, try using GCC_EXEC_PREFIX.
-[ ! -d $DATADIR/gnats -a -d "$GCC_EXEC_PREFIX" ] &&
- DATADIR=@DATADIR@
-
-
-# The default release for this host.
-DEFAULT_RELEASE="@DEFAULT_RELEASE@"
-
-# The default organization.
-DEFAULT_ORGANIZATION=
-
-# The default site to look for.
-GNATS_SITE=stacken
-
-# Newer config information?
-[ -f ${GNATS_ROOT}/gnats-adm/config ] && . ${GNATS_ROOT}/gnats-adm/config
-
-# What mailer to use. This must come after the config file, since it is
-# host-dependent.
-MAIL_AGENT="/usr/sbin/sendmail -oi -t"
-
-# How to read the passwd database.
-PASSWD="cat /etc/passwd"
-
-ECHON=bsd
-
-if [ $ECHON = bsd ] ; then
- ECHON1="echo -n"
- ECHON2=
-elif [ $ECHON = sysv ] ; then
- ECHON1=echo
- ECHON2='\c'
-else
- ECHON1=echo
- ECHON2=
-fi
-
-#
-
-if [ -z "$TMPDIR" ]; then
- TMPDIR=/tmp
-else
- if [ "`echo $TMPDIR | grep '/$'`" != "" ]; then
- TMPDIR="`echo $TMPDIR | sed -e 's,/$,,'`"
- fi
-fi
-
-TEMP=$TMPDIR/p$$
-BAD=$TMPDIR/pbad$$
-REF=$TMPDIR/pf$$
-
-# find a user name
-if [ "$LOGNAME" = "" ]; then
- if [ "$USER" != "" ]; then
- LOGNAME="$USER"
- else
- LOGNAME="UNKNOWN"
- fi
-fi
-
-FROM="$LOGNAME"
-REPLY_TO="${REPLY_TO:-${REPLYTO:-$LOGNAME}}"
-
-# Find out the name of the originator of this PR.
-if [ -n "$NAME" ]; then
- ORIGINATOR="$NAME"
-elif [ -f $HOME/.fullname ]; then
- ORIGINATOR="`sed -e '1q' $HOME/.fullname`"
-else
- # Must use temp file due to incompatibilities in quoting behavior
- # and to protect shell metacharacters in the expansion of $LOGNAME
- $PASSWD | grep "^$LOGNAME:" | awk -F: '{print $5}' | sed -e 's/,.*//' > $TEMP
- ORIGINATOR="`cat $TEMP`"
- rm -f $TEMP
-fi
-
-if [ -n "$ORGANIZATION" ]; then
- if [ -f "$ORGANIZATION" ]; then
- ORGANIZATION="`cat $ORGANIZATION`"
- fi
-else
- if [ -n "$DEFAULT_ORGANIZATION" ]; then
- ORGANIZATION="$DEFAULT_ORGANIZATION"
- elif [ -f $HOME/.organization ]; then
- ORGANIZATION="`cat $HOME/.organization`"
- fi
-fi
-
-# If they don't have a preferred editor set, then use
-if [ -z "$VISUAL" ]; then
- if [ -z "$EDITOR" ]; then
- EDIT=vi
- else
- EDIT="$EDITOR"
- fi
-else
- EDIT="$VISUAL"
-fi
-
-# Find out some information.
-SYSTEM=`( [ -f /bin/uname ] && /bin/uname -a ) || \
- ( [ -f /usr/bin/uname ] && /usr/bin/uname -a ) || echo ""`
-ARCH=`[ -f /bin/arch ] && /bin/arch`
-MACHINE=`[ -f /bin/machine ] && /bin/machine`
-
-COMMAND=`echo $0 | sed -e 's,.*/,,'`
-USAGE="Usage: $COMMAND [-PVL] [-t address] [-f filename] [-s severity]
- [-c address] [--request-id] [--version]"
-REMOVE=
-BATCH=
-CC=
-SEVERITY_C=
-
-while [ $# -gt 0 ]; do
- case "$1" in
- -r) ;; # Ignore for backward compat.
- -t | --to) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
- shift ; GNATS_ADDR="$1"
- EXPLICIT_GNATS_ADDR=true
- ;;
- -f | --file) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
- shift ; IN_FILE="$1"
- if [ "$IN_FILE" != "-" -a ! -r "$IN_FILE" ]; then
- echo "$COMMAND: cannot read $IN_FILE"
- exit 1
- fi
- ;;
- -b | --batch) BATCH=true ;;
- -c | --cc) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
- shift ; CC="$1"
- ;;
- -s | --severity) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
- shift ; SEVERITY_C="$1"
- ;;
- -p | -P | --print) PRINT=true ;;
- -L | --list) FORMAT=norm ;;
- -l | -CL | --lisp) FORMAT=lisp ;;
- --request-id) REQUEST_ID=true ;;
- -h | --help) echo "$USAGE"; exit 0 ;;
- -V | --version) echo "$VERSION"; exit 0 ;;
- -*) echo "$USAGE" ; exit 1 ;;
- *) if [ -z "$USER_GNATS_SITE" ]; then
- if [ ! -r "$DATADIR/gnats/$1" ]; then
- echo "$COMMAND: the GNATS site $1 does not have a categories list."
- exit 1
- else
- # The site name is the alias they'll have to have created.
- USER_GNATS_SITE=$1
- fi
- else
- echo "$USAGE" ; exit 1
- fi
- ;;
- esac
- shift
-done
-
-if [ -n "$USER_GNATS_SITE" ] && [ "$USER_GNATS_SITE" != "$GNATS_SITE" ]; then
- GNATS_SITE=$USER_GNATS_SITE
- GNATS_ADDR=$USER_GNATS_SITE-gnats
-fi
-
-if [ "$SUBMITTER" = "unknown" -a -z "$REQUEST_ID" -a -z "$IN_FILE" ]; then
- cat << '__EOF__'
-It seems that send-pr is not installed with your unique submitter-id.
-You need to run
-
- install-sid YOUR-SID
-
-where YOUR-SID is the identification code you received with `send-pr'.
-`send-pr' will automatically insert this value into the template field
-`>Submitter-Id'. If you've downloaded `send-pr' from the Net, use `net'
-for this value. If you do not know your id, run `send-pr --request-id' to
-get one from your support site.
-__EOF__
- exit 1
-fi
-
-if [ -r "$DATADIR/gnats/$GNATS_SITE" ]; then
- CATEGORIES=`grep -v '^#' $DATADIR/gnats/$GNATS_SITE | sort`
-else
- echo "$COMMAND: could not read $DATADIR/gnats/$GNATS_SITE for categories list."
- exit 1
-fi
-
-if [ -z "$CATEGORIES" ]; then
- echo "$COMMAND: the categories list for $GNATS_SITE was empty!"
- exit 1
-fi
-
-case "$FORMAT" in
- lisp) echo "$CATEGORIES" | \
- awk 'BEGIN {printf "( "} {printf "(\"%s\") ",$0} END {printf ")\n"}'
- exit 0
- ;;
- norm) l=`echo "$CATEGORIES" | \
- awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } }
- END {print max + 1;}'`
- c=`expr 70 / $l`
- if [ $c -eq 0 ]; then c=1; fi
- echo "$CATEGORIES" | \
- awk 'BEGIN {print "Known categories:"; i = 0 }
- { printf ("%-'$l'.'$l's", $0); if ((++i % '$c') == 0) { print "" } }
- END { print ""; }'
- exit 0
- ;;
-esac
-
-ORIGINATOR_C='<name of the PR author (one line)>'
-ORGANIZATION_C='<organization of PR author (multiple lines)>'
-CONFIDENTIAL_C='<[ yes | no ] (one line)>'
-SYNOPSIS_C='<synopsis of the problem (one line)>'
-if [ -z "$SEVERITY_C" ]; then
- SEVERITY_C='<[ non-critical | serious | critical ] (one line)>'
-fi
-PRIORITY_C='<[ low | medium | high ] (one line)>'
-CATEGORY_C='<choose from the list of categories above (one line)>'
-CLASS_C='<[ sw-bug | doc-bug | change-request | support ] (one line)>'
-RELEASE_C='<release number or tag (one line)>'
-ENVIRONMENT_C='<machine, os, target, libraries (multiple lines)>'
-DESCRIPTION_C='<precise description of the problem (multiple lines)>'
-HOW_TO_REPEAT_C='<code/input/activities to reproduce the problem (multiple lines)>'
-FIX_C='<how to correct or work around the problem, if known (multiple lines)>'
-
-# Catch some signals. ($xs kludge needed by Sun /bin/sh)
-xs=0
-trap 'rm -f $REF $TEMP; exit $xs' 0
-trap 'echo "$COMMAND: Aborting ..."; rm -f $REF $TEMP; xs=1; exit' 1 3 13 15
-
-# If they told us to use a specific file, then do so.
-if [ -n "$IN_FILE" ]; then
- if [ "$IN_FILE" = "-" ]; then
- # The PR is coming from the standard input.
- if [ -n "$EXPLICIT_GNATS_ADDR" ]; then
- sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" > $TEMP
- else
- cat > $TEMP
- fi
- else
- # Use the file they named.
- if [ -n "$EXPLICIT_GNATS_ADDR" ]; then
- sed -e "s;^[Tt][Oo]:.*;To: $GNATS_ADDR;" $IN_FILE > $TEMP
- else
- cat $IN_FILE > $TEMP
- fi
- fi
-else
-
- if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
- # If their PR_FORM points to a bogus entry, then bail.
- if [ ! -f "$PR_FORM" -o ! -r "$PR_FORM" -o ! -s "$PR_FORM" ]; then
- echo "$COMMAND: can't seem to read your template file (\`$PR_FORM'), ignoring PR_FORM"
- sleep 1
- PRINT_INTERN=bad_prform
- fi
- fi
-
- if [ -n "$PR_FORM" -a -z "$PRINT_INTERN" ]; then
- cp $PR_FORM $TEMP ||
- ( echo "$COMMAND: could not copy $PR_FORM" ; xs=1; exit )
- else
- for file in $TEMP $REF ; do
- cat > $file << '__EOF__'
-SEND-PR: -*- send-pr -*-
-SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as
-SEND-PR: will all comments (text enclosed in `<' and `>').
-SEND-PR:
-SEND-PR: Please consult the send-pr man page `send-pr(1)' or the Texinfo
-SEND-PR: manual if you are not sure how to fill out a problem report.
-SEND-PR: Note that the Synopsis field is mandatory. The Subject (for
-SEND-PR: the mail) will be made the same as Synopsis unless explicitly
-SEND-PR: changed.
-SEND-PR:
-SEND-PR: Choose from the following categories:
-SEND-PR:
-__EOF__
-
- # Format the categories so they fit onto lines.
- l=`echo "$CATEGORIES" | \
- awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } }
- END {print max + 1;}'`
- c=`expr 61 / $l`
- if [ $c -eq 0 ]; then c=1; fi
- echo "$CATEGORIES" | \
- awk 'BEGIN {printf "SEND-PR: "; i = 0 }
- { printf ("%-'$l'.'$l's", $0);
- if ((++i % '$c') == 0) { printf "\nSEND-PR: " } }
- END { printf "\nSEND-PR:\n"; }' >> $file
-
- cat >> $file << __EOF__
-To: $GNATS_ADDR
-Subject:
-From: $FROM
-Reply-To: $REPLYTO
-Cc: $CC
-X-send-pr-version: $VERSION
-X-GNATS-Notify:
-
-
->Submitter-Id: $SUBMITTER
->Originator: $ORIGINATOR
->Organization: ${ORGANIZATION-$ORGANIZATION_C}
->Confidential: $CONFIDENTIAL_C
->Synopsis: $SYNOPSIS_C
->Severity: $SEVERITY_C
->Priority: $PRIORITY_C
->Category: $CATEGORY_C
->Class: $CLASS_C
->Release: ${DEFAULT_RELEASE-$RELEASE_C}
->Environment:
-`[ -n "$SYSTEM" ] && echo System: $SYSTEM`
-`[ -n "$ARCH" ] && echo Architecture: $ARCH`
-`[ -n "$MACHINE" ] && echo Machine: $MACHINE`
- $ENVIRONMENT_C
->Description:
- $DESCRIPTION_C
->How-To-Repeat:
- $HOW_TO_REPEAT_C
->Fix:
- $FIX_C
-__EOF__
- done
- fi
-
- if [ "$PRINT" = true -o "$PRINT_INTERN" = true ]; then
- cat $TEMP
- xs=0; exit
- fi
-
- chmod u+w $TEMP
- if [ -z "$REQUEST_ID" ]; then
- eval $EDIT $TEMP
- else
- ed -s $TEMP << '__EOF__'
-/^Subject/s/^Subject:.*/Subject: request for a customer id/
-/^>Category/s/^>Category:.*/>Category: send-pr/
-w
-q
-__EOF__
- fi
-
- if cmp -s $REF $TEMP ; then
- echo "$COMMAND: problem report not filled out, therefore not sent"
- xs=1; exit
- fi
-fi
-
-#
-# Check the enumeration fields
-
-# This is a "sed-subroutine" with one keyword parameter
-# (with workaround for Sun sed bug)
-#
-SED_CMD='
-/$PATTERN/{
-s|||
-s|<.*>||
-s|^[ ]*||
-s|[ ]*$||
-p
-q
-}'
-
-
-while [ -z "$REQUEST_ID" ]; do
- CNT=0
-
- # 1) Confidential
- #
- PATTERN=">Confidential:"
- CONFIDENTIAL=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
- case "$CONFIDENTIAL" in
- ""|yes|no) CNT=`expr $CNT + 1` ;;
- *) echo "$COMMAND: \`$CONFIDENTIAL' is not a valid value for \`Confidential'." ;;
- esac
- #
- # 2) Severity
- #
- PATTERN=">Severity:"
- SEVERITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
- case "$SEVERITY" in
- ""|non-critical|serious|critical) CNT=`expr $CNT + 1` ;;
- *) echo "$COMMAND: \`$SEVERITY' is not a valid value for \`Severity'."
- esac
- #
- # 3) Priority
- #
- PATTERN=">Priority:"
- PRIORITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
- case "$PRIORITY" in
- ""|low|medium|high) CNT=`expr $CNT + 1` ;;
- *) echo "$COMMAND: \`$PRIORITY' is not a valid value for \`Priority'."
- esac
- #
- # 4) Category
- #
- PATTERN=">Category:"
- CATEGORY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
- FOUND=
- for C in $CATEGORIES
- do
- if [ "$C" = "$CATEGORY" ]; then FOUND=true ; break ; fi
- done
- if [ -n "$FOUND" ]; then
- CNT=`expr $CNT + 1`
- else
- if [ -z "$CATEGORY" ]; then
- echo "$COMMAND: you must include a Category: field in your report."
- else
- echo "$COMMAND: \`$CATEGORY' is not a known category."
- fi
- fi
- #
- # 5) Class
- #
- PATTERN=">Class:"
- CLASS=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
- case "$CLASS" in
- ""|sw-bug|doc-bug|change-request|support) CNT=`expr $CNT + 1` ;;
- *) echo "$COMMAND: \`$CLASS' is not a valid value for \`Class'."
- esac
- #
- # 6) Check that synopsis is not empty
- #
- if grep "^>Synopsis:[ ]*${SYNOPSIS_C}\$" $TEMP > /dev/null
- then
- echo "$COMMAND: Synopsis must not be empty."
- else
- CNT=`expr $CNT + 1`
- fi
-
- [ $CNT -lt 6 -a -z "$BATCH" ] &&
- echo "Errors were found with the problem report."
-
- while true; do
- if [ -z "$BATCH" ]; then
- $ECHON1 "a)bort, e)dit or s)end? $ECHON2"
- read input
- else
- if [ $CNT -eq 6 ]; then
- input=s
- else
- input=a
- fi
- fi
- case "$input" in
- a*)
- if [ -z "$BATCH" ]; then
- echo "$COMMAND: the problem report remains in $BAD and is not sent."
- mv $TEMP $BAD
- else
- echo "$COMMAND: the problem report is not sent."
- fi
- xs=1; exit
- ;;
- e*)
- eval $EDIT $TEMP
- continue 2
- ;;
- s*)
- break 2
- ;;
- esac
- done
-done
-
-#
-# Make sure the mail has got a Subject. If not, use the same as
-# in Synopsis.
-#
-
-if grep '^Subject:[ ]*$' $TEMP > /dev/null
-then
- SYNOPSIS=`grep '^>Synopsis:' $TEMP | sed -e 's/^>Synopsis:[ ]*//'`
- ed -s $TEMP << __EOF__
-/^Subject:/s/:.*\$/: $SYNOPSIS/
-w
-q
-__EOF__
-fi
-
-#
-# Remove comments and send the problem report
-# (we have to use patterns, where the comment contains regex chars)
-#
-# /^>Originator:/s;$ORIGINATOR;;
-sed -e "
-/^SEND-PR:/d
-/^>Organization:/,/^>[A-Za-z-]*:/s;$ORGANIZATION_C;;
-/^>Confidential:/s;<.*>;;
-/^>Synopsis:/s;$SYNOPSIS_C;;
-/^>Severity:/s;<.*>;;
-/^>Priority:/s;<.*>;;
-/^>Category:/s;$CATEGORY_C;;
-/^>Class:/s;<.*>;;
-/^>Release:/,/^>[A-Za-z-]*:/s;$RELEASE_C;;
-/^>Environment:/,/^>[A-Za-z-]*:/s;$ENVIRONMENT_C;;
-/^>Description:/,/^>[A-Za-z-]*:/s;$DESCRIPTION_C;;
-/^>How-To-Repeat:/,/^>[A-Za-z-]*:/s;$HOW_TO_REPEAT_C;;
-/^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;;
-" $TEMP > $REF
-
-if $MAIL_AGENT < $REF; then
- echo "$COMMAND: problem report sent"
- xs=0; exit
-else
- echo "$COMMAND: mysterious mail failure."
- if [ -z "$BATCH" ]; then
- echo "$COMMAND: the problem report remains in $BAD and is not sent."
- mv $REF $BAD
- else
- echo "$COMMAND: the problem report is not sent."
- fi
- xs=1; exit
-fi
diff --git a/usr.sbin/afs/src/tools/gnats/send-pr.texi b/usr.sbin/afs/src/tools/gnats/send-pr.texi
deleted file mode 100644
index 2dcdba6c0ef..00000000000
--- a/usr.sbin/afs/src/tools/gnats/send-pr.texi
+++ /dev/null
@@ -1,656 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@setfilename send-pr.info
-@settitle Reporting Problems Using send-pr
-
-@setchapternewpage odd
-
-@include version.texi
-@set SENDPR
-
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
-* send-pr: (send-pr). Reporting problems--using send-pr
-END-INFO-DIR-ENTRY
-@end format
-@end ifinfo
-
-@ifinfo
-Copyright @copyright{} 1993, 1994, 1995 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-@ignore
-Permission is granted to process this file through TeX and print the
-results, provided the printed document carries a copying permission
-notice identical to this one except for the removal of this paragraph
-(this paragraph not being relevant to the printed manual).
-
-@end ignore
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
-@end ifinfo
-
-@titlepage
-@finalout
-@title Reporting Problems
-@subtitle Using @code{send-pr}, version @value{VERSION}
-@subtitle October 1993
-@author Jeffrey M. Osier
-@author Cygnus Support
-@page
-
-@vskip 0pt plus 1filll
-
-Copyright @copyright{} 1993, 1994, 1995 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided also that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this manual
-into another language, under the above conditions for modified versions.
-
-@end titlepage
-
-@c ---------------------------------------------------------------
-@node Top
-@top Overview
-@cindex foreword to @code{send-pr}
-@cindex overview to @code{send-pr}
-@cindex introduction to @code{send-pr}
-
-This manual documents @code{send-pr},
-@ifinfo
-version @value{VERSION},
-@end ifinfo
-which uses electronic mail to submit support questions and problem
-reports to a central Support Site. No body of work is perfect, and
-support organizations understand this; @code{send-pr} is designed to
-allow users who have problems to submit reports of these problems to
-sites responsible for supporting the products in question, in a defined
-form which can be read by an electronically managed database.
-
-@cindex GNATS
-@code{send-pr} is part of a suite of programs known collectively as
-@sc{gnats}, the @sc{gnu} Problem Report Management System. @sc{gnats}
-consists of several programs which, used in concert, formulate and
-partially administer a database of @dfn{Problem Reports}, or @dfn{PRs},
-at a central Support Site. A PR goes through several states in its
-lifetime; @sc{gnats} tracks the PR and all information associated with it
-through each state and finally acts as an archive for PRs which have
-been @dfn{closed}.
-
-Because @code{send-pr} exists as a shell (@file{/bin/sh}) script and as
-an Elisp file for use with @sc{gnu} Emacs, it can be used from any
-machine on your network which can run a shell script and/or Emacs.
-
-In general, you can use any editor and mailer to submit valid Problem
-Reports, as long as the format required by @sc{gnats} is preserved.
-@code{send-pr} automates the process, however, and ensures that certain
-fields necessary for automatic processing are present. @code{send-pr}
-is strongly recommended for all initial problem-oriented correspondence
-with your Support Site. The organization you submit Problem Reports to
-supplies an address to which further information can be sent; the person
-responsible for the category of the problem you report contacts you
-directly.
-
-@menu
-* send-pr in detail:: Details about send-pr and GNATS
-* Invoking send-pr:: Editing and sending PRs
-* An Example:: A working example
-* Installing send-pr:: Installing send-pr on your system
-* Index::
-@end menu
-
-@node send-pr in detail
-@chapter Details about send-pr and GNATS
-
-@cindex details about @code{send-pr}
-@cindex Problem Reports
-A @dfn{Problem Report} is a message that describes a problem you are
-having with a body of work. @code{send-pr} organizes this message into
-a form which can be understood and automatically processed by @sc{gnats},
-the @sc{gnu} Problem Report Management System. A Problem Report is
-organized into @dfn{fields} which contain data describing you, your
-organization, and the problem you are announcing (@pxref{Fields,,Problem
-Report format}). Problem Reports go through several defined states in
-their lifetimes, from @dfn{open} to @dfn{closed} (@pxref{States,,States
-of Problem Reports}).
-
-@menu
-* States:: States of Problem Reports
-* Fields:: Problem Report format
-@end menu
-
-@include states.texi
-
-@include fields.texi
-
-@node Invoking send-pr
-@chapter Editing and sending PRs
-@cindex editing and sending PRs
-@cindex sending PRs
-@cindex invoking send-pr
-@cindex using send-pr
-@cindex generating new PRs
-
-@include s-usage.texi
-
-@node An Example
-@chapter An Example
-@cindex an example
-@cindex example PR
-@cindex Cygnus Solutions
-@cindex @sc{gnu} software support
-Cygnus Solutions in Sunnyvale, CA, uses @sc{gnats} and @code{send-pr}
-extensively for their support activities. As a support company, Cygnus
-finds problem tracking to be a crucial part of everyday business.
-Cygnus supports the @sc{gnu} compiling tools (including @sc{gnats} and
-@code{send-pr}) over several many platforms
-
-With each shipment of the Cygnus Solutions Developer's Kit, customers
-receive the latest version of @code{send-pr}, which contains an
-up-to-date listing of valid categories (values for the @code{>Category:}
-field). Using these tools, Cygnus' customers can communicate their
-problems to Cygnus effectively and receive automatic confirmation of
-receipt as well as notification of changes in the status of their
-reported problems. Much of Cygnus' support mechanism relies on
-electronic mail.
-
-As an example, let's pretend we're a customer of Cygnus Solutions, and
-that we're having a problem compiling some of our software using the
-@sc{gnu} C compiler, which Cygnus supports.
-
-Assume that we're getting an error in our @code{bifrabulator} program
-wherein the @samp{prestidigitation} routines don't match with the
-@samp{whatsitsname}. We've made sure we're following the rules of the
-program and checked the Release Notes from Cygnus and found that the bug
-isn't already known. In other words, we're pretty sure we've found a
-bug.
-
-@cindex Imaginary Software, Ltd.
-Our first step is to call @code{send-pr}. It really doesn't matter
-whether we use @code{send-pr} from the shell or from within Emacs.
-Indeed, if we use Emacs as a primary editor, calling @code{send-pr} from
-the shell is likely to start @code{send-pr} in an Emacs buffer anyway.
-So, since our company, @emph{Imaginary Software, Ltd.}, uses @sc{gnu}
-software extensively, we're pretty familiar with Emacs, so from within
-Emacs we type
-@smallexample
-M-x send-pr
-@end smallexample
-@noindent
-and we're greeted with the following screen:
-
-@cindex default PR template
-@cindex example of a default template
-@cindex blank PR template
-@cindex @code{bifrabulator}
-@cartouche
-@smallexample
-SEND-PR: -*- text -*-
-SEND-PR: Lines starting with `SEND-PR' will be removed
-SEND-PR: automatically as well as all comments (the text
-SEND-PR: below enclosed in `<' and `>').
-SEND-PR: Please consult the manual if you are not sure
-SEND-PR: how to fill out a problem report.
-SEND-PR:
-SEND-PR: Choose from the following categories:
-SEND-PR:
-SEND-PR: bfd binutils bison
-SEND-PR: byacc clib config cvs diff
-SEND-PR: doc emacs flex g++ gas
-SEND-PR: gcc gdb glob gprof grep
-SEND-PR: info ispell kerberos ld libg++
-SEND-PR: libiberty make makeinfo mas newlib
-SEND-PR: other patch rcs readline send-pr
-SEND-PR: test texindex texinfo texinfo.tex
-SEND-PR: bifrabulator <---@emph{note: this one is fake}
-SEND-PR:
-To: cygnus-bugs@@cygnus.com
-Subject:
-From: jeffrey@@imaginary.com
-Reply-To: jeffrey@@imaginary.com
-X-send-pr-version: send-pr @value{VERSION}
-
->Submitter-Id: imaginary
->Originator: Jeffrey Osier
->Organization:
-Imaginary Software, Ltd.
->Confidential: <[ yes | no ] (one line)>
->Synopsis: <synopsis of the problem (one line)>
->Severity: <[ non-critical | serious | critical ] (one line)>
->Priority: <[ low | medium | high ] (one line)>
->Category: <name of the product (one line)>
->Class: <[sw-bug|doc-bug|change-request|support](oneline)>
->Release: <release number or tag (one line)>
->Environment:
- <machine, os, target, libraries (multiple lines)>
-System: SunOS imaginary.com 4.1.1 1 sun4
-Architecture: sun4
-
->Description:
- <precise description of the problem (multiple lines)>
->How-To-Repeat:
- <code/input/activities to reproduce (multiple lines)>
->Fix:
-@iftex
-@hrule
-@end iftex
------Emacs: *send-pr* (send-pr Fill)----All------------------
-@iftex
-@hrule
-@end iftex
->Category: other[]
-@end smallexample
-@end cartouche
-@page
-We know from past experience that we need to set certain information into
-each field, so we compile all the information we know about our problem.
-We have some sample code which we know should work, even though it
-doesn't, so we'll include that. Below is the completed PR; we send this
-using @kbd{C-c C-c}. (The comments have been truncated).
-
-@cindex completed Problem Report
-@cindex example of a completed PR
-@cartouche
-@smallexample
-SEND-PR: Lines starting with `SEND-PR' will be removed
-SEND-PR: automatically as well as all comments (the text
-SEND-PR: @dots{}
-SEND-PR:
-To: cygnus-bugs@@cygnus.com
-Subject: bifrabulator routines don't match
-From: jeffrey@@imaginary.com
-Reply-To: jeffrey@@imaginary.com
-X-send-pr-version: send-pr @value{VERSION}
-
->Submitter-Id: imaginary
->Originator: Jeffrey Osier
->Organization:
-Imaginary Software, Ltd.
->Confidential: no
->Synopsis: bifrabulator routines don't match
->Severity: serious
->Priority: medium
->Category: bifrabulator
->Class: sw-bug
->Release: progressive-930101
->Environment:
-System: SunOS imaginary.com 4.1.1 1 sun4
-Architecture: sun4 (SPARC)
-
->Description:
- the following code I fed into the bifrabulator came back
- with a strange error. apparently, the prestidigitation
- routine doesn't match with the whatsitsname in all cases.
-
->How-To-Repeat:
- call the bifrabulator on the following code.
- @emph{code sample@dots{}}
-
->Fix:
-@iftex
-@hrule
-@end iftex
------Emacs: *send-pr* (send-pr Fill)----All------------------
-@iftex
-@hrule
-@end iftex
-To send the problem report use: C-c C-c
-@end smallexample
-@end cartouche
-
-We type @kbd{C-c C-c}, and off it goes. Now, we depend on Cygnus
-Support to figure out the answer to our problem.
-
-Soon afterward, we get the following message from Cygnus:
-
-@smallexample
-@group
-From: gnats (GNATS management)
-Sender: gnats-admin
-Reply-To: hacker@@cygnus.com
-To: jeffrey@@imaginary.com
-Subject: Re: bifrabulator/1425: routines don't match
-
-Thank you very much for your problem report.
-It has the internal identification: g++/1425.
-The individual assigned to look at your bug is: hacker
-(F.B. Hacker)
-
-Category: bifrabulator
-Responsible: hacker
-Synopsis: bifrabulator routines don't match
-Arrival-Date: Sat Feb 30 03:12:55 1993
-@end group
-@end smallexample
-
-@noindent
-This is our receipt that the bug has been accepted and forwarded to the
-responsible party.
-
-@noindent
-A while later, we get the analysis:
-
-@smallexample
-@group
-To: jeffrey@@imaginary.com
-From: hacker@@cygnus.com
-Subject: Re: bifrabulator/1425: routines don't match
-Reply-To: hacker@@cygnus.com
-
-Got your message, Jeff. It seems that the bifrabulator was
-confusing the prestidigitation routines with the realitychecker
-when lexically parsing the whatsitsname.
-
-I'm working on robustisizing the bifrabulator now.
-
-How about lunch next week?
---
-F.B. Hacker
-Cygnus Solutions, Sunnyvale, CA 408 542 9600
-#include <std-disclaimer.h>
-@end group
-@end smallexample
-
-@noindent
-About the same time, we get another message from Cygnus.
-
-@cindex state change example
-@cindex example of a state change
-@smallexample
-@group
-From: hacker@@cygnus.com
-To: jeffrey@@imaginary.com
-Subject: Re: bifrabulator/1425: doesn't match prestidig
-Reply-To: hacker@@cygnus.com
-
-
- `F.B. Hacker' changed the state to `analyzed'.
-
-State-Changed-From-To: open-analyzed
-State-Changed-By: hacker
-State-Changed-When: Fri Feb 31 1993 08:59:16 1993
-State-Changed-Why:
- figured out the problem, working on a patch this afternoon
---
-F.B. Hacker
-Cygnus Solutions, Sunnyvale, CA 408 542 9600
-#include <std-disclaimer.h>
-@end group
-@end smallexample
-
-@noindent
-The bug has now been analyzed, and Cygnus is working on a solution.
-
-@noindent
-Sometime later, we get more mail from F.B.:
-
-@smallexample
-@group
-To: jeffrey@@imaginary.com
-From: hacker@@cygnus.com
-Subject: Re: bifrabulator/1425: routines don't match
-Reply-To: hacker@@cygnus.com
-
-There's a patch now that you can ftp over and check out.
-
-Hey, that joke you sent me was great! The one about the
-strings walking into a bar... my boss laughed for an hour!
---
-F.B. Hacker
-Cygnus Solutions, Sunnyvale, CA 408 542 9600
-#include <std-disclaimer.h>
-@end group
-@end smallexample
-@sp 2
-@smallexample
-@group
-From: hacker@@cygnus.com
-To: jeffrey@@imaginary.com
-Subject: Re: bifrabulator/1425: doesn't match prestidig
-Reply-To: hacker@@cygnus.com
-
-
- `F.B. Hacker' changed the state to `feedback'.
-
-State-Changed-From-To: analyzed-feedback
-State-Changed-By: hacker
-State-Changed-When: Fri Feb 31 1993 23:43:16 1993
-State-Changed-Why:
- got the patch finished, notified Jeff at Imaginary Software
---
-F.B. Hacker
-Cygnus Solutions, Sunnyvale, CA 408 542 9600
-#include <std-disclaimer.h>
-@end group
-@end smallexample
-
-@noindent
-The bug has gone into @dfn{feedback} status now, until we get the patch,
-install it and test it. When everything tests well, we can mail F.B.
-back and tell him the bug's been fixed, and he can change the state of
-the PR from @dfn{feedback} to @dfn{closed}.
-
-Following is a list of valid @samp{>Category:} entries that are
-supported by Cygnus.
-
-@menu
-* Valid Categories::
-@end menu
-
-@c FIXME - is this list up to date?
-@include categ.texi
-
-@node Installing send-pr
-@appendix Installing @code{send-pr} on your system
-@cindex installation
-
-If you receive @code{send-pr} as part of a larger software distribution,
-it probably gets installed when the full distribution is installed. If
-you are using @sc{gnats} at your site as well, you must decide where
-@code{send-pr} sends Problem Reports by default; see @ref{default site,,
-Setting a default @var{site}}.
-
-@menu
-* installation:: installing `send-pr' by itself
-* default site:: setting a default site
-@end menu
-
-@node installation
-@section Installing @code{send-pr} by itself
-@cindex installation procedure
-
-Install @code{send-pr} by following these steps (you may need
-@code{root} access in order to change the @file{aliases} file and to
-install @code{send-pr}):
-
-@itemize @bullet
-@item
-Unpack the distribution into a directory which we refer to as
-@var{srcdir}.
-
-@item
-Edit the file @file{Makefile} to reflect local conventions.
-Specifically, you should edit the variable @samp{prefix} to alter the
-installation location. The default is @file{/usr/local}. All files are
-installed under @samp{prefix} (see below).
-
-@item @emph{Run}
-@smallexample
-make all install [ info ] [ install-info ] [ clean ]
-@end smallexample
-
-@noindent
-The targets mean the following:
-
-@table @code
-@item all
-Builds @code{send-pr} and @code{install-sid}
-
-@item install
-Installs the following:
-
-@table @code
-@item install-sid
-@itemx send-pr
-into @file{@var{prefix}/bin}
-
-@item send-pr.1
-into @file{@var{prefix}/man/man1}
-
-@item @var{site}
-the list of valid @var{categories} for the Support Site from which you
-received @code{send-pr}, installed as
-@w{@file{@var{prefix}/share/gnats/@var{site}}}
-
-@item send-pr.el
-into @w{@file{@var{prefix}/share/emacs/lisp}}@footnote{If your main Emacs
-lisp repository is in a different directory from this, substitute that
-directory for @w{@file{@var{prefix}/share/emacs/lisp}}.}
-@end table
-
-@item info (@emph{optional})
-Builds @file{send-pr.info} from @file{send-pr.texi}@*
-@c FIXME - is this still true?
-(@file{send-pr.info} is included with this distribution)
-
-@item install-info (@emph{optional})
-Installs @file{send-pr.info} into @w{@file{@var{prefix}/info}}
-
-@item clean (@emph{optional})
-Removes all intermediary build files that can be rebuilt from source
-code
-@end table
-
-@item
-Run
-
-@smallexample
-install-sid @var{your-sid}
-@end smallexample
-
-@noindent
-where @var{your-sid} is the identification code you received with
-@w{@code{send-pr}}. @code{send-pr} automatically inserts this value
-into the template field @samp{>Submitter-Id:}. If you've downloaded
-@code{send-pr} from the Net, use @samp{net} for this value.
-
-@item
-Place the following line in
-@w{@file{@var{prefix}/share/emacs/lisp/default.el}}, or instruct your
-users to place the following line in their @file{.emacs} files:
-
-@smallexample
-(autoload 'send-pr "send-pr" "Submit a Problem Report." t)
-@end smallexample
-
-@item
-Create a mail alias for the Support Site from which you received
-@code{send-pr}, and for every site with which you wish to use
-@code{send-pr} to communicate. Each alias must have a suffix of
-@samp{-gnats}. The Support Site(s) will provide the correct addresses
-where these aliases should point. For instance, edit your mail aliases
-file to contain something like:
-
-@smallexample
-# support sites; for use with send-pr
-cygnus-gnats: bugs@@cygnus.com # Cygnus Solutions
-bumblebee-gnats: bumblebugs@@bumblebee.com # Bumblebee Inc.
-mycompany-gnats: bugs@@my.company.com (@emph{if you use @sc{gnats} locally})
-@end smallexample
-
-@code{send-pr} automatically searches for these aliases when you type
-
-@smallexample
-send-pr cygnus
-send-pr bumblebee
-send-pr @var{site}@dots{}
-@end smallexample
-
-@noindent
-@code{send-pr} also uses @var{site} to determine the categories of
-problems accepted by the site in question by looking in
-
-@smallexample
-@var{prefix}/share/gnats/@var{site}
-@end smallexample
-
-@end itemize
-
-@node default site
-@section Setting a default @var{site}
-@cindex default @var{site}
-@cindex setting a default @var{site}
-
-@code{send-pr} is capable of sending Problem Reports to any number of
-Support Sites, using mail aliases which have @samp{-gnats} appended them.
-@code{send-pr} automatically appends the suffix, so that when you type
-
-@smallexample
-send-pr @var{site}
-@end smallexample
-
-@noindent
-the Problem Report goes to the address noted in the @file{aliases} file
-as @w{@samp{@var{site}-gnats}}. You can do this in the Emacs version of
-@code{send-pr} by invoking the program with
-
-@smallexample
-C-u M-x send-pr
-@end smallexample
-
-@noindent
-You are prompted for @var{site}.
-
-@var{site} is also used to error-check the @samp{>Category:} field, as a
-precaution against sending mistaken information (and against sending
-information to the wrong site).
-
-You may also simply type
-
-@smallexample
-send-pr
-@end smallexample
-
-@noindent
-from the shell (or @w{@samp{M-x send-pr}} in Emacs), and the Problem
-Report you generate will be sent to the @var{site}, which is usually the
-site from which you received your distribution of @w{@code{send-pr}}.
-If you use @sc{gnats} at your own organization, the default is usually
-your local address for reporting problems.
-
-To change this, simply edit the file @file{Makefile} before installing
-and change the line
-
-@smallexample
-GNATS_SITE = @var{site}
-@end smallexample
-
-@noindent
-to reflect the site where you wish to send PRs by default.
-
-@c ---------------------------------------------------------------
-@node Index
-@unnumbered Index
-
-@printindex cp
-
-@c ---------------------------------------------------------------
-@contents
-@bye
diff --git a/usr.sbin/afs/src/tools/gnats/states.texi b/usr.sbin/afs/src/tools/gnats/states.texi
deleted file mode 100644
index d63f6ba78f0..00000000000
--- a/usr.sbin/afs/src/tools/gnats/states.texi
+++ /dev/null
@@ -1,56 +0,0 @@
-@node States
-@section States of Problem Reports
-
-@cindex life-cycle of a Problem Report
-@cindex states of Problem Reports
-@cindex Problem Report states
-@cindex automatic notification
-
-Each PR goes through a defined series of states between origination and
-closure. The originator of a PR receives notification automatically of
-any state changes.
-
-Unless your site has customized states (see @pxref{states
-file,,,gnats}), @sc{gnats} uses these states:
-
-@table @dfn
-@cindex @emph{open} state
-@cindex initial state (@dfn{open})
-@cindex state---@dfn{open}
-@item open
-The initial state of a Problem Report. This means the PR has been filed
-and the responsible person(s) notified.
-
-@cindex @emph{analyzed} state
-@cindex state---@dfn{analyzed}
-@item analyzed
-The responsible person has analyzed the problem. The analysis should
-contain a preliminary evaluation of the problem and an estimate of the
-amount of time and resources necessary to solve the problem. It should
-also suggest possible workarounds.
-
-@cindex @emph{feedback} state
-@cindex state---@dfn{feedback}
-@item feedback
-The problem has been solved, and the originator has been given a patch
-or other fix. The PR remains in this state until the originator
-acknowledges that the solution works.
-
-@cindex @emph{closed} state
-@cindex state---@dfn{closed}
-@cindex final state (@dfn{closed})
-@item closed
-A Problem Report is closed (``the bug stops here'') only when any
-changes have been integrated, documented, and tested, and the submitter
-has confirmed the solution.
-
-@cindex @emph{suspended} state
-@cindex state---@dfn{suspended}
-@item suspended
-Work on the problem has been postponed. This happens if a timely
-solution is not possible or is not cost-effective at the present time.
-The PR continues to exist, though a solution is not being actively
-sought. If the problem cannot be solved at all, it should be closed
-rather than suspended.
-@end table
-
diff --git a/usr.sbin/afs/src/tools/gnats/texinfo.tex b/usr.sbin/afs/src/tools/gnats/texinfo.tex
deleted file mode 100644
index 3d18dde1bf3..00000000000
--- a/usr.sbin/afs/src/tools/gnats/texinfo.tex
+++ /dev/null
@@ -1,4800 +0,0 @@
-%% TeX macros to handle Texinfo files.
-%% $arla: texinfo.tex,v 1.1.1.1 2001/09/09 23:18:16 lha Exp $
-
-% Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
-% 94, 95, 96, 97 Free Software Foundation, Inc.
-
-%This texinfo.tex file is free software; you can redistribute it and/or
-%modify it under the terms of the GNU General Public License as
-%published by the Free Software Foundation; either version 2, or (at
-%your option) any later version.
-
-%This texinfo.tex file is distributed in the hope that it will be
-%useful, but WITHOUT ANY WARRANTY; without even the implied warranty
-%of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-%General Public License for more details.
-
-%You should have received a copy of the GNU General Public License
-%along with this texinfo.tex file; see the file COPYING. If not, write
-%to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-%Boston, MA 02111-1307, USA.
-
-
-%In other words, you are welcome to use, share and improve this program.
-%You are forbidden to forbid anyone else to use, share and improve
-%what you give them. Help stamp out software-hoarding!
-
-
-% Send bug reports to bug-texinfo@prep.ai.mit.edu.
-% Please include a *precise* test case in each bug report.
-
-
-% Make it possible to create a .fmt file just by loading this file:
-% if the underlying format is not loaded, start by loading it now.
-% Added by gildea November 1993.
-\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
-
-% This automatically updates the version number based on RCS.
-\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
-\deftexinfoversion$arla: 1.1.1.1 $
-\message{Loading texinfo package [Version \texinfoversion]:}
-
-% If in a .fmt file, print the version number
-% and turn on active characters that we couldn't do earlier because
-% they might have appeared in the input file name.
-\everyjob{\message{[Texinfo version \texinfoversion]}\message{}
- \catcode`+=\active \catcode`\_=\active}
-
-% Save some parts of plain tex whose names we will redefine.
-
-\let\ptexb=\b
-\let\ptexbullet=\bullet
-\let\ptexc=\c
-\let\ptexcomma=\,
-\let\ptexdot=\.
-\let\ptexdots=\dots
-\let\ptexend=\end
-\let\ptexequiv = \equiv
-\let\ptexi=\i
-\let\ptexlbrace=\{
-\let\ptexrbrace=\}
-\let\ptexstar=\*
-\let\ptext=\t
-
-% Be sure we're in horizontal mode when doing a tie, since we make space
-% equivalent to this in @example-like environments. Otherwise, a space
-% at the beginning of a line will start with \penalty -- and
-% since \penalty is valid in vertical mode, we'd end up putting the
-% penalty on the vertical list instead of in the new paragraph.
-{\catcode`@ = 11
- % Avoid using \@M directly, because that causes trouble
- % if the definition is written into an index file.
- \global\let\tiepenalty = \@M
- \gdef\tie{\leavevmode\penalty\tiepenalty\ }
-}
-
-
-\message{Basics,}
-\chardef\other=12
-
-% If this character appears in an error message or help string, it
-% starts a new line in the output.
-\newlinechar = `^^J
-
-% Set up fixed words for English.
-\ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter}}\fi%
-\def\putwordInfo{Info}%
-\ifx\putwordSee\undefined{\gdef\putwordSee{See}}\fi%
-\ifx\putwordsee\undefined{\gdef\putwordsee{see}}\fi%
-\ifx\putwordfile\undefined{\gdef\putwordfile{file}}\fi%
-\ifx\putwordpage\undefined{\gdef\putwordpage{page}}\fi%
-\ifx\putwordsection\undefined{\gdef\putwordsection{section}}\fi%
-\ifx\putwordSection\undefined{\gdef\putwordSection{Section}}\fi%
-\ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents}}\fi%
-\ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents}}\fi%
-\ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix}}\fi%
-
-% Ignore a token.
-%
-\def\gobble#1{}
-
-\hyphenation{ap-pen-dix}
-\hyphenation{mini-buf-fer mini-buf-fers}
-\hyphenation{eshell}
-
-% Margin to add to right of even pages, to left of odd pages.
-\newdimen \bindingoffset
-\newdimen \normaloffset
-\newdimen\pagewidth \newdimen\pageheight
-
-% Sometimes it is convenient to have everything in the transcript file
-% and nothing on the terminal. We don't just call \tracingall here,
-% since that produces some useless output on the terminal.
-%
-\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
-\def\loggingall{\tracingcommands2 \tracingstats2
- \tracingpages1 \tracingoutput1 \tracinglostchars1
- \tracingmacros2 \tracingparagraphs1 \tracingrestores1
- \showboxbreadth\maxdimen\showboxdepth\maxdimen
-}%
-
-% For @cropmarks command.
-% Do @cropmarks to get crop marks.
-%
-\newif\ifcropmarks
-\let\cropmarks = \cropmarkstrue
-%
-% Dimensions to add cropmarks at corners.
-% Added by P. A. MacKay, 12 Nov. 1986
-%
-\newdimen\cornerlong \newdimen\cornerthick
-\newdimen\topandbottommargin
-\newdimen\outerhsize \newdimen\outervsize
-\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
-\outerhsize=7in
-%\outervsize=9.5in
-% Alternative @smallbook page size is 9.25in
-\outervsize=9.25in
-\topandbottommargin=.75in
-
-% Main output routine.
-\chardef\PAGE = 255
-\output = {\onepageout{\pagecontents\PAGE}}
-
-\newbox\headlinebox
-\newbox\footlinebox
-
-% \onepageout takes a vbox as an argument. Note that \pagecontents
-% does insertions, but you have to call it yourself.
-\def\onepageout#1{%
- \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
- %
- \ifodd\pageno \advance\hoffset by \bindingoffset
- \else \advance\hoffset by -\bindingoffset\fi
- %
- % Do this outside of the \shipout so @code etc. will be expanded in
- % the headline as they should be, not taken literally (outputting ''code).
- \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
- \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
- %
- {%
- % Have to do this stuff outside the \shipout because we want it to
- % take effect in \write's, yet the group defined by the \vbox ends
- % before the \shipout runs.
- %
- \escapechar = `\\ % use backslash in output files.
- \indexdummies % don't expand commands in the output.
- \normalturnoffactive % \ in index entries must not stay \, e.g., if
- % the page break happens to be in the middle of an example.
- \shipout\vbox{%
- \ifcropmarks \vbox to \outervsize\bgroup
- \hsize = \outerhsize
- \line{\ewtop\hfil\ewtop}%
- \nointerlineskip
- \line{%
- \vbox{\moveleft\cornerthick\nstop}%
- \hfill
- \vbox{\moveright\cornerthick\nstop}%
- }%
- \vskip\topandbottommargin
- \line\bgroup
- \hfil % center the page within the outer (page) hsize.
- \ifodd\pageno\hskip\bindingoffset\fi
- \vbox\bgroup
- \fi
- %
- \unvbox\headlinebox
- \pagebody{#1}%
- \unvbox\footlinebox
- %
- \ifcropmarks
- \egroup % end of \vbox\bgroup
- \hfil\egroup % end of (centering) \line\bgroup
- \vskip\topandbottommargin plus1fill minus1fill
- \boxmaxdepth = \cornerthick
- \line{%
- \vbox{\moveleft\cornerthick\nsbot}%
- \hfill
- \vbox{\moveright\cornerthick\nsbot}%
- }%
- \nointerlineskip
- \line{\ewbot\hfil\ewbot}%
- \egroup % \vbox from first cropmarks clause
- \fi
- }% end of \shipout\vbox
- }% end of group with \turnoffactive
- \advancepageno
- \ifnum\outputpenalty>-20000 \else\dosupereject\fi
-}
-
-\newinsert\margin \dimen\margin=\maxdimen
-
-\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
-{\catcode`\@ =11
-\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
-% marginal hacks, juha@viisa.uucp (Juha Takala)
-\ifvoid\margin\else % marginal info is present
- \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
-\dimen@=\dp#1 \unvbox#1
-\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
-\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
-}
-
-% Here are the rules for the cropmarks. Note that they are
-% offset so that the space between them is truly \outerhsize or \outervsize
-% (P. A. MacKay, 12 November, 1986)
-%
-\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
-\def\nstop{\vbox
- {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
-\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
-\def\nsbot{\vbox
- {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
-
-% Parse an argument, then pass it to #1. The argument is the rest of
-% the input line (except we remove a trailing comment). #1 should be a
-% macro which expects an ordinary undelimited TeX argument.
-%
-\def\parsearg#1{%
- \let\next = #1%
- \begingroup
- \obeylines
- \futurelet\temp\parseargx
-}
-
-% If the next token is an obeyed space (from an @example environment or
-% the like), remove it and recurse. Otherwise, we're done.
-\def\parseargx{%
- % \obeyedspace is defined far below, after the definition of \sepspaces.
- \ifx\obeyedspace\temp
- \expandafter\parseargdiscardspace
- \else
- \expandafter\parseargline
- \fi
-}
-
-% Remove a single space (as the delimiter token to the macro call).
-{\obeyspaces %
- \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
-
-{\obeylines %
- \gdef\parseargline#1^^M{%
- \endgroup % End of the group started in \parsearg.
- %
- % First remove any @c comment, then any @comment.
- % Result of each macro is put in \toks0.
- \argremovec #1\c\relax %
- \expandafter\argremovecomment \the\toks0 \comment\relax %
- %
- % Call the caller's macro, saved as \next in \parsearg.
- \expandafter\next\expandafter{\the\toks0}%
- }%
-}
-
-% Since all \c{,omment} does is throw away the argument, we can let TeX
-% do that for us. The \relax here is matched by the \relax in the call
-% in \parseargline; it could be more or less anything, its purpose is
-% just to delimit the argument to the \c.
-\def\argremovec#1\c#2\relax{\toks0 = {#1}}
-\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
-
-% \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
-% @end itemize @c foo
-% will have two active spaces as part of the argument with the
-% `itemize'. Here we remove all active spaces from #1, and assign the
-% result to \toks0.
-%
-% This loses if there are any *other* active characters besides spaces
-% in the argument -- _ ^ +, for example -- since they get expanded.
-% Fortunately, Texinfo does not define any such commands. (If it ever
-% does, the catcode of the characters in questionwill have to be changed
-% here.) But this means we cannot call \removeactivespaces as part of
-% \argremovec{,omment}, since @c uses \parsearg, and thus the argument
-% that \parsearg gets might well have any character at all in it.
-%
-\def\removeactivespaces#1{%
- \begingroup
- \ignoreactivespaces
- \edef\temp{#1}%
- \global\toks0 = \expandafter{\temp}%
- \endgroup
-}
-
-% Change the active space to expand to nothing.
-%
-\begingroup
- \obeyspaces
- \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
-\endgroup
-
-
-\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
-
-%% These are used to keep @begin/@end levels from running away
-%% Call \inENV within environments (after a \begingroup)
-\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
-\def\ENVcheck{%
-\ifENV\errmessage{Still within an environment. Type Return to continue.}
-\endgroup\fi} % This is not perfect, but it should reduce lossage
-
-% @begin foo is the same as @foo, for now.
-\newhelp\EMsimple{Type <Return> to continue.}
-
-\outer\def\begin{\parsearg\beginxxx}
-
-\def\beginxxx #1{%
-\expandafter\ifx\csname #1\endcsname\relax
-{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
-\csname #1\endcsname\fi}
-
-% @end foo executes the definition of \Efoo.
-%
-\def\end{\parsearg\endxxx}
-\def\endxxx #1{%
- \removeactivespaces{#1}%
- \edef\endthing{\the\toks0}%
- %
- \expandafter\ifx\csname E\endthing\endcsname\relax
- \expandafter\ifx\csname \endthing\endcsname\relax
- % There's no \foo, i.e., no ``environment'' foo.
- \errhelp = \EMsimple
- \errmessage{Undefined command `@end \endthing'}%
- \else
- \unmatchedenderror\endthing
- \fi
- \else
- % Everything's ok; the right environment has been started.
- \csname E\endthing\endcsname
- \fi
-}
-
-% There is an environment #1, but it hasn't been started. Give an error.
-%
-\def\unmatchedenderror#1{%
- \errhelp = \EMsimple
- \errmessage{This `@end #1' doesn't have a matching `@#1'}%
-}
-
-% Define the control sequence \E#1 to give an unmatched @end error.
-%
-\def\defineunmatchedend#1{%
- \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
-}
-
-
-% Single-spacing is done by various environments (specifically, in
-% \nonfillstart and \quotations).
-\newskip\singlespaceskip \singlespaceskip = 12.5pt
-\def\singlespace{%
- % Why was this kern here? It messes up equalizing space above and below
- % environments. --karl, 6may93
- %{\advance \baselineskip by -\singlespaceskip
- %\kern \baselineskip}%
- \setleading \singlespaceskip
-}
-
-%% Simple single-character @ commands
-
-% @@ prints an @
-% Kludge this until the fonts are right (grr).
-\def\@{{\tt \char '100}}
-
-% This is turned off because it was never documented
-% and you can use @w{...} around a quote to suppress ligatures.
-%% Define @` and @' to be the same as ` and '
-%% but suppressing ligatures.
-%\def\`{{`}}
-%\def\'{{'}}
-
-% Used to generate quoted braces.
-\def\mylbrace {{\tt \char '173}}
-\def\myrbrace {{\tt \char '175}}
-\let\{=\mylbrace
-\let\}=\myrbrace
-\begingroup
- % Definitions to produce actual \{ & \} command in an index.
- \catcode`\{ = 12 \catcode`\} = 12
- \catcode`\[ = 1 \catcode`\] = 2
- \catcode`\@ = 0 \catcode`\\ = 12
- @gdef@lbracecmd[\{]%
- @gdef@rbracecmd[\}]%
-@endgroup
-
-% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
-% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
-\let\, = \c
-\let\dotaccent = \.
-\def\ringaccent#1{{\accent23 #1}}
-\let\tieaccent = \t
-\let\ubaraccent = \b
-\let\udotaccent = \d
-
-% Other special characters: @questiondown @exclamdown
-% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
-\def\questiondown{?`}
-\def\exclamdown{!`}
-
-% Dotless i and dotless j, used for accents.
-\def\imacro{i}
-\def\jmacro{j}
-\def\dotless#1{%
- \def\temp{#1}%
- \ifx\temp\imacro \ptexi
- \else\ifx\temp\jmacro \j
- \else \errmessage{@dotless can be used only with i or j}%
- \fi\fi
-}
-
-% @: forces normal size whitespace following.
-\def\:{\spacefactor=1000 }
-
-% @* forces a line break.
-\def\*{\hfil\break\hbox{}\ignorespaces}
-
-% @. is an end-of-sentence period.
-\def\.{.\spacefactor=3000 }
-
-% @enddots{} is an end-of-sentence ellipsis.
-\gdef\enddots{$\mathinner{\ldotp\ldotp\ldotp\ldotp}$\spacefactor=3000}
-
-% @! is an end-of-sentence bang.
-\gdef\!{!\spacefactor=3000 }
-
-% @? is an end-of-sentence query.
-\gdef\?{?\spacefactor=3000 }
-
-% @w prevents a word break. Without the \leavevmode, @w at the
-% beginning of a paragraph, when TeX is still in vertical mode, would
-% produce a whole line of output instead of starting the paragraph.
-\def\w#1{\leavevmode\hbox{#1}}
-
-% @group ... @end group forces ... to be all on one page, by enclosing
-% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
-% to keep its height that of a normal line. According to the rules for
-% \topskip (p.114 of the TeXbook), the glue inserted is
-% max (\topskip - \ht (first item), 0). If that height is large,
-% therefore, no glue is inserted, and the space between the headline and
-% the text is small, which looks bad.
-%
-\def\group{\begingroup
- \ifnum\catcode13=\active \else
- \errhelp = \groupinvalidhelp
- \errmessage{@group invalid in context where filling is enabled}%
- \fi
- %
- % The \vtop we start below produces a box with normal height and large
- % depth; thus, TeX puts \baselineskip glue before it, and (when the
- % next line of text is done) \lineskip glue after it. (See p.82 of
- % the TeXbook.) Thus, space below is not quite equal to space
- % above. But it's pretty close.
- \def\Egroup{%
- \egroup % End the \vtop.
- \endgroup % End the \group.
- }%
- %
- \vtop\bgroup
- % We have to put a strut on the last line in case the @group is in
- % the midst of an example, rather than completely enclosing it.
- % Otherwise, the interline space between the last line of the group
- % and the first line afterwards is too small. But we can't put the
- % strut in \Egroup, since there it would be on a line by itself.
- % Hence this just inserts a strut at the beginning of each line.
- \everypar = {\strut}%
- %
- % Since we have a strut on every line, we don't need any of TeX's
- % normal interline spacing.
- \offinterlineskip
- %
- % OK, but now we have to do something about blank
- % lines in the input in @example-like environments, which normally
- % just turn into \lisppar, which will insert no space now that we've
- % turned off the interline space. Simplest is to make them be an
- % empty paragraph.
- \ifx\par\lisppar
- \edef\par{\leavevmode \par}%
- %
- % Reset ^^M's definition to new definition of \par.
- \obeylines
- \fi
- %
- % Do @comment since we are called inside an environment such as
- % @example, where each end-of-line in the input causes an
- % end-of-line in the output. We don't want the end-of-line after
- % the `@group' to put extra space in the output. Since @group
- % should appear on a line by itself (according to the Texinfo
- % manual), we don't worry about eating any user text.
- \comment
-}
-%
-% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
-% message, so this ends up printing `@group can only ...'.
-%
-\newhelp\groupinvalidhelp{%
-group can only be used in environments such as @example,^^J%
-where each line of input produces a line of output.}
-
-% @need space-in-mils
-% forces a page break if there is not space-in-mils remaining.
-
-\newdimen\mil \mil=0.001in
-
-\def\need{\parsearg\needx}
-
-% Old definition--didn't work.
-%\def\needx #1{\par %
-%% This method tries to make TeX break the page naturally
-%% if the depth of the box does not fit.
-%{\baselineskip=0pt%
-%\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
-%\prevdepth=-1000pt
-%}}
-
-\def\needx#1{%
- % Go into vertical mode, so we don't make a big box in the middle of a
- % paragraph.
- \par
- %
- % Don't add any leading before our big empty box, but allow a page
- % break, since the best break might be right here.
- \allowbreak
- \nointerlineskip
- \vtop to #1\mil{\vfil}%
- %
- % TeX does not even consider page breaks if a penalty added to the
- % main vertical list is 10000 or more. But in order to see if the
- % empty box we just added fits on the page, we must make it consider
- % page breaks. On the other hand, we don't want to actually break the
- % page after the empty box. So we use a penalty of 9999.
- %
- % There is an extremely small chance that TeX will actually break the
- % page at this \penalty, if there are no other feasible breakpoints in
- % sight. (If the user is using lots of big @group commands, which
- % almost-but-not-quite fill up a page, TeX will have a hard time doing
- % good page breaking, for example.) However, I could not construct an
- % example where a page broke at this \penalty; if it happens in a real
- % document, then we can reconsider our strategy.
- \penalty9999
- %
- % Back up by the size of the box, whether we did a page break or not.
- \kern -#1\mil
- %
- % Do not allow a page break right after this kern.
- \nobreak
-}
-
-% @br forces paragraph break
-
-\let\br = \par
-
-% @dots{} output some dots
-
-\def\dots{$\ldots$}
-
-% @page forces the start of a new page
-
-\def\page{\par\vfill\supereject}
-
-% @exdent text....
-% outputs text on separate line in roman font, starting at standard page margin
-
-% This records the amount of indent in the innermost environment.
-% That's how much \exdent should take out.
-\newskip\exdentamount
-
-% This defn is used inside fill environments such as @defun.
-\def\exdent{\parsearg\exdentyyy}
-\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
-
-% This defn is used inside nofill environments such as @example.
-\def\nofillexdent{\parsearg\nofillexdentyyy}
-\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
-\leftline{\hskip\leftskip{\rm#1}}}}
-
-% @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
-
-\def\inmargin#1{%
-\strut\vadjust{\nobreak\kern-\strutdepth
- \vtop to \strutdepth{\baselineskip\strutdepth\vss
- \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}}
-\newskip\inmarginspacing \inmarginspacing=1cm
-\def\strutdepth{\dp\strutbox}
-
-%\hbox{{\rm#1}}\hfil\break}}
-
-% @include file insert text of that file as input.
-% Allow normal characters that we make active in the argument (a file name).
-\def\include{\begingroup
- \catcode`\\=12
- \catcode`~=12
- \catcode`^=12
- \catcode`_=12
- \catcode`|=12
- \catcode`<=12
- \catcode`>=12
- \catcode`+=12
- \parsearg\includezzz}
-% Restore active chars for included file.
-\def\includezzz#1{\endgroup\begingroup
- % Read the included file in a group so nested @include's work.
- \def\thisfile{#1}%
- \input\thisfile
-\endgroup}
-
-\def\thisfile{}
-
-% @center line outputs that line, centered
-
-\def\center{\parsearg\centerzzz}
-\def\centerzzz #1{{\advance\hsize by -\leftskip
-\advance\hsize by -\rightskip
-\centerline{#1}}}
-
-% @sp n outputs n lines of vertical space
-
-\def\sp{\parsearg\spxxx}
-\def\spxxx #1{\vskip #1\baselineskip}
-
-% @comment ...line which is ignored...
-% @c is the same as @comment
-% @ignore ... @end ignore is another way to write a comment
-
-\def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
-\parsearg \commentxxx}
-
-\def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }
-
-\let\c=\comment
-
-% @paragraphindent is defined for the Info formatting commands only.
-\let\paragraphindent=\comment
-
-% Prevent errors for section commands.
-% Used in @ignore and in failing conditionals.
-\def\ignoresections{%
-\let\chapter=\relax
-\let\unnumbered=\relax
-\let\top=\relax
-\let\unnumberedsec=\relax
-\let\unnumberedsection=\relax
-\let\unnumberedsubsec=\relax
-\let\unnumberedsubsection=\relax
-\let\unnumberedsubsubsec=\relax
-\let\unnumberedsubsubsection=\relax
-\let\section=\relax
-\let\subsec=\relax
-\let\subsubsec=\relax
-\let\subsection=\relax
-\let\subsubsection=\relax
-\let\appendix=\relax
-\let\appendixsec=\relax
-\let\appendixsection=\relax
-\let\appendixsubsec=\relax
-\let\appendixsubsection=\relax
-\let\appendixsubsubsec=\relax
-\let\appendixsubsubsection=\relax
-\let\contents=\relax
-\let\smallbook=\relax
-\let\titlepage=\relax
-}
-
-% Used in nested conditionals, where we have to parse the Texinfo source
-% and so want to turn off most commands, in case they are used
-% incorrectly.
-%
-\def\ignoremorecommands{%
- \let\defcodeindex = \relax
- \let\defcv = \relax
- \let\deffn = \relax
- \let\deffnx = \relax
- \let\defindex = \relax
- \let\defivar = \relax
- \let\defmac = \relax
- \let\defmethod = \relax
- \let\defop = \relax
- \let\defopt = \relax
- \let\defspec = \relax
- \let\deftp = \relax
- \let\deftypefn = \relax
- \let\deftypefun = \relax
- \let\deftypevar = \relax
- \let\deftypevr = \relax
- \let\defun = \relax
- \let\defvar = \relax
- \let\defvr = \relax
- \let\ref = \relax
- \let\xref = \relax
- \let\printindex = \relax
- \let\pxref = \relax
- \let\settitle = \relax
- \let\setchapternewpage = \relax
- \let\setchapterstyle = \relax
- \let\everyheading = \relax
- \let\evenheading = \relax
- \let\oddheading = \relax
- \let\everyfooting = \relax
- \let\evenfooting = \relax
- \let\oddfooting = \relax
- \let\headings = \relax
- \let\include = \relax
- \let\lowersections = \relax
- \let\down = \relax
- \let\raisesections = \relax
- \let\up = \relax
- \let\set = \relax
- \let\clear = \relax
- \let\item = \relax
-}
-
-% Ignore @ignore ... @end ignore.
-%
-\def\ignore{\doignore{ignore}}
-
-% Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text.
-%
-\def\ifinfo{\doignore{ifinfo}}
-\def\ifhtml{\doignore{ifhtml}}
-\def\html{\doignore{html}}
-\def\menu{\doignore{menu}}
-\def\direntry{\doignore{direntry}}
-
-% Also ignore @macro ... @end macro. The user must run texi2dvi,
-% which runs makeinfo to do macro expansion. Ignore @unmacro, too.
-\def\macro{\doignore{macro}}
-\let\unmacro = \comment
-
-
-% @dircategory CATEGORY -- specify a category of the dir file
-% which this file should belong to. Ignore this in TeX.
-\let\dircategory = \comment
-
-% Ignore text until a line `@end #1'.
-%
-\def\doignore#1{\begingroup
- % Don't complain about control sequences we have declared \outer.
- \ignoresections
- %
- % Define a command to swallow text until we reach `@end #1'.
- \long\def\doignoretext##1\end #1{\enddoignore}%
- %
- % Make sure that spaces turn into tokens that match what \doignoretext wants.
- \catcode32 = 10
- %
- % And now expand that command.
- \doignoretext
-}
-
-% What we do to finish off ignored text.
-%
-\def\enddoignore{\endgroup\ignorespaces}%
-
-\newif\ifwarnedobs\warnedobsfalse
-\def\obstexwarn{%
- \ifwarnedobs\relax\else
- % We need to warn folks that they may have trouble with TeX 3.0.
- % This uses \immediate\write16 rather than \message to get newlines.
- \immediate\write16{}
- \immediate\write16{***WARNING*** for users of Unix TeX 3.0!}
- \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
- \immediate\write16{If you are running another version of TeX, relax.}
- \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
- \immediate\write16{ Then upgrade your TeX installation if you can.}
- \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)}
- \immediate\write16{If you are stuck with version 3.0, run the}
- \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
- \immediate\write16{ to use a workaround.}
- \immediate\write16{}
- \global\warnedobstrue
- \fi
-}
-
-% **In TeX 3.0, setting text in \nullfont hangs tex. For a
-% workaround (which requires the file ``dummy.tfm'' to be installed),
-% uncomment the following line:
-%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
-
-% Ignore text, except that we keep track of conditional commands for
-% purposes of nesting, up to an `@end #1' command.
-%
-\def\nestedignore#1{%
- \obstexwarn
- % We must actually expand the ignored text to look for the @end
- % command, so that nested ignore constructs work. Thus, we put the
- % text into a \vbox and then do nothing with the result. To minimize
- % the change of memory overflow, we follow the approach outlined on
- % page 401 of the TeXbook: make the current font be a dummy font.
- %
- \setbox0 = \vbox\bgroup
- % Don't complain about control sequences we have declared \outer.
- \ignoresections
- %
- % Define `@end #1' to end the box, which will in turn undefine the
- % @end command again.
- \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
- %
- % We are going to be parsing Texinfo commands. Most cause no
- % trouble when they are used incorrectly, but some commands do
- % complicated argument parsing or otherwise get confused, so we
- % undefine them.
- %
- % We can't do anything about stray @-signs, unfortunately;
- % they'll produce `undefined control sequence' errors.
- \ignoremorecommands
- %
- % Set the current font to be \nullfont, a TeX primitive, and define
- % all the font commands to also use \nullfont. We don't use
- % dummy.tfm, as suggested in the TeXbook, because not all sites
- % might have that installed. Therefore, math mode will still
- % produce output, but that should be an extremely small amount of
- % stuff compared to the main input.
- %
- \nullfont
- \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont
- \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont
- \let\tensf = \nullfont
- % Similarly for index fonts (mostly for their use in
- % smallexample)
- \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont
- \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont
- \let\indsf = \nullfont
- %
- % Don't complain when characters are missing from the fonts.
- \tracinglostchars = 0
- %
- % Don't bother to do space factor calculations.
- \frenchspacing
- %
- % Don't report underfull hboxes.
- \hbadness = 10000
- %
- % Do minimal line-breaking.
- \pretolerance = 10000
- %
- % Do not execute instructions in @tex
- \def\tex{\doignore{tex}}
-}
-
-% @set VAR sets the variable VAR to an empty value.
-% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
-%
-% Since we want to separate VAR from REST-OF-LINE (which might be
-% empty), we can't just use \parsearg; we have to insert a space of our
-% own to delimit the rest of the line, and then take it out again if we
-% didn't need it. Make sure the catcode of space is correct to avoid
-% losing inside @example, for instance.
-%
-\def\set{\begingroup\catcode` =10
- \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
- \parsearg\setxxx}
-\def\setxxx#1{\setyyy#1 \endsetyyy}
-\def\setyyy#1 #2\endsetyyy{%
- \def\temp{#2}%
- \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
- \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
- \fi
- \endgroup
-}
-% Can't use \xdef to pre-expand #2 and save some time, since \temp or
-% \next or other control sequences that we've defined might get us into
-% an infinite loop. Consider `@set foo @cite{bar}'.
-\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
-
-% @clear VAR clears (i.e., unsets) the variable VAR.
-%
-\def\clear{\parsearg\clearxxx}
-\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
-
-% @value{foo} gets the text saved in variable foo.
-%
-\def\value{\begingroup
- \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
- \valuexxx}
-\def\valuexxx#1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- {\{No value for ``#1''\}}%
- \else
- \csname SET#1\endcsname
- \fi
-\endgroup}
-
-% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
-% with @set.
-%
-\def\ifset{\parsearg\ifsetxxx}
-\def\ifsetxxx #1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- \expandafter\ifsetfail
- \else
- \expandafter\ifsetsucceed
- \fi
-}
-\def\ifsetsucceed{\conditionalsucceed{ifset}}
-\def\ifsetfail{\nestedignore{ifset}}
-\defineunmatchedend{ifset}
-
-% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
-% defined with @set, or has been undefined with @clear.
-%
-\def\ifclear{\parsearg\ifclearxxx}
-\def\ifclearxxx #1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- \expandafter\ifclearsucceed
- \else
- \expandafter\ifclearfail
- \fi
-}
-\def\ifclearsucceed{\conditionalsucceed{ifclear}}
-\def\ifclearfail{\nestedignore{ifclear}}
-\defineunmatchedend{ifclear}
-
-% @iftex always succeeds; we read the text following, through @end
-% iftex). But `@end iftex' should be valid only after an @iftex.
-%
-\def\iftex{\conditionalsucceed{iftex}}
-\defineunmatchedend{iftex}
-
-% We can't just want to start a group at @iftex (for example) and end it
-% at @end iftex, since then @set commands inside the conditional have no
-% effect (they'd get reverted at the end of the group). So we must
-% define \Eiftex to redefine itself to be its previous value. (We can't
-% just define it to fail again with an ``unmatched end'' error, since
-% the @ifset might be nested.)
-%
-\def\conditionalsucceed#1{%
- \edef\temp{%
- % Remember the current value of \E#1.
- \let\nece{prevE#1} = \nece{E#1}%
- %
- % At the `@end #1', redefine \E#1 to be its previous value.
- \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
- }%
- \temp
-}
-
-% We need to expand lots of \csname's, but we don't want to expand the
-% control sequences after we've constructed them.
-%
-\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
-
-% @asis just yields its argument. Used with @table, for example.
-%
-\def\asis#1{#1}
-
-% @math means output in math mode.
-% We don't use $'s directly in the definition of \math because control
-% sequences like \math are expanded when the toc file is written. Then,
-% we read the toc file back, the $'s will be normal characters (as they
-% should be, according to the definition of Texinfo). So we must use a
-% control sequence to switch into and out of math mode.
-%
-% This isn't quite enough for @math to work properly in indices, but it
-% seems unlikely it will ever be needed there.
-%
-\let\implicitmath = $
-\def\math#1{\implicitmath #1\implicitmath}
-
-% @bullet and @minus need the same treatment as @math, just above.
-\def\bullet{\implicitmath\ptexbullet\implicitmath}
-\def\minus{\implicitmath-\implicitmath}
-
-\def\node{\ENVcheck\parsearg\nodezzz}
-\def\nodezzz#1{\nodexxx [#1,]}
-\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
-\let\nwnode=\node
-\let\lastnode=\relax
-
-\def\donoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\setref{\lastnode}\fi
-\global\let\lastnode=\relax}
-
-\def\unnumbnoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
-\global\let\lastnode=\relax}
-
-\def\appendixnoderef{\ifx\lastnode\relax\else
-\expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
-\global\let\lastnode=\relax}
-
-% @refill is a no-op.
-\let\refill=\relax
-
-% @setfilename is done at the beginning of every texinfo file.
-% So open here the files we need to have open while reading the input.
-% This makes it possible to make a .fmt file for texinfo.
-\def\setfilename{%
- \readauxfile
- \opencontents
- \openindices
- \fixbackslash % Turn off hack to swallow `\input texinfo'.
- \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
- \comment % Ignore the actual filename.
-}
-
-% @bye.
-\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
-
-% \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx}
-% \def\macroxxx#1#2 \end macro{%
-% \expandafter\gdef\macrotemp#1{#2}%
-% \endgroup}
-
-%\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx}
-%\def\linemacroxxx#1#2 \end linemacro{%
-%\let\parsearg=\relax
-%\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}%
-%\expandafter\xdef\macrotemp{\parsearg\macrotempx}%
-%\expandafter\gdef\macrotempx#1{#2}%
-%\endgroup}
-
-%\def\butfirst#1{}
-
-
-\message{fonts,}
-
-% Font-change commands.
-
-% Texinfo supports the sans serif font style, which plain TeX does not.
-% So we set up a \sf analogous to plain's \rm, etc.
-\newfam\sffam
-\def\sf{\fam=\sffam \tensf}
-\let\li = \sf % Sometimes we call it \li, not \sf.
-
-% We don't need math for this one.
-\def\ttsl{\tenttsl}
-
-%% Try out Computer Modern fonts at \magstephalf
-\let\mainmagstep=\magstephalf
-
-% Set the font macro #1 to the font named #2, adding on the
-% specified font prefix (normally `cm').
-% #3 is the font's design size, #4 is a scale factor
-\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
-
-% Use cm as the default font prefix.
-% To specify the font prefix, you must define \fontprefix
-% before you read in texinfo.tex.
-\ifx\fontprefix\undefined
-\def\fontprefix{cm}
-\fi
-% Support font families that don't use the same naming scheme as CM.
-\def\rmshape{r}
-\def\rmbshape{bx} %where the normal face is bold
-\def\bfshape{b}
-\def\bxshape{bx}
-\def\ttshape{tt}
-\def\ttbshape{tt}
-\def\ttslshape{sltt}
-\def\itshape{ti}
-\def\itbshape{bxti}
-\def\slshape{sl}
-\def\slbshape{bxsl}
-\def\sfshape{ss}
-\def\sfbshape{ss}
-\def\scshape{csc}
-\def\scbshape{csc}
-
-\ifx\bigger\relax
-\let\mainmagstep=\magstep1
-\setfont\textrm\rmshape{12}{1000}
-\setfont\texttt\ttshape{12}{1000}
-\else
-\setfont\textrm\rmshape{10}{\mainmagstep}
-\setfont\texttt\ttshape{10}{\mainmagstep}
-\fi
-% Instead of cmb10, you many want to use cmbx10.
-% cmbx10 is a prettier font on its own, but cmb10
-% looks better when embedded in a line with cmr10.
-\setfont\textbf\bfshape{10}{\mainmagstep}
-\setfont\textit\itshape{10}{\mainmagstep}
-\setfont\textsl\slshape{10}{\mainmagstep}
-\setfont\textsf\sfshape{10}{\mainmagstep}
-\setfont\textsc\scshape{10}{\mainmagstep}
-\setfont\textttsl\ttslshape{10}{\mainmagstep}
-\font\texti=cmmi10 scaled \mainmagstep
-\font\textsy=cmsy10 scaled \mainmagstep
-
-% A few fonts for @defun, etc.
-\setfont\defbf\bxshape{10}{\magstep1} %was 1314
-\setfont\deftt\ttshape{10}{\magstep1}
-\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
-
-% Fonts for indices and small examples (9pt).
-% We actually use the slanted font rather than the italic,
-% because texinfo normally uses the slanted fonts for that.
-% Do not make many font distinctions in general in the index, since they
-% aren't very useful.
-\setfont\ninett\ttshape{9}{1000}
-\setfont\indrm\rmshape{9}{1000}
-\setfont\indit\slshape{9}{1000}
-\let\indsl=\indit
-\let\indtt=\ninett
-\let\indttsl=\ninett
-\let\indsf=\indrm
-\let\indbf=\indrm
-\setfont\indsc\scshape{10}{900}
-\font\indi=cmmi9
-\font\indsy=cmsy9
-
-% Chapter (and unnumbered) fonts (17.28pt).
-\setfont\chaprm\rmbshape{12}{\magstep2}
-\setfont\chapit\itbshape{10}{\magstep3}
-\setfont\chapsl\slbshape{10}{\magstep3}
-\setfont\chaptt\ttbshape{12}{\magstep2}
-\setfont\chapttsl\ttslshape{10}{\magstep3}
-\setfont\chapsf\sfbshape{12}{\magstep2}
-\let\chapbf=\chaprm
-\setfont\chapsc\scbshape{10}{\magstep3}
-\font\chapi=cmmi12 scaled \magstep2
-\font\chapsy=cmsy10 scaled \magstep3
-
-% Section fonts (14.4pt).
-\setfont\secrm\rmbshape{12}{\magstep1}
-\setfont\secit\itbshape{10}{\magstep2}
-\setfont\secsl\slbshape{10}{\magstep2}
-\setfont\sectt\ttbshape{12}{\magstep1}
-\setfont\secttsl\ttslshape{10}{\magstep2}
-\setfont\secsf\sfbshape{12}{\magstep1}
-\let\secbf\secrm
-\setfont\secsc\scbshape{10}{\magstep2}
-\font\seci=cmmi12 scaled \magstep1
-\font\secsy=cmsy10 scaled \magstep2
-
-% \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad.
-% \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded.
-% \setfont\ssecsl\slshape{10}{\magstep1}
-% \setfont\ssectt\ttshape{10}{\magstep1}
-% \setfont\ssecsf\sfshape{10}{\magstep1}
-
-%\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
-%\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
-%\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
-%\setfont\ssectt\ttshape{10}{1315}
-%\setfont\ssecsf\sfshape{10}{1315}
-
-%\let\ssecbf=\ssecrm
-
-% Subsection fonts (13.15pt).
-\setfont\ssecrm\rmbshape{12}{\magstephalf}
-\setfont\ssecit\itbshape{10}{1315}
-\setfont\ssecsl\slbshape{10}{1315}
-\setfont\ssectt\ttbshape{12}{\magstephalf}
-\setfont\ssecttsl\ttslshape{10}{\magstep1}
-\setfont\ssecsf\sfbshape{12}{\magstephalf}
-\let\ssecbf\ssecrm
-\setfont\ssecsc\scbshape{10}{\magstep1}
-\font\sseci=cmmi12 scaled \magstephalf
-\font\ssecsy=cmsy10 scaled \magstep1
-% The smallcaps and symbol fonts should actually be scaled \magstep1.5,
-% but that is not a standard magnification.
-
-% Fonts for title page:
-\setfont\titlerm\rmbshape{12}{\magstep3}
-\let\authorrm = \secrm
-
-% In order for the font changes to affect most math symbols and letters,
-% we have to define the \textfont of the standard families. Since
-% texinfo doesn't allow for producing subscripts and superscripts, we
-% don't bother to reset \scriptfont and \scriptscriptfont (which would
-% also require loading a lot more fonts).
-%
-\def\resetmathfonts{%
- \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
- \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
- \textfont\ttfam = \tentt \textfont\sffam = \tensf
-}
-
-
-% The font-changing commands redefine the meanings of \tenSTYLE, instead
-% of just \STYLE. We do this so that font changes will continue to work
-% in math mode, where it is the current \fam that is relevant in most
-% cases, not the current font. Plain TeX does \def\bf{\fam=\bffam
-% \tenbf}, for example. By redefining \tenbf, we obviate the need to
-% redefine \bf itself.
-\def\textfonts{%
- \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
- \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
- \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
- \resetmathfonts}
-\def\chapfonts{%
- \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
- \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
- \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
- \resetmathfonts \setleading{19pt}}
-\def\secfonts{%
- \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
- \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
- \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
- \resetmathfonts \setleading{16pt}}
-\def\subsecfonts{%
- \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
- \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
- \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
- \resetmathfonts \setleading{15pt}}
-\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
-\def\indexfonts{%
- \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
- \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
- \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl
- \resetmathfonts \setleading{12pt}}
-
-% Set up the default fonts, so we can use them for creating boxes.
-%
-\textfonts
-
-% Count depth in font-changes, for error checks
-\newcount\fontdepth \fontdepth=0
-
-% Fonts for short table of contents.
-\setfont\shortcontrm\rmshape{12}{1000}
-\setfont\shortcontbf\bxshape{12}{1000}
-\setfont\shortcontsl\slshape{12}{1000}
-
-%% Add scribe-like font environments, plus @l for inline lisp (usually sans
-%% serif) and @ii for TeX italic
-
-% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
-% unless the following character is such as not to need one.
-\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
-\def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
-
-\let\i=\smartitalic
-\let\var=\smartitalic
-\let\dfn=\smartitalic
-\let\emph=\smartitalic
-\let\cite=\smartitalic
-
-\def\b#1{{\bf #1}}
-\let\strong=\b
-
-% We can't just use \exhyphenpenalty, because that only has effect at
-% the end of a paragraph. Restore normal hyphenation at the end of the
-% group within which \nohyphenation is presumably called.
-%
-\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
-\def\restorehyphenation{\hyphenchar\font = `- }
-
-\def\t#1{%
- {\tt \rawbackslash \frenchspacing #1}%
- \null
-}
-\let\ttfont=\t
-\def\samp #1{`\tclose{#1}'\null}
-\setfont\smallrm\rmshape{8}{1000}
-\font\smallsy=cmsy9
-\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
- \raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{%
- \vbox{\hrule\kern-0.4pt
- \hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}%
- \kern-0.4pt\hrule}%
- \kern-.06em\raise0.4pt\hbox{$\rangle$}}}}
-% The old definition, with no lozenge:
-%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
-\def\ctrl #1{{\tt \rawbackslash \hat}#1}
-
-\let\file=\samp
-
-% @code is a modification of @t,
-% which makes spaces the same size as normal in the surrounding text.
-\def\tclose#1{%
- {%
- % Change normal interword space to be same as for the current font.
- \spaceskip = \fontdimen2\font
- %
- % Switch to typewriter.
- \tt
- %
- % But `\ ' produces the large typewriter interword space.
- \def\ {{\spaceskip = 0pt{} }}%
- %
- % Turn off hyphenation.
- \nohyphenation
- %
- \rawbackslash
- \frenchspacing
- #1%
- }%
- \null
-}
-
-% We *must* turn on hyphenation at `-' and `_' in \code.
-% Otherwise, it is too hard to avoid overfull hboxes
-% in the Emacs manual, the Library manual, etc.
-
-% Unfortunately, TeX uses one parameter (\hyphenchar) to control
-% both hyphenation at - and hyphenation within words.
-% We must therefore turn them both off (\tclose does that)
-% and arrange explicitly to hyphenate at a dash.
-% -- rms.
-{
-\catcode`\-=\active
-\catcode`\_=\active
-\catcode`\|=\active
-\global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex}
-% The following is used by \doprintindex to insure that long function names
-% wrap around. It is necessary for - and _ to be active before the index is
-% read from the file, as \entry parses the arguments long before \code is
-% ever called. -- mycroft
-% _ is always active; and it shouldn't be \let = to an _ that is a
-% subscript character anyway. Then, @cindex @samp{_} (for example)
-% fails. --karl
-\global\def\indexbreaks{%
- \catcode`\-=\active \let-\realdash
-}
-}
-
-\def\realdash{-}
-\def\codedash{-\discretionary{}{}{}}
-\def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
-\def\codex #1{\tclose{#1}\endgroup}
-
-%\let\exp=\tclose %Was temporary
-
-% @kbd is like @code, except that if the argument is just one @key command,
-% then @kbd has no effect.
-%
-\def\xkey{\key}
-\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
-\ifx\one\xkey\ifx\threex\three \key{#2}%
-\else{\tclose{\ttsl\look}}\fi
-\else{\tclose{\ttsl\look}}\fi}
-
-% @url, @email. Quotes do not seem necessary.
-\let\url=\code % perhaps include a hypertex \special eventually
-% rms does not like the angle brackets --karl, 17may97.
-%\def\email#1{$\langle${\tt #1}$\rangle$}
-\let\email=\code
-
-% Check if we are currently using a typewriter font. Since all the
-% Computer Modern typewriter fonts have zero interword stretch (and
-% shrink), and it is reasonable to expect all typewriter fonts to have
-% this property, we can check that font parameter.
-%
-\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
-
-% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
-% argument is to make the input look right: @dmn{pt} instead of
-% @dmn{}pt.
-%
-\def\dmn#1{\thinspace #1}
-
-\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
-
-% @l was never documented to mean ``switch to the Lisp font'',
-% and it is not used as such in any manual I can find. We need it for
-% Polish suppressed-l. --karl, 22sep96.
-%\def\l#1{{\li #1}\null}
-
-\def\r#1{{\rm #1}} % roman font
-% Use of \lowercase was suggested.
-\def\sc#1{{\smallcaps#1}} % smallcaps font
-\def\ii#1{{\it #1}} % italic font
-
-% @pounds{} is a sterling sign.
-\def\pounds{{\it\$}}
-
-
-\message{page headings,}
-
-\newskip\titlepagetopglue \titlepagetopglue = 1.5in
-\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
-
-% First the title page. Must do @settitle before @titlepage.
-\def\titlefont#1{{\titlerm #1}}
-
-\newif\ifseenauthor
-\newif\iffinishedtitlepage
-
-\def\shorttitlepage{\parsearg\shorttitlepagezzz}
-\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
- \endgroup\page\hbox{}\page}
-
-\def\titlepage{\begingroup \parindent=0pt \textfonts
- \let\subtitlerm=\tenrm
-% I deinstalled the following change because \cmr12 is undefined.
-% This change was not in the ChangeLog anyway. --rms.
-% \let\subtitlerm=\cmr12
- \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
- %
- \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
- %
- % Leave some space at the very top of the page.
- \vglue\titlepagetopglue
- %
- % Now you can print the title using @title.
- \def\title{\parsearg\titlezzz}%
- \def\titlezzz##1{\leftline{\titlefont{##1}}
- % print a rule at the page bottom also.
- \finishedtitlepagefalse
- \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
- % No rule at page bottom unless we print one at the top with @title.
- \finishedtitlepagetrue
- %
- % Now you can put text using @subtitle.
- \def\subtitle{\parsearg\subtitlezzz}%
- \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
- %
- % @author should come last, but may come many times.
- \def\author{\parsearg\authorzzz}%
- \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
- {\authorfont \leftline{##1}}}%
- %
- % Most title ``pages'' are actually two pages long, with space
- % at the top of the second. We don't want the ragged left on the second.
- \let\oldpage = \page
- \def\page{%
- \iffinishedtitlepage\else
- \finishtitlepage
- \fi
- \oldpage
- \let\page = \oldpage
- \hbox{}}%
-% \def\page{\oldpage \hbox{}}
-}
-
-\def\Etitlepage{%
- \iffinishedtitlepage\else
- \finishtitlepage
- \fi
- % It is important to do the page break before ending the group,
- % because the headline and footline are only empty inside the group.
- % If we use the new definition of \page, we always get a blank page
- % after the title page, which we certainly don't want.
- \oldpage
- \endgroup
- \HEADINGSon
-}
-
-\def\finishtitlepage{%
- \vskip4pt \hrule height 2pt width \hsize
- \vskip\titlepagebottomglue
- \finishedtitlepagetrue
-}
-
-%%% Set up page headings and footings.
-
-\let\thispage=\folio
-
-\newtoks \evenheadline % Token sequence for heading line of even pages
-\newtoks \oddheadline % Token sequence for heading line of odd pages
-\newtoks \evenfootline % Token sequence for footing line of even pages
-\newtoks \oddfootline % Token sequence for footing line of odd pages
-
-% Now make Tex use those variables
-\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
- \else \the\evenheadline \fi}}
-\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
- \else \the\evenfootline \fi}\HEADINGShook}
-\let\HEADINGShook=\relax
-
-% Commands to set those variables.
-% For example, this is what @headings on does
-% @evenheading @thistitle|@thispage|@thischapter
-% @oddheading @thischapter|@thispage|@thistitle
-% @evenfooting @thisfile||
-% @oddfooting ||@thisfile
-
-\def\evenheading{\parsearg\evenheadingxxx}
-\def\oddheading{\parsearg\oddheadingxxx}
-\def\everyheading{\parsearg\everyheadingxxx}
-
-\def\evenfooting{\parsearg\evenfootingxxx}
-\def\oddfooting{\parsearg\oddfootingxxx}
-\def\everyfooting{\parsearg\everyfootingxxx}
-
-{\catcode`\@=0 %
-
-\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
-\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
-\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
-\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
-\gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
-\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
-\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
-\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
-\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
-\gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
-\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
-\global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-%
-}% unbind the catcode of @.
-
-% @headings double turns headings on for double-sided printing.
-% @headings single turns headings on for single-sided printing.
-% @headings off turns them off.
-% @headings on same as @headings double, retained for compatibility.
-% @headings after turns on double-sided headings after this page.
-% @headings doubleafter turns on double-sided headings after this page.
-% @headings singleafter turns on single-sided headings after this page.
-% By default, they are off at the start of a document,
-% and turned `on' after @end titlepage.
-
-\def\headings #1 {\csname HEADINGS#1\endcsname}
-
-\def\HEADINGSoff{
-\global\evenheadline={\hfil} \global\evenfootline={\hfil}
-\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
-\HEADINGSoff
-% When we turn headings on, set the page number to 1.
-% For double-sided printing, put current file name in lower left corner,
-% chapter name on inside top of right hand pages, document
-% title on inside top of left hand pages, and page numbers on outside top
-% edge of all pages.
-\def\HEADINGSdouble{
-\global\pageno=1
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\folio\hfil\thistitle}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chapoddpage
-}
-\let\contentsalignmacro = \chappager
-
-% For single-sided printing, chapter title goes across top left of page,
-% page number on top right.
-\def\HEADINGSsingle{
-\global\pageno=1
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\thischapter\hfil\folio}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chappager
-}
-\def\HEADINGSon{\HEADINGSdouble}
-
-\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
-\let\HEADINGSdoubleafter=\HEADINGSafter
-\def\HEADINGSdoublex{%
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\folio\hfil\thistitle}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chapoddpage
-}
-
-\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
-\def\HEADINGSsinglex{%
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\thischapter\hfil\folio}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chappager
-}
-
-% Subroutines used in generating headings
-% Produces Day Month Year style of output.
-\def\today{\number\day\space
-\ifcase\month\or
-January\or February\or March\or April\or May\or June\or
-July\or August\or September\or October\or November\or December\fi
-\space\number\year}
-
-% Use this if you want the Month Day, Year style of output.
-%\def\today{\ifcase\month\or
-%January\or February\or March\or April\or May\or June\or
-%July\or August\or September\or October\or November\or December\fi
-%\space\number\day, \number\year}
-
-% @settitle line... specifies the title of the document, for headings
-% It generates no output of its own
-
-\def\thistitle{No Title}
-\def\settitle{\parsearg\settitlezzz}
-\def\settitlezzz #1{\gdef\thistitle{#1}}
-
-
-\message{tables,}
-
-% @tabs -- simple alignment
-
-% These don't work. For one thing, \+ is defined as outer.
-% So these macros cannot even be defined.
-
-%\def\tabs{\parsearg\tabszzz}
-%\def\tabszzz #1{\settabs\+#1\cr}
-%\def\tabline{\parsearg\tablinezzz}
-%\def\tablinezzz #1{\+#1\cr}
-%\def\&{&}
-
-% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
-
-% default indentation of table text
-\newdimen\tableindent \tableindent=.8in
-% default indentation of @itemize and @enumerate text
-\newdimen\itemindent \itemindent=.3in
-% margin between end of table item and start of table text.
-\newdimen\itemmargin \itemmargin=.1in
-
-% used internally for \itemindent minus \itemmargin
-\newdimen\itemmax
-
-% Note @table, @vtable, and @vtable define @item, @itemx, etc., with
-% these defs.
-% They also define \itemindex
-% to index the item name in whatever manner is desired (perhaps none).
-
-\newif\ifitemxneedsnegativevskip
-
-\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
-
-\def\internalBitem{\smallbreak \parsearg\itemzzz}
-\def\internalBitemx{\itemxpar \parsearg\itemzzz}
-
-\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
-\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
-
-\def\internalBkitem{\smallbreak \parsearg\kitemzzz}
-\def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
-
-\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
- \itemzzz {#1}}
-
-\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
- \itemzzz {#1}}
-
-\def\itemzzz #1{\begingroup %
- \advance\hsize by -\rightskip
- \advance\hsize by -\tableindent
- \setbox0=\hbox{\itemfont{#1}}%
- \itemindex{#1}%
- \nobreak % This prevents a break before @itemx.
- %
- % Be sure we are not still in the middle of a paragraph.
- %{\parskip = 0in
- %\par
- %}%
- %
- % If the item text does not fit in the space we have, put it on a line
- % by itself, and do not allow a page break either before or after that
- % line. We do not start a paragraph here because then if the next
- % command is, e.g., @kindex, the whatsit would get put into the
- % horizontal list on a line by itself, resulting in extra blank space.
- \ifdim \wd0>\itemmax
- %
- % Make this a paragraph so we get the \parskip glue and wrapping,
- % but leave it ragged-right.
- \begingroup
- \advance\leftskip by-\tableindent
- \advance\hsize by\tableindent
- \advance\rightskip by0pt plus1fil
- \leavevmode\unhbox0\par
- \endgroup
- %
- % We're going to be starting a paragraph, but we don't want the
- % \parskip glue -- logically it's part of the @item we just started.
- \nobreak \vskip-\parskip
- %
- % Stop a page break at the \parskip glue coming up. Unfortunately
- % we can't prevent a possible page break at the following
- % \baselineskip glue.
- \nobreak
- \endgroup
- \itemxneedsnegativevskipfalse
- \else
- % The item text fits into the space. Start a paragraph, so that the
- % following text (if any) will end up on the same line. Since that
- % text will be indented by \tableindent, we make the item text be in
- % a zero-width box.
- \noindent
- \rlap{\hskip -\tableindent\box0}\ignorespaces%
- \endgroup%
- \itemxneedsnegativevskiptrue%
- \fi
-}
-
-\def\item{\errmessage{@item while not in a table}}
-\def\itemx{\errmessage{@itemx while not in a table}}
-\def\kitem{\errmessage{@kitem while not in a table}}
-\def\kitemx{\errmessage{@kitemx while not in a table}}
-\def\xitem{\errmessage{@xitem while not in a table}}
-\def\xitemx{\errmessage{@xitemx while not in a table}}
-
-%% Contains a kludge to get @end[description] to work
-\def\description{\tablez{\dontindex}{1}{}{}{}{}}
-
-\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
-{\obeylines\obeyspaces%
-\gdef\tablex #1^^M{%
-\tabley\dontindex#1 \endtabley}}
-
-\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
-{\obeylines\obeyspaces%
-\gdef\ftablex #1^^M{%
-\tabley\fnitemindex#1 \endtabley
-\def\Eftable{\endgraf\afterenvbreak\endgroup}%
-\let\Etable=\relax}}
-
-\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
-{\obeylines\obeyspaces%
-\gdef\vtablex #1^^M{%
-\tabley\vritemindex#1 \endtabley
-\def\Evtable{\endgraf\afterenvbreak\endgroup}%
-\let\Etable=\relax}}
-
-\def\dontindex #1{}
-\def\fnitemindex #1{\doind {fn}{\code{#1}}}%
-\def\vritemindex #1{\doind {vr}{\code{#1}}}%
-
-{\obeyspaces %
-\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
-\tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
-
-\def\tablez #1#2#3#4#5#6{%
-\aboveenvbreak %
-\begingroup %
-\def\Edescription{\Etable}% Necessary kludge.
-\let\itemindex=#1%
-\ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
-\ifnum 0#4>0 \tableindent=#4\mil \fi %
-\ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
-\def\itemfont{#2}%
-\itemmax=\tableindent %
-\advance \itemmax by -\itemmargin %
-\advance \leftskip by \tableindent %
-\exdentamount=\tableindent
-\parindent = 0pt
-\parskip = \smallskipamount
-\ifdim \parskip=0pt \parskip=2pt \fi%
-\def\Etable{\endgraf\afterenvbreak\endgroup}%
-\let\item = \internalBitem %
-\let\itemx = \internalBitemx %
-\let\kitem = \internalBkitem %
-\let\kitemx = \internalBkitemx %
-\let\xitem = \internalBxitem %
-\let\xitemx = \internalBxitemx %
-}
-
-% This is the counter used by @enumerate, which is really @itemize
-
-\newcount \itemno
-
-\def\itemize{\parsearg\itemizezzz}
-
-\def\itemizezzz #1{%
- \begingroup % ended by the @end itemsize
- \itemizey {#1}{\Eitemize}
-}
-
-\def\itemizey #1#2{%
-\aboveenvbreak %
-\itemmax=\itemindent %
-\advance \itemmax by -\itemmargin %
-\advance \leftskip by \itemindent %
-\exdentamount=\itemindent
-\parindent = 0pt %
-\parskip = \smallskipamount %
-\ifdim \parskip=0pt \parskip=2pt \fi%
-\def#2{\endgraf\afterenvbreak\endgroup}%
-\def\itemcontents{#1}%
-\let\item=\itemizeitem}
-
-% Set sfcode to normal for the chars that usually have another value.
-% These are `.?!:;,'
-\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
- \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
-
-% \splitoff TOKENS\endmark defines \first to be the first token in
-% TOKENS, and \rest to be the remainder.
-%
-\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
-
-% Allow an optional argument of an uppercase letter, lowercase letter,
-% or number, to specify the first label in the enumerated list. No
-% argument is the same as `1'.
-%
-\def\enumerate{\parsearg\enumeratezzz}
-\def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
-\def\enumeratey #1 #2\endenumeratey{%
- \begingroup % ended by the @end enumerate
- %
- % If we were given no argument, pretend we were given `1'.
- \def\thearg{#1}%
- \ifx\thearg\empty \def\thearg{1}\fi
- %
- % Detect if the argument is a single token. If so, it might be a
- % letter. Otherwise, the only valid thing it can be is a number.
- % (We will always have one token, because of the test we just made.
- % This is a good thing, since \splitoff doesn't work given nothing at
- % all -- the first parameter is undelimited.)
- \expandafter\splitoff\thearg\endmark
- \ifx\rest\empty
- % Only one token in the argument. It could still be anything.
- % A ``lowercase letter'' is one whose \lccode is nonzero.
- % An ``uppercase letter'' is one whose \lccode is both nonzero, and
- % not equal to itself.
- % Otherwise, we assume it's a number.
- %
- % We need the \relax at the end of the \ifnum lines to stop TeX from
- % continuing to look for a <number>.
- %
- \ifnum\lccode\expandafter`\thearg=0\relax
- \numericenumerate % a number (we hope)
- \else
- % It's a letter.
- \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
- \lowercaseenumerate % lowercase letter
- \else
- \uppercaseenumerate % uppercase letter
- \fi
- \fi
- \else
- % Multiple tokens in the argument. We hope it's a number.
- \numericenumerate
- \fi
-}
-
-% An @enumerate whose labels are integers. The starting integer is
-% given in \thearg.
-%
-\def\numericenumerate{%
- \itemno = \thearg
- \startenumeration{\the\itemno}%
-}
-
-% The starting (lowercase) letter is in \thearg.
-\def\lowercaseenumerate{%
- \itemno = \expandafter`\thearg
- \startenumeration{%
- % Be sure we're not beyond the end of the alphabet.
- \ifnum\itemno=0
- \errmessage{No more lowercase letters in @enumerate; get a bigger
- alphabet}%
- \fi
- \char\lccode\itemno
- }%
-}
-
-% The starting (uppercase) letter is in \thearg.
-\def\uppercaseenumerate{%
- \itemno = \expandafter`\thearg
- \startenumeration{%
- % Be sure we're not beyond the end of the alphabet.
- \ifnum\itemno=0
- \errmessage{No more uppercase letters in @enumerate; get a bigger
- alphabet}
- \fi
- \char\uccode\itemno
- }%
-}
-
-% Call itemizey, adding a period to the first argument and supplying the
-% common last two arguments. Also subtract one from the initial value in
-% \itemno, since @item increments \itemno.
-%
-\def\startenumeration#1{%
- \advance\itemno by -1
- \itemizey{#1.}\Eenumerate\flushcr
-}
-
-% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
-% to @enumerate.
-%
-\def\alphaenumerate{\enumerate{a}}
-\def\capsenumerate{\enumerate{A}}
-\def\Ealphaenumerate{\Eenumerate}
-\def\Ecapsenumerate{\Eenumerate}
-
-% Definition of @item while inside @itemize.
-
-\def\itemizeitem{%
-\advance\itemno by 1
-{\let\par=\endgraf \smallbreak}%
-\ifhmode \errmessage{In hmode at itemizeitem}\fi
-{\parskip=0in \hskip 0pt
-\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
-\vadjust{\penalty 1200}}%
-\flushcr}
-
-% @multitable macros
-% Amy Hendrickson, 8/18/94, 3/6/96
-%
-% @multitable ... @end multitable will make as many columns as desired.
-% Contents of each column will wrap at width given in preamble. Width
-% can be specified either with sample text given in a template line,
-% or in percent of \hsize, the current width of text on page.
-
-% Table can continue over pages but will only break between lines.
-
-% To make preamble:
-%
-% Either define widths of columns in terms of percent of \hsize:
-% @multitable @columnfractions .25 .3 .45
-% @item ...
-%
-% Numbers following @columnfractions are the percent of the total
-% current hsize to be used for each column. You may use as many
-% columns as desired.
-
-
-% Or use a template:
-% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
-% @item ...
-% using the widest term desired in each column.
-%
-% For those who want to use more than one line's worth of words in
-% the preamble, break the line within one argument and it
-% will parse correctly, i.e.,
-%
-% @multitable {Column 1 template} {Column 2 template} {Column 3
-% template}
-% Not:
-% @multitable {Column 1 template} {Column 2 template}
-% {Column 3 template}
-
-% Each new table line starts with @item, each subsequent new column
-% starts with @tab. Empty columns may be produced by supplying @tab's
-% with nothing between them for as many times as empty columns are needed,
-% ie, @tab@tab@tab will produce two empty columns.
-
-% @item, @tab, @multitable or @end multitable do not need to be on their
-% own lines, but it will not hurt if they are.
-
-% Sample multitable:
-
-% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
-% @item first col stuff @tab second col stuff @tab third col
-% @item
-% first col stuff
-% @tab
-% second col stuff
-% @tab
-% third col
-% @item first col stuff @tab second col stuff
-% @tab Many paragraphs of text may be used in any column.
-%
-% They will wrap at the width determined by the template.
-% @item@tab@tab This will be in third column.
-% @end multitable
-
-% Default dimensions may be reset by user.
-% @multitableparskip is vertical space between paragraphs in table.
-% @multitableparindent is paragraph indent in table.
-% @multitablecolmargin is horizontal space to be left between columns.
-% @multitablelinespace is space to leave between table items, baseline
-% to baseline.
-% 0pt means it depends on current normal line spacing.
-
-%%%%
-% Dimensions
-
-\newskip\multitableparskip
-\newskip\multitableparindent
-\newdimen\multitablecolspace
-\newskip\multitablelinespace
-\multitableparskip=0pt
-\multitableparindent=6pt
-\multitablecolspace=12pt
-\multitablelinespace=0pt
-
-%%%%
-% Macros used to set up halign preamble:
-\let\endsetuptable\relax
-\def\xendsetuptable{\endsetuptable}
-\let\columnfractions\relax
-\def\xcolumnfractions{\columnfractions}
-\newif\ifsetpercent
-
-%% 2/1/96, to allow fractions to be given with more than one digit.
-\def\pickupwholefraction#1 {\global\advance\colcount by1 %
-\expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
-\setuptable}
-
-\newcount\colcount
-\def\setuptable#1{\def\firstarg{#1}%
-\ifx\firstarg\xendsetuptable\let\go\relax%
-\else
- \ifx\firstarg\xcolumnfractions\global\setpercenttrue%
- \else
- \ifsetpercent
- \let\go\pickupwholefraction % In this case arg of setuptable
- % is the decimal point before the
- % number given in percent of hsize.
- % We don't need this so we don't use it.
- \else
- \global\advance\colcount by1
- \setbox0=\hbox{#1 }% Add a normal word space as a separator;
- % typically that is always in the input, anyway.
- \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
- \fi%
- \fi%
-\ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
-\fi\go}
-
-%%%%
-% multitable syntax
-\def\tab{&\hskip1sp\relax} % 2/2/96
- % tiny skip here makes sure this column space is
- % maintained, even if it is never used.
-
-
-%%%%
-% @multitable ... @end multitable definitions:
-
-\def\multitable{\parsearg\dotable}
-
-\def\dotable#1{\bgroup
-\let\item\cr
-\tolerance=9500
-\hbadness=9500
-\setmultitablespacing
-\parskip=\multitableparskip
-\parindent=\multitableparindent
-\overfullrule=0pt
-\global\colcount=0\relax%
-\def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}%
- % To parse everything between @multitable and @item :
-\setuptable#1 \endsetuptable
- % Need to reset this to 0 after \setuptable.
-\global\colcount=0\relax%
- %
- % This preamble sets up a generic column definition, which will
- % be used as many times as user calls for columns.
- % \vtop will set a single line and will also let text wrap and
- % continue for many paragraphs if desired.
-\halign\bgroup&\global\advance\colcount by 1\relax%
-\multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
- % In order to keep entries from bumping into each other
- % we will add a \leftskip of \multitablecolspace to all columns after
- % the first one.
- % If a template has been used, we will add \multitablecolspace
- % to the width of each template entry.
- % If user has set preamble in terms of percent of \hsize
- % we will use that dimension as the width of the column, and
- % the \leftskip will keep entries from bumping into each other.
- % Table will start at left margin and final column will justify at
- % right margin.
-\ifnum\colcount=1
-\else
- \ifsetpercent
- \else
- % If user has <not> set preamble in terms of percent of \hsize
- % we will advance \hsize by \multitablecolspace
- \advance\hsize by \multitablecolspace
- \fi
- % In either case we will make \leftskip=\multitablecolspace:
-\leftskip=\multitablecolspace
-\fi
- % Ignoring space at the beginning and end avoids an occasional spurious
- % blank line, when TeX decides to break the line at the space before the
- % box from the multistrut, so the strut ends up on a line by itself.
- % For example:
- % @multitable @columnfractions .11 .89
- % @item @code{#}
- % @tab Legal holiday which is valid in major parts of the whole country.
- % Is automatically provided with highlighting sequences respectively marking
- % characters.
- \noindent\ignorespaces##\unskip\multistrut}\cr
- % \everycr will reset column counter, \colcount, at the end of
- % each line. Every column entry will cause \colcount to advance by one.
- % The table preamble
- % looks at the current \colcount to find the correct column width.
-\global\everycr{\noalign{%
-% \filbreak%% keeps underfull box messages off when table breaks over pages.
-% Maybe so, but it also creates really weird page breaks when the table
-% breaks over pages Wouldn't \vfil be better? Wait until the problem
-% manifests itself, so it can be fixed for real --karl.
-\global\colcount=0\relax}}
-}
-
-\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
-% If so, do nothing. If not, give it an appropriate dimension based on
-% current baselineskip.
-\ifdim\multitablelinespace=0pt
-%% strut to put in table in case some entry doesn't have descenders,
-%% to keep lines equally spaced
-\let\multistrut = \strut
-%% Test to see if parskip is larger than space between lines of
-%% table. If not, do nothing.
-%% If so, set to same dimension as multitablelinespace.
-\else
-\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
-width0pt\relax} \fi
-\ifdim\multitableparskip>\multitablelinespace
-\global\multitableparskip=\multitablelinespace
-\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
- %% than skip between lines in the table.
-\fi%
-\ifdim\multitableparskip=0pt
-\global\multitableparskip=\multitablelinespace
-\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
- %% than skip between lines in the table.
-\fi}
-
-
-\message{indexing,}
-% Index generation facilities
-
-% Define \newwrite to be identical to plain tex's \newwrite
-% except not \outer, so it can be used within \newindex.
-{\catcode`\@=11
-\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
-
-% \newindex {foo} defines an index named foo.
-% It automatically defines \fooindex such that
-% \fooindex ...rest of line... puts an entry in the index foo.
-% It also defines \fooindfile to be the number of the output channel for
-% the file that accumulates this index. The file's extension is foo.
-% The name of an index should be no more than 2 characters long
-% for the sake of vms.
-
-\def\newindex #1{
-\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
-\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\doindex {#1}}
-}
-
-% @defindex foo == \newindex{foo}
-
-\def\defindex{\parsearg\newindex}
-
-% Define @defcodeindex, like @defindex except put all entries in @code.
-
-\def\newcodeindex #1{
-\expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
-\openout \csname#1indfile\endcsname \jobname.#1 % Open the file
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\docodeindex {#1}}
-}
-
-\def\defcodeindex{\parsearg\newcodeindex}
-
-% @synindex foo bar makes index foo feed into index bar.
-% Do this instead of @defindex foo if you don't want it as a separate index.
-\def\synindex #1 #2 {%
-\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
-\expandafter\let\csname#1indfile\endcsname=\synindexfoo
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\doindex {#2}}%
-}
-
-% @syncodeindex foo bar similar, but put all entries made for index foo
-% inside @code.
-\def\syncodeindex #1 #2 {%
-\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
-\expandafter\let\csname#1indfile\endcsname=\synindexfoo
-\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
-\noexpand\docodeindex {#2}}%
-}
-
-% Define \doindex, the driver for all \fooindex macros.
-% Argument #1 is generated by the calling \fooindex macro,
-% and it is "foo", the name of the index.
-
-% \doindex just uses \parsearg; it calls \doind for the actual work.
-% This is because \doind is more useful to call from other macros.
-
-% There is also \dosubind {index}{topic}{subtopic}
-% which makes an entry in a two-level index such as the operation index.
-
-\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
-\def\singleindexer #1{\doind{\indexname}{#1}}
-
-% like the previous two, but they put @code around the argument.
-\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
-\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
-
-\def\indexdummies{%
-% Take care of the plain tex accent commands.
-\def\"{\realbackslash "}%
-\def\`{\realbackslash `}%
-\def\'{\realbackslash '}%
-\def\^{\realbackslash ^}%
-\def\~{\realbackslash ~}%
-\def\={\realbackslash =}%
-\def\b{\realbackslash b}%
-\def\c{\realbackslash c}%
-\def\d{\realbackslash d}%
-\def\u{\realbackslash u}%
-\def\v{\realbackslash v}%
-\def\H{\realbackslash H}%
-% Take care of the plain tex special European modified letters.
-\def\oe{\realbackslash oe}%
-\def\ae{\realbackslash ae}%
-\def\aa{\realbackslash aa}%
-\def\OE{\realbackslash OE}%
-\def\AE{\realbackslash AE}%
-\def\AA{\realbackslash AA}%
-\def\o{\realbackslash o}%
-\def\O{\realbackslash O}%
-\def\l{\realbackslash l}%
-\def\L{\realbackslash L}%
-\def\ss{\realbackslash ss}%
-% Take care of texinfo commands likely to appear in an index entry.
-% (Must be a way to avoid doing expansion at all, and thus not have to
-% laboriously list every single command here.)
-\def\@{@}% will be @@ when we switch to @ as escape char.
-%\let\{ = \lbracecmd
-%\let\} = \rbracecmd
-\def\_{{\realbackslash _}}%
-\def\w{\realbackslash w }%
-\def\bf{\realbackslash bf }%
-%\def\rm{\realbackslash rm }%
-\def\sl{\realbackslash sl }%
-\def\sf{\realbackslash sf}%
-\def\tt{\realbackslash tt}%
-\def\gtr{\realbackslash gtr}%
-\def\less{\realbackslash less}%
-\def\hat{\realbackslash hat}%
-%\def\char{\realbackslash char}%
-\def\TeX{\realbackslash TeX}%
-\def\dots{\realbackslash dots }%
-\def\copyright{\realbackslash copyright }%
-\def\tclose##1{\realbackslash tclose {##1}}%
-\def\code##1{\realbackslash code {##1}}%
-\def\dotless##1{\realbackslash dotless {##1}}%
-\def\samp##1{\realbackslash samp {##1}}%
-\def\,##1{\realbackslash ,{##1}}%
-\def\t##1{\realbackslash t {##1}}%
-\def\r##1{\realbackslash r {##1}}%
-\def\i##1{\realbackslash i {##1}}%
-\def\b##1{\realbackslash b {##1}}%
-\def\sc##1{\realbackslash sc {##1}}%
-\def\cite##1{\realbackslash cite {##1}}%
-\def\key##1{\realbackslash key {##1}}%
-\def\file##1{\realbackslash file {##1}}%
-\def\var##1{\realbackslash var {##1}}%
-\def\kbd##1{\realbackslash kbd {##1}}%
-\def\dfn##1{\realbackslash dfn {##1}}%
-\def\emph##1{\realbackslash emph {##1}}%
-\unsepspaces
-}
-
-% If an index command is used in an @example environment, any spaces
-% therein should become regular spaces in the raw index file, not the
-% expansion of \tie (\\leavevmode \penalty \@M \ ).
-{\obeyspaces
- \gdef\unsepspaces{\obeyspaces\let =\space}}
-
-% \indexnofonts no-ops all font-change commands.
-% This is used when outputting the strings to sort the index by.
-\def\indexdummyfont#1{#1}
-\def\indexdummytex{TeX}
-\def\indexdummydots{...}
-
-\def\indexnofonts{%
-% Just ignore accents.
-\let\,=\indexdummyfont
-\let\"=\indexdummyfont
-\let\`=\indexdummyfont
-\let\'=\indexdummyfont
-\let\^=\indexdummyfont
-\let\~=\indexdummyfont
-\let\==\indexdummyfont
-\let\b=\indexdummyfont
-\let\c=\indexdummyfont
-\let\d=\indexdummyfont
-\let\u=\indexdummyfont
-\let\v=\indexdummyfont
-\let\H=\indexdummyfont
-\let\dotless=\indexdummyfont
-% Take care of the plain tex special European modified letters.
-\def\oe{oe}%
-\def\ae{ae}%
-\def\aa{aa}%
-\def\OE{OE}%
-\def\AE{AE}%
-\def\AA{AA}%
-\def\o{o}%
-\def\O{O}%
-\def\l{l}%
-\def\L{L}%
-\def\ss{ss}%
-\let\w=\indexdummyfont
-\let\t=\indexdummyfont
-\let\r=\indexdummyfont
-\let\i=\indexdummyfont
-\let\b=\indexdummyfont
-\let\emph=\indexdummyfont
-\let\strong=\indexdummyfont
-\let\cite=\indexdummyfont
-\let\sc=\indexdummyfont
-%Don't no-op \tt, since it isn't a user-level command
-% and is used in the definitions of the active chars like <, >, |...
-%\let\tt=\indexdummyfont
-\let\tclose=\indexdummyfont
-\let\code=\indexdummyfont
-\let\file=\indexdummyfont
-\let\samp=\indexdummyfont
-\let\kbd=\indexdummyfont
-\let\key=\indexdummyfont
-\let\var=\indexdummyfont
-\let\TeX=\indexdummytex
-\let\dots=\indexdummydots
-\def\@{@}%
-}
-
-% To define \realbackslash, we must make \ not be an escape.
-% We must first make another character (@) an escape
-% so we do not become unable to do a definition.
-
-{\catcode`\@=0 \catcode`\\=\other
-@gdef@realbackslash{\}}
-
-\let\indexbackslash=0 %overridden during \printindex.
-
-\let\SETmarginindex=\relax %initialize!
-% workhorse for all \fooindexes
-% #1 is name of index, #2 is stuff to put there
-\def\doind #1#2{%
- % Put the index entry in the margin if desired.
- \ifx\SETmarginindex\relax\else
- \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
- \fi
- {%
- \count255=\lastpenalty
- {%
- \indexdummies % Must do this here, since \bf, etc expand at this stage
- \escapechar=`\\
- {%
- \let\folio=0% We will expand all macros now EXCEPT \folio.
- \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
- % so it will be output as is; and it will print as backslash.
- %
- % First process the index-string with all font commands turned off
- % to get the string to sort by.
- {\indexnofonts \xdef\indexsorttmp{#2}}%
- %
- % Now produce the complete index entry, with both the sort key and the
- % original text, including any font commands.
- \toks0 = {#2}%
- \edef\temp{%
- \write\csname#1indfile\endcsname{%
- \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
- }%
- \temp
- }%
- }%
- \penalty\count255
- }%
-}
-
-\def\dosubind #1#2#3{%
-{\count10=\lastpenalty %
-{\indexdummies % Must do this here, since \bf, etc expand at this stage
-\escapechar=`\\%
-{\let\folio=0%
-\def\rawbackslashxx{\indexbackslash}%
-%
-% Now process the index-string once, with all font commands turned off,
-% to get the string to sort the index by.
-{\indexnofonts
-\xdef\temp1{#2 #3}%
-}%
-% Now produce the complete index entry. We process the index-string again,
-% this time with font commands expanded, to get what to print in the index.
-\edef\temp{%
-\write \csname#1indfile\endcsname{%
-\realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
-\temp }%
-}\penalty\count10}}
-
-% The index entry written in the file actually looks like
-% \entry {sortstring}{page}{topic}
-% or
-% \entry {sortstring}{page}{topic}{subtopic}
-% The texindex program reads in these files and writes files
-% containing these kinds of lines:
-% \initial {c}
-% before the first topic whose initial is c
-% \entry {topic}{pagelist}
-% for a topic that is used without subtopics
-% \primary {topic}
-% for the beginning of a topic that is used with subtopics
-% \secondary {subtopic}{pagelist}
-% for each subtopic.
-
-% Define the user-accessible indexing commands
-% @findex, @vindex, @kindex, @cindex.
-
-\def\findex {\fnindex}
-\def\kindex {\kyindex}
-\def\cindex {\cpindex}
-\def\vindex {\vrindex}
-\def\tindex {\tpindex}
-\def\pindex {\pgindex}
-
-\def\cindexsub {\begingroup\obeylines\cindexsub}
-{\obeylines %
-\gdef\cindexsub "#1" #2^^M{\endgroup %
-\dosubind{cp}{#2}{#1}}}
-
-% Define the macros used in formatting output of the sorted index material.
-
-% @printindex causes a particular index (the ??s file) to get printed.
-% It does not print any chapter heading (usually an @unnumbered).
-%
-\def\printindex{\parsearg\doprintindex}
-\def\doprintindex#1{\begingroup
- \dobreak \chapheadingskip{10000}%
- %
- \indexfonts \rm
- \tolerance = 9500
- \indexbreaks
- %
- % See if the index file exists and is nonempty.
- \openin 1 \jobname.#1s
- \ifeof 1
- % \enddoublecolumns gets confused if there is no text in the index,
- % and it loses the chapter title and the aux file entries for the
- % index. The easiest way to prevent this problem is to make sure
- % there is some text.
- (Index is nonexistent)
- \else
- %
- % If the index file exists but is empty, then \openin leaves \ifeof
- % false. We have to make TeX try to read something from the file, so
- % it can discover if there is anything in it.
- \read 1 to \temp
- \ifeof 1
- (Index is empty)
- \else
- % Index files are almost Texinfo source, but we use \ as the escape
- % character. It would be better to use @, but that's too big a change
- % to make right now.
- \def\indexbackslash{\rawbackslashxx}%
- \catcode`\\ = 0
- \catcode`\@ = 11
- \escapechar = `\\
- \begindoublecolumns
- \input \jobname.#1s
- \enddoublecolumns
- \fi
- \fi
- \closein 1
-\endgroup}
-
-% These macros are used by the sorted index file itself.
-% Change them to control the appearance of the index.
-
-% Same as \bigskipamount except no shrink.
-% \balancecolumns gets confused if there is any shrink.
-\newskip\initialskipamount \initialskipamount 12pt plus4pt
-
-\def\initial #1{%
-{\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
-\ifdim\lastskip<\initialskipamount
-\removelastskip \penalty-200 \vskip \initialskipamount\fi
-\line{\secbf#1\hfill}\kern 2pt\penalty10000}}
-
-% This typesets a paragraph consisting of #1, dot leaders, and then #2
-% flush to the right margin. It is used for index and table of contents
-% entries. The paragraph is indented by \leftskip.
-%
-\def\entry #1#2{\begingroup
- %
- % Start a new paragraph if necessary, so our assignments below can't
- % affect previous text.
- \par
- %
- % Do not fill out the last line with white space.
- \parfillskip = 0in
- %
- % No extra space above this paragraph.
- \parskip = 0in
- %
- % Do not prefer a separate line ending with a hyphen to fewer lines.
- \finalhyphendemerits = 0
- %
- % \hangindent is only relevant when the entry text and page number
- % don't both fit on one line. In that case, bob suggests starting the
- % dots pretty far over on the line. Unfortunately, a large
- % indentation looks wrong when the entry text itself is broken across
- % lines. So we use a small indentation and put up with long leaders.
- %
- % \hangafter is reset to 1 (which is the value we want) at the start
- % of each paragraph, so we need not do anything with that.
- \hangindent=2em
- %
- % When the entry text needs to be broken, just fill out the first line
- % with blank space.
- \rightskip = 0pt plus1fil
- %
- % Start a ``paragraph'' for the index entry so the line breaking
- % parameters we've set above will have an effect.
- \noindent
- %
- % Insert the text of the index entry. TeX will do line-breaking on it.
- #1%
- % The following is kludged to not output a line of dots in the index if
- % there are no page numbers. The next person who breaks this will be
- % cursed by a Unix daemon.
- \def\tempa{{\rm }}%
- \def\tempb{#2}%
- \edef\tempc{\tempa}%
- \edef\tempd{\tempb}%
- \ifx\tempc\tempd\ \else%
- %
- % If we must, put the page number on a line of its own, and fill out
- % this line with blank space. (The \hfil is overwhelmed with the
- % fill leaders glue in \indexdotfill if the page number does fit.)
- \hfil\penalty50
- \null\nobreak\indexdotfill % Have leaders before the page number.
- %
- % The `\ ' here is removed by the implicit \unskip that TeX does as
- % part of (the primitive) \par. Without it, a spurious underfull
- % \hbox ensues.
- \ #2% The page number ends the paragraph.
- \fi%
- \par
-\endgroup}
-
-% Like \dotfill except takes at least 1 em.
-\def\indexdotfill{\cleaders
- \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
-
-\def\primary #1{\line{#1\hfil}}
-
-\newskip\secondaryindent \secondaryindent=0.5cm
-
-\def\secondary #1#2{
-{\parfillskip=0in \parskip=0in
-\hangindent =1in \hangafter=1
-\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
-}}
-
-% Define two-column mode, which we use to typeset indexes.
-% Adapted from the TeXbook, page 416, which is to say,
-% the manmac.tex format used to print the TeXbook itself.
-\catcode`\@=11
-
-\newbox\partialpage
-\newdimen\doublecolumnhsize
-
-\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
- % Grab any single-column material above us.
- \output = {\global\setbox\partialpage = \vbox{%
- %
- % Here is a possibility not foreseen in manmac: if we accumulate a
- % whole lot of material, we might end up calling this \output
- % routine twice in a row (see the doublecol-lose test, which is
- % essentially a couple of indexes with @setchapternewpage off). In
- % that case, we must prevent the second \partialpage from
- % simply overwriting the first, causing us to lose the page.
- % This will preserve it until a real output routine can ship it
- % out. Generally, \partialpage will be empty when this runs and
- % this will be a no-op.
- \unvbox\partialpage
- %
- % Unvbox the main output page.
- \unvbox255
- \kern-\topskip \kern\baselineskip
- }}%
- \eject
- %
- % Use the double-column output routine for subsequent pages.
- \output = {\doublecolumnout}%
- %
- % Change the page size parameters. We could do this once outside this
- % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
- % format, but then we repeat the same computation. Repeating a couple
- % of assignments once per index is clearly meaningless for the
- % execution time, so we may as well do it in one place.
- %
- % First we halve the line length, less a little for the gutter between
- % the columns. We compute the gutter based on the line length, so it
- % changes automatically with the paper format. The magic constant
- % below is chosen so that the gutter has the same value (well, +-<1pt)
- % as it did when we hard-coded it.
- %
- % We put the result in a separate register, \doublecolumhsize, so we
- % can restore it in \pagesofar, after \hsize itself has (potentially)
- % been clobbered.
- %
- \doublecolumnhsize = \hsize
- \advance\doublecolumnhsize by -.04154\hsize
- \divide\doublecolumnhsize by 2
- \hsize = \doublecolumnhsize
- %
- % Double the \vsize as well. (We don't need a separate register here,
- % since nobody clobbers \vsize.)
- \vsize = 2\vsize
-}
-\def\doublecolumnout{%
- \splittopskip=\topskip \splitmaxdepth=\maxdepth
- % Get the available space for the double columns -- the normal
- % (undoubled) page height minus any material left over from the
- % previous page.
- \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
- % box0 will be the left-hand column, box2 the right.
- \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
- \onepageout\pagesofar
- \unvbox255
- \penalty\outputpenalty
-}
-\def\pagesofar{%
- % Re-output the contents of the output page -- any previous material,
- % followed by the two boxes we just split.
- \unvbox\partialpage
- \hsize = \doublecolumnhsize
- \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}%
-}
-\def\enddoublecolumns{%
- \output = {\balancecolumns}\eject % split what we have
- \endgroup % started in \begindoublecolumns
- %
- % Back to normal single-column typesetting, but take account of the
- % fact that we just accumulated some stuff on the output page.
- \pagegoal = \vsize
-}
-\def\balancecolumns{%
- % Called at the end of the double column material.
- \setbox0 = \vbox{\unvbox255}%
- \dimen@ = \ht0
- \advance\dimen@ by \topskip
- \advance\dimen@ by-\baselineskip
- \divide\dimen@ by 2
- \splittopskip = \topskip
- % Loop until we get a decent breakpoint.
- {\vbadness=10000 \loop
- \global\setbox3=\copy0
- \global\setbox1=\vsplit3 to\dimen@
- \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt
- \repeat}%
- \setbox0=\vbox to\dimen@{\unvbox1}%
- \setbox2=\vbox to\dimen@{\unvbox3}%
- \pagesofar
-}
-\catcode`\@ = \other
-
-
-\message{sectioning,}
-% Define chapters, sections, etc.
-
-\newcount\chapno
-\newcount\secno \secno=0
-\newcount\subsecno \subsecno=0
-\newcount\subsubsecno \subsubsecno=0
-
-% This counter is funny since it counts through charcodes of letters A, B, ...
-\newcount\appendixno \appendixno = `\@
-\def\appendixletter{\char\the\appendixno}
-
-\newwrite\contentsfile
-% This is called from \setfilename.
-\def\opencontents{\openout\contentsfile = \jobname.toc }
-
-% Each @chapter defines this as the name of the chapter.
-% page headings and footings can use it. @section does likewise
-
-\def\thischapter{} \def\thissection{}
-\def\seccheck#1{\ifnum \pageno<0
- \errmessage{@#1 not allowed after generating table of contents}%
-\fi}
-
-\def\chapternofonts{%
- \let\rawbackslash=\relax
- \let\frenchspacing=\relax
- \def\result{\realbackslash result}%
- \def\equiv{\realbackslash equiv}%
- \def\expansion{\realbackslash expansion}%
- \def\print{\realbackslash print}%
- \def\TeX{\realbackslash TeX}%
- \def\dots{\realbackslash dots}%
- \def\copyright{\realbackslash copyright}%
- \def\tt{\realbackslash tt}%
- \def\bf{\realbackslash bf}%
- \def\w{\realbackslash w}%
- \def\less{\realbackslash less}%
- \def\gtr{\realbackslash gtr}%
- \def\hat{\realbackslash hat}%
- \def\char{\realbackslash char}%
- \def\tclose##1{\realbackslash tclose{##1}}%
- \def\code##1{\realbackslash code{##1}}%
- \def\samp##1{\realbackslash samp{##1}}%
- \def\r##1{\realbackslash r{##1}}%
- \def\b##1{\realbackslash b{##1}}%
- \def\key##1{\realbackslash key{##1}}%
- \def\file##1{\realbackslash file{##1}}%
- \def\kbd##1{\realbackslash kbd{##1}}%
- % These are redefined because @smartitalic wouldn't work inside xdef.
- \def\i##1{\realbackslash i{##1}}%
- \def\cite##1{\realbackslash cite{##1}}%
- \def\var##1{\realbackslash var{##1}}%
- \def\emph##1{\realbackslash emph{##1}}%
- \def\dfn##1{\realbackslash dfn{##1}}%
-}
-
-\newcount\absseclevel % used to calculate proper heading level
-\newcount\secbase\secbase=0 % @raise/lowersections modify this count
-
-% @raisesections: treat @section as chapter, @subsection as section, etc.
-\def\raisesections{\global\advance\secbase by -1}
-\let\up=\raisesections % original BFox name
-
-% @lowersections: treat @chapter as section, @section as subsection, etc.
-\def\lowersections{\global\advance\secbase by 1}
-\let\down=\lowersections % original BFox name
-
-% Choose a numbered-heading macro
-% #1 is heading level if unmodified by @raisesections or @lowersections
-% #2 is text for heading
-\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
-\ifcase\absseclevel
- \chapterzzz{#2}
-\or
- \seczzz{#2}
-\or
- \numberedsubseczzz{#2}
-\or
- \numberedsubsubseczzz{#2}
-\else
- \ifnum \absseclevel<0
- \chapterzzz{#2}
- \else
- \numberedsubsubseczzz{#2}
- \fi
-\fi
-}
-
-% like \numhead, but chooses appendix heading levels
-\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
-\ifcase\absseclevel
- \appendixzzz{#2}
-\or
- \appendixsectionzzz{#2}
-\or
- \appendixsubseczzz{#2}
-\or
- \appendixsubsubseczzz{#2}
-\else
- \ifnum \absseclevel<0
- \appendixzzz{#2}
- \else
- \appendixsubsubseczzz{#2}
- \fi
-\fi
-}
-
-% like \numhead, but chooses numberless heading levels
-\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
-\ifcase\absseclevel
- \unnumberedzzz{#2}
-\or
- \unnumberedseczzz{#2}
-\or
- \unnumberedsubseczzz{#2}
-\or
- \unnumberedsubsubseczzz{#2}
-\else
- \ifnum \absseclevel<0
- \unnumberedzzz{#2}
- \else
- \unnumberedsubsubseczzz{#2}
- \fi
-\fi
-}
-
-
-\def\thischaptername{No Chapter Title}
-\outer\def\chapter{\parsearg\chapteryyy}
-\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
-\def\chapterzzz #1{\seccheck{chapter}%
-\secno=0 \subsecno=0 \subsubsecno=0
-\global\advance \chapno by 1 \message{\putwordChapter \the\chapno}%
-\chapmacro {#1}{\the\chapno}%
-\gdef\thissection{#1}%
-\gdef\thischaptername{#1}%
-% We don't substitute the actual chapter name into \thischapter
-% because we don't want its macros evaluated now.
-\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash chapentry{\the\toks0}{\the\chapno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\global\let\section = \numberedsec
-\global\let\subsection = \numberedsubsec
-\global\let\subsubsection = \numberedsubsubsec
-}}
-
-\outer\def\appendix{\parsearg\appendixyyy}
-\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
-\def\appendixzzz #1{\seccheck{appendix}%
-\secno=0 \subsecno=0 \subsubsecno=0
-\global\advance \appendixno by 1 \message{Appendix \appendixletter}%
-\chapmacro {#1}{\putwordAppendix{} \appendixletter}%
-\gdef\thissection{#1}%
-\gdef\thischaptername{#1}%
-\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash chapentry{\the\toks0}%
- {\putwordAppendix{} \appendixletter}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\global\let\section = \appendixsec
-\global\let\subsection = \appendixsubsec
-\global\let\subsubsection = \appendixsubsubsec
-}}
-
-% @centerchap is like @unnumbered, but the heading is centered.
-\outer\def\centerchap{\parsearg\centerchapyyy}
-\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
-
-\outer\def\top{\parsearg\unnumberedyyy}
-\outer\def\unnumbered{\parsearg\unnumberedyyy}
-\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
-\def\unnumberedzzz #1{\seccheck{unnumbered}%
-\secno=0 \subsecno=0 \subsubsecno=0
-%
-% This used to be simply \message{#1}, but TeX fully expands the
-% argument to \message. Therefore, if #1 contained @-commands, TeX
-% expanded them. For example, in `@unnumbered The @cite{Book}', TeX
-% expanded @cite (which turns out to cause errors because \cite is meant
-% to be executed, not expanded).
-%
-% Anyway, we don't want the fully-expanded definition of @cite to appear
-% as a result of the \message, we just want `@cite' itself. We use
-% \the<toks register> to achieve this: TeX expands \the<toks> only once,
-% simply yielding the contents of the <toks register>.
-\toks0 = {#1}\message{(\the\toks0)}%
-%
-\unnumbchapmacro {#1}%
-\gdef\thischapter{#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash unnumbchapentry{\the\toks0}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\global\let\section = \unnumberedsec
-\global\let\subsection = \unnumberedsubsec
-\global\let\subsubsection = \unnumberedsubsubsec
-}}
-
-\outer\def\numberedsec{\parsearg\secyyy}
-\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
-\def\seczzz #1{\seccheck{section}%
-\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
-\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash secentry %
-{\the\toks0}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}}
-
-\outer\def\appendixsection{\parsearg\appendixsecyyy}
-\outer\def\appendixsec{\parsearg\appendixsecyyy}
-\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
-\def\appendixsectionzzz #1{\seccheck{appendixsection}%
-\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
-\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash secentry %
-{\the\toks0}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\penalty 10000 %
-}}
-
-\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
-\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
-\def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
-\plainsecheading {#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash unnumbsecentry{\the\toks0}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}}
-
-\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
-\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
-\def\numberedsubseczzz #1{\seccheck{subsection}%
-\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
-\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash subsecentry %
-{\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}}
-
-\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
-\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
-\def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
-\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
-\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash subsecentry %
-{\the\toks0}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\penalty 10000 %
-}}
-
-\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
-\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
-\def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
-\plainsubsecheading {#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash unnumbsubsecentry{\the\toks0}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}}
-
-\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
-\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
-\def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
-\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
-\subsubsecheading {#1}
- {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash subsubsecentry{\the\toks0}
- {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
- {\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\donoderef %
-\penalty 10000 %
-}}
-
-\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
-\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
-\def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
-\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
-\subsubsecheading {#1}
- {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash subsubsecentry{\the\toks0}%
- {\appendixletter}
- {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\appendixnoderef %
-\penalty 10000 %
-}}
-
-\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
-\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
-\def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
-\plainsubsubsecheading {#1}\gdef\thissection{#1}%
-{\chapternofonts%
-\toks0 = {#1}%
-\edef\temp{{\realbackslash unnumbsubsubsecentry{\the\toks0}{\noexpand\folio}}}%
-\escapechar=`\\%
-\write \contentsfile \temp %
-\unnumbnoderef %
-\penalty 10000 %
-}}
-
-% These are variants which are not "outer", so they can appear in @ifinfo.
-% Actually, they should now be obsolete; ordinary section commands should work.
-\def\infotop{\parsearg\unnumberedzzz}
-\def\infounnumbered{\parsearg\unnumberedzzz}
-\def\infounnumberedsec{\parsearg\unnumberedseczzz}
-\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
-\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
-
-\def\infoappendix{\parsearg\appendixzzz}
-\def\infoappendixsec{\parsearg\appendixseczzz}
-\def\infoappendixsubsec{\parsearg\appendixsubseczzz}
-\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
-
-\def\infochapter{\parsearg\chapterzzz}
-\def\infosection{\parsearg\sectionzzz}
-\def\infosubsection{\parsearg\subsectionzzz}
-\def\infosubsubsection{\parsearg\subsubsectionzzz}
-
-% These macros control what the section commands do, according
-% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
-% Define them by default for a numbered chapter.
-\global\let\section = \numberedsec
-\global\let\subsection = \numberedsubsec
-\global\let\subsubsection = \numberedsubsubsec
-
-% Define @majorheading, @heading and @subheading
-
-% NOTE on use of \vbox for chapter headings, section headings, and
-% such:
-% 1) We use \vbox rather than the earlier \line to permit
-% overlong headings to fold.
-% 2) \hyphenpenalty is set to 10000 because hyphenation in a
-% heading is obnoxious; this forbids it.
-% 3) Likewise, headings look best if no \parindent is used, and
-% if justification is not attempted. Hence \raggedright.
-
-
-\def\majorheading{\parsearg\majorheadingzzz}
-\def\majorheadingzzz #1{%
-{\advance\chapheadingskip by 10pt \chapbreak }%
-{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 200}
-
-\def\chapheading{\parsearg\chapheadingzzz}
-\def\chapheadingzzz #1{\chapbreak %
-{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 200}
-
-% @heading, @subheading, @subsubheading.
-\def\heading{\parsearg\plainsecheading}
-\def\subheading{\parsearg\plainsubsecheading}
-\def\subsubheading{\parsearg\plainsubsubsecheading}
-
-% These macros generate a chapter, section, etc. heading only
-% (including whitespace, linebreaking, etc. around it),
-% given all the information in convenient, parsed form.
-
-%%% Args are the skip and penalty (usually negative)
-\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
-
-\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
-
-%%% Define plain chapter starts, and page on/off switching for it
-% Parameter controlling skip before chapter headings (if needed)
-
-\newskip\chapheadingskip
-
-\def\chapbreak{\dobreak \chapheadingskip {-4000}}
-\def\chappager{\par\vfill\supereject}
-\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
-
-\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
-
-\def\CHAPPAGoff{
-\global\let\contentsalignmacro = \chappager
-\global\let\pchapsepmacro=\chapbreak
-\global\let\pagealignmacro=\chappager}
-
-\def\CHAPPAGon{
-\global\let\contentsalignmacro = \chappager
-\global\let\pchapsepmacro=\chappager
-\global\let\pagealignmacro=\chappager
-\global\def\HEADINGSon{\HEADINGSsingle}}
-
-\def\CHAPPAGodd{
-\global\let\contentsalignmacro = \chapoddpage
-\global\let\pchapsepmacro=\chapoddpage
-\global\let\pagealignmacro=\chapoddpage
-\global\def\HEADINGSon{\HEADINGSdouble}}
-
-\CHAPPAGon
-
-\def\CHAPFplain{
-\global\let\chapmacro=\chfplain
-\global\let\unnumbchapmacro=\unnchfplain
-\global\let\centerchapmacro=\centerchfplain}
-
-% Plain chapter opening.
-% #1 is the text, #2 the chapter number or empty if unnumbered.
-\def\chfplain#1#2{%
- \pchapsepmacro
- {%
- \chapfonts \rm
- \def\chapnum{#2}%
- \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
- \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
- \hangindent = \wd0 \centerparametersmaybe
- \unhbox0 #1\par}%
- }%
- \nobreak\bigskip % no page break after a chapter title
- \nobreak
-}
-
-% Plain opening for unnumbered.
-\def\unnchfplain#1{\chfplain{#1}{}}
-
-% @centerchap -- centered and unnumbered.
-\let\centerparametersmaybe = \relax
-\def\centerchfplain#1{{%
- \def\centerparametersmaybe{%
- \advance\rightskip by 3\rightskip
- \leftskip = \rightskip
- \parfillskip = 0pt
- }%
- \chfplain{#1}{}%
-}}
-
-\CHAPFplain % The default
-
-\def\unnchfopen #1{%
-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt\raggedright
- \rm #1\hfill}}\bigskip \par\penalty 10000 %
-}
-
-\def\chfopen #1#2{\chapoddpage {\chapfonts
-\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
-\par\penalty 5000 %
-}
-
-\def\centerchfopen #1{%
-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
- \parindent=0pt
- \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 %
-}
-
-\def\CHAPFopen{
-\global\let\chapmacro=\chfopen
-\global\let\unnumbchapmacro=\unnchfopen
-\global\let\centerchapmacro=\centerchfopen}
-
-
-% Section titles.
-\newskip\secheadingskip
-\def\secheadingbreak{\dobreak \secheadingskip {-1000}}
-\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}}
-\def\plainsecheading#1{\sectionheading{sec}{}{#1}}
-
-% Subsection titles.
-\newskip \subsecheadingskip
-\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
-\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}}
-\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}}
-
-% Subsubsection titles.
-\let\subsubsecheadingskip = \subsecheadingskip
-\let\subsubsecheadingbreak = \subsecheadingbreak
-\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}}
-\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}}
-
-
-% Print any size section title.
-%
-% #1 is the section type (sec/subsec/subsubsec), #2 is the section
-% number (maybe empty), #3 the text.
-\def\sectionheading#1#2#3{%
- {%
- \expandafter\advance\csname #1headingskip\endcsname by \parskip
- \csname #1headingbreak\endcsname
- }%
- {%
- % Switch to the right set of fonts.
- \csname #1fonts\endcsname \rm
- %
- % Only insert the separating space if we have a section number.
- \def\secnum{#2}%
- \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}%
- %
- \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
- \hangindent = \wd0 % zero if no section number
- \unhbox0 #3}%
- }%
- \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak
-}
-
-
-\message{toc printing,}
-% Finish up the main text and prepare to read what we've written
-% to \contentsfile.
-
-\newskip\contentsrightmargin \contentsrightmargin=1in
-\def\startcontents#1{%
- % If @setchapternewpage on, and @headings double, the contents should
- % start on an odd page, unlike chapters. Thus, we maintain
- % \contentsalignmacro in parallel with \pagealignmacro.
- % From: Torbjorn Granlund <tege@matematik.su.se>
- \contentsalignmacro
- \immediate\closeout \contentsfile
- \ifnum \pageno>0
- \pageno = -1 % Request roman numbered pages.
- \fi
- % Don't need to put `Contents' or `Short Contents' in the headline.
- % It is abundantly clear what they are.
- \unnumbchapmacro{#1}\def\thischapter{}%
- \begingroup % Set up to handle contents files properly.
- \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
- \catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
- \raggedbottom % Worry more about breakpoints than the bottom.
- \advance\hsize by -\contentsrightmargin % Don't use the full line length.
-}
-
-
-% Normal (long) toc.
-\outer\def\contents{%
- \startcontents{\putwordTableofContents}%
- \input \jobname.toc
- \endgroup
- \vfill \eject
-}
-
-% And just the chapters.
-\outer\def\summarycontents{%
- \startcontents{\putwordShortContents}%
- %
- \let\chapentry = \shortchapentry
- \let\unnumbchapentry = \shortunnumberedentry
- % We want a true roman here for the page numbers.
- \secfonts
- \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
- \rm
- \hyphenpenalty = 10000
- \advance\baselineskip by 1pt % Open it up a little.
- \def\secentry ##1##2##3##4{}
- \def\unnumbsecentry ##1##2{}
- \def\subsecentry ##1##2##3##4##5{}
- \def\unnumbsubsecentry ##1##2{}
- \def\subsubsecentry ##1##2##3##4##5##6{}
- \def\unnumbsubsubsecentry ##1##2{}
- \input \jobname.toc
- \endgroup
- \vfill \eject
-}
-\let\shortcontents = \summarycontents
-
-% These macros generate individual entries in the table of contents.
-% The first argument is the chapter or section name.
-% The last argument is the page number.
-% The arguments in between are the chapter number, section number, ...
-
-% Chapter-level things, for both the long and short contents.
-\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
-
-% See comments in \dochapentry re vbox and related settings
-\def\shortchapentry#1#2#3{%
- \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
-}
-
-% Typeset the label for a chapter or appendix for the short contents.
-% The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
-% We could simplify the code here by writing out an \appendixentry
-% command in the toc file for appendices, instead of using \chapentry
-% for both, but it doesn't seem worth it.
-\setbox0 = \hbox{\shortcontrm \putwordAppendix }
-\newdimen\shortappendixwidth \shortappendixwidth = \wd0
-
-\def\shortchaplabel#1{%
- % We typeset #1 in a box of constant width, regardless of the text of
- % #1, so the chapter titles will come out aligned.
- \setbox0 = \hbox{#1}%
- \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
- %
- % This space should be plenty, since a single number is .5em, and the
- % widest letter (M) is 1em, at least in the Computer Modern fonts.
- % (This space doesn't include the extra space that gets added after
- % the label; that gets put in by \shortchapentry above.)
- \advance\dimen0 by 1.1em
- \hbox to \dimen0{#1\hfil}%
-}
-
-\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
-\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
-
-% Sections.
-\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
-\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
-
-% Subsections.
-\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
-\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
-
-% And subsubsections.
-\def\subsubsecentry#1#2#3#4#5#6{%
- \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
-\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
-
-% This parameter controls the indentation of the various levels.
-\newdimen\tocindent \tocindent = 3pc
-
-% Now for the actual typesetting. In all these, #1 is the text and #2 is the
-% page number.
-%
-% If the toc has to be broken over pages, we want it to be at chapters
-% if at all possible; hence the \penalty.
-\def\dochapentry#1#2{%
- \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
- \begingroup
- \chapentryfonts
- \tocentry{#1}{\dopageno{#2}}%
- \endgroup
- \nobreak\vskip .25\baselineskip plus.1\baselineskip
-}
-
-\def\dosecentry#1#2{\begingroup
- \secentryfonts \leftskip=\tocindent
- \tocentry{#1}{\dopageno{#2}}%
-\endgroup}
-
-\def\dosubsecentry#1#2{\begingroup
- \subsecentryfonts \leftskip=2\tocindent
- \tocentry{#1}{\dopageno{#2}}%
-\endgroup}
-
-\def\dosubsubsecentry#1#2{\begingroup
- \subsubsecentryfonts \leftskip=3\tocindent
- \tocentry{#1}{\dopageno{#2}}%
-\endgroup}
-
-% Final typesetting of a toc entry; we use the same \entry macro as for
-% the index entries, but we want to suppress hyphenation here. (We
-% can't do that in the \entry macro, since index entries might consist
-% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
-%
-% \turnoffactive is for the sake of @" used for umlauts.
-\def\tocentry#1#2{\begingroup
- \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
- \entry{\turnoffactive #1}{\turnoffactive #2}%
-\endgroup}
-
-% Space between chapter (or whatever) number and the title.
-\def\labelspace{\hskip1em \relax}
-
-\def\dopageno#1{{\rm #1}}
-\def\doshortpageno#1{{\rm #1}}
-
-\def\chapentryfonts{\secfonts \rm}
-\def\secentryfonts{\textfonts}
-\let\subsecentryfonts = \textfonts
-\let\subsubsecentryfonts = \textfonts
-
-
-\message{environments,}
-
-% Since these characters are used in examples, it should be an even number of
-% \tt widths. Each \tt character is 1en, so two makes it 1em.
-% Furthermore, these definitions must come after we define our fonts.
-\newbox\dblarrowbox \newbox\longdblarrowbox
-\newbox\pushcharbox \newbox\bullbox
-\newbox\equivbox \newbox\errorbox
-
-%{\tentt
-%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
-%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
-%\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
-%\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
-% Adapted from the manmac format (p.420 of TeXbook)
-%\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
-% depth .1ex\hfil}
-%}
-
-% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
-\def\point{$\star$}
-\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
-\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
-\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
-\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
-
-% Adapted from the TeXbook's \boxit.
-{\tentt \global\dimen0 = 3em}% Width of the box.
-\dimen2 = .55pt % Thickness of rules
-% The text. (`r' is open on the right, `e' somewhat less so on the left.)
-\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
-
-\global\setbox\errorbox=\hbox to \dimen0{\hfil
- \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
- \advance\hsize by -2\dimen2 % Rules.
- \vbox{
- \hrule height\dimen2
- \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
- \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
- \kern3pt\vrule width\dimen2}% Space to right.
- \hrule height\dimen2}
- \hfil}
-
-% The @error{} command.
-\def\error{\leavevmode\lower.7ex\copy\errorbox}
-
-% @tex ... @end tex escapes into raw Tex temporarily.
-% One exception: @ is still an escape character, so that @end tex works.
-% But \@ or @@ will get a plain tex @ character.
-
-\def\tex{\begingroup
-\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
-\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
-\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
-\catcode `\%=14
-\catcode 43=12 % plus
-\catcode`\"=12
-\catcode`\==12
-\catcode`\|=12
-\catcode`\<=12
-\catcode`\>=12
-\escapechar=`\\
-%
-\let\,=\ptexcomma
-\let\{=\ptexlbrace
-\let\}=\ptexrbrace
-\let\.=\ptexdot
-\let\*=\ptexstar
-\let\dots=\ptexdots
-\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
-\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
-\def\@{@}%
-\let\bullet=\ptexbullet
-\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext
-%
-\let\Etex=\endgroup}
-
-% Define @lisp ... @endlisp.
-% @lisp does a \begingroup so it can rebind things,
-% including the definition of @endlisp (which normally is erroneous).
-
-% Amount to narrow the margins by for @lisp.
-\newskip\lispnarrowing \lispnarrowing=0.4in
-
-% This is the definition that ^^M gets inside @lisp, @example, and other
-% such environments. \null is better than a space, since it doesn't
-% have any width.
-\def\lisppar{\null\endgraf}
-
-% Make each space character in the input produce a normal interword
-% space in the output. Don't allow a line break at this space, as this
-% is used only in environments like @example, where each line of input
-% should produce a line of output anyway.
-%
-{\obeyspaces %
-\gdef\sepspaces{\obeyspaces\let =\tie}}
-
-% Define \obeyedspace to be our active space, whatever it is. This is
-% for use in \parsearg.
-{\sepspaces%
-\global\let\obeyedspace= }
-
-% This space is always present above and below environments.
-\newskip\envskipamount \envskipamount = 0pt
-
-% Make spacing and below environment symmetrical. We use \parskip here
-% to help in doing that, since in @example-like environments \parskip
-% is reset to zero; thus the \afterenvbreak inserts no space -- but the
-% start of the next paragraph will insert \parskip
-%
-\def\aboveenvbreak{{\advance\envskipamount by \parskip
-\endgraf \ifdim\lastskip<\envskipamount
-\removelastskip \penalty-50 \vskip\envskipamount \fi}}
-
-\let\afterenvbreak = \aboveenvbreak
-
-% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
-\let\nonarrowing=\relax
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% \cartouche: draw rectangle w/rounded corners around argument
-\font\circle=lcircle10
-\newdimen\circthick
-\newdimen\cartouter\newdimen\cartinner
-\newskip\normbskip\newskip\normpskip\newskip\normlskip
-\circthick=\fontdimen8\circle
-%
-\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
-\def\ctr{{\hskip 6pt\circle\char'010}}
-\def\cbl{{\circle\char'012\hskip -6pt}}
-\def\cbr{{\hskip 6pt\circle\char'011}}
-\def\carttop{\hbox to \cartouter{\hskip\lskip
- \ctl\leaders\hrule height\circthick\hfil\ctr
- \hskip\rskip}}
-\def\cartbot{\hbox to \cartouter{\hskip\lskip
- \cbl\leaders\hrule height\circthick\hfil\cbr
- \hskip\rskip}}
-%
-\newskip\lskip\newskip\rskip
-
-\long\def\cartouche{%
-\begingroup
- \lskip=\leftskip \rskip=\rightskip
- \leftskip=0pt\rightskip=0pt %we want these *outside*.
- \cartinner=\hsize \advance\cartinner by-\lskip
- \advance\cartinner by-\rskip
- \cartouter=\hsize
- \advance\cartouter by 18pt % allow for 3pt kerns on either
-% side, and for 6pt waste from
-% each corner char
- \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
- % Flag to tell @lisp, etc., not to narrow margin.
- \let\nonarrowing=\comment
- \vbox\bgroup
- \baselineskip=0pt\parskip=0pt\lineskip=0pt
- \carttop
- \hbox\bgroup
- \hskip\lskip
- \vrule\kern3pt
- \vbox\bgroup
- \hsize=\cartinner
- \kern3pt
- \begingroup
- \baselineskip=\normbskip
- \lineskip=\normlskip
- \parskip=\normpskip
- \vskip -\parskip
-\def\Ecartouche{%
- \endgroup
- \kern3pt
- \egroup
- \kern3pt\vrule
- \hskip\rskip
- \egroup
- \cartbot
- \egroup
-\endgroup
-}}
-
-
-% This macro is called at the beginning of all the @example variants,
-% inside a group.
-\def\nonfillstart{%
- \aboveenvbreak
- \inENV % This group ends at the end of the body
- \hfuzz = 12pt % Don't be fussy
- \sepspaces % Make spaces be word-separators rather than space tokens.
- \singlespace
- \let\par = \lisppar % don't ignore blank lines
- \obeylines % each line of input is a line of output
- \parskip = 0pt
- \parindent = 0pt
- \emergencystretch = 0pt % don't try to avoid overfull boxes
- % @cartouche defines \nonarrowing to inhibit narrowing
- % at next level down.
- \ifx\nonarrowing\relax
- \advance \leftskip by \lispnarrowing
- \exdentamount=\lispnarrowing
- \let\exdent=\nofillexdent
- \let\nonarrowing=\relax
- \fi
-}
-
-% To ending an @example-like environment, we first end the paragraph
-% (via \afterenvbreak's vertical glue), and then the group. That way we
-% keep the zero \parskip that the environments set -- \parskip glue
-% will be inserted at the beginning of the next paragraph in the
-% document, after the environment.
-%
-\def\nonfillfinish{\afterenvbreak\endgroup}%
-
-% This macro is
-\def\lisp{\begingroup
- \nonfillstart
- \let\Elisp = \nonfillfinish
- \tt
- \rawbackslash % have \ input char produce \ char from current font
- \gobble
-}
-
-% Define the \E... control sequence only if we are inside the
-% environment, so the error checking in \end will work.
-%
-% We must call \lisp last in the definition, since it reads the
-% return following the @example (or whatever) command.
-%
-\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
-\def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp}
-\def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
-
-% @smallexample and @smalllisp. This is not used unless the @smallbook
-% command is given. Originally contributed by Pavel@xerox.
-%
-\def\smalllispx{\begingroup
- \nonfillstart
- \let\Esmalllisp = \nonfillfinish
- \let\Esmallexample = \nonfillfinish
- %
- % Smaller fonts for small examples.
- \indexfonts \tt
- \rawbackslash % make \ output the \ character from the current font (tt)
- \gobble
-}
-
-% This is @display; same as @lisp except use roman font.
-%
-\def\display{\begingroup
- \nonfillstart
- \let\Edisplay = \nonfillfinish
- \gobble
-}
-
-% This is @format; same as @display except don't narrow margins.
-%
-\def\format{\begingroup
- \let\nonarrowing = t
- \nonfillstart
- \let\Eformat = \nonfillfinish
- \gobble
-}
-
-% @flushleft (same as @format) and @flushright.
-%
-\def\flushleft{\begingroup
- \let\nonarrowing = t
- \nonfillstart
- \let\Eflushleft = \nonfillfinish
- \gobble
-}
-\def\flushright{\begingroup
- \let\nonarrowing = t
- \nonfillstart
- \let\Eflushright = \nonfillfinish
- \advance\leftskip by 0pt plus 1fill
- \gobble}
-
-% @quotation does normal linebreaking (hence we can't use \nonfillstart)
-% and narrows the margins.
-%
-\def\quotation{%
- \begingroup\inENV %This group ends at the end of the @quotation body
- {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
- \singlespace
- \parindent=0pt
- % We have retained a nonzero parskip for the environment, since we're
- % doing normal filling. So to avoid extra space below the environment...
- \def\Equotation{\parskip = 0pt \nonfillfinish}%
- %
- % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
- \ifx\nonarrowing\relax
- \advance\leftskip by \lispnarrowing
- \advance\rightskip by \lispnarrowing
- \exdentamount = \lispnarrowing
- \let\nonarrowing = \relax
- \fi
-}
-
-\message{defuns,}
-% Define formatter for defuns
-% First, allow user to change definition object font (\df) internally
-\def\setdeffont #1 {\csname DEF#1\endcsname}
-
-\newskip\defbodyindent \defbodyindent=.4in
-\newskip\defargsindent \defargsindent=50pt
-\newskip\deftypemargin \deftypemargin=12pt
-\newskip\deflastargmargin \deflastargmargin=18pt
-
-\newcount\parencount
-% define \functionparens, which makes ( and ) and & do special things.
-% \functionparens affects the group it is contained in.
-\def\activeparens{%
-\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
-\catcode`\[=\active \catcode`\]=\active}
-
-% Make control sequences which act like normal parenthesis chars.
-\let\lparen = ( \let\rparen = )
-
-{\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
-
-% Be sure that we always have a definition for `(', etc. For example,
-% if the fn name has parens in it, \boldbrax will not be in effect yet,
-% so TeX would otherwise complain about undefined control sequence.
-\global\let(=\lparen \global\let)=\rparen
-\global\let[=\lbrack \global\let]=\rbrack
-
-\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
-\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
-% This is used to turn on special parens
-% but make & act ordinary (given that it's active).
-\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr}
-
-% Definitions of (, ) and & used in args for functions.
-% This is the definition of ( outside of all parentheses.
-\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested
- \global\advance\parencount by 1
-}
-%
-% This is the definition of ( when already inside a level of parens.
-\gdef\opnested{\char`\(\global\advance\parencount by 1 }
-%
-\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
- % also in that case restore the outer-level definition of (.
- \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
- \global\advance \parencount by -1 }
-% If we encounter &foo, then turn on ()-hacking afterwards
-\gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
-%
-\gdef\normalparens{\boldbrax\let&=\ampnr}
-} % End of definition inside \activeparens
-%% These parens (in \boldbrax) actually are a little bolder than the
-%% contained text. This is especially needed for [ and ]
-\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
-\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
-\def\ampnr{\&}
-\def\lbrb{{\bf\char`\[}}
-\def\rbrb{{\bf\char`\]}}
-
-% First, defname, which formats the header line itself.
-% #1 should be the function name.
-% #2 should be the type of definition, such as "Function".
-
-\def\defname #1#2{%
-% Get the values of \leftskip and \rightskip as they were
-% outside the @def...
-\dimen2=\leftskip
-\advance\dimen2 by -\defbodyindent
-\dimen3=\rightskip
-\advance\dimen3 by -\defbodyindent
-\noindent %
-\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
-\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
-\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
-\parshape 2 0in \dimen0 \defargsindent \dimen1 %
-% Now output arg 2 ("Function" or some such)
-% ending at \deftypemargin from the right margin,
-% but stuck inside a box of width 0 so it does not interfere with linebreaking
-{% Adjust \hsize to exclude the ambient margins,
-% so that \rightline will obey them.
-\advance \hsize by -\dimen2 \advance \hsize by -\dimen3
-\rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
-% Make all lines underfull and no complaints:
-\tolerance=10000 \hbadness=10000
-\advance\leftskip by -\defbodyindent
-\exdentamount=\defbodyindent
-{\df #1}\enskip % Generate function name
-}
-
-% Actually process the body of a definition
-% #1 should be the terminating control sequence, such as \Edefun.
-% #2 should be the "another name" control sequence, such as \defunx.
-% #3 should be the control sequence that actually processes the header,
-% such as \defunheader.
-
-\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup %
-\catcode 61=\active % 61 is `='
-\obeylines\activeparens\spacesplit#3}
-
-\def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
-
-\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2##1 ##2 {\def#4{##1}%
-\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
-
-% These parsing functions are similar to the preceding ones
-% except that they do not make parens into active characters.
-% These are used for "variables" since they have no arguments.
-
-\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2{\begingroup\obeylines\spacesplit#3}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup %
-\catcode 61=\active %
-\obeylines\spacesplit#3}
-
-% This is used for \def{tp,vr}parsebody. It could probably be used for
-% some of the others, too, with some judicious conditionals.
-%
-\def\parsebodycommon#1#2#3{%
- \begingroup\inENV %
- \medbreak %
- % Define the end token that this defining construct specifies
- % so that it will exit this group.
- \def#1{\endgraf\endgroup\medbreak}%
- \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
- \parindent=0in
- \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
- \exdentamount=\defbodyindent
- \begingroup\obeylines
-}
-
-\def\defvrparsebody#1#2#3#4 {%
- \parsebodycommon{#1}{#2}{#3}%
- \spacesplit{#3{#4}}%
-}
-
-% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
-% type is just `struct', because we lose the braces in `{struct
-% termios}' when \spacesplit reads its undelimited argument. Sigh.
-% \let\deftpparsebody=\defvrparsebody
-%
-% So, to get around this, we put \empty in with the type name. That
-% way, TeX won't find exactly `{...}' as an undelimited argument, and
-% won't strip off the braces.
-%
-\def\deftpparsebody #1#2#3#4 {%
- \parsebodycommon{#1}{#2}{#3}%
- \spacesplit{\parsetpheaderline{#3{#4}}}\empty
-}
-
-% Fine, but then we have to eventually remove the \empty *and* the
-% braces (if any). That's what this does.
-%
-\def\removeemptybraces\empty#1\relax{#1}
-
-% After \spacesplit has done its work, this is called -- #1 is the final
-% thing to call, #2 the type name (which starts with \empty), and #3
-% (which might be empty) the arguments.
-%
-\def\parsetpheaderline#1#2#3{%
- #1{\removeemptybraces#2\relax}{#3}%
-}%
-
-\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
-\medbreak %
-% Define the end token that this defining construct specifies
-% so that it will exit this group.
-\def#1{\endgraf\endgroup\medbreak}%
-\def#2##1 ##2 {\def#4{##1}%
-\begingroup\obeylines\spacesplit{#3{##2}}}%
-\parindent=0in
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
-\exdentamount=\defbodyindent
-\begingroup\obeylines\spacesplit{#3{#5}}}
-
-% Split up #2 at the first space token.
-% call #1 with two arguments:
-% the first is all of #2 before the space token,
-% the second is all of #2 after that space token.
-% If #2 contains no space token, all of it is passed as the first arg
-% and the second is passed as empty.
-
-{\obeylines
-\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
-\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
-\ifx\relax #3%
-#1{#2}{}\else #1{#2}{#3#4}\fi}}
-
-% So much for the things common to all kinds of definitions.
-
-% Define @defun.
-
-% First, define the processing that is wanted for arguments of \defun
-% Use this to expand the args and terminate the paragraph they make up
-
-\def\defunargs #1{\functionparens \sl
-% Expand, preventing hyphenation at `-' chars.
-% Note that groups don't affect changes in \hyphenchar.
-\hyphenchar\tensl=0
-#1%
-\hyphenchar\tensl=45
-\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
-\interlinepenalty=10000
-\advance\rightskip by 0pt plus 1fil
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
-}
-
-\def\deftypefunargs #1{%
-% Expand, preventing hyphenation at `-' chars.
-% Note that groups don't affect changes in \hyphenchar.
-% Use \boldbraxnoamp, not \functionparens, so that & is not special.
-\boldbraxnoamp
-\tclose{#1}% avoid \code because of side effects on active chars
-\interlinepenalty=10000
-\advance\rightskip by 0pt plus 1fil
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000%
-}
-
-% Do complete processing of one @defun or @defunx line already parsed.
-
-% @deffn Command forward-char nchars
-
-\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
-
-\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
-\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
-}
-
-% @defun == @deffn Function
-
-\def\defun{\defparsebody\Edefun\defunx\defunheader}
-
-\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Function}%
-\defunargs {#2}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
-}
-
-% @deftypefun int foobar (int @var{foo}, float @var{bar})
-
-\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
-
-% #1 is the data type. #2 is the name and args.
-\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
-% #1 is the data type, #2 the name, #3 the args.
-\def\deftypefunheaderx #1#2 #3\relax{%
-\doind {fn}{\code{#2}}% Make entry in function index
-\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}%
-\deftypefunargs {#3}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
-}
-
-% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
-
-\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
-
-% \defheaderxcond#1\relax$$$
-% puts #1 in @code, followed by a space, but does nothing if #1 is null.
-\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi}
-
-% #1 is the classification. #2 is the data type. #3 is the name and args.
-\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
-% #1 is the classification, #2 the data type, #3 the name, #4 the args.
-\def\deftypefnheaderx #1#2#3 #4\relax{%
-\doind {fn}{\code{#3}}% Make entry in function index
-\begingroup
-\normalparens % notably, turn off `&' magic, which prevents
-% at least some C++ text from working
-\defname {\defheaderxcond#2\relax$$$#3}{#1}%
-\deftypefunargs {#4}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
-}
-
-% @defmac == @deffn Macro
-
-\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
-
-\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Macro}%
-\defunargs {#2}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
-}
-
-% @defspec == @deffn Special Form
-
-\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
-
-\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
-\begingroup\defname {#1}{Special Form}%
-\defunargs {#2}\endgroup %
-\catcode 61=\other % Turn off change made in \defparsebody
-}
-
-% This definition is run if you use @defunx
-% anywhere other than immediately after a @defun or @defunx.
-
-\def\deffnx #1 {\errmessage{@deffnx in invalid context}}
-\def\defunx #1 {\errmessage{@defunx in invalid context}}
-\def\defmacx #1 {\errmessage{@defmacx in invalid context}}
-\def\defspecx #1 {\errmessage{@defspecx in invalid context}}
-\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
-\def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}}
-\def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
-
-% @defmethod, and so on
-
-% @defop {Funny Method} foo-class frobnicate argument
-
-\def\defop #1 {\def\defoptype{#1}%
-\defopparsebody\Edefop\defopx\defopheader\defoptype}
-
-\def\defopheader #1#2#3{%
-\dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
-\begingroup\defname {#2}{\defoptype{} on #1}%
-\defunargs {#3}\endgroup %
-}
-
-% @deftypemethod foo-class return-type foo-method args
-%
-\def\deftypemethod{%
- \defmethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
-%
-% #1 is the class name, #2 the data type, #3 the method name, #4 the args.
-\def\deftypemethodheader#1#2#3#4{%
- \deftypefnheaderx{Method on #1}{#2}#3 #4\relax
-}
-
-% @defmethod == @defop Method
-
-\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
-
-\def\defmethodheader #1#2#3{%
-\dosubind {fn}{\code{#2}}{on #1}% entry in function index
-\begingroup\defname {#2}{Method on #1}%
-\defunargs {#3}\endgroup %
-}
-
-% @defcv {Class Option} foo-class foo-flag
-
-\def\defcv #1 {\def\defcvtype{#1}%
-\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
-
-\def\defcvarheader #1#2#3{%
-\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
-\begingroup\defname {#2}{\defcvtype{} of #1}%
-\defvarargs {#3}\endgroup %
-}
-
-% @defivar == @defcv {Instance Variable}
-
-\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
-
-\def\defivarheader #1#2#3{%
-\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
-\begingroup\defname {#2}{Instance Variable of #1}%
-\defvarargs {#3}\endgroup %
-}
-
-% These definitions are run if you use @defmethodx, etc.,
-% anywhere other than immediately after a @defmethod, etc.
-
-\def\defopx #1 {\errmessage{@defopx in invalid context}}
-\def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
-\def\defcvx #1 {\errmessage{@defcvx in invalid context}}
-\def\defivarx #1 {\errmessage{@defivarx in invalid context}}
-
-% Now @defvar
-
-% First, define the processing that is wanted for arguments of @defvar.
-% This is actually simple: just print them in roman.
-% This must expand the args and terminate the paragraph they make up
-\def\defvarargs #1{\normalparens #1%
-\interlinepenalty=10000
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000}
-
-% @defvr Counter foo-count
-
-\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
-
-\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
-\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
-
-% @defvar == @defvr Variable
-
-\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
-
-\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
-\begingroup\defname {#1}{Variable}%
-\defvarargs {#2}\endgroup %
-}
-
-% @defopt == @defvr {User Option}
-
-\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
-
-\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
-\begingroup\defname {#1}{User Option}%
-\defvarargs {#2}\endgroup %
-}
-
-% @deftypevar int foobar
-
-\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
-
-% #1 is the data type. #2 is the name, perhaps followed by text that
-% is actually part of the data type, which should not be put into the index.
-\def\deftypevarheader #1#2{%
-\dovarind#2 \relax% Make entry in variables index
-\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}%
-\interlinepenalty=10000
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000
-\endgroup}
-\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
-
-% @deftypevr {Global Flag} int enable
-
-\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
-
-\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
-\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
-\interlinepenalty=10000
-\endgraf\penalty 10000\vskip -\parskip\penalty 10000
-\endgroup}
-
-% This definition is run if you use @defvarx
-% anywhere other than immediately after a @defvar or @defvarx.
-
-\def\defvrx #1 {\errmessage{@defvrx in invalid context}}
-\def\defvarx #1 {\errmessage{@defvarx in invalid context}}
-\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
-\def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
-\def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
-
-% Now define @deftp
-% Args are printed in bold, a slight difference from @defvar.
-
-\def\deftpargs #1{\bf \defvarargs{#1}}
-
-% @deftp Class window height width ...
-
-\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
-
-\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
-\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
-
-% This definition is run if you use @deftpx, etc
-% anywhere other than immediately after a @deftp, etc.
-
-\def\deftpx #1 {\errmessage{@deftpx in invalid context}}
-
-
-\message{cross reference,}
-% Define cross-reference macros
-\newwrite \auxfile
-
-\newif\ifhavexrefs % True if xref values are known.
-\newif\ifwarnedxrefs % True if we warned once that they aren't known.
-
-% @inforef is simple.
-\def\inforef #1{\inforefzzz #1,,,,**}
-\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
- node \samp{\ignorespaces#1{}}}
-
-% \setref{foo} defines a cross-reference point named foo.
-
-\def\setref#1{%
-\dosetq{#1-title}{Ytitle}%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Ysectionnumberandtype}}
-
-\def\unnumbsetref#1{%
-\dosetq{#1-title}{Ytitle}%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Ynothing}}
-
-\def\appendixsetref#1{%
-\dosetq{#1-title}{Ytitle}%
-\dosetq{#1-pg}{Ypagenumber}%
-\dosetq{#1-snt}{Yappendixletterandtype}}
-
-% \xref, \pxref, and \ref generate cross-references to specified points.
-% For \xrefX, #1 is the node name, #2 the name of the Info
-% cross-reference, #3 the printed node name, #4 the name of the Info
-% file, #5 the name of the printed manual. All but the node name can be
-% omitted.
-%
-\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
-\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
-\def\ref#1{\xrefX[#1,,,,,,,]}
-\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
- \def\printedmanual{\ignorespaces #5}%
- \def\printednodename{\ignorespaces #3}%
- \setbox1=\hbox{\printedmanual}%
- \setbox0=\hbox{\printednodename}%
- \ifdim \wd0 = 0pt
- % No printed node name was explicitly given.
- \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
- % Use the node name inside the square brackets.
- \def\printednodename{\ignorespaces #1}%
- \else
- % Use the actual chapter/section title appear inside
- % the square brackets. Use the real section title if we have it.
- \ifdim \wd1>0pt%
- % It is in another manual, so we don't have it.
- \def\printednodename{\ignorespaces #1}%
- \else
- \ifhavexrefs
- % We know the real title if we have the xref values.
- \def\printednodename{\refx{#1-title}{}}%
- \else
- % Otherwise just copy the Info node name.
- \def\printednodename{\ignorespaces #1}%
- \fi%
- \fi
- \fi
- \fi
- %
- % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
- % insert empty discretionaries after hyphens, which means that it will
- % not find a line break at a hyphen in a node names. Since some manuals
- % are best written with fairly long node names, containing hyphens, this
- % is a loss. Therefore, we give the text of the node name again, so it
- % is as if TeX is seeing it for the first time.
- \ifdim \wd1 > 0pt
- \putwordsection{} ``\printednodename'' in \cite{\printedmanual}%
- \else
- % _ (for example) has to be the character _ for the purposes of the
- % control sequence corresponding to the node, but it has to expand
- % into the usual \leavevmode...\vrule stuff for purposes of
- % printing. So we \turnoffactive for the \refx-snt, back on for the
- % printing, back off for the \refx-pg.
- {\turnoffactive \refx{#1-snt}{}}%
- \space [\printednodename],\space
- \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
- \fi
-\endgroup}
-
-% \dosetq is the interface for calls from other macros
-
-% Use \turnoffactive so that punctuation chars such as underscore
-% work in node names.
-\def\dosetq #1#2{{\let\folio=0 \turnoffactive
-\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
-\next}}
-
-% \internalsetq {foo}{page} expands into
-% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
-% When the aux file is read, ' is the escape character
-
-\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
-
-% Things to be expanded by \internalsetq
-
-\def\Ypagenumber{\folio}
-
-\def\Ytitle{\thissection}
-
-\def\Ynothing{}
-
-\def\Ysectionnumberandtype{%
-\ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
-\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
-\else \ifnum \subsubsecno=0 %
-\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
-\else %
-\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
-\fi \fi \fi }
-
-\def\Yappendixletterandtype{%
-\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
-\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno %
-\else \ifnum \subsubsecno=0 %
-\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
-\else %
-\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
-\fi \fi \fi }
-
-\gdef\xreftie{'tie}
-
-% Use TeX 3.0's \inputlineno to get the line number, for better error
-% messages, but if we're using an old version of TeX, don't do anything.
-%
-\ifx\inputlineno\thisisundefined
- \let\linenumber = \empty % Non-3.0.
-\else
- \def\linenumber{\the\inputlineno:\space}
-\fi
-
-% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
-% If its value is nonempty, SUFFIX is output afterward.
-
-\def\refx#1#2{%
- \expandafter\ifx\csname X#1\endcsname\relax
- % If not defined, say something at least.
- $\langle$un\-de\-fined$\rangle$%
- \ifhavexrefs
- \message{\linenumber Undefined cross reference `#1'.}%
- \else
- \ifwarnedxrefs\else
- \global\warnedxrefstrue
- \message{Cross reference values unknown; you must run TeX again.}%
- \fi
- \fi
- \else
- % It's defined, so just use it.
- \csname X#1\endcsname
- \fi
- #2% Output the suffix in any case.
-}
-
-% This is the macro invoked by entries in the aux file.
-\def\xrdef #1#2{{%
- \catcode`\'=\other
- \expandafter\gdef\csname X#1\endcsname{#2}%
-}}
-
-% Read the last existing aux file, if any. No error if none exists.
-\def\readauxfile{\begingroup
- \catcode`\^^@=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\^^C=\other
- \catcode`\^^D=\other
- \catcode`\^^E=\other
- \catcode`\^^F=\other
- \catcode`\^^G=\other
- \catcode`\^^H=\other
- \catcode`\ =\other
- \catcode`\^^L=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode`\=\other
- \catcode26=\other
- \catcode`\^^[=\other
- \catcode`\^^\=\other
- \catcode`\^^]=\other
- \catcode`\^^^=\other
- \catcode`\^^_=\other
- \catcode`\@=\other
- \catcode`\^=\other
- % It was suggested to define this as 7, which would allow ^^e4 etc.
- % in xref tags, i.e., node names. But since ^^e4 notation isn't
- % supported in the main text, it doesn't seem desirable. Furthermore,
- % that is not enough: for node names that actually contain a ^
- % character, we would end up writing a line like this: 'xrdef {'hat
- % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
- % argument, and \hat is not an expandable control sequence. It could
- % all be worked out, but why? Either we support ^^ or we don't.
- %
- % The other change necessary for this was to define \auxhat:
- % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
- % and then to call \auxhat in \setq.
- %
- \catcode`\~=\other
- \catcode`\[=\other
- \catcode`\]=\other
- \catcode`\"=\other
- \catcode`\_=\other
- \catcode`\|=\other
- \catcode`\<=\other
- \catcode`\>=\other
- \catcode`\$=\other
- \catcode`\#=\other
- \catcode`\&=\other
- % `\+ does not work, so use 43.
- \catcode43=\other
- % Make the characters 128-255 be printing characters
- {%
- \count 1=128
- \def\loop{%
- \catcode\count 1=\other
- \advance\count 1 by 1
- \ifnum \count 1<256 \loop \fi
- }%
- }%
- % The aux file uses ' as the escape (for now).
- % Turn off \ as an escape so we do not lose on
- % entries which were dumped with control sequences in their names.
- % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
- % Reference to such entries still does not work the way one would wish,
- % but at least they do not bomb out when the aux file is read in.
- \catcode`\{=1
- \catcode`\}=2
- \catcode`\%=\other
- \catcode`\'=0
- \catcode`\\=\other
- %
- \openin 1 \jobname.aux
- \ifeof 1 \else
- \closein 1
- \input \jobname.aux
- \global\havexrefstrue
- \global\warnedobstrue
- \fi
- % Open the new aux file. TeX will close it automatically at exit.
- \openout\auxfile=\jobname.aux
-\endgroup}
-
-
-% Footnotes.
-
-\newcount \footnoteno
-
-% The trailing space in the following definition for supereject is
-% vital for proper filling; pages come out unaligned when you do a
-% pagealignmacro call if that space before the closing brace is
-% removed. (Generally, numeric constants should always be followed by a
-% space to prevent strange expansion errors.)
-\def\supereject{\par\penalty -20000\footnoteno =0 }
-
-% @footnotestyle is meaningful for info output only..
-\let\footnotestyle=\comment
-
-\let\ptexfootnote=\footnote
-
-{\catcode `\@=11
-%
-% Auto-number footnotes. Otherwise like plain.
-\gdef\footnote{%
- \global\advance\footnoteno by \@ne
- \edef\thisfootno{$^{\the\footnoteno}$}%
- %
- % In case the footnote comes at the end of a sentence, preserve the
- % extra spacing after we do the footnote number.
- \let\@sf\empty
- \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
- %
- % Remove inadvertent blank space before typesetting the footnote number.
- \unskip
- \thisfootno\@sf
- \footnotezzz
-}%
-
-% Don't bother with the trickery in plain.tex to not require the
-% footnote text as a parameter. Our footnotes don't need to be so general.
-%
-% Oh yes, they do; otherwise, @ifset and anything else that uses
-% \parseargline fail inside footnotes because the tokens are fixed when
-% the footnote is read. --karl, 16nov96.
-%
-\long\gdef\footnotezzz{\insert\footins\bgroup
- % We want to typeset this text as a normal paragraph, even if the
- % footnote reference occurs in (for example) a display environment.
- % So reset some parameters.
- \interlinepenalty\interfootnotelinepenalty
- \splittopskip\ht\strutbox % top baseline for broken footnotes
- \splitmaxdepth\dp\strutbox
- \floatingpenalty\@MM
- \leftskip\z@skip
- \rightskip\z@skip
- \spaceskip\z@skip
- \xspaceskip\z@skip
- \parindent\defaultparindent
- %
- % Hang the footnote text off the number.
- \hang
- \textindent{\thisfootno}%
- %
- % Don't crash into the line above the footnote text. Since this
- % expands into a box, it must come within the paragraph, lest it
- % provide a place where TeX can split the footnote.
- \footstrut
- \futurelet\next\fo@t
-}
-\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t
- \else\let\next\f@t\fi \next}
-\def\f@@t{\bgroup\aftergroup\@foot\let\next}
-\def\f@t#1{#1\@foot}
-\def\@foot{\strut\egroup}
-
-}%end \catcode `\@=11
-
-% Set the baselineskip to #1, and the lineskip and strut size
-% correspondingly. There is no deep meaning behind these magic numbers
-% used as factors; they just match (closely enough) what Knuth defined.
-%
-\def\lineskipfactor{.08333}
-\def\strutheightpercent{.70833}
-\def\strutdepthpercent {.29167}
-%
-\def\setleading#1{%
- \normalbaselineskip = #1\relax
- \normallineskip = \lineskipfactor\normalbaselineskip
- \normalbaselines
- \setbox\strutbox =\hbox{%
- \vrule width0pt height\strutheightpercent\baselineskip
- depth \strutdepthpercent \baselineskip
- }%
-}
-
-% @| inserts a changebar to the left of the current line. It should
-% surround any changed text. This approach does *not* work if the
-% change spans more than two lines of output. To handle that, we would
-% have adopt a much more difficult approach (putting marks into the main
-% vertical list for the beginning and end of each change).
-%
-\def\|{%
- % \vadjust can only be used in horizontal mode.
- \leavevmode
- %
- % Append this vertical mode material after the current line in the output.
- \vadjust{%
- % We want to insert a rule with the height and depth of the current
- % leading; that is exactly what \strutbox is supposed to record.
- \vskip-\baselineskip
- %
- % \vadjust-items are inserted at the left edge of the type. So
- % the \llap here moves out into the left-hand margin.
- \llap{%
- %
- % For a thicker or thinner bar, change the `1pt'.
- \vrule height\baselineskip width1pt
- %
- % This is the space between the bar and the text.
- \hskip 12pt
- }%
- }%
-}
-
-% For a final copy, take out the rectangles
-% that mark overfull boxes (in case you have decided
-% that the text looks ok even though it passes the margin).
-%
-\def\finalout{\overfullrule=0pt}
-
-
-% End of control word definitions.
-
-\message{and turning on texinfo input format.}
-
-\def\openindices{%
- \newindex{cp}%
- \newcodeindex{fn}%
- \newcodeindex{vr}%
- \newcodeindex{tp}%
- \newcodeindex{ky}%
- \newcodeindex{pg}%
-}
-
-% Set some numeric style parameters, for 8.5 x 11 format.
-
-\hsize = 6in
-\hoffset = .25in
-\newdimen\defaultparindent \defaultparindent = 15pt
-\parindent = \defaultparindent
-\parskip 3pt plus 2pt minus 1pt
-\setleading{13.2pt}
-\advance\topskip by 1.2cm
-
-\chapheadingskip = 15pt plus 4pt minus 2pt
-\secheadingskip = 12pt plus 3pt minus 2pt
-\subsecheadingskip = 9pt plus 2pt minus 2pt
-
-% Prevent underfull vbox error messages.
-\vbadness=10000
-
-% Following George Bush, just get rid of widows and orphans.
-\widowpenalty=10000
-\clubpenalty=10000
-
-% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
-% using an old version of TeX, don't do anything. We want the amount of
-% stretch added to depend on the line length, hence the dependence on
-% \hsize. This makes it come to about 9pt for the 8.5x11 format.
-%
-\ifx\emergencystretch\thisisundefined
- % Allow us to assign to \emergencystretch anyway.
- \def\emergencystretch{\dimen0}%
-\else
- \emergencystretch = \hsize
- \divide\emergencystretch by 45
-\fi
-
-% Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
-\def\smallbook{
- \global\chapheadingskip = 15pt plus 4pt minus 2pt
- \global\secheadingskip = 12pt plus 3pt minus 2pt
- \global\subsecheadingskip = 9pt plus 2pt minus 2pt
- %
- \global\lispnarrowing = 0.3in
- \setleading{12pt}
- \advance\topskip by -1cm
- \global\parskip 2pt plus 1pt
- \global\hsize = 5in
- \global\vsize=7.5in
- \global\tolerance=700
- \global\hfuzz=1pt
- \global\contentsrightmargin=0pt
- \global\deftypemargin=0pt
- \global\defbodyindent=.5cm
- %
- \global\pagewidth=\hsize
- \global\pageheight=\vsize
- %
- \global\let\smalllisp=\smalllispx
- \global\let\smallexample=\smalllispx
- \global\def\Esmallexample{\Esmalllisp}
-}
-
-% Use @afourpaper to print on European A4 paper.
-\def\afourpaper{
-\global\tolerance=700
-\global\hfuzz=1pt
-\setleading{12pt}
-\global\parskip 15pt plus 1pt
-
-\global\vsize= 53\baselineskip
-\advance\vsize by \topskip
-%\global\hsize= 5.85in % A4 wide 10pt
-\global\hsize= 6.5in
-\global\outerhsize=\hsize
-\global\advance\outerhsize by 0.5in
-\global\outervsize=\vsize
-\global\advance\outervsize by 0.6in
-
-\global\pagewidth=\hsize
-\global\pageheight=\vsize
-}
-
-\bindingoffset=0pt
-\normaloffset=\hoffset
-\pagewidth=\hsize
-\pageheight=\vsize
-
-% Allow control of the text dimensions. Parameters in order: textheight;
-% textwidth; voffset; hoffset; binding offset; topskip.
-% All require a dimension;
-% header is additional; added length extends the bottom of the page.
-
-\def\changepagesizes#1#2#3#4#5#6{
- \global\vsize= #1
- \global\topskip= #6
- \advance\vsize by \topskip
- \global\voffset= #3
- \global\hsize= #2
- \global\outerhsize=\hsize
- \global\advance\outerhsize by 0.5in
- \global\outervsize=\vsize
- \global\advance\outervsize by 0.6in
- \global\pagewidth=\hsize
- \global\pageheight=\vsize
- \global\normaloffset= #4
- \global\bindingoffset= #5}
-
-% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
-% 29mm, hence bottom margin 28mm, nominal side margin 3cm.
-\def\afourlatex
- {\global\tolerance=700
- \global\hfuzz=1pt
- \setleading{12pt}
- \global\parskip 15pt plus 1pt
- \advance\baselineskip by 1.6pt
- \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}
- }
-
-% Use @afourwide to print on European A4 paper in wide format.
-\def\afourwide{\afourpaper
-\changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}}
-
-% Define macros to output various characters with catcode for normal text.
-\catcode`\"=\other
-\catcode`\~=\other
-\catcode`\^=\other
-\catcode`\_=\other
-\catcode`\|=\other
-\catcode`\<=\other
-\catcode`\>=\other
-\catcode`\+=\other
-\def\normaldoublequote{"}
-\def\normaltilde{~}
-\def\normalcaret{^}
-\def\normalunderscore{_}
-\def\normalverticalbar{|}
-\def\normalless{<}
-\def\normalgreater{>}
-\def\normalplus{+}
-
-% This macro is used to make a character print one way in ttfont
-% where it can probably just be output, and another way in other fonts,
-% where something hairier probably needs to be done.
-%
-% #1 is what to print if we are indeed using \tt; #2 is what to print
-% otherwise. Since all the Computer Modern typewriter fonts have zero
-% interword stretch (and shrink), and it is reasonable to expect all
-% typewriter fonts to have this, we can check that font parameter.
-%
-\def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
-
-% Turn off all special characters except @
-% (and those which the user can use as if they were ordinary).
-% Most of these we simply print from the \tt font, but for some, we can
-% use math or other variants that look better in normal text.
-
-\catcode`\"=\active
-\def\activedoublequote{{\tt \char '042}}
-\let"=\activedoublequote
-\catcode`\~=\active
-\def~{{\tt \char '176}}
-\chardef\hat=`\^
-\catcode`\^=\active
-\def^{{\tt \hat}}
-
-\catcode`\_=\active
-\def_{\ifusingtt\normalunderscore\_}
-% Subroutine for the previous macro.
-\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
-
-\catcode`\|=\active
-\def|{{\tt \char '174}}
-\chardef \less=`\<
-\catcode`\<=\active
-\def<{{\tt \less}}
-\chardef \gtr=`\>
-\catcode`\>=\active
-\def>{{\tt \gtr}}
-\catcode`\+=\active
-\def+{{\tt \char 43}}
-%\catcode 27=\active
-%\def^^[{$\diamondsuit$}
-
-% Set up an active definition for =, but don't enable it most of the time.
-{\catcode`\==\active
-\global\def={{\tt \char 61}}}
-
-\catcode`+=\active
-\catcode`\_=\active
-
-% If a .fmt file is being used, characters that might appear in a file
-% name cannot be active until we have parsed the command line.
-% So turn them off again, and have \everyjob (or @setfilename) turn them on.
-% \otherifyactive is called near the end of this file.
-\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
-
-\catcode`\@=0
-
-% \rawbackslashxx output one backslash character in current font
-\global\chardef\rawbackslashxx=`\\
-%{\catcode`\\=\other
-%@gdef@rawbackslashxx{\}}
-
-% \rawbackslash redefines \ as input to do \rawbackslashxx.
-{\catcode`\\=\active
-@gdef@rawbackslash{@let\=@rawbackslashxx }}
-
-% \normalbackslash outputs one backslash in fixed width font.
-\def\normalbackslash{{\tt\rawbackslashxx}}
-
-% Say @foo, not \foo, in error messages.
-\escapechar=`\@
-
-% \catcode 17=0 % Define control-q
-\catcode`\\=\active
-
-% Used sometimes to turn off (effectively) the active characters
-% even after parsing them.
-@def@turnoffactive{@let"=@normaldoublequote
-@let\=@realbackslash
-@let~=@normaltilde
-@let^=@normalcaret
-@let_=@normalunderscore
-@let|=@normalverticalbar
-@let<=@normalless
-@let>=@normalgreater
-@let+=@normalplus}
-
-@def@normalturnoffactive{@let"=@normaldoublequote
-@let\=@normalbackslash
-@let~=@normaltilde
-@let^=@normalcaret
-@let_=@normalunderscore
-@let|=@normalverticalbar
-@let<=@normalless
-@let>=@normalgreater
-@let+=@normalplus}
-
-% Make _ and + \other characters, temporarily.
-% This is canceled by @fixbackslash.
-@otherifyactive
-
-% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
-% That is what \eatinput is for; after that, the `\' should revert to printing
-% a backslash.
-%
-@gdef@eatinput input texinfo{@fixbackslash}
-@global@let\ = @eatinput
-
-% On the other hand, perhaps the file did not have a `\input texinfo'. Then
-% the first `\{ in the file would cause an error. This macro tries to fix
-% that, assuming it is called before the first `\' could plausibly occur.
-% Also back turn on active characters that might appear in the input
-% file name, in case not using a pre-dumped format.
-%
-@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi
- @catcode`+=@active @catcode`@_=@active}
-
-%% These look ok in all fonts, so just make them not special. The @rm below
-%% makes sure that the current font starts out as the newly loaded cmr10
-@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
-
-@textfonts
-@rm
-
-@c Local variables:
-@c page-delimiter: "^\\\\message"
-@c End:
diff --git a/usr.sbin/afs/src/tools/gnats/version.texi b/usr.sbin/afs/src/tools/gnats/version.texi
deleted file mode 100644
index 5ec3d87dd68..00000000000
--- a/usr.sbin/afs/src/tools/gnats/version.texi
+++ /dev/null
@@ -1 +0,0 @@
-@set VERSION 3.113.1
diff --git a/usr.sbin/afs/src/tools/release-tools/common.c b/usr.sbin/afs/src/tools/release-tools/common.c
deleted file mode 100644
index 46cf2b7986c..00000000000
--- a/usr.sbin/afs/src/tools/release-tools/common.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-#include <atypes.h>
-
-#include <stdlib.h>
-#include <limits.h>
-#include <err.h>
-#include <ctype.h>
-#include <string.h>
-
-#include "common.h"
-
-int64_t
-estrntoll(const char *str, size_t len, int base)
-{
- char *endptr, *p;
- int64_t num;
-
- p = malloc(len + 1);
- if (p == NULL)
- errx(1, "malloc");
-
- memcpy(p, str, len);
- p[len] = '\0';
-
-#if defined(HAVE_STRTOLL)
- num = strtoll(p, &endptr, base);
-#elif defined(HAVE_STRTOQ)
- num = strtoq(p, &endptr, base);
-#else
- num = strtol(p, &endptr, base);
-#endif
-
- while(isspace((int)*endptr))
- endptr++;
-
- if (*endptr != '\0')
- errx(1, "error parsing number %s", p);
- return num;
-}
-
diff --git a/usr.sbin/afs/src/tools/release-tools/common.h b/usr.sbin/afs/src/tools/release-tools/common.h
deleted file mode 100644
index 0060d42bfe3..00000000000
--- a/usr.sbin/afs/src/tools/release-tools/common.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/* $arla: common.h,v 1.1 2002/06/03 18:17:03 lha Exp $ */
-
-#ifndef ARLA_RELEASE_TOOLS_COMMON_H
-#define ARLA_RELEASE_TOOLS_COMMON_H 1
-
-int64_t
-estrntoll(const char *str, size_t len, int base);
-
-#endif /* ARLA_RELEASE_TOOLS_COMMON_H */
diff --git a/usr.sbin/afs/src/tools/release-tools/cpio-rootify.c b/usr.sbin/afs/src/tools/release-tools/cpio-rootify.c
deleted file mode 100644
index e407b96142e..00000000000
--- a/usr.sbin/afs/src/tools/release-tools/cpio-rootify.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-#include <atypes.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <err.h>
-#include <unistd.h>
-#include <string.h>
-
-#include "common.h"
-
-/*
- * This only works for "new" cpio archives, those with ASCII header
- */
-
-/* from netbsd pax */
-
-struct cpio_header {
- char magic[6]; /* magic cookie */
- char dev[6]; /* device number */
- char ino[6]; /* inode number */
- char mode[6]; /* file type/access */
- char uid[6]; /* owners uid */
- char gid[6]; /* owners gid */
- char nlink[6]; /* # of links at archive creation */
- char rdev[6]; /* block/char major/minor # */
- char mtime[11]; /* modification time */
- char namesize[6]; /* length of pathname */
- char filesize[11]; /* length of file in bytes */
-};
-
-#define MAGIC 070707 /* transportable archive id */
-
-
-int
-main(int argc, char **argv)
-{
- char *buf;
- int rec = 0;
- uint64_t skipbytes;
- struct cpio_header *p;
- uint64_t val, filesize, namesize, uid, gid;
- int verbose = 0;
-
- buf = malloc(sizeof(*p));
- if (buf == NULL)
- err(1, "malloc");
-
- skipbytes = 0;
-
- while (read(0, buf, sizeof(*p)) == sizeof(*p)) {
- p = (void *)buf;
-
- rec++;
-
- val = estrntoll(p->magic, sizeof(p->magic), 8);
- if (val != MAGIC)
- errx(1, "rec #%d containted wrong magic", rec);
-
- namesize = estrntoll(p->namesize, sizeof(p->namesize), 8);
- filesize = estrntoll(p->filesize, sizeof(p->filesize), 8);
- uid = estrntoll(p->uid, sizeof(p->uid), 8);
- gid = estrntoll(p->uid, sizeof(p->gid), 8);
-
- if (verbose) {
- fprintf(stderr, "raw-uid: %.*s\n", (int)sizeof(p->uid), p->uid);
- fprintf(stderr, "raw-gid: %.*s\n", (int)sizeof(p->gid), p->gid);
-
- fprintf(stderr,
- "namesize %d\nfilesize %d\n"
- "uid: %d\ngid %d\n",
- (int)namesize, (int) filesize,
- (int)uid, (int)gid);
- }
-
- {
- char dbuf[7];
-
- snprintf(dbuf, sizeof(dbuf), "%06o", 0);
- memcpy(p->uid, dbuf, 6);
- snprintf(dbuf, sizeof(dbuf), "%06o", 0);
- memcpy(p->gid, dbuf, 6);
- }
-
- if (write(1, buf, sizeof(*p)) != sizeof(*p))
- errx(1, "write");
-
- skipbytes = filesize;
-
- if (namesize == 11) {
- char *namebuf = malloc(namesize);
- if (namebuf == NULL)
- errx(1, "malloc");
- if (read(0, namebuf, (int)namesize) != (int)namesize)
- errx(1, "read");
- if (write(1, namebuf, (int)namesize) != (int)namesize)
- err(1, "write");
-
- if (memcmp("TRAILER!!!", namebuf, 11) == 0)
- break;
- /* XXXX
- this break make us not copy the data after the TRAILER!!! */
- } else
- skipbytes += namesize;
-
- {
- char buf[1024 * 8];
- int i;
-
- do {
- i = sizeof(buf);
- if (i > skipbytes)
- i = skipbytes;
-
- if (read(0, buf, i) != i)
- err(1, "read");
- if (write(1, buf, i) != i)
- err(1, "write");
- skipbytes -= i;
- } while (skipbytes);
- }
- }
-
- return 0;
-}
diff --git a/usr.sbin/afs/src/tools/release-tools/tar-rootify.c b/usr.sbin/afs/src/tools/release-tools/tar-rootify.c
deleted file mode 100644
index 2bff325333d..00000000000
--- a/usr.sbin/afs/src/tools/release-tools/tar-rootify.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (c) 2002, Stockholms Universitet
- * (Stockholm University, Stockholm Sweden)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the university nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-#include <atypes.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <err.h>
-#include <unistd.h>
-#include <string.h>
-
-#include "common.h"
-
-/* from gnu tar manual */
-
-struct posix_header
-{ /* byte offset */
- char name[100]; /* 0 */
- char mode[8]; /* 100 */
- char uid[8]; /* 108 */
- char gid[8]; /* 116 */
- char size[12]; /* 124 */
- char mtime[12]; /* 136 */
- char chksum[8]; /* 148 */
- char typeflag; /* 156 */
- char linkname[100]; /* 157 */
- char magic[6]; /* 257 */
- char version[2]; /* 263 */
- char uname[32]; /* 265 */
- char gname[32]; /* 297 */
- char devmajor[8]; /* 329 */
- char devminor[8]; /* 337 */
- char prefix[155]; /* 345 */
- /* 500 */
-};
-
-#define TMAGIC "ustar" /* ustar and a null */
-#define OLDGNU_MAGIC "ustar " /* 7 chars and a null */
-#define TMAGLEN 6
-#define TVERSION "00" /* 00 and no null */
-#define TVERSLEN 2
-
-int
-main(int argc, char **argv)
-{
- char *buf;
- int bufsz = 512;
- int i, skip = 0, rec = 0;
- struct posix_header *p;
- uint64_t size;
- unsigned long cksum, hcksum;
- int verbose = 0;
-
- buf = malloc(bufsz);
- if (buf == NULL)
- err(1, "malloc");
-
- while (read(0, buf, bufsz) == bufsz) {
- rec++;
- p = (void *)buf;
-
- if (skip || p->name[0] == '\0') {
- if (write(1, buf, bufsz) != bufsz)
- err(1, "write");
- skip--;
- continue;
- }
-
- if (strcmp(p->magic, TMAGIC) != 0
- && strcmp(p->magic, OLDGNU_MAGIC) != 0)
- errx(1, "bad magic in #%d '%.*s'", rec,
- (int)sizeof(p->magic), p->magic);
-
- cksum = 256;
- for (i = 0; i < sizeof(*p); i++)
- if (i < 148 || 155 < i)
- cksum += (u_long)(buf[i] & 0xff);
-
- if (verbose) {
- fprintf(stderr, "rec #%d\n", rec);
- fprintf(stderr, "name = %.*s\n", (int)sizeof(p->name), p->name);
- fprintf(stderr, "uid = %.*s\n", (int)sizeof(p->uid), p->uid);
- fprintf(stderr, "gid = %.*s\n", (int)sizeof(p->gid), p->gid);
- fprintf(stderr, "uname = %.*s\n", (int)sizeof(p->uname), p->uname);
- fprintf(stderr, "gname = %.*s\n", (int)sizeof(p->gname), p->gname);
- fprintf(stderr, "type = %c\n", p->typeflag);
- fprintf(stderr, "size = %.*s\n", (int)sizeof(p->size), p->size);
- size = estrntoll(p->size, 12, 8);
- fprintf(stderr, "size = %llo\n", size);
- }
-
- hcksum = estrntoll(p->chksum, 8, 8);
- if (hcksum != cksum)
- errx(1, "invalid cksum %d != %d", (int)hcksum, (int)cksum);
- snprintf(p->uid, (int)sizeof(p->uid), "%6o ", 0);
- snprintf(p->gid, (int)sizeof(p->gid), "%6o ", 0);
- snprintf(p->uname, (int)sizeof(p->uname), "root");
- snprintf(p->gname, (int)sizeof(p->gname), "wheel");
-
- cksum = 256;
- for (i = 0; i < sizeof(*p); i++)
- if (i < 148 || 155 < i)
- cksum += (u_long)(buf[i] & 0xff);
-
- snprintf(p->chksum, (int)sizeof(p->chksum), " %6o ", (unsigned)cksum);
-
- if (write(1, buf, bufsz) != bufsz)
- errx(1, "write");
-
- if (size)
- skip = (size + bufsz - 1) / bufsz;
- }
- return 0;
-}
diff --git a/usr.sbin/afs/src/util/Makefile.in b/usr.sbin/afs/src/util/Makefile.in
deleted file mode 100644
index 69bf0f8bdfb..00000000000
--- a/usr.sbin/afs/src/util/Makefile.in
+++ /dev/null
@@ -1,141 +0,0 @@
-# $KTH: Makefile.in,v 1.38 2000/10/25 07:06:47 lha Exp $
-
-srcdir = @srcdir@
-top_builddir = ..
-VPATH = @srcdir@
-
-CC = @CC@
-AR = ar
-RANLIB = @RANLIB@
-MAKEDEPEND = makedepend
-ETAGS = etags
-LIBS = @LIB_roken@ @LIBS@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-includedir = @includedir@
-libdir = @libdir@
-mandir = @mandir@
-
-# Profiler flags
-PROF =
-
-DEFS = @DEFS@
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-REALCFLAGS = $(CFLAGS) $(DEFS) \
- @INC_roken@ \
- -I$(srcdir) -I../include -I$(srcdir)/../include $(PROF)
-
-PROGS = mmaptime_test util-tester heaptest
-LIB = libutil.a
-MANPAGES = log_log.3
-
-HEADERS = bool.h hash.h heap.h list.h log.h
-
-SRCS = \
- $(mmaptime_test_SRCS) \
- $(libutil_SRCS) \
- $(util_tester_SRCS) \
- $(heaptest_SRCS)
-
-mmaptime_test_PROG= mmaptime_test
-mmaptime_test_SRCS= mmaptime.c mmaptime_test.c
-mmaptime_test_OBJS= mmaptime.o mmaptime_test.o
-
-libutil_SRCS = hash.c list.c log.c \
- mmaptime.c heap.c
-libutil_OBJS = hash.o list.o log.o \
- mmaptime.o heap.o
-
-util_tester_PROG = util-tester
-
-util_tester_SRCS = util-tester.c
-
-util_tester_OBJS = util-tester.o
-
-heaptest_PROG = heaptest
-
-heaptest_SRCS = heaptest.c
-
-heaptest_OBJS = heaptest.o
-
-.PHONY: all install uninstall depend tags clean check
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(REALCFLAGS) $<
-
-all: $(PROGS) $(LIB)
-
-$(mmaptime_test_PROG): $(mmaptime_test_OBJS)
- $(CC) -o $@ $(mmaptime_test_OBJS) $(LIBS) $(PROF)
-
-libutil_LIB: $(libutil_OBJS)
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
- $(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/$(LIB)
- for i in $(HEADERS); do \
- $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/$$i; \
- done ; \
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$$e ; \
- $(INSTALL_DATA) $(srcdir)/$$x \
- $(DESTDIR)$(mandir)/man$$e/$$f.$$e; \
- done
-
-uninstall:
- rm -f $(DESTDIR)$(libdir)/$(LIB)
- for i in $(HEADERS); do \
- rm -f $(DESTDIR)$(includedir)/$$i; \
- done ; \
- MANPAGES='$(MANPAGES)'; for x in $$MANPAGES; do \
- n=`echo $$x | sed 's/\(.*\)\.[1-9a-zA-Z]*$$/\1/'`; \
- e=`echo $$x | sed 's/.*\.\([1-9a-zA-Z]*\)$$/\1/'`; \
- f=`echo $$n | sed '$(transform)'`; \
- rm -rf $(DESTDIR)$(mandir)/$$f.$$e; \
- done
-
-libutil.a: $(libutil_OBJS)
- $(AR) cr $@ $(libutil_OBJS)
- $(RANLIB) $@
-
-$(util_tester_PROG): libutil.a $(util_tester_OBJS)
- $(CC) -o $@ $(util_tester_OBJS) -L. -lutil $(LIBS) $(PROF)
-
-$(heaptest_PROG): libutil.a $(heaptest_OBJS)
- $(CC) -o $@ $(heaptest_OBJS) -L. -lutil $(LIBS) $(PROF)
-
-check: all
- ./$(heaptest_PROG) 100
- ./$(util_tester_PROG) >/dev/null
-
-depend: $(SRCS)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-Makefile: Makefile.in ../config.status
- cd ..; CONFIG_FILES=util/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-tags: TAGS
-
-TAGS: $(SRCS)
- $(ETAGS) -t $(SRCS)
-
-clean:
- rm -f $(OBJS) $(PROGS) libutil.a *~ *.o core
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *~
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/util/arlamath.c b/usr.sbin/afs/src/util/arlamath.c
deleted file mode 100644
index 737c38a7f9f..00000000000
--- a/usr.sbin/afs/src/util/arlamath.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * a collection of math functions
- */
-
-/* $arla: arlamath.c,v 1.1 2002/05/12 16:00:24 lha Exp $ */
-
-#include <arlamath.h>
-
-int
-arlautil_isprime(int p)
-{
- int q,i;
- for(i=2 ; i < p; i++) {
- q = p/i;
-
- if(i*q == p)
- return 0;
- if(i*i > p)
- return 1;
- }
- return 1;
-}
-
-int
-arlautil_findprime(int p)
-{
- if(p % 2 == 0) {
- p++;
- }
-
- while(!arlautil_isprime(p)) {
- p+=2;
- }
- return p;
-}
-
diff --git a/usr.sbin/afs/src/util/arlamath.h b/usr.sbin/afs/src/util/arlamath.h
deleted file mode 100644
index 3376e8beea5..00000000000
--- a/usr.sbin/afs/src/util/arlamath.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * a collection of math functions
- */
-
-/* $arla: arlamath.h,v 1.1 2002/05/12 16:00:24 lha Exp $ */
-
-#ifndef _ARLAMATH_H_
-#define _ARLAMATH_H_ 1
-
-int arlautil_isprime(int p); /* predicate deciding if a number is prime */
-int arlautil_findprime(int p); /* returns the next prime following p */
-
-#endif /* _ARLAMATH_H_ */
diff --git a/usr.sbin/afs/src/util/arlautil.h b/usr.sbin/afs/src/util/arlautil.h
deleted file mode 100644
index a6c52dae1d6..00000000000
--- a/usr.sbin/afs/src/util/arlautil.h
+++ /dev/null
@@ -1,17 +0,0 @@
-
-#ifndef __ARLA_UTIL_H
-#define __ARLA_UTIL_H 1
-
-
-char *copy_basename (const char *s);
-char *copy_dirname (const char *s);
-
-
-/* timeval */
-
-void timevalfix(struct timeval *t1);
-void timevaladd(struct timeval *t1, const struct timeval *t2);
-void timevalsub(struct timeval *t1, const struct timeval *t2);
-
-
-#endif /* __ARLA_UTIL_H */
diff --git a/usr.sbin/afs/src/util/bool.h b/usr.sbin/afs/src/util/bool.h
deleted file mode 100644
index fdf90dd177f..00000000000
--- a/usr.sbin/afs/src/util/bool.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Boolean
- */
-
-/* $arla: bool.h,v 1.5 2003/01/10 12:38:40 lha Exp $ */
-
-#ifndef _ARLAUTIL_BOOL_H
-#define _ARLAUTIL_BOOL_H 1
-
-#ifndef FALSE
-
-#ifndef Bool
-
-typedef enum {
- FALSE = 0, TRUE = 1
-} Bool;
-
-#else /* Bool */
-
-#define FALSE 0
-#define TRUE 1
-
-#endif /* Bool */
-
-#else /* FALSE */
-
-#ifndef Bool
-
-typedef int Bool;
-
-#endif /* Bool */
-
-#endif /* FALSE */
-
-#endif /* _ARLAUTIL_BOOL_H */
diff --git a/usr.sbin/afs/src/util/hash.c b/usr.sbin/afs/src/util/hash.c
deleted file mode 100644
index 7777335af5d..00000000000
--- a/usr.sbin/afs/src/util/hash.c
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Hash table functions
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: hash.c,v 1.18 2002/05/23 15:21:41 lha Exp $");
-#endif
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <ctype.h>
-#include <bool.h>
-#include <hash.h>
-#include <arlamath.h>
-
-struct ht_bucket {
- Hashentry *e;
- int len;
-};
-
-
-struct hashtab { /* Hash table */
- int (*cmp)(void *, void *); /* Compare function */
- unsigned (*hash)(void *); /* hash function */
- int flags; /* flags */
- int sz; /* Size */
- int maxbucketlen; /* max bucket length */
- struct ht_bucket *tab; /* The table */
-};
-
-struct hashentry { /* Entry in bucket */
- struct hashentry **prev;
- struct hashentry *next;
- void *ptr;
-};
-
-#define HASHTAB_INITAL_SIZE 17
-#define HASHTAB_MAX_BUCKET_LEN 20
-
-static Hashentry *_search(Hashtab * htab, /* The hash table */
- void *ptr); /* And key */
-static void *_add(Hashtab * htab,
- void *ptr,
- Bool unique);
-
-static void _might_resize(Hashtab *htab, /* The hash table */
- int bucket_len); /* Hash bucket len */
-
-Hashtab *
-hashtabnew(int sz,
- int (*cmp) (void *, void *),
- unsigned (*hash) (void *))
-{
- return hashtabnewf(sz, cmp, hash, 0);
-}
-
-Hashtab *
-hashtabnewf(int sz,
- int (*cmp) (void *, void *),
- unsigned (*hash) (void *),
- int flags)
-{
- Hashtab *htab;
- int i;
-
- assert(sz > 0 || (flags & HASHTAB_GROW));
-
- htab = (Hashtab *) malloc(sizeof(Hashtab));
-
- if (htab == NULL)
- return NULL;
-
- if (sz == 0 && (flags & HASHTAB_GROW))
- sz = HASHTAB_INITAL_SIZE;
-
- htab->tab = malloc(sz * sizeof(struct ht_bucket));
- if (htab->tab == NULL){
- free(htab);
- return NULL;
- }
-
- for (i = 0; i < sz; ++i) {
- htab->tab[i].e = NULL;
- htab->tab[i].len = 0;
- }
-
- htab->cmp = cmp;
- htab->hash = hash;
- htab->sz = sz;
- htab->maxbucketlen = HASHTAB_MAX_BUCKET_LEN;
- htab->flags = flags;
-
- return htab;
-}
-
-/* Intern search function */
-
-static Hashentry *
-_search(Hashtab * htab, void *ptr)
-{
- Hashentry *hptr;
-
- assert(htab && ptr);
-
- for (hptr = htab->tab[(*htab->hash) (ptr) % htab->sz].e;
- hptr;
- hptr = hptr->next)
- if ((*htab->cmp) (ptr, hptr->ptr) == 0)
- break;
- return hptr;
-}
-
-/* Interal resize function */
-
-static Bool
-_resize(void *ptr, void *arg)
-{
- Hashtab *h = arg;
- _add(h, ptr, TRUE);
- return TRUE;
-}
-
-static void
-_might_resize(Hashtab *htab, int bucket_len)
-{
- if (bucket_len > htab->maxbucketlen) {
- Hashtab *nhtab;
- struct ht_bucket *tab;
- int new_size, old_size;
-
- new_size = arlautil_findprime(htab->sz * 2);
- assert (new_size > htab->sz);
-
- nhtab = hashtabnewf(new_size, htab->cmp,
- htab->hash, htab->flags);
- if (nhtab == NULL)
- return;
-
- hashtabcleantab(htab, _resize, nhtab);
-
- /* switch place between the tab and size */
- tab = htab->tab;
- htab->tab = nhtab->tab;
- nhtab->tab = tab;
-
- old_size = htab->sz;
- htab->sz = nhtab->sz;
- nhtab->sz = old_size;
-
- hashtabrelease(nhtab);
- }
-}
-
-
-/* Search for element in hash table */
-
-void *
-hashtabsearch(Hashtab * htab, void *ptr)
-{
- Hashentry *tmp;
-
- tmp = _search(htab, ptr);
- return tmp ? tmp->ptr : tmp;
-}
-
-/* add element to hash table */
-/* if already there, set new value */
-/* !NULL if succesful */
-
-static void *
-_add(Hashtab * htab, void *ptr, Bool unique)
-{
- Hashentry *h = _search(htab, ptr);
- Hashentry **tabptr;
- struct ht_bucket *hb;
-
- assert(htab && ptr);
-
- if (h) {
- if (unique)
- return NULL;
- free((void *) h->ptr);
- h->ptr = ptr;
- } else {
- h = (Hashentry *) malloc(sizeof(Hashentry));
- if (h == NULL) {
- return NULL;
- }
- hb = &htab->tab[(*htab->hash) (ptr) % htab->sz];
- hb->len++;
- tabptr = &hb->e;
- h->next = *tabptr;
- *tabptr = h;
- h->prev = tabptr;
- if (h->next)
- h->next->prev = &h->next;
- h->ptr = ptr;
- if (htab->flags & HASHTAB_GROW)
- _might_resize(htab, hb->len);
- }
- return h;
-}
-
-void *
-hashtabaddreplace (Hashtab *htab, void *ptr)
-{
- return _add (htab, ptr, FALSE);
-}
-
-void *
-hashtabadd (Hashtab *htab, void *ptr)
-{
- return _add (htab, ptr, TRUE);
-}
-
-/* delete element with key key. Iff freep, free Hashentry->ptr */
-
-int
-_hashtabdel(Hashtab * htab, void *ptr, int freep)
-{
- Hashentry *h;
-
- assert(htab && ptr);
-
- h = _search(htab, ptr);
- if (h) {
- if (freep)
- free(h->ptr);
- if ((*(h->prev) = h->next))
- h->next->prev = h->prev;
- free(h);
- return 0;
- } else
- return -1;
-}
-
-/* Do something for each element */
-
-void
-hashtabforeach(Hashtab * htab, Bool(*func) (void *ptr, void *arg),
- void *arg)
-{
- struct ht_bucket *h;
- Hashentry *g, *next;
-
- assert(htab);
-
- for (h = htab->tab; h < &htab->tab[htab->sz]; ++h)
- for (g = h->e; g; g = next) {
- next = g->next;
- if ((*func) (g->ptr, arg))
- return;
- }
-}
-
-
-/* Clean out all elements that meet condition */
-
-void
-hashtabcleantab(Hashtab * htab, Bool(*cond) (void *ptr, void *arg),
- void *arg)
-{
- struct ht_bucket *h;
- Hashentry *g, *f;
-
- assert(htab);
-
- for (h = htab->tab; h < &htab->tab[htab->sz]; ++h) {
- for (g = h->e; g;) {
- if ((*cond) (g->ptr, arg)) {
- f = g ;
- g = g->next ;
- if ((*(f->prev) = f->next))
- f->next->prev = f->prev;
- free(f);
- assert(h->len > 0);
- h->len--;
- } else {
- g = g->next;
- }
- }
- }
-}
-
-static Bool
-true_cond(void *ptr, void *arg)
-{
- return TRUE;
-}
-
-/* Free the hashtab and all items in it */
-
-void
-hashtabrelease(Hashtab *htab)
-{
- hashtabcleantab(htab, true_cond, NULL);
- free(htab->tab);
- free(htab);
-}
-
-
-/* standard hash-functions for strings */
-
-unsigned
-hashadd(const char *s)
-{ /* Standard hash function */
- unsigned i;
-
- assert(s);
-
- for (i = 0; *s; ++s)
- i += *s;
- return i;
-}
-
-unsigned
-hashcaseadd(const char *s)
-{ /* Standard hash function */
- unsigned i;
-
- assert(s);
-
- for (i = 0; *s; ++s)
- i += toupper((unsigned char)*s);
- return i;
-}
-
-#define TWELVE (sizeof(unsigned))
-#define SEVENTYFIVE (6*sizeof(unsigned))
-#define HIGH_BITS (~((unsigned)(~0) >> TWELVE))
-
-unsigned
-hashjpw(const char *ss)
-{ /* another hash function */
- unsigned h = 0;
- unsigned g;
- unsigned const char *s = (unsigned const char *) ss;
-
- for (; *s; ++s) {
- h = (h << TWELVE) + *s;
- if ((g = h & HIGH_BITS))
- h = (h ^ (g >> SEVENTYFIVE)) & ~HIGH_BITS;
- }
- return h;
-}
diff --git a/usr.sbin/afs/src/util/hash.h b/usr.sbin/afs/src/util/hash.h
deleted file mode 100644
index c8095aa3905..00000000000
--- a/usr.sbin/afs/src/util/hash.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * hash.h. Header file for hash table functions
- */
-
-/* $arla: hash.h,v 1.8 2002/05/12 16:02:33 lha Exp $ */
-
-#include <bool.h>
-
-#define HASHTAB_GROW 0x01
-
-struct hashentry;
-typedef struct hashentry Hashentry;
-
-struct hashtab;
-
-typedef struct hashtab Hashtab;
-typedef int (*hashtabnew_arg2_t)(void *, void *);
-typedef unsigned (*hashtabnew_arg3_t)(void *);
-
-/* prototypes */
-
-Hashtab *hashtabnew(int sz,
- int (*cmp)(void *, void *),
- unsigned (*hash)(void *)); /* Make new hash table */
-
-Hashtab *hashtabnewf(int sz,
- int (*cmp)(void *, void *),
- unsigned (*hash)(void *),
- int flags); /* Make new hash table */
-
-void *hashtabsearch(Hashtab *htab, /* The hash table */
- void *ptr); /* The key */
-
-
-void *hashtabaddreplace(Hashtab *htab, /* The hash table */
- void *ptr); /* The element */
-
-void *hashtabadd(Hashtab *htab,
- void *ptr);
-
-int _hashtabdel(Hashtab *htab, /* The table */
- void *ptr, /* Key */
- int freep); /* Free data part? */
-
-void hashtabforeach(Hashtab *htab,
- Bool (*func)(void *ptr, void *arg),
- void *arg);
-
-void hashtabcleantab(Hashtab * htab,
- Bool(*cond) (void *ptr, void *arg),
- void *arg);
-
-void hashtabrelease(Hashtab *htab);
-
-unsigned hashadd(const char *s); /* Standard hash function */
-unsigned hashcaseadd(const char *s); /* Standard hash function */
-unsigned hashjpw(const char *s); /* another hash function */
-
-/* macros */
-
- /* Don't free space */
-#define hashtabdel(htab,key) _hashtabdel(htab,key,FALSE)
-
-#define hashtabfree(htab,key) _hashtabdel(htab,key,TRUE) /* Do! */
diff --git a/usr.sbin/afs/src/util/heap.c b/usr.sbin/afs/src/util/heap.c
deleted file mode 100644
index 5142c13e6bb..00000000000
--- a/usr.sbin/afs/src/util/heap.c
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * Copyright (c) 1998 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Heap
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: heap.c,v 1.5 2003/01/11 00:18:24 lha Exp $");
-#endif
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "heap.h"
-
-/*
- * Allocate a new heap of size `sz' with compare function `cmp'.
- */
-
-Heap *
-heap_new (unsigned sz, heap_cmp_fn cmp)
-{
- Heap *ret;
- int i;
-
- ret = malloc (sizeof(*ret));
- if (ret == NULL)
- return ret;
-
- ret->cmp = cmp;
- ret->max_sz = sz;
- ret->sz = 0;
- ret->data = malloc (sz * sizeof(*ret->data));
- if (ret->sz != 0 && ret->data == NULL) {
- free (ret);
- return NULL;
- }
- for (i = 0; i < sz; ++i) {
- ret->data[i].data = NULL;
- ret->data[i].ptr = NULL;
- }
- return ret;
-}
-
-static inline unsigned
-parent (unsigned n)
-{
- return (n + 1) / 2 - 1;
-}
-
-static inline unsigned
-left_child (unsigned n)
-{
- return 2 * n + 1;
-}
-
-static inline unsigned
-right_child (unsigned n)
-{
- return 2 * n + 2;
-}
-
-static heap_ptr dummy;
-
-/*
- *
- */
-
-static void
-assign (Heap *h, unsigned n, heap_element el)
-{
- h->data[n] = el;
- *(h->data[n].ptr) = n;
-}
-
-/*
- *
- */
-
-static void
-upheap (Heap *h, unsigned n)
-{
- heap_element v = h->data[n];
-
- while (n > 0 && (*h->cmp)(h->data[parent(n)].data, v.data) > 0) {
- assign (h, n, h->data[parent(n)]);
- n = parent(n);
- }
- assign (h, n, v);
-}
-
-/*
- *
- */
-
-static void
-downheap (Heap *h, unsigned n)
-{
- heap_element v = h->data[n];
-
- while (n < h->sz / 2) {
- int cmp1, cmp2;
- unsigned new_n;
-
- assert (left_child(n) < h->sz);
-
- new_n = left_child(n);
-
- cmp1 = (*h->cmp)(v.data, h->data[new_n].data);
-
- if (right_child(n) < h->sz) {
- cmp2 = (*h->cmp)(v.data, h->data[right_child(n)].data);
- if (cmp2 > cmp1) {
- cmp1 = cmp2;
- new_n = right_child(n);
- }
- }
-
- if (cmp1 > 0) {
- assign (h, n, h->data[new_n]);
- n = new_n;
- } else {
- break;
- }
- }
- assign (h, n, v);
-}
-
-/*
- * Insert a new element `data' into `h'.
- * Return 0 if succesful or else -1.
- */
-
-int
-heap_insert (Heap *h, const void *data, heap_ptr *ptr)
-{
- assert (data != NULL);
-
- if (h->sz == h->max_sz) {
- unsigned new_sz = h->max_sz * 2;
- heap_element *tmp;
-
- tmp = realloc (h->data, new_sz * sizeof(*h->data));
- if (tmp == NULL)
- return -1;
- h->max_sz = new_sz;
- h->data = tmp;
- }
- if (ptr == NULL)
- ptr = &dummy;
-
- h->data[h->sz].data = data;
- h->data[h->sz].ptr = ptr;
- upheap (h, h->sz);
- ++h->sz;
- return 0;
-}
-
-/*
- * Return the head of the heap `h' (or NULL if it's empty).
- */
-
-const void *
-heap_head (Heap *h)
-{
- if (h->sz == 0)
- return NULL;
- else
- return h->data[0].data;
-}
-
-/*
- * Remove element `n' from the heap `h'
- */
-
-static void
-remove_this (Heap *h, unsigned n)
-{
- assert (n < h->sz);
-
- --h->sz;
- h->data[n] = h->data[h->sz];
- h->data[h->sz].data = NULL;
- h->data[h->sz].ptr = NULL;
- if (n != h->sz) {
- downheap (h, n);
- upheap (h, n);
- }
-}
-
-/*
- * Remove the head from the heap `h'.
- */
-
-void
-heap_remove_head (Heap *h)
-{
- remove_this (h, 0);
-}
-
-/*
- * Remove this very element from the heap `h'.
- * Return 0 if succesful and -1 if it couldn't be found.
- */
-
-int
-heap_remove (Heap *h, heap_ptr ptr)
-{
- if (h->sz == 0)
- return -1;
-
- assert (h->data[ptr].ptr != &dummy);
-
- remove_this (h, ptr);
- return 0;
-}
-
-/*
- * Delete the heap `h'
- */
-
-void
-heap_delete (Heap *h)
-{
- free (h->data);
- free (h);
-}
-
-/*
- *
- */
-
-static Bool
-do_verify (Heap *h, unsigned n)
-{
- if (left_child(n) < h->sz) {
- if((*h->cmp)(h->data[n].data, h->data[left_child(n)].data) > 0)
- return FALSE;
- if (!do_verify (h, left_child(n)))
- return FALSE;
- }
- if (right_child(n) < h->sz) {
- if((*h->cmp)(h->data[n].data, h->data[right_child(n)].data) > 0)
- return FALSE;
- if (!do_verify (h, right_child(n)))
- return FALSE;
- }
- return TRUE;
-}
-
-/*
- * Verify that `h' is really a heap.
- */
-
-Bool
-heap_verify (Heap *h)
-{
- return do_verify (h, 0);
-}
diff --git a/usr.sbin/afs/src/util/heap.h b/usr.sbin/afs/src/util/heap.h
deleted file mode 100644
index d62d1c3f4df..00000000000
--- a/usr.sbin/afs/src/util/heap.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 1998 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * an abstract heap implementation
- */
-
-/* $arla: heap.h,v 1.3 2003/01/10 12:38:42 lha Exp $ */
-
-#ifndef _ARLAUTIL_HEAP_H
-#define _ARLAUTIL_HEAP_H 1
-
-#include "bool.h"
-
-typedef int (*heap_cmp_fn)(const void *, const void *);
-
-typedef unsigned heap_ptr;
-
-struct heap_element {
- const void *data;
- heap_ptr *ptr;
-};
-
-typedef struct heap_element heap_element;
-
-struct heap {
- heap_cmp_fn cmp;
- unsigned max_sz;
- unsigned sz;
- heap_element *data;
-};
-
-typedef struct heap Heap;
-
-Heap *heap_new (unsigned sz, heap_cmp_fn cmp);
-
-int
-heap_insert (Heap *h, const void *data, heap_ptr *ptr);
-
-const void *
-heap_head (Heap *h);
-
-void
-heap_remove_head (Heap *h);
-
-int
-heap_remove (Heap *h, heap_ptr ptr);
-
-void
-heap_delete (Heap *h);
-
-Bool
-heap_verify (Heap *h);
-
-#endif /* _ARLAUTIL_HEAP_H */
diff --git a/usr.sbin/afs/src/util/heaptest.c b/usr.sbin/afs/src/util/heaptest.c
deleted file mode 100644
index 5e942e834ac..00000000000
--- a/usr.sbin/afs/src/util/heaptest.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-RCSID("$arla: heaptest.c,v 1.3 2000/10/03 00:31:03 lha Exp $");
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <err.h>
-#include "heap.h"
-
-struct foo {
- int i;
- heap_ptr hptr;
-};
-
-static int
-cmp(const void *v1, const void *v2)
-{
- const struct foo *foo1 = (const struct foo *)v1;
- const struct foo *foo2 = (const struct foo *)v2;
-
- return foo1->i - foo2->i;
-}
-
-static int
-testit (unsigned n)
-{
- struct foo *foos, *bars;
- Heap *h1, *h2;
- int i;
-
- foos = malloc (n * sizeof(*foos));
- bars = malloc (n * sizeof(*bars));
- assert (foos != NULL && bars != NULL);
- h1 = heap_new (n, cmp);
- h2 = heap_new (n, cmp);
- assert (h1 != NULL && h2 != NULL);
- for (i = 0; i < n; ++i) {
- foos[i].i = bars[i].i = rand();
- heap_insert (h1, (void *)&foos[i], NULL);
- heap_insert (h2, (void *)&foos[i], &foos[i].hptr);
- if (!heap_verify(h1) || !heap_verify(h2))
- abort ();
- }
- for (i = 0; i < n; ++i) {
- heap_remove (h2, foos[i].hptr);
- if (!heap_verify(h2))
- abort ();
- }
- qsort (bars, n, sizeof(*bars), cmp);
- for (i = 0; i < n; ++i) {
- struct foo *f = (struct foo *)heap_head (h1);
-
- if (bars[i].i != f->i)
- abort ();
- heap_remove_head (h1);
- if (!heap_verify(h1))
- abort ();
- }
- heap_delete (h1);
- heap_delete (h2);
- free (foos);
- free (bars);
- return 0;
-}
-
-int
-main(int argc, char **argv)
-{
- int i, n;
-
- if (argc != 2)
- errx (1, "argc != 2");
-
- n = atoi (argv[1]);
- for (i = 0; i < n; ++i)
- testit (rand () % 1000);
- return 0;
-}
diff --git a/usr.sbin/afs/src/util/list.c b/usr.sbin/afs/src/util/list.c
deleted file mode 100644
index 7eaac166870..00000000000
--- a/usr.sbin/afs/src/util/list.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * List handling functions
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: list.c,v 1.12 2002/04/20 17:06:21 lha Exp $");
-#endif
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "list.h"
-
-/*
- * The representation is with a double-linked list, a pointer to
- * the tail, and another one to the head.
- */
-
-/*
- * Create a new list.
- */
-
-List*
-listnew (void)
-{
- List *tmp = (List *)malloc (sizeof (List));
-
- if (tmp)
- tmp->head = tmp->tail = NULL;
- return tmp;
-}
-
-/*
- * Free a list, assume that its empty
- */
-
-void
-listfree(List *list)
-{
- list->head = list->tail = NULL;
- free(list);
-}
-
-/*
- * Add an element before `item'
- */
-
-Listitem *
-listaddbefore (List *list, Listitem *old_item, void *data)
-{
- Listitem *item = (Listitem *)malloc (sizeof (Listitem));
-
- if (item == NULL)
- return item;
-
- item->data = data;
- item->prev = old_item->prev;
- item->next = old_item;
- if (item->prev)
- item->prev->next = item;
- else
- list->head = item;
- old_item->prev = item;
- return item;
-}
-
-/*
- * Add an element after `item'
- */
-
-Listitem *
-listaddafter (List *list, Listitem *old_item, void *data)
-{
- Listitem *item = (Listitem *)malloc (sizeof (Listitem));
-
- if (item == NULL)
- return item;
-
- item->data = data;
- item->next = old_item->next;
- item->prev = old_item;
- if (item->next)
- item->next->prev = item;
- else
- list->tail = item;
- old_item->next = item;
- return item;
-}
-
-/*
- * Add an element to the head of the list
- */
-
-Listitem *
-listaddhead (List *list, void *data)
-{
- Listitem *item = (Listitem *)malloc (sizeof (Listitem));
-
- if (item == NULL)
- return item;
-
- item->data = data;
- item->prev = NULL;
- item->next = list->head;
- if (list->head)
- list->head->prev = item;
- list->head = item;
- if (list->tail == NULL)
- list->tail = item;
- return item;
-}
-
-/*
- * Add an element to the tail of the list
- */
-
-Listitem *
-listaddtail (List *list, void *data)
-{
- Listitem *item = (Listitem *)malloc (sizeof (Listitem));
-
- if (item == NULL)
- return item;
-
- item->data = data;
- item->next = NULL;
- item->prev = list->tail;
- if (list->tail)
- list->tail->next = item;
- list->tail = item;
- if (list->head == NULL)
- list->head = item;
- return item;
-}
-
-/*
- * Remove an element from the head of the list.
- * Return this element.
- */
-
-void *
-listdelhead (List *list)
-{
- Listitem *item = list->head;
- void *ret;
-
- if (item == NULL)
- return NULL;
- ret = item->data;
-
- list->head = list->head->next;
- if (list->head)
- list->head->prev = NULL;
- free(item);
- if (list->tail == item)
- list->tail = NULL;
- return ret;
-}
-
-/*
- * Remove an element from the tail of the list.
- * Return this element.
- */
-
-void *
-listdeltail (List *list)
-{
- Listitem *item = list->tail;
- void *ret;
-
- if (item == NULL)
- return NULL;
- ret = item->data;
-
- list->tail = list->tail->prev;
- if (list->tail)
- list->tail->next = NULL;
- free (item);
- if (list->head == item)
- list->head = NULL;
- return ret;
-}
-
-/*
- * listdel
- */
-
-void
-listdel (List *list, Listitem *item)
-{
- if (item->prev)
- item->prev->next = item->next;
- if (item->next)
- item->next->prev = item->prev;
- if (item == list->head)
- list->head = item->next;
- if (item == list->tail)
- list->tail = item->prev;
- free (item);
-}
-
-/*
- * Iterate through all the items in a list.
- */
-
-void listiter (List *list, Bool (*fn)(List *, Listitem *, void *arg),
- void *arg)
-{
- Listitem *item;
-
- for (item = list->head; item; item = item->next)
- if ((*fn) (list, item, arg))
- break;
-}
diff --git a/usr.sbin/afs/src/util/list.h b/usr.sbin/afs/src/util/list.h
deleted file mode 100644
index 55ccba4fc85..00000000000
--- a/usr.sbin/afs/src/util/list.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * list handling functions
- */
-
-/* $arla: list.h,v 1.13 2003/01/10 12:38:43 lha Exp $ */
-
-#ifndef _ARLAUTIL_LIST_H
-#define _ARLAUTIL_LIST_H 1
-
-#include "bool.h"
-#include <roken.h>
-
-struct listitem {
- void *data;
- struct listitem *prev, *next;
-};
-
-typedef struct listitem Listitem;
-
-struct list {
- Listitem *head, *tail;
-};
-
-typedef struct list List;
-
-/*
- * functions
- */
-
-List *listnew (void);
-
-void listfree(List *);
-
-Listitem *listaddhead (List *list, void *data);
-
-Listitem *listaddtail (List *list, void *data);
-
-void listdel (List *list, Listitem *item);
-
-Listitem *listaddbefore (List *list, Listitem *old_item, void *data);
-
-Listitem *listaddafter (List *list, Listitem *old_item, void *data);
-
-void *listdelhead (List *list);
-
-void *listdeltail (List *list);
-
-void listiter (List *list, Bool (*fn)(List *, Listitem *, void *arg),
- void *arg);
-
-/*
- * inline functions
- */
-
-static inline Listitem * __attribute__ ((unused))
-listhead (List *list)
-{
- return list->head;
-}
-
-static inline Listitem * __attribute__ ((unused))
-listtail (List *list)
-{
- return list->tail;
-}
-
-static inline Listitem * __attribute__ ((unused))
-listprev (List *list, Listitem *item)
-{
- return item->prev;
-}
-
-static inline Listitem * __attribute__ ((unused))
-listnext (List *list, Listitem *item)
-{
- return item->next;
-}
-
-static inline void * __attribute__ ((unused))
-listdata (Listitem *item)
-{
- return item->data;
-}
-
-static inline Bool __attribute__ ((unused))
-listemptyp (List *list)
-{
- return (Bool)(list->head == NULL);
-}
-
-static inline Bool __attribute__ ((unused))
-listnextp(Listitem *item)
-{
- return (Bool)(item->next != NULL);
-}
-
-#endif /* _ARLAUTIL_LIST_H */
diff --git a/usr.sbin/afs/src/util/localtime_r.c b/usr.sbin/afs/src/util/localtime_r.c
deleted file mode 100644
index e15333d764a..00000000000
--- a/usr.sbin/afs/src/util/localtime_r.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: localtime_r.c,v 1.1 2002/02/07 18:00:26 lha Exp $");
-#endif
-
-#include <time.h>
-
-#ifndef HAVE_LOCALTIME_R
-
-struct tm *
-localtime_r(const time_t *timer, struct tm *result)
-{
- struct tm *tm;
-
- tm = localtime((time_t *)timer);
- if (tm == NULL)
- return NULL;
- *result = *tm;
- return result;
-}
-
-#endif
diff --git a/usr.sbin/afs/src/util/log.c b/usr.sbin/afs/src/util/log.c
deleted file mode 100644
index 8e71601bbaa..00000000000
--- a/usr.sbin/afs/src/util/log.c
+++ /dev/null
@@ -1,777 +0,0 @@
-/*
- * Copyright (c) 1995 - 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * Logging functions
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: log.c,v 1.38 2003/03/13 14:50:58 lha Exp $");
-#endif
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/time.h>
-#ifdef HAVE_SYS_RESOURCE_H
-#include <sys/resource.h>
-#endif
-#include <stdio.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <time.h>
-#if HAVE_SYSLOG
-#include <syslog.h>
-#endif /* HAVE_SYSLOG */
-
-#include <assert.h>
-#include <roken.h>
-#include <err.h>
-#include "log.h"
-
-extern char *__progname;
-
-/*
- * The structure for each logging method.
- */
-
-struct log_method;
-
-struct log_unit {
- struct log_method *method;
- char *name;
- const struct units *unit;
- unsigned mask;
-};
-
-struct log_method {
- char *name;
- void (*open)(Log_method *, const char *progname, char *fname,
- char *extra_args);
- void (*vprint)(Log_method *, char *, va_list);
- void (*print)(Log_method *, char *);
- void (*close)(Log_method *);
- union {
- void *v;
- int i;
- } data;
- log_flags flags;
- int num_units;
- int alloc_units;
- struct log_unit **units;
-};
-
-struct log_method_file_data {
- FILE *f;
- int flags;
-#define LOGFILE_NO_TIME 1
- char *progname;
-};
-
-#if HAVE_SYSLOG
-static void log_open_syslog (Log_method *lm, const char *progname,
- char *fname, char *extra_args);
-
-static void log_close_syslog (Log_method *lm);
-#if HAVE_VSYSLOG
-static void log_vprint_syslog (Log_method *lm, char *, va_list);
-#endif /* HAVE_VSYSLOG */
-static void log_print_syslog (Log_method *lm, char *);
-#endif /* HAVE_SYSLOG */
-
-static void
-log_open_stderr (Log_method *lm, const char *progname, char *fname,
- char *extra_args);
-
-static void
-log_open_file (Log_method *lm, const char *progname, char *fname,
- char *extra_args);
-
-static void
-log_close_file (Log_method *lm);
-
-static void
-log_print_file (Log_method *lm, char *);
-
-static void
-log_vprint_file (Log_method *lm, char *, va_list);
-
-/*
- * The names for which we do special handling in the logging routines.
- */
-
-static
-Log_method special_names[] = {
-#if HAVE_SYSLOG
-{"syslog", log_open_syslog,
-#if HAVE_VSYSLOG
- log_vprint_syslog, log_print_syslog
-#else
- NULL, log_print_syslog
-#endif /* HAVE_VSYSLOG */
- , log_close_syslog},
-#endif /* HAVE_SYSLOG */
-{"/dev/stderr", log_open_stderr, log_vprint_file, log_print_file, NULL},
-{NULL, log_open_file, log_vprint_file, log_print_file, log_close_file}
-/* Should be last */
-};
-
-#if HAVE_SYSLOG
-
-struct units syslog_opt_units[] = {
-#ifdef LOG_PERROR
- { "stderr", LOG_PERROR },
-#endif
-#ifdef LOG_NDELAY
- { "no-delay", LOG_NDELAY },
-#endif
-#ifdef LOG_CONS
- { "console", LOG_CONS },
-#endif
-#ifdef LOG_PID
- { "pid", LOG_PID },
-#endif
- { NULL }
-};
-
-struct units syslog_facility_units[] = {
-#ifdef LOG_AUTH
- { "auth", LOG_AUTH },
-#endif
-#ifdef LOG_AUTHPRIV
- { "authpriv", LOG_AUTHPRIV },
-#endif
-#ifdef LOG_CRON
- { "cron", LOG_CRON },
-#endif
-#ifdef LOG_DAEMON
- { "daemon", LOG_DAEMON },
-#endif
-#ifdef LOG_FTP
- { "ftp", LOG_FTP },
-#endif
-#ifdef LOG_KERN
- { "kern", LOG_KERN },
-#endif
-#ifdef LOG_LPR
- { "lpr", LOG_LPR },
-#endif
-#ifdef LOG_MAIL
- { "mail", LOG_MAIL },
-#endif
-#ifdef LOG_NEWS
- { "news", LOG_NEWS },
-#endif
-#ifdef LOG_SYSLOG
- { "syslog", LOG_SYSLOG },
-#endif
-#ifdef LOG_USER
- { "user", LOG_USER },
-#endif
-#ifdef LOG_UUCP
- { "uucp", LOG_UUCP },
-#endif
-#ifdef LOG_LOCAL0
- { "local0", LOG_LOCAL0 },
-#endif
-#ifdef LOG_LOCAL1
- { "local1", LOG_LOCAL1 },
-#endif
-#ifdef LOG_LOCAL2
- { "local2", LOG_LOCAL2 },
-#endif
-#ifdef LOG_LOCAL3
- { "local3", LOG_LOCAL3 },
-#endif
-#ifdef LOG_LOCAL4
- { "local4", LOG_LOCAL4 },
-#endif
-#ifdef LOG_LOCAL5
- { "local5", LOG_LOCAL5 },
-#endif
-#ifdef LOG_LOCAL6
- { "local6", LOG_LOCAL6 },
-#endif
-#ifdef LOG_LOCAL7
- { "local7", LOG_LOCAL7 },
-#endif
- { NULL }
-};
-
-static void
-log_open_syslog (Log_method *lm, const char *progname, char *fname,
- char *extra_args)
-{
- int logopt = LOG_PID | LOG_NDELAY;
- int facility = LOG_DAEMON;
- char *opt = NULL;
- char *facility_str = NULL;
-
- opt = extra_args;
- if (opt) {
- facility_str = opt;
- strsep (&facility_str, ":");
-
- logopt = parse_flags (opt, syslog_opt_units, logopt);
- if (logopt < 0) {
- fprintf (stderr, "log_open: error parsing syslog "
- "optional flags: %s\n", opt);
- print_flags_table (syslog_opt_units, stderr);
- exit (1);
- }
- }
- if (facility_str) {
- struct units *best_match = NULL, *u = syslog_facility_units;
- int len = strlen(facility_str);
-
- while (u->name) {
- if (strcasecmp(u->name, facility_str) == 0) {
- best_match = u;
- break;
- }
- if (strncasecmp(u->name, facility_str, len) == 0) {
- if (best_match)
- errx (1, "log_open: log facility %s is ambiguous",
- facility_str);
- best_match = u;
- }
- u++;
- }
- if (best_match == NULL)
- errx (1, "log_open: unknown facility %s", facility_str);
- facility = u->mult;
- }
-
- openlog (progname, logopt, facility);
-}
-
-#if HAVE_VSYSLOG
-
-static void
-log_vprint_syslog (Log_method *lm, char *fmt, va_list args)
-{
- vsyslog (LOG_NOTICE, fmt, args);
-}
-#endif /* HAVE_VSYSLOG */
-
-static void
-log_print_syslog (Log_method *lm, char *str)
-{
- syslog (LOG_NOTICE, "%s", str);
-}
-
-static void
-log_close_syslog (Log_method *lm)
-{
- closelog ();
-}
-
-#endif /* HAVE_SYSLOG */
-
-static int
-file_parse_extra(FILE *f, char *extra_args)
-{
- int flags = 0;
- char *str;
- if (extra_args == NULL)
- return 0;
- do {
- if (strlen(extra_args) == 0)
- return flags;
-
- str = strsep(&extra_args, ":");
- if (extra_args) {
- *extra_args = '\0';
- extra_args++;
- }
- if (strncasecmp(str, "notime", 6) == 0)
- flags |= LOGFILE_NO_TIME;
- else
- fprintf (f, "unknown flag: `%s'\n", str);
- } while (extra_args != NULL);
-
- return flags;
-}
-
-static void
-log_open_file_common(struct log_method_file_data *data,
- const char *progname, char *extra_args)
-{
- if (progname != NULL)
- data->progname = strdup(progname);
- else
- progname = "unknown-program";
- if (data->progname == NULL)
- data->progname = "out of memory";
- data->flags = file_parse_extra(data->f, extra_args);
-}
-
-static void
-log_open_stderr (Log_method *lm, const char *progname, char *fname,
- char *extra_args)
-{
- struct log_method_file_data *data;
- data = malloc(sizeof(*data));
- if (data == NULL)
- errx (1, "log_open_stderr: failed to malloc");
- lm->data.v = data;
-
- data->f = stderr;
- log_open_file_common(data, progname, extra_args);
-}
-
-static void
-log_open_file (Log_method *lm, const char *progname, char *fname,
- char *extra_args)
-{
- struct log_method_file_data *data;
- data = malloc(sizeof(*data));
- if (data == NULL)
- errx (1, "log_open_stderr: failed to malloc");
- lm->data.v = data;
-
- data->f = fopen (fname, "a");
- if (data->f == NULL)
- data->f = stderr;
- log_open_file_common(data, progname, extra_args);
-}
-
-static void
-log_printf_file(Log_method *lm, char *fmt, ...)
-{
- va_list args;
-
- va_start (args, fmt);
- log_vprint_file(lm, fmt, args);
- va_end (args);
-}
-
-static void
-log_print_file(Log_method *lm, char *str)
-{
- log_printf_file(lm, "%s", str);
-}
-
-static void
-log_vprint_file (Log_method *lm, char *fmt, va_list args)
-{
- struct timeval tv = { 0, 0 };
- char time[128];
- time_t t;
- struct log_method_file_data *data = lm->data.v;
- FILE *f = data->f;
-
- if ((data->flags & LOGFILE_NO_TIME) == 0) {
- struct tm tm;
- gettimeofday(&tv, NULL);
- t = tv.tv_sec;
- strftime(time, sizeof(time), "%Y-%m-%d %H:%M:%S %Z",
- localtime_r(&t, &tm));
- time[sizeof(time)-1] = '\0';
- fprintf (f, "%s: ", time);
- }
-
- fprintf (f, "%s: ", data->progname);
- vfprintf (f, fmt, args);
- putc ('\n', f);
- fflush (f);
-}
-
-static void
-log_close_file (Log_method *lm)
-{
- struct log_method_file_data *data = lm->data.v;
- fclose(data->f);
- free (data);
-}
-
-Log_method *
-log_open (const char *progname, char *fname)
-{
- int i;
- Log_method *logm;
- char *name, *extra;
-
- name = strdup(fname);
- if (name == NULL)
- return NULL;
-
- logm = (Log_method *)malloc (sizeof(Log_method));
- if (logm == NULL) {
- free (name);
- return logm;
- }
- for (i = 0; i < sizeof(special_names) / sizeof(*special_names);
- ++i) {
- int len = 0;
- if (special_names[i].name)
- len = strlen(special_names[i].name);
- if (special_names[i].name == NULL
- || (strncmp (special_names[i].name, fname, len) == 0 &&
- (special_names[i].name[len] == '\0'
- || special_names[i].name[len] == ':'))) {
- *logm = special_names[i];
- break;
- }
- }
- extra = name;
- strsep(&extra, ":");
- logm->num_units = 0;
- logm->alloc_units = 0;
- logm->units = NULL;
- (*logm->open)(logm, progname, name, extra);
- free (name);
- return logm;
-}
-
-log_flags
-log_setflags(Log_method *method, log_flags flags)
-{
- log_flags oldflags;
-
- oldflags = method->flags;
- method->flags = flags;
- return oldflags;
-}
-
-log_flags
-log_getflags(Log_method *method)
-{
- return method->flags;
-}
-
-void
-log_set_mask (Log_unit *logu, unsigned m)
-{
- logu->mask = m;
-}
-
-unsigned
-log_get_mask (Log_unit *unit)
-{
- return unit->mask;
-}
-
-static void
-_internal_vlog (Log_method *method, const char *fmt, va_list args)
-{
- if (method->vprint && (method->flags & LOG_CPU_USAGE) == 0)
- (*method->vprint)(method, (char *) fmt, args);
- else {
- char *buf;
-
- vasprintf (&buf, fmt, args);
-
- if (buf != NULL) {
-#ifdef HAVE_GETRUSAGE
- if (method->flags & LOG_CPU_USAGE) {
- struct rusage usage;
- int ret;
- char *rbuf = NULL;
-
- ret = getrusage(RUSAGE_SELF, &usage);
- if (ret == 0) {
- asprintf(&rbuf, "s: %d.%d u: %d.%d",
- (int)usage.ru_stime.tv_sec,
- (int)usage.ru_stime.tv_usec,
- (int)usage.ru_utime.tv_sec,
- (int)usage.ru_utime.tv_usec);
- if (rbuf) {
- char *buf2;
-
- asprintf(&buf2, "%s %s", buf, rbuf);
- if (buf2) {
- free(buf);
- buf = buf2;
- }
- free(rbuf);
- }
- }
- }
-#endif /* HAVE_GETRUSAGE */
- (*method->print)(method, buf);
- } else
- (*method->print)(method, "not enough memory to print");
- free(buf);
- }
-}
-
-static void
-_internal_log (Log_method *method, const char *fmt, ...)
-{
- va_list args;
-
- va_start (args, fmt);
- _internal_vlog(method, fmt, args);
- va_end (args);
-}
-
-void
-log_vlog(Log_unit *unit, unsigned level, const char *fmt, va_list args)
-{
- if (level & unit->mask)
- _internal_vlog (unit->method, fmt, args);
-}
-
-
-void
-log_log (Log_unit *logu, unsigned level, const char *fmt, ...)
-{
- va_list args;
-
- va_start (args, fmt);
- log_vlog(logu, level, fmt, args);
- va_end (args);
-}
-
-void
-log_close (Log_method *method)
-{
- int i;
- if (method->close)
- (*method->close)(method);
- for (i = 0 ; i < method->num_units; i++)
- log_unit_free (method, method->units[i]);
- free (method->units);
- method->units = NULL;
- free (method);
-}
-
-Log_unit *
-log_unit_init (Log_method *method, const char *name, struct units *unit,
- unsigned long default_mask)
-{
- Log_unit *u, **list;
-
- u = malloc (sizeof(Log_unit));
- if (u == NULL)
- return NULL;
- if (method->alloc_units == method->num_units) {
- list = realloc (method->units,
- (method->alloc_units + 1) * sizeof(Log_unit *));
- if (list == NULL) {
- free (u);
- return NULL;
- }
- method->alloc_units += 1;
- }
- method->units = list;
- method->units[method->num_units] = u;
- method->num_units += 1;
-
- u->method = method;
- u->name = estrdup (name);
- u->unit = unit;
- u->mask = default_mask;
- return u;
-}
-
-void
-log_unit_free (Log_method *method, Log_unit *logu)
-{
- Log_unit **list;
- int i;
-
- for (i = 0; i < method->num_units; i++)
- if (logu == method->units[method->num_units])
- break;
- if (i < method->num_units - 1)
- memmove (&method->units[i], &method->units[i+1],
- method->num_units - i);
-
- method->num_units -= 1;
- list = realloc (method->units, method->num_units * sizeof(Log_unit *));
- if (list != NULL)
- method->alloc_units = method->num_units;
- method->units = list;
- free (logu->name);
- assert (logu->method == method);
- logu->name = NULL;
- logu->unit = NULL;
- logu->mask = 0;
- free (logu);
-}
-
-static int
-parse_word (Log_method *m, char **str, Log_unit **u, char **log_str)
-{
- int j;
- char *first;
-
- if (**str == '\0') return 1;
- while (isspace((unsigned char)**str) || **str == ';')
- (*str)++;
- if (**str == '\0') return 1;
-
- first = *str;
- while (**str != '\0' && !isspace((unsigned char)**str) && **str != ':')
- (*str)++;
- if (**str == ':') {
- int best_fit = -1;
- int str_len;
- **str = '\0';
- (*str)++;
- str_len = strlen(first);
- for (j = 0; j < m->num_units; j++) {
- if (strcasecmp(m->units[j]->name, first) == 0)
- break;
- if (strncasecmp(m->units[j]->name, first, str_len) == 0) {
- if (best_fit != -1)
- return 1;
- best_fit = j;
- }
- }
- if (j == m->num_units) {
- if (best_fit != -1)
- *u = m->units[best_fit];
- else
- return 1;
- } else
- *u = m->units[j];
- *log_str = *str;
- } else {
- *u = NULL;
- *log_str = first;
- }
- while (**str != '\0' && **str != ';')
- (*str)++;
- if (**str == '\0')
- return 0;
- **str = '\0';
- (*str)++;
- return 0;
-}
-
-static int
-unit_parse_flags (const char *log_str, struct log_unit *unit)
-{
- int ret;
- ret = parse_flags (log_str, unit->unit, log_get_mask(unit));
- if (ret < 0)
- return ret;
- log_set_mask (unit, ret);
- return 0;
-}
-
-void
-log_set_mask_str (Log_method *method, Log_unit *default_unit, const char *str)
-{
- char *log_str, *ptr, *str2;
- Log_unit *unit = NULL;
- int ret;
-
- str2 = ptr = estrdup (str);
- while (parse_word (method, &ptr, &unit, &log_str) == 0) {
- if (unit || default_unit) {
- if ((unit && default_unit) && unit != default_unit)
- _internal_log (method,
- "log_set_mask_str: default with unit string"
- "%s:%s", unit->name, log_str);
- if (unit == NULL)
- unit = default_unit;
- ret = unit_parse_flags (log_str, unit);
- if (ret)
- _internal_log (unit->method,
- "log error parsing: %s:%s\n",
- unit->name, log_str);
- unit = NULL;
- } else {
- int i;
- ret = 1;
- /* If something matches, be merry */
- for (i = 0; i < method->num_units; i++) {
- if (unit_parse_flags (log_str, method->units[i]) != -1)
- ret = 0;
- }
- if (ret)
- _internal_log (method,
- "log error parsing: %s\n",
- log_str);
- }
- }
- free (str2);
-}
-
-#define UPDATESZ(str,len,update) \
- do { (str) += (update); (len) -= min((len),(update)); } while (0)
-
-static size_t
-_print_unit (Log_unit *unit, char *buf, size_t sz)
-{
- size_t ret, orig_sz = sz;
- if (sz <= 0)
- return(0);
- ret = snprintf (buf, sz, "%s:", unit->name);
- if (ret == -1)
- ret = 0;
- if (ret >= sz)
- ret = sz - 1;
- UPDATESZ(buf,sz,ret);
- ret = unparse_flags (log_get_mask (unit), unit->unit, buf, sz);
- UPDATESZ(buf,sz,ret);
- return orig_sz - sz;
-}
-
-size_t
-log_mask2str (Log_method *method, Log_unit *unit, char *buf, size_t sz)
-{
- size_t ret, orig_sz = sz;
- int i, printed = 0;
-
- if (sz) buf[0] = '\0';
-
- if (unit)
- return _print_unit (unit, buf, sz);
-
- for (i = 0; i < method->num_units; i++) {
- if (log_get_mask (method->units[i])) {
- if (printed && sz > 0) {
- ret = snprintf (buf, sz, ";");
- if (ret == -1)
- ret = 0;
- if (ret >= sz)
- ret = sz - 1;
- UPDATESZ(buf,sz,ret);
- }
- ret = _print_unit (method->units[i], buf, sz);
- UPDATESZ(buf,sz,ret);
- printed = 1;
- }
- }
- return orig_sz - sz;
-}
-
-#undef UPDATESZ
diff --git a/usr.sbin/afs/src/util/log.h b/usr.sbin/afs/src/util/log.h
deleted file mode 100644
index 9fb7250a2bc..00000000000
--- a/usr.sbin/afs/src/util/log.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: log.h,v 1.12 2003/01/10 12:38:44 lha Exp $ */
-
-#ifndef _ARLAUTIL_LOG_H
-#define _ARLAUTIL_LOG_H 1
-
-#include <stdarg.h>
-#include <parse_units.h>
-
-#if !defined(__GNUC__) && !defined(__attribute__)
-#define __attribute__(x)
-#endif
-
-typedef enum {
- LOG_CPU_USAGE = 1
-} log_flags;
-
-typedef struct log_method Log_method;
-typedef struct log_unit Log_unit;
-
-/*
- * Functions for handling logging
- */
-
-Log_method *log_open (const char *progname, char *fname);
-/* Starting logging to `fname'. Label all messages as coming from
- * `progname'. */
-
-void log_close (Log_method *logm);
-
-Log_unit *log_unit_init (Log_method *method, const char *name,
- struct units *lognames,
- unsigned long default_mask);
-
-void log_unit_free (Log_method *method, Log_unit *logu);
-
-log_flags log_setflags(Log_method *logm, log_flags flags);
-log_flags log_getflags(Log_method *logm);
-
-void log_log (Log_unit *logu, unsigned level, const char *fmt, ...)
-__attribute__((format (printf, 3, 4)))
-;
-
-void log_vlog(Log_unit *logu, unsigned level, const char *fmt, va_list args)
-__attribute__((format (printf, 3, 0)))
-;
-
-unsigned log_get_mask (Log_unit *logu);
-
-void log_set_mask (Log_unit *logu, unsigned mask);
-
-void log_set_mask_str (Log_method *method, Log_unit *default_unit,
- const char *str);
-
-size_t log_mask2str (Log_method *method, Log_unit *unit, char *buf, size_t sz);
-
-#endif /* _ARLAUTIL_LOG_H */
diff --git a/usr.sbin/afs/src/util/log_log.3 b/usr.sbin/afs/src/util/log_log.3
deleted file mode 100644
index a01e068f488..00000000000
--- a/usr.sbin/afs/src/util/log_log.3
+++ /dev/null
@@ -1,153 +0,0 @@
-.\" Copyright (c) 2000 Kungliga Tekniska Högskolan
-.\" $arla: log_log.3,v 1.6 2002/10/17 09:18:06 lha Exp $
-.Dd August 24, 2000
-.Dt LOG_LOG 3
-.Os UTIL
-.Sh NAME
-.Nm log_log ,
-.Nm log_vlog ,
-.Nm log_open ,
-.Nm log_close ,
-.Nm log_unit_init ,
-.Nm log_unit_free ,
-.Nm log_set_mask ,
-.Nm log_get_mask ,
-.Nm log_mask2str ,
-.Nm log_set_mask_str
-.Nd provides unified logging
-.Sh SYNOPSIS
-.Fd #include <parse_units.h>
-.Fd #include <log.h>
-.Fo "void log_log"
-.Fa "Log_unit *unit"
-.Fa "unsigned level"
-.Fa "const char *fmt"
-.Fa ...
-.Fc
-.Fo "void log_vlog"
-.Fa "Log_unit *unit"
-.Fa "unsigned level"
-.Fa "const char *fmt"
-.Fa "va_list args"
-.Fc
-.Fo "Log_method *log_open"
-.Fa "char *progname"
-.Fa "char *fname"
-.Fc
-.Fo "void log_close"
-.Fa "Log_method *method"
-.Fc
-.Fo "Log_unit *log_unit_init"
-.Fa "Log_method *method"
-.Fa "const char *name"
-.Fa "struct units *lognames"
-.Fa "unsigned long default_mask"
-.Fc
-.Fo "void log_unit_free"
-.Fa "Log_method *method"
-.Fa "Log_unit *unit"
-.Fc
-.Fo "void log_set_mask"
-.Fa "Log_unit *unit"
-.Fa "unsigned long mask"
-.Fc
-.Fo "unsigned log_get_mask"
-.Fa "Log_unit *unit"
-.Fc
-.Fo "void log_mask2str"
-.Fa "Log_method *method"
-.Fa "Log_unit *unit"
-.Fa "char *buf"
-.Fa "size_t sz"
-.Fc
-.Fo "void log_set_mask_str"
-.Fa "Log_method *method"
-.Fa "Log_unit *default_unit"
-.Fa "const char *str"
-.Fc
-.Sh DESCRIPTION
-.Nm log_log
-will let you have a unified logging system throu-out your whole project.
-No more strange errnos like
-.Er EINVAL
-returned from libraries since they can print to stderr (not knowing
-what fd will be connected to fd number 2).
-.Pp
-.Fn log_open
-will open a Log_method that all Log_units will log though, Log_method
-controls to what device the log is sent.
-Logging devices, passed in fname, are syslog, /dev/stderr, or a file.
-.Pp
-Options can be passes to the subsystem with an extra colon. Valid
-options are:
-.D1 syslog[:pid,no-delay,console,stderr[:facility]]
-.D1 {/dev/stderr,/file}[:notime]
-.Fn log_close
-closeses the Log_method and assosiated Log_units.
-.Pp
-.Fn log_unit_init
-will return a logging unit, that is used by a subsystem.
-.Pp
-.Fn log_unit_free
-will free a logging unit allocated by
-.Fn log_unit_init .
-.Pp
-.Fn log_set_mask
-set the logging mask for a logging unit.
-.Pp
-.Fn log_get_mask
-get the logging mask for a logging unit.
-.Pp
-.Fn log_mask2str
-convert the longing mask for `unit' (or all if this is NULL), to a
-string that can be printed.
-The string can be parsed by
-.Fn log_set_mask_str .
-.Pp
-.Fn log_set_mask_str
-will set the mask for `default_unit' (or all if this is NULL).
-.Sh EXAMPLE
-.Bd -literal
-#include <parse_units.h>
-#include <log.h>
-#include <err.h>
-
-enum { A_WARNING = 1, A_DEBUG = 2 };
-
-struct units u_units[] = {
- { "debug", A_DEBUG },
- { "warning", A_WARNING },
- { NULL, 0 }
-};
-
-int
-main (int argc, char **argv)
-{
- Log_method *m;
- Log_unit *u;
- char buf[1024];
-
- m = log_open ("log-tester", "/dev/stderr");
- if (m == NULL)
- errx (1, "log_open");
-
- u = log_unit_init (m, "test-foo", u_units, A_WARNING);
- if (u == NULL)
- errx (1, "log_unit_init");
-
- log_log (u, A_WARNING, "this should show");
- log_log (u, A_DEBUG, "this should NOT show");
-
- log_mask2str (m, NULL, buf, sizeof(buf));
- printf ("logmask: %s\\n", buf);
-
- log_close (m);
-
- return 0;
-}
-.Ed
-.Sh BUGS
-Should maybe include a log_logx version.
-.Sh SEE ALSO
-.Xr syslog 3 ,
-.Xr syslogd 8
diff --git a/usr.sbin/afs/src/util/mmaptime.c b/usr.sbin/afs/src/util/mmaptime.c
deleted file mode 100644
index 1741a9ee1fb..00000000000
--- a/usr.sbin/afs/src/util/mmaptime.c
+++ /dev/null
@@ -1,201 +0,0 @@
-OBSOLETE /*
-OBSOLETE * Copyright (c) 1998 Kungliga Tekniska Högskolan
-OBSOLETE * (Royal Institute of Technology, Stockholm, Sweden).
-OBSOLETE * All rights reserved.
-OBSOLETE *
-OBSOLETE * Redistribution and use in source and binary forms, with or without
-OBSOLETE * modification, are permitted provided that the following conditions
-OBSOLETE * are met:
-OBSOLETE *
-OBSOLETE * 1. Redistributions of source code must retain the above copyright
-OBSOLETE * notice, this list of conditions and the following disclaimer.
-OBSOLETE *
-OBSOLETE * 2. Redistributions in binary form must reproduce the above copyright
-OBSOLETE * notice, this list of conditions and the following disclaimer in the
-OBSOLETE * documentation and/or other materials provided with the distribution.
-OBSOLETE *
-OBSOLETE * 3. Neither the name of the Institute nor the names of its contributors
-OBSOLETE * may be used to endorse or promote products derived from this software
-OBSOLETE * without specific prior written permission.
-OBSOLETE *
-OBSOLETE * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-OBSOLETE * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-OBSOLETE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-OBSOLETE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-OBSOLETE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-OBSOLETE * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OBSOLETE * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-OBSOLETE * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-OBSOLETE * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OBSOLETE * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-OBSOLETE * SUCH DAMAGE.
-OBSOLETE */
-OBSOLETE
-OBSOLETE #ifdef HAVE_CONFIG_H
-OBSOLETE #include <config.h>
-OBSOLETE #endif
-OBSOLETE
-OBSOLETE RCSID("$arla: mmaptime.c,v 1.8 2002/12/20 12:57:07 lha Exp $");
-OBSOLETE
-OBSOLETE #include <stdio.h>
-OBSOLETE
-OBSOLETE /*
-OBSOLETE * Speed hack
-OBSOLETE *
-OBSOLETE * Here we try to mmap time from the kernelspace.
-OBSOLETE * There are people claiming that this is about 100 times faster
-OBSOLETE * then gettimeofday()
-OBSOLETE *
-OBSOLETE * You need to have USE_MMAPTIME defined to get it.
-OBSOLETE *
-OBSOLETE * Other thing that you need is mmap(), getpagesize(), kvm_open() & co
-OBSOLETE *
-OBSOLETE * If not initalized with mmaptime_probe gettimeofday will be called
-OBSOLETE *
-OBSOLETE */
-OBSOLETE
-OBSOLETE #if defined(USE_MMAPTIME)
-OBSOLETE
-OBSOLETE #if defined(HAVE_MMAP) && defined(HAVE_KVM_OPEN) && defined(HAVE_KVM_NLIST) && defined(HAVE_GETPAGESIZE)
-OBSOLETE
-OBSOLETE #include "mmaptime.h"
-OBSOLETE
-OBSOLETE #ifdef HAVE_UNISTD_H
-OBSOLETE #include <unistd.h>
-OBSOLETE #endif
-OBSOLETE #ifdef HAVE_SYS_MMAN_H
-OBSOLETE #include <sys/mman.h>
-OBSOLETE #endif
-OBSOLETE #ifdef HAVE_FCNTL_H
-OBSOLETE #include <fcntl.h>
-OBSOLETE #endif
-OBSOLETE #ifdef HAVE_NLIST_H
-OBSOLETE #include <nlist.h>
-OBSOLETE #endif
-OBSOLETE #ifdef HAVE_ELFLIB_NLIST_H
-OBSOLETE #include <elflib/nlist.h>
-OBSOLETE #endif
-OBSOLETE #ifdef HAVE_KVM_H
-OBSOLETE #include <kvm.h>
-OBSOLETE #endif
-OBSOLETE #include <errno.h>
-OBSOLETE
-OBSOLETE
-OBSOLETE static unsigned long ps;
-OBSOLETE static unsigned long begpage;
-OBSOLETE static void *mem;
-OBSOLETE static int kmemfd = -1;
-OBSOLETE static struct timeval *tp = NULL;
-OBSOLETE
-OBSOLETE
-OBSOLETE int mmaptime_probe(void)
-OBSOLETE {
-OBSOLETE kvm_t *kvm;
-OBSOLETE unsigned long value;
-OBSOLETE struct nlist nl[2];
-OBSOLETE int i, saved_errno;
-OBSOLETE
-OBSOLETE if (tp)
-OBSOLETE return 0;
-OBSOLETE
-OBSOLETE if (geteuid()) {
-OBSOLETE fprintf(stderr, "mmaptime needs to be run as root, falling back on gettimeofday\n");
-OBSOLETE return EPERM;
-OBSOLETE }
-OBSOLETE
-OBSOLETE kvm = kvm_open(NULL, NULL, NULL, O_RDONLY, "util/mmaptime");
-OBSOLETE nl[0].n_name = "_time";
-OBSOLETE nl[1].n_name = NULL;
-OBSOLETE i = kvm_nlist(kvm, nl);
-OBSOLETE
-OBSOLETE /*
-OBSOLETE * SunOS 5.6 is broken and returns a zero even when it fails.
-OBSOLETE */
-OBSOLETE
-OBSOLETE if (nl[0].n_value == 0) {
-OBSOLETE nl[0].n_name = "time";
-OBSOLETE nl[1].n_name = NULL;
-OBSOLETE i = kvm_nlist(kvm, nl);
-OBSOLETE }
-OBSOLETE
-OBSOLETE kvm_close(kvm);
-OBSOLETE
-OBSOLETE if (i != 0)
-OBSOLETE return ENOENT;
-OBSOLETE
-OBSOLETE kmemfd = open("/dev/kmem", O_RDONLY);
-OBSOLETE if (kmemfd < 0)
-OBSOLETE return errno;
-OBSOLETE
-OBSOLETE value = nl[0].n_value;
-OBSOLETE
-OBSOLETE ps = getpagesize();
-OBSOLETE
-OBSOLETE begpage = value - value % ps ;
-OBSOLETE mem = mmap(NULL, ps, PROT_READ, MAP_SHARED, kmemfd, begpage);
-OBSOLETE
-OBSOLETE if (mem == (void *) -1) {
-OBSOLETE saved_errno = errno;
-OBSOLETE close(kmemfd);
-OBSOLETE return saved_errno;
-OBSOLETE }
-OBSOLETE
-OBSOLETE tp = (struct timeval *) (mem + value % ps);
-OBSOLETE return 0;
-OBSOLETE }
-OBSOLETE
-OBSOLETE
-OBSOLETE int
-OBSOLETE mmaptime_close(void)
-OBSOLETE {
-OBSOLETE if (tp)
-OBSOLETE munmap(mem, ps);
-OBSOLETE
-OBSOLETE tp = NULL;
-OBSOLETE
-OBSOLETE if (kmemfd >= 0)
-OBSOLETE close(kmemfd);
-OBSOLETE
-OBSOLETE
-OBSOLETE return 0;
-OBSOLETE }
-OBSOLETE
-OBSOLETE int
-OBSOLETE mmaptime_gettimeofday(struct timeval *t, void *tzp)
-OBSOLETE {
-OBSOLETE if (t && tp && !tzp) {
-OBSOLETE *t = *tp;
-OBSOLETE return 0;
-OBSOLETE } else
-OBSOLETE return gettimeofday(tp, tzp);
-OBSOLETE
-OBSOLETE /* NOT REACHED */
-OBSOLETE return -1;
-OBSOLETE }
-OBSOLETE
-OBSOLETE
-OBSOLETE #else /* USE_MMAPTIME not useable */
-OBSOLETE
-OBSOLETE #include <errno.h>
-OBSOLETE
-OBSOLETE int
-OBSOLETE mmaptime_probe(void)
-OBSOLETE {
-OBSOLETE return EOPNOTSUPP;
-OBSOLETE }
-OBSOLETE
-OBSOLETE int
-OBSOLETE mmaptime_gettimeofday(struct timeval *tp, void *tzp)
-OBSOLETE {
-OBSOLETE return gettimeofday(tp, tzp);
-OBSOLETE }
-OBSOLETE
-OBSOLETE int
-OBSOLETE mmaptime_close(void)
-OBSOLETE {
-OBSOLETE return 0;
-OBSOLETE }
-OBSOLETE
-OBSOLETE #endif /* USE_MMAPTIME not useable */
-OBSOLETE #endif /* USE_MMAPTIME */
-OBSOLETE
diff --git a/usr.sbin/afs/src/util/mmaptime.h b/usr.sbin/afs/src/util/mmaptime.h
deleted file mode 100644
index 2296d772f0d..00000000000
--- a/usr.sbin/afs/src/util/mmaptime.h
+++ /dev/null
@@ -1,47 +0,0 @@
-OBSOLETE /*
-OBSOLETE * Copyright (c) 1998 Kungliga Tekniska Högskolan
-OBSOLETE * (Royal Institute of Technology, Stockholm, Sweden).
-OBSOLETE * All rights reserved.
-OBSOLETE *
-OBSOLETE * Redistribution and use in source and binary forms, with or without
-OBSOLETE * modification, are permitted provided that the following conditions
-OBSOLETE * are met:
-OBSOLETE *
-OBSOLETE * 1. Redistributions of source code must retain the above copyright
-OBSOLETE * notice, this list of conditions and the following disclaimer.
-OBSOLETE *
-OBSOLETE * 2. Redistributions in binary form must reproduce the above copyright
-OBSOLETE * notice, this list of conditions and the following disclaimer in the
-OBSOLETE * documentation and/or other materials provided with the distribution.
-OBSOLETE *
-OBSOLETE * 3. Neither the name of the Institute nor the names of its contributors
-OBSOLETE * may be used to endorse or promote products derived from this software
-OBSOLETE * without specific prior written permission.
-OBSOLETE *
-OBSOLETE * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-OBSOLETE * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-OBSOLETE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-OBSOLETE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-OBSOLETE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-OBSOLETE * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OBSOLETE * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-OBSOLETE * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-OBSOLETE * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OBSOLETE * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-OBSOLETE * SUCH DAMAGE.
-OBSOLETE */
-OBSOLETE
-OBSOLETE /* $arla: mmaptime.h,v 1.3 2002/12/20 13:11:51 lha Exp $ */
-OBSOLETE
-OBSOLETE #ifndef _UTIL_MMAPTIME_H
-OBSOLETE #define _UTIL_MMAPTIME_H 1
-OBSOLETE
-OBSOLETE #include <sys/time.h>
-OBSOLETE
-OBSOLETE int mmaptime_probe(void);
-OBSOLETE int mmaptime_gettimeofday(struct timeval *tp, void *tzp);
-OBSOLETE int mmaptime_close(void);
-OBSOLETE
-OBSOLETE #endif
-OBSOLETE
-OBSOLETE
diff --git a/usr.sbin/afs/src/util/mmaptime_test.c b/usr.sbin/afs/src/util/mmaptime_test.c
deleted file mode 100644
index 7793f4b5c8e..00000000000
--- a/usr.sbin/afs/src/util/mmaptime_test.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 1998 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-RCSID("$arla: mmaptime_test.c,v 1.6 2002/05/16 22:09:46 hin Exp $");
-
-#ifdef USE_MMAPTIME
-
-#include <stdio.h>
-#include <time.h>
-#include <errno.h>
-#include <err.h>
-#include "mmaptime.h"
-
-static void
-print_time_diff(char *str, struct timeval *tv, struct timeval *tv2)
-{
- struct timeval t;
-
- t.tv_sec = tv2->tv_sec - tv->tv_sec;
- t.tv_usec = tv2->tv_usec - tv->tv_usec;
- if (t.tv_usec < 0) {
- t.tv_usec += 100000;
- --t.tv_sec;
- }
-
- printf("%s: %f\n",
- str,
- (double)t.tv_sec +
- (double)t.tv_usec / 100000 );
-}
-
-
-int main(int argc, char **argv)
-{
- struct timeval t, t2, start, stop;
- int i, times;
- time_t tim;
-
- i = mmaptime_probe();
- if (i == EOPNOTSUPP) {
- errx(1, "You don't have support for mmaptime\n"
- "Try run configure with --enable-mmaptime");
- } else if (i) {
- err(1, "probe");
- }
-
- if (!(argc == 2 && sscanf(argv[1], "%d", &times) == 1))
- times = 100000;
-
- /* Get date two different ways */
-
- if (mmaptime_gettimeofday(&t, NULL))
- err(1, "mmaptime_gettimeofday: here am I");
- if (gettimeofday(&t2, NULL))
- err(1, "gettimeofday: this should not happen");
- tim = t.tv_sec;
- printf("mmaptime: %s", ctime(&tim));
- tim = t2.tv_sec;
- printf("gettimeofday: %s", ctime(&tim));
-
- print_time_diff("Diff", &t, &t2);
-
- /* Test run */
-
- printf("Doing %d tests of mmaptime_gettimeofday()\n", times);
- if (mmaptime_gettimeofday(&start, NULL))
- err(1, "mmaptime_gettimeofday: start");
- for (i = 0 ; i < times ; i++) {
- if (mmaptime_gettimeofday(&t, NULL))
- err(1, "mmaptime_gettimeofday: running");
- }
- if (mmaptime_gettimeofday(&stop, NULL))
- err(1, "mmaptime_gettimeofday: stop");
- print_time_diff("End time", &start, &stop);
-
- mmaptime_close();
-
- /* Do the same with gettimeofday */
-
- printf("Doing %d tests of gettimeofday()\n", times);
- if (gettimeofday(&start, NULL))
- err(1, "gettimeofday: start");
- for (i = 0 ; i < times ; i++) {
- if (gettimeofday(&t, NULL))
- err(1, "gettimeofday: running");
- }
- if (gettimeofday(&stop, NULL))
- err(1, "gettimeofday: stop");
- print_time_diff("End time", &start, &stop);
-
- return 0;
-}
-
-#else /* !USE_MMAPTIME */
-
-int
-main(int argc, char **argv)
-{
- return 0;
-}
-
-#endif /* USE_MMAPTIME */
diff --git a/usr.sbin/afs/src/util/util-tester.c b/usr.sbin/afs/src/util/util-tester.c
deleted file mode 100644
index 1adb53a841b..00000000000
--- a/usr.sbin/afs/src/util/util-tester.c
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * Copyright (c) 1998 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <roken.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/time.h>
-
-#include <parse_units.h>
-
-#include "bool.h"
-#include "hash.h"
-#include "log.h"
-#include "arlamath.h"
-
-struct timeval time1, time2;
-
-static void
-starttesting(char *msg)
-{
- printf("--------------------------------------------\n");
- printf("testing %s...\n", msg);
- fflush (stdout);
- gettimeofday(&time1, NULL);
-}
-
-static int
-endtesting(int bool)
-{
- gettimeofday(&time2, NULL);
- printf("-%s--------------------------------------\n",
- !bool ? "ok --" : "fail ");
- time2.tv_usec -= time1.tv_usec;
- if (time2.tv_usec < 0) {
- time2.tv_usec += 10000;
- --time2.tv_sec;
- }
- time2.tv_sec -= time1.tv_sec;
- printf("timing: %ld.%ld\n", (long)time2.tv_sec, (long)time2.tv_usec);
-
- return bool;
-}
-
-
-static int
-hash_cmp(void *foo, void *bar)
-{
- return strcmp((char *) foo, (char *)bar);
-}
-
-static unsigned
-hash_hash(void *foo)
-{
- return hashcaseadd((char *) foo);
-}
-
-static Bool
-hash_print(void *foo, void *bar)
-{
- printf("%s\n", (char *) foo);
- return FALSE;
-}
-
-static int
-test_hash(void)
-{
- Hashtab *h;
-
- starttesting("hashtab");
-
- h = hashtabnew(100, hash_cmp, hash_hash);
- if (!h)
- return endtesting(1);
-
- if (!hashtabadd(h, "one")||
- !hashtabadd(h, "two")||
- !hashtabadd(h, "three")||
- !hashtabadd(h, "four"))
- return endtesting(1);
-
- printf("foreach ----\n");
- hashtabforeach(h, hash_print, NULL);
-
- printf("search ----\none == %s\ntwo == %s\nthree == %s\nfour == %s\n",
- (char *)hashtabsearch(h, "one"),
- (char *)hashtabsearch(h, "two"),
- (char *)hashtabsearch(h, "three"),
- (char *)hashtabsearch(h, "four"));
-
- hashtabrelease(h);
-
- return endtesting(0);
-}
-
-struct units u1_units[] = {
- { "all", 0xff },
- { "u1-hack", 0x04 },
- { "warning", 0x02 },
- { "debug", 0x01 },
- { NULL, 0 }
-};
-
-struct units u2_units[] = {
- { "all", 0xff },
- { "u2-hack2", 0x08 },
- { "u2-hack1", 0x04 },
- { "warning", 0x02 },
- { "debug", 0x01 },
- { NULL, 0 }
-};
-
-static int
-test_log (void)
-{
- Log_method *m;
- Log_unit *u1, *u2;
- char buf[1024];
-
- starttesting ("log");
-
- m = log_open ("util-tester", "/dev/stderr:notime");
- if (m == NULL)
- return endtesting(1);
-
- u1 = log_unit_init (m, "u1", u1_units, 0x3);
- if (u1 == NULL)
- return endtesting(1);
-
- u2 = log_unit_init (m, "u2", u2_units, 0x0);
- if (u2 == NULL)
- return endtesting(1);
-
- log_mask2str (m, NULL, buf, sizeof(buf));
- printf ("%s\n", buf); fflush (stdout);
- log_set_mask_str (m, NULL, buf);
- log_log (u1, 0x1, "1. this should show");
- log_log (u2, 0x1, "X. this should NOT show");
-
- log_set_mask_str (m, NULL, "u1:-debug;u2:+debug");
- log_log (u1, 0x1, "X. now this should NOT show");
- log_log (u2, 0x1, "2. now this should show");
- log_mask2str (m, NULL, buf, sizeof(buf));
- printf ("%s\n", buf); fflush (stdout);
- log_set_mask_str (m, NULL, buf);
-
- log_set_mask_str (m, NULL, "u1:-debug;u2:-debug");
- log_log (u1, 0x1, "X. now this should NOT show");
- log_log (u2, 0x1, "X. now this should NOT show");
- log_mask2str (m, NULL, buf, sizeof(buf));
- printf ("%s\n", buf); fflush (stdout);
- log_set_mask_str (m, NULL, buf);
-
- log_set_mask_str (m, NULL, "+debug");
- log_log (u1, 0x1, "3. now this should show");
- log_log (u2, 0x1, "4. now this should show");
- log_mask2str (m, NULL, buf, sizeof(buf));
- printf ("%s\n", buf); fflush (stdout);
- log_set_mask_str (m, NULL, buf);
-
- log_set_mask_str (m, NULL, "-debug");
- log_log (u1, 0x1, "X. now this should NOT show");
- log_log (u2, 0x1, "X. now this should NOT show");
- log_mask2str (m, NULL, buf, sizeof(buf));
- printf ("%s\n", buf); fflush (stdout);
- log_set_mask_str (m, NULL, buf);
-
- log_set_mask_str (m, NULL, "+debug,+warning");
- log_log (u1, 0x1, "5. now this should show");
- log_log (u2, 0x1, "6. now this should show");
- log_log (u1, 0x2, "7. now this should show");
- log_log (u2, 0x2, "8. now this should show");
- log_mask2str (m, NULL, buf, sizeof(buf));
- printf ("%s\n", buf); fflush (stdout);
- log_set_mask_str (m, NULL, buf);
-
- log_set_mask_str (m, u1, "-debug,-warning");
- log_log (u1, 0x1, "X. now this should NOT show");
- log_log (u2, 0x1, "9. now this should show");
- log_log (u1, 0x2, "X. now this should NOT show");
- log_log (u2, 0x2, "10. now this should show");
-
- log_mask2str (m, NULL, buf, sizeof(buf));
- printf ("%s\n", buf); fflush (stdout);
- log_set_mask_str (m, NULL, buf);
-
- log_set_mask (u1, 0x4 + 0x2 + 0x1);
- log_set_mask (u2, 0x8 + 0x4 + 0x2 + 0x1);
-
- log_mask2str (m, NULL, buf, sizeof(buf));
- printf ("%s\n", buf); fflush (stdout);
- log_set_mask_str (m, NULL, buf);
-
- log_set_mask_str (m, NULL, "all");
- log_mask2str (m, NULL, buf, sizeof(buf));
- printf ("all: %s\n", buf); fflush (stdout);
-
- log_set_mask_str (m, NULL, "-all");
- log_mask2str (m, NULL, buf, sizeof(buf));
- printf ("none: %s\n", buf); fflush (stdout);
-
-
- log_close (m);
- return endtesting (0);
-}
-
-static int
-test_math (void)
-{
- starttesting ("math");
-
- if (arlautil_findprime(17) != 17)
- return endtesting (1);
- if (arlautil_findprime(18) != 19)
- return endtesting (1);
- if (arlautil_findprime(11412) != 11423)
- return endtesting (1);
-
- if (arlautil_findprime(11412) != 11423)
- return endtesting (1);
-
- if (arlautil_isprime(20897) == 0)
- return endtesting (1);
- if (arlautil_isprime(49037) == 0)
- return endtesting (1);
-
- return endtesting (0);
-}
-
-int
-main(int argc, char **argv)
-{
- int ret = 0;
- ret |= test_hash();
- ret |= test_log();
- ret |= test_math();
- return ret;
-}
diff --git a/usr.sbin/afs/src/ydr/Makefile.in b/usr.sbin/afs/src/ydr/Makefile.in
deleted file mode 100644
index 09d6735c0af..00000000000
--- a/usr.sbin/afs/src/ydr/Makefile.in
+++ /dev/null
@@ -1,103 +0,0 @@
-# $KTH: Makefile.in,v 1.21 2000/12/21 12:47:04 lha Exp $
-
-srcdir = @srcdir@
-top_builddir = ..
-VPATH = @srcdir@
-
-CC = @CC@
-YACC = @YACC@
-LEX = @LEX@
-YFLAGS = -d
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-ETAGS = etags
-MAKEDEPEND = makedepend
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-
-DEFS = @DEFS@ -DCPP="\"@CPP@\""
-
-LIBS = @LIBS@
-
-SHELL = /bin/sh
-
-CFLAGS = @CFLAGS@
-REALCFLAGS = -I$(srcdir) \
- -I$(srcdir)/../util \
- -I../include \
- -I$(srcdir)/../include \
- -I. \
- @INC_roken@ \
- $(CFLAGS) $(DEFS)
-ydr_SRCS = parse.y lex.l main.c symbol.c types.c output.c
-ydr_OBJS = parse.o lex.o main.o symbol.o types.o output.o
-HDRS = sym.h types.h output.h lex.h parse.h
-bin_PROGRAMS = ydr
-
-SRCS = $(ydr_SRCS)
-OBJS = $(ydr_OBJS)
-
-all: $(bin_PROGRAMS)
-
-.PHONY: all install uninstall depend tags clean
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(REALCFLAGS) $<
-
-.l.c:
- $(LEX) $(LFLAGS) -t $< >$@
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
- for x in $(bin_PROGRAMS); do \
- f=`echo $$x | sed '$(transform)'`; \
- $(INSTALL_PROGRAM) $$x $(DESTDIR)$(bindir)/$$f; \
- done
-
-uninstall:
- for x in $(bin_PROGRAMS); do \
- f=`echo $$x | sed '$(transform)'`; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
- done
-
-ydr: $(ydr_OBJS) ../util/libutil.a
- $(CC) $(LDFLAGS) -o $@ $(ydr_OBJS) ../util/libutil.a @LIB_roken@ $(LIBS)
-
-parse.c: parse.h
-parse.h: parse.y
- $(YACC) $(YFLAGS) $(srcdir)/parse.y
- mv -f y.tab.h parse.h
- mv -f y.tab.c parse.c
-
-lex.c: lex.l
- $(LEX) $(srcdir)/lex.l
- mv -f lex.yy.c lex.c
-
-lex.o: parse.h
-
-Makefile: Makefile.in ../config.status
- cd ..; CONFIG_FILES=ydr/Makefile CONFIG_HEADERS= $(SHELL) config.status
-
-depend: $(SRCS) $(HDRS)
- $(MAKEDEPEND) -- $(REALCFLAGS) -- $^
-
-tags: TAGS
-
-TAGS: $(SRCS) $(HDRS)
- $(ETAGS) -t $(SRCS) $(HDRS)
-
-clean :
- rm -f $(OBJS) $(bin_PROGRAMS) lex.c parse.c parse.h *~ *.o core
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *~
-
-realclean: distclean
- rm -f TAGS
diff --git a/usr.sbin/afs/src/ydr/lex.h b/usr.sbin/afs/src/ydr/lex.h
deleted file mode 100644
index 450193d7543..00000000000
--- a/usr.sbin/afs/src/ydr/lex.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: lex.h,v 1.6 2000/10/02 22:36:33 lha Exp $ */
-
-#ifndef _LEX_
-#define _LEX_
-
-void error_message (int errorp, char *, ...);
-
-int yylex (void);
-
-#endif /* _LEX_ */
diff --git a/usr.sbin/afs/src/ydr/lex.l b/usr.sbin/afs/src/ydr/lex.l
deleted file mode 100644
index d1a2e9ee4b7..00000000000
--- a/usr.sbin/afs/src/ydr/lex.l
+++ /dev/null
@@ -1,189 +0,0 @@
-%{
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: lex.l,v 1.31 2003/01/20 07:12:56 lha Exp $");
-#endif
-
-/*
- * This is to handle the definition of this symbol in some AIX
- * headers, which will conflict with the definition that lex will
- * generate for it. It's only a problem for AIX lex.
- */
-
-#ifndef __osf__
-#undef ECHO
-#endif
-
-#include <stdio.h>
-#include <ctype.h>
-#include <stdarg.h>
-#include <string.h>
-#include <roken.h>
-#include "sym.h"
-#include "types.h"
-#include "parse.h"
-#include "lex.h"
-#include "output.h"
-
-#ifndef __osf__
-#undef ECHO
-#endif
-
-#define YY_NO_UNPUT
-
-static unsigned lineno;
-
-static char filename[256];
-
-static void parse_filename (char *s);
-static void parse_lineno (char *s);
-%}
-
-%%
-^\#[ ][0-9]+[ ]\"[^\n\"]*\".*\n { parse_filename (yytext); }
-^\#line[ ][0-9]+[ ]\"[^\n\"]*\".*\n { parse_filename (yytext); }
-^\#[ ][0-9]+.*\n { parse_lineno (yytext); }
-^\#line[ ][0-9]+.*\n { parse_lineno (yytext); }
-^\#ident.*$ { }
-const { return T_CONST; }
-enum { return T_ENUM; }
-struct { return T_STRUCT; }
-typedef { return T_TYPEDEF; }
-unsigned { return T_UNSIGNED; }
-long { return T_LONG; }
-afs_int32 { return T_LONG; }
-int32_t { return T_LONG; }
-afs_int64 { return T_LONGLONG; }
-int64_t { return T_LONGLONG; }
-u_long { return T_ULONG; }
-uint32_t { return T_ULONG; }
-afs_uint32 { return T_ULONG; }
-uint64_t { return T_ULONGLONG; }
-afs_uint64 { return T_ULONGLONG; }
-short { return T_SHORT; }
-int16_t { return T_SHORT; }
-u_short { return T_USHORT; }
-uint16_t { return T_USHORT; }
-int { return T_INT; }
-u_char { return T_UCHAR; }
-char { return T_CHAR; }
-string { return T_STRING; }
-opaque { return T_OPAQUE; }
-package { return T_PACKAGE; }
-prefix { return T_PREFIX; }
-proc { return T_PROC; }
-error-function { return T_ERROR_FUNCTION; }
-split { return T_SPLIT; }
-multi { return T_MULTI; }
-IN { return T_IN; }
-OUT { return T_OUT; }
-INOUT { return T_INOUT; }
-ASIS { return T_ASIS; }
-"["|"]"|[,;=()<>]|"{"|"}"|"*" { return *yytext; }
-^\%[^\n]*$ { yylval.name = strdup (yytext+1); return T_VERBATIM; }
--?[0-9]+ { yylval.constant = atoi(yytext); return T_CONSTANT; }
-0[Xx][0-9a-fA-F]+ { yylval.constant = (int)strtol(yytext+2, NULL, 0x10); return T_CONSTANT; }
-[A-Za-z_][A-Za-z0-9_]* {
-Symbol *sym;
-
-sym = findsym(yytext);
-yylval.sym = sym;
-if (sym == NULL) {
- yylval.name = strdup(yytext);
- return T_IDENTIFIER;
-} else if (sym->type == YDR_TCONST)
- return T_IDCONST;
-else if (sym->type == YDR_TTYPEDEF
- || sym->type == YDR_TENUM
- || sym->type == YDR_TSTRUCT)
- return T_IDTYPE;
-else
- error_message (0, "Ignoring \"%s\"\n", yytext);
-}
-[ \t] ;
-\n { lineno++; }
-. { error_message(0, "Ignoring char(%c)\n", *yytext); }
-%%
-
-#ifndef yywrap
-int
-yywrap (void)
-{
- return 1;
-}
-#endif /* !yywrap */
-
-void
-error_message (int errorp, char *format, ...)
-{
- va_list args;
-
- va_start (args, format);
- fprintf (stderr, "%s:%d: ", filename, lineno);
- vfprintf (stderr, format, args);
- va_end (args);
- if (errorp)
- parse_errors = 1;
-}
-
-static void
-parse_filename (char *s)
-{
- char *d1, *d2;
-
- while (!isspace((unsigned char)*s))
- ++s;
- while (isspace((unsigned char)*s))
- ++s;
-
- lineno = atoi (s);
- d1 = strchr (s, '"') + 1;
- d2 = strchr (d1, '"');
- *d2 = '\0';
- if (strcmp (d1, "") != 0)
- strlcpy (filename, d1, sizeof(filename));
-}
-
-static void
-parse_lineno (char *s)
-{
- while (!isspace((unsigned char)*s))
- ++s;
- while (isspace((unsigned char)*s))
- ++s;
-
- lineno = atoi (s);
-}
diff --git a/usr.sbin/afs/src/ydr/main.c b/usr.sbin/afs/src/ydr/main.c
deleted file mode 100644
index 951c73102d7..00000000000
--- a/usr.sbin/afs/src/ydr/main.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: main.c,v 1.23 2002/11/27 23:48:58 lha Exp $");
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <roken.h>
-#include "sym.h"
-#include "output.h"
-#include <err.h>
-#include <roken.h>
-
-extern FILE *yyin;
-
-int parse_errors;
-
-/*
- * ydr - generate stub routines for encode/decoding and RX
- */
-
-int yyparse(void);
-
-/*
- * Return the basename of `s'.
- * The result is malloc'ed.
- */
-
-static char *
-ydr_basename (const char *s)
-{
- const char *p, *q;
- char *res;
-
- p = strrchr (s, '/');
- if (p == NULL)
- p = s;
- else
- ++p;
- q = strchr (p, '.');
- if (q == NULL)
- q = s + strlen (s);
- res = malloc (q - p + 1);
- if (res == NULL)
- return NULL;
- memmove (res, p, q - p);
- res[q - p] = '\0';
- return res;
-}
-
-/*
- *
- */
-
-int
-main (int argc, char **argv)
-{
- int ret;
- FILE *foo;
- char tmp_filename[64];
- char *cpp = CPP;
- int arglen;
- int i;
- char *arg;
- char *filename;
-
- if (argc < 2)
- errx (1, "Usage: %s [cpp-arguments] filename", argv[0]);
-
- snprintf (tmp_filename, sizeof(tmp_filename),
- "ydr_tmp_%u.c", (unsigned)getpid());
- foo = fopen (tmp_filename, "w");
- if (foo == NULL)
- err (1, "error opening %s", tmp_filename);
- filename = ydr_basename (argv[argc - 1]);
- fprintf (foo, "#include \"%s\"\n", argv[argc - 1]);
- fclose (foo);
-
- initsym ();
- init_generate (filename);
-
- arglen = strlen(cpp) + 1;
- for (i = 1; i < argc - 1; ++i) {
- arglen += strlen (argv[i]) + 1;
- }
- arglen += strlen(tmp_filename) + 1;
-
- arg = malloc (arglen);
- if (arg == NULL) {
- unlink (tmp_filename);
- errx (1, "malloc: out of memory");
- }
- strlcpy (arg, cpp, arglen);
- strlcat (arg, " ", arglen);
- for (i = 1; i < argc - 1; ++i) {
- strlcat (arg, argv[i], arglen);
- strlcat (arg, " ", arglen);
- }
- strlcat (arg, tmp_filename, arglen);
-
- yyin = popen (arg, "r");
- if (yyin == NULL) {
- unlink (tmp_filename);
- err (1, "popen `%s'", arg);
- }
- free (arg);
- ret = yyparse ();
- generate_server_switch (serverfile.stream, serverhdrfile.stream);
- pclose (yyin);
- close_generator (filename);
- unlink (tmp_filename);
-
- return ret + parse_errors;
-}
-
diff --git a/usr.sbin/afs/src/ydr/output.c b/usr.sbin/afs/src/ydr/output.c
deleted file mode 100644
index a9b5326d080..00000000000
--- a/usr.sbin/afs/src/ydr/output.c
+++ /dev/null
@@ -1,2445 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: output.c,v 1.91 2003/04/16 09:07:03 lha Exp $");
-#endif
-
-#include <stdio.h>
-#include <assert.h>
-#include <string.h>
-#include <list.h>
-#include <ctype.h>
-#include <err.h>
-#include <roken.h>
-#include "sym.h"
-#include "output.h"
-#include "types.h"
-#include "lex.h"
-
-/*
- * The name of the current package that we're generating stubs for
- */
-
-char *package = "";
-
-/*
- * This is the list of packages so we know how to generate
- * all Execute_package().
- */
-
-List *packagelist = NULL;
-
-/*
- * Add this in front of the real functions implementing the server
- * functions called.
- */
-
-char *prefix = "";
-
-/*
- * File handles for the generated files themselves.
- */
-
-ydr_file headerfile,
- clientfile,
- serverfile,
- clienthdrfile,
- serverhdrfile,
- ydrfile;
-
-static long tmpcnt = 0;
-
-/*
- * Function to convert error codes with.
- * (the default, the empty string, conveniently means no conversion.)
- */
-
-char *error_function = "";
-
-typedef enum { ENCODE_RX, DECODE_RX, ENCODE_MEM, DECODE_MEM } EncodeType;
-
-typedef enum { CLIENT, SERVER } Side;
-
-typedef enum { FDECL, VDECL } DeclType;
-
-static void print_type (char *name, Type *type, enum argtype argtype,
- DeclType decl, FILE *f);
-static Bool print_entry (List *list, Listitem *item, void *i);
-static void generate_hdr_struct (Symbol *s, FILE *f);
-static void generate_hdr_enum (Symbol *s, FILE *f);
-static void generate_hdr_const (Symbol *s, FILE *f);
-static void generate_hdr_typedef (Symbol *s, FILE *f);
-static int sizeof_type (Type *type);
-static int sizeof_symbol (Symbol *);
-static void encode_type (char *name, Type *type, FILE *f,
- EncodeType encodetype, Side side);
-static void display_type (char *where, char *name, Type *type, FILE *f);
-static Bool encode_entry (List *list, Listitem *item, void *arg);
-static void encode_struct (Symbol *s, char *name, FILE *f,
- EncodeType encodetype, Side side);
-static void encode_enum (Symbol *s, char *name, FILE *f,
- EncodeType encodetype, Side side);
-static void encode_typedef (Symbol *s, char *name, FILE *f,
- EncodeType encodetype, Side side);
-static void encode_symbol (Symbol *s, char *name, FILE *f,
- EncodeType encodetype, Side side);
-static void print_symbol (char *where, Symbol *s, char *name, FILE *f);
-static void free_symbol (char *where, Symbol *s, char *name, FILE *f);
-static void free_type (char *where, char *name, Type *type, FILE *f);
-
-static void
-print_type (char *name, Type *type, enum argtype argtype,
- DeclType decl, FILE *f)
-{
- switch (type->type) {
- case YDR_TCHAR :
- fprintf (f, "char %s", name);
- break;
- case YDR_TUCHAR :
- fprintf (f, "unsigned char %s", name);
- break;
- case YDR_TSHORT :
- fprintf (f, "int16_t %s", name);
- break;
- case YDR_TUSHORT :
- fprintf (f, "uint16_t %s", name);
- break;
- case YDR_TLONG :
- fprintf (f, "int32_t %s", name);
- break;
- case YDR_TULONG :
- fprintf (f, "uint32_t %s", name);
- break;
- case YDR_TLONGLONG:
- fprintf (f, "int64_t %s", name);
- break;
- case YDR_TULONGLONG:
- fprintf (f, "uint64_t %s", name);
- break;
- case YDR_TSTRING :
- if (type->size && decl == VDECL)
- fprintf (f, "char %s[%d]", name, type->size);
- else if (argtype != TIN && type->size == 0)
- fprintf (f, "char **%s", name);
- else
- fprintf (f, "char *%s", name);
- break;
- case YDR_TPOINTER :
- {
- char *tmp;
- size_t len = strlen(name) + 2;
-
- tmp = (char *)emalloc (len);
- *tmp = '*';
- strlcpy (tmp+1, name, len - 1);
- print_type (tmp, type->subtype, argtype, decl, f);
- free (tmp);
- break;
- }
- case YDR_TUSERDEF :
- if(type->symbol->type == YDR_TSTRUCT)
- fprintf (f, "struct %s %s", type->symbol->name, name);
- else
- fprintf (f, "%s %s", type->symbol->name, name);
- break;
- case YDR_TVARRAY :
- {
- char *s;
- size_t len = strlen (name) + 6;
-
- s = (char *)emalloc (len);
- *s = '*';
- strlcpy (s + 1, name, len - 1);
- strlcat (s, "_len", len);
-
- fprintf (f, "struct {\n");
- if (type->indextype)
- print_type ("len", type->indextype, argtype, decl, f);
- else
- fprintf (f, "unsigned %s", "len");
- fprintf (f, ";\n");
- strlcpy(s + strlen(s) - 3, "val", len - strlen(s) + 3);
- print_type ("*val", type->subtype, argtype, decl, f);
- fprintf (f, ";\n} %s", name);
- free(s);
- break;
- }
- case YDR_TARRAY :
- print_type (name, type->subtype, argtype, decl, f);
- fprintf (f, "[ %d ]", type->size);
- break;
- case YDR_TOPAQUE :
- fprintf (f, "char %s", name);
- break;
- default :
- exit(-1);
- }
-}
-
-static Bool
-print_entry (List *list, Listitem *item, void *i)
-{
- StructEntry *s = (StructEntry *)listdata (item);
- FILE *f = (FILE *)i;
-
- fprintf (f, " ");
- print_type (s->name, s->type, TIN, VDECL, f);
- fprintf (f, ";\n");
- return FALSE;
-}
-
-/*
- * Return the size of this type in bytes.
- * In the case of a variable-sized type, return -1 (unknown) or
- * the negative maxsize.
- */
-
-static Bool
-sizeof_struct_iter (List *list, Listitem *item, void *arg)
-{
- int *tot = (int *)arg;
- StructEntry *s = (StructEntry *)listdata (item);
- int sz;
-
- sz = sizeof_type (s->type);
- if (sz == -1) {
- *tot = -1;
- return TRUE;
- } else if (sz < 0 || *tot < 0) {
- *tot = -1 * (abs(*tot) + abs(sz));
- return FALSE;
- } else {
- *tot = *tot + sz;
- return FALSE;
- }
-}
-
-static int
-sizeof_struct (Symbol *s)
-{
- int tot = 0;
-
- if (s->u.list)
- listiter (s->u.list, sizeof_struct_iter, &tot);
- return tot;
-}
-
-static int
-sizeof_type (Type *t)
-{
- switch (t->type) {
- case YDR_TCHAR :
- case YDR_TUCHAR :
- case YDR_TSHORT :
- case YDR_TUSHORT :
- case YDR_TLONG :
- case YDR_TULONG :
- return 4;
- case YDR_TLONGLONG :
- case YDR_TULONGLONG :
- return 8;
- case YDR_TSTRING :
- if (t->size == 0)
- return -1;
- else
- return t->size;
- case YDR_TOPAQUE :
- return 1;
- case YDR_TUSERDEF :
- return sizeof_symbol (t->symbol);
- case YDR_TARRAY :
- {
- int sz = sizeof_type (t->subtype);
-
- if (sz == -1)
- return -1;
- return t->size * sz;
- }
- case YDR_TVARRAY :
- {
- int sz;
- if (t->size == 0)
- return -1;
- sz = sizeof_type(t->subtype);
- if (sz == -1)
- return -1;
- return -1 * (t->size * abs(sz) + 4); /* 4 is size of the var part */
- }
- case YDR_TPOINTER :
- return -1;
- default :
- abort ();
- }
-}
-
-static int
-sizeof_symbol (Symbol *s)
-{
- switch (s->type) {
- case YDR_TUNDEFINED :
- fprintf (stderr, "What is %s doing in sizeof_type?", s->name);
- return 0;
- case YDR_TSTRUCT :
- return sizeof_struct (s);
- case YDR_TENUM :
- return 4;
- case YDR_TCONST :
- return 0;
- case YDR_TENUMVAL :
- return 0;
- case YDR_TTYPEDEF :
- return sizeof_type (s->u.type);
- default :
- abort ();
- }
-}
-
-/*
- * Generate header contents
- */
-
-static void
-generate_hdr_struct (Symbol *s, FILE *f)
-{
- fprintf (f, "struct %s {\n", s->name);
- if (s->u.list)
- listiter (s->u.list, print_entry, f);
- fprintf (f, "};\ntypedef struct %s %s;\n", s->name, s->name);
-}
-
-static void
-generate_hdr_enum (Symbol *s, FILE *f)
-{
- Listitem *item;
- Symbol *e;
-
- fprintf (f, "enum %s {\n", s->name);
- if (s->u.list) {
- for (item = listhead (s->u.list);
- item && listnext (s->u.list, item);
- item = listnext (s->u.list, item))
- {
- e = (Symbol *)listdata (item);
-
- fprintf (f, " %s = %d,\n", e->name, e->u.val);
- }
- e = (Symbol *)listdata (item);
- fprintf (f, " %s = %d\n};\n", e->name, e->u.val);
- }
- fprintf (f, "typedef enum %s %s;\n",
- s->name, s->name);
-}
-
-static void
-generate_hdr_const (Symbol *s, FILE *f)
-{
- fprintf (f, "#define %s %d\n", s->name, s->u.val);
-}
-
-static void
-generate_hdr_typedef (Symbol *s, FILE *f)
-{
- fprintf (f, "typedef ");
- print_type (s->name, s->u.type, TIN, VDECL, f);
- fprintf (f, ";\n");
-}
-
-void
-generate_sizeof (Symbol *s, FILE *f)
-{
- int sz;
-
- if (s->type == YDR_TCONST)
- return;
-
- sz = sizeof_symbol (s);
- if (sz == -1) {
- ; /* the size is unknown */
- } else {
- char *name, *ms = "";
- if (sz < 0)
- ms = "MAX_";
-
- name = estrdup (s->name);
- fprintf (f, "#define %s_%sSIZE %d\n", strupr (name), ms, abs(sz));
- free (name);
- }
-}
-
-void
-generate_header (Symbol *s, FILE *f)
-{
- switch (s->type) {
- case YDR_TUNDEFINED :
- fprintf (f, "What is %s doing in generate_header?", s->name);
- break;
- case YDR_TSTRUCT :
- generate_hdr_struct (s, f);
- break;
- case YDR_TENUM :
- generate_hdr_enum (s, f);
- break;
- case YDR_TCONST :
- generate_hdr_const (s, f);
- break;
- case YDR_TENUMVAL :
- break;
- case YDR_TTYPEDEF :
- generate_hdr_typedef (s, f);
- default :
- break;
- }
- putc ('\n', f);
-}
-
-/*
- * Generate functions for encoding and decoding.
- */
-
-static char *
-encode_function (Type *type, EncodeType encodetype)
-{
- if (type->flags & TASIS)
- return "";
- else if (encodetype == ENCODE_RX || encodetype == ENCODE_MEM) {
- switch (type->type) {
- case YDR_TLONGLONG:
- case YDR_TULONGLONG:
- return "htole64";
- default:
- return "htonl";
- break;
- }
- } else if (encodetype == DECODE_RX || encodetype == DECODE_MEM) {
- switch (type->type) {
- case YDR_TLONGLONG:
- case YDR_TULONGLONG:
- return "letoh64";
- default:
- return "ntohl";
- break;
- }
- } else
- exit(-1);
-}
-
-/*
- * encode/decode long/longlong
- */
-
-static void
-encode_int_type (char *name, char *tname, Type *type,
- FILE *f, EncodeType encodetype)
-{
- switch (encodetype) {
- case ENCODE_RX :
- fprintf (f, "{ u%s u;\n"
- "u = %s (%s);\n"
- "if(rx_Write(call, &u, sizeof(u)) != sizeof(u))\n"
- "goto fail;\n"
- "}\n",
- tname,
- encode_function (type, encodetype),
- name);
- break;
- case DECODE_RX :
- fprintf (f, "{ u%s u;\n"
- "if(rx_Read(call, &u, sizeof(u)) != sizeof(u))\n"
- "goto fail;\n"
- "%s = %s (u);\n"
- "}\n", tname, name,
- encode_function (type, encodetype));
- break;
- case ENCODE_MEM :
- fprintf (f, "{ %s tmp = %s(%s); "
- "if (*total_len < sizeof(tmp)) goto fail;\n"
- "memcpy (ptr, (char*)&tmp, sizeof(tmp)); "
- "ptr += sizeof(tmp); "
- "*total_len -= sizeof(tmp);}\n",
- tname,
- encode_function (type, encodetype),
- name);
- break;
- case DECODE_MEM :
- fprintf (f, "{ %s tmp; "
- "if (*total_len < sizeof(tmp)) goto fail;"
- "memcpy ((char*)&tmp, ptr, sizeof(tmp)); "
- "%s = %s(tmp); "
- "ptr += sizeof(tmp); "
- "*total_len -= sizeof(tmp);}\n",
- tname,
- name,
- encode_function (type, encodetype));
- break;
- default :
- abort ();
- }
-}
-
-static void
-encode_long (char *name, Type *type, FILE *f, EncodeType encodetype)
-{
- encode_int_type(name, "int32_t", type, f, encodetype);
-}
-
-static void
-encode_longlong (char *name, Type *type, FILE *f, EncodeType encodetype)
-{
- encode_int_type(name, "int64_t", type, f, encodetype);
-}
-
-/*
- * print long
- */
-
-static void
-print_long (char *where, char *name, Type *type, FILE *f)
-{
- fprintf (f, "printf(\" %s = %%d\", %s%s);", name, where, name);
-}
-
-/*
- * print longlong
- */
-
-static void
-print_longlong (char *where, char *name, Type *type, FILE *f)
-{
- fprintf (f, "printf(\" %s = %%d\", (int32_t)%s%s);", name, where, name);
-}
-
-/*
- *
- */
-
-static void
-gen_check_overflow(Type *indextype, Type *subtype, char *num, FILE *f)
-{
- /* Check if we will overflow */
- fprintf(f, "{\n");
- print_type ("overI", indextype, TIN, VDECL, f);
- fprintf(f, ";\n");
- fprintf(f, "overI = ((");
- print_type ("", indextype, TIN, VDECL, f);
- fprintf(f, ")~((");
- print_type ("", indextype, TIN, VDECL, f);
- fprintf(f, ")0) >> 1) / sizeof(");
- print_type ("", subtype, TIN, VDECL, f);
- fprintf(f, ");\n");
- fprintf(f, "if (overI < %s) goto fail;\n", num);
- fprintf(f, "}\n");
-}
-
-/*
- *
- */
-
-static void __attribute__ ((unused))
-encode_char (char *name, Type *type, FILE *f, EncodeType encodetype)
-{
- switch (encodetype) {
- case ENCODE_RX :
- fprintf (f,
- "if(rx_Write(call, &%s, sizeof(%s)) != sizeof(%s))\n"
- "goto fail;\n",
- name, name, name);
- break;
- case DECODE_RX :
- fprintf (f,
- "if(rx_Read(call, &%s, sizeof(%s)) != sizeof(%s))\n"
- "goto fail;\n",
- name, name, name);
- break;
- case ENCODE_MEM :
- fprintf (f, "{ if (*total_len < sizeof(char)) goto fail;\n"
- "*((char *)ptr) = %s; "
- "ptr += sizeof(char); *total_len -= sizeof(char);}\n",
- name);
- break;
- case DECODE_MEM :
- fprintf (f, "{ if (*total_len < sizeof(char)) goto fail;\n"
- "%s = *((char *)ptr); "
- "ptr += sizeof(char); *total_len -= sizeof(char);}\n",
- name);
- break;
- default :
- abort ();
- }
-}
-
-static void __attribute__ ((unused))
-encode_short (char *name, Type *type, FILE *f, EncodeType encodetype)
-{
- switch (encodetype) {
- case ENCODE_RX :
- fprintf (f, "{ int16_t u;\n"
- "u = %s (%s);\n"
- "if(rx_Write(call, &u, sizeof(u)) != sizeof(u))\n"
- "goto fail;\n"
- "}\n",
- encode_function (type, encodetype),
- name);
- break;
- case DECODE_RX :
- fprintf (f, "{ int16_t u;\n"
- "if(rx_Read(call, &u, sizeof(u)) != sizeof(u))\n"
- "goto fail;\n"
- "%s = %s (u);\n"
- "}\n", name,
- encode_function (type, encodetype));
- break;
- case ENCODE_MEM :
- fprintf (f, "{ in16_t tmp = %s(%s); "
- "if (*total_len < sizeof(int16_t)) goto fail;\n"
- "memcpy (ptr, (char*)&tmp, sizeof(int16_t)); "
- "ptr += sizeof(int16_t); "
- "*total_len -= sizeof(int16_t);}\n",
- encode_function (type, encodetype),
- name);
- break;
- case DECODE_MEM :
- fprintf (f, "{ int16_t tmp; "
- "if (*total_len < sizeof(int16_t)) goto fail;\n"
- "memcpy ((char *)&tmp, ptr, sizeof(int16_t)); "
- "%s = %s(tmp); "
- "ptr += sizeof(int16_t); "
- "*total_len -= sizeof(int16_t); }\n",
- name,
- encode_function (type, encodetype));
- break;
- default :
- abort ();
- }
-}
-
-/*
- * encode/decode TSTRING
- */
-
-static void
-encode_string (char *name, Type *type, FILE *f, EncodeType encodetype,
- Side side)
-{
- Type lentype = {YDR_TULONG};
- char *nname;
-
- asprintf (&nname, "(%s%s)",
- ((type->size == 0) && side == CLIENT
- && (encodetype == ENCODE_RX || encodetype == ENCODE_MEM))
- ? "*" : "", name);
-
- switch (encodetype) {
- case ENCODE_RX :
- fprintf (f, "{ unsigned len;\n"
- "char zero[4] = {0, 0, 0, 0};\n"
- "unsigned padlen;\n"
- "len = strlen(%s);\n"
- "padlen = (4 - (len %% 4)) %% 4;\n",
- name);
- encode_type ("len", &lentype, f, encodetype, side);
- fprintf (f,
- "if(rx_Write(call, %s, len) != len)\n"
- "goto fail;\n"
- "if(rx_Write(call, zero, padlen) != padlen)\n"
- "goto fail;\n"
- "}\n", name);
- break;
- case DECODE_RX :
- fprintf (f, "{ unsigned len;\n"
- "unsigned padlen;\n"
- "char zero[4] = {0, 0, 0, 0};\n");
- encode_type ("len", &lentype, f, encodetype, side);
- if (type->size != 0) {
- fprintf (f,
- "if (len >= %u) {\n"
- "rx_SetCallError(call, ENOMEM);\n"
- "goto fail;\n"
- "}\n",
- type->size);
- } else {
- fprintf(f, "if (len == (uint32_t) -1) {\n"
- "rx_SetCallError(call, ENOMEM);\n"
- "goto fail;\n"
- "}\n");
- fprintf(f, "%s = malloc(len + 1);\n"
- "if (%s == NULL) {\n"
- "rx_SetCallError(call, ENOMEM);\n"
- "goto fail;\n"
- "}\n",
- nname, nname);
- }
-
- fprintf (f,
- "if(rx_Read(call, %s, len) != len)\n"
- "goto fail;\n"
- "%s[len] = '\\0';\n"
- "padlen = (4 - (len %% 4)) %% 4;\n"
- "if(rx_Read(call, zero, padlen) != padlen)\n"
- "goto fail;\n"
- "}\n", nname, nname);
- break;
- case ENCODE_MEM :
- fprintf (f,
- "{\nunsigned len = strlen(%s);\n"
- "if (*total_len < len) goto fail;\n"
- "*total_len -= len;\n",
- name);
- encode_type ("len", &lentype, f, encodetype, side);
- fprintf (f, "strncpy (ptr, %s, len);\n", name);
- fprintf (f, "ptr += len + (4 - (len %% 4)) %% 4;\n"
- "*total_len -= len + (4 - (len %% 4)) %% 4;\n}\n");
- break;
- case DECODE_MEM :
- fprintf (f,
- "{\nunsigned len;\n");
- encode_type ("len", &lentype, f, encodetype, side);
- fprintf (f,
- "if (*total_len < len) goto fail;\n"
- "*total_len -= len;\n");
- if (type->size != 0) {
- fprintf (f,
- "if(len >= %u)\n"
- "goto fail;\n",
- type->size);
- } else {
- fprintf(f, "if (len == (uint32_t) -1) {\n"
- "goto fail;\n"
- "}\n");
- fprintf(f, "%s = malloc(len + 1);\n"
- "if (%s == NULL) {\n"
- "goto fail;\n"
- "}\n",
- nname, nname);
- }
- fprintf (f,
- "memcpy (%s, ptr, len);\n"
- "%s[len] = '\\0';\n"
- "ptr += len + (4 - (len %% 4)) %% 4;\n"
- "*total_len -= len + (4 - (len %% 4)) %% 4;\n}\n",
- nname, nname);
- break;
- default :
- abort ();
- }
- free (nname);
-}
-
-/*
- * print TSTRING
- */
-
-static void
-print_string (char *where, char *name, Type *type, FILE *f)
-{
- fprintf (f, "/* printing TSTRING %s%s */\n", where, name);
- fprintf (f, "printf(\" %s = %%s\", %s%s);", name, where, name);
-}
-
-#if 0
-/*
- * free TSTRING
- */
-
-static void
-free_string (char *where, char *name, Type *type, FILE *f)
-{
- fprintf (f, "free(%s%s);\n", where, name);
-}
-#endif
-
-/*
- * encode/decode TARRAY
- */
-
-static void
-encode_array (char *name, Type *type, FILE *f, EncodeType encodetype,
- Side side)
-{
- if (type->subtype->type == YDR_TOPAQUE) {
- if (type->size % 4 != 0)
- error_message (1, "Opaque array should be"
- "multiple of 4");
- switch (encodetype) {
- case ENCODE_RX :
- fprintf (f,
- "if(rx_Write (call, %s, %d) != %d)\n"
- "goto fail;",
- name, type->size, type->size);
- break;
- case DECODE_RX :
- fprintf (f,
- "if(rx_Read (call, %s, %d) != %d)\n"
- "goto fail;",
- name, type->size, type->size);
- break;
- case ENCODE_MEM :
- fprintf (f, "if (*total_len < %u) goto fail;\n"
- "memcpy (ptr, %s, %u);\n", type->size, name,
- type->size);
- fprintf (f, "ptr += %u; *total_len -= %u;\n",
- type->size, type->size);
- break;
- case DECODE_MEM :
- fprintf (f, "if (*total_len < %u) goto fail;"
- "memcpy (%s, ptr, %u);\n", type->size, name,
- type->size);
- fprintf (f, "ptr += %u; *total_len -= %u;\n",
- type->size, type->size);
- break;
- default :
- abort ();
- }
- } else {
- char tmp[256];
-
- fprintf (f, "{\nint i%lu;\nfor(i%lu = 0; i%lu < %u;"
- "++i%lu){\n", tmpcnt, tmpcnt, tmpcnt, type->size,tmpcnt);
- snprintf(tmp, sizeof(tmp)-1, "%s[i%lu]", name, tmpcnt);
- tmpcnt++;
- if (type->flags)
- type->subtype->flags |= type->flags;
- encode_type (tmp , type->subtype, f, encodetype, side);
- tmpcnt--;
- fprintf (f, "}\n}\n");
- }
-}
-
-/*
- * print ARRAY
- */
-
-static void
-print_array (char *where, char *name, Type *type, FILE *f)
-{
- fprintf (f, "{\nunsigned int i%lu;\n", tmpcnt);
-
- fprintf (f, "/* printing ARRAY %s%s */\n", where, name);
-
- if (type->subtype->type == YDR_TOPAQUE) {
- if (type->size % 4 != 0)
- error_message (1, "print_array: Opaque array should be"
- "multiple of 4");
-
- fprintf (f, "char *ptr = %s%s;\n", where, name);
- fprintf (f, "printf(\"0x\");");
- fprintf (f, "for (i%lu = 0; i%lu < %d; ++i%lu)\n"
- "printf(\"%%x\", ptr[i%lu]);",
- tmpcnt, tmpcnt,
- type->size, tmpcnt, tmpcnt);
-
- } else {
- char *ptr;
- fprintf (f, "for (i%lu = 0; i%lu < %d; ++i%lu) {\n",
- tmpcnt, tmpcnt, type->size, tmpcnt);
- asprintf(&ptr, "%s%s[i%ld]", where, name, tmpcnt);
- tmpcnt++;
- display_type (ptr, "", type->subtype, f);
- tmpcnt--;
- free(ptr);
- fprintf (f, "\nif (i%lu != %d - 1) printf(\",\");\n",
- tmpcnt, type->size);
-
- fprintf (f, "}\n");
- }
- fprintf (f, "}\n");
-}
-
-/*
- * free TARRAY
- */
-
-static void
-free_array (char *where, char *name, Type *type, FILE *f)
-{
- if (type->subtype->type == YDR_TOPAQUE) {
- ; /* nothing */
- } else {
- char tmp[256];
-
- fprintf (f, "{\nint i%lu;\nfor(i%lu = 0; i%lu < %u;"
- "++i%lu){\n", tmpcnt, tmpcnt, tmpcnt, type->size,tmpcnt);
- snprintf(tmp, sizeof(tmp)-1, "%s[i%lu]", name, tmpcnt);
- tmpcnt++;
- if (type->flags)
- type->subtype->flags |= type->flags;
- free_type (tmp, "", type->subtype, f);
- tmpcnt--;
- fprintf (f, "}\n}\n");
- }
-}
-
-/*
- * encode/decode TVARRAY
- */
-
-static void
-encode_varray (char *name, Type *type, FILE *f, EncodeType encodetype,
- Side side)
-{
- char tmp[256];
- Type lentype = {YDR_TULONG};
- Type *indextype;
-
- strlcpy (tmp, name, sizeof tmp);
- strlcat (tmp, ".len", sizeof tmp);
-
- indextype = type->indextype ? type->indextype : &lentype;
-
- encode_type (tmp, indextype, f, encodetype, side);
- if (encodetype == DECODE_MEM || encodetype == DECODE_RX) {
- if (type->size != 0)
- fprintf (f, "if (%s > %d) goto fail;\n", tmp, type->size);
- if (encodetype == DECODE_MEM) {
- fprintf (f, "if ((%s * sizeof(", tmp);
- print_type ("", type->subtype, TIN, VDECL, f);
- fprintf (f, ")) > *total_len) goto fail;\n");
- }
- }
- gen_check_overflow(indextype, type->subtype, tmp, f);
- if (encodetype == DECODE_MEM || encodetype == DECODE_RX) {
- fprintf (f, "%s.val = (", name);
- print_type ("*", type->subtype, TIN, VDECL, f);
- fprintf (f, ")malloc(sizeof(");
- print_type ("", type->subtype, TIN, VDECL, f);
- fprintf (f, ") * %s);\n", tmp);
- fprintf (f, "if (%s.val == NULL) goto fail;\n", name);
- }
- if (type->subtype->type == YDR_TOPAQUE) {
- switch (encodetype) {
- case ENCODE_RX :
- fprintf (f, "{\n"
- "char zero[4] = {0, 0, 0, 0};\n"
- "unsigned padlen = (4 - (%s %% 4)) %% 4;\n"
- "if(rx_Write (call, %s.val, %s) != %s)\n"
- "goto fail;\n"
- "if(rx_Write (call, zero, padlen) != padlen)\n"
- "goto fail;\n"
- "}\n",
- tmp, name, tmp, tmp);
- break;
- case DECODE_RX :
- fprintf (f, "{\n"
- "char zero[4] = {0, 0, 0, 0};\n"
- "unsigned padlen = (4 - (%s %% 4)) %% 4;\n"
- "if(rx_Read (call, %s.val, %s) != %s)\n"
- "goto fail;\n"
- "if(rx_Read (call, zero, padlen) != padlen)\n"
- "goto fail;\n"
- "}\n",
- tmp, name, tmp, tmp);
- break;
- case ENCODE_MEM :
- fprintf (f, "{\n"
- "char zero[4] = {0, 0, 0, 0};\n"
- "size_t sz = %s + (4 - (%s %% 4)) %% 4;\n"
- "if (*total_len < sz) goto fail;\n"
- "memcpy (ptr, %s.val, %s);\n"
- "memcpy (ptr + %s, zero, (4 - (%s %% 4)) %% 4);\n"
- "ptr += sz; *total_len -= sz;\n"
- "}\n",
- tmp, tmp, name, tmp, tmp, tmp);
- break;
- case DECODE_MEM :
- fprintf (f,
- "{\n"
- "memcpy (%s.val, ptr, %s);\n"
- "ptr += %s + (4 - (%s %% 4)) %% 4;\n"
- "}\n",
- name, tmp, tmp, tmp);
- break;
- default :
- abort ();
- }
- } else {
- fprintf (f, "{\nint i%lu;\nfor(i%lu = 0; i%lu < %s;"
- "++i%lu){\n", tmpcnt, tmpcnt, tmpcnt, tmp, tmpcnt);
- snprintf(tmp, sizeof(tmp)-1, "%s.val[i%lu]", name, tmpcnt);
- tmpcnt++;
- if (type->flags)
- type->subtype->flags |= type->flags;
- encode_type (tmp , type->subtype, f, encodetype, side);
- tmpcnt--;
- fprintf (f, "}\n}\n");
- }
-}
-
-/*
- * print TVARRAY
- */
-
-static void
-print_varray (char *where, char *name, Type *type, FILE *f)
-{
- fprintf (f, "{\nunsigned int i%lu;\n", tmpcnt);
-
- fprintf (f, "/* printing YDR_TVARRAY %s%s */\n", where, name);
-
- if (type->subtype->type == YDR_TOPAQUE) {
- fprintf (f, "char *ptr = %s%s.val;\n", where, name);
- fprintf (f, "printf(\"0x\");");
- fprintf (f, "for (i%lu = 0; i%lu < %s%s.len; ++i%lu)\n"
- "printf(\"%%x\", ptr[i%lu]);",
- tmpcnt, tmpcnt,
- where, name, tmpcnt, tmpcnt);
- } else {
- char *ptr;
- fprintf (f, "for (i%lu = 0; i%lu < %s%s.len; ++i%lu) {\n",
- tmpcnt, tmpcnt, where, name, tmpcnt);
- asprintf(&ptr, "%s%s.val[i%ld]", where, name, tmpcnt);
- tmpcnt++;
- display_type (ptr, "", type->subtype, f);
- tmpcnt--;
- free(ptr);
- fprintf (f, "\nif (i%lu != %s%s.len - 1) printf(\",\");\n",
- tmpcnt, where, name);
-
- fprintf (f, "}\n");
- }
- fprintf (f, "}\n");
-}
-
-/*
- * free TVARRAY
- */
-
-static void
-free_varray (char *where, char *name, Type *type, FILE *f)
-{
- if (type->subtype->type != YDR_TOPAQUE) {
- char *ptr;
- fprintf (f, "{\n"
- "unsigned int i%lu;\n", tmpcnt);
- fprintf (f, "for (i%lu = 0; i%lu < %s%s.len; ++i%lu) {\n",
- tmpcnt, tmpcnt, where, name, tmpcnt);
- asprintf(&ptr, "%s%s.val[i%ld]", where, name, tmpcnt);
- tmpcnt++;
- free_type (ptr, "", type->subtype, f);
- tmpcnt--;
- free(ptr);
- fprintf (f, "}\n");
- fprintf (f, "}\n");
- }
- fprintf (f, "free((%s%s).val);\n", where, name);
-}
-
-/*
- * encode/decode pointer
- */
-
-static void
-encode_pointer (char *name, Type *type, FILE *f, EncodeType encodetype,
- Side side)
-{
- Type booltype = {YDR_TULONG};
- char tmp[256];
-
- snprintf (tmp, sizeof(tmp), "*(%s)", name);
-
- switch(encodetype) {
- case ENCODE_RX:
- abort ();
- case ENCODE_MEM:
- fprintf(f, "{ unsigned bool;\n"
- "bool = %s != NULL;\n", name);
- encode_type ("bool", &booltype, f, encodetype, side);
- fprintf (f, "if(%s) {\n", name);
- encode_type (tmp, type->subtype, f, encodetype, side);
- fprintf (f, "}\n"
- "}\n");
- break;
- case DECODE_RX:
- exit(-1);
- case DECODE_MEM:
- fprintf(f, "{ unsigned bool;\n");
- encode_type ("bool", &booltype, f, encodetype, side);
- fprintf (f, "if(bool) {\n");
- fprintf (f, "%s = malloc(sizeof(%s));\n"
- "if (%s == NULL) return ENOMEM;\n",
- name, tmp, name);
- encode_type (tmp, type->subtype, f, encodetype, side);
- fprintf (f, "} else {\n"
- "%s = NULL;\n"
- "}\n"
- "}\n", name);
- break;
- default:
- abort ();
- }
-}
-
-/*
- * free pointer
- */
-
-static void
-free_pointer (char *where, char *name, Type *type, FILE *f)
-{
- char *tmp;
-
- asprintf (&tmp, "*(%s%s)", where, name);
- fprintf (f, "if(%s%s)", where, name);
- free_type(tmp, "", type->subtype, f);
- free(tmp);
-}
-
-/*
- * encode type
- */
-
-static void
-encode_type (char *name, Type *type, FILE *f, EncodeType encodetype,
- Side side)
-{
- switch (type->type) {
- case YDR_TCHAR :
- case YDR_TUCHAR :
- case YDR_TSHORT :
- case YDR_TUSHORT :
- case YDR_TLONG :
- case YDR_TULONG :
- encode_long (name, type, f, encodetype);
- break;
- case YDR_TLONGLONG :
- case YDR_TULONGLONG :
- encode_longlong (name, type, f, encodetype);
- break;
- case YDR_TSTRING :
- encode_string (name, type, f, encodetype, side);
- break;
- case YDR_TOPAQUE :
- error_message (1,
- "Type opaque only allowed as part of an array");
- break;
- case YDR_TUSERDEF :
- encode_symbol (type->symbol, name, f, encodetype, side);
- break;
- case YDR_TARRAY :
- encode_array (name, type, f, encodetype, side);
- break;
- case YDR_TVARRAY :
- encode_varray (name, type, f, encodetype, side);
- break;
- case YDR_TPOINTER :
- encode_pointer (name, type, f, encodetype, side);
- break;
- default :
- exit(-1);
- }
-}
-
-/*
- * print type
- */
-
-static void
-display_type (char *where, char *name, Type *type, FILE *f)
-{
- assert (where);
-
- switch (type->type) {
- case YDR_TCHAR :
- case YDR_TUCHAR :
- case YDR_TSHORT :
- case YDR_TUSHORT :
- case YDR_TLONG :
- case YDR_TULONG :
- print_long (where, name, type, f);
- break;
- case YDR_TLONGLONG :
- case YDR_TULONGLONG :
- print_longlong (where, name, type, f);
- break;
- case YDR_TSTRING :
- print_string (where, name, type, f);
- break;
- case YDR_TOPAQUE :
- fprintf (f, "printf(\"printing TOPAQUE\\n\");");
- break;
- case YDR_TUSERDEF :
- print_symbol (where, type->symbol, name, f);
- break;
- case YDR_TARRAY :
- print_array (where, name, type, f);
- break;
- case YDR_TVARRAY :
- print_varray (where, name, type, f);
- break;
- case YDR_TPOINTER :
- fprintf (f, "printf(\"printing TPOINTER\\n\");");
- break;
- default :
- exit(-1);
- }
-}
-
-/*
- * free type
- */
-
-static void
-free_type (char *where, char *name, Type *type, FILE *f)
-{
- switch (type->type) {
- case YDR_TCHAR :
- case YDR_TUCHAR :
- case YDR_TSHORT :
- case YDR_TUSHORT :
- case YDR_TLONG :
- case YDR_TULONG :
- case YDR_TLONGLONG :
- case YDR_TULONGLONG :
- break;
- case YDR_TSTRING :
-#if 0
- free_string (where, name, type, f);
-#endif
- break;
- case YDR_TOPAQUE :
- break;
- case YDR_TUSERDEF :
- free_symbol (where, type->symbol, name, f);
- break;
- case YDR_TARRAY :
- free_array (where, name, type, f);
- break;
- case YDR_TVARRAY :
- free_varray (where, name, type, f);
- break;
- case YDR_TPOINTER :
- free_pointer (where, name, type, f);
- break;
- default :
- exit(-1);
- }
-}
-
-struct context {
- char *name;
- FILE *f;
- Symbol *symbol;
- EncodeType encodetype;
- Side side;
-};
-
-/*
- * helpfunction for encode_struct
- */
-
-static Bool
-encode_entry (List *list, Listitem *item, void *arg)
-{
- StructEntry *s = (StructEntry *)listdata (item);
- char tmp[256];
- struct context *context = (struct context *)arg;
-
- strlcpy (tmp, context->name, sizeof tmp);
- strlcat (tmp, ".", sizeof tmp);
- strlcat (tmp, s->name, sizeof tmp);
-
- if (s->type->type == YDR_TPOINTER
- && s->type->subtype->type == YDR_TUSERDEF
- && s->type->subtype->symbol->type == YDR_TSTRUCT
- && strcmp(s->type->subtype->symbol->name,
- context->symbol->name) == 0) {
- fprintf (context->f,
- "ptr = ydr_encode_%s(%s, ptr);\n",
- context->symbol->name,
- tmp);
- } else {
- encode_type (tmp, s->type, context->f, context->encodetype,
- context->side);
- }
-
- return FALSE;
-}
-
-/*
- * encode/decode TSTRUCT
- */
-
-static void
-encode_struct (Symbol *s, char *name, FILE *f, EncodeType encodetype,
- Side side)
-{
- struct context context;
-
- context.name = name;
- context.symbol = s;
- context.f = f;
- context.encodetype = encodetype;
- context.side = side;
-
- if (s->u.list)
- listiter (s->u.list, encode_entry, (void *)&context);
-}
-
-/*
- * help function for print_struct
- */
-
-struct printcontext {
- char *where;
- char *name;
- FILE *f;
- Symbol *symbol;
-};
-
-static Bool
-print_structentry (List *list, Listitem *item, void *arg)
-{
- StructEntry *s = (StructEntry *)listdata (item);
- struct printcontext *context = (struct printcontext *)arg;
-
- char *tmp;
- char *tmp2;
-
- asprintf(&tmp, ".%s", s->name);
- asprintf(&tmp2, "%s%s", context->where, context->name);
-
- if (s->type->type == YDR_TPOINTER
- && s->type->subtype->type == YDR_TUSERDEF
- && s->type->subtype->symbol->type == YDR_TSTRUCT
- && strcmp(s->type->subtype->symbol->name,
- context->symbol->name) == 0) {
- fprintf (context->f,
- "ydr_print_%s%s(%s%s, ptr);\n",
- package,
- context->symbol->name,
- tmp2,
- tmp);
- } else {
- display_type (tmp2, tmp, s->type, context->f);
- }
-
- free(tmp);
- free(tmp2);
-
- fprintf (context->f, "\n");
-
- return FALSE;
-}
-
-/*
- * print TSTRUCT
- */
-
-static void
-print_struct (char *where, Symbol *s, char *name, FILE *f)
-{
- struct printcontext context;
-
- context.name = name;
- context.symbol = s;
- context.f = f;
- context.where = where ;
-
- fprintf (f, "/* printing TSTRUCT %s%s */\n", where, name);
-
- if (s->u.list)
- listiter (s->u.list, print_structentry, (void *)&context);
-}
-
-/*
- * help function for free_struct
- */
-
-struct freecontext {
- char *where;
- char *name;
- FILE *f;
- Symbol *symbol;
-};
-
-static Bool
-free_structentry (List *list, Listitem *item, void *arg)
-{
- StructEntry *s = (StructEntry *)listdata (item);
- struct freecontext *context = (struct freecontext *)arg;
-
- char *tmp;
- char *tmp2;
-
- asprintf(&tmp, ".%s", s->name);
- asprintf(&tmp2, "%s%s", context->where, context->name);
-
- if (s->type->type == YDR_TPOINTER
- && s->type->subtype->type == YDR_TUSERDEF
- && s->type->subtype->symbol->type == YDR_TSTRUCT
- && strcmp(s->type->subtype->symbol->name,
- context->symbol->name) == 0) {
- fprintf (context->f,
- "ydr_free_%s%s(%s%s, ptr);\n",
- package,
- context->symbol->name,
- tmp2,
- tmp);
- } else {
- free_type (tmp2, tmp, s->type, context->f);
- }
-
- free(tmp);
- free(tmp2);
-
- return FALSE;
-}
-
-/*
- * free TSTRUCT
- */
-
-static void
-free_struct (char *where, Symbol *s, char *name, FILE *f)
-{
- struct freecontext context;
-
- context.name = name;
- context.symbol = s;
- context.f = f;
- context.where = where;
-
- if (s->u.list)
- listiter (s->u.list, free_structentry, (void *)&context);
-}
-
-/*
- * encode/decode TENUM
- */
-
-static void
-encode_enum (Symbol *s, char *name, FILE *f, EncodeType encodetype,
- Side side)
-{
- Type type = {YDR_TLONG};
-
- encode_type (name, &type, f, encodetype, side);
-}
-
-/*
- * print TENUM
- */
-
-static Bool
-gen_printenum (List *list, Listitem *item, void *arg)
-{
- Symbol *s = (Symbol *)listdata (item);
- FILE *f = (FILE *)arg;
-
- fprintf (f, "case %d:\n"
- "printf(\"%s\");\n"
- "break;\n",
- (int) s->u.val, s->name);
-
- return FALSE;
-}
-
-static void
-print_enum (char *where, Symbol *s, char *name, FILE *f)
-{
- fprintf (f, "/* print ENUM %s */\n", where);
-
- fprintf (f, "printf(\"%s = \");", name);
- fprintf (f, "switch(%s) {\n", where);
- if (s->u.list)
- listiter (s->u.list, gen_printenum, f);
- fprintf (f,
- "default:\n"
- "printf(\" unknown enum %%d\", %s);\n"
- "}\n",
- where);
-}
-
-/*
- * encode/decode TTYPEDEF
- */
-
-static void
-encode_typedef (Symbol *s, char *name, FILE *f, EncodeType encodetype,
- Side side)
-{
- encode_type (name, s->u.type, f, encodetype, side);
-}
-
-/*
- * print TTYPEDEF
- */
-
-static void
-print_typedef (char *where, Symbol *s, char *name, FILE *f)
-{
- display_type (where, name, s->u.type, f);
-}
-
-/*
- * free TTYPEDEF
- */
-
-static void
-free_typedef (char *where, Symbol *s, char *name, FILE *f)
-{
- free_type (where, name, s->u.type, f);
-}
-
-/*
- * Encode symbol/TUSERDEF
- */
-
-static void
-encode_symbol (Symbol *s, char *name, FILE *f, EncodeType encodetype,
- Side side)
-{
- switch (s->type) {
- case YDR_TSTRUCT :
- encode_struct (s, name, f, encodetype, side);
- break;
- case YDR_TENUM :
- encode_enum (s, name, f, encodetype, side);
- break;
- case YDR_TTYPEDEF :
- encode_typedef (s, name, f, encodetype, side);
- break;
- default :
- exit(-1);
- }
-}
-
-/*
- * print symbol/TUSERDEF
- */
-
-static void
-print_symbol (char *where, Symbol *s, char *name, FILE *f)
-{
- switch (s->type) {
- case YDR_TSTRUCT :
- print_struct (where, s, name, f);
- break;
- case YDR_TENUM :
- print_enum (where, s, name, f);
- break;
- case YDR_TTYPEDEF :
- print_typedef (where, s, name, f);
- break;
- default :
- exit(-1);
- }
-}
-
-/*
- * Generate a free function for symbol
- */
-
-static void
-free_symbol (char *where, Symbol *s, char *name, FILE *f)
-{
- switch (s->type) {
- case YDR_TSTRUCT :
- free_struct (where, s, name, f);
- break;
- case YDR_TENUM :
- break;
- case YDR_TTYPEDEF :
- free_typedef (where, s, name, f);
- break;
- default :
- exit(-1);
- }
-}
-
-/*
- * Generate the definition of an encode/decode function.
- */
-
-static void
-generate_function_definition (Symbol *s, FILE *f, Bool encodep)
-{
- if (s->type == YDR_TSTRUCT
- || s->type == YDR_TENUM
- || s->type == YDR_TTYPEDEF)
- {
- fprintf (f,
- "%schar *ydr_%scode_%s(%s%s *o, %schar *ptr, size_t *total_len)",
- encodep ? "" : "const ",
- encodep ? "en" : "de",
- s->name,
- encodep ? "const " : "",
- s->name,
- encodep ? "" : "const ");
- } else if (s->type == YDR_TCONST
- || s->type == YDR_TENUMVAL
- || s->type == YDR_TTYPEDEF)
- ;
- else
- error_message (1, "What is %s (type %d) doing here?\n",
- s->name, s->type);
-}
-
-/*
- * Generate the definition of a print function.
- */
-
-static void
-generate_printfunction_definition (Symbol *s, FILE *f)
-{
- if (s->type == YDR_TSTRUCT
- || s->type == YDR_TENUM
- || s->type == YDR_TTYPEDEF)
- {
- fprintf (f,
- "void ydr_print_%s(%s *o)",
- s->name, s->name);
- } else if (s->type == YDR_TCONST
- || s->type == YDR_TENUMVAL
- || s->type == YDR_TTYPEDEF)
- ;
- else
- error_message (1, "What is %s (type %d) doing here?\n",
- s->name, s->type);
-}
-
-/*
- * Generate a defintion for a function to free `s', writing it to `f'
- */
-
-static void
-generate_freefunction_definition (Symbol *s, FILE *f)
-{
- if (s->type == YDR_TSTRUCT
- || s->type == YDR_TENUM
- || s->type == YDR_TTYPEDEF)
- {
- fprintf (f,
- "void ydr_free_%s(%s *o)",
- s->name, s->name);
- } else if (s->type == YDR_TCONST
- || s->type == YDR_TENUMVAL
- || s->type == YDR_TTYPEDEF)
- ;
- else
- error_message (1, "What is %s (type %d) doing here?\n",
- s->name, s->type);
-}
-
-/*
- * Generate an encode/decode function
- */
-
-void
-generate_function (Symbol *s, FILE *f, Bool encodep)
-{
- if (s->type == YDR_TSTRUCT
- || s->type == YDR_TENUM
- || s->type == YDR_TTYPEDEF)
- {
- generate_function_definition (s, f, encodep);
- fprintf (f, "\n{\n");
- if (!encodep)
- fprintf (f, "memset(o, 0, sizeof(*o));\n");
- encode_symbol (s, "(*o)", f,
- encodep ? ENCODE_MEM : DECODE_MEM, CLIENT);
- fprintf (f, "return ptr;\n"
- "fail:\n");
- if (!encodep)
- free_symbol ("", s, "(*o)", f);
- fprintf (f, "errno = EINVAL;\n"
- "return NULL;}\n");
- } else if (s->type == YDR_TCONST
- || s->type == YDR_TENUMVAL
- || s->type == YDR_TTYPEDEF)
- ;
- else
- error_message (1, "What is %s (type %d) doing here?\n",
- s->name, s->type);
-}
-
-/*
- * Generate a print function
- */
-
-void
-generate_printfunction (Symbol *s, FILE *f)
-{
- if (s->type == YDR_TSTRUCT
- || s->type == YDR_TENUM
- || s->type == YDR_TTYPEDEF) {
- generate_printfunction_definition (s, f);
- fprintf (f, "\n{\n");
- print_symbol ("(*o)", s, "", f);
- fprintf (f, "return;\n}\n");
- } else if (s->type == YDR_TCONST
- || s->type == YDR_TENUMVAL
- || s->type == YDR_TTYPEDEF)
- ;
- else
- error_message (1, "What is %s (type %d) doing here?\n",
- s->name, s->type);
-}
-
-/*
- * Generate a free function for the type `s' and print it on `f'.
- */
-
-void
-generate_freefunction (Symbol *s, FILE *f)
-{
- if (s->type == YDR_TSTRUCT
- || s->type == YDR_TENUM
- || s->type == YDR_TTYPEDEF) {
- generate_freefunction_definition (s, f);
- fprintf (f, "\n{\n");
- free_symbol("(*o)", s, "", f);
- fprintf (f, "return;\n}\n");
- } else if (s->type == YDR_TCONST
- || s->type == YDR_TENUMVAL
- || s->type == YDR_TTYPEDEF)
- ;
- else
- error_message (1, "What is %s (type %d) doing here?\n",
- s->name, s->type);
-}
-
-/*
- * Generate an prototype for an encode/decode function
- */
-
-void
-generate_function_prototype (Symbol *s, FILE *f, Bool encodep)
-{
- if (s->type == YDR_TSTRUCT
- || s->type == YDR_TENUM
- || s->type == YDR_TTYPEDEF)
- {
- generate_function_definition (s, f, encodep);
- fprintf (f, ";\n");
- } else if (s->type == YDR_TCONST
- || s->type == YDR_TENUMVAL
- || s->type == YDR_TTYPEDEF)
- ;
- else
- error_message (1, "What is %s (type %d) doing here?\n",
- s->name, s->type);
-}
-
-/*
- * Generate an prototype for a print function
- */
-
-void
-generate_printfunction_prototype (Symbol *s, FILE *f)
-{
- if (s->type == YDR_TSTRUCT
- || s->type == YDR_TENUM
- || s->type == YDR_TTYPEDEF) {
- generate_printfunction_definition (s, f);
- fprintf (f, ";\n");
- } else if (s->type == YDR_TCONST
- || s->type == YDR_TENUMVAL
- || s->type == YDR_TTYPEDEF)
- ;
- else
- error_message (1, "What is %s (type %d) doing here?\n",
- s->name, s->type);
-}
-
-/*
- * Generate a prototype for a free function for the `s' type
- * and output it to `f'
- */
-
-void
-generate_freefunction_prototype(Symbol *s, FILE *f)
-{
- if (s->type == YDR_TSTRUCT
- || s->type == YDR_TENUM
- || s->type == YDR_TTYPEDEF) {
- generate_freefunction_definition (s, f);
- fprintf (f, ";\n");
- } else if (s->type == YDR_TCONST
- || s->type == YDR_TENUMVAL
- || s->type == YDR_TTYPEDEF)
- ;
- else
- error_message (1, "What is %s (type %d) doing here?\n",
- s->name, s->type);
-}
-
-static Bool
-gen1 (List *list, Listitem *item, void *arg)
-{
- Argument *a = (Argument *)listdata (item);
- FILE *f = (FILE *)arg;
-
- if ((a->argtype == TOUT || a->argtype == TINOUT)
- && a->type->type != YDR_TPOINTER
- && a->type->type != YDR_TSTRING)
- error_message (1, "Argument %s is OUT and not pointer or string.\n",
- a->name);
- fprintf (f, ", ");
- if (a->argtype == TIN)
- fprintf (f, "const ");
- print_type (a->name, a->type, a->argtype, FDECL, f);
- fprintf (f, "\n");
- return FALSE;
-}
-
-static Bool
-genin (List *list, Listitem *item, void *arg)
-{
- Argument *a = (Argument *)listdata (item);
- FILE *f = (FILE *)arg;
-
- if (a->argtype == TIN || a->argtype == TINOUT) {
- fprintf (f, ", %s ", a->argtype == TIN ? "const" : "");
- print_type (a->name, a->type, a->argtype, FDECL, f);
- fprintf (f, "\n");
- }
- return FALSE;
-}
-
-static Bool
-genout (List *list, Listitem *item, void *arg)
-{
- Argument *a = (Argument *)listdata (item);
-
- if (a->argtype == TOUT || a->argtype == TINOUT)
- return gen1 (list, item, arg);
- else
- return FALSE;
-}
-
-static Bool
-gendeclare (List *list, Listitem *item, void *arg)
-{
- Argument *a = (Argument *)listdata (item);
- FILE *f = (FILE *)arg;
-
- if (a->type->type == YDR_TPOINTER)
- print_type (a->name, a->type->subtype, TIN, VDECL, f);
- else
- print_type (a->name, a->type, TIN, VDECL, f);
- fprintf (f, ";\n");
- return FALSE;
-}
-
-static Bool
-genzero (List *list, Listitem *item, void *arg)
-{
- Argument *a = (Argument *)listdata (item);
- FILE *f = (FILE *)arg;
-
- fprintf (f, "memset(&%s, 0, sizeof(%s));\n",
- a->name, a->name);
- return FALSE;
-}
-
-static Bool
-genfree_isarrayp(Type *type)
-{
- if (type->type == YDR_TVARRAY)
- return TRUE;
- if (type->type == YDR_TPOINTER)
- return genfree_isarrayp(type->subtype);
- if (type->type == YDR_TUSERDEF &&
- type->symbol &&
- type->symbol->type == YDR_TTYPEDEF)
- return genfree_isarrayp(type->symbol->u.type);
-
- return FALSE;
-}
-
-
-static Bool
-genfree (List *list, Listitem *item, void *arg)
-{
- Argument *a = (Argument *)listdata (item);
- FILE *f = (FILE *)arg;
-
- if (genfree_isarrayp(a->type))
- fprintf(f, "free(%s.val);\n", a->name);
- else if (a->argtype != TIN
- && a->type->type == YDR_TSTRING && a->type->size == 0)
- fprintf (f, "free(%s);\n", a->name);
- return FALSE;
-}
-
-static Bool
-genencodein (List *list, Listitem *item, void *arg)
-{
- Argument *a = (Argument *)listdata (item);
- FILE *f = (FILE *)arg;
-
- if (a->argtype == TIN || a->argtype == TINOUT) {
- if (a->type->type == YDR_TPOINTER) {
- size_t len = strlen (a->name) + 4;
- char *tmp = (char *)emalloc (len);
-
- snprintf (tmp, len, "(*%s)", a->name);
-
- encode_type (tmp, a->type->subtype, f, ENCODE_RX, CLIENT);
- free (tmp);
- } else
- encode_type (a->name, a->type, f, ENCODE_RX, CLIENT);
- }
- return FALSE;
-}
-
-static Bool
-gendecodeout (List *list, Listitem *item, void *arg)
-{
- Argument *a = (Argument *)listdata (item);
- FILE *f = (FILE *)arg;
-
- if (a->argtype == TOUT || a->argtype == TINOUT) {
- if (a->type->type == YDR_TPOINTER) {
- size_t len = strlen(a->name) + 4;
- char *tmp = (char *)emalloc (len);
-
- snprintf (tmp, len, "(*%s)", a->name);
-
- encode_type (tmp, a->type->subtype, f, DECODE_RX, CLIENT);
- free (tmp);
- } else if(a->type->type == YDR_TSTRING) {
- encode_type (a->name, a->type, f, DECODE_RX, CLIENT);
- }
- }
- return FALSE;
-}
-
-static Bool
-gendecodein (List *list, Listitem *item, void *arg)
-{
- Argument *a = (Argument *)listdata (item);
- FILE *f = (FILE *)arg;
-
- if (a->argtype != TIN && a->argtype != TINOUT)
- return TRUE;
- else {
- if (a->type->type == YDR_TPOINTER) {
-#if 0
- size_t len = strlen(a->name) + 4;
- char *tmp = (char *)emalloc (len);
-
- snprintf (tmp, len, "(*%s)", a->name);
-
- encode_type (tmp, a->type->subtype, f, DECODE_RX, SERVER);
- free (tmp);
-#endif
- encode_type (a->name, a->type->subtype, f, DECODE_RX, SERVER);
- } else
- encode_type (a->name, a->type, f, DECODE_RX, SERVER);
- return FALSE;
- }
-}
-
-static Bool
-genencodeout (List *list, Listitem *item, void *arg)
-{
- Argument *a = (Argument *)listdata (item);
- FILE *f = (FILE *)arg;
-
- if (a->argtype == TOUT || a->argtype == TINOUT) {
- if (a->type->type == YDR_TPOINTER)
- encode_type (a->name, a->type->subtype, f, ENCODE_RX, SERVER);
- else
- encode_type (a->name, a->type, f, ENCODE_RX, SERVER);
- }
- return FALSE;
-}
-
-static Bool
-findargtypeiter (List *list, Listitem *item, void *arg)
-{
- Argument *a = (Argument *)listdata (item);
- int *type = (int *)arg;
-
- if (a->argtype == *type) {
- (*type)++;
- return TRUE;
- }
- return FALSE;
-}
-
-static Bool
-findargtype(List *list, int type)
-{
- int savedtype = type;
- listiter(list, findargtypeiter, &type);
- if (type != savedtype)
- return TRUE;
- return FALSE;
-}
-
-static Bool
-genargs (List *list, Listitem *item, void *arg)
-{
- Argument *a = (Argument *)listdata (item);
- FILE *f = (FILE *)arg;
-
- if (a->type->type == YDR_TPOINTER
- || (a->argtype != TIN
- && a->type->type == YDR_TSTRING && a->type->size == 0))
- putc ('&', f);
- fputs (a->name, f);
- if (listnext (list, item))
- fprintf (f, ", ");
- return FALSE;
-}
-
-/*
- * Generate the stub functions for this RPC call
- */
-
-static void
-generate_simple_stub (Symbol *s, FILE *f, FILE *headerf)
-{
- Type type = {YDR_TLONG};
- char *op;
-
- fprintf (headerf, "int %s%s(\nstruct rx_connection *connection\n",
- package, s->name);
- listiter (s->u.proc.arguments, gen1, headerf);
- fprintf (headerf, ");\n\n");
-
- fprintf (f, "int %s%s(\nstruct rx_connection *connection\n",
- package, s->name);
- listiter (s->u.proc.arguments, gen1, f);
- fprintf (f, ")\n{\n"
- "struct rx_call *call;\n"
- "int ret = 0;\n"
- "call = rx_NewCall (connection);\n");
-
- asprintf (&op, "%u", s->u.proc.id);
-
- encode_type (op, &type, f, ENCODE_RX, CLIENT);
- free (op);
- listiter (s->u.proc.arguments, genencodein, f);
- listiter (s->u.proc.arguments, gendecodeout, f);
- fprintf (f,
- "return %s(rx_EndCall (call,0));\n"
- "fail:\n"
- "ret = %s(rx_GetCallError(call));\n"
- "rx_EndCall (call, 0);\n"
- "return ret;\n"
- "}\n",
- error_function,
- error_function);
-}
-
-static void
-generate_split_stub (Symbol *s, FILE *f, FILE *headerf)
-{
- Type type = {YDR_TLONG};
- char *op;
-
- fprintf (headerf, "int Start%s%s(\nstruct rx_call *call\n",
- package, s->name);
- listiter (s->u.proc.arguments, genin, headerf);
- fprintf (headerf, ");\n\n");
-
- fprintf (f, "int Start%s%s(\nstruct rx_call *call\n",
- package, s->name);
- listiter (s->u.proc.arguments, genin, f);
- fprintf (f, ")\n{\n");
-
-
- asprintf (&op, "%u", s->u.proc.id);
- encode_type (op, &type, f, ENCODE_RX, CLIENT);
- free (op);
- listiter (s->u.proc.arguments, genencodein, f);
- fprintf (f, "return 0;\n");
- /* XXX only in arg */
- if (findargtype(s->u.proc.arguments, TIN) ||
- findargtype(s->u.proc.arguments, TINOUT))
- fprintf (f, "fail:\n"
- "return %s(rx_GetCallError(call));\n",
- error_function);
-
- fprintf (f, "}\n\n");
-
- fprintf (headerf, "int End%s%s(\nstruct rx_call *call\n",
- package, s->name);
- listiter (s->u.proc.arguments, genout, headerf);
- fprintf (headerf, ");\n\n");
-
- fprintf (f, "int End%s%s(\nstruct rx_call *call\n",
- package, s->name);
- listiter (s->u.proc.arguments, genout, f);
- fprintf (f, ")\n{\n");
-
- listiter (s->u.proc.arguments, gendecodeout, f);
- fprintf (f, "return 0;\n");
- /* XXX only out arg */
- if (findargtype(s->u.proc.arguments, TOUT) ||
- findargtype(s->u.proc.arguments, TINOUT))
- fprintf (f, "fail:\n"
- "return %s(rx_GetCallError(call));\n",
- error_function);
-
- fprintf (f, "}\n\n");
-}
-
-struct gen_args {
- FILE *f;
- int firstp;
- int arg_type;
-};
-
-static Bool
-genmacro (List *list, Listitem *item, void *arg)
-{
- Argument *a = (Argument *)listdata (item);
- struct gen_args *args = (struct gen_args *)arg;
-
- if (a->argtype == args->arg_type || a->argtype == TINOUT) {
- fprintf (args->f, "%s%s",
- args->firstp ? "" : ", ", a->name);
- args->firstp = 0;
- }
-
- return FALSE;
-}
-
-static void
-generate_multi (Symbol *s, FILE *f)
-{
- struct gen_args gen_args;
-
- fprintf (f, "\n#include <rx/rx_multi.h>");
- fprintf (f, "\n#define multi_%s%s(", package, s->name);
- gen_args.f = f;
- gen_args.firstp = 1;
- gen_args.arg_type = TIN;
- listiter (s->u.proc.arguments, genmacro, &gen_args);
- fprintf (f, ") multi_Body(");
- fprintf (f, "Start%s%s(multi_call", package, s->name);
- gen_args.f = f;
- gen_args.firstp = 0;
- gen_args.arg_type = TIN;
- listiter (s->u.proc.arguments, genmacro, &gen_args);
- fprintf (f, "), End%s%s(multi_call", package, s->name);
- gen_args.f = f;
- gen_args.firstp = 0;
- gen_args.arg_type = TOUT;
- listiter (s->u.proc.arguments, genmacro, f);
- fprintf (f, "))\n");
-}
-
-void
-generate_client_stub (Symbol *s, FILE *f, FILE *headerf)
-{
- if (s->u.proc.flags & TSPLIT)
- generate_split_stub (s, f, headerf);
- if (s->u.proc.flags & TSIMPLE)
- generate_simple_stub (s, f, headerf);
-}
-
-/*
- * A list of all the functions that are to be recognized by the
- * server, later used in generate_server_switch.
- */
-
-static List *func_list;
-
-static void
-generate_standard_c_prologue (FILE *f,
- const char *filename,
- const char *basename)
-{
- fprintf (f, "/* Generated from %s.xg */\n", basename);
- fprintf (f, "#include \"%s.h\"\n\n", basename);
- fprintf (f, "#include <stdio.h>\n");
- fprintf (f, "#include <stdlib.h>\n");
- fprintf (f, "#include <string.h>\n");
- fprintf (f, "#include <netinet/in.h>\n");
- fprintf (f, "#include <errno.h>\n");
- fprintf (f, "#ifdef RCSID\n"
- "RCSID(\"%s generated from %s.xg with $arla: output.c,v 1.91 2003/04/16 09:07:03 lha Exp $\");\n"
- "#endif\n\n", filename, basename);
-}
-
-/*
- * Convert filename into a cpp symbol
- */
-
-static char *
-cppfilesymbolname(const char *fn)
-{
- char *symname, *tmp;
-
- symname = estrdup(fn);
- estrdup (symname);
- for (tmp = symname; *tmp; tmp++) {
- if (tmp == symname && isdigit((unsigned char)*tmp))
- *tmp = '_';
- if (!isalpha((unsigned char)*tmp))
- *tmp = '_';
- }
- return symname;
-}
-
-/*
- * open all files
- */
-
-void
-init_generate (const char *filename)
-{
- char *tmp;
- char *fileupr;
-
- func_list = listnew ();
-
- asprintf (&tmp, "%s.h", filename);
- if (tmp == NULL)
- err (1, "malloc");
- ydr_fopen (tmp, "w", &headerfile);
- free (tmp);
-
- fileupr = cppfilesymbolname(filename);
- fprintf (headerfile.stream, "/* Generated from %s.xg */\n", filename);
- fprintf (headerfile.stream, "#ifndef _%s_\n"
- "#define _%s_\n\n", fileupr, fileupr);
- fprintf (headerfile.stream, "#include <atypes.h>\n\n");
- free (fileupr);
-
- asprintf (&tmp, "%s.ydr.c", filename);
- if (tmp == NULL)
- err (1, "malloc");
- ydr_fopen (tmp, "w", &ydrfile);
- generate_standard_c_prologue (ydrfile.stream, tmp, filename);
- free (tmp);
-
- asprintf (&tmp, "%s.cs.c", filename);
- if (tmp == NULL)
- err (1, "malloc");
- ydr_fopen (tmp, "w", &clientfile);
- generate_standard_c_prologue (clientfile.stream, tmp, filename);
- fprintf (clientfile.stream, "#include \"%s.cs.h\"\n\n", filename);
- free (tmp);
-
- asprintf (&tmp, "%s.ss.c", filename);
- if (tmp == NULL)
- err (1, "malloc");
- ydr_fopen (tmp, "w", &serverfile);
- generate_standard_c_prologue (serverfile.stream, tmp, filename);
- fprintf (serverfile.stream, "#include \"%s.ss.h\"\n\n", filename);
- free (tmp);
-
- asprintf (&tmp, "%s.cs.h", filename);
- if (tmp == NULL)
- err (1, "malloc");
- ydr_fopen (tmp, "w", &clienthdrfile);
- free (tmp);
- fprintf (clienthdrfile.stream, "/* Generated from %s.xg */\n", filename);
- fprintf (clienthdrfile.stream, "#include <rx/rx.h>\n");
- fprintf (clienthdrfile.stream, "#include \"%s.h\"\n\n", filename);
-
- asprintf (&tmp, "%s.ss.h", filename);
- if (tmp == NULL)
- err (1, "malloc");
- ydr_fopen (tmp, "w", &serverhdrfile);
- free (tmp);
- fprintf (serverhdrfile.stream, "/* Generated from %s.xg */\n", filename);
- fprintf (serverhdrfile.stream, "#include <rx/rx.h>\n");
- fprintf (serverhdrfile.stream, "#include \"%s.h\"\n\n", filename);
-
- packagelist = listnew();
- if (packagelist == NULL)
- err (1, "init_generate: listnew: packagelist");
-}
-
-void
-close_generator (const char *filename)
-{
- char *fileupr;
-
- fileupr = cppfilesymbolname(filename);
- fprintf (headerfile.stream, "\n#endif /* %s */\n", fileupr);
- free(fileupr);
- ydr_fclose (&headerfile);
- ydr_fclose (&clientfile);
- ydr_fclose (&serverfile);
- ydr_fclose (&clienthdrfile);
- ydr_fclose (&serverhdrfile);
- ydr_fclose (&ydrfile);
-}
-
-/*
- * Generate the server-side stub function for the function in s and
- * write it to the file f.
- */
-
-void
-generate_server_stub (Symbol *s, FILE *f, FILE *headerf, FILE *h_file)
-{
- fprintf (headerf, "int S%s%s%s(\nstruct rx_call *call\n",
- prefix, package, s->name);
- listiter (s->u.proc.arguments, gen1, headerf);
- fprintf (headerf, ");\n\n");
-
- fprintf (f, "static int ydr_ps_%s%s(\nstruct rx_call *call)\n",
- package, s->name);
- fprintf (f, "{\n"
- "int32_t _result;\n");
- listiter (s->u.proc.arguments, gendeclare, f);
- listiter (s->u.proc.arguments, genzero, f);
- fprintf (f, "\n");
- listiter (s->u.proc.arguments, gendecodein, f);
- fprintf (f, "_result = S%s%s%s(", prefix, package, s->name);
- if (/* s->u.proc.splitp */ 1) {
- fprintf (f, "call");
- if (!listemptyp (s->u.proc.arguments))
- fprintf (f, ", ");
- }
- listiter (s->u.proc.arguments, genargs, f);
- fprintf (f, ");\n");
- fprintf (f, "if (_result) goto funcfail;\n");
- listiter (s->u.proc.arguments, genencodeout, f);
- listiter (s->u.proc.arguments, genfree, f);
- fprintf (f, "return _result;\n");
- if (!listemptyp(s->u.proc.arguments)) {
- fprintf(f, "fail:\n");
- listiter (s->u.proc.arguments, genfree, f);
- fprintf(f, "return rx_GetCallError(call);\n");
-
- }
- fprintf(f, "funcfail:\n"
- "return _result;\n"
- "}\n\n");
-
- listaddtail (func_list, s);
- if (s->u.proc.flags & TMULTI)
- generate_multi (s, h_file);
-}
-
-struct gencase_context {
- FILE *f;
- char *package;
-};
-
-static Bool
-gencase (List *list, Listitem *item, void *arg)
-{
- Symbol *s = (Symbol *)listdata (item);
- struct gencase_context *c = (struct gencase_context *)arg;
- FILE *f = c->f;
-
- if (c->package == s->u.proc.package) {
- fprintf (f, "case %u: {\n"
- "_result = ydr_ps_%s%s(call);\n"
- "break;\n"
- "}\n",
- s->u.proc.id, s->u.proc.package, s->name);
- }
- return FALSE;
-}
-
-/*
- *
- */
-
-void
-generate_server_switch (FILE *c_file,
- FILE *h_file)
-{
- Type optype = {YDR_TULONG};
- Listitem *li;
- struct gencase_context c;
-
- c.f = c_file;
-
- li = listhead (packagelist);
- while (li) {
- c.package = (char *)listdata (li);
-
- fprintf (h_file,
- "int32_t %sExecuteRequest(struct rx_call *call);\n",
- c.package);
-
- fprintf (c_file,
- "int32_t %sExecuteRequest(struct rx_call *call)\n"
- "{\n"
- "unsigned opcode;\n"
- "int32_t _result;\n",
- c.package);
-
- encode_type ("opcode", &optype, c_file, DECODE_RX, SERVER);
- fprintf (c_file, "switch(opcode) {\n");
-
- listiter (func_list, gencase, &c);
-
- fprintf (c_file, "default:\n"
- "_result = RXGEN_OPCODE;\n"
- "}\n"
- "return _result;\n"
- "fail:\n"
- "return rx_GetCallError(call);\n"
- "}\n\n");
-
- li = listnext (packagelist, li);
- }
-}
-
-/*
- *
- */
-
-void
-ydr_fopen (const char *name, const char *mode, ydr_file *f)
-{
- int streamfd;
-
- asprintf (&f->curname, "%sXXXXXXXXXX", name);
- if (f->curname == NULL)
- err (1, "malloc");
-
- streamfd = mkstemp(f->curname);
- if (streamfd < 0)
- err (1, "mkstemp %s failed", f->curname);
- f->stream = fdopen (streamfd, mode);
- if (f->stream == NULL)
- err (1, "open %s mode %s", f->curname, mode);
- f->newname = estrdup(name);
-}
-
-void
-ydr_fclose (ydr_file *f)
-{
- if (fclose (f->stream))
- err (1, "close %s", f->curname);
- if (rename(f->curname, f->newname))
- err (1, "rename %s, %s", f->curname, f->newname);
- free(f->curname);
- free(f->newname);
-}
diff --git a/usr.sbin/afs/src/ydr/output.h b/usr.sbin/afs/src/ydr/output.h
deleted file mode 100644
index 7b059a2b6ed..00000000000
--- a/usr.sbin/afs/src/ydr/output.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: output.h,v 1.17 2002/11/27 23:51:35 lha Exp $ */
-
-#ifndef _OUTPUT_
-#define _OUTPUT_
-
-#include <stdio.h>
-#include <bool.h>
-#include <roken.h>
-
-typedef struct {
- FILE *stream;
- char *curname;
- char *newname;
-} ydr_file;
-
-void generate_header (Symbol *s, FILE *f);
-void generate_sizeof (Symbol *s, FILE *f);
-void generate_function (Symbol *s, FILE *f, Bool encodep);
-void generate_function_prototype (Symbol *s, FILE *f, Bool encodep);
-void generate_printfunction (Symbol *s, FILE *f);
-void generate_printfunction_prototype (Symbol *s, FILE *f);
-void generate_client_stub (Symbol *s, FILE *f, FILE *headerf);
-void generate_server_stub (Symbol *s, FILE *f, FILE *headerf, FILE *h_file);
-void generate_tcpdump_stub (Symbol *s, FILE *f);
-void generate_server_switch (FILE *c_f, FILE *h_file);
-void generate_freefunction (Symbol *s, FILE *f);
-void generate_freefunction_prototype (Symbol *s, FILE *f);
-void init_generate (const char *filename);
-void close_generator (const char *filename);
-
-extern char *package;
-extern List *packagelist;
-
-extern char *prefix;
-
-extern ydr_file headerfile, clientfile, serverfile, clienthdrfile,
- serverhdrfile, ydrfile;
-
-extern char *error_function;
-
-extern int parse_errors;
-
-void
-ydr_fopen (const char *name, const char *mode, ydr_file *f);
-
-void
-ydr_fclose (ydr_file *f);
-
-
-#endif /* _OUTPUT_ */
diff --git a/usr.sbin/afs/src/ydr/parse.y b/usr.sbin/afs/src/ydr/parse.y
deleted file mode 100644
index 6dae1015fc1..00000000000
--- a/usr.sbin/afs/src/ydr/parse.y
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-%{
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: parse.y,v 1.28 2003/01/20 07:12:58 lha Exp $");
-#endif
-
-#include <stdio.h>
-#include <list.h>
-#include <bool.h>
-#include <roken.h>
-#include "sym.h"
-#include "types.h"
-#include "output.h"
-#include "lex.h"
-
-void yyerror (char *);
-static int varcnt = 0;
-
-%}
-
-%union {
- int constant;
- Symbol *sym;
- List *list;
- char *name;
- Type *type;
- StructEntry *sentry;
- Argument *arg;
- Bool bool;
- unsigned flags;
-}
-
-%token T_ENUM T_STRUCT T_CONST T_UNSIGNED T_ULONG T_INT T_CHAR T_STRING
-%token T_LONG T_TYPEDEF T_OPAQUE T_IN T_OUT T_INOUT T_SPLIT T_MULTI
-%token T_SHORT T_USHORT T_UCHAR T_ASIS T_PROC
-%token T_LONGLONG T_ULONGLONG
-%token <name> T_IDENTIFIER T_VERBATIM T_PACKAGE T_PREFIX T_ERROR_FUNCTION
-%token <constant> T_CONSTANT
-%token <sym> T_IDCONST T_IDTYPE
-
-%type <constant> constant opt_constant opt_proc
-%type <constant> param_type
-%type <sym> enumentry type_decl proc_decl
-%type <list> enumentries enumbody structbody memberdecls params attrs
-%type <type> type
-%type <sentry> memberdecl memberdecl2
-%type <arg> param
-%type <flags> flags
-%type <name> attr
-
-%start specification
-
-%%
-
-specification:
- | specification declaration
- | specification directive
- | error ';'
- ;
-
-declaration: type_decl {
- if (!sym_find_attr($1, "__nogenerate__")) {
- generate_header ($1, headerfile.stream);
- generate_sizeof ($1, headerfile.stream);
- generate_function ($1, ydrfile.stream, TRUE);
- generate_function_prototype ($1, headerfile.stream, TRUE);
- generate_function ($1, ydrfile.stream, FALSE);
- generate_function_prototype ($1, headerfile.stream, FALSE);
- generate_printfunction ($1, ydrfile.stream);
- generate_printfunction_prototype ($1, headerfile.stream);
- generate_freefunction ($1, ydrfile.stream);
- generate_freefunction_prototype ($1, headerfile.stream);
- }
- }
- | proc_decl {
- generate_client_stub ($1, clientfile.stream,
- clienthdrfile.stream);
- generate_server_stub ($1, serverfile.stream,
- serverhdrfile.stream,
- headerfile.stream);
- }
- ;
-
-type_decl : T_ENUM T_IDENTIFIER enumbody ';'
- { $$ = define_enum ($2, $3); varcnt = 0; }
- | T_STRUCT T_IDENTIFIER { define_struct($2); } structbody attrs ';'
- { $$ = set_struct_body ($2, $4);
- set_sym_attrs($$, $5); }
- | T_STRUCT type structbody attrs';'
- { if($2->symbol && $2->symbol->type != YDR_TSTRUCT)
- error_message (1, "%s is not a struct\n",
- $2->symbol->name);
- $$ = set_struct_body_sym ($2->symbol, $3);
- set_sym_attrs($2->symbol, $4);
- }
- | T_TYPEDEF memberdecl ';'
- { $$ = define_typedef ($2); }
- | T_CONST T_IDENTIFIER '=' constant ';'
- { $$ = define_const ($2, $4); }
- ;
-
-flags: { $$ = TSIMPLE; }
- | T_SPLIT { $$ = TSPLIT; }
- | T_MULTI { $$ = TSPLIT | TSIMPLE | TMULTI; }
- ;
-
-opt_proc: { $$ = 0; }/* empty */
- | T_PROC { $$ = 0; }
- ;
-
-proc_decl: opt_proc T_IDENTIFIER '(' params ')' flags '=' constant ';'
- { $$ = (Symbol *)emalloc(sizeof(Symbol));
- $$->type = YDR_TPROC;
- $$->name = $2;
- $$->u.proc.package = package;
- $$->u.proc.arguments = $4;
- $$->u.proc.id = $8;
- $$->u.proc.flags = $6;
- }
- ;
-
-params: { $$ = listnew(); }
- | param { $$ = listnew(); listaddhead ($$, $1); }
- | params ',' param
- { listaddtail ($1, $3); $$ = $1; }
- ;
-
-param: param_type memberdecl
- { $$ = (Argument *)emalloc(sizeof(Argument));
- $$->argtype = $1;
- $$->name = $2->name;
- $$->type = $2->type;
- free($2); }
- ;
-
-param_type: T_IN { $$ = TIN; }
- | T_OUT { $$ = TOUT; }
- | T_INOUT { $$ = TINOUT; }
- | { $$ = TIN; }
- ;
-
-directive: T_PACKAGE T_IDENTIFIER
- { package = estrdup($2);
- listaddtail (packagelist, package);
- }
- | T_PREFIX T_IDENTIFIER
- { prefix = $2; }
- | T_VERBATIM
- { fprintf (headerfile.stream, "%s\n", $1); }
- | T_ERROR_FUNCTION T_IDENTIFIER
- { error_function = $2; }
- ;
-
-enumbody: '{' enumentries '}' { $$ = $2; }
- ;
-
-enumentries: { $$ = listnew (); }
- | enumentry
- { $$ = listnew(); listaddhead ($$, $1); }
- | enumentries ',' enumentry
- { listaddtail ($1, $3); $$ = $1;}
- ;
-
-enumentry: T_IDENTIFIER '=' constant
- { $$ = createenumentry ($1, $3); varcnt = $3 + 1; }
- | T_IDENTIFIER
- { $$ = createenumentry ($1, varcnt++); }
- ;
-
-memberdecl: T_ASIS memberdecl2
- { $$ = $2; $$->type->flags |= TASIS; }
- | memberdecl2
- { $$ = $1; }
- ;
-
-memberdecl2: type T_IDENTIFIER
- { $$ = createstructentry ($2, $1); }
- | T_STRING T_IDENTIFIER '<' opt_constant '>'
- { Type *t = create_type (YDR_TSTRING, NULL, $4, NULL, NULL,0);
- $$ = createstructentry ($2, t);
- }
- | T_STRING T_IDENTIFIER
- { Type *t = create_type (YDR_TSTRING, NULL, 0, NULL, NULL, 0);
- $$ = createstructentry ($2, t);
- }
- | type T_IDENTIFIER '[' opt_constant ']'
- { Type *t = create_type (YDR_TARRAY, NULL, $4, $1, NULL, 0);
- $$ = createstructentry ($2, t); }
- | type T_IDENTIFIER '<' opt_constant '>'
- { Type *t = create_type (YDR_TVARRAY, NULL, $4, $1, NULL, 0);
- $$ = createstructentry ($2, t); }
- | type T_IDENTIFIER '<' type '>'
- { Type *t = create_type (YDR_TVARRAY, NULL, 0, $1, $4, 0);
- $$ = createstructentry ($2, t); }
- ;
-
-type: long_or_int
- { $$ = create_type (YDR_TLONG, NULL, 0, NULL, NULL, 0); }
- | T_UNSIGNED
- { $$ = create_type (YDR_TULONG, NULL, 0, NULL, NULL, 0); }
- | T_ULONG
- { $$ = create_type (YDR_TULONG, NULL, 0, NULL, NULL, 0); }
- | T_UNSIGNED T_LONG
- { $$ = create_type (YDR_TULONG, NULL, 0, NULL, NULL, 0); }
- | T_LONGLONG
- { $$ = create_type (YDR_TLONGLONG, NULL, 0, NULL, NULL, 0); }
- | T_ULONGLONG
- { $$ = create_type (YDR_TULONGLONG, NULL, 0, NULL, NULL, 0); }
- | T_CHAR
- { $$ = create_type (YDR_TCHAR, NULL, 0, NULL, NULL, 0); }
- | T_UCHAR
- { $$ = create_type (YDR_TUCHAR, NULL, 0, NULL, NULL, 0); }
- | T_UNSIGNED T_CHAR
- { $$ = create_type (YDR_TUCHAR, NULL, 0, NULL, NULL, 0); }
- | T_SHORT
- { $$ = create_type (YDR_TSHORT, NULL, 0, NULL, NULL, 0); }
- | T_USHORT
- { $$ = create_type (YDR_TUSHORT, NULL, 0, NULL, NULL, 0); }
- | T_UNSIGNED T_SHORT
- { $$ = create_type (YDR_TUSHORT, NULL, 0, NULL, NULL, 0); }
- | T_STRING
- { $$ = create_type (YDR_TSTRING, NULL, 0, NULL, NULL, 0); }
- | T_OPAQUE
- { $$ = create_type (YDR_TOPAQUE, NULL, 0, NULL, NULL, 0); }
- | type '*'
- { $$ = create_type (YDR_TPOINTER, NULL, 0, $1, NULL, 0); }
- | T_IDTYPE
- { $$ = create_type (YDR_TUSERDEF, $1, 0, NULL, NULL, 0);
- if ($$->symbol->type != YDR_TSTRUCT
- && $$->symbol->type != YDR_TENUM
- && $$->symbol->type != YDR_TTYPEDEF)
- error_message (1, "%s used as a type\n",
- $$->symbol->name);
- }
- | T_STRUCT type
- {
- $$ = $2;
- if ($$->symbol && $$->symbol->type != YDR_TSTRUCT)
- error_message (1, "%s is not a struct\n",
- $$->symbol->name);
- }
- | T_STRUCT T_IDENTIFIER
- { $$ = create_type (YDR_TUSERDEF, define_struct($2), 0, NULL,
- NULL, 0);
- }
- ;
-
-long_or_int: T_LONG
- | T_INT
- ;
-
-memberdecls: { $$ = listnew(); }
- | memberdecls memberdecl ';'
- { listaddtail ($1, $2); $$ = $1; }
- ;
-
-structbody: '{' memberdecls '}' { $$ = $2; }
- ;
-
-opt_constant: { $$ = 0; }
- | constant { $$ = $1; }
- ;
-
-constant: T_CONSTANT { $$ = $1; }
- | T_IDCONST
- { Symbol *s = $1;
- if (s->type != YDR_TCONST) {
- error_message (1, "%s not a constant\n", s->name);
- } else
- $$ = s->u.val;
- }
- ;
-
-attrs: { $$ = listnew(); }
- | attr { $$ = listnew(); listaddhead ($$, $1); }
- | attrs attr
- { listaddtail ($1, $2); $$ = $1; }
- ;
-
-attr: T_IDENTIFIER '(' '(' T_IDENTIFIER ')' ')'
- { $$ = $4;
- if (strcmp($1, "__attribute__") != 0)
- error_message(1, "%s isn't __attribute__"); }
- ;
-%%
-
-void
-yyerror (char *s)
-{
- error_message (1, "%s\n", s);
-}
diff --git a/usr.sbin/afs/src/ydr/sym.h b/usr.sbin/afs/src/ydr/sym.h
deleted file mode 100644
index 07fcc625eb0..00000000000
--- a/usr.sbin/afs/src/ydr/sym.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: sym.h,v 1.10 2002/04/15 14:53:19 lha Exp $ */
-
-#ifndef _SYM_
-#define _SYM_
-
-#include <bool.h>
-#include <list.h>
-
-struct Type;
-
-typedef struct Type Type;
-
-typedef enum
-{
- YDR_TUNDEFINED, YDR_TSTRUCT, YDR_TENUM, YDR_TCONST, YDR_TENUMVAL,
- YDR_TTYPEDEF, YDR_TPROC
-} SymbolType;
-
-enum { TSPLIT = 1, TSIMPLE = 2, TMULTI = 4};
-
-typedef struct {
- SymbolType type;
- char *name;
- union {
- List *list;
- int val;
- Type *type;
- struct {
- unsigned id;
- List *arguments;
- unsigned flags;
- char *package;
- } proc;
- } u;
- List *attrs;
-} Symbol;
-
-void initsym (void);
-Symbol* addsym (char *);
-Symbol* findsym (char *);
-void symiterate (Bool (*func)(void *, void *), void *arg);
-
-#endif /* _SYM_ */
diff --git a/usr.sbin/afs/src/ydr/symbol.c b/usr.sbin/afs/src/ydr/symbol.c
deleted file mode 100644
index 4fc9feeb000..00000000000
--- a/usr.sbin/afs/src/ydr/symbol.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: symbol.c,v 1.10 2002/04/15 14:53:19 lha Exp $");
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "sym.h"
-#include <hash.h>
-#include <roken.h>
-
-static Hashtab *hashtab;
-
-static int
-symcmp (void *a, void *b)
-{
- Symbol *sa = (Symbol *)a;
- Symbol *sb = (Symbol *)b;
-
- return strcmp (sa->name, sb->name);
-}
-
-static unsigned
-symhash (void *a)
-{
- Symbol *sa = (Symbol *)a;
-
- return hashadd (sa->name);
-}
-
-#define HASHTABSIZE 149
-
-void
-initsym (void)
-{
- hashtab = hashtabnew (HASHTABSIZE, symcmp, symhash);
-}
-
-Symbol *
-addsym (char *name)
-{
- Symbol tmp;
- Symbol *sym;
-
- tmp.name = name;
- sym = (Symbol *)hashtabsearch (hashtab, (void *)&tmp);
- if (sym == NULL) {
- sym = (Symbol *)emalloc (sizeof (Symbol));
- sym->name = name;
- sym->type = YDR_TUNDEFINED;
- sym->attrs = NULL;
- hashtabadd (hashtab, sym);
- }
- return sym;
-}
-
-Symbol *
-findsym (char *name)
-{
- Symbol tmp;
-
- tmp.name = name;
- return (Symbol *)hashtabsearch (hashtab, (void *)&tmp);
-}
-
-static Bool __attribute__ ((unused))
-printsymbol (void *ptr, void *arg)
-{
- Symbol *s = (Symbol *)ptr;
-
- switch (s->type) {
- case YDR_TUNDEFINED :
- printf ("undefined ");
- break;
- case YDR_TSTRUCT :
- printf ("struct ");
- break;
- case YDR_TENUM :
- printf ("enum ");
- break;
- case YDR_TENUMVAL :
- printf ("enumval ");
- break;
- case YDR_TCONST :
- printf ("const ");
- break;
- case YDR_TTYPEDEF :
- printf ("typedef ");
- break;
- default :
- abort ();
- }
- puts (s->name);
-
- return FALSE;
-}
-
-void
-symiterate (Bool (*func)(void *, void *), void *arg)
-{
- hashtabforeach (hashtab, func, arg);
-}
diff --git a/usr.sbin/afs/src/ydr/types.c b/usr.sbin/afs/src/ydr/types.c
deleted file mode 100644
index daa1dd3a71b..00000000000
--- a/usr.sbin/afs/src/ydr/types.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$arla: types.c,v 1.10 2002/04/15 14:53:19 lha Exp $");
-#endif
-
-#include <stdio.h>
-#include <roken.h>
-#include "types.h"
-#include "lex.h"
-
-Symbol *
-define_const (char *name, int value)
-{
- Symbol *s;
-
- s = addsym (name);
-
- if (s->type != YDR_TUNDEFINED) {
- error_message (1, "Redeclaration of %s\n", s->name);
- return NULL;
- }
- s->type = YDR_TCONST;
- s->u.val = value;
- return s;
-}
-
-Symbol *
-define_enum (char *name, List *list)
-{
- Symbol *s;
-
- s = addsym (name);
-
- if (s->type != YDR_TUNDEFINED) {
- error_message (1, "Redeclaration of %s\n", s->name);
- return NULL;
- }
- s->type = YDR_TENUM;
- s->u.list = list;
- return s;
-}
-
-Symbol *
-define_struct (char *name)
-{
- Symbol *s;
-
- s = addsym (name);
-
- if (s->type != YDR_TSTRUCT && s->type != YDR_TUNDEFINED) {
- error_message (1, "Redeclaration of %s as a different type\n",
- s->name);
- return NULL;
- }
- s->type = YDR_TSTRUCT;
- s->u.list = NULL;
- return s;
-}
-
-Symbol *
-set_struct_body_sym (Symbol *s, List *list)
-{
- s->u.list = list;
- return s;
-}
-
-Symbol *
-set_struct_body (char *name, List *list)
-{
- Symbol *s;
-
- s = findsym(name);
- if (s == NULL) {
- error_message(1, "struct %s not declared", name);
- return NULL;
- }
- return set_struct_body_sym (s, list);
-}
-
-Symbol *
-define_typedef (StructEntry *entry)
-{
- Symbol *s;
-
- s = addsym (entry->name);
-
- if (s->type != YDR_TUNDEFINED) {
- error_message (1, "Redeclaration of %s\n", s->name);
- return NULL;
- }
- s->type = YDR_TTYPEDEF;
- s->name = entry->name;
- s->u.type = entry->type;
- free (entry);
- return s;
-}
-
-
-Symbol *
-define_proc (char *name, List *args, unsigned id)
-{
- Symbol *s;
-
- s = addsym (name);
-
- if (s->type != YDR_TUNDEFINED) {
- error_message (1, "Redeclaration of %s\n", s->name);
- return NULL;
- }
- s->type = YDR_TPROC;
- s->u.proc.id = id;
- s->u.proc.arguments = args;
- return s;
-}
-
-Symbol *
-createenumentry (char *name, int value)
-{
- Symbol *s;
-
- s = addsym (name);
-
- if (s->type != YDR_TUNDEFINED) {
- error_message (1,"Redeclaration of %s\n", s->name);
- return NULL;
- }
- s->type = YDR_TENUMVAL;
- s->u.val = value;
- return s;
-}
-
-StructEntry *
-createstructentry (char *name, Type *type)
-{
- StructEntry *e;
-
- e = (StructEntry *)emalloc (sizeof (StructEntry));
- e->name = name;
- e->type = type;
- return e;
-}
-
-struct Type *
-create_type (TypeType type, Symbol *symbol, unsigned size,
- Type *subtype, Type *indextype, int flags)
-{
- Type *t;
-
- t = emalloc(sizeof(*t));
-
- t->type = type;
- t->symbol = symbol;
- t->size = size;
- t->subtype = subtype;
- t->indextype = indextype;
- t->flags = flags;
-
- return t;
-}
-
-void
-set_sym_attrs(Symbol *symbol, List *attrs)
-{
- switch (symbol->type) {
- case YDR_TSTRUCT:
- break;
- default:
- error_message(1, "can't set attribues for %s", symbol->name);
- return;
- }
- symbol->attrs = attrs;
-}
-
-struct fa {
- char *attr;
- int found;
-};
-
-static int
-find_attr(List *l, Listitem *li, void *ptr)
-{
- struct fa *f = ptr;
- char *mem = listdata(li);
- if (strcmp(f->attr, mem) == 0) {
- f->found = 1;
- return 1;
- }
- return 0;
-}
-
-int
-sym_find_attr(Symbol *symbol, char *attr)
-{
- struct fa f;
-
- if (symbol->attrs == NULL)
- return 0;
-
- f.attr = attr;
- f.found = 0;
-
- listiter(symbol->attrs, find_attr, &f);
-
- return f.found;
-}
diff --git a/usr.sbin/afs/src/ydr/types.h b/usr.sbin/afs/src/ydr/types.h
deleted file mode 100644
index 00eb7cf253d..00000000000
--- a/usr.sbin/afs/src/ydr/types.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 1995 - 2000 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $arla: types.h,v 1.13 2003/01/20 07:12:59 lha Exp $ */
-
-#ifndef _YDR_TYPES_
-#define _YDR_TYPES_
-
-#include "sym.h"
-
-typedef struct {
- char *name;
- int val;
-} EnumEntry;
-
-typedef enum {
- YDR_TCHAR, YDR_TUCHAR, YDR_TSHORT, YDR_TUSHORT, YDR_TLONG, YDR_TULONG,
- YDR_TSTRING, YDR_TOPAQUE, YDR_TUSERDEF, YDR_TARRAY,
- YDR_TVARRAY, YDR_TPOINTER, YDR_TLONGLONG, YDR_TULONGLONG
-} TypeType;
-
-struct Type {
- TypeType type;
- Symbol *symbol;
- unsigned size;
- Type *subtype;
- Type *indextype;
- enum { TASIS = 1 } flags;
-};
-
-typedef struct {
- char *name;
- Type *type;
-} StructEntry;
-
-enum argtype { TIN, TOUT, TINOUT };
-
-typedef struct {
- enum argtype argtype;
- char *name;
- Type *type;
-} Argument;
-
-Symbol *define_const (char *name, int value);
-Symbol *define_enum (char *name, List *list);
-Symbol *define_struct (char *name);
-Symbol *set_struct_body_sym (Symbol *s, List *list);
-Symbol *set_struct_body (char *name, List *list);
-Symbol *define_typedef (StructEntry *entry);
-Symbol *define_proc (char *name, List *args, unsigned id);
-Symbol *createenumentry (char *name, int val);
-void set_sym_attrs(Symbol *, List *);
-int sym_find_attr(Symbol *, char *);
-StructEntry *createstructentry (char *name, Type *type);
-struct Type *create_type (TypeType type, Symbol *symbol, unsigned size,
- Type *subtype, Type *indextype, int flags);
-
-
-#endif /* _YDR_TYPES_ */
diff --git a/usr.sbin/afs/usr.sbin/Makefile b/usr.sbin/afs/usr.sbin/Makefile
deleted file mode 100644
index a995ff1bfe1..00000000000
--- a/usr.sbin/afs/usr.sbin/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-# $OpenBSD: Makefile,v 1.1 2002/06/07 05:02:58 hin Exp $
-
-SUBDIR= fs pts vos bos
-
-.include <bsd.subdir.mk>
diff --git a/usr.sbin/afs/usr.sbin/bos/Makefile b/usr.sbin/afs/usr.sbin/bos/Makefile
deleted file mode 100644
index e2aa4cc1117..00000000000
--- a/usr.sbin/afs/usr.sbin/bos/Makefile
+++ /dev/null
@@ -1,38 +0,0 @@
-# $OpenBSD: Makefile,v 1.5 2010/10/13 08:14:22 jsg Exp $
-
-AFSTOPDIR = ../..
-.include <../../Makefile.inc>
-
-.PATH: $(ROKENSRC)
-
-PROG = bos
-BINDIR = /usr/sbin
-MAN = bos.8
-LDADD += ${LIBARLA} -lkrb5 -lcrypto -lasn1 -ledit -lcurses
-DPADD += ${LIBARLA}
-
-CFLAGS += -I${AFSSRC}/appl/lib
-
-SRCS = bos.c \
- bos_addhost.c \
- bos_adduser.c \
- bos_getrestart.c \
- bos_listhosts.c \
- bos_listusers.c \
- bos_removehost.c \
- bos_restart.c \
- bos_start.c \
- bos_status.c \
- bos_stop.c \
- estrdup.c \
- emalloc.c \
- erealloc.c
-
-.PATH: ${AFSSRC}/appl/bos
-
-#SRCS += arladebu.c fs_lib.c
-
-.PATH: ${AFSSRC}/appl/lib
-.PATH: ${AFSSRC}/arlad
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/afs/usr.sbin/fs/Makefile b/usr.sbin/afs/usr.sbin/fs/Makefile
deleted file mode 100644
index e235f28113a..00000000000
--- a/usr.sbin/afs/usr.sbin/fs/Makefile
+++ /dev/null
@@ -1,57 +0,0 @@
-# $OpenBSD: Makefile,v 1.4 2009/08/17 09:40:37 jsg Exp $
-
-AFSTOPDIR = ../..
-.include <../../Makefile.inc>
-
-.PATH: $(ROKENSRC)
-
-PROG = fs
-BINDIR = /usr/sbin
-LDADD += ${LIBARLA} -lkrb5 -lcrypto -lasn1 -ledit -lcurses
-DPADD += ${LIBARLA}
-
-CFLAGS += -I${AFSSRC}/appl/lib
-
-SRCS = fs.c \
- fs_arladebug.c \
- fs_checkservers.c \
- fs_connect.c \
- fs_copyacl.c \
- fs_diskfree.c \
- fs_examine.c \
- fs_flush.c \
- fs_flushvol.c \
- fs_getcache.c \
- fs_getcellstat.c \
- fs_getfid.c \
- fs_getprio.c \
- fs_la.c \
- fs_listcell.c \
- fs_listquota.c \
- fs_lsm.c \
- fs_mkm.c \
- fs_newcell.c \
- fs_nnpfsdebug.c \
- fs_quota.c \
- fs_rmm.c \
- fs_setacl.c \
- fs_setcache.c \
- fs_setcrypt.c \
- fs_setquota.c \
- fs_statistics.c \
- fs_strerror.c \
- fs_whereis.c \
- fs_whichcell.c \
- fs_wscell.c \
- estrdup.c \
- print_version.c \
- getarg.c
-
-.PATH: ${AFSSRC}/appl/fs
-
-SRCS += arladebu.c fs_lib.c
-
-.PATH: ${AFSSRC}/appl/lib
-.PATH: ${AFSSRC}/arlad
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/afs/usr.sbin/pts/Makefile b/usr.sbin/afs/usr.sbin/pts/Makefile
deleted file mode 100644
index 4ad779440e0..00000000000
--- a/usr.sbin/afs/usr.sbin/pts/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-# $OpenBSD: Makefile,v 1.5 2010/10/13 08:14:22 jsg Exp $
-
-AFSTOPDIR = ../..
-.include <../../Makefile.inc>
-
-.PATH: $(ROKENSRC)
-
-PROG = pts
-SRCS = pts.c \
- estrdup.c
-LDADD += ${LIBARLA} -lkrb5 -lcrypto -lasn1 -ledit -lcurses
-DPADD += ${LIBARLA}
-
-.PATH: ${AFSSRCDIR}/appl/pts
-
-SRCS += arlalib.c fs_lib.c
-CFLAGS += -I${AFSSRC}/appl/lib
-.PATH: ${AFSSRC}/appl/lib
-.PATH: ${AFSSRC}/appl/pts
-.PATH: ${AFSSRC}/arlad
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/afs/usr.sbin/vos/Makefile b/usr.sbin/afs/usr.sbin/vos/Makefile
deleted file mode 100644
index f662dd1c122..00000000000
--- a/usr.sbin/afs/usr.sbin/vos/Makefile
+++ /dev/null
@@ -1,42 +0,0 @@
-# $OpenBSD: Makefile,v 1.4 2009/08/17 09:40:37 jsg Exp $
-
-AFSTOPDIR = ../..
-.include <../../Makefile.inc>
-
-.PATH: $(ROKENSRC)
-
-PROG = vos
-MAN = vos.8
-BINDIR = /usr/sbin
-SRCS = vos.c \
- vos_backup.c \
- vos_common.c \
- vos_createentry.c \
- vos_createvolume.c \
- vos_dump.c \
- vos_endtrans.c \
- vos_examine.c \
- vos_listaddrs.c \
- vos_listpart.c \
- vos_listvldb.c \
- vos_listvol.c \
- vos_lock.c \
- vos_partinfo.c \
- vos_status.c \
- vos_syncsite.c \
- vos_unlock.c \
- vos_vldbexamine.c \
- vos_zap.c \
- emalloc.c \
- estrdup.c
-
-LDADD += ${LIBARLA} -lkrb5 -lcrypto -lasn1 -ledit -lcurses
-DPADD += ${LIBARLA}
-
-.PATH: ${AFSSRC}/appl/vos
-
-CFLAGS += -I${AFSSRC}/appl/lib -I../libarla
-.PATH: ${AFSSRC}/appl/lib
-.PATH: ${AFSSRC}/arlad
-
-.include <bsd.prog.mk>
diff --git a/usr.sbin/afs/usr.sbin/ydr/Makefile b/usr.sbin/afs/usr.sbin/ydr/Makefile
deleted file mode 100644
index 86d5390a22d..00000000000
--- a/usr.sbin/afs/usr.sbin/ydr/Makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-# $OpenBSD: Makefile,v 1.3 2004/01/05 02:55:28 espie Exp $
-
-AFSTOPDIR= ../..
-.include <../../Makefile.inc>
-
-.PATH: $(ROKENSRC)
-
-test:
- echo $(ROKENSRC)
-
-SRCS += main.c output.c symbol.c types.c lex.c parse.c list.c \
- hash.c arlamath.c emalloc.c estrdup.c strupr.c
-CLEANFILES += lex.c parse.c parse.h y.tab.h
-CFLAGS += -DCPP='"/usr/bin/cpp"'
-MAN =
-BINDIR = ${DESTDIR}/usr/bin
-PROG = ydr
-
-CFLAGS += -I${AFSSRC}/util -I${AFSSRC}/ydr -I.
-
-.PATH: ${AFSSRC}/ydr ${AFSSRC}/util
-
-beforedepend: parse.h
-
-parse.h: y.tab.h
- -@ln -s y.tab.h parse.h
-
-y.tab.h: parse.c
-
-lex.o: parse.h
-
-.if (${MACHINE_ARCH} == "m68k")
-output.o: output.c
- ${CC} -c ${CFLAGS} -O1 ${.IMPSRC}
-.endif
-
-.include <bsd.prog.mk>