Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 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 | |
| 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 | {} |
| 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 | {} |
| 27 | #else |
| 28 | extern int nfs_dns_resolver_init(void); |
| 29 | extern void nfs_dns_resolver_destroy(void); |
| 30 | extern int nfs_dns_resolver_cache_init(struct net *net); |
| 31 | extern void nfs_dns_resolver_cache_destroy(struct net *net); |
| 32 | #endif |
| 33 | |
| 34 | extern ssize_t nfs_dns_resolve_name(struct net *net, char *name, |
| 35 | size_t namelen, struct sockaddr *sa, size_t salen); |
| 36 | |
| 37 | #endif |