blob: 7a0cc2d07cad96ca56f06a1d53a3e4034f6d72c5 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/****************************************************************************
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 Cheng4b29af02012-03-07 16:14:53 -080014
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080015#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 Cheng4b29af02012-03-07 16:14:53 -080021
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080022struct 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 Cheng4b29af02012-03-07 16:14:53 -080031
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080032 struct list_head sv_permsocks;
33 struct list_head sv_tempsocks;
34 int sv_tmpcnt;
Ben Cheng4b29af02012-03-07 16:14:53 -080035
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080036 char * sv_name;
37};
Ben Cheng4b29af02012-03-07 16:14:53 -080038
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080039#define RPCSVC_MAXPAYLOAD (64*1024u)
Ben Cheng4b29af02012-03-07 16:14:53 -080040
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080041#define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2)
Ben Cheng4b29af02012-03-07 16:14:53 -080042
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080043struct 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 Cheng4b29af02012-03-07 16:14:53 -080055
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080056struct svc_version {
57 u32 vs_vers;
58 u32 vs_nproc;
59 struct svc_procedure * vs_proc;
60 u32 vs_xdrsize;
Ben Cheng4b29af02012-03-07 16:14:53 -080061
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080062 int (*vs_dispatch)(struct svc_rqst *, u32 *);
63};
Ben Cheng4b29af02012-03-07 16:14:53 -080064
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080065typedef int (*svc_procfunc)(struct svc_rqst *, void *argp, void *resp);
66struct 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 Cheng4b29af02012-03-07 16:14:53 -080077
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080078typedef void (*svc_thread_fn)(struct svc_rqst *);
Ben Cheng4b29af02012-03-07 16:14:53 -080079
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080080struct svc_serv * svc_create(struct svc_program *, unsigned int);
Ben Cheng4b29af02012-03-07 16:14:53 -080081
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080082#endif