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