2 * rpcmisc Support for RPC startup, dispatching and logging.
4 * Copyright (C) 1995 Olaf Kirch <okir@monad.swb.de>
11 #include <rpc/pmap_clnt.h>
14 # define CONCAT(a,b) a##b
17 # define CONCAT(a,b) a/**/b
18 # define STRING(a) "a"
21 typedef bool_t (*rpcsvc_fn_t)(struct svc_req *, void *argp, void *resp);
26 xdrproc_t xdr_arg_fn; /* argument XDR */
28 xdrproc_t xdr_res_fn; /* result XDR */
33 struct rpc_dentry *entries;
37 #define dtable_ent(func, vers, arg_type, res_type) \
39 (rpcsvc_fn_t)func##_##vers##_svc, \
40 (xdrproc_t)xdr_##arg_type, sizeof(arg_type), \
41 (xdrproc_t)xdr_##res_type, sizeof(res_type), \
44 void nfs_svc_unregister(const rpcprog_t program,
45 const rpcvers_t version);
46 unsigned int nfs_svc_create(char *name, const rpcprog_t program,
47 const rpcvers_t version,
48 void (*dispatch)(struct svc_req *, SVCXPRT *),
50 void rpc_init(char *name, int prog, int vers,
51 void (*dispatch)(struct svc_req *, SVCXPRT *),
53 void rpc_dispatch(struct svc_req *rq, SVCXPRT *xprt,
54 struct rpc_dtable *dtable, int nvers,
55 void *argp, void *resp);
57 extern int _rpcpmstart;
58 extern int _rpcfdtype;
59 extern int _rpcsvcdirty;
61 static inline struct sockaddr_in *nfs_getrpccaller_in(SVCXPRT *xprt)
63 return (struct sockaddr_in *)(char *)svc_getcaller(xprt);
66 static inline struct sockaddr *nfs_getrpccaller(SVCXPRT *xprt)
68 return (struct sockaddr *)(char *)svc_getcaller(xprt);
71 #endif /* RPCMISC_H */