\"Talpey, Thomas\ | 49c36fc | 2007-09-10 13:47:31 -0400 | [diff] [blame] | 1 | /* |
| 2 | * linux/include/linux/sunrpc/xprtsock.h |
| 3 | * |
| 4 | * Declarations for the RPC transport socket provider. |
| 5 | */ |
| 6 | |
| 7 | #ifndef _LINUX_SUNRPC_XPRTSOCK_H |
| 8 | #define _LINUX_SUNRPC_XPRTSOCK_H |
| 9 | |
| 10 | #ifdef __KERNEL__ |
| 11 | |
\"Talpey, Thomas\ | 49c36fc | 2007-09-10 13:47:31 -0400 | [diff] [blame] | 12 | int init_socket_xprt(void); |
| 13 | void cleanup_socket_xprt(void); |
| 14 | |
\"Talpey, Thomas\ | 49c36fc | 2007-09-10 13:47:31 -0400 | [diff] [blame] | 15 | #define RPC_MIN_RESVPORT (1U) |
| 16 | #define RPC_MAX_RESVPORT (65535U) |
| 17 | #define RPC_DEF_MIN_RESVPORT (665U) |
| 18 | #define RPC_DEF_MAX_RESVPORT (1023U) |
| 19 | |
Jeff Layton | 1a867a0 | 2014-10-28 14:24:14 -0400 | [diff] [blame] | 20 | struct sock_xprt { |
| 21 | struct rpc_xprt xprt; |
| 22 | |
| 23 | /* |
| 24 | * Network layer |
| 25 | */ |
| 26 | struct socket * sock; |
| 27 | struct sock * inet; |
| 28 | |
| 29 | /* |
| 30 | * State of TCP reply receive |
| 31 | */ |
| 32 | __be32 tcp_fraghdr, |
| 33 | tcp_xid, |
| 34 | tcp_calldir; |
| 35 | |
| 36 | u32 tcp_offset, |
| 37 | tcp_reclen; |
| 38 | |
| 39 | unsigned long tcp_copied, |
| 40 | tcp_flags; |
| 41 | |
| 42 | /* |
| 43 | * Connection of transports |
| 44 | */ |
| 45 | struct delayed_work connect_worker; |
| 46 | struct sockaddr_storage srcaddr; |
| 47 | unsigned short srcport; |
| 48 | |
| 49 | /* |
| 50 | * UDP socket buffer size parameters |
| 51 | */ |
| 52 | size_t rcvsize, |
| 53 | sndsize; |
| 54 | |
| 55 | /* |
| 56 | * Saved socket callback addresses |
| 57 | */ |
| 58 | void (*old_data_ready)(struct sock *); |
| 59 | void (*old_state_change)(struct sock *); |
| 60 | void (*old_write_space)(struct sock *); |
| 61 | void (*old_error_report)(struct sock *); |
| 62 | }; |
| 63 | |
| 64 | /* |
| 65 | * TCP receive state flags |
| 66 | */ |
| 67 | #define TCP_RCV_LAST_FRAG (1UL << 0) |
| 68 | #define TCP_RCV_COPY_FRAGHDR (1UL << 1) |
| 69 | #define TCP_RCV_COPY_XID (1UL << 2) |
| 70 | #define TCP_RCV_COPY_DATA (1UL << 3) |
| 71 | #define TCP_RCV_READ_CALLDIR (1UL << 4) |
| 72 | #define TCP_RCV_COPY_CALLDIR (1UL << 5) |
| 73 | |
| 74 | /* |
| 75 | * TCP RPC flags |
| 76 | */ |
| 77 | #define TCP_RPC_REPLY (1UL << 6) |
| 78 | |
\"Talpey, Thomas\ | 49c36fc | 2007-09-10 13:47:31 -0400 | [diff] [blame] | 79 | #endif /* __KERNEL__ */ |
| 80 | |
| 81 | #endif /* _LINUX_SUNRPC_XPRTSOCK_H */ |