sunrpc.h 927 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /******************************************************************************
  3. (c) 2008 NetApp. All Rights Reserved.
  4. ******************************************************************************/
  5. /*
  6. * Functions and macros used internally by RPC
  7. */
  8. #ifndef _NET_SUNRPC_SUNRPC_H
  9. #define _NET_SUNRPC_SUNRPC_H
  10. #include <linux/net.h>
  11. /*
  12. * Header for dynamically allocated rpc buffers.
  13. */
  14. struct rpc_buffer {
  15. size_t len;
  16. char data[];
  17. };
  18. static inline int sock_is_loopback(struct sock *sk)
  19. {
  20. struct dst_entry *dst;
  21. int loopback = 0;
  22. rcu_read_lock();
  23. dst = rcu_dereference(sk->sk_dst_cache);
  24. if (dst && dst->dev &&
  25. (dst->dev->features & NETIF_F_LOOPBACK))
  26. loopback = 1;
  27. rcu_read_unlock();
  28. return loopback;
  29. }
  30. int rpc_clients_notifier_register(void);
  31. void rpc_clients_notifier_unregister(void);
  32. void auth_domain_cleanup(void);
  33. #endif /* _NET_SUNRPC_SUNRPC_H */