dns_resolve.h 812 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Resolve DNS hostnames into valid ip addresses
  3. */
  4. #ifndef __LINUX_FS_NFS_DNS_RESOLVE_H
  5. #define __LINUX_FS_NFS_DNS_RESOLVE_H
  6. #define NFS_DNS_HOSTNAME_MAXLEN (128)
  7. #ifdef CONFIG_NFS_USE_KERNEL_DNS
  8. static inline int nfs_dns_resolver_init(void)
  9. {
  10. return 0;
  11. }
  12. static inline void nfs_dns_resolver_destroy(void)
  13. {}
  14. static inline int nfs_dns_resolver_cache_init(struct net *net)
  15. {
  16. return 0;
  17. }
  18. static inline void nfs_dns_resolver_cache_destroy(struct net *net)
  19. {}
  20. #else
  21. extern int nfs_dns_resolver_init(void);
  22. extern void nfs_dns_resolver_destroy(void);
  23. extern int nfs_dns_resolver_cache_init(struct net *net);
  24. extern void nfs_dns_resolver_cache_destroy(struct net *net);
  25. #endif
  26. extern ssize_t nfs_dns_resolve_name(struct net *net, char *name,
  27. size_t namelen, struct sockaddr *sa, size_t salen);
  28. #endif