| 1 | /* |
|---|
| 2 | * linux/include/linux/sunrpc/clnt.h |
|---|
| 3 | * |
|---|
| 4 | * Declarations for the high-level RPC client interface |
|---|
| 5 | * |
|---|
| 6 | * Copyright (C) 1995, 1996, Olaf Kirch <okir@monad.swb.de> |
|---|
| 7 | */ |
|---|
| 8 | |
|---|
| 9 | #ifndef _LINUX_SUNRPC_CLNT_H |
|---|
| 10 | #define _LINUX_SUNRPC_CLNT_H |
|---|
| 11 | |
|---|
| 12 | #include <asm/types.h> |
|---|
| 13 | |
|---|
| 14 | #include <linux/sunrpc/sched.h> |
|---|
| 15 | #include <linux/sunrpc/xprt.h> |
|---|
| 16 | #include <linux/sunrpc/stats.h> |
|---|
| 17 | #include <linux/sunrpc/timer.h> |
|---|
| 18 | |
|---|
| 19 | /* |
|---|
| 20 | * This defines an RPC port mapping |
|---|
| 21 | */ |
|---|
| 22 | struct rpc_portmap { |
|---|
| 23 | __u32 pm_prog; |
|---|
| 24 | __u32 pm_vers; |
|---|
| 25 | __u32 pm_prot; |
|---|
| 26 | __u16 pm_port; |
|---|
| 27 | unsigned char pm_binding : 1; /* doing a getport() */ |
|---|
| 28 | struct rpc_wait_queue pm_bindwait; /* waiting on getport() */ |
|---|
| 29 | }; |
|---|
| 30 | |
|---|
| 31 | struct rpc_inode; |
|---|
| 32 | |
|---|
| 33 | /* |
|---|
| 34 | * The high-level client handle |
|---|
| 35 | */ |
|---|
| 36 | struct rpc_clnt { |
|---|
| 37 | atomic_t cl_count; /* Number of clones */ |
|---|
| 38 | atomic_t cl_users; /* number of references */ |
|---|
| 39 | struct rpc_xprt * cl_xprt; /* transport */ |
|---|
| 40 | struct rpc_procinfo * cl_procinfo; /* procedure info */ |
|---|
| 41 | __u32 cl_maxproc; /* max procedure number */ |
|---|
| 42 | |
|---|
| 43 | char * cl_server; /* server machine name */ |
|---|
| 44 | char * cl_protname; /* protocol name */ |
|---|
| 45 | struct rpc_auth * cl_auth; /* authenticator */ |
|---|
| 46 | struct rpc_stat * cl_stats; /* statistics */ |
|---|
| 47 | |
|---|
| 48 | unsigned int cl_softrtry : 1,/* soft timeouts */ |
|---|
| 49 | cl_intr : 1,/* interruptible */ |
|---|
| 50 | cl_chatty : 1,/* be verbose */ |
|---|
| 51 | cl_autobind : 1,/* use getport() */ |
|---|
| 52 | cl_oneshot : 1,/* dispose after use */ |
|---|
| 53 | cl_dead : 1;/* abandoned */ |
|---|
| 54 | |
|---|
| 55 | struct rpc_rtt * cl_rtt; /* RTO estimator data */ |
|---|
| 56 | struct rpc_portmap * cl_pmap; /* port mapping */ |
|---|
| 57 | |
|---|
| 58 | int cl_nodelen; /* nodename length */ |
|---|
| 59 | char cl_nodename[UNX_MAXNODENAME]; |
|---|
| 60 | char cl_pathname[30];/* Path in rpc_pipe_fs */ |
|---|
| 61 | struct dentry * cl_dentry; /* inode */ |
|---|
| 62 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ |
|---|
| 63 | struct rpc_rtt cl_rtt_default; |
|---|
| 64 | struct rpc_portmap cl_pmap_default; |
|---|
| 65 | char cl_inline_name[32]; |
|---|
| 66 | }; |
|---|
| 67 | #define cl_timeout cl_xprt->timeout |
|---|
| 68 | #define cl_prog cl_pmap->pm_prog |
|---|
| 69 | #define cl_vers cl_pmap->pm_vers |
|---|
| 70 | #define cl_port cl_pmap->pm_port |
|---|
| 71 | #define cl_prot cl_pmap->pm_prot |
|---|
| 72 | |
|---|
| 73 | /* |
|---|
| 74 | * General RPC program info |
|---|
| 75 | */ |
|---|
| 76 | #define RPC_MAXVERSION 4 |
|---|
| 77 | struct rpc_program { |
|---|
| 78 | char * name; /* protocol name */ |
|---|
| 79 | __u32 number; /* program number */ |
|---|
| 80 | unsigned int nrvers; /* number of versions */ |
|---|
| 81 | struct rpc_version ** version; /* version array */ |
|---|
| 82 | struct rpc_stat * stats; /* statistics */ |
|---|
| 83 | char * pipe_dir_name; /* path to rpc_pipefs dir */ |
|---|
| 84 | }; |
|---|
| 85 | |
|---|
| 86 | struct rpc_version { |
|---|
| 87 | __u32 number; /* version number */ |
|---|
| 88 | unsigned int nrprocs; /* number of procs */ |
|---|
| 89 | struct rpc_procinfo * procs; /* procedure array */ |
|---|
| 90 | }; |
|---|
| 91 | |
|---|
| 92 | /* |
|---|
| 93 | * Procedure information |
|---|
| 94 | */ |
|---|
| 95 | struct rpc_procinfo { |
|---|
| 96 | __u32 p_proc; /* RPC procedure number */ |
|---|
| 97 | kxdrproc_t p_encode; /* XDR encode function */ |
|---|
| 98 | kxdrproc_t p_decode; /* XDR decode function */ |
|---|
| 99 | unsigned int p_bufsiz; /* req. buffer size */ |
|---|
| 100 | unsigned int p_count; /* call count */ |
|---|
| 101 | unsigned int p_timer; /* Which RTT timer to use */ |
|---|
| 102 | }; |
|---|
| 103 | |
|---|
| 104 | #define RPC_CONGESTED(clnt) (RPCXPRT_CONGESTED((clnt)->cl_xprt)) |
|---|
| 105 | #define RPC_PEERADDR(clnt) (&(clnt)->cl_xprt->addr) |
|---|
| 106 | |
|---|
| 107 | #endif /* _LINUX_SUNRPC_CLNT_H */ |
|---|