Thomas Gleixner | 1accad5 | 2022-06-07 16:11:20 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Ricardo Labiaga | 55ae1aa | 2009-04-01 09:23:03 -0400 | [diff] [blame] | 2 | /****************************************************************************** |
| 3 | |
| 4 | (c) 2008 NetApp. All Rights Reserved. |
| 5 | |
Ricardo Labiaga | 55ae1aa | 2009-04-01 09:23:03 -0400 | [diff] [blame] | 6 | |
| 7 | ******************************************************************************/ |
| 8 | |
| 9 | /* |
| 10 | * Functions and macros used internally by RPC |
| 11 | */ |
| 12 | |
| 13 | #ifndef _NET_SUNRPC_SUNRPC_H |
| 14 | #define _NET_SUNRPC_SUNRPC_H |
| 15 | |
Benny Halevy | 6951867 | 2009-09-10 12:25:04 +0300 | [diff] [blame] | 16 | #include <linux/net.h> |
| 17 | |
| 18 | /* |
| 19 | * Header for dynamically allocated rpc buffers. |
| 20 | */ |
| 21 | struct rpc_buffer { |
| 22 | size_t len; |
| 23 | char data[]; |
| 24 | }; |
| 25 | |
NeilBrown | ef11ce2 | 2014-05-12 11:22:47 +1000 | [diff] [blame] | 26 | static inline int sock_is_loopback(struct sock *sk) |
| 27 | { |
| 28 | struct dst_entry *dst; |
| 29 | int loopback = 0; |
| 30 | rcu_read_lock(); |
| 31 | dst = rcu_dereference(sk->sk_dst_cache); |
| 32 | if (dst && dst->dev && |
| 33 | (dst->dev->features & NETIF_F_LOOPBACK)) |
| 34 | loopback = 1; |
| 35 | rcu_read_unlock(); |
| 36 | return loopback; |
| 37 | } |
| 38 | |
Stanislav Kinsbursky | 80df9d2 | 2012-01-11 19:18:17 +0400 | [diff] [blame] | 39 | int rpc_clients_notifier_register(void); |
| 40 | void rpc_clients_notifier_unregister(void); |
NeilBrown | f45db2b | 2020-05-22 12:01:32 +1000 | [diff] [blame] | 41 | void auth_domain_cleanup(void); |
Ricardo Labiaga | 55ae1aa | 2009-04-01 09:23:03 -0400 | [diff] [blame] | 42 | #endif /* _NET_SUNRPC_SUNRPC_H */ |