blob: 576ff4b54c82a84a1bfff8f970c2e309f40f0744 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Trond Myklebuste571cbf2009-08-19 18:12:27 -04002/*
3 * Resolve DNS hostnames into valid ip addresses
4 */
5#ifndef __LINUX_FS_NFS_DNS_RESOLVE_H
6#define __LINUX_FS_NFS_DNS_RESOLVE_H
7
8#define NFS_DNS_HOSTNAME_MAXLEN (128)
9
Bryan Schumakerc2e81392010-08-11 09:37:53 +010010
11#ifdef CONFIG_NFS_USE_KERNEL_DNS
12static inline int nfs_dns_resolver_init(void)
13{
14 return 0;
15}
16
17static inline void nfs_dns_resolver_destroy(void)
18{}
Stanislav Kinsbursky1b340d02011-11-25 17:13:04 +030019
20static inline int nfs_dns_resolver_cache_init(struct net *net)
21{
22 return 0;
23}
24
25static inline void nfs_dns_resolver_cache_destroy(struct net *net)
26{}
Bryan Schumakerc2e81392010-08-11 09:37:53 +010027#else
Trond Myklebuste571cbf2009-08-19 18:12:27 -040028extern int nfs_dns_resolver_init(void);
29extern void nfs_dns_resolver_destroy(void);
Stanislav Kinsbursky1b340d02011-11-25 17:13:04 +030030extern int nfs_dns_resolver_cache_init(struct net *net);
31extern void nfs_dns_resolver_cache_destroy(struct net *net);
Bryan Schumakerc2e81392010-08-11 09:37:53 +010032#endif
33
Stanislav Kinsbursky1b340d02011-11-25 17:13:04 +030034extern ssize_t nfs_dns_resolve_name(struct net *net, char *name,
35 size_t namelen, struct sockaddr *sa, size_t salen);
Trond Myklebuste571cbf2009-08-19 18:12:27 -040036
37#endif