2
* nlm_dispatch This is a generic RPC call dispatcher.
3
* It is loosely based on the dispatch mechanism I
4
* first encountered in the UNFSD source.
6
* Cyopright (C) 1995, Olaf Kirch <okir@monad.swb.de>
18
# define CONCAT(a,b) a##b
19
# define CONCAT3(a,b,c) a##b##c
22
# define CONCAT(a,b) a/**/b
23
# define CONCAT3(a,b,c) a/**/b/**/c
24
# define STRING(a) "a"
28
typedef bool_t (*rpcsvc_fn_t)(struct svc_req *, void *argp, void *resp);
30
typedef bool_t (*rpcsvc_fn_t)();
33
#define table_ent(func, vers, arg_type, res_type) \
35
(rpcsvc_fn_t)CONCAT(func,_svc), vers,\
36
(xdrproc_t)CONCAT(xdr_, arg_type), sizeof(arg_type), \
37
(xdrproc_t)CONCAT(xdr_, res_type), sizeof(res_type), \
39
#define nlm_undef_svc NULL
40
#define xdr_nlm_void xdr_void
42
struct dispatch_entry {
45
unsigned int versions; /* bitmap of versions */
46
xdrproc_t xdr_arg_fn; /* argument XDR */
48
xdrproc_t xdr_res_fn; /* result XDR */
52
void rpc_dispatch(struct svc_req *rq, SVCXPRT *tp,
53
struct dispatch_entry *dtable, int nproc,
54
void *argp, void *resp);
55
void rpc_svcrun(void);
57
#endif /* RPCDISPATCH_H */