xref: /openbmc/linux/include/net/af_rxrpc.h (revision cd2cf63a567fb45be445ccc0aed8e551d86f0314)
1651350d1SDavid Howells /* RxRPC kernel service interface definitions
217926a79SDavid Howells  *
3651350d1SDavid Howells  * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
417926a79SDavid Howells  * Written by David Howells (dhowells@redhat.com)
517926a79SDavid Howells  *
617926a79SDavid Howells  * This program is free software; you can redistribute it and/or
717926a79SDavid Howells  * modify it under the terms of the GNU General Public License
817926a79SDavid Howells  * as published by the Free Software Foundation; either version
917926a79SDavid Howells  * 2 of the License, or (at your option) any later version.
1017926a79SDavid Howells  */
1117926a79SDavid Howells 
1217926a79SDavid Howells #ifndef _NET_RXRPC_H
1317926a79SDavid Howells #define _NET_RXRPC_H
1417926a79SDavid Howells 
1517926a79SDavid Howells #include <linux/rxrpc.h>
1617926a79SDavid Howells 
17651350d1SDavid Howells struct rxrpc_call;
18651350d1SDavid Howells 
19651350d1SDavid Howells /*
20651350d1SDavid Howells  * the mark applied to socket buffers that may be intercepted
21651350d1SDavid Howells  */
22651350d1SDavid Howells enum {
23651350d1SDavid Howells 	RXRPC_SKB_MARK_DATA,		/* data message */
24651350d1SDavid Howells 	RXRPC_SKB_MARK_FINAL_ACK,	/* final ACK received message */
25651350d1SDavid Howells 	RXRPC_SKB_MARK_BUSY,		/* server busy message */
26651350d1SDavid Howells 	RXRPC_SKB_MARK_REMOTE_ABORT,	/* remote abort message */
27651350d1SDavid Howells 	RXRPC_SKB_MARK_NET_ERROR,	/* network error message */
28651350d1SDavid Howells 	RXRPC_SKB_MARK_LOCAL_ERROR,	/* local error message */
29651350d1SDavid Howells 	RXRPC_SKB_MARK_NEW_CALL,	/* local error message */
30651350d1SDavid Howells };
31651350d1SDavid Howells 
32651350d1SDavid Howells typedef void (*rxrpc_interceptor_t)(struct sock *, unsigned long,
33651350d1SDavid Howells 				    struct sk_buff *);
34*cd2cf63aSJoe Perches void rxrpc_kernel_intercept_rx_messages(struct socket *, rxrpc_interceptor_t);
35*cd2cf63aSJoe Perches struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *,
36651350d1SDavid Howells 					   struct sockaddr_rxrpc *,
37651350d1SDavid Howells 					   struct key *,
38651350d1SDavid Howells 					   unsigned long,
39651350d1SDavid Howells 					   gfp_t);
40*cd2cf63aSJoe Perches int rxrpc_kernel_send_data(struct rxrpc_call *, struct msghdr *, size_t);
41*cd2cf63aSJoe Perches void rxrpc_kernel_abort_call(struct rxrpc_call *, u32);
42*cd2cf63aSJoe Perches void rxrpc_kernel_end_call(struct rxrpc_call *);
43*cd2cf63aSJoe Perches bool rxrpc_kernel_is_data_last(struct sk_buff *);
44*cd2cf63aSJoe Perches u32 rxrpc_kernel_get_abort_code(struct sk_buff *);
45*cd2cf63aSJoe Perches int rxrpc_kernel_get_error_number(struct sk_buff *);
46*cd2cf63aSJoe Perches void rxrpc_kernel_data_delivered(struct sk_buff *);
47*cd2cf63aSJoe Perches void rxrpc_kernel_free_skb(struct sk_buff *);
48*cd2cf63aSJoe Perches struct rxrpc_call *rxrpc_kernel_accept_call(struct socket *, unsigned long);
49*cd2cf63aSJoe Perches int rxrpc_kernel_reject_call(struct socket *);
50651350d1SDavid Howells 
5117926a79SDavid Howells #endif /* _NET_RXRPC_H */
52