sunrpc.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. struct svc_serv;
  31. struct svc_rqst;
  32. int rpc_clients_notifier_register(void);
  33. void rpc_clients_notifier_unregister(void);
  34. void auth_domain_cleanup(void);
  35. void svc_sock_update_bufs(struct svc_serv *serv);
  36. enum svc_auth_status svc_authenticate(struct svc_rqst *rqstp);
  37. #endif /* _NET_SUNRPC_SUNRPC_H */