aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-02-13 01:43:25 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-02-13 01:43:25 -0500
commitd9bc125caf592b7d081021f32ce5b717efdf70c8 (patch)
tree263b7066ba22ddce21db610c0300f6eaac6f2064 /include/linux/sunrpc
parent43d78ef2ba5bec26d0315859e8324bfc0be23766 (diff)
parentec2f9d1331f658433411c58077871e1eef4ee1b4 (diff)
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Conflicts: net/sunrpc/auth_gss/gss_krb5_crypto.c net/sunrpc/auth_gss/gss_spkm3_token.c net/sunrpc/clnt.c Merge with mainline and fix conflicts.
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r--include/linux/sunrpc/svc.h45
-rw-r--r--include/linux/sunrpc/svcsock.h14
2 files changed, 49 insertions, 10 deletions
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 64f3d60c72af..83b3c7b433aa 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -11,6 +11,7 @@
11#define SUNRPC_SVC_H 11#define SUNRPC_SVC_H
12 12
13#include <linux/in.h> 13#include <linux/in.h>
14#include <linux/in6.h>
14#include <linux/sunrpc/types.h> 15#include <linux/sunrpc/types.h>
15#include <linux/sunrpc/xdr.h> 16#include <linux/sunrpc/xdr.h>
16#include <linux/sunrpc/auth.h> 17#include <linux/sunrpc/auth.h>
@@ -191,7 +192,13 @@ static inline void svc_putu32(struct kvec *iov, __be32 val)
191 iov->iov_len += sizeof(__be32); 192 iov->iov_len += sizeof(__be32);
192} 193}
193 194
194 195union svc_addr_u {
196 struct in_addr addr;
197#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
198 struct in6_addr addr6;
199#endif
200};
201
195/* 202/*
196 * The context of a single thread, including the request currently being 203 * The context of a single thread, including the request currently being
197 * processed. 204 * processed.
@@ -200,8 +207,8 @@ struct svc_rqst {
200 struct list_head rq_list; /* idle list */ 207 struct list_head rq_list; /* idle list */
201 struct list_head rq_all; /* all threads list */ 208 struct list_head rq_all; /* all threads list */
202 struct svc_sock * rq_sock; /* socket */ 209 struct svc_sock * rq_sock; /* socket */
203 struct sockaddr_in rq_addr; /* peer address */ 210 struct sockaddr_storage rq_addr; /* peer address */
204 int rq_addrlen; 211 size_t rq_addrlen;
205 212
206 struct svc_serv * rq_server; /* RPC service definition */ 213 struct svc_serv * rq_server; /* RPC service definition */
207 struct svc_pool * rq_pool; /* thread pool */ 214 struct svc_pool * rq_pool; /* thread pool */
@@ -227,8 +234,8 @@ struct svc_rqst {
227 unsigned short 234 unsigned short
228 rq_secure : 1; /* secure port */ 235 rq_secure : 1; /* secure port */
229 236
230 237 union svc_addr_u rq_daddr; /* dest addr of request
231 __be32 rq_daddr; /* dest addr of request - reply from here */ 238 * - reply from here */
232 239
233 void * rq_argp; /* decoded arguments */ 240 void * rq_argp; /* decoded arguments */
234 void * rq_resp; /* xdr'd results */ 241 void * rq_resp; /* xdr'd results */
@@ -256,6 +263,24 @@ struct svc_rqst {
256}; 263};
257 264
258/* 265/*
266 * Rigorous type checking on sockaddr type conversions
267 */
268static inline struct sockaddr_in *svc_addr_in(struct svc_rqst *rqst)
269{
270 return (struct sockaddr_in *) &rqst->rq_addr;
271}
272
273static inline struct sockaddr_in6 *svc_addr_in6(struct svc_rqst *rqst)
274{
275 return (struct sockaddr_in6 *) &rqst->rq_addr;
276}
277
278static inline struct sockaddr *svc_addr(struct svc_rqst *rqst)
279{
280 return (struct sockaddr *) &rqst->rq_addr;
281}
282
283/*
259 * Check buffer bounds after decoding arguments 284 * Check buffer bounds after decoding arguments
260 */ 285 */
261static inline int 286static inline int
@@ -292,9 +317,10 @@ static inline void svc_free_res_pages(struct svc_rqst *rqstp)
292 317
293struct svc_deferred_req { 318struct svc_deferred_req {
294 u32 prot; /* protocol (UDP or TCP) */ 319 u32 prot; /* protocol (UDP or TCP) */
295 struct sockaddr_in addr; 320 struct svc_sock *svsk;
296 struct svc_sock *svsk; /* where reply must go */ 321 struct sockaddr_storage addr; /* where reply must go */
297 __be32 daddr; /* where reply must come from */ 322 size_t addrlen;
323 union svc_addr_u daddr; /* where reply must come from */
298 struct cache_deferred_req handle; 324 struct cache_deferred_req handle;
299 int argslen; 325 int argslen;
300 __be32 args[0]; 326 __be32 args[0];
@@ -368,5 +394,8 @@ int svc_register(struct svc_serv *, int, unsigned short);
368void svc_wake_up(struct svc_serv *); 394void svc_wake_up(struct svc_serv *);
369void svc_reserve(struct svc_rqst *rqstp, int space); 395void svc_reserve(struct svc_rqst *rqstp, int space);
370struct svc_pool * svc_pool_for_cpu(struct svc_serv *serv, int cpu); 396struct svc_pool * svc_pool_for_cpu(struct svc_serv *serv, int cpu);
397char * svc_print_addr(struct svc_rqst *, char *, size_t);
398
399#define RPC_MAX_ADDRBUFLEN (63U)
371 400
372#endif /* SUNRPC_SVC_H */ 401#endif /* SUNRPC_SVC_H */
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index 98b21ad370fd..cccea0a0feb4 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -57,13 +57,16 @@ struct svc_sock {
57 57
58 /* cache of various info for TCP sockets */ 58 /* cache of various info for TCP sockets */
59 void *sk_info_authunix; 59 void *sk_info_authunix;
60
61 struct sockaddr_storage sk_remote; /* remote peer's address */
62 int sk_remotelen; /* length of address */
60}; 63};
61 64
62/* 65/*
63 * Function prototypes. 66 * Function prototypes.
64 */ 67 */
65int svc_makesock(struct svc_serv *, int, unsigned short); 68int svc_makesock(struct svc_serv *, int, unsigned short, int flags);
66void svc_delete_socket(struct svc_sock *); 69void svc_close_socket(struct svc_sock *);
67int svc_recv(struct svc_rqst *, long); 70int svc_recv(struct svc_rqst *, long);
68int svc_send(struct svc_rqst *); 71int svc_send(struct svc_rqst *);
69void svc_drop(struct svc_rqst *); 72void svc_drop(struct svc_rqst *);
@@ -74,4 +77,11 @@ int svc_addsock(struct svc_serv *serv,
74 char *name_return, 77 char *name_return,
75 int *proto); 78 int *proto);
76 79
80/*
81 * svc_makesock socket characteristics
82 */
83#define SVC_SOCK_DEFAULTS (0U)
84#define SVC_SOCK_ANONYMOUS (1U << 0) /* don't register with pmap */
85#define SVC_SOCK_TEMPORARY (1U << 1) /* flag socket as temporary */
86
77#endif /* SUNRPC_SVCSOCK_H */ 87#endif /* SUNRPC_SVCSOCK_H */