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

  1. Newsgroups: comp.sources.misc
  2. From: youki-k@is.aist-nara.ac.jp (Youki Kadobayashi)
  3. Subject: v41i097:  wwfs - WorldWide File System, Part12/22
  4. Message-ID: <1994Jan17.202330.20046@sparky.sterling.com>
  5. X-Md4-Signature: a654c58f4c3b8bab2a2d112b813fb5fe
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Nara Institute of Science and Technology, Japan
  8. Date: Mon, 17 Jan 1994 20:23:30 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: youki-k@is.aist-nara.ac.jp (Youki Kadobayashi)
  12. Posting-number: Volume 41, Issue 97
  13. Archive-name: wwfs/part12
  14. Environment: UNIX, inet
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then feed it
  18. # into a shell via "sh file" or similar.  To overwrite existing files,
  19. # type "sh file -c".
  20. # Contents:  csd/auto.h csd/wfs.h doc/manual.tex libww/wwconfigure.sh
  21. # Wrapped by kent@sparky on Sun Jan 16 17:48:34 1994
  22. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
  23. echo If this archive is complete, you will see the following message:
  24. echo '          "shar: End of archive 12 (of 22)."'
  25. if test -f 'csd/auto.h' -a "${1}" != "-c" ; then 
  26.   echo shar: Will not clobber existing file \"'csd/auto.h'\"
  27. else
  28.   echo shar: Extracting \"'csd/auto.h'\" \(27718 characters\)
  29.   sed "s/^X//" >'csd/auto.h' <<'END_OF_FILE'
  30. X/*
  31. X *   This file was automatically generated by version 1.7 of cextract.
  32. X *   Manual editing not recommended.
  33. X *
  34. X *   Created: Sat Dec 11 00:32:27 1993
  35. X */
  36. X#ifndef __CEXTRACT__
  37. X#if __STDC__
  38. X
  39. Xextern int acc_bind ( char *name, char *value );
  40. Xextern wf_acc * acc_load ( char *dir );
  41. Xextern wf_acc * acc_findname ( char *dir );
  42. Xextern int acc_check ( wf_acc *accp, unsigned long ip, long mask );
  43. Xextern void bfs_start ( void );
  44. Xextern int cwd_fake ( wf_thrd *c, wf_fh *fhp );
  45. Xextern void fh_fake ( wf_thrd *c );
  46. Xextern void fh_getattr ( wf_thrd *c );
  47. Xextern void fh_read ( wf_thrd *c );
  48. Xextern void * timeout_set ( time_t t, void (*fn)(), void *closure );
  49. Xextern void timeout_reset ( time_t t, callout *cp );
  50. Xextern void timeout_clear ( callout *cp );
  51. Xextern void timeout_reschedule ( time_t now, time_t then );
  52. Xextern int softclock ( void );
  53. Xextern void cmfs_getattr ( wf_thrd *c );
  54. Xextern void cmfs_lookup ( wf_thrd *c );
  55. Xextern void cmfs_readdir ( wf_thrd *c );
  56. Xextern void cmfs_readlink ( wf_thrd *c );
  57. Xextern void cmfs_read ( wf_thrd *c );
  58. Xextern void conn_start ( void );
  59. Xextern void conn_stop ( void );
  60. Xextern int conn_count ( void );
  61. Xextern wf_conn * conn_alloc ( void );
  62. Xextern void conn_free ( wf_conn *cp );
  63. Xextern void conn_shutdown ( wf_conn *cp, int howto );
  64. Xextern void conn_dropped ( int so );
  65. Xextern void conn_inspect ( wf_req *reqp );
  66. Xextern unsigned long updcrc ( unsigned long icrc, unsigned char *icp, int icnt );
  67. Xextern int cs_namei ( char *pname, wf_fh *fhp );
  68. Xextern long cs_error ( char *msg );
  69. Xextern void cs_mount ( wf_thrd *c );
  70. Xextern void cs_mount_done ( wf_thrd *c, int status );
  71. Xextern int cs_umount ( char *vol );
  72. Xextern void cs_lookup ( svc_req *rqstp, wf_vol *volp, wf_fh *fhp, char *fname );
  73. Xextern void cs_readdir ( svc_req *rqstp, wf_vol *volp, wf_fh *fhp, long cookie, u_int count );
  74. Xextern void cs_read ( svc_req *rqstp, wf_vol *volp, wf_fh *fhp, u_int offset, u_int count, u_int totalcount );
  75. Xextern void cs_getuda ( svc_req *rqstp, wf_fh *fhp, char *attrname );
  76. Xextern void cs_geterr ( svc_req *rqstp, long err_context );
  77. Xextern void * cs_proc_null_1 ( void *argp, svc_req *rqstp );
  78. Xextern int * cs_proc_getport_1 ( void *argp, svc_req *rqstp );
  79. Xextern cs_fhres * cs_proc_register_1 ( void *argp, svc_req *rqstp );
  80. Xextern cs_res * cs_proc_unregister_1 ( void *argp, svc_req *rqstp );
  81. Xextern cs_res * cs_proc_mount_1 ( cs_volargs *argp, svc_req *rqstp );
  82. Xextern cs_res * cs_proc_umount_1 ( cs_volargs *argp, svc_req *rqstp );
  83. Xextern cs_diropres * cs_proc_lookup_1 ( cs_diropargs *argp, svc_req *rqstp );
  84. Xextern cs_readdirres * cs_proc_readdir_1 ( cs_readdirargs *argp, svc_req *rqstp );
  85. Xextern cs_readres * cs_proc_read_1 ( cs_readargs *argp, svc_req *rqstp );
  86. Xextern cs_volres * cs_proc_getvol_1 ( cs_volargs *argp, svc_req *rqstp );
  87. Xextern cs_xferres * cs_proc_getxfer_1 ( wf_fh *fhp, svc_req *rqstp );
  88. Xextern cs_udares * cs_proc_getuda_1 ( cs_udaargs *argp, svc_req *rqstp );
  89. Xextern cs_geterrres * cs_proc_geterr_1 ( cs_geterrargs *argp, svc_req *rqstp );
  90. Xextern void dir_start ( void );
  91. Xextern void dir_addfile ( wf_dir *dirp, wf_file *filep );
  92. Xextern void dir_deletefile ( wf_file *filep );
  93. Xextern wf_file * dir_adddir ( wf_dir *dirp, char *name, long volid, long dirid );
  94. Xextern wf_dir * dir_new ( wf_vol *volp, long id, char *dir, char *subdir );
  95. Xextern wf_dir * dir_findcache ( wf_vol *volp, long dirid );
  96. Xextern wf_dir * dir_load ( wf_vol *volp, long dirid );
  97. Xextern void dir_save ( wf_vol *volp, wf_dir *dirp, wf_dir *olddirp );
  98. Xextern void dir_realdir ( char *path, wf_vol *volp, wf_dir *dirp );
  99. Xextern void dir_dispose ( wf_vol *volp, long dirid );
  100. Xextern void dir_inspect ( wf_req *reqp, char *name );
  101. Xextern int dump_srv ( char *tag, wf_srv *srvp );
  102. Xextern int dump_fh ( char *tag, wf_fh *fhp );
  103. Xextern int dump_vol ( char *tag, wf_vol *volp );
  104. Xextern int dump_dir ( char *tag, wf_dir *dirp );
  105. Xextern int dump_fdset ( char *tag, fd_set *fdsetp );
  106. Xextern void err_getattr ( wf_thrd *c );
  107. Xextern void err_getattr_miss ( wf_thrd *c );
  108. Xextern void err_lookup ( wf_thrd *c );
  109. Xextern void err_lookup_miss ( wf_thrd *c );
  110. Xextern void err_readlink ( wf_thrd *c );
  111. Xextern void err_read ( wf_thrd *c );
  112. Xextern void err_read_miss ( wf_thrd *c );
  113. Xextern void err_readdir ( wf_thrd *c );
  114. Xextern void err_readdir_miss ( wf_thrd *c );
  115. Xextern void err_getuda ( wf_thrd *c );
  116. Xextern void err_keepalive ( wf_thrd *c );
  117. Xextern void err_close ( wf_conn *cp );
  118. Xextern void err_shutdown ( wf_conn *cp, int howto );
  119. Xextern wf_file * file_alloc ( void );
  120. Xextern void file_free ( wf_file *filep );
  121. Xextern void file_uncache ( wf_dir *dirp );
  122. Xextern wf_file * file_new ( char *name, char *link, ftype filetype, u_int nlink, u_int mode, u_int uid, u_int gid, long size, long time, long fileid, u_int fsid );
  123. Xextern void attr_initdir ( fattr *attrp );
  124. Xextern void attr_initfile ( fattr *attrp, long size );
  125. Xextern unsigned int attr_touch ( fattr *attrp );
  126. Xextern wf_file * file_newvol ( char *name );
  127. Xextern wf_file * file_findid ( wf_dir *dirp, long fsid, long fileid );
  128. Xextern wf_file * file_findname ( wf_dir *dirp, char *name );
  129. Xextern int file_recv_init ( wf_vol *volp, wf_dir *dirp, wf_file *filep );
  130. Xextern void file_recv_finish ( wf_vol *volp, wf_dir *dirp, wf_file *filep );
  131. Xextern void file_recv_abort ( wf_vol *volp, wf_dir *dirp, wf_file *filep );
  132. Xextern void file_getpath ( char *buf, wf_vol *volp, wf_dir *dirp, wf_file *filep );
  133. Xextern int file_findcache ( wf_vol *volp, wf_dir *dirp, wf_file *filep );
  134. Xextern void file_dispose ( wf_vol *volp, wf_dir *dirp, wf_file *filep );
  135. Xextern void file_inspect ( wf_req *reqp, char *name );
  136. Xextern void ftp_getuda ( void );
  137. Xextern void ftp_keepalive ( void );
  138. Xextern void ftp_close ( wf_conn *cp );
  139. Xextern void ftp_shutdown ( wf_conn *cp, int howto );
  140. Xextern int ftp_conn_open ( wf_thrd *c );
  141. Xextern int ftp_recv_status ( wf_conn *cp );
  142. Xextern void ftp_recv_junk ( int so );
  143. Xextern void ftp_reply_diag ( int ret );
  144. Xextern void ftp_readdir_miss ( wf_thrd *c );
  145. Xextern void ftp_recv_list ( wf_thrd *c );
  146. Xextern int ftp_parse_list ( char *buftop, wf_vol *volp, wf_dir *dirp, wf_dir *olddirp );
  147. Xextern void ftp_read_miss ( wf_thrd *c );
  148. Xextern void icmp_start ( void );
  149. Xextern void icmp_send ( sockaddr_in *to );
  150. Xextern void icmp_recv ( int so );
  151. Xextern void dlog ( char *fmt, ... );
  152. Xextern void dlog_start ( void );
  153. Xextern void dlog_stop ( void );
  154. Xextern void errno_log ( char *file, int line );
  155. Xextern void talk_start ( void );
  156. Xextern void talk ( long ip_addr, char *fmt, ... );
  157. Xextern int main ( int argc, char **argv );
  158. Xextern void csd_start_1 ( void );
  159. Xextern void csd_start_2 ( void );
  160. Xextern void csd_stop ( void );
  161. Xextern int csd_tailor ( char *name, char *value );
  162. Xextern void nfs_getattr_reply ( wf_thrd *c, int status );
  163. Xextern void nfs_lookup_reply ( wf_thrd *c, int status );
  164. Xextern void nfs_readlink_reply ( wf_thrd *c, int status );
  165. Xextern void nfs_read_reply ( wf_thrd *c, nfsstat status, fattr *attrp, int data_len, char *data_val );
  166. Xextern void nfs_read_done ( wf_thrd *c, int status );
  167. Xextern unsigned long cookie_bake ( wf_file *filep, wf_file *head );
  168. Xextern wf_file * cookie_taste ( unsigned long cookie, wf_file *head );
  169. Xextern void nfs_readdir_done ( wf_thrd *c, int status );
  170. Xextern void so_register ( int so, int flag );
  171. Xextern void so_unregister ( int so, int flag );
  172. Xextern void fd_union ( fd_set *destfdp, fd_set *srcfdp );
  173. Xextern void so_callback ( int so, func funcp, void *p );
  174. Xextern void so_clear ( int so );
  175. Xextern char * so_getbuf ( int so );
  176. Xextern serv_state csd_run ( void );
  177. Xextern int csd_rpc ( void );
  178. Xextern void * nfsproc_null_2 ( void *argp, svc_req *rqstp );
  179. Xextern attrstat * nfsproc_getattr_2 ( nfs_fh *argp, svc_req *rqstp );
  180. Xextern attrstat * nfsproc_setattr_2 ( sattrargs *argp, svc_req *rqstp );
  181. Xextern void * nfsproc_root_2 ( void *argp, svc_req *rqstp );
  182. Xextern diropres * nfsproc_lookup_2 ( diropargs *argp, svc_req *rqstp );
  183. Xextern readlinkres * nfsproc_readlink_2 ( nfs_fh *argp, svc_req *rqstp );
  184. Xextern readres * nfsproc_read_2 ( readargs *argp, svc_req *rqstp );
  185. Xextern void * nfsproc_writecache_2 ( void *argp, svc_req *rqstp );
  186. Xextern attrstat * nfsproc_write_2 ( writeargs *argp, svc_req *rqstp );
  187. Xextern diropres * nfsproc_create_2 ( createargs *argp, svc_req *rqstp );
  188. Xextern nfsstat * nfsproc_remove_2 ( diropargs *argp, svc_req *rqstp );
  189. Xextern nfsstat * nfsproc_rename_2 ( renameargs *argp, svc_req *rqstp );
  190. Xextern nfsstat * nfsproc_link_2 ( linkargs *argp, svc_req *rqstp );
  191. Xextern nfsstat * nfsproc_symlink_2 ( symlinkargs *argp, svc_req *rqstp );
  192. Xextern diropres * nfsproc_mkdir_2 ( createargs *argp, svc_req *rqstp );
  193. Xextern nfsstat * nfsproc_rmdir_2 ( diropargs *argp, svc_req *rqstp );
  194. Xextern readdirres * nfsproc_readdir_2 ( readdirargs *argp, svc_req *rqstp );
  195. Xextern statfsres * nfsproc_statfs_2 ( nfs_fh *argp, svc_req *rqstp );
  196. Xextern int parse_conf ( char *conf, int (*bind_func)() );
  197. Xextern int parse_tailor ( wf_tailor *tailor, char *name, char *value );
  198. Xextern long parse_cap ( wf_cap *cap, char *str );
  199. Xextern wf_proto * pol_select_proto ( wf_vol *volp );
  200. Xextern wf_srvq * pol_select_srv ( wf_vol *volp );
  201. Xextern void proto_getattr ( wf_thrd *c );
  202. Xextern void proto_lookup ( wf_thrd *c );
  203. Xextern void proto_readlink ( wf_thrd *c );
  204. Xextern void proto_read ( wf_thrd *c );
  205. Xextern void proto_readdir ( wf_thrd *c );
  206. Xextern void proto_getuda ( wf_thrd *c );
  207. Xextern void proto_keepalive ( wf_thrd *c );
  208. Xextern void proto_close ( wf_conn *cp );
  209. Xextern void proto_shutdown ( wf_conn *cp, int howto );
  210. Xextern void proto_getattr_miss ( wf_thrd *c );
  211. Xextern void proto_lookup_miss ( wf_thrd *c );
  212. Xextern void proto_readdir_miss ( wf_thrd *c );
  213. Xextern void proto_read_miss ( wf_thrd *c );
  214. Xextern void root_start ( void );
  215. Xextern wf_file * root_attach ( wf_dir *dirp, char *name );
  216. Xextern int root_deletevol ( char *name );
  217. Xextern int root_fhn2ih ( char *pname, wf_ih *ihp );
  218. Xextern int root_name2ih ( char *pname, wf_ih *ihp );
  219. Xextern void ih2fh ( wf_ih *ihp, wf_fh *fhp );
  220. Xextern int root_name2fh ( char *pname, wf_fh *fhp );
  221. Xextern void root_inspect ( wf_req *reqp, char *arg );
  222. Xextern void root_getattr_miss ( wf_thrd *c );
  223. Xextern void root_read_miss ( wf_thrd *c );
  224. Xextern void root_lookup_miss ( wf_thrd *c );
  225. Xextern void root_getuda ( void );
  226. Xextern void run_task ( int (*tf)(), void *ta, func cf, void *ca );
  227. Xextern void sched_task ( func cf, void *ca, void *wchan );
  228. Xextern void sched_task_atop ( func cf, void *ca, void *wchan );
  229. Xextern void wakeup ( void *wchan );
  230. Xextern void sigchld ( int sig );
  231. Xextern void do_task_notify ( void );
  232. Xextern struct hostent * parse_hostorip ( char *str );
  233. Xextern void srv_resolv ( wf_srv *srvp );
  234. Xextern wf_srv * srv_findname ( char *name );
  235. Xextern wf_srv * srv_findip ( long ipaddr );
  236. Xextern wf_conn * srv_getconn ( wf_srvq *srvq );
  237. Xextern wf_conn * srv_newconn ( wf_srvq *srvq );
  238. Xextern void srv_releaseconn ( wf_srv *srvp, wf_conn *cp );
  239. Xextern void srv_flag ( wf_srv *srvp, int flag );
  240. Xextern wf_thrd * thrd_alloc ( void );
  241. Xextern void thrd_watch ( wf_thrd *thrdp );
  242. Xextern void thrd_ignore ( wf_thrd *thrdp );
  243. Xextern void thrd_free ( wf_thrd *thrdp );
  244. Xextern void thrd_srvfailure ( wf_srv *srvp );
  245. Xextern void thrd_start ( void );
  246. Xextern void thrd_stop ( void );
  247. Xextern void thrd_inspect ( wf_req *reqp );
  248. Xextern void trace_event ( void *handle, wf_trace *tracep );
  249. Xextern void trace_report ( void );
  250. Xextern void trace_start ( void );
  251. Xextern void ufs_read_miss ( wf_thrd *c );
  252. Xextern void ufs_readdir_miss ( wf_thrd *c );
  253. Xextern int uip_id ( void );
  254. Xextern void uip_start ( void );
  255. Xextern qelem * q_alloc ( void );
  256. Xextern void q_insert ( qelem *elem, qelem *pred );
  257. Xextern void q_remove ( qelem *elem );
  258. Xextern int q_len ( qelem *elem );
  259. Xextern void q_allfree ( qelem *head );
  260. Xextern void * alloc_and_copy ( void *v, int vlen );
  261. Xextern void * alloc_and_clear ( int vlen );
  262. Xextern void alloc_start ( void );
  263. Xextern int mkdirs ( char *path );
  264. Xextern int validate_dir ( char *dir );
  265. Xextern void csd_abort ( int ret );
  266. Xextern int background ( void );
  267. Xextern int bind_resv_port ( int so, unsigned short *portp );
  268. Xextern int tcp_send ( int so, char *fmt, ... );
  269. Xextern int req_send ( wf_req *reqp, char *fmt, ... );
  270. Xextern void getdate ( void );
  271. Xextern void unix_command ( char *cmd );
  272. Xextern long compute_blocks ( long size );
  273. Xextern time_t tm2time ( struct tm *tm );
  274. Xextern char * strdup ( Const char *str );
  275. Xextern wf_vol * vol_alloc ( void );
  276. Xextern void vol_free ( wf_vol *volp );
  277. Xextern wf_vol * vol_findid ( long id );
  278. Xextern wf_vol * vol_findname ( char *dir, char *name );
  279. Xextern int vol_set_name ( char *name );
  280. Xextern int vol_set_ftp_server ( char *hostname );
  281. Xextern int vol_set_ftp_directory ( char *subdir );
  282. Xextern int vol_set_ftp_options ( char *flagstr );
  283. Xextern int vol_set_ufs_directory ( char *topdir );
  284. Xextern int vol_set_description ( char *desc );
  285. Xextern int vol_bind ( char *name, char *value );
  286. Xextern wf_vol * vol_load ( char *dir, char *name );
  287. Xextern void vol_save ( wf_vol *volp );
  288. Xextern wf_conn * vol_getconn ( wf_vol *volp );
  289. Xextern wf_conn * vol_newconn ( wf_vol *volp );
  290. Xextern void vol_releaseconn ( wf_vol *volp );
  291. Xextern void vol_addsrv ( wf_vol *volp, wf_srv *srvp, char *subdir );
  292. Xextern void vol_deletesrv ( wf_vol *volp, wf_srv *srvp );
  293. Xextern long vol_allocid ( wf_vol *volp );
  294. Xextern void vol_destroyid ( wf_vol *volp );
  295. Xextern wf_dir * vol_newroot ( wf_vol *volp );
  296. Xextern wf_dir * vol_findroot ( wf_vol *volp );
  297. Xextern void vol_inspect ( wf_req *reqp, char *name );
  298. X
  299. X#else /* __STDC__ */
  300. X
  301. Xextern int acc_bind (/* char *name, char *value */);
  302. Xextern wf_acc * acc_load (/* char *dir */);
  303. Xextern wf_acc * acc_findname (/* char *dir */);
  304. Xextern int acc_check (/* wf_acc *accp, unsigned long ip, long mask */);
  305. Xextern void bfs_start (/* void */);
  306. Xextern int cwd_fake (/* wf_thrd *c, wf_fh *fhp */);
  307. Xextern void fh_fake (/* wf_thrd *c */);
  308. Xextern void fh_getattr (/* wf_thrd *c */);
  309. Xextern void fh_read (/* wf_thrd *c */);
  310. Xextern void * timeout_set (/* time_t t, void (*fn)(), void *closure */);
  311. Xextern void timeout_reset (/* time_t t, callout *cp */);
  312. Xextern void timeout_clear (/* callout *cp */);
  313. Xextern void timeout_reschedule (/* time_t now, time_t then */);
  314. Xextern int softclock (/* void */);
  315. Xextern void cmfs_getattr (/* wf_thrd *c */);
  316. Xextern void cmfs_lookup (/* wf_thrd *c */);
  317. Xextern void cmfs_readdir (/* wf_thrd *c */);
  318. Xextern void cmfs_readlink (/* wf_thrd *c */);
  319. Xextern void cmfs_read (/* wf_thrd *c */);
  320. Xextern void conn_start (/* void */);
  321. Xextern void conn_stop (/* void */);
  322. Xextern int conn_count (/* void */);
  323. Xextern wf_conn * conn_alloc (/* void */);
  324. Xextern void conn_free (/* wf_conn *cp */);
  325. Xextern void conn_shutdown (/* wf_conn *cp, int howto */);
  326. Xextern void conn_dropped (/* int so */);
  327. Xextern void conn_inspect (/* wf_req *reqp */);
  328. Xextern unsigned long updcrc (/* unsigned long icrc, unsigned char *icp, int icnt */);
  329. Xextern int cs_namei (/* char *pname, wf_fh *fhp */);
  330. Xextern long cs_error (/* char *msg */);
  331. Xextern void cs_mount (/* wf_thrd *c */);
  332. Xextern void cs_mount_done (/* wf_thrd *c, int status */);
  333. Xextern int cs_umount (/* char *vol */);
  334. Xextern void cs_lookup (/* svc_req *rqstp, wf_vol *volp, wf_fh *fhp, char *fname */);
  335. Xextern void cs_readdir (/* svc_req *rqstp, wf_vol *volp, wf_fh *fhp, long cookie, u_int count */);
  336. Xextern void cs_read (/* svc_req *rqstp, wf_vol *volp, wf_fh *fhp, u_int offset, u_int count, u_int totalcount */);
  337. Xextern void cs_getuda (/* svc_req *rqstp, wf_fh *fhp, char *attrname */);
  338. Xextern void cs_geterr (/* svc_req *rqstp, long err_context */);
  339. Xextern void * cs_proc_null_1 (/* void *argp, svc_req *rqstp */);
  340. Xextern int * cs_proc_getport_1 (/* void *argp, svc_req *rqstp */);
  341. Xextern cs_fhres * cs_proc_register_1 (/* void *argp, svc_req *rqstp */);
  342. Xextern cs_res * cs_proc_unregister_1 (/* void *argp, svc_req *rqstp */);
  343. Xextern cs_res * cs_proc_mount_1 (/* cs_volargs *argp, svc_req *rqstp */);
  344. Xextern cs_res * cs_proc_umount_1 (/* cs_volargs *argp, svc_req *rqstp */);
  345. Xextern cs_diropres * cs_proc_lookup_1 (/* cs_diropargs *argp, svc_req *rqstp */);
  346. Xextern cs_readdirres * cs_proc_readdir_1 (/* cs_readdirargs *argp, svc_req *rqstp */);
  347. Xextern cs_readres * cs_proc_read_1 (/* cs_readargs *argp, svc_req *rqstp */);
  348. Xextern cs_volres * cs_proc_getvol_1 (/* cs_volargs *argp, svc_req *rqstp */);
  349. Xextern cs_xferres * cs_proc_getxfer_1 (/* wf_fh *fhp, svc_req *rqstp */);
  350. Xextern cs_udares * cs_proc_getuda_1 (/* cs_udaargs *argp, svc_req *rqstp */);
  351. Xextern cs_geterrres * cs_proc_geterr_1 (/* cs_geterrargs *argp, svc_req *rqstp */);
  352. Xextern void dir_start (/* void */);
  353. Xextern void dir_addfile (/* wf_dir *dirp, wf_file *filep */);
  354. Xextern void dir_deletefile (/* wf_file *filep */);
  355. Xextern wf_file * dir_adddir (/* wf_dir *dirp, char *name, long volid, long dirid */);
  356. Xextern wf_dir * dir_new (/* wf_vol *volp, long id, char *dir, char *subdir */);
  357. Xextern wf_dir * dir_findcache (/* wf_vol *volp, long dirid */);
  358. Xextern wf_dir * dir_load (/* wf_vol *volp, long dirid */);
  359. Xextern void dir_save (/* wf_vol *volp, wf_dir *dirp, wf_dir *olddirp */);
  360. Xextern void dir_realdir (/* char *path, wf_vol *volp, wf_dir *dirp */);
  361. Xextern void dir_dispose (/* wf_vol *volp, long dirid */);
  362. Xextern void dir_inspect (/* wf_req *reqp, char *name */);
  363. Xextern int dump_srv (/* char *tag, wf_srv *srvp */);
  364. Xextern int dump_fh (/* char *tag, wf_fh *fhp */);
  365. Xextern int dump_vol (/* char *tag, wf_vol *volp */);
  366. Xextern int dump_dir (/* char *tag, wf_dir *dirp */);
  367. Xextern int dump_fdset (/* char *tag, fd_set *fdsetp */);
  368. Xextern void err_getattr (/* wf_thrd *c */);
  369. Xextern void err_getattr_miss (/* wf_thrd *c */);
  370. Xextern void err_lookup (/* wf_thrd *c */);
  371. Xextern void err_lookup_miss (/* wf_thrd *c */);
  372. Xextern void err_readlink (/* wf_thrd *c */);
  373. Xextern void err_read (/* wf_thrd *c */);
  374. Xextern void err_read_miss (/* wf_thrd *c */);
  375. Xextern void err_readdir (/* wf_thrd *c */);
  376. Xextern void err_readdir_miss (/* wf_thrd *c */);
  377. Xextern void err_getuda (/* wf_thrd *c */);
  378. Xextern void err_keepalive (/* wf_thrd *c */);
  379. Xextern void err_close (/* wf_conn *cp */);
  380. Xextern void err_shutdown (/* wf_conn *cp, int howto */);
  381. Xextern wf_file * file_alloc (/* void */);
  382. Xextern void file_free (/* wf_file *filep */);
  383. Xextern void file_uncache (/* wf_dir *dirp */);
  384. Xextern wf_file * file_new (/* char *name, char *link, ftype filetype, u_int nlink, u_int mode, u_int uid, u_int gid, long size, long time, long fileid, u_int fsid */);
  385. Xextern void attr_initdir (/* fattr *attrp */);
  386. Xextern void attr_initfile (/* fattr *attrp, long size */);
  387. Xextern unsigned int attr_touch (/* fattr *attrp */);
  388. Xextern wf_file * file_newvol (/* char *name */);
  389. Xextern wf_file * file_findid (/* wf_dir *dirp, long fsid, long fileid */);
  390. Xextern wf_file * file_findname (/* wf_dir *dirp, char *name */);
  391. Xextern int file_recv_init (/* wf_vol *volp, wf_dir *dirp, wf_file *filep */);
  392. Xextern void file_recv_finish (/* wf_vol *volp, wf_dir *dirp, wf_file *filep */);
  393. Xextern void file_recv_abort (/* wf_vol *volp, wf_dir *dirp, wf_file *filep */);
  394. Xextern void file_getpath (/* char *buf, wf_vol *volp, wf_dir *dirp, wf_file *filep */);
  395. Xextern int file_findcache (/* wf_vol *volp, wf_dir *dirp, wf_file *filep */);
  396. Xextern void file_dispose (/* wf_vol *volp, wf_dir *dirp, wf_file *filep */);
  397. Xextern void file_inspect (/* wf_req *reqp, char *name */);
  398. Xextern void ftp_getuda (/* void */);
  399. Xextern void ftp_keepalive (/* void */);
  400. Xextern void ftp_close (/* wf_conn *cp */);
  401. Xextern void ftp_shutdown (/* wf_conn *cp, int howto */);
  402. Xextern int ftp_conn_open (/* wf_thrd *c */);
  403. Xextern int ftp_recv_status (/* wf_conn *cp */);
  404. Xextern void ftp_recv_junk (/* int so */);
  405. Xextern void ftp_reply_diag (/* int ret */);
  406. Xextern void ftp_readdir_miss (/* wf_thrd *c */);
  407. Xextern void ftp_recv_list (/* wf_thrd *c */);
  408. Xextern int ftp_parse_list (/* char *buftop, wf_vol *volp, wf_dir *dirp, wf_dir *olddirp */);
  409. Xextern void ftp_read_miss (/* wf_thrd *c */);
  410. Xextern void icmp_start (/* void */);
  411. Xextern void icmp_send (/* sockaddr_in *to */);
  412. Xextern void icmp_recv (/* int so */);
  413. Xextern void dlog (/* char *fmt, ... */);
  414. Xextern void dlog_start (/* void */);
  415. Xextern void dlog_stop (/* void */);
  416. Xextern void errno_log (/* char *file, int line */);
  417. Xextern void talk_start (/* void */);
  418. Xextern void talk (/* long ip_addr, char *fmt, ... */);
  419. Xextern int main (/* int argc, char **argv */);
  420. Xextern void csd_start_1 (/* void */);
  421. Xextern void csd_start_2 (/* void */);
  422. Xextern void csd_stop (/* void */);
  423. Xextern int csd_tailor (/* char *name, char *value */);
  424. Xextern void nfs_getattr_reply (/* wf_thrd *c, int status */);
  425. Xextern void nfs_lookup_reply (/* wf_thrd *c, int status */);
  426. Xextern void nfs_readlink_reply (/* wf_thrd *c, int status */);
  427. Xextern void nfs_read_reply (/* wf_thrd *c, nfsstat status, fattr *attrp, int data_len, char *data_val */);
  428. Xextern void nfs_read_done (/* wf_thrd *c, int status */);
  429. Xextern unsigned long cookie_bake (/* wf_file *filep, wf_file *head */);
  430. Xextern wf_file * cookie_taste (/* unsigned long cookie, wf_file *head */);
  431. Xextern void nfs_readdir_done (/* wf_thrd *c, int status */);
  432. Xextern void so_register (/* int so, int flag */);
  433. Xextern void so_unregister (/* int so, int flag */);
  434. Xextern void fd_union (/* fd_set *destfdp, fd_set *srcfdp */);
  435. Xextern void so_callback (/* int so, func funcp, void *p */);
  436. Xextern void so_clear (/* int so */);
  437. Xextern char * so_getbuf (/* int so */);
  438. Xextern serv_state csd_run (/* void */);
  439. Xextern int csd_rpc (/* void */);
  440. Xextern void * nfsproc_null_2 (/* void *argp, svc_req *rqstp */);
  441. Xextern attrstat * nfsproc_getattr_2 (/* nfs_fh *argp, svc_req *rqstp */);
  442. Xextern attrstat * nfsproc_setattr_2 (/* sattrargs *argp, svc_req *rqstp */);
  443. Xextern void * nfsproc_root_2 (/* void *argp, svc_req *rqstp */);
  444. Xextern diropres * nfsproc_lookup_2 (/* diropargs *argp, svc_req *rqstp */);
  445. Xextern readlinkres * nfsproc_readlink_2 (/* nfs_fh *argp, svc_req *rqstp */);
  446. Xextern readres * nfsproc_read_2 (/* readargs *argp, svc_req *rqstp */);
  447. Xextern void * nfsproc_writecache_2 (/* void *argp, svc_req *rqstp */);
  448. Xextern attrstat * nfsproc_write_2 (/* writeargs *argp, svc_req *rqstp */);
  449. Xextern diropres * nfsproc_create_2 (/* createargs *argp, svc_req *rqstp */);
  450. Xextern nfsstat * nfsproc_remove_2 (/* diropargs *argp, svc_req *rqstp */);
  451. Xextern nfsstat * nfsproc_rename_2 (/* renameargs *argp, svc_req *rqstp */);
  452. Xextern nfsstat * nfsproc_link_2 (/* linkargs *argp, svc_req *rqstp */);
  453. Xextern nfsstat * nfsproc_symlink_2 (/* symlinkargs *argp, svc_req *rqstp */);
  454. Xextern diropres * nfsproc_mkdir_2 (/* createargs *argp, svc_req *rqstp */);
  455. Xextern nfsstat * nfsproc_rmdir_2 (/* diropargs *argp, svc_req *rqstp */);
  456. Xextern readdirres * nfsproc_readdir_2 (/* readdirargs *argp, svc_req *rqstp */);
  457. Xextern statfsres * nfsproc_statfs_2 (/* nfs_fh *argp, svc_req *rqstp */);
  458. Xextern int parse_conf (/* char *conf, int (*bind_func)() */);
  459. Xextern int parse_tailor (/* wf_tailor *tailor, char *name, char *value */);
  460. Xextern long parse_cap (/* wf_cap *cap, char *str */);
  461. Xextern wf_proto * pol_select_proto (/* wf_vol *volp */);
  462. Xextern wf_srvq * pol_select_srv (/* wf_vol *volp */);
  463. Xextern void proto_getattr (/* wf_thrd *c */);
  464. Xextern void proto_lookup (/* wf_thrd *c */);
  465. Xextern void proto_readlink (/* wf_thrd *c */);
  466. Xextern void proto_read (/* wf_thrd *c */);
  467. Xextern void proto_readdir (/* wf_thrd *c */);
  468. Xextern void proto_getuda (/* wf_thrd *c */);
  469. Xextern void proto_keepalive (/* wf_thrd *c */);
  470. Xextern void proto_close (/* wf_conn *cp */);
  471. Xextern void proto_shutdown (/* wf_conn *cp, int howto */);
  472. Xextern void proto_getattr_miss (/* wf_thrd *c */);
  473. Xextern void proto_lookup_miss (/* wf_thrd *c */);
  474. Xextern void proto_readdir_miss (/* wf_thrd *c */);
  475. Xextern void proto_read_miss (/* wf_thrd *c */);
  476. Xextern void root_start (/* void */);
  477. Xextern wf_file * root_attach (/* wf_dir *dirp, char *name */);
  478. Xextern int root_deletevol (/* char *name */);
  479. Xextern int root_fhn2ih (/* char *pname, wf_ih *ihp */);
  480. Xextern int root_name2ih (/* char *pname, wf_ih *ihp */);
  481. Xextern void ih2fh (/* wf_ih *ihp, wf_fh *fhp */);
  482. Xextern int root_name2fh (/* char *pname, wf_fh *fhp */);
  483. Xextern void root_inspect (/* wf_req *reqp, char *arg */);
  484. Xextern void root_getattr_miss (/* wf_thrd *c */);
  485. Xextern void root_read_miss (/* wf_thrd *c */);
  486. Xextern void root_lookup_miss (/* wf_thrd *c */);
  487. Xextern void root_getuda (/* void */);
  488. Xextern void run_task (/* int (*tf)(), void *ta, func cf, void *ca */);
  489. Xextern void sched_task (/* func cf, void *ca, void *wchan */);
  490. Xextern void sched_task_atop (/* func cf, void *ca, void *wchan */);
  491. Xextern void wakeup (/* void *wchan */);
  492. Xextern void sigchld (/* int sig */);
  493. Xextern void do_task_notify (/* void */);
  494. Xextern struct hostent * parse_hostorip (/* char *str */);
  495. Xextern void srv_resolv (/* wf_srv *srvp */);
  496. Xextern wf_srv * srv_findname (/* char *name */);
  497. Xextern wf_srv * srv_findip (/* long ipaddr */);
  498. Xextern wf_conn * srv_getconn (/* wf_srvq *srvq */);
  499. Xextern wf_conn * srv_newconn (/* wf_srvq *srvq */);
  500. Xextern void srv_releaseconn (/* wf_srv *srvp, wf_conn *cp */);
  501. Xextern void srv_flag (/* wf_srv *srvp, int flag */);
  502. Xextern wf_thrd * thrd_alloc (/* void */);
  503. Xextern void thrd_watch (/* wf_thrd *thrdp */);
  504. Xextern void thrd_ignore (/* wf_thrd *thrdp */);
  505. Xextern void thrd_free (/* wf_thrd *thrdp */);
  506. Xextern void thrd_srvfailure (/* wf_srv *srvp */);
  507. Xextern void thrd_start (/* void */);
  508. Xextern void thrd_stop (/* void */);
  509. Xextern void thrd_inspect (/* wf_req *reqp */);
  510. Xextern void trace_event (/* void *handle, wf_trace *tracep */);
  511. Xextern void trace_report (/* void */);
  512. Xextern void trace_start (/* void */);
  513. Xextern void ufs_read_miss (/* wf_thrd *c */);
  514. Xextern void ufs_readdir_miss (/* wf_thrd *c */);
  515. Xextern int uip_id (/* void */);
  516. Xextern void uip_start (/* void */);
  517. Xextern qelem * q_alloc (/* void */);
  518. Xextern void q_insert (/* qelem *elem, qelem *pred */);
  519. Xextern void q_remove (/* qelem *elem */);
  520. Xextern int q_len (/* qelem *elem */);
  521. Xextern void q_allfree (/* qelem *head */);
  522. Xextern void * alloc_and_copy (/* void *v, int vlen */);
  523. Xextern void * alloc_and_clear (/* int vlen */);
  524. Xextern void alloc_start (/* void */);
  525. Xextern int mkdirs (/* char *path */);
  526. Xextern int validate_dir (/* char *dir */);
  527. Xextern void csd_abort (/* int ret */);
  528. Xextern int background (/* void */);
  529. Xextern int bind_resv_port (/* int so, unsigned short *portp */);
  530. Xextern int tcp_send (/* int so, char *fmt, ... */);
  531. Xextern int req_send (/* wf_req *reqp, char *fmt, ... */);
  532. Xextern void getdate (/* void */);
  533. Xextern void unix_command (/* char *cmd */);
  534. Xextern long compute_blocks (/* long size */);
  535. Xextern time_t tm2time (/* struct tm *tm */);
  536. Xextern char * strdup (/* Const char *str */);
  537. Xextern wf_vol * vol_alloc (/* void */);
  538. Xextern void vol_free (/* wf_vol *volp */);
  539. Xextern wf_vol * vol_findid (/* long id */);
  540. Xextern wf_vol * vol_findname (/* char *dir, char *name */);
  541. Xextern int vol_set_name (/* char *name */);
  542. Xextern int vol_set_ftp_server (/* char *hostname */);
  543. Xextern int vol_set_ftp_directory (/* char *subdir */);
  544. Xextern int vol_set_ftp_options (/* char *flagstr */);
  545. Xextern int vol_set_ufs_directory (/* char *topdir */);
  546. Xextern int vol_set_description (/* char *desc */);
  547. Xextern int vol_bind (/* char *name, char *value */);
  548. Xextern wf_vol * vol_load (/* char *dir, char *name */);
  549. Xextern void vol_save (/* wf_vol *volp */);
  550. Xextern wf_conn * vol_getconn (/* wf_vol *volp */);
  551. Xextern wf_conn * vol_newconn (/* wf_vol *volp */);
  552. Xextern void vol_releaseconn (/* wf_vol *volp */);
  553. Xextern void vol_addsrv (/* wf_vol *volp, wf_srv *srvp, char *subdir */);
  554. Xextern void vol_deletesrv (/* wf_vol *volp, wf_srv *srvp */);
  555. Xextern long vol_allocid (/* wf_vol *volp */);
  556. Xextern void vol_destroyid (/* wf_vol *volp */);
  557. Xextern wf_dir * vol_newroot (/* wf_vol *volp */);
  558. Xextern wf_dir * vol_findroot (/* wf_vol *volp */);
  559. Xextern void vol_inspect (/* wf_req *reqp, char *name */);
  560. X
  561. X#endif /* __STDC__ */
  562. X#endif /* __CEXTRACT__ */
  563. END_OF_FILE
  564.   if test 27718 -ne `wc -c <'csd/auto.h'`; then
  565.     echo shar: \"'csd/auto.h'\" unpacked with wrong size!
  566.   fi
  567.   # end of 'csd/auto.h'
  568. fi
  569. if test -f 'csd/wfs.h' -a "${1}" != "-c" ; then 
  570.   echo shar: Will not clobber existing file \"'csd/wfs.h'\"
  571. else
  572.   echo shar: Extracting \"'csd/wfs.h'\" \(13997 characters\)
  573.   sed "s/^X//" >'csd/wfs.h' <<'END_OF_FILE'
  574. X/* 
  575. X * WorldWide File System
  576. X * Copyright (c) 1992,1993 Youki Kadobayashi
  577. X * Copyright (c) 1992,1993 Osaka University
  578. X * All rights reserved.
  579. X *
  580. X * Permission to use, copy, modify and distribute this software and its
  581. X * documentation is hereby granted, provided that the following conditions
  582. X * are met:
  583. X * 1. Both the copyright notice and this permission notice appear in
  584. X *    all copies of the software, derivative works or modified versions,
  585. X *    and any portions thereof, and that both notices appear in
  586. X *    supporting documentation.
  587. X * 2. All advertising materials mentioning features or use of this software
  588. X *    must display the following acknowledgement:
  589. X *      This product includes software developed by the Osaka University
  590. X *      and its contributors.
  591. X * 3. Neither the name of the University nor the names of its contributors
  592. X *    may be used to endorse or promote products derived from this software
  593. X *    without specific prior written permission.
  594. X *
  595. X * THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND OSAKA
  596. X * UNIVERSITY DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  597. X * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  598. X *
  599. X * Osaka University requests users of this software to return to
  600. X *
  601. X *  Youki Kadobayashi
  602. X *  Department of Information and Computer Sciences
  603. X *  Osaka University, Toyonaka 560, Osaka, Japan
  604. X *
  605. X * any improvements or extensions that they make and grant Osaka
  606. X * University the rights to redistribute these changes.
  607. X */
  608. X/* $Header: wfs.h[109.0] Wed Nov 24 03:47:20 1993 youki-k@is.aist-nara.ac.jp saved $ */
  609. X
  610. X#include <sys/types.h>
  611. X#include <sys/param.h>
  612. X#include <sys/socket.h>
  613. X#include <rpc/rpc.h>
  614. X#ifndef IPPROTO_UDP
  615. X#include <netinet/in.h>
  616. X#endif
  617. X#include <arpa/inet.h>
  618. X#include "nfs_prot.h"
  619. X#include "cs_prot.h"
  620. X#define WFS_H
  621. X#include "parse.h"
  622. X
  623. Xtypedef enum {
  624. X    Start,
  625. X    Run,
  626. X    Finishing,
  627. X    Quit,
  628. X    Done
  629. X} serv_state;
  630. X
  631. Xtypedef struct sockaddr_in sockaddr_in;
  632. Xtypedef void (*func)();
  633. Xtypedef struct svc_req svc_req;
  634. X
  635. X/*
  636. X * Linked list
  637. X */
  638. Xtypedef struct qelem qelem;
  639. Xstruct qelem {
  640. X    qelem *q_forw;
  641. X    qelem *q_back;
  642. X};
  643. X#define FIRST(ty, q)    ((ty *) ((q)->q_forw))
  644. X#define LAST(ty, q)    ((ty *) ((q)->q_back))
  645. X#define NEXT(ty, q)    ((ty *) (((qelem *) q)->q_forw))
  646. X#define PREV(ty, q)    ((ty *) (((qelem *) q)->q_back))
  647. X#define HEAD(ty, q)    ((ty *) q)
  648. X#define MORE(q)        ((q)->q_forw != q)
  649. X#define ITER(v, ty, q) \
  650. X    for ((v) = FIRST(ty,(q)); (v) != HEAD(ty,(q)); (v) = NEXT(ty,(v)))
  651. X#define REVITER(v, ty, q) \
  652. X    for ((v) = LAST(ty,(q)); (v) != HEAD(ty,(q)); (v) = PREV(ty,(v)))
  653. X#define ITER2(v, w, ty, q) \
  654. X    for ((v) = FIRST(ty, (q)); (w) = NEXT(ty, (v)), (v) != HEAD(ty, (q)); \
  655. X         (v) = (w))
  656. X
  657. X/* protocol switch & protocol spec */
  658. Xtypedef struct wf_proto {
  659. X    char        *name;        /* protocol name */
  660. X    func        wf_getattr;
  661. X    func        wf_getattr_miss;
  662. X    func        wf_lookup;
  663. X    func        wf_lookup_miss;
  664. X    func        wf_readlink;
  665. X    func        wf_read;
  666. X    func        wf_read_miss;
  667. X    func        wf_readdir;
  668. X    func        wf_readdir_miss;
  669. X    func        wf_getuda;    /* user defined attributes */
  670. X    func        wf_keepalive;
  671. X    func        wf_close;
  672. X    func        wf_shutdown;
  673. X    int        class;        /* protocol class, WF_CLASS */
  674. X} wf_proto;
  675. X
  676. X/* wf_proto->class bitmap */
  677. X#define WF_CLASS_AUTH    0x1    /* authentication */
  678. X#define WF_CLASS_ALIVE    0x2    /* keepalive */
  679. X#define WF_CLASS_RD    0x4    /* reliable delivery */
  680. X
  681. X/* to compute padding */
  682. Xstruct wf_fhsize {
  683. X    long    a;
  684. X    long    b;
  685. X    long    c;
  686. X    long    d;
  687. X    long    e;
  688. X};
  689. X
  690. X/* file handle */
  691. Xtypedef struct wf_fh {
  692. X    long    world_id;    /* filehandle type and version */
  693. X    long    parent_vol;    /* unique in the world */
  694. X    long    child_vol;    /* unique in the world */
  695. X    union {
  696. X        struct {
  697. X            long    u_dir_id;    /* inode */
  698. X            long    u_file_id;    /* crc */
  699. X        } u_file;
  700. X        struct {
  701. X            long    u_parent_dir;    /* inode# of parent dir */
  702. X            long    u_child_dir;    /* inode# of child dir */
  703. X        } u_dir;
  704. X    } u;
  705. X    char    padding[NFS_FHSIZE - sizeof(struct wf_fhsize)];
  706. X} wf_fh;
  707. X
  708. X#define    dir_id        u.u_file.u_dir_id
  709. X#define    file_id        u.u_file.u_file_id
  710. X#define    parent_dir    u.u_dir.u_parent_dir
  711. X#define    child_dir    u.u_dir.u_child_dir
  712. X
  713. Xtypedef struct wf_srvstat {
  714. X    long    bytes_to_server;    /* # of bytes sent to servers */
  715. X    long    bytes_from_server;    /* # of bytes received from servers */
  716. X    long    rtt;            /* round trip time with decay */
  717. X    long    icmp_reply;        /* # of successful echo-reply */ 
  718. X    long    icmp_unreach;        /* # of dest unreach */
  719. X} wf_srvstat;
  720. X
  721. Xtypedef struct wf_connq wf_connq;
  722. X/* per-server information */
  723. Xtypedef struct wf_srv {
  724. X    qelem        q;
  725. X    char        *name;        /* server name */
  726. X    sockaddr_in    sin;        /* network address */
  727. X    int        flag;        /* server status, WF_SRV */
  728. X    long        touch;        /* time of last status change */
  729. X    int        protos;        /* supported protocols, WF_PROTO */
  730. X    long        variant;    /* extension flags, WF_XYZFS */
  731. X    wf_connq    *connq;        /* connections for this server */
  732. X    int        nconn;        /* number of connections */
  733. X    wf_srvstat    stats;        /* per-server statistics */
  734. X} wf_srv;
  735. X
  736. X/* per-volume-server information */
  737. Xtypedef struct wf_srvq {
  738. X    qelem    q;
  739. X    wf_srv    *srv;
  740. X    void    *info;        /* protocol specific */
  741. X} wf_srvq;
  742. X
  743. X/* wf_srv->flag */
  744. X#define    WF_SRV_HUNREACH    0x1    /* server unreachable */
  745. X#define    WF_SRV_NUNREACH    0x2    /* network unreachable */
  746. X#define    WF_SRV_REFUSED    0x4    /* connection refused */
  747. X#define    WF_SRV_XABORT    0x8    /* transfer aborted */
  748. X#define    WF_SRV_TIMEOUT    0x10    /* transfer timeout */
  749. X#define    WF_SRV_BADNS    0x20    /* name-server problem */
  750. X
  751. X/* wf_srv->protos bitmap */
  752. X#define WF_PROTO_FTP    0x1    /* file transfer protocol */
  753. X#define WF_PROTO_NFSUDP    0x2    /* sun NFS over UDP */
  754. X#define WF_PROTO_NFSTCP    0x4    /* sun NFS over TCP */
  755. X#define WF_PROTO_YFS    0x8    /* youki file system */
  756. X
  757. X/* wf_srv->variant bitmap */
  758. X#define WF_FTP_FOLLOW    0x1    /* follow symbolic links */
  759. X#define WF_FTP_NOSTAT    0x2    /* FTP does not support STAT */
  760. X#define WF_NFS_SPONGY    0x4    /* NFS spongy mount */
  761. X#define WF_NFS_COMPRESS    0x8    /* NFS compress */
  762. X
  763. X#define    WF_SRV_MAXCONN    16        /* max # of connection for a server */
  764. X
  765. Xtypedef struct wf_connstat {
  766. X    long    bytes_to_server;    /* # of bytes sent to servers */
  767. X    long    bytes_from_server;    /* # of bytes received from servers */
  768. X} wf_connstat;
  769. X
  770. Xtypedef struct wf_thrd wf_thrd;
  771. X/* per-connection information (server side) */
  772. Xtypedef struct wf_conn {
  773. X    qelem        q;
  774. X    wf_proto    *proto;        /* protocol used */
  775. X    int        id;        /* connection id */
  776. X    wf_thrd        *thrdp;        /* transfer */
  777. X    int        idle;        /* idle time */
  778. X    wf_srv        *srv;        /* peer entity */
  779. X    wf_connstat    stats;        /* per-connection statistics */
  780. X    void        *info;        /* protocol specific */
  781. X} wf_conn;
  782. X
  783. X/* list of per-connection information */
  784. Xstruct wf_connq {
  785. X    qelem    q;
  786. X    wf_conn    *conn;
  787. X};
  788. X
  789. X/* per-session information (client side); primarily for non-RPC protocols */
  790. Xtypedef struct wf_req {
  791. X    long        id;        /* session ID */
  792. X    int        so;        /* socket */
  793. X    sockaddr_in    sin;        /* client address */
  794. X    int        flag;        /* flags */
  795. X} wf_req;
  796. X
  797. X#define    WF_REQ_PRIV    0x01        /* privileged connection */
  798. X
  799. X/* access control information */
  800. Xtypedef struct wf_acc {
  801. X    qelem        q;
  802. X    unsigned long    from;        /* lower bound (host byte order) */
  803. X    unsigned long    to;        /* upper bound (host byte order) */
  804. X    long        flag;        /* WF_ACC_ */
  805. X} wf_acc;
  806. X
  807. X#define    WF_ACC_NFS    0x1
  808. X#define    WF_ACC_UIP    0x2
  809. X#define    WF_ACC_FDP    0x4
  810. X#define    WF_ACC_RAW    0x8
  811. X
  812. Xtypedef struct wf_volstat {
  813. X    long    bytes_to_server;    /* # of bytes sent to servers */
  814. X    long    bytes_from_server;    /* # of bytes received from servers */
  815. X    long    bytes_to_client;    /* # of bytes sent to clients */
  816. X    long    bytes_from_client;    /* # of bytes received from clients */
  817. X    long    n_request_readdir;    /* # of readdir requests */
  818. X    long    n_request_lookup;    /* # of lookup requests */
  819. X    long    n_request_read;        /* # of read requests */
  820. X    long    n_request_readdir_miss;    /* # of readdir actually done */
  821. X    long    n_request_lookup_miss;    /* # of lookup actually done */
  822. X    long    n_request_read_miss;    /* # of read actually done */
  823. X} wf_volstat;
  824. X
  825. Xtypedef struct wf_dir wf_dir;
  826. X/* list of per-volume information */
  827. Xtypedef struct wf_vol {
  828. X    qelem        q;
  829. X    char        *name;        /* volume name */
  830. X    long        id;        /* volume id */
  831. X    char        *dir;        /* directory this volume resides */
  832. X    wf_acc        *accp;        /*   and its access control info */
  833. X    int        flag:16;    /* status */
  834. X    int        nconn:16;    /* number of connections */
  835. X    long        mtime;        /* timestamp of volume update */
  836. X    wf_srvq        *srvq;        /* servers of this volume */
  837. X    wf_dir        *dirp;        /* cached directory chain */
  838. X    wf_thrd        *thrdp;        /* transfer */
  839. X    char        *topdir;    /* for WF_VOL_DIRECTFILE */
  840. X    wf_volstat    stats;        /* per-volume statistics */
  841. X} wf_vol;
  842. X
  843. X/* wf_vol->flag */
  844. X#define    WF_VOL_XCONN        0x1    /* exceeded connection limit */
  845. X#define    WF_VOL_DIRECTFILE    0x2    /* bypass file caching mechanism */
  846. X
  847. X/* constants */
  848. X#define    WF_VOL_MAXCONN    4    /* max # of connection for a volume */
  849. X#define    WF_VOL_BASE    0x10000    /* large enough so that volume IDs can be
  850. X                 * discriminated from directory ID */
  851. X#define    WF_GLUE_BASE    0x8000    /* large enough so that glue IDs can be
  852. X                 * discriminated from directory ID */
  853. X#define    WF_ROOT_VOL_ID    0    /* root file system */
  854. X#if 0
  855. X#define    WF_HOST_VOL_ID    (-1)    /* ".wwfs_host" */
  856. X#define    WF_CWD_VOL_ID    (-2)    /* ".wwfs_cwd" */
  857. X#endif
  858. X#define    WF_FH_VOL_ID    (-3)    /* ".wwfs_fh" */
  859. X
  860. X/* list of per-file information */
  861. Xtypedef struct wf_file {
  862. X    qelem    q;
  863. X    char    *name;        /* filename */
  864. X    char    *link;        /* symbolic link */
  865. X    long    id;        /* file id (crc32 or inode #) */
  866. X    long    crc;        /* crc32 */
  867. X    int    flag;        /* WF_FILE */
  868. X    struct fattr fattr;    /* see nfs_prot.h */
  869. X    wf_thrd    *thrdp;        /* transfer */
  870. X} wf_file;
  871. X
  872. X/* wf_file->flag */
  873. X#define WF_FILE_MARKED        0x1
  874. X#define    WF_FILE_MUTABLE        0x2
  875. X
  876. X/* wrapper macros for this complex data structure */
  877. X#define    FSID(p)        ((p)->fattr.fsid)
  878. X#define    FID(p)        ((p)->id)
  879. X
  880. X/* list of per-directory information */
  881. Xstruct wf_dir {
  882. X    qelem    q;
  883. X    char    *name;        /* entire directory name */
  884. X    long    id;        /* directory id (inode #) */
  885. X    int    flag;        /* WF_DIR */
  886. X    int    idle;        /* idle time */
  887. X    long    ctime;        /* when this id was allocated */
  888. X    wf_file    *file;        /* files in this directory */
  889. X    int    n_xfer;        /* # of ongoing transfer */
  890. X};
  891. X
  892. X#define    WF_ROOT_DIR_ID    0xffff
  893. X
  894. X/* wf_dir->flag */
  895. X#define    WF_DIR_OBSOLETE        0x1
  896. X#define    WF_DIR_WIREDDOWN    0x2
  897. X
  898. Xtypedef struct wf_ih {        /* internal handle */
  899. X    wf_vol    *parent_volp;
  900. X    wf_dir    *dirp;
  901. X    wf_vol    *child_volp;
  902. X    wf_file    *filep;
  903. X} wf_ih;
  904. X
  905. X/* for filesystem trace */
  906. Xtypedef struct wf_trace {
  907. X    qelem    q;
  908. X    long    cookie;        /* unique id */
  909. X    long    time;        /* timestamp */
  910. X    int    uid;        /* user id */
  911. X    long    client;        /* client ip address */
  912. X    long    volume;        /* volume id */
  913. X    long    dir;        /* directory id */
  914. X    long    file;        /* file id */
  915. X    int    op:16;        /* operation. read(0) or readdir(1) */
  916. X    int    hit:16;        /* cache hit(1) or miss(0) */
  917. X    long    arg;        /* file size etc. */
  918. X} wf_trace;
  919. X
  920. X/* wf_trace->op */
  921. X#define    WF_OP_READ        0
  922. X#define    WF_OP_READDIR        1
  923. X/* wf_trace->hit */
  924. X#define    WF_CACHE_MISS        0
  925. X#define    WF_CACHE_HIT        1
  926. X#define    WF_CACHE_READY        2
  927. X
  928. Xtypedef struct callout callout;
  929. X/* Unified closure.
  930. X * Represents all information about currently processing request.
  931. X */
  932. Xstruct wf_thrd {
  933. X    qelem        q;
  934. X    int        step:16;    /* state of this thread */
  935. X    int        flag:16;    /* WF_THREAD */
  936. X    /* nfs args */
  937. X    svc_req        *rqstp;
  938. X    wf_vol        *parent_volp;
  939. X    wf_vol        *child_volp;
  940. X    wf_fh        *fhp;
  941. X    char        *fname;
  942. X    nfscookie    cookie;        /* nfs_readdir */
  943. X    u_int        offset;        /* nfs_read */
  944. X    u_int        count;        /* nfs_readdir, nfs_read */
  945. X    u_int        totalcount;    /* nfs_read */
  946. X    /* state */
  947. X    wf_fh        *resfhp;
  948. X    wf_dir        *dirp;
  949. X    wf_dir        *olddirp;
  950. X    wf_dir        *dotdotp;
  951. X    wf_file        *filep;
  952. X    /* for user-interface protocols */
  953. X    wf_req        req;        /* deepcopy here */
  954. X    char        *pathname;    /* deepcopy full pathname */
  955. X    int        uid;        /* user id, for trace */
  956. X    unsigned long    client;        /* ip address, for trace */
  957. X    /* transfer state */
  958. X    wf_proto    *proto;
  959. X    wf_conn        *cp;        /* connection for this request */
  960. X    int        so;        /* data connection socket */
  961. X    int        port;        /* port for data connection */
  962. X    int        fd;        /* received data */
  963. X    char        *buf;        /* received data */
  964. X    int        bytes;        /* done so far */
  965. X    int        idle;        /* risky but no response */
  966. X    func        reply;        /* reply to client */
  967. X    func        give_up;    /* encountered difficulty */
  968. X    void        *closure;    /* for give_up */
  969. X    callout        *callout;    /* timeout handle (opaque) */
  970. X};
  971. X
  972. X/* wf_thrd->flag bitmap */
  973. X#define WF_THREAD_BUSY        0x1
  974. X#define WF_THREAD_TIMEOUT    0x2    /* 2: timeout, ~2: in time */
  975. X#define WF_THREAD_RISKY        0x4    /* 4: risky, ~4: safe */
  976. X#define WF_THREAD_ERROR        0x8    /* 8: error, ~8: no error */
  977. X
  978. X/* wf_thrd->step FSM  */
  979. X#define    FTPS_PROMPT        0
  980. X#define    FTPS_STAT_RECV        1
  981. X#define    FTPS_STAT_RECVINIT    2
  982. X#define    FTPS_STAT_RECVLOOP    3
  983. X#define    FTPS_RETR_SEND        4
  984. X#define    FTPS_PORT_ACCEPT    5
  985. X#define    FTPS_RETR_RECVINIT    6
  986. X#define    FTPS_RETR_RECVLOOP    7
  987. X#define    FTPS_RETR_FIN        8
  988. X#define    FTPS_CONN_INIT        10
  989. X#define    FTPS_CONN_USER        11
  990. X#define    FTPS_CONN_PASS        12
  991. X#define    FTPS_CONN_TYPE        13
  992. X#define    FTPS_CONN_FIN        14
  993. X#define    FTPS_CONN_FAIL        15
  994. X
  995. X/* unified error code. limited to internal use. */
  996. X#define    WF_REP_OK    0        /* no error */
  997. X#define    WF_ERR_PERM    1        /* Not owner */
  998. X#define    WF_ERR_NOENT    2        /* No such entity */
  999. X#define    WF_ERR_IO    3        /* I/O error */
  1000. X#define    WF_ERR_NXIO    4        /* No such device or address */
  1001. X#define    WF_ERR_ACCES    5        /* Permission denied */
  1002. X#define    WF_ERR_EXIST    6        /* Given resource exists */
  1003. X#define    WF_ERR_NODEV    7        /* No such device */
  1004. X#define    WF_ERR_NOTDIR    8        /* Not a directory*/
  1005. X#define    WF_ERR_ISDIR    9        /* Is a directory */
  1006. X#define    WF_ERR_FBIG    10        /* Resource too large */
  1007. X#define    WF_ERR_NOSPC    11        /* No space left on device */
  1008. X#define    WF_ERR_ROFS    12        /* Read-only file system */
  1009. X#define    WF_ERR_NAMETOOLONG    13    /* Resource name too long */
  1010. X#define    WF_ERR_NOTEMPTY    14        /* Directory not empty */
  1011. X#define    WF_ERR_DQUOT    15        /* Disc quota exceeded */
  1012. X#define    WF_ERR_STALE    16        /* Stale file handle */
  1013. X#define    WF_ERR_WFLUSH    17        /* Write cache flushed */
  1014. X#define    WF_REP_WAIT    18        /* Operation would block */
  1015. X#define    WF_ERR_ALREADY    19        /* Operation already in progress */
  1016. X#define    WF_ERR_PROTO    20        /* Protocol not available */
  1017. X#define    WF_ERR_NDOWN    21        /* Network is down */
  1018. X#define    WF_ERR_NUNREACH    22        /* Network is unreachable */
  1019. X#define    WF_ERR_XABORT    23        /* Transfer aborted */
  1020. X#define    WF_ERR_TIMEOUT    24        /* Connection timed out */
  1021. X#define    WF_ERR_REFUSED    25        /* Connection refused */
  1022. X#define    WF_ERR_HDOWN    26        /* Host is down */
  1023. X#define    WF_ERR_HUNREACH    27        /* No route to host */
  1024. X#define    WF_ERR_NQUOT    28        /* Network quota exceeded */
  1025. END_OF_FILE
  1026.   if test 13997 -ne `wc -c <'csd/wfs.h'`; then
  1027.     echo shar: \"'csd/wfs.h'\" unpacked with wrong size!
  1028.   fi
  1029.   # end of 'csd/wfs.h'
  1030. fi
  1031. if test -f 'doc/manual.tex' -a "${1}" != "-c" ; then 
  1032.   echo shar: Will not clobber existing file \"'doc/manual.tex'\"
  1033. else
  1034.   echo shar: Extracting \"'doc/manual.tex'\" \(43575 characters\)
  1035.   sed "s/^X//" >'doc/manual.tex' <<'END_OF_FILE'
  1036. X\documentstyle[11pt,ascmac,a4wide,epsf]{book}
  1037. X\input{version.tex}
  1038. X\title{{\bf WWFS Reference Manual} \\
  1039. X        version \wwfsversion}
  1040. X\author{        Youki Kadobayashi \\
  1041. X                {\tt youki@wide.ad.jp} \\
  1042. X                Department of Information and Computer Sciences \\
  1043. X                Osaka University, Japan}
  1044. X
  1045. X\newcommand{\ID}{{\sc id}}
  1046. X\font\tentt = cmtt9
  1047. X\font\elvtt = cmtt10
  1048. X
  1049. X\begin{document}
  1050. X\maketitle
  1051. X\tableofcontents
  1052. X
  1053. X\chapter{Introduction}
  1054. X
  1055. X% \begin{quote}
  1056. X% {\it Although I have tried to describe every aspects of WWFS in this
  1057. X% document, there may be syntactically incorrect sentences and strange
  1058. X% wording.  If you have any comments or suggestions on this document,
  1059. X% please send e-mail to the alpha-testers mailing list. Instructions for
  1060. X% feedback are given in Section \ref{contrib_send}.}
  1061. X% \end{quote}
  1062. X
  1063. X\section{Description}
  1064. X
  1065. X% What is WWFS?
  1066. XWWFS (WorldWide File System, or Waku-Waku File System) is a filesystem
  1067. Xwhich extends NFS over the Internet, while achieving simplicity,
  1068. Xscalability, and compatibility.
  1069. X% What can I do with it?
  1070. XWWFS users can access existing FTP archives without expert knowledge
  1071. Xof the Internet and other network applications.
  1072. X
  1073. X% Who can use it?
  1074. X% Why shall I use it?
  1075. XWWFS is not wizard's vehicle.  It eliminates burden of users and
  1076. Xnetwork administrators. There is no need to worry about hostname,
  1077. Xpathname, or geographical location of the host. Once network
  1078. Xadministrator arranged ``volumes'' for you, it's no longer necessary
  1079. Xto remember the details of FTP archives. Also, WWFS supports network
  1080. Xadministrators by letting them estimate, optimize or regulate file
  1081. Xtransfer.
  1082. X
  1083. X% How to use it?
  1084. XWWFS is not technology with another dozen buzzword.  Every existing
  1085. XUNIX command works fine, just as ordinary UNIX file systems, apart
  1086. Xfrom some strange behaviors resulting from large delays in the
  1087. XInternet.  Because it is built on top of a filesystem, many existing
  1088. Xcommand works fine with little or no modification; MULE does great job
  1089. Xwith dozen Emacs lisp jewels, and NCSA {\sc Mosaic} now saves your
  1090. Xtime and network bandwidth with
  1091. Xdirect WWFS support.
  1092. X% Where can I use it?
  1093. XYou can use it ``off-the-shelf'', without any modification to the UNIX
  1094. Xkernel. Server and client runs on a number of BSD-derivatives, since I
  1095. Xused widely available features only. Client workstations require
  1096. Xminimal addition: {\tt wwmount} and {\tt wwumount}, which is modified
  1097. Xversions of mount/unmount commands. With the cluster server ({\tt
  1098. X  csd}) running on a well-endowed, well-managed machine, everyone can
  1099. Xshare those cached information with little performance overhead.
  1100. X
  1101. X% When can I use it?
  1102. XSo just try it.  It's technology of today --- enabling future
  1103. Xapplications to come out now.
  1104. X
  1105. X\begin{figure}
  1106. X\begin{center}
  1107. X\epsfile{file=overview.eps,scale=0.7}
  1108. X\end{center}
  1109. X\caption{Cluster Server: An NFS server, an NFS-FTP gateway software,
  1110. Xor the Internet file cache.}
  1111. X\label{fig_overview}
  1112. X\end{figure}
  1113. X
  1114. X\section{Organization of this distribution}
  1115. X
  1116. XThis release contains source code and documentation for our
  1117. Xintermediary file-server software named Cluster Server ({\tt csd}),
  1118. Xclient software, direct WWFS support in NCSA {\sc Mosaic} for X, API
  1119. X(application programming interface), API examples,
  1120. X% sample graphical user interface written in Tk,
  1121. Xsome perl scripts for administration, and volume files for variety of
  1122. Xinformation resources in the Internet.
  1123. X
  1124. XDirectories are organized as follows:
  1125. X
  1126. X\begin{itemize}
  1127. X\item   {\tt caps/} \\
  1128. X  {\tt perl} scripts and shell scripts.
  1129. X  CAPS stands for Client Administration Perl Scripts.
  1130. X\item   {\tt config/} \\
  1131. X  Machine-, architecture- and operating-system dependent files.
  1132. X\item {\tt csd/} \\
  1133. X  An NFS server, an NFS-FTP gateway software, the Internet file cache,
  1134. X  or the substrate for scalable information systems, that runs as a
  1135. X  daemon in the user mode.  Modification to the UNIX kernel is not
  1136. X  necessary at all.  It can be accessed as an ordinary NFS server from
  1137. X  virtually any client workstations with NFS capability. It talks with
  1138. X  anonymous ftp servers using FTP protocol (see Figure
  1139. X  \ref{fig_overview}).
  1140. X\item   {\tt doc/} \\
  1141. X  Documentation, both finished and unfinished, including
  1142. X  memorandum and preliminary ideas.
  1143. X  Some may be only useful to interested developers.
  1144. X\item   {\tt gtr/} \\
  1145. X  A package to rearrange servers by geographical / topological region.
  1146. X\item   {\tt include/} \\
  1147. X  Header files for C programs.
  1148. X\item   {\tt libww/} \\
  1149. X  Application programming interface, for bypassing NFS when necessary.
  1150. X\item {\tt mosaic/} \\
  1151. X  Patches to add direct WWFS support to NCSA {\sc Mosaic} for X,
  1152. X  the multi-protocol information browser.  Also included here are
  1153. X  migration tools from Internet Gopher Protocol and HyperText
  1154. X  Transfer Protocol.
  1155. X\item   {\tt mule/} \\
  1156. X  Emacs lisp package to access WWFS within multi-lingual EMACS.
  1157. X\item   {\tt rpc/} \\
  1158. X  Subroutines for remote procedure call.
  1159. X\item   {\tt saps/} \\
  1160. X  SAPS stands for Server Administration Perl Scripts;
  1161. X  some of which has been used for day-to-day server administration.
  1162. X\item {\tt vol/} \\
  1163. X  Volume files, that describe server-to-location mappings
  1164. X  and alternative servers.
  1165. X\item {\tt wwalk/} \\
  1166. X  Point-and-click style graphical user interface,
  1167. X  which is actually a rework of my good-old-days Tk script. You need
  1168. X  Tk2.3, TclX6.4c, and tclRawTCP-1.0 to run this script. {\em It's not
  1169. X    updated in this release.} If you don't know what Tcl and Tk is,
  1170. X  just get the {\tt comp.lang.tcl} FAQ from USENET newsgroups (or just
  1171. X  go to {\tt /news.answers/tcl-faq} on WWFS).
  1172. X\item {\tt wwmount/} \\
  1173. X  A modified version of {\tt mount} and {\tt umount} command, based on
  1174. X  BSD Net2.
  1175. X\end{itemize}
  1176. X
  1177. X\begin{figure}[h]
  1178. X\begin{center}
  1179. X\epsfile{file=architecture.eps,scale=0.6}
  1180. X\end{center}
  1181. X\caption{WWFS: shared namespace, replicated services, binding mechanism,
  1182. Xand right protocol for the right place.}
  1183. X\label{fig_architecture}
  1184. X\end{figure}
  1185. X
  1186. X\chapter{Installation}
  1187. X
  1188. XThis chapter describes installation procedure of this software suite.
  1189. XBefore beginning installation, you must make sure that you have
  1190. Xnecessary tools handy, then decide where you install this software.
  1191. X
  1192. X\section{Bootstrapping environments}
  1193. X
  1194. XThe following tools are necessary to generate executables
  1195. Xand to perform administrative tasks:
  1196. X
  1197. X\medskip
  1198. X\begin{tabular}{|l|l|} \hline
  1199. Xname            & requirements \\ \hline
  1200. Xmake            & bundled {\tt make}, or GNU {\tt make}. \\
  1201. Xcc              & bundled {\tt cc}, or GNU {\tt cc}. \\
  1202. Xperl            & version 4.0 or later. \\ \hline
  1203. X\end{tabular}
  1204. X\medskip
  1205. X
  1206. XBasically any brain-damaged {\tt make} should work.  If it doesn't work,
  1207. Xplease let me know.
  1208. X
  1209. XIf you are planning to make {\sc Mosaic/WWFS}, you will need Motif/X11
  1210. Xlibraries.  You can grab binaries from {\tt WWFS/binaries} on WWFS and
  1211. Xoriginal Mosaic source from {\tt NCSA/Web/Mosaic-source} on WWFS.
  1212. X
  1213. XIf you are planning to hack {\tt wwalk}, a point-and-click style
  1214. Xdirectory browser for the X Window System, you need Tcl and Tk.  Note
  1215. Xthat this stuff is no longer maintained up to date.  Bunch of Tcl
  1216. Xstuff is available from {\tt tcl-tk} on WWFS.
  1217. X
  1218. XIf you are willing to adapt, improve or port this software by
  1219. Xyourself, I strongly recommend the use of GNU software suite to
  1220. Xfacilitate development. If you are planning to modify the source code,
  1221. XI recommend the use of additional tools which I have been using for
  1222. Xday-to-day programming tasks:
  1223. X
  1224. X\medskip
  1225. X\begin{tabular}{|l|l|} \hline
  1226. Xname            & description \\ \hline
  1227. Xcextract        & C prototype extractor \\
  1228. Xgdb             & GNU debugger \\
  1229. Xlsof            & process file-table inspector \\
  1230. Xmalloclib       & malloc debugging library \\
  1231. Xmkid            & source code indexing tool \\
  1232. Xrpcsrc-4.0      & Sun RPC source \\ \hline
  1233. X\end{tabular}
  1234. X\medskip
  1235. X
  1236. XOther brand-new tools or commercial programming environments might be
  1237. Xof great help. I am very much interested to share any programming tips
  1238. Xwith other developers (preferably via mailing list).
  1239. X
  1240. X\section{Planning server installation}
  1241. X\label{install_plan}
  1242. X
  1243. X% Determine the size of the cache -- other extras isn't significant
  1244. XNow you must determine where to put related material. You need
  1245. Xsufficient amount of storage because our daemon cache accessed files.
  1246. XNecessary storage space varies depending on the number of users, user
  1247. Xactivity, and granularity of cached files, but you can start with
  1248. Xrelatively small space (e.g., 40Mbytes) and change the partition
  1249. Xlater, when demands exceed supply.  Other extras, such as logs and
  1250. Xmaintenance scripts, do not occupy much space as compared with cache
  1251. Xdirectories.
  1252. X
  1253. X% Make the cache partition and mount it if you want -- optional
  1254. XIf you have a relatively large empty partition available and you are
  1255. Xplanning to use WWFS regularly, it would be better to allocate the
  1256. Xentire partition to WWFS, since cache occasionally grows quickly when
  1257. Xusers access WWFS in a sudden burst\footnote{Also, WWFS has had a
  1258. X  strange bug which filled up entire partition, although it was known
  1259. X  to be harmless and is now exterminated.}. If you are planning to
  1260. Xadopt this option, simply {\tt newfs} it, create mountpoint and {\tt
  1261. X  mount} it as usual. No special operation is necessary since the
  1262. Xcaching mechanism is built on top of UNIX file system.
  1263. X
  1264. X% Make appropriately named directory for WWFS
  1265. XWWFS requires a directory tree to store various information. Name the
  1266. Xtop directory appropriately (e.g., {\tt /var/wwfs}) and make sure it
  1267. Xis writable by root. It can reside either on a local disk or on an
  1268. XNFS-mounted disk, but I recommend the use of local disk for better
  1269. Xreliability and performance.
  1270. X
  1271. X\section{Installing the Cluster Server}
  1272. X\label{install_server}
  1273. X
  1274. XThe {\tt csd} included in this release is known to work on the
  1275. Xfollowing platforms:
  1276. X
  1277. X\medskip
  1278. X\begin{tabular}{|l|l|} \hline
  1279. X        hardware        & operating system \\ \hline
  1280. X        Sun [34]        & Sun OS 4.1.[123] \\
  1281. X        DECstation      & Ultrix 4.3 \\
  1282. X        Gateway 2000    & BSD/386 \\
  1283. X        OMRON Luna 2    & BSD / Mach 2.5 \\
  1284. X        SUMI STATION    & RISC/os 4.x \\
  1285. X        Sony NEWS       & NEWS-OS 4.[012] \\ \hline
  1286. X\end{tabular}
  1287. X\medskip
  1288. X
  1289. XBasically any 4.3BSD, 4.4BSD or OSF/1 machines is OK (well, supposed to be).
  1290. X
  1291. XThis software is not tested on other platforms. Port to other
  1292. Xplatforms will be easy however, if the target platform implements Sun
  1293. XNFS, the Berkeley family of filesystems (FFS or FFFS) and 4.[34]BSD
  1294. Xsystem calls.  I haven't made further attempt to port this software to
  1295. Xmore esotelic platforms (largely due to lack of motivation for it and
  1296. Xfamiliarity with unseen beasts), but I hope we can support many more
  1297. Xplatforms without pain.
  1298. X
  1299. X\subsection{Edit {\tt csd.conf} and {\tt Makefile.config}}
  1300. X
  1301. XIf you are using one of these supported platforms, skip to the next
  1302. Xparagraph.  If you are not, then read comments in the {\tt
  1303. X  config/Makefile.config} and edit flags accordingly.  There are lots
  1304. Xof configuration files in the {\tt config/} directory, which has been
  1305. Xmostly stolen from the {\tt amd}, the 4.4 BSD automounter.  If your
  1306. Xplatform has been supported by the {\tt amd}, you can avoid
  1307. Xre-inventing the wheel by starting there.
  1308. X
  1309. XNext, modify {\tt config/csd.conf} to reflect your decision in Section
  1310. X\ref{install_plan}.  Let us call it {\tt WWFSDIR}.  {\tt csd.conf} is
  1311. Xreferenced by various utilities including make, shell scripts, perl
  1312. Xscripts and tcl scripts.
  1313. X
  1314. X\subsection{Just type {\tt make}}
  1315. X
  1316. XAt the top directory of the distribution, just type {\tt make}.  It
  1317. Xautomagically guesses your architecture and operating system.
  1318. X
  1319. X{\tt make} will start compilation, and eventually generate the server
  1320. Xprogram ({\tt csd}) and client commands ({\tt wwmount} and {\tt
  1321. X  wwumount}), among other things. You can ignore a lot of warnings
  1322. Xduring compilation procedure, especially if your compiler conform to
  1323. Xthe ANSI standard.
  1324. X
  1325. XNOTE: It's not desirable to hand-edit C files generated by {\tt
  1326. X  rpcgen}.  If you have encountered any difficulty with compiling
  1327. X\verb+*_prot_*.c+ files, you must regenerate these files using {\tt
  1328. X  rpcgen}.  To do this, step down to {\tt rpc/} then just type {\tt
  1329. X  make}.
  1330. X
  1331. X\subsection{Edit {\tt /etc/passwd}}
  1332. X
  1333. XIf this is the first time for your server installation, you must
  1334. Xcreate a local account with user \ID\ {\tt wwfs} and group \ID\ {\tt
  1335. X  operator} (or its counterpart in your system), at the machine
  1336. Xdesignated as your cluster server, since {\tt csd} operates under this
  1337. Xaccount, and since all files and directories beneath {\tt WWFSDIR}
  1338. Xwill be owned by the account.  Choice of user \ID\ and group \ID\ is
  1339. Xarbitrary, but you must choose \ID s carefully so that other
  1340. Xfilesystems can be protected from unexpected behaviour of {\tt csd}
  1341. X(which is very unlikely though, but serious admins wants firewall).
  1342. XAn excerpt from our password database follows.
  1343. X\begin{verbatim}
  1344. Xwwfs:*:40:5:WWFS manager:/var/wwfs:/bin/csh
  1345. X\end{verbatim}
  1346. X
  1347. XSince {\tt csd} uses {\tt wwfs@name.of.this.machine} for e-mail
  1348. Xaddress, this account should be reachable by e-mail and every received
  1349. Xmessage should be forwarded to the administrator. The e-mail address
  1350. Xhas been used for statistics reports and password (contact address,
  1351. Xthat is) for anonymous ftp login.
  1352. X
  1353. X\subsection{\tt make install-server}
  1354. X
  1355. XAs root, go to the top directory of the distribution, then type:
  1356. X\begin{verbatim}
  1357. Xmake install-server
  1358. X\end{verbatim}
  1359. XThis will install the {\tt csd} and shell/perl scripts appropriately,
  1360. Xcreating the following directories beneath {\tt WWFSDIR}:
  1361. X
  1362. X\begin{itemize}
  1363. X\item   {\tt bin/}      --- executables are installed here.
  1364. X\item   {\tt cache/}    --- cached information is stored here.
  1365. X\item   {\tt etc/}      --- configuration files for perl scripts.
  1366. X\item   {\tt lib/}      --- for library files used by perl scripts.
  1367. X\item   {\tt log/}      --- logs and event traces go here.
  1368. X\item   {\tt stale/}    --- stale files and directories are moved here.
  1369. X\item   {\tt ongoing/}  --- all interim data, including files, are stored here.
  1370. X\item   {\tt vol/}      --- volume files are stored here.
  1371. X\end{itemize}
  1372. X
  1373. XNow you finished server installation procedure. Please read Sections
  1374. X\ref{admin_server} and \ref{admin_volumes} for starting up the Cluster
  1375. XServer.
  1376. X
  1377. X\section{Installing mount commands}
  1378. X\label{install_client}
  1379. X
  1380. XNow you compile {\tt wwmount} and {\tt wwumount} for use on your
  1381. Xworkstation clusters.  Or you can grab binaries from {\tt
  1382. X  WWFS/binaries} on WWFS.
  1383. X
  1384. XThe mount commands is known to work on BSD/386 1, SunOS 4, Ultrix 4,
  1385. XOSF/1 1.3, IRIX 4, HP-UX 8, NEWS-OS 4, RISC/os 4, NeXT OS, and Luna
  1386. Xfamily of operating systems.  Bascially any 4.3BSD, 4.4BSD or OSF/1
  1387. Xmachines should be OK (say VAX or Tahoe which I don't have access to).
  1388. XAlso, it is relatively easy to port the client software to non-BSD
  1389. Xplatforms.  I would like to know if it runs on Solaris 2 and NEWS-OS
  1390. X6; please let me know if it runs on one of these (and other exotic
  1391. Xoperating systems :-).
  1392. X
  1393. XNOTE: BSD/386 and possibly other operating systems with 'Guelph NFS'
  1394. Xmay suffer from the symptom that previously uncached directories
  1395. Xremain empty even when FTP transfer completes and directories get
  1396. Xfilled.  I don't have any smart idea on how to fix it except modifying
  1397. Xthe BSD kernel.  I hope 4.4BSD have fixed this bug.
  1398. X
  1399. XNOTE: Luna2/Mach users must steal {\tt mount.o} from Luna/UniOS-B
  1400. X{\tt libc.a}.
  1401. X
  1402. XYou must modify {\tt config/wwfs.conf} accordingly.  It is referenced
  1403. Xby various utilities including shell scripts, perl scripts and tcl
  1404. Xscripts.
  1405. X
  1406. XYou may need to edit {\tt config/Makefile.config} and correctly set
  1407. Xthe following flags.
  1408. X
  1409. X\medskip
  1410. X\begin{tabular}{|l|l|} \hline
  1411. Xname    & description \\ \hline
  1412. X{\tt ETCDIR}    & {\tt wwmount} and {\tt wwumount} goes here \\
  1413. X{\tt LIBDIR}    & {\tt libww.a} goes here \\
  1414. X{\tt INCDIR}    & {\tt libww.h} goes here \\ \hline
  1415. X\end{tabular}
  1416. X\medskip
  1417. X
  1418. XJust type {\tt make install-client} then it will install {\tt
  1419. X  /etc/wwfs.conf}, mount commands, libraries and header files.
  1420. X
  1421. X\chapter{Administration}
  1422. X
  1423. XThis chapter is written for the administrator of the Cluster Server
  1424. X({\tt csd}).  Please read Sections \ref{admin_server} and
  1425. X\ref{admin_volumes} for starting up {\tt csd}.
  1426. X
  1427. X\section{Server administration}
  1428. X\label{admin_server}
  1429. X
  1430. XThe Cluster Server, {\tt csd}, can be restarted anytime. Basically,
  1431. Xthere is no loss of information due to termination, since cached
  1432. Xinformation is kept on the disk. You should be careful however, since
  1433. Xthere might be ongoing file transfer, and there might be some users
  1434. Xaccessing WWFS.
  1435. X
  1436. X\subsection*{Starting server process}
  1437. X
  1438. XTo start the server process, become superuser and just type {\tt
  1439. X  csd-nanny} to start {\tt csd}.  (presumably installed at
  1440. X\verb+WWFSDIR/bin+).
  1441. X
  1442. XNOTE: WWFS provides non-stop operation with {\tt csd-nanny}, an
  1443. Xiterative and automatic debugger front-end specifically written for
  1444. Xnon-stop programs such as {\tt csd}.  {\tt csd-nanny} is included in
  1445. X{\tt saps/} directory of this distribution.  For more information on
  1446. X{\tt csd-nanny}, read the source, which is actually a small perl
  1447. Xscript and is well-documented.
  1448. X
  1449. X\subsection*{Terminating server process}
  1450. X
  1451. X{\tt csd} can be killed just as other daemon processes. You can use
  1452. Xeither {\tt SIGINT}, {\tt SIGTERM} or {\tt SIGKILL}. Termination is
  1453. Xlogged as such, using {\tt syslog} facility.  {\tt csd-nanny} detects
  1454. Xtermination and automatically restarts {\tt csd}.
  1455. X
  1456. XIf you really want to stop {\tt csd}, first kill {\tt csd-nanny} then
  1457. X{\tt csd}.  But beware: if someone was accessing WWFS when you stopped
  1458. Xthe daemon, his shell (or other accessing processes, say Emacs) will
  1459. Xbecome frozen.  This is normal NFS behaviour and not a bug in WWFS.
  1460. X
  1461. X% His
  1462. X% ongoing file transfer, if any, will be aborted (the vestige remains
  1463. X% though).  Although I will try to address these problems in forthcoming
  1464. X% versions, you are advised to monitor filesystem activities so that
  1465. X% termination of the daemon will not lead to any loss of data or client
  1466. X% blockage.  Use of {\tt wall} might be a good idea on a big cluster
  1467. X% like NAIST, where {\tt csd} has been serving hundreds of machines.
  1468. X
  1469. X\subsection*{Managing cache}
  1470. X
  1471. X% expire
  1472. XCurrently, {\tt csd} does not reclaim secondary storage by itself.
  1473. XThe shell script {\tt expire.sh}, which has been included in this
  1474. Xdistribution, should be invoked regularly via {\tt crontab} (typically
  1475. Xonce a week). It expires ``inactive'' files that haven't been accessed
  1476. Xfor more than two weeks, so that cache partition will not be filled up
  1477. Xwith ``no longer referenced'' files.  Directories do not expire, but
  1478. Xobsolete directory listings are automatically discarded and superseded
  1479. Xby newer ones.
  1480. X
  1481. XNOTE: It's okay to delete cached files selectively, but it's not
  1482. Xrecommended to delete cached directory files (i.e., files within {\tt
  1483. X  dir/} directory) unless you want to remove cached information for
  1484. Xthe whole volume.  Even if all cached directory files were lost, {\tt
  1485. X  csd} continues to function but {\tt csd} will occasionally forget
  1486. Xwhich file is cached and which is not.
  1487. X
  1488. X% consistency check?
  1489. XOther management tools, such as file system consistency checker, will
  1490. Xbe available in future versions.
  1491. X
  1492. X% accident?
  1493. XIf {\tt csd} was accidentally killed by someone, even with
  1494. X{\tt SIGKILL}, the chances are that user's ongoing file transfers
  1495. Xweren't lost; just take a look at the {\tt ongoing} subdirectory of
  1496. X{\tt WWFSDIR}, where interim files are kept.
  1497. XSignificant amount of effort have been paid so that daemon can survive
  1498. Xvirtually eternally, and can be restarted anytime without loss of
  1499. Xdata.
  1500. X
  1501. X\subsection*{Snooping cache with perl}
  1502. X
  1503. XI have written {\tt libmm.pl}, the Maru-Maru library (counterpart of
  1504. XWaku-Waku in Japanese) in the hope that perl scripts built upon this
  1505. Xpackage complements features not implemented in {\tt csd}, thereby
  1506. Xenabling much more advanced features such as cache strategy selection,
  1507. Xcache statistics and cache consistency management.  I have also added
  1508. XUIP commands that enables close collaboration of {\tt csd} and these perl
  1509. Xprograms.
  1510. X
  1511. XNOTE: This package works only on localhost (that is, the machine
  1512. Xrunning csd) for security reasons.
  1513. X% Current implementation of UIP server restricts
  1514. X% CTOR/RTOC access to localhost.
  1515. X
  1516. XSeveral sample perl scripts are provided in the {\tt libww/}
  1517. Xsubdirectory of this distribution; I hope these examples facilitate
  1518. Xwriting perl scripts for {\tt csd} administration.
  1519. X
  1520. X\section{Client administration}
  1521. X
  1522. X% install wwclient
  1523. X{\tt wwclient}, a perl script, is included in this distribution to
  1524. Xfacilitate the administration of clients. It should be already present
  1525. Xin {\tt /etc} if you have done {\tt install-client}.
  1526. X
  1527. X% invoke wwclient in rc.local
  1528. XIf you want a client machine to automatically mount WWFS, you can do
  1529. Xit with {\tt wwclient}.  To do this, add the following lines to
  1530. X{\tt /etc/rc.local}:
  1531. X
  1532. X\begin{screen}
  1533. X\small
  1534. X\begin{verbatim}
  1535. X# WWFS
  1536. Xif [ -f /etc/wwclient -a -f /etc/wwfs.conf ]; then
  1537. X        /etc/wwclient
  1538. Xfi
  1539. X\end{verbatim}
  1540. X\end{screen}
  1541. XThis does not work if {\tt csd} does not respond to client's request
  1542. Xfor some reason (e.g., temporarily terminated for reboot).
  1543. X
  1544. X% acct users beware
  1545. XSites using {\tt acct} should beware so that it does not traverse
  1546. Xbeneath WWFS mount point. Some sites report that {\tt diskusg}, the
  1547. Xdisk accounting command of System V, makes {\tt csd} crash.
  1548. X
  1549. X% daily crash
  1550. XAlso, {\tt /usr/adm/daily}, {\tt /usr/spool/cron/crontabs/root} and
  1551. Xother periodically kicked maintenance scripts should be checked so
  1552. Xthat {\tt find} do not traverse beneath WWFS mount point. Traversal
  1553. Xshould be limited to local disks with appropriate {\tt find} options
  1554. Xsuch as {\tt -xdev} and/or {\tt -fstype nfs -prune}.
  1555. X
  1556. X\section{Troubleshooting {\tt csd}}
  1557. X\label{admin_troubleshooting}
  1558. X
  1559. X% inspecting logs
  1560. X
  1561. X\subsection*{Reporting bugs}
  1562. X% Use {\tt csd-nanny} if your {\tt csd} dumps core
  1563. X
  1564. XAlthough it is very unlikely, if your daemon runs out of CPU or
  1565. Xmemory, please be prepared to send bug reports to me.  I would
  1566. Xlike to particularly know:
  1567. X
  1568. X\begin{itemize}
  1569. X\item   if it is reproducible.
  1570. X\item   peculiarities of your network configuration.
  1571. X\item   peculiarities of your administrative tools.
  1572. X\item   debug logs produced by {\tt csd-nanny}.
  1573. X\end{itemize}
  1574. X
  1575. XIf you could get snapshots of debug session, then please e-mail them
  1576. Xto me. I am very grateful to receive your bug report.
  1577. X
  1578. X\subsection*{Other troubles: send e-mail}
  1579. X
  1580. XIf you have faced any other problem concerning the server software,
  1581. Xplease send e-mail to me (or the WWFS mailing list). If you have any
  1582. Xproblem with the client software, please make sure to read chapter
  1583. X\ref{using_wwfs} before asking any question to me, since it might be
  1584. Xthe inevitable oddities of global filesystems.
  1585. X
  1586. X\section{Volume administration}
  1587. X\label{admin_volumes}
  1588. X
  1589. X% what is volume
  1590. XI have introduced the notion of {\em volume} that is a group of files
  1591. Xwith a specific purpose and organized within a subtree, since every
  1592. Xanonymous ftp server contains tons of files with different purpose
  1593. Xand since it is difficult to locate where those files have been
  1594. Xcategorized, while it is relatively easy to find desired files
  1595. Xwithin the directory subtree.
  1596. X
  1597. X% what is volume for
  1598. XVolume makes it easy to find necessary information, since volumes have
  1599. Xbeen indexed with keywords and no extra information is necessary to
  1600. Xaccess them.
  1601. X
  1602. X% benefits
  1603. XThe separation of {\tt hostname:directory} and archived files yields
  1604. Xseveral benefits. An archive administrator can provide alternative access
  1605. Xpoint for the same files, so that alternative server is available when
  1606. Xthe original server become unavailable for some reason, such as network
  1607. Xtroubles and disk crashes. In other words, the task of locating file
  1608. Xserver, exploring directory trees, and switching between file servers
  1609. Xbecome automatic, once the administrator creates volumes.
  1610. X
  1611. X% who does administration
  1612. XTraditionally, these tasks have been done by the people called ``ftp
  1613. Xhacker''. Now that we have WWFS, their efforts can be publicized in
  1614. Xthe form of {\em volume file}, that will benefit every users of the
  1615. Xfilesystem. If you are not ftp type and you are not willing to
  1616. Xadminister volumes, ask your friendly ftp hackers to do the task
  1617. Xinstead.
  1618. X
  1619. X% how to share it
  1620. X% how to organize it
  1621. XThe beautiful point of volume files is that they can be shared among
  1622. XInternet sites. However, their uncontrolled distribution will lead to
  1623. Xtotally chaotic situation, which is no better than current ftp
  1624. Xarchives. Thus coordination by authoritative organization should be
  1625. Xnecessary in near future.
  1626. X
  1627. X\subsection*{Installing volumes}
  1628. X
  1629. XVolume files must be installed properly to enable access to volumes.
  1630. XYou must hold write permission on the volume directory, which is
  1631. Xnormally {\tt WWFSDIR/vol}.
  1632. X
  1633. X\subsection*{Creating new volumes}
  1634. X
  1635. XIf you or your clients want to access other ftp directories not listed
  1636. Xin existing volumes, you can create a new volume for that.
  1637. X% writing volume file
  1638. XYou can write a volume file with your favorite text editor. The syntax
  1639. Xof volume file can be described as follows:
  1640. X
  1641. X\begin{tabbing}
  1642. Xxxxxxxx \= foo \kill
  1643. Xfile    \> ::= line $|$ line file \\
  1644. Xline    \> ::= key: value \\
  1645. Xkey     \> ::= \{ ``volume-id'', ``ftp-server'', ``ftp-directory'' \}
  1646. X\end{tabbing}
  1647. X
  1648. X% volume id must be unique
  1649. XAlthough {\tt map.pl} tries to assign unique volume \ID\ for each
  1650. Xvolume file, it cannot make sure that given volume \ID\ is unique.
  1651. X{\tt map.pl} maintains the next free volume id in the {\tt seq} file,
  1652. Xwhich is located at {\tt WWFSDIR/vol}.  However, if the volume id
  1653. Xconflicts for some reason, {\tt csd} may behave incorrectly.  You must
  1654. Xguarantee the uniqueness of volume \ID s.  The most viable solution is
  1655. Xprobably that you learn {\tt perl} and troubleshoot your problem
  1656. Xyourself.
  1657. X
  1658. X% listing alternative servers
  1659. XIt is desirable to list all alternative servers that provide the same
  1660. Xvolume. If there are alternative servers, {\tt csd} will switch to
  1661. Xsecondary server if the primary server became unavailable due to
  1662. Xnetwork problems or hardware problems. An example, {\tt
  1663. X  X-contrib.vol}, is shown below, which enumerates alternative
  1664. Xservers.
  1665. X
  1666. X\begin{screen}
  1667. X\small
  1668. X\begin{verbatim}
  1669. Xvolume-id:      34
  1670. Xftp-server:     ftp.center.osaka-u.ac.jp
  1671. Xftp-directory:  X-contrib
  1672. Xftp-server:     ftp.iij.ad.jp
  1673. Xftp-directory:  pub/X/contrib
  1674. X
  1675. Xftp-server:     ftp.x.org
  1676. Xftp-directory:  contrib
  1677. Xftp-server:     ftp.germany.eu.net
  1678. Xftp-directory:  pub/X11/contrib
  1679. Xftp-server:     nic.switch.ch
  1680. Xftp-directory:  mirror/X-contrib
  1681. X
  1682. Xdescription:    Contributed software for X Window System
  1683. X#category-youki:        free/gui
  1684. X\end{verbatim}
  1685. X\end{screen}
  1686. X
  1687. XThe priority of access is determined by the order of listing; the topmost
  1688. Xone becomes primary server.
  1689. X
  1690. XNOTE: ``ftp-server:'' can be either hostname or IP address, so that
  1691. X{\tt csd} can run on corporate networks without DNS.
  1692. X
  1693. X\subsection*{Modifying volumes: {\tt make reload}}
  1694. X
  1695. X% why modify -- for speed, to save bandwidth, to balance the load
  1696. X% see ``working with archive servers''
  1697. XYou can accommodate volume files to your network configuration by
  1698. Xsorting server information in volumes files so that file transfer can
  1699. Xbe optimized; response time can be improved, load can be reduced, and
  1700. Xbandwidth can be saved.
  1701. X
  1702. XThis release comes with GTR, which automates selection of nearest
  1703. Xserver by GTR configuration file ({\tt WWFSDIR/etc/gtr.conf}) and GTR
  1704. Xresource records stored in DNS.  As this server selection scheme is
  1705. Xnot standardized, GTR resource records can be stored in a flat file
  1706. X({\tt WWFSDIR/etc/gtr.txt}).  Please look at {\tt gtr/} directory for
  1707. Xmore detailed information on GTR.
  1708. X
  1709. XTo install modified volumes, reload them using {\tt WWFSDIR/Makefile}.
  1710. XVolumes can be reloaded while {\tt csd} is running.
  1711. X
  1712. X\subsection*{Deleting volumes: {\tt make unload}}
  1713. X
  1714. X% why delete -- basically there is no need to delete
  1715. X% what to delete -- obsolete, or reorganized volumes
  1716. X% how to delete -- geez, delete and restart
  1717. XVolumes can be deleted, either because they are reorganized into other
  1718. Xvolumes or because they became obsolete and no longer necessary.  You
  1719. Xcan delete the volume files in {\tt WWFSDIR/vol}. Use {\tt
  1720. X  WWFSDIR/Makefile} to reflect the removal.
  1721. X
  1722. X\subsection*{Organizing volumes}
  1723. X
  1724. XYou can organize volumes by creating subdirectories under WWFSDIR/vol
  1725. Xand moving appropriate\footnote{The real question is that what's
  1726. X  appropriate.} volumes into that directory.  You must think twice
  1727. Xbefore doing this, since we do not provide any smart scheme to pick up
  1728. Xdesired volumes from hundreds of volumes that are organized in
  1729. Xsubdirectories.  The number of volumes does not change no matter how
  1730. Xyou organize it, and after all, how good is subdirectories that have
  1731. Xhundreds of volumes in each?
  1732. X
  1733. XWe are merely escaping from the namespace explosion problem; but at
  1734. Xleast we learned one thing: flat namespace with carefully annotated
  1735. XINDEX does help.
  1736. X
  1737. XIf you have {\sc Mosaic/WWFS} running, try looking at {\tt
  1738. X  wwfs:/WWFS/web/WWFShome.html}.
  1739. X
  1740. X\subsection*{Generating INDEX: {\tt make index}}
  1741. X
  1742. XSince volumes are initially invisible, users must be informed of their
  1743. Xavailability. The list of available volumes can be generated from
  1744. Xvolume files using {\tt makelist.pl}. To do this, simply type {\tt
  1745. X  make index} in {\tt WWFSDIR}.
  1746. X
  1747. X\subsection*{Automating administration with Makefile}
  1748. X
  1749. XSome of procedural tasks tend to be commonly performed by
  1750. Xadministrators. Such tasks can be facilitated by preparing a {\tt
  1751. XMakefile}.  Sample {\tt Makefile} have been provided for these
  1752. Xpurpose; they are copied to {\tt WWFSDIR} upon correct
  1753. Xinstallation. You are encouraged to tweak it and create {\tt perl}
  1754. Xscripts for smarter administration.
  1755. X
  1756. X\section{Access control and security}
  1757. X\label{access_control}
  1758. X
  1759. XFor some reason, you may want to make the filesystem visible to
  1760. Xcertain subnets but keep it inaccessible from the rest of the world.
  1761. XYou can do this with access control file named {\tt access}.  Access
  1762. Xcontrol files can be placed in arbitrary subdirectory of WWFSDIR/vol;
  1763. Xin other words, if you want to make some sensitive information
  1764. Xaccessible as volumes, make a subdirectory under WWFSDIR/vol, move
  1765. Xsensitive volumes there, and put {\tt access} there.  I do not go into
  1766. Xdetail about its grammer; here is an example {\tt access} file.
  1767. X
  1768. X\begin{screen}
  1769. X\small
  1770. X\begin{verbatim}
  1771. X163.221.32-163.221.68       nfs,uip    # address range
  1772. X163.221.80.*-163.221.96.*   nfs,uip    # same effect
  1773. X163.221.74.25               nfs,uip    # specific host
  1774. X163.221.78.*                nfs,uip    # 0 to 255
  1775. X\end{verbatim}
  1776. X\end{screen}
  1777. X
  1778. XBasically it's combination of {\em address range} and {\em
  1779. X  capability}.  Host names and domain names are not allowed here,
  1780. Xsince there are only tricky and non-standard way to retrieve subnet
  1781. Xmasks and subnet addresses via DNS.
  1782. X
  1783. XNOTE: You may want to ensure security at your firewall gateways (i.e.,
  1784. XInternet routers at the outermost segment) by letting them drop
  1785. Xpackets of UDP port 8000 (csd NFS), UDP and TCP port 8002 (csd UIP).
  1786. X
  1787. X
  1788. X\chapter{Using WWFS}
  1789. X\label{using_wwfs}
  1790. X
  1791. X% this chapter is for general public
  1792. XThis chapter is intended for casual UNIX users who can understand what
  1793. Xshell is and what {\tt ls} is. Even if you are wizard, you are
  1794. Xrecommended to glance through this chapter at least once.  Also, you
  1795. Xmay want to ask your local WWFS administrator for local configuration
  1796. Xinformation and/or local guide.
  1797. X
  1798. X\section{{\tt wwclient}: starting to be a WWFS client}
  1799. X
  1800. X% wwmount
  1801. XIf you or your system administrator has already mounted WWFS, you can
  1802. Xskip this section. You can see if WWFS have been mounted with the
  1803. X{\tt mount} command:
  1804. X\begin{screen}
  1805. X\small
  1806. X\begin{verbatim}
  1807. Xyouki-k@dec416$ /etc/mount | grep wwfs
  1808. Xfsa2:wwfs on /ww/fs type nfs (ro,soft)
  1809. X\end{verbatim}
  1810. X\end{screen}
  1811. X
  1812. XIf it's not mounted, then {\tt grep} will display nothing. In that
  1813. Xcase, you can mount WWFS by yourself (if you don't have superuser
  1814. Xprivilege, ask your system administrator to do so). There should be a
  1815. Xperl script named {\tt wwclient} somewhere in your filesystem
  1816. X(presumably {\tt /etc}, {\tt /usr/local/etc} or {\tt
  1817. X  /usr/local/ww/etc}).  You can mount WWFS by invoking {\tt wwclient}
  1818. Xas root without any arguments. If you can't find it, ask your local
  1819. XWWFS administrator for help.
  1820. X
  1821. X\section{Stopping to be a WWFS client}
  1822. X
  1823. X% wwumount
  1824. XIf you decided to stop using WWFS for some reason, you don't have to
  1825. Xunmount the filesystem. However, if your WWFS administrator asked you
  1826. Xto unmount the filesystem, you would better do that.  To unmount the
  1827. Xfilesystem, simply give the mount point as its argument. An example
  1828. Xfollows.
  1829. X\begin{screen}
  1830. X\small
  1831. X\begin{verbatim}
  1832. Xdec416# wwumount /ww/fs
  1833. X\end{verbatim}
  1834. X\end{screen}
  1835. X
  1836. X\section{Accessing volumes}
  1837. X
  1838. X% ls, ls snapshot...
  1839. XVolumes are represented as ordinary directories, but it is invisible
  1840. Xat first time. A volume is made visible only after it has been
  1841. Xaccessed explicitly, since users will get bewildered if thousands of
  1842. Xvolumes have been visible at once.
  1843. X\begin{screen}
  1844. X\small
  1845. X\begin{verbatim}
  1846. Xyouki-k@dec416$ ls /ww/fs
  1847. XCERN-web/  CTAN/      GNU/       INDEX      WWFS/      www/
  1848. X\end{verbatim}
  1849. X\end{screen}
  1850. X
  1851. X% Although they are currently organized directly beneath the mount point
  1852. X% in a flat manner, it should be improved somehow. Organization of
  1853. X% namespace is a touchy subject however, and it forms different research
  1854. X% gender. Your comments and opinions are welcomed.
  1855. X
  1856. X\section{Accessing directories}
  1857. X
  1858. XDirectories in WWFS can be accessed just like other filesystems using
  1859. Xyour favorite tools, with one noticeable difference: you must
  1860. Xsometimes retry. It will take longer when {\tt csd} establish FTP
  1861. Xconnection with anonymous ftp server.  You must be patient for this,
  1862. Xsince delays are inevitable in the Internet and delays increase as the
  1863. Xlogical distance between client and ftp server increase.
  1864. X
  1865. XNOTE: If you feel it really irritating to type {\tt ls} repeatedly,
  1866. Xyou should plan to re-compile {\tt ls} with {\tt libww}.  See
  1867. XChapter \ref{useful_hacks} for more detail.
  1868. X
  1869. X\section{Accessing files}
  1870. X
  1871. X% more, more snapshot...
  1872. XFiles suffer the same problem with directories. Generally, you cannot
  1873. Xexpect a file transfer to complete real soon now unless you have
  1874. Xenough bandwidth available for you. Therefore, the initial access to
  1875. Xthe designated file is likely to fail especially under poorly
  1876. Xconnected networks. After certain amount of time, access to the same
  1877. Xfile will succeed since the file has been cached on the local filesystem.
  1878. X
  1879. XFailure to instantly deliver the requested file will result in an
  1880. Xerror ``no such file or directory'' ({\tt NFSERR\_NOENT}), so that
  1881. X{\tt csd} deliberately avoids your shell being blocked (i.e., become
  1882. Xirresponsible) almost eternally by filesystem request.  This was a
  1883. Xdesign choice because of poor semantics provided by NFS.
  1884. X
  1885. XNOTE: You can virtually forget the problem by re-compiling your
  1886. Xfavorite programs with {\tt libww}.  See Chapter \ref{useful_hacks}
  1887. Xfor more detail.
  1888. X
  1889. X\section{Other operations}
  1890. X
  1891. XWrite operation is not supported for now, since WWFS is designed for
  1892. Xwidely shared information, which is rarely modified, according to
  1893. Xstatistical studies.
  1894. X
  1895. X\chapter{Useful hacks}
  1896. X\label{useful_hacks}
  1897. X
  1898. XDue to strong demand from the user community, I devised several ways
  1899. Xto bypass limitations of NFS with minimal effort. This chapter is
  1900. Xintended for aggressive WWFS users who want to accommodate existing
  1901. Xtools to WWFS.  The basic idea is that you have WWFS-ready command
  1902. Xsets, say {\tt emacs}, {\tt ls}, {\tt tar}, {\tt cat}, and so on.
  1903. X
  1904. X\section{MULE: {\tt wwfs-access-hook.el}}
  1905. X
  1906. XThere is {\tt mule/} subdirectory in this distribution.  For more
  1907. Xinformation on WWFS-ready {\tt mule}, follow the README in that
  1908. Xdirectory which I have written for {\tt mule} addicts.
  1909. X
  1910. XSo what is MULE?  MULE stands for Multilingual enhancement to GNU
  1911. XEmacs.  For those who cares, I do not support the US-centric version
  1912. Xof Emacs (because it's mostly useless to me).  But I think it's easy
  1913. Xto add {\tt access-hook} to Emacs 19 as well.
  1914. X
  1915. X\section{Recompiling other utilities}
  1916. X
  1917. XMost of GNU software can be compiled WWFS-ready and installed without
  1918. Xmodifying Makefiles; use {\tt libww/wwconfigure} in this distribution
  1919. Xinstead of the bundled {\tt configure}.
  1920. X
  1921. XBasically, it should be fairly easy to make existing commands
  1922. XWWFS-ready, as long as you have source code of them. Just redefine
  1923. X{\tt open} to {\tt ww\_open}, {\tt opendir} to {\tt ww\_opendir},
  1924. X{\tt fopen} to {\tt ww\_fopen} by adding C flags like this:
  1925. X\begin{screen}
  1926. X\small
  1927. X\begin{verbatim}
  1928. XCFLAGS= -Dopen=ww_open -Dopendir=ww_opendir -Dfopen=ww_fopen
  1929. X\end{verbatim}
  1930. X\end{screen}
  1931. X
  1932. XNext, make them link with {\tt libww.a} by adding flags for {\tt ld}
  1933. Xlike this:
  1934. X\begin{screen}
  1935. X\small
  1936. X\begin{verbatim}
  1937. XLIBS= -L/usr/local/ww/lib -lww
  1938. X\end{verbatim}
  1939. X\end{screen}
  1940. X
  1941. X\section{Splicing the C library}
  1942. X
  1943. XYou can rename arbitrary symbols in {\tt libc.a} with {\tt
  1944. X  renamesym.pl}, my brute-force perl script, which may be useful when
  1945. Xyou have object files but not source files (e.g., binary licensed
  1946. Xsoftware).  You can generate WWFS-ready C library, {\tt libc\_wwfs.a},
  1947. Xwith this perl script; to do this, just step down to {\tt libww/}
  1948. Xsubdirectory and type {\tt make libc}.  Note that this perl script
  1949. Xassumes BSD-style nm output format (that is, it does not work on IRIX,
  1950. XHP-UX and other SysV variants for now).
  1951. X
  1952. X\begin{figure}
  1953. X\begin{center}
  1954. X\epsfile{file=switch.eps,scale=0.4}
  1955. X\end{center}
  1956. X\caption{For those who cares: yes, {\tt csd} is a 1) protocol conversion
  1957. Xengine for information access, 2) shared file cache for the Internet, and
  1958. X3) an information delivery mechanism.}
  1959. X\label{fig_switch}
  1960. X\end{figure}
  1961. X
  1962. X\section{Monitoring server status}
  1963. X
  1964. X% lsof, netstat, ps, pstat
  1965. X
  1966. XThere are several ways to monitor the server status. You can use
  1967. Xtraditional tools such as {\tt netstat}, {\tt ps} and {\tt pstat}.
  1968. XBoth {\tt ps} and {\tt pstat} are useful to see if {\tt csd} is
  1969. Xoccupying too much memory or too much CPU time.
  1970. X
  1971. X% {\tt tcpdump} or {\tt etherfind} are useful to see how actively WWFS
  1972. X% has been accessed. These tools are particularly useful if you want to
  1973. X% replace {\tt csd} with new one but you can't determine when.  If you
  1974. X% plan to use {\tt tcpdump} for monitoring purpose, you must specify
  1975. X% {\tt udp port 8000} so that NFS requests to {\tt csd} can be
  1976. X% monitored. Other options, such as {\tt -N} and {\tt -s 192}, might be
  1977. X% helpful.
  1978. X
  1979. X{\tt netstat} may be useful to see how many file transfer have been
  1980. Xtaking place. But there is much smarter tool for this purpose, called
  1981. X{\tt lsof}, developed at Purdue University. Snapshot of a sample {\tt
  1982. X  lsof} session follows:
  1983. X
  1984. X\begin{screen}
  1985. X\small
  1986. X\begin{verbatim}
  1987. Xyouki@raicho$ /usr/local/etc/lsof -u wwfs -s
  1988. XCOMMAND     PID     USER   FD  TYPE     DEVICE   INODE/NAME
  1989. Xcsd        1887     wwfs  cwd  VDIR     7,   6   53658 /usr (/dev/sd0g)
  1990. Xcsd        1887     wwfs    0  VCHR    20,   0    2864 /dev/ttyp0
  1991. Xcsd        1887     wwfs    1  VCHR    20,   0    2864 /dev/ttyp0
  1992. Xcsd        1887     wwfs    2  VCHR    20,   0    2864 /dev/ttyp0
  1993. Xcsd        1887     wwfs    4  inet 0xff66090c     UDP *:791
  1994. Xcsd        1887     wwfs    6  inet 0xff651a8c     TCP *:8002
  1995. Xcsd        1887     wwfs    7  inet 0xff65158c     UDP *:2272
  1996. Xcsd        1887     wwfs    8  inet 0xff660e0c     UDP *:8000
  1997. Xcsd        1887     wwfs   10  VREG     7,  11   20542 /space (/dev/sd1d)
  1998. Xcsd        1887     wwfs   11  VREG     7,  11   20485 /space (/dev/sd1d)
  1999. Xcsd        1887     wwfs   12  inet 0xff66450c     TCP 133.1.84.1:3681
  2000. X                                                       ->192.41.197.14:21
  2001. X\end{verbatim}
  2002. X\end{screen}
  2003. X
  2004. X% telnet debug connection
  2005. X
  2006. XThere is an experimental feature called ``debug connection'' in {\tt
  2007. X  csd}. You can talk to csd directly with {\tt telnet} using TCP port
  2008. X8002. A new protocol, UIP (WWFS User Interface Protocol) has been
  2009. Xintroduced for the administrative purpose, among others. A sample
  2010. Xsession is shown below.
  2011. X
  2012. X\begin{screen}
  2013. X\small
  2014. X\begin{verbatim}
  2015. Xyouki@nozomi$ telnet raicho 8002
  2016. XTrying 133.1.84.1...
  2017. XConnected to raicho.rd.ecip.osaka-u.ac.jp.
  2018. XEscape character is '^]'.
  2019. XDIAG file /tahoe/bin/cat/cat.1
  2020. X220-009 fil /tahoe/bin/cat/cat.1
  2021. X213-009 name = cat.1
  2022. X213-009 link = (null)
  2023. X213-009 id = 1e5a2ca7
  2024. X213-009 crc = 1e5a2ca7
  2025. X213-009 flag = 0
  2026. X213-009 type = 1
  2027. X213-009 fsid = d
  2028. X213.009 fileid = 1e5a2ca7
  2029. XQUIT
  2030. XConnection closed by foreign host.
  2031. X\end{verbatim}
  2032. X\end{screen}
  2033. X
  2034. XThe draft document for UIP protocol specification has been included
  2035. Xin this distribution. It doesn't document all available features
  2036. Xhowever, and may not reflect latest changes to the protocol.  The
  2037. Xcorresponding source code, {\tt csd/uip.c}, might be more informative.
  2038. X
  2039. XThe {\tt telnet} debug connection can never be a security hole, but if
  2040. Xthe connection peer used privileged port (i.e., {\tt sin\_port} of the
  2041. Xconnection peer is smaller than 1024), {\tt csd} logs the event for
  2042. Xlater perusal.
  2043. X
  2044. X\begin{screen}
  2045. X\small
  2046. X\begin{verbatim}
  2047. Xraicho csd[1887]: privileged connection established: 133.1.84.13
  2048. Xraicho csd[1887]: privileged connection closed: 133.1.84.13
  2049. X\end{verbatim}
  2050. X\end{screen}
  2051. X
  2052. X\section{Mounting WWFS using {\tt amd}}
  2053. X
  2054. XIt's possible to mount WWFS using {\tt amd}'s program file system.
  2055. XOne possible pitfall is that {\tt amd} will fall into deadlock if you
  2056. Xmisconfigured it.  The rule of thumb is that {\em do not put wwmount
  2057. Xand wwumount under filesystems managed by amd}.  The deadlock occurs
  2058. Xas follows:
  2059. X\begin{enumerate}
  2060. X\item {\tt amd} executes {\tt wwmount} and block until it completes.
  2061. X\item exec routine in the kernel attempts to read {\tt wwmount}
  2062. X  binary from its directory, say {\tt /usr/local}, which in turn is
  2063. X  served by {\tt amd}.
  2064. X\item {\tt amd} deadlocks.
  2065. X\end{enumerate}
  2066. X
  2067. XNow you know how to avoid {\tt amd} deadlock, so write your own map file.
  2068. XHere is our working example:
  2069. X
  2070. X\begin{screen}
  2071. X\small
  2072. X\begin{verbatim}
  2073. Xworld   type:=program;\
  2074. X        mount:="/etc/wwmount wwmount raicho ${fs}";\
  2075. X        unmount:="/etc/wwumount wwumount ${fs}";
  2076. X\end{verbatim}
  2077. X\end{screen}
  2078. X
  2079. X
  2080. X\chapter{Contribution}
  2081. X
  2082. X\section{Sending comments, bug reports and improvements}
  2083. X\label{contrib_send}
  2084. X
  2085. X% send comments
  2086. X% send bug reports
  2087. X% send ideas for improvement
  2088. XWWFS is a still-ongoing research project. I think this software suite can
  2089. Xbecome a building block for large scale networked environments in near
  2090. Xfuture.  You can contribute to our research and development by sending
  2091. Xcomments, bug reports, and ideas for improvements; I am very grateful
  2092. Xto receive your feedback.
  2093. X
  2094. XPlease feel free to send your feedbacks to me, or to the following
  2095. Xe-mail address:
  2096. X\begin{verbatim}
  2097. Xwwfs@is.aist-nara.ac.jp
  2098. X\end{verbatim}
  2099. X
  2100. XIf you want to join the WWFS bandwagon, just send an e-mail to the
  2101. Xfollowing address, so that you will be added to the WWFS mailing list:
  2102. X\begin{verbatim}
  2103. Xwwfs-request@is.aist-nara.ac.jp
  2104. X\end{verbatim}
  2105. X
  2106. XAlthough we adopt English as our primary communication language, we
  2107. Xaccept Japanese as well, since this research project and this mailing
  2108. Xlist has been wheeled by Japanese folks, including me.
  2109. X
  2110. X\section{Acknowledgements}
  2111. X\label{acknowledgements}
  2112. XI would especially like to thank Noritoshi Demizu for his useful perl
  2113. Xhacks, impressive jokes and his serious attitude toward layer
  2114. Xviolation.  Also, I would like to thank Akira Kato, Hiroyuki Ohno,
  2115. XKazumasa Utashiro, Kouichirou Eto, Motonori Nakamura, Shuji Ishii,
  2116. XToshihiko Shimokawa, Yoshitaka Tokugawa and other alpha testers for
  2117. Xtheir helpful comments, bug reports and discussions on the WWFS
  2118. Xmailing list and private talks.  I would like to thank folks at Osaka
  2119. XUniversity, Nara Institute of Science and Technology, and WIDE
  2120. XProject, especially Dr.\ Suguru Yamaguchi, Prof.\ Hideo Miyahara and
  2121. XProf.\ Jun Murai for their fundamental support --- including
  2122. Xenvironmental, financial, and spiritual support --- for my research
  2123. Xactivities.  I would also like to thank the administrators of ftp
  2124. Xarchives in the Internet.
  2125. X
  2126. X\end{document}
  2127. END_OF_FILE
  2128.   if test 43575 -ne `wc -c <'doc/manual.tex'`; then
  2129.     echo shar: \"'doc/manual.tex'\" unpacked with wrong size!
  2130.   fi
  2131.   # end of 'doc/manual.tex'
  2132. fi
  2133. if test -f 'libww/wwconfigure.sh' -a "${1}" != "-c" ; then 
  2134.   echo shar: Will not clobber existing file \"'libww/wwconfigure.sh'\"
  2135. else
  2136.   echo shar: Extracting \"'libww/wwconfigure.sh'\" \(654 characters\)
  2137.   sed "s/^X//" >'libww/wwconfigure.sh' <<'END_OF_FILE'
  2138. X#!/bin/sh
  2139. X#
  2140. X# GNU configure for WWFS clients.
  2141. X# Do you want to recompile ls, cp, cat, gzip etc. for WWFS?
  2142. X# Then this shell script is for you.  You don't have to modify
  2143. X# source code or Makefiles.
  2144. X#
  2145. X# Just type
  2146. X#    wwconfigure
  2147. X# instead of
  2148. X#    ./configure
  2149. X#
  2150. X# Author: DEMIZU Noritoshi <nori-d@is.aist-nara.ac.jp>
  2151. X# Modified: Youki Kadobayashi <youki@wide.ad.jp>
  2152. X#
  2153. X
  2154. X# This doesn't work anymore...
  2155. X#DEFS="-Dopen=ww_open -Dopendir=ww_opendir -Dfopen=ww_fopen" LIBS="-lww" \
  2156. X
  2157. X# Another try, which does work on newer versions of fileutils & textutils.
  2158. XCC="gcc -Dopen=ww_open -Dopendir=ww_opendir -Dfopen=ww_fopen" LIBS="-L/usr/local/ww/lib -lww" \
  2159. X./configure $*
  2160. END_OF_FILE
  2161.   if test 654 -ne `wc -c <'libww/wwconfigure.sh'`; then
  2162.     echo shar: \"'libww/wwconfigure.sh'\" unpacked with wrong size!
  2163.   fi
  2164.   chmod +x 'libww/wwconfigure.sh'
  2165.   # end of 'libww/wwconfigure.sh'
  2166. fi
  2167. echo shar: End of archive 12 \(of 22\).
  2168. cp /dev/null ark12isdone
  2169. MISSING=""
  2170. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ; do
  2171.     if test ! -f ark${I}isdone ; then
  2172.     MISSING="${MISSING} ${I}"
  2173.     fi
  2174. done
  2175. if test "${MISSING}" = "" ; then
  2176.     echo You have unpacked all 22 archives.
  2177.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2178. else
  2179.     echo You still must unpack the following archives:
  2180.     echo "        " ${MISSING}
  2181. fi
  2182. exit 0
  2183. exit 0 # Just in case...
  2184.