blob: 2e4f596d2923d5876b685fb9fb8bdc0ed13c2de6 [file] [log] [blame]
Trond Myklebuste571cbf2009-08-19 18:12:27 -04001/*
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
7#define NFS_DNS_HOSTNAME_MAXLEN (128)
8
Bryan Schumakerc2e81392010-08-11 09:37:53 +01009
10#ifdef CONFIG_NFS_USE_KERNEL_DNS
11static inline int nfs_dns_resolver_init(void)
12{
13 return 0;
14}
15
16static inline void nfs_dns_resolver_destroy(void)
17{}
Stanislav Kinsbursky1b340d02011-11-25 17:13:04 +030018
19static inline int nfs_dns_resolver_cache_init(struct net *net)
20{
21 return 0;
22}
23
24static inline void nfs_dns_resolver_cache_destroy(struct net *net)
25{}
Bryan Schumakerc2e81392010-08-11 09:37:53 +010026#else
Trond Myklebuste571cbf2009-08-19 18:12:27 -040027extern int nfs_dns_resolver_init(void);
28extern void nfs_dns_resolver_destroy(void);
Stanislav Kinsbursky1b340d02011-11-25 17:13:04 +030029extern int nfs_dns_resolver_cache_init(struct net *net);
30extern void nfs_dns_resolver_cache_destroy(struct net *net);
Bryan Schumakerc2e81392010-08-11 09:37:53 +010031#endif
32
Stanislav Kinsbursky1b340d02011-11-25 17:13:04 +030033extern ssize_t nfs_dns_resolve_name(struct net *net, char *name,
34 size_t namelen, struct sockaddr *sa, size_t salen);
Trond Myklebuste571cbf2009-08-19 18:12:27 -040035
36#endif