1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 **************************************************************************** 11 ****************************************************************************/ 12 #ifndef SUNRPC_SVC_H 13 #define SUNRPC_SVC_H 14 15 #include <linux/in.h> 16 #include <linux/sunrpc/types.h> 17 #include <linux/sunrpc/xdr.h> 18 #include <linux/sunrpc/svcauth.h> 19 #include <linux/wait.h> 20 #include <linux/mm.h> 21 22 struct svc_serv { 23 struct list_head sv_threads; 24 struct list_head sv_sockets; 25 struct svc_program * sv_program; 26 struct svc_stat * sv_stats; 27 spinlock_t sv_lock; 28 unsigned int sv_nrthreads; 29 unsigned int sv_bufsz; 30 unsigned int sv_xdrsize; 31 32 struct list_head sv_permsocks; 33 struct list_head sv_tempsocks; 34 int sv_tmpcnt; 35 36 char * sv_name; 37 }; 38 39 #define RPCSVC_MAXPAYLOAD (64*1024u) 40 41 #define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2) 42 43 struct svc_program { 44 struct svc_program * pg_next; 45 u32 pg_prog; 46 unsigned int pg_lovers; 47 unsigned int pg_hivers; 48 unsigned int pg_nvers; 49 struct svc_version ** pg_vers; 50 char * pg_name; 51 char * pg_class; 52 struct svc_stat * pg_stats; 53 int (*pg_authenticate)(struct svc_rqst *); 54 }; 55 56 struct svc_version { 57 u32 vs_vers; 58 u32 vs_nproc; 59 struct svc_procedure * vs_proc; 60 u32 vs_xdrsize; 61 62 int (*vs_dispatch)(struct svc_rqst *, u32 *); 63 }; 64 65 typedef int (*svc_procfunc)(struct svc_rqst *, void *argp, void *resp); 66 struct svc_procedure { 67 svc_procfunc pc_func; 68 kxdrproc_t pc_decode; 69 kxdrproc_t pc_encode; 70 kxdrproc_t pc_release; 71 unsigned int pc_argsize; 72 unsigned int pc_ressize; 73 unsigned int pc_count; 74 unsigned int pc_cachetype; 75 unsigned int pc_xdrressize; 76 }; 77 78 typedef void (*svc_thread_fn)(struct svc_rqst *); 79 80 struct svc_serv * svc_create(struct svc_program *, unsigned int); 81 82 #endif 83