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
11 int init_socket_xprt(void);
12 void cleanup_socket_xprt(void);
13 unsigned short get_srcport(struct rpc_xprt *);
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)
31 * State of TCP reply receive
38 } __attribute__((packed));
47 * State of TCP transmit queue
54 * Connection of transports
56 unsigned long sock_state;
57 struct delayed_work connect_worker;
58 struct work_struct error_worker;
59 struct work_struct recv_worker;
60 struct mutex recv_mutex;
61 struct sockaddr_storage srcaddr;
62 unsigned short srcport;
66 * UDP socket buffer size parameters
71 struct rpc_timeout tcp_timeout;
74 * Saved socket callback addresses
76 void (*old_data_ready)(struct sock *);
77 void (*old_state_change)(struct sock *);
78 void (*old_write_space)(struct sock *);
79 void (*old_error_report)(struct sock *);
85 #define XPRT_SOCK_CONNECTING 1U
86 #define XPRT_SOCK_DATA_READY (2)
87 #define XPRT_SOCK_UPD_TIMEOUT (3)
88 #define XPRT_SOCK_WAKE_ERROR (4)
89 #define XPRT_SOCK_WAKE_WRITE (5)
90 #define XPRT_SOCK_WAKE_PENDING (6)
91 #define XPRT_SOCK_WAKE_DISCONNECT (7)
93 #endif /* _LINUX_SUNRPC_XPRTSOCK_H */