1 /* SPDX-License-Identifier: LGPL-2.1 */ 2 /* 3 * DNS Resolver upcall management for CIFS DFS 4 * Handles host name to IP address resolution 5 * 6 * Copyright (c) International Business Machines Corp., 2008 7 * Author(s): Steve French (sfrench@us.ibm.com) 8 * 9 */ 10 11 #ifndef _DNS_RESOLVE_H 12 #define _DNS_RESOLVE_H 13 14 #include <linux/net.h> 15 #include "cifsglob.h" 16 #include "cifsproto.h" 17 18 int dns_resolve_name(const char *dom, const char *name, 19 size_t namelen, struct sockaddr *ip_addr); 20 21 static inline int dns_resolve_unc(const char *dom, const char *unc, 22 struct sockaddr *ip_addr) 23 { 24 const char *name; 25 size_t namelen; 26 27 if (!unc || strlen(unc) < 3) 28 return -EINVAL; 29 30 extract_unc_hostname(unc, &name, &namelen); 31 if (!namelen) 32 return -EINVAL; 33 34 return dns_resolve_name(dom, name, namelen, ip_addr); 35 } 36 37 #endif /* _DNS_RESOLVE_H */ 38