1 /* SPDX-License-Identifier: GPL-2.0 */
3 * linux/include/linux/sunrpc/xprtsock.h
5 * Declarations for the RPC transport socket provider.
8 #ifndef _LINUX_SUNRPC_XPRTSOCK_H
9 #define _LINUX_SUNRPC_XPRTSOCK_H
13 int init_socket_xprt(void);
14 void cleanup_socket_xprt(void);
16 #define RPC_MIN_RESVPORT (1U)
17 #define RPC_MAX_RESVPORT (65535U)
18 #define RPC_DEF_MIN_RESVPORT (665U)
19 #define RPC_DEF_MAX_RESVPORT (1023U)
31 * State of TCP reply receive
40 unsigned long tcp_copied
,
44 * Connection of transports
46 unsigned long sock_state
;
47 struct delayed_work connect_worker
;
48 struct work_struct recv_worker
;
49 struct mutex recv_mutex
;
50 struct sockaddr_storage srcaddr
;
51 unsigned short srcport
;
54 * UDP socket buffer size parameters
59 struct rpc_timeout tcp_timeout
;
62 * Saved socket callback addresses
64 void (*old_data_ready
)(struct sock
*);
65 void (*old_state_change
)(struct sock
*);
66 void (*old_write_space
)(struct sock
*);
67 void (*old_error_report
)(struct sock
*);
71 * TCP receive state flags
73 #define TCP_RCV_LAST_FRAG (1UL << 0)
74 #define TCP_RCV_COPY_FRAGHDR (1UL << 1)
75 #define TCP_RCV_COPY_XID (1UL << 2)
76 #define TCP_RCV_COPY_DATA (1UL << 3)
77 #define TCP_RCV_READ_CALLDIR (1UL << 4)
78 #define TCP_RCV_COPY_CALLDIR (1UL << 5)
83 #define TCP_RPC_REPLY (1UL << 6)
85 #define XPRT_SOCK_CONNECTING 1U
86 #define XPRT_SOCK_DATA_READY (2)
87 #define XPRT_SOCK_UPD_TIMEOUT (3)
89 #endif /* __KERNEL__ */
91 #endif /* _LINUX_SUNRPC_XPRTSOCK_H */