af_rxrpc.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /* RxRPC kernel service interface definitions
  3. *
  4. * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  5. * Written by David Howells ([email protected])
  6. */
  7. #ifndef _NET_RXRPC_H
  8. #define _NET_RXRPC_H
  9. #include <linux/rxrpc.h>
  10. #include <linux/ktime.h>
  11. struct key;
  12. struct sock;
  13. struct socket;
  14. struct rxrpc_call;
  15. enum rxrpc_interruptibility {
  16. RXRPC_INTERRUPTIBLE, /* Call is interruptible */
  17. RXRPC_PREINTERRUPTIBLE, /* Call can be cancelled whilst waiting for a slot */
  18. RXRPC_UNINTERRUPTIBLE, /* Call should not be interruptible at all */
  19. };
  20. /*
  21. * Debug ID counter for tracing.
  22. */
  23. extern atomic_t rxrpc_debug_id;
  24. typedef void (*rxrpc_notify_rx_t)(struct sock *, struct rxrpc_call *,
  25. unsigned long);
  26. typedef void (*rxrpc_notify_end_tx_t)(struct sock *, struct rxrpc_call *,
  27. unsigned long);
  28. typedef void (*rxrpc_notify_new_call_t)(struct sock *, struct rxrpc_call *,
  29. unsigned long);
  30. typedef void (*rxrpc_discard_new_call_t)(struct rxrpc_call *, unsigned long);
  31. typedef void (*rxrpc_user_attach_call_t)(struct rxrpc_call *, unsigned long);
  32. void rxrpc_kernel_new_call_notification(struct socket *,
  33. rxrpc_notify_new_call_t,
  34. rxrpc_discard_new_call_t);
  35. struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *,
  36. struct sockaddr_rxrpc *,
  37. struct key *,
  38. unsigned long,
  39. s64,
  40. gfp_t,
  41. rxrpc_notify_rx_t,
  42. bool,
  43. enum rxrpc_interruptibility,
  44. unsigned int);
  45. int rxrpc_kernel_send_data(struct socket *, struct rxrpc_call *,
  46. struct msghdr *, size_t,
  47. rxrpc_notify_end_tx_t);
  48. int rxrpc_kernel_recv_data(struct socket *, struct rxrpc_call *,
  49. struct iov_iter *, size_t *, bool, u32 *, u16 *);
  50. bool rxrpc_kernel_abort_call(struct socket *, struct rxrpc_call *,
  51. u32, int, const char *);
  52. void rxrpc_kernel_end_call(struct socket *, struct rxrpc_call *);
  53. void rxrpc_kernel_get_peer(struct socket *, struct rxrpc_call *,
  54. struct sockaddr_rxrpc *);
  55. bool rxrpc_kernel_get_srtt(struct socket *, struct rxrpc_call *, u32 *);
  56. int rxrpc_kernel_charge_accept(struct socket *, rxrpc_notify_rx_t,
  57. rxrpc_user_attach_call_t, unsigned long, gfp_t,
  58. unsigned int);
  59. void rxrpc_kernel_set_tx_length(struct socket *, struct rxrpc_call *, s64);
  60. bool rxrpc_kernel_check_life(const struct socket *, const struct rxrpc_call *);
  61. u32 rxrpc_kernel_get_epoch(struct socket *, struct rxrpc_call *);
  62. bool rxrpc_kernel_call_is_complete(struct rxrpc_call *);
  63. void rxrpc_kernel_set_max_life(struct socket *, struct rxrpc_call *,
  64. unsigned long);
  65. int rxrpc_sock_set_min_security_level(struct sock *sk, unsigned int val);
  66. #endif /* _NET_RXRPC_H */