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