xprtsock.h 1.6 KB

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