2 * mount_dispatch This file contains the function dispatch table.
4 * Copyright (C) 1995 Olaf Kirch <okir@monad.swb.de>
11 #ifdef HAVE_TCP_WRAPPER
12 #include "tcpwrapper.h"
19 * Procedures for MNTv1
21 static struct rpc_dentry mnt_1_dtable[] = {
22 dtable_ent(mount_null,1,void,void), /* NULL */
23 dtable_ent(mount_mnt,1,dirpath,fhstatus), /* MNT */
24 dtable_ent(mount_dump,1,void,mountlist), /* DUMP */
25 dtable_ent(mount_umnt,1,dirpath,void), /* UMNT */
26 dtable_ent(mount_umntall,1,void,void), /* UMNTALL */
27 dtable_ent(mount_export,1,void,exports), /* EXPORT */
28 dtable_ent(mount_exportall,1,void,exports), /* EXPORTALL */
32 * Procedures for MNTv2
34 static struct rpc_dentry mnt_2_dtable[] = {
35 dtable_ent(mount_null,1,void,void), /* NULL */
36 dtable_ent(mount_mnt,1,dirpath,fhstatus), /* MNT */
37 dtable_ent(mount_dump,1,void,mountlist), /* DUMP */
38 dtable_ent(mount_umnt,1,dirpath,void), /* UMNT */
39 dtable_ent(mount_umntall,1,void,void), /* UMNTALL */
40 dtable_ent(mount_export,1,void,exports), /* EXPORT */
41 dtable_ent(mount_exportall,1,void,exports), /* EXPORTALL */
42 dtable_ent(mount_pathconf,2,dirpath,ppathcnf), /* PATHCONF */
46 * Procedures for MNTv3
48 static struct rpc_dentry mnt_3_dtable[] = {
49 dtable_ent(mount_null,1,void,void), /* NULL */
50 dtable_ent(mount_mnt,3,dirpath,mountres3), /* MNT */
51 dtable_ent(mount_dump,1,void,mountlist), /* DUMP */
52 dtable_ent(mount_umnt,1,dirpath,void), /* UMNT */
53 dtable_ent(mount_umntall,1,void,void), /* UMNTALL */
54 dtable_ent(mount_export,1,void,exports), /* EXPORT */
57 #define number_of(x) (sizeof(x)/sizeof(x[0]))
59 static struct rpc_dtable dtable[] = {
60 { mnt_1_dtable, number_of(mnt_1_dtable) },
61 { mnt_2_dtable, number_of(mnt_2_dtable) },
62 { mnt_3_dtable, number_of(mnt_3_dtable) },
66 * The main dispatch routine.
69 mount_dispatch(struct svc_req *rqstp, SVCXPRT *transp)
71 union mountd_arguments argument;
72 union mountd_results result;
74 #ifdef HAVE_TCP_WRAPPER
75 /* remote host authorization check */
76 if (!check_default("mountd", svc_getcaller(transp),
77 rqstp->rq_proc, MOUNTPROG)) {
78 svcerr_auth (transp, AUTH_FAILED);
83 rpc_dispatch(rqstp, transp, dtable, number_of(dtable),