The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 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 |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 14 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 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> |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 21 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 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; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 31 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 32 | struct list_head sv_permsocks; |
| 33 | struct list_head sv_tempsocks; |
| 34 | int sv_tmpcnt; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 35 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 36 | char * sv_name; |
| 37 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 38 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 39 | #define RPCSVC_MAXPAYLOAD (64*1024u) |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 40 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 41 | #define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2) |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 42 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 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 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 55 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 56 | struct svc_version { |
| 57 | u32 vs_vers; |
| 58 | u32 vs_nproc; |
| 59 | struct svc_procedure * vs_proc; |
| 60 | u32 vs_xdrsize; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 61 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 62 | int (*vs_dispatch)(struct svc_rqst *, u32 *); |
| 63 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 64 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 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 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 77 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 78 | typedef void (*svc_thread_fn)(struct svc_rqst *); |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 79 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 80 | struct svc_serv * svc_create(struct svc_program *, unsigned int); |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 81 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 82 | #endif |