xref: /openbmc/linux/include/net/af_rxrpc.h (revision 2874c5fd284268364ece81a7bd936f3c8168e567)
1*2874c5fdSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
2651350d1SDavid Howells /* RxRPC kernel service interface definitions
317926a79SDavid Howells  *
4651350d1SDavid Howells  * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
517926a79SDavid Howells  * Written by David Howells (dhowells@redhat.com)
617926a79SDavid Howells  */
717926a79SDavid Howells 
817926a79SDavid Howells #ifndef _NET_RXRPC_H
917926a79SDavid Howells #define _NET_RXRPC_H
1017926a79SDavid Howells 
1117926a79SDavid Howells #include <linux/rxrpc.h>
122070a3e4SDavid Howells #include <linux/ktime.h>
1317926a79SDavid Howells 
144de48af6SDavid Howells struct key;
154de48af6SDavid Howells struct sock;
164de48af6SDavid Howells struct socket;
17651350d1SDavid Howells struct rxrpc_call;
18651350d1SDavid Howells 
19c038a58cSDavid Howells /*
20a25e21f0SDavid Howells  * Debug ID counter for tracing.
21a25e21f0SDavid Howells  */
22a25e21f0SDavid Howells extern atomic_t rxrpc_debug_id;
23a25e21f0SDavid Howells 
24d001648eSDavid Howells typedef void (*rxrpc_notify_rx_t)(struct sock *, struct rxrpc_call *,
25d001648eSDavid Howells 				  unsigned long);
26e833251aSDavid Howells typedef void (*rxrpc_notify_end_tx_t)(struct sock *, struct rxrpc_call *,
27e833251aSDavid Howells 				      unsigned long);
2800e90712SDavid Howells typedef void (*rxrpc_notify_new_call_t)(struct sock *, struct rxrpc_call *,
2900e90712SDavid Howells 					unsigned long);
3000e90712SDavid Howells typedef void (*rxrpc_discard_new_call_t)(struct rxrpc_call *, unsigned long);
3100e90712SDavid Howells typedef void (*rxrpc_user_attach_call_t)(struct rxrpc_call *, unsigned long);
32651350d1SDavid Howells 
33d001648eSDavid Howells void rxrpc_kernel_new_call_notification(struct socket *,
3400e90712SDavid Howells 					rxrpc_notify_new_call_t,
3500e90712SDavid Howells 					rxrpc_discard_new_call_t);
36cd2cf63aSJoe Perches struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *,
37651350d1SDavid Howells 					   struct sockaddr_rxrpc *,
38651350d1SDavid Howells 					   struct key *,
39651350d1SDavid Howells 					   unsigned long,
40e754eba6SDavid Howells 					   s64,
41d001648eSDavid Howells 					   gfp_t,
42a68f4a27SDavid Howells 					   rxrpc_notify_rx_t,
43a25e21f0SDavid Howells 					   bool,
44b960a34bSDavid Howells 					   bool,
45a25e21f0SDavid Howells 					   unsigned int);
464de48af6SDavid Howells int rxrpc_kernel_send_data(struct socket *, struct rxrpc_call *,
47e833251aSDavid Howells 			   struct msghdr *, size_t,
48e833251aSDavid Howells 			   rxrpc_notify_end_tx_t);
49d001648eSDavid Howells int rxrpc_kernel_recv_data(struct socket *, struct rxrpc_call *,
50eb9950ebSDavid Howells 			   struct iov_iter *, bool, u32 *, u16 *);
5184a4c09cSDavid Howells bool rxrpc_kernel_abort_call(struct socket *, struct rxrpc_call *,
525a42976dSDavid Howells 			     u32, int, const char *);
534de48af6SDavid Howells void rxrpc_kernel_end_call(struct socket *, struct rxrpc_call *);
548324f0bcSDavid Howells void rxrpc_kernel_get_peer(struct socket *, struct rxrpc_call *,
558324f0bcSDavid Howells 			   struct sockaddr_rxrpc *);
56f4d15fb6SDavid Howells u64 rxrpc_kernel_get_rtt(struct socket *, struct rxrpc_call *);
5700e90712SDavid Howells int rxrpc_kernel_charge_accept(struct socket *, rxrpc_notify_rx_t,
58a25e21f0SDavid Howells 			       rxrpc_user_attach_call_t, unsigned long, gfp_t,
59a25e21f0SDavid Howells 			       unsigned int);
60e754eba6SDavid Howells void rxrpc_kernel_set_tx_length(struct socket *, struct rxrpc_call *, s64);
614611da30SMarc Dionne bool rxrpc_kernel_check_life(const struct socket *, const struct rxrpc_call *,
624611da30SMarc Dionne 			     u32 *);
637150ceaaSDavid Howells void rxrpc_kernel_probe_life(struct socket *, struct rxrpc_call *);
64e908bcf4SDavid Howells u32 rxrpc_kernel_get_epoch(struct socket *, struct rxrpc_call *);
652070a3e4SDavid Howells bool rxrpc_kernel_get_reply_time(struct socket *, struct rxrpc_call *,
662070a3e4SDavid Howells 				 ktime_t *);
674611da30SMarc Dionne bool rxrpc_kernel_call_is_complete(struct rxrpc_call *);
68bbd172e3SDavid Howells void rxrpc_kernel_set_max_life(struct socket *, struct rxrpc_call *,
69bbd172e3SDavid Howells 			       unsigned long);
70651350d1SDavid Howells 
7117926a79SDavid Howells #endif /* _NET_RXRPC_H */
72