Trond Myklebust | e571cbf | 2009-08-19 18:12:27 -0400 | [diff] [blame] | 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 | |
| 7 | #define NFS_DNS_HOSTNAME_MAXLEN (128) |
| 8 | |
Bryan Schumaker | c2e8139 | 2010-08-11 09:37:53 +0100 | [diff] [blame] | 9 | |
| 10 | #ifdef CONFIG_NFS_USE_KERNEL_DNS |
| 11 | static inline int nfs_dns_resolver_init(void) |
| 12 | { |
| 13 | return 0; |
| 14 | } |
| 15 | |
| 16 | static inline void nfs_dns_resolver_destroy(void) |
| 17 | {} |
Stanislav Kinsbursky | 1b340d0 | 2011-11-25 17:13:04 +0300 | [diff] [blame] | 18 | |
| 19 | static inline int nfs_dns_resolver_cache_init(struct net *net) |
| 20 | { |
| 21 | return 0; |
| 22 | } |
| 23 | |
| 24 | static inline void nfs_dns_resolver_cache_destroy(struct net *net) |
| 25 | {} |
Bryan Schumaker | c2e8139 | 2010-08-11 09:37:53 +0100 | [diff] [blame] | 26 | #else |
Trond Myklebust | e571cbf | 2009-08-19 18:12:27 -0400 | [diff] [blame] | 27 | extern int nfs_dns_resolver_init(void); |
| 28 | extern void nfs_dns_resolver_destroy(void); |
Stanislav Kinsbursky | 1b340d0 | 2011-11-25 17:13:04 +0300 | [diff] [blame] | 29 | extern int nfs_dns_resolver_cache_init(struct net *net); |
| 30 | extern void nfs_dns_resolver_cache_destroy(struct net *net); |
Bryan Schumaker | c2e8139 | 2010-08-11 09:37:53 +0100 | [diff] [blame] | 31 | #endif |
| 32 | |
Stanislav Kinsbursky | 1b340d0 | 2011-11-25 17:13:04 +0300 | [diff] [blame] | 33 | extern ssize_t nfs_dns_resolve_name(struct net *net, char *name, |
| 34 | size_t namelen, struct sockaddr *sa, size_t salen); |
Trond Myklebust | e571cbf | 2009-08-19 18:12:27 -0400 | [diff] [blame] | 35 | |
| 36 | #endif |