blob: 07a47ee6f783e449a8f7ec2216a194e81fae10a3 [file] [log] [blame]
David Howells651350d2007-04-26 15:50:17 -07001/* RxRPC kernel service interface definitions
David Howells17926a72007-04-26 15:48:28 -07002 *
David Howells651350d2007-04-26 15:50:17 -07003 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
David Howells17926a72007-04-26 15:48:28 -07004 * Written by David Howells ([email protected])
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#ifndef _NET_RXRPC_H
13#define _NET_RXRPC_H
14
15#include <linux/rxrpc.h>
16
David Howells4de48af2016-08-30 12:00:48 +010017struct key;
18struct sock;
19struct socket;
David Howells651350d2007-04-26 15:50:17 -070020struct rxrpc_call;
21
David Howellsd0016482016-08-30 20:42:14 +010022typedef void (*rxrpc_notify_rx_t)(struct sock *, struct rxrpc_call *,
23 unsigned long);
David Howellse8332512017-08-29 10:18:56 +010024typedef void (*rxrpc_notify_end_tx_t)(struct sock *, struct rxrpc_call *,
25 unsigned long);
David Howells00e90712016-09-08 11:10:12 +010026typedef void (*rxrpc_notify_new_call_t)(struct sock *, struct rxrpc_call *,
27 unsigned long);
28typedef void (*rxrpc_discard_new_call_t)(struct rxrpc_call *, unsigned long);
29typedef void (*rxrpc_user_attach_call_t)(struct rxrpc_call *, unsigned long);
David Howells651350d2007-04-26 15:50:17 -070030
David Howellsd0016482016-08-30 20:42:14 +010031void rxrpc_kernel_new_call_notification(struct socket *,
David Howells00e90712016-09-08 11:10:12 +010032 rxrpc_notify_new_call_t,
33 rxrpc_discard_new_call_t);
Joe Perchescd2cf632013-07-31 17:31:34 -070034struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *,
35 struct sockaddr_rxrpc *,
36 struct key *,
37 unsigned long,
David Howellse754eba62017-06-07 12:40:03 +010038 s64,
David Howellsd0016482016-08-30 20:42:14 +010039 gfp_t,
40 rxrpc_notify_rx_t);
David Howells4de48af2016-08-30 12:00:48 +010041int rxrpc_kernel_send_data(struct socket *, struct rxrpc_call *,
David Howellse8332512017-08-29 10:18:56 +010042 struct msghdr *, size_t,
43 rxrpc_notify_end_tx_t);
David Howellsd0016482016-08-30 20:42:14 +010044int rxrpc_kernel_recv_data(struct socket *, struct rxrpc_call *,
45 void *, size_t, size_t *, bool, u32 *);
David Howells84a4c092017-04-06 10:11:59 +010046bool rxrpc_kernel_abort_call(struct socket *, struct rxrpc_call *,
David Howells5a429762016-09-06 22:19:51 +010047 u32, int, const char *);
David Howells4de48af2016-08-30 12:00:48 +010048void rxrpc_kernel_end_call(struct socket *, struct rxrpc_call *);
David Howells8324f0b2016-08-30 09:49:29 +010049void rxrpc_kernel_get_peer(struct socket *, struct rxrpc_call *,
50 struct sockaddr_rxrpc *);
David Howells00e90712016-09-08 11:10:12 +010051int rxrpc_kernel_charge_accept(struct socket *, rxrpc_notify_rx_t,
52 rxrpc_user_attach_call_t, unsigned long, gfp_t);
David Howellse754eba62017-06-07 12:40:03 +010053void rxrpc_kernel_set_tx_length(struct socket *, struct rxrpc_call *, s64);
David Howells651350d2007-04-26 15:50:17 -070054
David Howells17926a72007-04-26 15:48:28 -070055#endif /* _NET_RXRPC_H */