xref: /linux/fs/nfs/dns_resolve.h (revision 7ae9fb1b7ecbb5d85d07857943f677fd1a559b18)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2e571cbf1STrond Myklebust /*
3e571cbf1STrond Myklebust  * Resolve DNS hostnames into valid ip addresses
4e571cbf1STrond Myklebust  */
5e571cbf1STrond Myklebust #ifndef __LINUX_FS_NFS_DNS_RESOLVE_H
6e571cbf1STrond Myklebust #define __LINUX_FS_NFS_DNS_RESOLVE_H
7e571cbf1STrond Myklebust 
8e571cbf1STrond Myklebust #define NFS_DNS_HOSTNAME_MAXLEN	(128)
9e571cbf1STrond Myklebust 
10c2e8139cSBryan Schumaker 
11c2e8139cSBryan Schumaker #ifdef CONFIG_NFS_USE_KERNEL_DNS
nfs_dns_resolver_init(void)12c2e8139cSBryan Schumaker static inline int nfs_dns_resolver_init(void)
13c2e8139cSBryan Schumaker {
14c2e8139cSBryan Schumaker 	return 0;
15c2e8139cSBryan Schumaker }
16c2e8139cSBryan Schumaker 
nfs_dns_resolver_destroy(void)17c2e8139cSBryan Schumaker static inline void nfs_dns_resolver_destroy(void)
18c2e8139cSBryan Schumaker {}
191b340d01SStanislav Kinsbursky 
nfs_dns_resolver_cache_init(struct net * net)201b340d01SStanislav Kinsbursky static inline int nfs_dns_resolver_cache_init(struct net *net)
211b340d01SStanislav Kinsbursky {
221b340d01SStanislav Kinsbursky 	return 0;
231b340d01SStanislav Kinsbursky }
241b340d01SStanislav Kinsbursky 
nfs_dns_resolver_cache_destroy(struct net * net)251b340d01SStanislav Kinsbursky static inline void nfs_dns_resolver_cache_destroy(struct net *net)
261b340d01SStanislav Kinsbursky {}
27c2e8139cSBryan Schumaker #else
28e571cbf1STrond Myklebust extern int nfs_dns_resolver_init(void);
29e571cbf1STrond Myklebust extern void nfs_dns_resolver_destroy(void);
301b340d01SStanislav Kinsbursky extern int nfs_dns_resolver_cache_init(struct net *net);
311b340d01SStanislav Kinsbursky extern void nfs_dns_resolver_cache_destroy(struct net *net);
32c2e8139cSBryan Schumaker #endif
33c2e8139cSBryan Schumaker 
341b340d01SStanislav Kinsbursky extern ssize_t nfs_dns_resolve_name(struct net *net, char *name,
35*cf0d7e7fSKees Cook 		size_t namelen,	struct sockaddr_storage *sa, size_t salen);
36e571cbf1STrond Myklebust 
37e571cbf1STrond Myklebust #endif
38