xref: /openbmc/linux/net/sunrpc/sunrpc.h (revision 1accad5e)
1*1accad5eSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
255ae1aabSRicardo Labiaga /******************************************************************************
355ae1aabSRicardo Labiaga 
455ae1aabSRicardo Labiaga (c) 2008 NetApp.  All Rights Reserved.
555ae1aabSRicardo Labiaga 
655ae1aabSRicardo Labiaga 
755ae1aabSRicardo Labiaga ******************************************************************************/
855ae1aabSRicardo Labiaga 
955ae1aabSRicardo Labiaga /*
1055ae1aabSRicardo Labiaga  * Functions and macros used internally by RPC
1155ae1aabSRicardo Labiaga  */
1255ae1aabSRicardo Labiaga 
1355ae1aabSRicardo Labiaga #ifndef _NET_SUNRPC_SUNRPC_H
1455ae1aabSRicardo Labiaga #define _NET_SUNRPC_SUNRPC_H
1555ae1aabSRicardo Labiaga 
166951867bSBenny Halevy #include <linux/net.h>
176951867bSBenny Halevy 
186951867bSBenny Halevy /*
196951867bSBenny Halevy  * Header for dynamically allocated rpc buffers.
206951867bSBenny Halevy  */
216951867bSBenny Halevy struct rpc_buffer {
226951867bSBenny Halevy 	size_t	len;
236951867bSBenny Halevy 	char	data[];
246951867bSBenny Halevy };
256951867bSBenny Halevy 
sock_is_loopback(struct sock * sk)26ef11ce24SNeilBrown static inline int sock_is_loopback(struct sock *sk)
27ef11ce24SNeilBrown {
28ef11ce24SNeilBrown 	struct dst_entry *dst;
29ef11ce24SNeilBrown 	int loopback = 0;
30ef11ce24SNeilBrown 	rcu_read_lock();
31ef11ce24SNeilBrown 	dst = rcu_dereference(sk->sk_dst_cache);
32ef11ce24SNeilBrown 	if (dst && dst->dev &&
33ef11ce24SNeilBrown 	    (dst->dev->features & NETIF_F_LOOPBACK))
34ef11ce24SNeilBrown 		loopback = 1;
35ef11ce24SNeilBrown 	rcu_read_unlock();
36ef11ce24SNeilBrown 	return loopback;
37ef11ce24SNeilBrown }
38ef11ce24SNeilBrown 
3980df9d20SStanislav Kinsbursky int rpc_clients_notifier_register(void);
4080df9d20SStanislav Kinsbursky void rpc_clients_notifier_unregister(void);
41f45db2b9SNeilBrown void auth_domain_cleanup(void);
4255ae1aabSRicardo Labiaga #endif /* _NET_SUNRPC_SUNRPC_H */
43