aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc/clnt.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sunrpc/clnt.h')
-rw-r--r--include/linux/sunrpc/clnt.h43
1 files changed, 40 insertions, 3 deletions
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 37881f1a0bd7..ab3f6e90caa5 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -9,6 +9,10 @@
9#ifndef _LINUX_SUNRPC_CLNT_H 9#ifndef _LINUX_SUNRPC_CLNT_H
10#define _LINUX_SUNRPC_CLNT_H 10#define _LINUX_SUNRPC_CLNT_H
11 11
12#include <linux/socket.h>
13#include <linux/in.h>
14#include <linux/in6.h>
15
12#include <linux/sunrpc/msg_prot.h> 16#include <linux/sunrpc/msg_prot.h>
13#include <linux/sunrpc/sched.h> 17#include <linux/sunrpc/sched.h>
14#include <linux/sunrpc/xprt.h> 18#include <linux/sunrpc/xprt.h>
@@ -17,6 +21,7 @@
17#include <linux/sunrpc/xdr.h> 21#include <linux/sunrpc/xdr.h>
18#include <linux/sunrpc/timer.h> 22#include <linux/sunrpc/timer.h>
19#include <asm/signal.h> 23#include <asm/signal.h>
24#include <linux/path.h>
20 25
21struct rpc_inode; 26struct rpc_inode;
22 27
@@ -50,9 +55,7 @@ struct rpc_clnt {
50 55
51 int cl_nodelen; /* nodename length */ 56 int cl_nodelen; /* nodename length */
52 char cl_nodename[UNX_MAXNODENAME]; 57 char cl_nodename[UNX_MAXNODENAME];
53 char cl_pathname[30];/* Path in rpc_pipe_fs */ 58 struct path cl_path;
54 struct vfsmount * cl_vfsmnt;
55 struct dentry * cl_dentry; /* inode */
56 struct rpc_clnt * cl_parent; /* Points to parent of clones */ 59 struct rpc_clnt * cl_parent; /* Points to parent of clones */
57 struct rpc_rtt cl_rtt_default; 60 struct rpc_rtt cl_rtt_default;
58 struct rpc_timeout cl_timeout_default; 61 struct rpc_timeout cl_timeout_default;
@@ -151,5 +154,39 @@ void rpc_force_rebind(struct rpc_clnt *);
151size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); 154size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t);
152const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); 155const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t);
153 156
157size_t rpc_ntop(const struct sockaddr *, char *, const size_t);
158size_t rpc_pton(const char *, const size_t,
159 struct sockaddr *, const size_t);
160char * rpc_sockaddr2uaddr(const struct sockaddr *);
161size_t rpc_uaddr2sockaddr(const char *, const size_t,
162 struct sockaddr *, const size_t);
163
164static inline unsigned short rpc_get_port(const struct sockaddr *sap)
165{
166 switch (sap->sa_family) {
167 case AF_INET:
168 return ntohs(((struct sockaddr_in *)sap)->sin_port);
169 case AF_INET6:
170 return ntohs(((struct sockaddr_in6 *)sap)->sin6_port);
171 }
172 return 0;
173}
174
175static inline void rpc_set_port(struct sockaddr *sap,
176 const unsigned short port)
177{
178 switch (sap->sa_family) {
179 case AF_INET:
180 ((struct sockaddr_in *)sap)->sin_port = htons(port);
181 break;
182 case AF_INET6:
183 ((struct sockaddr_in6 *)sap)->sin6_port = htons(port);
184 break;
185 }
186}
187
188#define IPV6_SCOPE_DELIMITER '%'
189#define IPV6_SCOPE_ID_LEN sizeof("%nnnnnnnnnn")
190
154#endif /* __KERNEL__ */ 191#endif /* __KERNEL__ */
155#endif /* _LINUX_SUNRPC_CLNT_H */ 192#endif /* _LINUX_SUNRPC_CLNT_H */